sudocode 1.0.0 → 1.1.1
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/README.md +222 -0
- package/build.js +75 -0
- package/node_modules/@sudocode-ai/cli/README.md +330 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.d.ts +53 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.js +274 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/feedback-commands.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.d.ts +22 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.js +148 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/init-commands.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.d.ts +45 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.js +310 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/issue-commands.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.d.ts +18 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.js +61 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/query-commands.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.d.ts +22 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.js +136 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/reference-commands.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.d.ts +14 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.js +76 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/relationship-commands.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.d.ts +17 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.js +99 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/server-commands.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.d.ts +38 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.js +321 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/spec-commands.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.d.ts +17 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.js +131 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/status-commands.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.d.ts +24 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.js +416 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/sync-commands.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.d.ts +12 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.js +78 -0
- package/node_modules/@sudocode-ai/cli/dist/cli/update-commands.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli.d.ts +6 -0
- package/node_modules/@sudocode-ai/cli/dist/cli.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/cli.js +426 -0
- package/node_modules/@sudocode-ai/cli/dist/cli.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/db.d.ts +21 -0
- package/node_modules/@sudocode-ai/cli/dist/db.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/db.js +54 -0
- package/node_modules/@sudocode-ai/cli/dist/db.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/export.d.ts +79 -0
- package/node_modules/@sudocode-ai/cli/dist/export.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/export.js +195 -0
- package/node_modules/@sudocode-ai/cli/dist/export.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/filename-generator.d.ts +30 -0
- package/node_modules/@sudocode-ai/cli/dist/filename-generator.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/filename-generator.js +93 -0
- package/node_modules/@sudocode-ai/cli/dist/filename-generator.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/id-generator.d.ts +26 -0
- package/node_modules/@sudocode-ai/cli/dist/id-generator.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/id-generator.js +123 -0
- package/node_modules/@sudocode-ai/cli/dist/id-generator.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/import.d.ts +118 -0
- package/node_modules/@sudocode-ai/cli/dist/import.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/import.js +608 -0
- package/node_modules/@sudocode-ai/cli/dist/import.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/index.d.ts +13 -0
- package/node_modules/@sudocode-ai/cli/dist/index.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/index.js +13 -0
- package/node_modules/@sudocode-ai/cli/dist/index.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/jsonl.d.ts +69 -0
- package/node_modules/@sudocode-ai/cli/dist/jsonl.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/jsonl.js +333 -0
- package/node_modules/@sudocode-ai/cli/dist/jsonl.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/markdown.d.ts +146 -0
- package/node_modules/@sudocode-ai/cli/dist/markdown.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/markdown.js +357 -0
- package/node_modules/@sudocode-ai/cli/dist/markdown.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/migrations.d.ts +23 -0
- package/node_modules/@sudocode-ai/cli/dist/migrations.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/migrations.js +57 -0
- package/node_modules/@sudocode-ai/cli/dist/migrations.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/events.d.ts +53 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/events.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/events.js +108 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/events.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.d.ts +92 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.js +444 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback-anchors.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback.d.ts +76 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback.js +234 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/feedback.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/index.d.ts +10 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/index.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/index.js +10 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/index.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/issues.d.ts +82 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/issues.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/issues.js +411 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/issues.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/references.d.ts +34 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/references.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/references.js +117 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/references.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/relationships.d.ts +57 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/relationships.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/relationships.js +236 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/relationships.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/specs.d.ts +64 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/specs.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/specs.js +290 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/specs.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/tags.d.ts +42 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/tags.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/tags.js +127 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/tags.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/transactions.d.ts +41 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/transactions.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/transactions.js +111 -0
- package/node_modules/@sudocode-ai/cli/dist/operations/transactions.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/sync.d.ts +47 -0
- package/node_modules/@sudocode-ai/cli/dist/sync.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/sync.js +442 -0
- package/node_modules/@sudocode-ai/cli/dist/sync.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/test-schema.d.ts +5 -0
- package/node_modules/@sudocode-ai/cli/dist/test-schema.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/test-schema.js +46 -0
- package/node_modules/@sudocode-ai/cli/dist/test-schema.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/types.d.ts +7 -0
- package/node_modules/@sudocode-ai/cli/dist/types.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/types.js +7 -0
- package/node_modules/@sudocode-ai/cli/dist/types.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/update-checker.d.ts +24 -0
- package/node_modules/@sudocode-ai/cli/dist/update-checker.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/update-checker.js +151 -0
- package/node_modules/@sudocode-ai/cli/dist/update-checker.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/version.d.ts +12 -0
- package/node_modules/@sudocode-ai/cli/dist/version.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/version.js +23 -0
- package/node_modules/@sudocode-ai/cli/dist/version.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/watcher.d.ts +63 -0
- package/node_modules/@sudocode-ai/cli/dist/watcher.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/cli/dist/watcher.js +438 -0
- package/node_modules/@sudocode-ai/cli/dist/watcher.js.map +1 -0
- package/node_modules/@sudocode-ai/cli/package.json +65 -0
- package/node_modules/@sudocode-ai/local-server/README.md +19 -0
- package/node_modules/@sudocode-ai/local-server/dist/cli.d.ts +7 -0
- package/node_modules/@sudocode-ai/local-server/dist/cli.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/cli.js +7 -0
- package/node_modules/@sudocode-ai/local-server/dist/cli.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/engine.d.ts +103 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/engine.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/engine.js +10 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/engine.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/simple-engine.d.ts +190 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/simple-engine.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/simple-engine.js +611 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/simple-engine.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/types.d.ts +116 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/types.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/types.js +10 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/engine/types.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.d.ts +176 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.js +438 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-adapter.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-integration.d.ts +96 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-integration.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-integration.js +96 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/ag-ui-integration.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-code-output-processor.d.ts +321 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-code-output-processor.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-code-output-processor.js +769 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/claude-code-output-processor.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.d.ts +18 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.js +15 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/index.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.d.ts +421 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.js +22 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/output/types.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.d.ts +86 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.js +59 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/builders/claude.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/index.d.ts +15 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/index.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/index.js +15 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/index.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/manager.d.ts +133 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/manager.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/manager.js +10 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/manager.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/simple-manager.d.ts +102 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/simple-manager.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/simple-manager.js +336 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/simple-manager.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/types.d.ts +105 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/types.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/types.js +10 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/types.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/utils.d.ts +53 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/utils.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/utils.js +97 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/process/utils.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/circuit-breaker.d.ts +170 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/circuit-breaker.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/circuit-breaker.js +291 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/circuit-breaker.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/executor.d.ts +109 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/executor.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/executor.js +10 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/executor.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/index.d.ts +14 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/index.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/index.js +15 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/index.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/resilient-executor.d.ts +86 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/resilient-executor.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/resilient-executor.js +261 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/resilient-executor.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/retry.d.ts +161 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/retry.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/retry.js +234 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/retry.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/types.d.ts +226 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/types.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/types.js +30 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/resilience/types.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.d.ts +119 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.js +208 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/event-buffer.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.d.ts +10 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.js +10 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/index.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.d.ts +146 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.js +282 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.d.ts +176 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.js +231 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/index.d.ts +13 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/index.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/index.js +13 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/index.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/linear-orchestrator.d.ts +216 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/linear-orchestrator.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/linear-orchestrator.js +683 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/linear-orchestrator.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/memory-storage.d.ts +54 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/memory-storage.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/memory-storage.js +68 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/memory-storage.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/orchestrator.d.ts +158 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/orchestrator.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/orchestrator.js +9 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/orchestrator.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/types.d.ts +172 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/types.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/types.js +9 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/types.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/utils.d.ts +89 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/utils.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/utils.js +152 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/workflow/utils.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.d.ts +74 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.js +280 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/config.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.d.ts +151 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.js +189 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/git-cli.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.d.ts +16 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.js +15 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/index.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.d.ts +184 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.js +452 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/manager.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.d.ts +90 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.js +42 -0
- package/node_modules/@sudocode-ai/local-server/dist/execution/worktree/types.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/index.d.ts +8 -0
- package/node_modules/@sudocode-ai/local-server/dist/index.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/index.js +356 -0
- package/node_modules/@sudocode-ai/local-server/dist/index.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-C4SmlXoo.js +568 -0
- package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-C4SmlXoo.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/public/assets/index-DE59j7ti.css +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/public/assets/react-vendor-LX0UoTxg.js +60 -0
- package/node_modules/@sudocode-ai/local-server/dist/public/assets/react-vendor-LX0UoTxg.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/public/assets/ui-vendor-_cxVHaqZ.js +54 -0
- package/node_modules/@sudocode-ai/local-server/dist/public/assets/ui-vendor-_cxVHaqZ.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/public/favicon.ico +0 -0
- package/node_modules/@sudocode-ai/local-server/dist/public/index.html +16 -0
- package/node_modules/@sudocode-ai/local-server/dist/public/logo.png +0 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.d.ts +24 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.js +55 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions-stream.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions.d.ts +19 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions.js +267 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/executions.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.d.ts +7 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.js +329 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/feedback.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/issues.d.ts +7 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/issues.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/issues.js +280 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/issues.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.d.ts +7 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.js +308 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/relationships.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/specs.d.ts +7 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/specs.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/specs.js +270 -0
- package/node_modules/@sudocode-ai/local-server/dist/routes/specs.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/db.d.ts +33 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/db.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/db.js +85 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/db.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.d.ts +108 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.js +286 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-lifecycle.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.d.ts +185 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.js +676 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/execution-service.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/executions.d.ts +59 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/executions.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/executions.js +164 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/executions.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/export.d.ts +24 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/export.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/export.js +106 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/export.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/feedback.d.ts +40 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/feedback.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/feedback.js +54 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/feedback.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/issues.d.ts +27 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/issues.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/issues.js +35 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/issues.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.d.ts +108 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.js +212 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-template-engine.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.d.ts +97 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.js +236 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/prompt-templates.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/relationships.d.ts +35 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/relationships.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/relationships.js +42 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/relationships.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/specs.d.ts +27 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/specs.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/specs.js +35 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/specs.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/watcher.d.ts +50 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/watcher.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/watcher.js +69 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/watcher.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/websocket.d.ts +127 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/websocket.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/websocket.js +389 -0
- package/node_modules/@sudocode-ai/local-server/dist/services/websocket.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.d.ts +6 -0
- package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.js +9 -0
- package/node_modules/@sudocode-ai/local-server/dist/utils/sudocode-dir.js.map +1 -0
- package/node_modules/@sudocode-ai/local-server/package.json +72 -0
- package/node_modules/@sudocode-ai/mcp/LICENSE +21 -0
- package/node_modules/@sudocode-ai/mcp/README.md +226 -0
- package/node_modules/@sudocode-ai/mcp/dist/client.d.ts +33 -0
- package/node_modules/@sudocode-ai/mcp/dist/client.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/client.js +159 -0
- package/node_modules/@sudocode-ai/mcp/dist/client.js.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/index.d.ts +6 -0
- package/node_modules/@sudocode-ai/mcp/dist/index.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/index.js +64 -0
- package/node_modules/@sudocode-ai/mcp/dist/index.js.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/server.d.ts +26 -0
- package/node_modules/@sudocode-ai/mcp/dist/server.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/server.js +575 -0
- package/node_modules/@sudocode-ai/mcp/dist/server.js.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.d.ts +41 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.js +21 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/analytics.js.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.d.ts +19 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.js +24 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/feedback.js.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/init.d.ts +17 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/init.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/init.js +15 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/init.js.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/issues.d.ts +44 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/issues.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/issues.js +106 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/issues.js.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/references.d.ts +21 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/references.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/references.js +49 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/references.js.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.d.ts +15 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.js +18 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/relationships.js.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/specs.d.ts +35 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/specs.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/specs.js +85 -0
- package/node_modules/@sudocode-ai/mcp/dist/tools/specs.js.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/types.d.ts +35 -0
- package/node_modules/@sudocode-ai/mcp/dist/types.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/mcp/dist/types.js +21 -0
- package/node_modules/@sudocode-ai/mcp/dist/types.js.map +1 -0
- package/node_modules/@sudocode-ai/mcp/package.json +67 -0
- package/node_modules/@sudocode-ai/types/README.md +7 -0
- package/node_modules/@sudocode-ai/types/dist/schema.d.ts +45 -0
- package/node_modules/@sudocode-ai/types/dist/schema.d.ts.map +1 -0
- package/node_modules/@sudocode-ai/types/dist/schema.js +338 -0
- package/node_modules/@sudocode-ai/types/dist/schema.js.map +1 -0
- package/node_modules/@sudocode-ai/types/package.json +46 -0
- package/package.json +51 -12
- package/index.js +0 -5
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-Sent Events (SSE) Transport Layer
|
|
3
|
+
*
|
|
4
|
+
* Provides real-time streaming of AG-UI events to frontend clients using SSE.
|
|
5
|
+
* Supports connection management, heartbeat, and run-specific event filtering.
|
|
6
|
+
*
|
|
7
|
+
* @module execution/transport/sse-transport
|
|
8
|
+
*/
|
|
9
|
+
import type { Response } from "express";
|
|
10
|
+
/**
|
|
11
|
+
* SSE Event to send to clients
|
|
12
|
+
*
|
|
13
|
+
* Follows the SSE specification format
|
|
14
|
+
*/
|
|
15
|
+
interface SseEvent {
|
|
16
|
+
/** Event type (optional, defaults to 'message') */
|
|
17
|
+
event?: string;
|
|
18
|
+
/** Event data (will be JSON stringified) */
|
|
19
|
+
data: any;
|
|
20
|
+
/** Event ID (optional) */
|
|
21
|
+
id?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* SseTransport - Server-Sent Events transport for AG-UI events
|
|
25
|
+
*
|
|
26
|
+
* Manages SSE connections and streams AG-UI protocol events to connected clients.
|
|
27
|
+
* Supports multiple concurrent connections, heartbeat mechanism, and run-specific filtering.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const transport = new SseTransport();
|
|
32
|
+
*
|
|
33
|
+
* // Handle new connection
|
|
34
|
+
* app.get('/api/events', (req, res) => {
|
|
35
|
+
* const clientId = req.query.clientId as string;
|
|
36
|
+
* const runId = req.query.runId as string | undefined;
|
|
37
|
+
* transport.handleConnection(clientId, res, runId);
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* // Send event to specific client
|
|
41
|
+
* transport.sendToClient('client-123', {
|
|
42
|
+
* event: 'TOOL_CALL_START',
|
|
43
|
+
* data: { type: 'TOOL_CALL_START', toolCallId: 'tool-1' }
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // Broadcast to all clients watching a specific run
|
|
47
|
+
* transport.broadcastToRun('run-123', {
|
|
48
|
+
* event: 'RUN_FINISHED',
|
|
49
|
+
* data: { type: 'RUN_FINISHED', runId: 'run-123' }
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare class SseTransport {
|
|
54
|
+
private clients;
|
|
55
|
+
private heartbeatInterval;
|
|
56
|
+
private readonly HEARTBEAT_INTERVAL_MS;
|
|
57
|
+
/**
|
|
58
|
+
* Create a new SSE transport instance
|
|
59
|
+
*/
|
|
60
|
+
constructor();
|
|
61
|
+
/**
|
|
62
|
+
* Handle a new SSE connection from a client
|
|
63
|
+
*
|
|
64
|
+
* Sets up proper SSE headers, registers the client, and handles cleanup on disconnect.
|
|
65
|
+
*
|
|
66
|
+
* @param clientId - Unique identifier for this client
|
|
67
|
+
* @param res - Express response object
|
|
68
|
+
* @param runId - Optional run ID to filter events
|
|
69
|
+
* @param replayEvents - Optional: buffered events to replay to this client
|
|
70
|
+
*/
|
|
71
|
+
handleConnection(clientId: string, res: Response, runId?: string, replayEvents?: Array<{
|
|
72
|
+
event: string;
|
|
73
|
+
data: any;
|
|
74
|
+
}>): void;
|
|
75
|
+
/**
|
|
76
|
+
* Send an event to a specific client
|
|
77
|
+
*
|
|
78
|
+
* @param clientId - Target client ID
|
|
79
|
+
* @param event - Event to send
|
|
80
|
+
* @returns true if sent successfully, false if client not found
|
|
81
|
+
*/
|
|
82
|
+
sendToClient(clientId: string, event: SseEvent): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Broadcast an event to all connected clients
|
|
85
|
+
*
|
|
86
|
+
* @param event - Event to broadcast
|
|
87
|
+
* @returns Number of clients that received the event
|
|
88
|
+
*/
|
|
89
|
+
broadcast(event: SseEvent): number;
|
|
90
|
+
/**
|
|
91
|
+
* Broadcast an event to all clients watching a specific run
|
|
92
|
+
*
|
|
93
|
+
* @param runId - Target run ID
|
|
94
|
+
* @param event - Event to send
|
|
95
|
+
* @returns Number of clients that received the event
|
|
96
|
+
*/
|
|
97
|
+
broadcastToRun(runId: string, event: SseEvent): number;
|
|
98
|
+
/**
|
|
99
|
+
* Remove a client connection
|
|
100
|
+
*
|
|
101
|
+
* @param clientId - Client to remove
|
|
102
|
+
* @returns true if client was removed, false if not found
|
|
103
|
+
*/
|
|
104
|
+
removeClient(clientId: string): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Get the number of active connections
|
|
107
|
+
*
|
|
108
|
+
* @returns Number of connected clients
|
|
109
|
+
*/
|
|
110
|
+
getClientCount(): number;
|
|
111
|
+
/**
|
|
112
|
+
* Get the number of clients watching a specific run
|
|
113
|
+
*
|
|
114
|
+
* @param runId - Run ID to check
|
|
115
|
+
* @returns Number of clients watching this run
|
|
116
|
+
*/
|
|
117
|
+
getRunClientCount(runId: string): number;
|
|
118
|
+
/**
|
|
119
|
+
* Get all active client IDs
|
|
120
|
+
*
|
|
121
|
+
* @returns Array of client IDs
|
|
122
|
+
*/
|
|
123
|
+
getClientIds(): string[];
|
|
124
|
+
/**
|
|
125
|
+
* Shutdown the transport and close all connections
|
|
126
|
+
*/
|
|
127
|
+
shutdown(): void;
|
|
128
|
+
/**
|
|
129
|
+
* Write an event to a client connection
|
|
130
|
+
*
|
|
131
|
+
* Formats the event according to SSE specification and writes it to the response.
|
|
132
|
+
*
|
|
133
|
+
* @param client - Target client
|
|
134
|
+
* @param event - Event to write
|
|
135
|
+
* @returns true if successful, false if write failed
|
|
136
|
+
*/
|
|
137
|
+
private writeEvent;
|
|
138
|
+
/**
|
|
139
|
+
* Start the heartbeat mechanism
|
|
140
|
+
*
|
|
141
|
+
* Sends periodic ping events to keep connections alive
|
|
142
|
+
*/
|
|
143
|
+
private startHeartbeat;
|
|
144
|
+
}
|
|
145
|
+
export {};
|
|
146
|
+
//# sourceMappingURL=sse-transport.d.ts.map
|
package/node_modules/@sudocode-ai/local-server/dist/execution/transport/sse-transport.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse-transport.d.ts","sourceRoot":"","sources":["../../../src/execution/transport/sse-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAoBxC;;;;GAIG;AACH,UAAU,QAAQ;IAChB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,IAAI,EAAE,GAAG,CAAC;IACV,0BAA0B;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,OAAO,CAAqC;IACpD,OAAO,CAAC,iBAAiB,CAA+B;IACxD,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAS;IAE/C;;OAEG;;IAKH;;;;;;;;;OASG;IACH,gBAAgB,CACd,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,QAAQ,EACb,KAAK,CAAC,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE,CAAC,GACjD,IAAI;IA8CP;;;;;;OAMG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,OAAO;IASxD;;;;;OAKG;IACH,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM;IAYlC;;;;;;OAMG;IACH,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,MAAM;IAgBtD;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAmBvC;;;;OAIG;IACH,cAAc,IAAI,MAAM;IAIxB;;;;;OAKG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAUxC;;;;OAIG;IACH,YAAY,IAAI,MAAM,EAAE;IAIxB;;OAEG;IACH,QAAQ,IAAI,IAAI;IAahB;;;;;;;;OAQG;IACH,OAAO,CAAC,UAAU;IAoDlB;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAavB"}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-Sent Events (SSE) Transport Layer
|
|
3
|
+
*
|
|
4
|
+
* Provides real-time streaming of AG-UI events to frontend clients using SSE.
|
|
5
|
+
* Supports connection management, heartbeat, and run-specific event filtering.
|
|
6
|
+
*
|
|
7
|
+
* @module execution/transport/sse-transport
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* SseTransport - Server-Sent Events transport for AG-UI events
|
|
11
|
+
*
|
|
12
|
+
* Manages SSE connections and streams AG-UI protocol events to connected clients.
|
|
13
|
+
* Supports multiple concurrent connections, heartbeat mechanism, and run-specific filtering.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const transport = new SseTransport();
|
|
18
|
+
*
|
|
19
|
+
* // Handle new connection
|
|
20
|
+
* app.get('/api/events', (req, res) => {
|
|
21
|
+
* const clientId = req.query.clientId as string;
|
|
22
|
+
* const runId = req.query.runId as string | undefined;
|
|
23
|
+
* transport.handleConnection(clientId, res, runId);
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* // Send event to specific client
|
|
27
|
+
* transport.sendToClient('client-123', {
|
|
28
|
+
* event: 'TOOL_CALL_START',
|
|
29
|
+
* data: { type: 'TOOL_CALL_START', toolCallId: 'tool-1' }
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* // Broadcast to all clients watching a specific run
|
|
33
|
+
* transport.broadcastToRun('run-123', {
|
|
34
|
+
* event: 'RUN_FINISHED',
|
|
35
|
+
* data: { type: 'RUN_FINISHED', runId: 'run-123' }
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export class SseTransport {
|
|
40
|
+
clients = new Map();
|
|
41
|
+
heartbeatInterval = null;
|
|
42
|
+
HEARTBEAT_INTERVAL_MS = 30000; // 30 seconds
|
|
43
|
+
/**
|
|
44
|
+
* Create a new SSE transport instance
|
|
45
|
+
*/
|
|
46
|
+
constructor() {
|
|
47
|
+
this.startHeartbeat();
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Handle a new SSE connection from a client
|
|
51
|
+
*
|
|
52
|
+
* Sets up proper SSE headers, registers the client, and handles cleanup on disconnect.
|
|
53
|
+
*
|
|
54
|
+
* @param clientId - Unique identifier for this client
|
|
55
|
+
* @param res - Express response object
|
|
56
|
+
* @param runId - Optional run ID to filter events
|
|
57
|
+
* @param replayEvents - Optional: buffered events to replay to this client
|
|
58
|
+
*/
|
|
59
|
+
handleConnection(clientId, res, runId, replayEvents) {
|
|
60
|
+
// Set SSE headers
|
|
61
|
+
res.setHeader("Content-Type", "text/event-stream");
|
|
62
|
+
res.setHeader("Cache-Control", "no-cache");
|
|
63
|
+
res.setHeader("Connection", "keep-alive");
|
|
64
|
+
res.setHeader("X-Accel-Buffering", "no"); // Disable nginx buffering
|
|
65
|
+
// Enable CORS for SSE (if needed)
|
|
66
|
+
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
67
|
+
// Disable compression for SSE
|
|
68
|
+
res.flushHeaders();
|
|
69
|
+
const client = {
|
|
70
|
+
clientId,
|
|
71
|
+
response: res,
|
|
72
|
+
runId,
|
|
73
|
+
connectedAt: new Date(),
|
|
74
|
+
lastActivity: new Date(),
|
|
75
|
+
};
|
|
76
|
+
this.clients.set(clientId, client);
|
|
77
|
+
// Send initial connection acknowledgment
|
|
78
|
+
this.sendToClient(clientId, {
|
|
79
|
+
event: "connected",
|
|
80
|
+
data: {
|
|
81
|
+
clientId,
|
|
82
|
+
runId,
|
|
83
|
+
timestamp: Date.now(),
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
// Replay buffered events if provided
|
|
87
|
+
if (replayEvents && replayEvents.length > 0) {
|
|
88
|
+
for (const event of replayEvents) {
|
|
89
|
+
this.sendToClient(clientId, event);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// Handle client disconnect
|
|
93
|
+
res.on("close", () => {
|
|
94
|
+
this.removeClient(clientId);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Send an event to a specific client
|
|
99
|
+
*
|
|
100
|
+
* @param clientId - Target client ID
|
|
101
|
+
* @param event - Event to send
|
|
102
|
+
* @returns true if sent successfully, false if client not found
|
|
103
|
+
*/
|
|
104
|
+
sendToClient(clientId, event) {
|
|
105
|
+
const client = this.clients.get(clientId);
|
|
106
|
+
if (!client) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
return this.writeEvent(client, event);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Broadcast an event to all connected clients
|
|
113
|
+
*
|
|
114
|
+
* @param event - Event to broadcast
|
|
115
|
+
* @returns Number of clients that received the event
|
|
116
|
+
*/
|
|
117
|
+
broadcast(event) {
|
|
118
|
+
let sentCount = 0;
|
|
119
|
+
for (const client of this.clients.values()) {
|
|
120
|
+
if (this.writeEvent(client, event)) {
|
|
121
|
+
sentCount++;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return sentCount;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Broadcast an event to all clients watching a specific run
|
|
128
|
+
*
|
|
129
|
+
* @param runId - Target run ID
|
|
130
|
+
* @param event - Event to send
|
|
131
|
+
* @returns Number of clients that received the event
|
|
132
|
+
*/
|
|
133
|
+
broadcastToRun(runId, event) {
|
|
134
|
+
let sentCount = 0;
|
|
135
|
+
let matchingClients = 0;
|
|
136
|
+
for (const client of this.clients.values()) {
|
|
137
|
+
if (client.runId === runId) {
|
|
138
|
+
matchingClients++;
|
|
139
|
+
if (this.writeEvent(client, event)) {
|
|
140
|
+
sentCount++;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return sentCount;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Remove a client connection
|
|
148
|
+
*
|
|
149
|
+
* @param clientId - Client to remove
|
|
150
|
+
* @returns true if client was removed, false if not found
|
|
151
|
+
*/
|
|
152
|
+
removeClient(clientId) {
|
|
153
|
+
const client = this.clients.get(clientId);
|
|
154
|
+
if (!client) {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
// Try to close the response if it's still open
|
|
158
|
+
try {
|
|
159
|
+
if (!client.response.writableEnded) {
|
|
160
|
+
client.response.end();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
// Connection already closed, ignore
|
|
165
|
+
}
|
|
166
|
+
this.clients.delete(clientId);
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Get the number of active connections
|
|
171
|
+
*
|
|
172
|
+
* @returns Number of connected clients
|
|
173
|
+
*/
|
|
174
|
+
getClientCount() {
|
|
175
|
+
return this.clients.size;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Get the number of clients watching a specific run
|
|
179
|
+
*
|
|
180
|
+
* @param runId - Run ID to check
|
|
181
|
+
* @returns Number of clients watching this run
|
|
182
|
+
*/
|
|
183
|
+
getRunClientCount(runId) {
|
|
184
|
+
let count = 0;
|
|
185
|
+
for (const client of this.clients.values()) {
|
|
186
|
+
if (client.runId === runId) {
|
|
187
|
+
count++;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return count;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Get all active client IDs
|
|
194
|
+
*
|
|
195
|
+
* @returns Array of client IDs
|
|
196
|
+
*/
|
|
197
|
+
getClientIds() {
|
|
198
|
+
return Array.from(this.clients.keys());
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Shutdown the transport and close all connections
|
|
202
|
+
*/
|
|
203
|
+
shutdown() {
|
|
204
|
+
// Stop heartbeat
|
|
205
|
+
if (this.heartbeatInterval) {
|
|
206
|
+
clearInterval(this.heartbeatInterval);
|
|
207
|
+
this.heartbeatInterval = null;
|
|
208
|
+
}
|
|
209
|
+
// Close all client connections
|
|
210
|
+
for (const clientId of this.clients.keys()) {
|
|
211
|
+
this.removeClient(clientId);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Write an event to a client connection
|
|
216
|
+
*
|
|
217
|
+
* Formats the event according to SSE specification and writes it to the response.
|
|
218
|
+
*
|
|
219
|
+
* @param client - Target client
|
|
220
|
+
* @param event - Event to write
|
|
221
|
+
* @returns true if successful, false if write failed
|
|
222
|
+
*/
|
|
223
|
+
writeEvent(client, event) {
|
|
224
|
+
try {
|
|
225
|
+
const { response } = client;
|
|
226
|
+
// Check if response is still writable
|
|
227
|
+
if (response.writableEnded || !response.writable) {
|
|
228
|
+
this.removeClient(client.clientId);
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
// Format SSE message
|
|
232
|
+
let message = "";
|
|
233
|
+
// Add event type if specified
|
|
234
|
+
if (event.event) {
|
|
235
|
+
message += `event: ${event.event}\n`;
|
|
236
|
+
}
|
|
237
|
+
// Add event ID if specified
|
|
238
|
+
if (event.id) {
|
|
239
|
+
message += `id: ${event.id}\n`;
|
|
240
|
+
}
|
|
241
|
+
// Add data (JSON stringify if object)
|
|
242
|
+
const dataString = typeof event.data === "string"
|
|
243
|
+
? event.data
|
|
244
|
+
: JSON.stringify(event.data);
|
|
245
|
+
// SSE spec requires data to be on separate lines if multiline
|
|
246
|
+
const dataLines = dataString.split("\n");
|
|
247
|
+
for (const line of dataLines) {
|
|
248
|
+
message += `data: ${line}\n`;
|
|
249
|
+
}
|
|
250
|
+
// SSE messages end with double newline
|
|
251
|
+
message += "\n";
|
|
252
|
+
// Write to response
|
|
253
|
+
response.write(message);
|
|
254
|
+
// Update last activity
|
|
255
|
+
client.lastActivity = new Date();
|
|
256
|
+
return true;
|
|
257
|
+
}
|
|
258
|
+
catch (error) {
|
|
259
|
+
// Connection error, remove client
|
|
260
|
+
this.removeClient(client.clientId);
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Start the heartbeat mechanism
|
|
266
|
+
*
|
|
267
|
+
* Sends periodic ping events to keep connections alive
|
|
268
|
+
*/
|
|
269
|
+
startHeartbeat() {
|
|
270
|
+
this.heartbeatInterval = setInterval(() => {
|
|
271
|
+
const pingEvent = {
|
|
272
|
+
event: "ping",
|
|
273
|
+
data: { timestamp: Date.now() },
|
|
274
|
+
};
|
|
275
|
+
// Send ping to all clients
|
|
276
|
+
for (const client of this.clients.values()) {
|
|
277
|
+
this.writeEvent(client, pingEvent);
|
|
278
|
+
}
|
|
279
|
+
}, this.HEARTBEAT_INTERVAL_MS);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
//# sourceMappingURL=sse-transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse-transport.js","sourceRoot":"","sources":["../../../src/execution/transport/sse-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAoCH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,OAAO,YAAY;IACf,OAAO,GAA2B,IAAI,GAAG,EAAE,CAAC;IAC5C,iBAAiB,GAA0B,IAAI,CAAC;IACvC,qBAAqB,GAAG,KAAK,CAAC,CAAC,aAAa;IAE7D;;OAEG;IACH;QACE,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED;;;;;;;;;OASG;IACH,gBAAgB,CACd,QAAgB,EAChB,GAAa,EACb,KAAc,EACd,YAAkD;QAElD,kBAAkB;QAClB,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;QACnD,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QAC3C,GAAG,CAAC,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAC1C,GAAG,CAAC,SAAS,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC,CAAC,0BAA0B;QAEpE,kCAAkC;QAClC,GAAG,CAAC,SAAS,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;QAElD,8BAA8B;QAC9B,GAAG,CAAC,YAAY,EAAE,CAAC;QAEnB,MAAM,MAAM,GAAc;YACxB,QAAQ;YACR,QAAQ,EAAE,GAAG;YACb,KAAK;YACL,WAAW,EAAE,IAAI,IAAI,EAAE;YACvB,YAAY,EAAE,IAAI,IAAI,EAAE;SACzB,CAAC;QAEF,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAEnC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,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAEjC,8DAA8D;YAC9D,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACzC,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;gBAC7B,OAAO,IAAI,SAAS,IAAI,IAAI,CAAC;YAC/B,CAAC;YAED,uCAAuC;YACvC,OAAO,IAAI,IAAI,CAAC;YAEhB,oBAAoB;YACpB,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAExB,uBAAuB;YACvB,MAAM,CAAC,YAAY,GAAG,IAAI,IAAI,EAAE,CAAC;YAEjC,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,kCAAkC;YAClC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACnC,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED;;;;OAIG;IACK,cAAc;QACpB,IAAI,CAAC,iBAAiB,GAAG,WAAW,CAAC,GAAG,EAAE;YACxC,MAAM,SAAS,GAAa;gBAC1B,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE;aAChC,CAAC;YAEF,2BAA2B;YAC3B,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;gBAC3C,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;YACrC,CAAC;QACH,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACjC,CAAC;CACF"}
|
package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.d.ts
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transport Manager
|
|
3
|
+
*
|
|
4
|
+
* Coordinates between AG-UI adapter and SSE transport layer.
|
|
5
|
+
* Acts as a facade that routes adapter events to appropriate transport methods.
|
|
6
|
+
*
|
|
7
|
+
* @module execution/transport/transport-manager
|
|
8
|
+
*/
|
|
9
|
+
import type { AgUiEventAdapter } from "../output/ag-ui-adapter.js";
|
|
10
|
+
import type { RunStartedEvent, RunFinishedEvent, RunErrorEvent, StepStartedEvent, StepFinishedEvent, ToolCallStartEvent, ToolCallArgsEvent, ToolCallEndEvent, ToolCallResultEvent, TextMessageStartEvent, TextMessageContentEvent, TextMessageEndEvent, StateDeltaEvent, StateSnapshotEvent, CustomEvent } from "@ag-ui/core";
|
|
11
|
+
import { SseTransport } from "./sse-transport.js";
|
|
12
|
+
/**
|
|
13
|
+
* Union type for all AG-UI events
|
|
14
|
+
*/
|
|
15
|
+
export type AgUiEvent = RunStartedEvent | RunFinishedEvent | RunErrorEvent | StepStartedEvent | StepFinishedEvent | ToolCallStartEvent | ToolCallArgsEvent | ToolCallEndEvent | ToolCallResultEvent | TextMessageStartEvent | TextMessageContentEvent | TextMessageEndEvent | StateDeltaEvent | StateSnapshotEvent | CustomEvent;
|
|
16
|
+
/**
|
|
17
|
+
* TransportManager - Coordinates AG-UI events with SSE transport
|
|
18
|
+
*
|
|
19
|
+
* Manages the connection between AG-UI adapters and SSE transport,
|
|
20
|
+
* routing events to appropriate broadcast methods based on run filtering.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const manager = new TransportManager();
|
|
25
|
+
* const adapter = new AgUiEventAdapter('run-123');
|
|
26
|
+
*
|
|
27
|
+
* // Connect adapter to transport
|
|
28
|
+
* manager.connectAdapter(adapter, 'run-123');
|
|
29
|
+
*
|
|
30
|
+
* // Events from adapter are now automatically broadcast via SSE
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare class TransportManager {
|
|
34
|
+
private sseTransport;
|
|
35
|
+
private eventBuffer;
|
|
36
|
+
private adapterListeners;
|
|
37
|
+
private pruneInterval;
|
|
38
|
+
/**
|
|
39
|
+
* Create a new transport manager
|
|
40
|
+
*
|
|
41
|
+
* Initializes the SSE transport layer and event buffer
|
|
42
|
+
*/
|
|
43
|
+
constructor();
|
|
44
|
+
/**
|
|
45
|
+
* Connect AG-UI adapter to SSE transport
|
|
46
|
+
*
|
|
47
|
+
* Subscribes to adapter's event stream and routes events to SSE transport.
|
|
48
|
+
* If runId is provided, events are broadcast only to clients watching that run.
|
|
49
|
+
* Otherwise, events are broadcast to all connected clients.
|
|
50
|
+
*
|
|
51
|
+
* @param adapter - AG-UI event adapter to connect
|
|
52
|
+
* @param runId - Optional run ID for filtering events
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* const adapter = new AgUiEventAdapter('run-123');
|
|
57
|
+
* manager.connectAdapter(adapter, 'run-123');
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
connectAdapter(adapter: AgUiEventAdapter, runId?: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Disconnect AG-UI adapter from transport
|
|
63
|
+
*
|
|
64
|
+
* Removes the adapter's event listener and stops broadcasting its events.
|
|
65
|
+
*
|
|
66
|
+
* @param adapter - AG-UI event adapter to disconnect
|
|
67
|
+
* @returns true if adapter was disconnected, false if not found
|
|
68
|
+
*/
|
|
69
|
+
disconnectAdapter(adapter: AgUiEventAdapter): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Broadcast event to all connected clients
|
|
72
|
+
*
|
|
73
|
+
* @param event - AG-UI event to broadcast
|
|
74
|
+
* @returns Number of clients that received the event
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* manager.broadcast({
|
|
79
|
+
* type: EventType.RUN_STARTED,
|
|
80
|
+
* runId: 'run-123',
|
|
81
|
+
* threadId: 'run-123',
|
|
82
|
+
* timestamp: Date.now()
|
|
83
|
+
* });
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
broadcast(event: AgUiEvent): number;
|
|
87
|
+
/**
|
|
88
|
+
* Broadcast event to clients watching a specific run
|
|
89
|
+
*
|
|
90
|
+
* @param runId - Target run ID
|
|
91
|
+
* @param event - AG-UI event to broadcast
|
|
92
|
+
* @returns Number of clients that received the event
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* manager.broadcastToRun('run-123', {
|
|
97
|
+
* type: EventType.TOOL_CALL_START,
|
|
98
|
+
* toolCallId: 'tool-1',
|
|
99
|
+
* toolCallName: 'Read',
|
|
100
|
+
* timestamp: Date.now()
|
|
101
|
+
* });
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
broadcastToRun(runId: string, event: AgUiEvent): number;
|
|
105
|
+
/**
|
|
106
|
+
* Get underlying SSE transport
|
|
107
|
+
*
|
|
108
|
+
* Provides access to the SSE transport for route handlers
|
|
109
|
+
* that need to manage client connections.
|
|
110
|
+
*
|
|
111
|
+
* @returns SSE transport instance
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```typescript
|
|
115
|
+
* const transport = manager.getSseTransport();
|
|
116
|
+
*
|
|
117
|
+
* // Handle SSE connection in route
|
|
118
|
+
* app.get('/api/events', (req, res) => {
|
|
119
|
+
* transport.handleConnection(clientId, res, runId);
|
|
120
|
+
* });
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
getSseTransport(): SseTransport;
|
|
124
|
+
/**
|
|
125
|
+
* Get number of connected adapters
|
|
126
|
+
*
|
|
127
|
+
* @returns Number of active adapter connections
|
|
128
|
+
*/
|
|
129
|
+
getAdapterCount(): number;
|
|
130
|
+
/**
|
|
131
|
+
* Get buffered events for an execution
|
|
132
|
+
*
|
|
133
|
+
* Returns all events that have been buffered for the specified execution.
|
|
134
|
+
* Useful for replaying events to late-joining clients.
|
|
135
|
+
*
|
|
136
|
+
* @param runId - Target run ID
|
|
137
|
+
* @param fromSequence - Optional: only return events >= this sequence number
|
|
138
|
+
* @returns Array of buffered events
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```typescript
|
|
142
|
+
* const events = manager.getBufferedEvents('run-123');
|
|
143
|
+
* for (const buffered of events) {
|
|
144
|
+
* console.log(buffered.event.type, buffered.sequenceNumber);
|
|
145
|
+
* }
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
getBufferedEvents(runId: string, fromSequence?: number): import("./event-buffer.js").BufferedEvent[];
|
|
149
|
+
/**
|
|
150
|
+
* Check if events are buffered for an execution
|
|
151
|
+
*
|
|
152
|
+
* @param runId - Target run ID
|
|
153
|
+
* @returns true if events are buffered
|
|
154
|
+
*/
|
|
155
|
+
hasBufferedEvents(runId: string): boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Get buffer statistics
|
|
158
|
+
*
|
|
159
|
+
* @returns Buffer statistics
|
|
160
|
+
*/
|
|
161
|
+
getBufferStats(): {
|
|
162
|
+
bufferCount: number;
|
|
163
|
+
totalEvents: number;
|
|
164
|
+
avgEventsPerBuffer: number;
|
|
165
|
+
oldestBuffer: number | null;
|
|
166
|
+
newestBuffer: number | null;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Shutdown transport manager
|
|
170
|
+
*
|
|
171
|
+
* Disconnects all adapters and shuts down SSE transport.
|
|
172
|
+
* Closes all client connections and releases resources.
|
|
173
|
+
*/
|
|
174
|
+
shutdown(): void;
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=transport-manager.d.ts.map
|
package/node_modules/@sudocode-ai/local-server/dist/execution/transport/transport-manager.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport-manager.d.ts","sourceRoot":"","sources":["../../../src/execution/transport/transport-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EACV,eAAe,EACf,gBAA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