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,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pi SDK adapter boundary
|
|
3
|
+
* Zones: pi agent sdk boundary, shared adapters
|
|
4
|
+
* Owns direct pi SDK imports and exposes narrow bridge-facing helpers/types for the extension composition layer
|
|
5
|
+
*/
|
|
6
|
+
import { SettingsManager, } from "@earendil-works/pi-coding-agent";
|
|
7
|
+
function isPiRunMode(value) {
|
|
8
|
+
return (value === "tui" || value === "rpc" || value === "json" || value === "print");
|
|
9
|
+
}
|
|
10
|
+
/** Pi rejects a context captured before session replacement with a stale-context error; this is not a domain failure. */
|
|
11
|
+
export function isPiStaleContextError(error) {
|
|
12
|
+
return (error instanceof Error &&
|
|
13
|
+
(error.message.includes("stale after session") ||
|
|
14
|
+
error.message.includes("stale ctx")));
|
|
15
|
+
}
|
|
16
|
+
export function getExtensionContextMode(ctx) {
|
|
17
|
+
const mode = typeof ctx === "object" && ctx !== null
|
|
18
|
+
? ctx.mode
|
|
19
|
+
: undefined;
|
|
20
|
+
return isPiRunMode(mode) ? mode : undefined;
|
|
21
|
+
}
|
|
22
|
+
export function isExtensionContextPassiveRunMode(ctx) {
|
|
23
|
+
const mode = getExtensionContextMode(ctx);
|
|
24
|
+
return mode === "print" || mode === "json";
|
|
25
|
+
}
|
|
26
|
+
export function canStartPollingInExtensionContext(ctx) {
|
|
27
|
+
return !isExtensionContextPassiveRunMode(ctx);
|
|
28
|
+
}
|
|
29
|
+
export function formatPollingStartBlockedByRunMode(ctx) {
|
|
30
|
+
const mode = getExtensionContextMode(ctx);
|
|
31
|
+
return mode
|
|
32
|
+
? `Telegram polling is unavailable in Pi ${mode} mode. Use /telegram-connect from a long-lived Pi session.`
|
|
33
|
+
: "Telegram polling is unavailable in this Pi run mode.";
|
|
34
|
+
}
|
|
35
|
+
export function getSessionCompactionReason(event) {
|
|
36
|
+
const reason = event && typeof event === "object" && "reason" in event
|
|
37
|
+
? event.reason
|
|
38
|
+
: undefined;
|
|
39
|
+
return reason === "manual" || reason === "threshold" || reason === "overflow"
|
|
40
|
+
? reason
|
|
41
|
+
: "unknown";
|
|
42
|
+
}
|
|
43
|
+
export function createExtensionApiRuntimePorts(api) {
|
|
44
|
+
return {
|
|
45
|
+
sendUserMessage: (content, options) => api.sendUserMessage(content, options),
|
|
46
|
+
exec: (command, args, options) => api.exec(command, args, options),
|
|
47
|
+
getCommands: () => api.getCommands(),
|
|
48
|
+
getThinkingLevel: () => api.getThinkingLevel(),
|
|
49
|
+
setThinkingLevel: (level) => api.setThinkingLevel(level),
|
|
50
|
+
getActiveTools: () => api.getActiveTools(),
|
|
51
|
+
setActiveTools: (names) => api.setActiveTools(names),
|
|
52
|
+
setModel: (model) => api.setModel(model),
|
|
53
|
+
registerCommand: (name, options) => api.registerCommand(name, options),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function readEnabledModels(value) {
|
|
57
|
+
if (value === undefined)
|
|
58
|
+
return undefined;
|
|
59
|
+
if (Array.isArray(value) &&
|
|
60
|
+
value.every((entry) => typeof entry === "string")) {
|
|
61
|
+
return [...value];
|
|
62
|
+
}
|
|
63
|
+
throw new TypeError("Host settings enabledModels must be a string array or undefined.");
|
|
64
|
+
}
|
|
65
|
+
export function normalizeSettingsManager(manager) {
|
|
66
|
+
if (typeof manager !== "object" || manager === null) {
|
|
67
|
+
throw new TypeError("Host settings manager must be an object.");
|
|
68
|
+
}
|
|
69
|
+
const host = manager;
|
|
70
|
+
if (typeof host.flush !== "function") {
|
|
71
|
+
throw new TypeError("Host settings manager must provide flush().");
|
|
72
|
+
}
|
|
73
|
+
const read = typeof host.getEnabledModels === "function"
|
|
74
|
+
? () => host.getEnabledModels.call(host)
|
|
75
|
+
: typeof host.get === "function"
|
|
76
|
+
? () => host.get.call(host, "enabledModels")
|
|
77
|
+
: undefined;
|
|
78
|
+
const write = typeof host.setEnabledModels === "function"
|
|
79
|
+
? (patterns) => host.setEnabledModels.call(host, patterns)
|
|
80
|
+
: typeof host.set === "function"
|
|
81
|
+
? (patterns) => host.set.call(host, "enabledModels", patterns ?? [])
|
|
82
|
+
: undefined;
|
|
83
|
+
if (!read || !write) {
|
|
84
|
+
throw new TypeError("Host settings manager must provide enabled-model read and write capabilities.");
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
reload: async () => {
|
|
88
|
+
await host.reload?.call(host);
|
|
89
|
+
},
|
|
90
|
+
flush: async () => {
|
|
91
|
+
await host.flush.call(host);
|
|
92
|
+
},
|
|
93
|
+
getEnabledModels: () => readEnabledModels(read()),
|
|
94
|
+
setEnabledModels: write,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export async function createSettingsManager(cwd) {
|
|
98
|
+
// Pi returns its legacy settings surface synchronously. Compatible hosts may
|
|
99
|
+
// resolve a generic settings service asynchronously; normalize both once at
|
|
100
|
+
// the SDK boundary instead of leaking host distinctions into menu domains.
|
|
101
|
+
const factory = SettingsManager;
|
|
102
|
+
return normalizeSettingsManager(await factory.create(cwd));
|
|
103
|
+
}
|
|
104
|
+
export function createScopedModelPatternPersister(deps) {
|
|
105
|
+
return async (patterns, ctx) => {
|
|
106
|
+
const settingsManager = await deps.createSettingsManager(ctx.cwd);
|
|
107
|
+
settingsManager.setEnabledModels(patterns.length > 0 ? patterns : undefined);
|
|
108
|
+
await settingsManager.flush();
|
|
109
|
+
deps.clearCachedModelMenuInputs();
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
export function getExtensionContextModel(ctx) {
|
|
113
|
+
return ctx.model;
|
|
114
|
+
}
|
|
115
|
+
export function getExtensionContextCwd(ctx) {
|
|
116
|
+
return ctx.cwd;
|
|
117
|
+
}
|
|
118
|
+
export function getExtensionContextSessionId(ctx) {
|
|
119
|
+
// Minimal hosts and stale contexts may omit a session manager; absence is not an invented ID.
|
|
120
|
+
return ctx?.sessionManager?.getSessionId?.();
|
|
121
|
+
}
|
|
122
|
+
export function isExtensionContextIdle(ctx) {
|
|
123
|
+
return ctx.isIdle();
|
|
124
|
+
}
|
|
125
|
+
export function hasExtensionContextPendingMessages(ctx) {
|
|
126
|
+
return ctx.hasPendingMessages();
|
|
127
|
+
}
|
|
128
|
+
export function compactExtensionContext(ctx, callbacks) {
|
|
129
|
+
return ctx.compact(callbacks);
|
|
130
|
+
}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telegram polling runtime domain helpers
|
|
3
|
+
* Zones: telegram transport, polling runtime
|
|
4
|
+
* Owns polling request builders, stop conditions, and the long-poll loop runtime for Telegram updates
|
|
5
|
+
*/
|
|
6
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
7
|
+
export interface TelegramPollingConfig {
|
|
8
|
+
botToken?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface TelegramUpdate {
|
|
11
|
+
update_id: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const TELEGRAM_GET_UPDATES_CONFLICT_STOP_LIMIT = 10;
|
|
14
|
+
export declare const TELEGRAM_ALLOWED_UPDATES: readonly ["message", "edited_message", "callback_query", "message_reaction", "guest_message"];
|
|
15
|
+
export declare function buildTelegramInitialSyncRequest(): {
|
|
16
|
+
offset: number;
|
|
17
|
+
limit: number;
|
|
18
|
+
timeout: number;
|
|
19
|
+
};
|
|
20
|
+
export declare function buildTelegramLongPollRequest(lastUpdateId?: number): {
|
|
21
|
+
offset?: number;
|
|
22
|
+
limit: number;
|
|
23
|
+
timeout: number;
|
|
24
|
+
allowed_updates: readonly string[];
|
|
25
|
+
};
|
|
26
|
+
export declare function getLatestTelegramUpdateId(updates: readonly TelegramUpdate[]): number | undefined;
|
|
27
|
+
export declare class TelegramPersistentGetUpdatesConflictError extends Error {
|
|
28
|
+
readonly count: number;
|
|
29
|
+
constructor(count: number);
|
|
30
|
+
}
|
|
31
|
+
/** Exponential backoff for non-conflict polling/admission failures. */
|
|
32
|
+
export declare function getTelegramPollingRetryDelayMs(consecutiveFailures: number): number;
|
|
33
|
+
export declare class TelegramGetUpdatesTimeoutError extends Error {
|
|
34
|
+
readonly timeoutMs: number;
|
|
35
|
+
constructor(timeoutMs: number);
|
|
36
|
+
}
|
|
37
|
+
export declare function getTelegramGetUpdatesRequestBudgetMs(body: Record<string, unknown>, graceMs?: number): number;
|
|
38
|
+
export declare function shouldStopTelegramPolling(signalAborted: boolean, error: unknown): boolean;
|
|
39
|
+
export interface TelegramPollingStartState {
|
|
40
|
+
hasBotToken: boolean;
|
|
41
|
+
hasPollingPromise: boolean;
|
|
42
|
+
}
|
|
43
|
+
export type TelegramPollingWorkPhase = "long-poll" | "persisting-journal" | "persisting-offset" | "retrying";
|
|
44
|
+
export type TelegramPollingPhase = "stopped" | "starting" | TelegramPollingWorkPhase;
|
|
45
|
+
export type TelegramPollingStopReason = "not-started" | "requested" | "completed" | "failed" | "persistent-conflict";
|
|
46
|
+
export interface TelegramPollingStateSnapshot {
|
|
47
|
+
phase: TelegramPollingPhase;
|
|
48
|
+
phaseStartedAtMs?: number;
|
|
49
|
+
currentUpdateId?: number;
|
|
50
|
+
startedAtMs?: number;
|
|
51
|
+
stoppedAtMs?: number;
|
|
52
|
+
lastSuccessfulResponseAtMs?: number;
|
|
53
|
+
lastSuccessfulResponseUpdateCount?: number;
|
|
54
|
+
stopReason?: TelegramPollingStopReason;
|
|
55
|
+
}
|
|
56
|
+
export interface TelegramPollingControllerState extends TelegramPollingStateSnapshot {
|
|
57
|
+
pollingPromise?: Promise<void>;
|
|
58
|
+
pollingController?: AbortController;
|
|
59
|
+
}
|
|
60
|
+
export declare function createTelegramPollingControllerState(): TelegramPollingControllerState;
|
|
61
|
+
export declare function createTelegramPollingStateReader(state: TelegramPollingControllerState): () => TelegramPollingStateSnapshot;
|
|
62
|
+
export declare function isTelegramPollingControllerActive(state: TelegramPollingControllerState): boolean;
|
|
63
|
+
export declare function createTelegramPollingActivityReader(state: TelegramPollingControllerState): () => boolean;
|
|
64
|
+
export interface TelegramPollingRuntimeDeps<TContext> extends TelegramRuntimeEventRecorderPort {
|
|
65
|
+
hasBotToken: () => boolean;
|
|
66
|
+
getPollingPromise: () => Promise<void> | undefined;
|
|
67
|
+
setPollingPromise: (promise: Promise<void> | undefined) => void;
|
|
68
|
+
getPollingController: () => AbortController | undefined;
|
|
69
|
+
setPollingController: (controller: AbortController | undefined) => void;
|
|
70
|
+
stopTypingLoop: () => unknown;
|
|
71
|
+
runPollLoop: (ctx: TContext, signal: AbortSignal) => Promise<void>;
|
|
72
|
+
updateStatus: (ctx: TContext, message?: string) => void;
|
|
73
|
+
createAbortController?: () => AbortController;
|
|
74
|
+
getNowMs?: () => number;
|
|
75
|
+
onPollingStateChange?: () => void;
|
|
76
|
+
onPersistentConflict?: (ctx: TContext, count: number) => MaybePromise<void>;
|
|
77
|
+
onPollingStarted?: () => void;
|
|
78
|
+
onPollingStopped?: (reason: TelegramPollingStopReason) => void;
|
|
79
|
+
}
|
|
80
|
+
export type TelegramPollingControllerDeps<TContext> = Omit<TelegramPollingRuntimeDeps<TContext>, "getPollingPromise" | "setPollingPromise" | "getPollingController" | "setPollingController"> & {
|
|
81
|
+
state?: TelegramPollingControllerState;
|
|
82
|
+
};
|
|
83
|
+
export interface TelegramPollingController<TContext> {
|
|
84
|
+
isActive: () => boolean;
|
|
85
|
+
start: (ctx: TContext) => void;
|
|
86
|
+
stop: () => Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
export interface TelegramPollingAdmissionRuntime<TContext> {
|
|
89
|
+
isActive: () => boolean;
|
|
90
|
+
start: (ctx: TContext) => Promise<void>;
|
|
91
|
+
stop: () => Promise<void>;
|
|
92
|
+
}
|
|
93
|
+
export declare function createTelegramPollingAdmissionRuntime<TContext>(deps: {
|
|
94
|
+
polling: TelegramPollingController<TContext>;
|
|
95
|
+
prepareStart?: () => MaybePromise<void>;
|
|
96
|
+
canStart?: (ctx: TContext) => boolean;
|
|
97
|
+
validateStart?: () => void;
|
|
98
|
+
worker: {
|
|
99
|
+
onSessionStart: (ctx: TContext) => Promise<void>;
|
|
100
|
+
};
|
|
101
|
+
}): TelegramPollingAdmissionRuntime<TContext>;
|
|
102
|
+
export interface TelegramDurablePollingRuntimeAssembly<TContext> {
|
|
103
|
+
controller: TelegramPollingController<TContext>;
|
|
104
|
+
admission: TelegramPollingAdmissionRuntime<TContext>;
|
|
105
|
+
}
|
|
106
|
+
export type TelegramDurablePollingRuntimeAssemblyDeps<TUpdate extends TelegramUpdate, TContext> = Omit<TelegramPollingControllerRuntimeDeps<TUpdate, TContext>, "appendUpdateBatch" | "getJournalEntryCount" | "signalUpdateWorker"> & {
|
|
107
|
+
canStart?: (ctx: TContext) => boolean;
|
|
108
|
+
prepareUpdateBatch?: (updates: readonly TUpdate[]) => void;
|
|
109
|
+
journal: {
|
|
110
|
+
appendBatch: (updates: readonly TUpdate[], acceptedThroughUpdateId?: number) => {
|
|
111
|
+
nonExcludedUpdateIds: readonly number[];
|
|
112
|
+
};
|
|
113
|
+
getAcceptedThroughUpdateId: () => number | undefined;
|
|
114
|
+
prepareCursorCutover?: () => MaybePromise<void>;
|
|
115
|
+
getEntryCount: () => number;
|
|
116
|
+
signalWorker: () => void;
|
|
117
|
+
getBootstrapEntryCount: () => number;
|
|
118
|
+
onSessionStart: (ctx: TContext) => Promise<void>;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
/** Own journal-first polling assembly and cursor bootstrap validation. */
|
|
122
|
+
export declare function createTelegramDurablePollingRuntimeAssembly<TUpdate extends TelegramUpdate, TContext>(deps: TelegramDurablePollingRuntimeAssemblyDeps<TUpdate, TContext>): TelegramDurablePollingRuntimeAssembly<TContext>;
|
|
123
|
+
export type TelegramPollingControllerRuntimeDeps<TUpdate extends TelegramUpdate, TContext = unknown> = Omit<TelegramPollLoopRunnerDeps<TUpdate, TContext>, "onPhaseChange" | "onSuccessfulResponse"> & {
|
|
124
|
+
state?: TelegramPollingControllerState;
|
|
125
|
+
hasBotToken: () => boolean;
|
|
126
|
+
stopTypingLoop: () => unknown;
|
|
127
|
+
createAbortController?: () => AbortController;
|
|
128
|
+
getNowMs?: () => number;
|
|
129
|
+
onPollingStateChange?: () => void;
|
|
130
|
+
onPersistentConflict?: (ctx: TContext, count: number) => MaybePromise<void>;
|
|
131
|
+
};
|
|
132
|
+
export declare function createTelegramPollingControllerRuntime<TUpdate extends TelegramUpdate, TContext = unknown>(deps: TelegramPollingControllerRuntimeDeps<TUpdate, TContext>): TelegramPollingController<TContext>;
|
|
133
|
+
export declare function createTelegramPollingController<TContext>(deps: TelegramPollingControllerDeps<TContext>): TelegramPollingController<TContext>;
|
|
134
|
+
export declare function shouldStartTelegramPolling(state: TelegramPollingStartState): boolean;
|
|
135
|
+
export declare function stopTelegramPollingRuntime<TContext>(deps: TelegramPollingRuntimeDeps<TContext>): Promise<void>;
|
|
136
|
+
export declare function startTelegramPollingRuntime<TContext>(ctx: TContext, deps: TelegramPollingRuntimeDeps<TContext>): void;
|
|
137
|
+
export interface TelegramRuntimeEventRecorderPort {
|
|
138
|
+
recordRuntimeEvent?: (category: string, error: unknown, details?: Record<string, unknown>) => void;
|
|
139
|
+
}
|
|
140
|
+
export type TelegramThreadCapabilityMode = "enabled" | "disabled" | "unknown";
|
|
141
|
+
export interface TelegramThreadCapabilityState {
|
|
142
|
+
threadMode?: TelegramThreadCapabilityMode;
|
|
143
|
+
updatedAtMs?: number;
|
|
144
|
+
lastSlot?: string;
|
|
145
|
+
lastReconcileAction?: string;
|
|
146
|
+
}
|
|
147
|
+
export interface TelegramThreadCapabilityRecordView {
|
|
148
|
+
status?: string;
|
|
149
|
+
target?: {
|
|
150
|
+
chatId?: number;
|
|
151
|
+
threadId?: number;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
export interface TelegramThreadCapabilityStore {
|
|
155
|
+
load: () => Promise<void>;
|
|
156
|
+
refresh?: () => Promise<void>;
|
|
157
|
+
persist: () => Promise<void>;
|
|
158
|
+
getBotState: () => TelegramThreadCapabilityState;
|
|
159
|
+
setBotState: (state: TelegramThreadCapabilityState) => void;
|
|
160
|
+
list?: () => TelegramThreadCapabilityRecordView[];
|
|
161
|
+
}
|
|
162
|
+
export interface TelegramThreadCapabilityReaderDeps {
|
|
163
|
+
getAllowedUserId: () => number | undefined;
|
|
164
|
+
callApi: <TResponse>(method: string, body: Record<string, unknown>) => Promise<TResponse>;
|
|
165
|
+
}
|
|
166
|
+
interface TelegramThreadCapabilityLifecycle {
|
|
167
|
+
capture: () => () => boolean;
|
|
168
|
+
invalidate: () => void;
|
|
169
|
+
}
|
|
170
|
+
export interface TelegramStartupThreadCapabilityProbeDeps extends TelegramThreadCapabilityReaderDeps {
|
|
171
|
+
topicTargetStore: TelegramThreadCapabilityStore;
|
|
172
|
+
recordEvent: (category: string, message: unknown, details?: Record<string, unknown>) => void;
|
|
173
|
+
setTopicModeUnavailable: (unavailable: boolean) => void;
|
|
174
|
+
getNowMs?: () => number;
|
|
175
|
+
}
|
|
176
|
+
export interface TelegramThreadCapabilityRuntimeDeps<TContext> extends TelegramThreadCapabilityReaderDeps {
|
|
177
|
+
lifecycle?: TelegramThreadCapabilityLifecycle;
|
|
178
|
+
topicTargetStore: TelegramThreadCapabilityStore;
|
|
179
|
+
ownsLock: (ctx: TContext) => boolean;
|
|
180
|
+
isFollowerRegistered?: () => boolean;
|
|
181
|
+
getPollingStartedWithTelegramBus: () => boolean;
|
|
182
|
+
setPollingStartedWithTelegramBus: (started: boolean) => void;
|
|
183
|
+
setTopicModeUnavailable: (unavailable: boolean) => void;
|
|
184
|
+
suspendLiveThreadTarget?: () => void;
|
|
185
|
+
stopFollowerRegistration: () => void;
|
|
186
|
+
startClassicPolling: (ctx: TContext) => MaybePromise<void>;
|
|
187
|
+
stopClassicPolling: () => MaybePromise<void>;
|
|
188
|
+
startBusPolling: (ctx: TContext) => MaybePromise<void>;
|
|
189
|
+
stopBusPolling: () => MaybePromise<void>;
|
|
190
|
+
startLeaderHealth: () => void;
|
|
191
|
+
stopLeaderHealth: () => void;
|
|
192
|
+
isTopicModeUnavailableError?: (error: unknown) => boolean;
|
|
193
|
+
updateStatus: (ctx: TContext) => void;
|
|
194
|
+
recordEvent: (category: string, message: unknown, details?: Record<string, unknown>) => void;
|
|
195
|
+
getNowMs?: () => number;
|
|
196
|
+
intervalMs?: number;
|
|
197
|
+
}
|
|
198
|
+
export interface TelegramThreadCapabilityMonitor<TContext> {
|
|
199
|
+
start: (ctx: TContext) => void;
|
|
200
|
+
stop: () => void;
|
|
201
|
+
}
|
|
202
|
+
export interface TelegramThreadCapabilityStateRuntime {
|
|
203
|
+
isBusPollingStarted(): boolean;
|
|
204
|
+
setBusPollingStarted(started: boolean): void;
|
|
205
|
+
isTopicModeUnavailable(): boolean;
|
|
206
|
+
setTopicModeUnavailable(unavailable: boolean): void;
|
|
207
|
+
isBusRuntimeEnabled(): boolean;
|
|
208
|
+
shouldForceFreshLeaderThread(): boolean;
|
|
209
|
+
setForceFreshLeaderThread(forceFresh: boolean): void;
|
|
210
|
+
getRequestedThreadName(): string | undefined;
|
|
211
|
+
setRequestedThreadName(threadName: string | undefined): void;
|
|
212
|
+
}
|
|
213
|
+
export type TelegramThreadTargetObservationHandler<TContext> = (ctx: TContext) => Promise<void>;
|
|
214
|
+
export interface TelegramThreadTargetObservationBinding<TContext> {
|
|
215
|
+
handle: TelegramThreadTargetObservationHandler<TContext>;
|
|
216
|
+
set(handler: TelegramThreadTargetObservationHandler<TContext>): void;
|
|
217
|
+
}
|
|
218
|
+
export declare function createTelegramThreadTargetObservationBinding<TContext>(): TelegramThreadTargetObservationBinding<TContext>;
|
|
219
|
+
export interface TelegramThreadAwarePollingPorts<TContext, TOwner> {
|
|
220
|
+
startPolling: (ctx: TContext, options?: {
|
|
221
|
+
forceFreshLeaderThread?: boolean;
|
|
222
|
+
}) => Promise<void>;
|
|
223
|
+
stopPolling: () => Promise<void>;
|
|
224
|
+
registerFollowerWithOwner: (ctx: TContext, owner: TOwner) => Promise<boolean | undefined>;
|
|
225
|
+
restoreFollowerWithOwner: (ctx: TContext, owner: TOwner) => Promise<boolean | undefined>;
|
|
226
|
+
stopFollowerRegistration: () => void;
|
|
227
|
+
}
|
|
228
|
+
/** Classic/leader polling and follower registration controls that thread-aware polling switches between. */
|
|
229
|
+
export interface TelegramThreadAwarePollingControls<TContext, TOwner> {
|
|
230
|
+
startClassicPolling: (ctx: TContext) => MaybePromise<void>;
|
|
231
|
+
stopClassicPolling: () => Promise<void>;
|
|
232
|
+
startBusLeaderPolling: (ctx: TContext) => Promise<void>;
|
|
233
|
+
stopBusLeaderPolling: () => Promise<void>;
|
|
234
|
+
startLeaderHealth: () => void;
|
|
235
|
+
stopLeaderHealth: () => void;
|
|
236
|
+
registerFollowerWithLeader: (ctx: TContext, owner: TOwner) => Promise<boolean | undefined>;
|
|
237
|
+
restoreFollowerWithLeader?: (ctx: TContext, owner: TOwner) => Promise<boolean | undefined>;
|
|
238
|
+
hasRememberedWorkspaceBinding?: (ctx: TContext) => boolean;
|
|
239
|
+
stopFollowerRegistration: () => void;
|
|
240
|
+
isBusRuntimeEnabled: () => boolean;
|
|
241
|
+
isTopicModeUnavailableError: (error: unknown) => boolean;
|
|
242
|
+
}
|
|
243
|
+
export interface TelegramThreadAwarePollingDeps<TContext, TOwner> extends TelegramStartupThreadCapabilityProbeDeps, TelegramThreadAwarePollingControls<TContext, TOwner> {
|
|
244
|
+
lifecycle?: TelegramThreadCapabilityLifecycle;
|
|
245
|
+
getPollingStartedWithTelegramBus: () => boolean;
|
|
246
|
+
setPollingStartedWithTelegramBus: (started: boolean) => void;
|
|
247
|
+
setForceFreshLeaderThreadOnNextStart: (forceFresh: boolean) => void;
|
|
248
|
+
}
|
|
249
|
+
export interface TelegramThreadCapabilityOrchestrationDeps<TContext, TOwner> extends TelegramThreadCapabilityReaderDeps, TelegramThreadAwarePollingControls<TContext, TOwner> {
|
|
250
|
+
state: TelegramThreadCapabilityStateRuntime;
|
|
251
|
+
topicTargetStore: TelegramThreadCapabilityStore;
|
|
252
|
+
ownsLock: (ctx: TContext) => boolean;
|
|
253
|
+
isFollowerRegistered?: () => boolean;
|
|
254
|
+
suspendLiveThreadTarget?: () => void;
|
|
255
|
+
updateStatus: (ctx: TContext) => void;
|
|
256
|
+
recordEvent: (category: string, message: unknown, details?: Record<string, unknown>) => void;
|
|
257
|
+
}
|
|
258
|
+
export interface TelegramThreadCapabilityOrchestration<TContext, TOwner> {
|
|
259
|
+
monitor: TelegramThreadCapabilityMonitor<TContext>;
|
|
260
|
+
observeTarget: TelegramThreadTargetObservationHandler<TContext>;
|
|
261
|
+
pollingPorts: TelegramThreadAwarePollingPorts<TContext, TOwner>;
|
|
262
|
+
}
|
|
263
|
+
export declare function createTelegramThreadCapabilityStateRuntime(): TelegramThreadCapabilityStateRuntime;
|
|
264
|
+
export declare function createTelegramThreadCapabilityOrchestration<TContext, TOwner>(deps: TelegramThreadCapabilityOrchestrationDeps<TContext, TOwner>): TelegramThreadCapabilityOrchestration<TContext, TOwner>;
|
|
265
|
+
export declare function applyTelegramThreadCapability<TContext>(ctx: TContext, threadModeEnabled: boolean, phase: string, deps: TelegramThreadCapabilityRuntimeDeps<TContext>, isCurrent?: () => boolean): Promise<void>;
|
|
266
|
+
export declare function createTelegramThreadAwarePollingPorts<TContext, TOwner>(deps: TelegramThreadAwarePollingDeps<TContext, TOwner>): TelegramThreadAwarePollingPorts<TContext, TOwner>;
|
|
267
|
+
export declare function canProbeTelegramThreadCapability<TContext>(ctx: TContext, deps: Pick<TelegramThreadCapabilityRuntimeDeps<TContext>, "ownsLock" | "isFollowerRegistered">): boolean;
|
|
268
|
+
export declare function createTelegramThreadCapabilityMonitor<TContext>(deps: TelegramThreadCapabilityRuntimeDeps<TContext>): TelegramThreadCapabilityMonitor<TContext>;
|
|
269
|
+
export declare class TelegramPollingBatchValidationError extends Error {
|
|
270
|
+
constructor(message: string);
|
|
271
|
+
}
|
|
272
|
+
export declare class TelegramPollingCursorBootstrapError extends Error {
|
|
273
|
+
constructor(message: string);
|
|
274
|
+
}
|
|
275
|
+
export interface TelegramPollingCursorCutoverDeps {
|
|
276
|
+
getLegacyCursor: () => number | undefined;
|
|
277
|
+
readJournal: () => {
|
|
278
|
+
acceptedThroughUpdateId?: number;
|
|
279
|
+
entries: readonly {
|
|
280
|
+
updateId: number;
|
|
281
|
+
}[];
|
|
282
|
+
};
|
|
283
|
+
publishJournalCursor: (acceptedThroughUpdateId: number) => MaybePromise<void>;
|
|
284
|
+
removeLegacyCursor: () => MaybePromise<void>;
|
|
285
|
+
}
|
|
286
|
+
/** Transfer one legacy config cursor into journal authority before deleting it. */
|
|
287
|
+
export declare function cutOverTelegramPollingCursor(deps: TelegramPollingCursorCutoverDeps): Promise<void>;
|
|
288
|
+
export interface TelegramPollingBatchAdmissionResult {
|
|
289
|
+
updateCount: number;
|
|
290
|
+
latestUpdateId?: number;
|
|
291
|
+
}
|
|
292
|
+
export interface TelegramPollingBatchAdmissionDeps<TUpdate extends TelegramUpdate> extends TelegramRuntimeEventRecorderPort {
|
|
293
|
+
updates: readonly TUpdate[];
|
|
294
|
+
config: TelegramPollingConfig;
|
|
295
|
+
appendBatch: (updates: readonly TUpdate[], acceptedThroughUpdateId?: number) => MaybePromise<unknown>;
|
|
296
|
+
getAcceptedThroughUpdateId?: () => number | undefined;
|
|
297
|
+
persistConfig: (config: TelegramPollingConfig) => Promise<void>;
|
|
298
|
+
signalWorker: () => void;
|
|
299
|
+
onPhaseChange?: (phase: TelegramPollingWorkPhase, currentUpdateId?: number) => void;
|
|
300
|
+
}
|
|
301
|
+
export declare function admitTelegramPollingUpdateBatch<TUpdate extends TelegramUpdate>(deps: TelegramPollingBatchAdmissionDeps<TUpdate>): Promise<TelegramPollingBatchAdmissionResult>;
|
|
302
|
+
/** Bot API, journal and progress ports shared by one poll loop and its restartable runner. */
|
|
303
|
+
export interface TelegramPollLoopTransportPorts<TUpdate extends TelegramUpdate> extends TelegramRuntimeEventRecorderPort {
|
|
304
|
+
deleteWebhook: (signal: AbortSignal) => Promise<unknown>;
|
|
305
|
+
getUpdates: (body: Record<string, unknown>, signal: AbortSignal) => Promise<TUpdate[]>;
|
|
306
|
+
getUpdatesRequestBudgetMs?: (body: Record<string, unknown>) => number;
|
|
307
|
+
persistConfig: (config: TelegramPollingConfig) => Promise<void>;
|
|
308
|
+
appendUpdateBatch: (updates: readonly TUpdate[], acceptedThroughUpdateId?: number) => MaybePromise<unknown>;
|
|
309
|
+
getAcceptedThroughUpdateId?: () => number | undefined;
|
|
310
|
+
getJournalEntryCount: () => number;
|
|
311
|
+
signalUpdateWorker: () => void;
|
|
312
|
+
onPhaseChange?: (phase: TelegramPollingWorkPhase, currentUpdateId?: number) => void;
|
|
313
|
+
onSuccessfulResponse?: (updateCount: number) => void;
|
|
314
|
+
}
|
|
315
|
+
export interface TelegramPollLoopDeps<TUpdate extends TelegramUpdate, TContext = unknown> extends TelegramPollLoopTransportPorts<TUpdate> {
|
|
316
|
+
ctx: TContext;
|
|
317
|
+
signal: AbortSignal;
|
|
318
|
+
config: TelegramPollingConfig;
|
|
319
|
+
onErrorStatus: (message: string) => void;
|
|
320
|
+
onStatusReset: () => void;
|
|
321
|
+
sleep: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
322
|
+
}
|
|
323
|
+
export interface TelegramPollLoopRunnerDeps<TUpdate extends TelegramUpdate, TContext = unknown> extends TelegramPollLoopTransportPorts<TUpdate> {
|
|
324
|
+
getConfig: () => TelegramPollingConfig;
|
|
325
|
+
updateStatus: (ctx: TContext, message?: string) => void;
|
|
326
|
+
sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
327
|
+
}
|
|
328
|
+
export declare function sleepTelegramPollingRetry(ms: number, signal?: AbortSignal): Promise<void>;
|
|
329
|
+
export declare function createTelegramPollLoopRunner<TUpdate extends TelegramUpdate, TContext = unknown>(deps: TelegramPollLoopRunnerDeps<TUpdate, TContext>): (ctx: TContext, signal: AbortSignal) => Promise<void>;
|
|
330
|
+
export declare function isTelegramGetUpdatesConflictError(error: unknown): boolean;
|
|
331
|
+
export declare function runTelegramPollLoop<TUpdate extends TelegramUpdate, TContext = unknown>(deps: TelegramPollLoopDeps<TUpdate, TContext>): Promise<void>;
|
|
332
|
+
export {};
|