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,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resilience Layer Types
|
|
3
|
+
*
|
|
4
|
+
* Core types for the Resilience Layer (Layer 3) that adds retry logic,
|
|
5
|
+
* circuit breakers, and fault tolerance to task execution.
|
|
6
|
+
*
|
|
7
|
+
* @module execution/resilience/types
|
|
8
|
+
*/
|
|
9
|
+
import type { ExecutionResult } from '../engine/types.js';
|
|
10
|
+
/**
|
|
11
|
+
* RetryPolicy - Configuration for retry behavior
|
|
12
|
+
*/
|
|
13
|
+
export interface RetryPolicy {
|
|
14
|
+
/**
|
|
15
|
+
* Maximum number of retry attempts (0 = no retry)
|
|
16
|
+
*/
|
|
17
|
+
maxAttempts: number;
|
|
18
|
+
/**
|
|
19
|
+
* Backoff strategy configuration
|
|
20
|
+
*/
|
|
21
|
+
backoff: {
|
|
22
|
+
/**
|
|
23
|
+
* Type of backoff strategy
|
|
24
|
+
* - exponential: delay = baseDelay * 2^(attempt-1)
|
|
25
|
+
* - linear: delay = baseDelay * attempt
|
|
26
|
+
* - fixed: delay = baseDelay (constant)
|
|
27
|
+
*/
|
|
28
|
+
type: 'exponential' | 'linear' | 'fixed';
|
|
29
|
+
/**
|
|
30
|
+
* Initial delay in milliseconds
|
|
31
|
+
*/
|
|
32
|
+
baseDelayMs: number;
|
|
33
|
+
/**
|
|
34
|
+
* Maximum delay cap in milliseconds
|
|
35
|
+
*/
|
|
36
|
+
maxDelayMs: number;
|
|
37
|
+
/**
|
|
38
|
+
* Add randomness to prevent thundering herd
|
|
39
|
+
* Adds ±10% jitter to delay
|
|
40
|
+
*/
|
|
41
|
+
jitter: boolean;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Error types/messages that should trigger a retry
|
|
45
|
+
* Examples: 'ECONNREFUSED', 'timeout', 'network'
|
|
46
|
+
*/
|
|
47
|
+
retryableErrors: string[];
|
|
48
|
+
/**
|
|
49
|
+
* Exit codes that should trigger a retry
|
|
50
|
+
* Examples: [1, 137] for generic error and SIGKILL
|
|
51
|
+
*/
|
|
52
|
+
retryableExitCodes: number[];
|
|
53
|
+
/**
|
|
54
|
+
* Optional callback to determine if circuit breaker should open
|
|
55
|
+
*/
|
|
56
|
+
shouldOpenCircuit?: (error: Error, attempts: number) => boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* CircuitState - State of a circuit breaker
|
|
60
|
+
*/
|
|
61
|
+
export type CircuitState = 'closed' | 'open' | 'half-open';
|
|
62
|
+
/**
|
|
63
|
+
* CircuitBreaker - Circuit breaker for preventing cascading failures
|
|
64
|
+
*/
|
|
65
|
+
export interface CircuitBreaker {
|
|
66
|
+
/**
|
|
67
|
+
* Unique name for this circuit breaker
|
|
68
|
+
* Typically matches the task type (e.g., 'issue', 'spec', 'custom')
|
|
69
|
+
*/
|
|
70
|
+
name: string;
|
|
71
|
+
/**
|
|
72
|
+
* Current state of the circuit
|
|
73
|
+
* - closed: Normal operation, requests pass through
|
|
74
|
+
* - open: Too many failures, requests rejected
|
|
75
|
+
* - half-open: Testing if service recovered, limited requests allowed
|
|
76
|
+
*/
|
|
77
|
+
state: CircuitState;
|
|
78
|
+
/**
|
|
79
|
+
* Circuit breaker configuration
|
|
80
|
+
*/
|
|
81
|
+
config: {
|
|
82
|
+
/**
|
|
83
|
+
* Number of consecutive failures before opening circuit
|
|
84
|
+
*/
|
|
85
|
+
failureThreshold: number;
|
|
86
|
+
/**
|
|
87
|
+
* Number of consecutive successes in half-open to close circuit
|
|
88
|
+
*/
|
|
89
|
+
successThreshold: number;
|
|
90
|
+
/**
|
|
91
|
+
* Time to wait before transitioning from open to half-open (ms)
|
|
92
|
+
*/
|
|
93
|
+
timeout: number;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Circuit breaker metrics
|
|
97
|
+
*/
|
|
98
|
+
metrics: {
|
|
99
|
+
/**
|
|
100
|
+
* Total requests processed
|
|
101
|
+
*/
|
|
102
|
+
totalRequests: number;
|
|
103
|
+
/**
|
|
104
|
+
* Total failed requests
|
|
105
|
+
*/
|
|
106
|
+
failedRequests: number;
|
|
107
|
+
/**
|
|
108
|
+
* Total successful requests
|
|
109
|
+
*/
|
|
110
|
+
successfulRequests: number;
|
|
111
|
+
/**
|
|
112
|
+
* Timestamp of last failure
|
|
113
|
+
*/
|
|
114
|
+
lastFailureTime?: Date;
|
|
115
|
+
/**
|
|
116
|
+
* Timestamp of last success
|
|
117
|
+
*/
|
|
118
|
+
lastSuccessTime?: Date;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* ExecutionAttempt - Record of a single execution attempt
|
|
123
|
+
*/
|
|
124
|
+
export interface ExecutionAttempt {
|
|
125
|
+
/**
|
|
126
|
+
* Attempt number (1-indexed)
|
|
127
|
+
*/
|
|
128
|
+
attemptNumber: number;
|
|
129
|
+
/**
|
|
130
|
+
* When this attempt started
|
|
131
|
+
*/
|
|
132
|
+
startedAt: Date;
|
|
133
|
+
/**
|
|
134
|
+
* When this attempt completed (if finished)
|
|
135
|
+
*/
|
|
136
|
+
completedAt?: Date;
|
|
137
|
+
/**
|
|
138
|
+
* Duration of this attempt in milliseconds
|
|
139
|
+
*/
|
|
140
|
+
duration?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Whether this attempt succeeded
|
|
143
|
+
*/
|
|
144
|
+
success: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Error that occurred during this attempt
|
|
147
|
+
*/
|
|
148
|
+
error?: Error;
|
|
149
|
+
/**
|
|
150
|
+
* Exit code from this attempt
|
|
151
|
+
*/
|
|
152
|
+
exitCode?: number;
|
|
153
|
+
/**
|
|
154
|
+
* Whether another retry will be attempted after this
|
|
155
|
+
*/
|
|
156
|
+
willRetry: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* When the next retry will occur (if willRetry is true)
|
|
159
|
+
*/
|
|
160
|
+
nextRetryAt?: Date;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* ResilientExecutionResult - Enhanced execution result with retry information
|
|
164
|
+
*
|
|
165
|
+
* Extends the base ExecutionResult with detailed retry tracking
|
|
166
|
+
*/
|
|
167
|
+
export interface ResilientExecutionResult extends ExecutionResult {
|
|
168
|
+
/**
|
|
169
|
+
* All execution attempts made for this task
|
|
170
|
+
*/
|
|
171
|
+
attempts: ExecutionAttempt[];
|
|
172
|
+
/**
|
|
173
|
+
* Total number of attempts made
|
|
174
|
+
*/
|
|
175
|
+
totalAttempts: number;
|
|
176
|
+
/**
|
|
177
|
+
* The final attempt (may be success or failure)
|
|
178
|
+
*/
|
|
179
|
+
finalAttempt: ExecutionAttempt;
|
|
180
|
+
/**
|
|
181
|
+
* Human-readable reason for failure (if failed)
|
|
182
|
+
*/
|
|
183
|
+
failureReason?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Whether the circuit breaker prevented execution
|
|
186
|
+
*/
|
|
187
|
+
circuitBreakerTriggered?: boolean;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* RetryMetrics - Aggregate metrics for retry behavior
|
|
191
|
+
*/
|
|
192
|
+
export interface RetryMetrics {
|
|
193
|
+
/**
|
|
194
|
+
* Total number of retries attempted across all tasks
|
|
195
|
+
*/
|
|
196
|
+
totalRetries: number;
|
|
197
|
+
/**
|
|
198
|
+
* Number of retries that eventually succeeded
|
|
199
|
+
*/
|
|
200
|
+
successfulRetries: number;
|
|
201
|
+
/**
|
|
202
|
+
* Number of retries that ultimately failed
|
|
203
|
+
*/
|
|
204
|
+
failedRetries: number;
|
|
205
|
+
/**
|
|
206
|
+
* Average number of attempts needed for successful tasks
|
|
207
|
+
*/
|
|
208
|
+
averageAttemptsToSuccess: number;
|
|
209
|
+
/**
|
|
210
|
+
* Circuit breakers by name
|
|
211
|
+
*/
|
|
212
|
+
circuitBreakers: Map<string, CircuitBreaker>;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* RetryAttemptHandler - Callback for retry attempt events
|
|
216
|
+
*/
|
|
217
|
+
export type RetryAttemptHandler = (taskId: string, attempt: ExecutionAttempt) => void;
|
|
218
|
+
/**
|
|
219
|
+
* CircuitOpenHandler - Callback for circuit breaker open events
|
|
220
|
+
*/
|
|
221
|
+
export type CircuitOpenHandler = (circuitName: string, breaker: CircuitBreaker) => void;
|
|
222
|
+
/**
|
|
223
|
+
* Default retry policy for resilient execution
|
|
224
|
+
*/
|
|
225
|
+
export declare const DEFAULT_RETRY_POLICY: RetryPolicy;
|
|
226
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/execution/resilience/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,E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,MAAM,EACnB,OAAO,EAAE,cAAc,KACpB,IAAI,CAAC;AAEV;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,WAiBlC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resilience Layer Types
|
|
3
|
+
*
|
|
4
|
+
* Core types for the Resilience Layer (Layer 3) that adds retry logic,
|
|
5
|
+
* circuit breakers, and fault tolerance to task execution.
|
|
6
|
+
*
|
|
7
|
+
* @module execution/resilience/types
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Default retry policy for resilient execution
|
|
11
|
+
*/
|
|
12
|
+
export const DEFAULT_RETRY_POLICY = {
|
|
13
|
+
maxAttempts: 3,
|
|
14
|
+
backoff: {
|
|
15
|
+
type: 'exponential',
|
|
16
|
+
baseDelayMs: 1000,
|
|
17
|
+
maxDelayMs: 30000,
|
|
18
|
+
jitter: true,
|
|
19
|
+
},
|
|
20
|
+
retryableErrors: [
|
|
21
|
+
'ECONNREFUSED',
|
|
22
|
+
'ETIMEDOUT',
|
|
23
|
+
'ENOTFOUND',
|
|
24
|
+
'timeout',
|
|
25
|
+
'network',
|
|
26
|
+
'Process execution timeout',
|
|
27
|
+
],
|
|
28
|
+
retryableExitCodes: [1, 137], // Generic error, SIGKILL
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/execution/resilience/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAsQH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAgB;IAC/C,WAAW,EAAE,CAAC;IACd,OAAO,EAAE;QACP,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,IAAI;KACb;IACD,eAAe,EAAE;QACf,cAAc;QACd,WAAW;QACX,WAAW;QACX,SAAS;QACT,SAAS;QACT,2BAA2B;KAC5B;IACD,kBAAkB,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,yBAAyB;CACxD,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution Event Buffer
|
|
3
|
+
*
|
|
4
|
+
* Stores AG-UI events for executions so they can be replayed to late-joining clients
|
|
5
|
+
* or retrieved for historical display.
|
|
6
|
+
*
|
|
7
|
+
* @module execution/transport/event-buffer
|
|
8
|
+
*/
|
|
9
|
+
import type { AgUiEvent } from "./transport-manager.js";
|
|
10
|
+
/**
|
|
11
|
+
* Buffered event with metadata
|
|
12
|
+
*/
|
|
13
|
+
export interface BufferedEvent {
|
|
14
|
+
/** The AG-UI event */
|
|
15
|
+
event: AgUiEvent;
|
|
16
|
+
/** When the event was buffered */
|
|
17
|
+
timestamp: number;
|
|
18
|
+
/** Event sequence number within the execution */
|
|
19
|
+
sequenceNumber: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Event buffer for a single execution
|
|
23
|
+
*/
|
|
24
|
+
export interface ExecutionEventBuffer {
|
|
25
|
+
/** Execution/run ID */
|
|
26
|
+
executionId: string;
|
|
27
|
+
/** Buffered events in order */
|
|
28
|
+
events: BufferedEvent[];
|
|
29
|
+
/** Next sequence number */
|
|
30
|
+
nextSequence: number;
|
|
31
|
+
/** When the buffer was created */
|
|
32
|
+
createdAt: number;
|
|
33
|
+
/** When the buffer was last updated */
|
|
34
|
+
lastUpdatedAt: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* EventBuffer - In-memory storage for execution events
|
|
38
|
+
*
|
|
39
|
+
* Stores events for active executions and allows replay when clients connect.
|
|
40
|
+
* Events are automatically pruned after executions complete to prevent memory leaks.
|
|
41
|
+
*/
|
|
42
|
+
export declare class EventBuffer {
|
|
43
|
+
private buffers;
|
|
44
|
+
private readonly MAX_EVENTS_PER_EXECUTION;
|
|
45
|
+
private readonly RETENTION_MS;
|
|
46
|
+
/**
|
|
47
|
+
* Add an event to the buffer for an execution
|
|
48
|
+
*
|
|
49
|
+
* @param executionId - Execution ID
|
|
50
|
+
* @param event - AG-UI event to buffer
|
|
51
|
+
*/
|
|
52
|
+
addEvent(executionId: string, event: AgUiEvent): void;
|
|
53
|
+
/**
|
|
54
|
+
* Get all buffered events for an execution
|
|
55
|
+
*
|
|
56
|
+
* @param executionId - Execution ID
|
|
57
|
+
* @param fromSequence - Optional: only return events >= this sequence number
|
|
58
|
+
* @returns Array of buffered events, or empty array if no buffer exists
|
|
59
|
+
*/
|
|
60
|
+
getEvents(executionId: string, fromSequence?: number): BufferedEvent[];
|
|
61
|
+
/**
|
|
62
|
+
* Check if a buffer exists for an execution
|
|
63
|
+
*
|
|
64
|
+
* @param executionId - Execution ID
|
|
65
|
+
* @returns true if buffer exists
|
|
66
|
+
*/
|
|
67
|
+
hasBuffer(executionId: string): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Get buffer metadata without events
|
|
70
|
+
*
|
|
71
|
+
* @param executionId - Execution ID
|
|
72
|
+
* @returns Buffer metadata or null if not found
|
|
73
|
+
*/
|
|
74
|
+
getBufferInfo(executionId: string): Omit<ExecutionEventBuffer, "events"> | null;
|
|
75
|
+
/**
|
|
76
|
+
* Remove a buffer for an execution
|
|
77
|
+
*
|
|
78
|
+
* @param executionId - Execution ID
|
|
79
|
+
* @returns true if buffer was removed, false if it didn't exist
|
|
80
|
+
*/
|
|
81
|
+
removeBuffer(executionId: string): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Clear all buffers
|
|
84
|
+
*/
|
|
85
|
+
clearAll(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Prune stale buffers that haven't been updated recently
|
|
88
|
+
*
|
|
89
|
+
* Should be called periodically to prevent memory leaks.
|
|
90
|
+
*
|
|
91
|
+
* @returns Number of buffers pruned
|
|
92
|
+
*/
|
|
93
|
+
pruneStale(): number;
|
|
94
|
+
/**
|
|
95
|
+
* Get total number of buffers
|
|
96
|
+
*
|
|
97
|
+
* @returns Number of active buffers
|
|
98
|
+
*/
|
|
99
|
+
getBufferCount(): number;
|
|
100
|
+
/**
|
|
101
|
+
* Get total number of events across all buffers
|
|
102
|
+
*
|
|
103
|
+
* @returns Total event count
|
|
104
|
+
*/
|
|
105
|
+
getTotalEventCount(): number;
|
|
106
|
+
/**
|
|
107
|
+
* Get statistics about buffer usage
|
|
108
|
+
*
|
|
109
|
+
* @returns Buffer statistics
|
|
110
|
+
*/
|
|
111
|
+
getStats(): {
|
|
112
|
+
bufferCount: number;
|
|
113
|
+
totalEvents: number;
|
|
114
|
+
avgEventsPerBuffer: number;
|
|
115
|
+
oldestBuffer: number | null;
|
|
116
|
+
newestBuffer: number | null;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=event-buffer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-buffer.d.ts","sourceRoot":"","sources":["../../../src/execution/transport/event-buffer.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,sBAAsB;IACtB,KAAK,EAAE,SAAS,CAAC;IACjB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,uBAAuB;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,2BAA2B;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAA2C;IAC1D,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAS;IAClD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAkB;IAE/C;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,IAAI;IAmDrD;;;;;;OAMG;IACH,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,aAAa,EAAE;IAatE;;;;;OAKG;IACH,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAIvC;;;;;OAKG;IACH,aAAa,CACX,WAAW,EAAE,MAAM,GAClB,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,GAAG,IAAI;IAc9C;;;;;OAKG;IACH,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO;IAY1C;;OAEG;IACH,QAAQ,IAAI,IAAI;IAMhB;;;;;;OAMG;IACH,UAAU,IAAI,MAAM;IAsBpB;;;;OAIG;IACH,cAAc,IAAI,MAAM;IAIxB;;;;OAIG;IACH,kBAAkB,IAAI,MAAM;IAQ5B;;;;OAIG;IACH,QAAQ,IAAI;QACV,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;KAC7B;CAwBF"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution Event Buffer
|
|
3
|
+
*
|
|
4
|
+
* Stores AG-UI events for executions so they can be replayed to late-joining clients
|
|
5
|
+
* or retrieved for historical display.
|
|
6
|
+
*
|
|
7
|
+
* @module execution/transport/event-buffer
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* EventBuffer - In-memory storage for execution events
|
|
11
|
+
*
|
|
12
|
+
* Stores events for active executions and allows replay when clients connect.
|
|
13
|
+
* Events are automatically pruned after executions complete to prevent memory leaks.
|
|
14
|
+
*/
|
|
15
|
+
export class EventBuffer {
|
|
16
|
+
buffers = new Map();
|
|
17
|
+
MAX_EVENTS_PER_EXECUTION = 10000; // Prevent unbounded growth
|
|
18
|
+
RETENTION_MS = 1000 * 60 * 60; // 1 hour after last update
|
|
19
|
+
/**
|
|
20
|
+
* Add an event to the buffer for an execution
|
|
21
|
+
*
|
|
22
|
+
* @param executionId - Execution ID
|
|
23
|
+
* @param event - AG-UI event to buffer
|
|
24
|
+
*/
|
|
25
|
+
addEvent(executionId, event) {
|
|
26
|
+
let buffer = this.buffers.get(executionId);
|
|
27
|
+
if (!buffer) {
|
|
28
|
+
buffer = {
|
|
29
|
+
executionId,
|
|
30
|
+
events: [],
|
|
31
|
+
nextSequence: 0,
|
|
32
|
+
createdAt: Date.now(),
|
|
33
|
+
lastUpdatedAt: Date.now(),
|
|
34
|
+
};
|
|
35
|
+
this.buffers.set(executionId, buffer);
|
|
36
|
+
console.log("[EventBuffer] Created buffer for execution", {
|
|
37
|
+
executionId,
|
|
38
|
+
timestamp: new Date().toISOString(),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
// Add event with sequence number
|
|
42
|
+
const bufferedEvent = {
|
|
43
|
+
event,
|
|
44
|
+
timestamp: Date.now(),
|
|
45
|
+
sequenceNumber: buffer.nextSequence++,
|
|
46
|
+
};
|
|
47
|
+
buffer.events.push(bufferedEvent);
|
|
48
|
+
buffer.lastUpdatedAt = Date.now();
|
|
49
|
+
// Enforce max events limit
|
|
50
|
+
if (buffer.events.length > this.MAX_EVENTS_PER_EXECUTION) {
|
|
51
|
+
// Remove oldest 10% of events
|
|
52
|
+
const toRemove = Math.floor(this.MAX_EVENTS_PER_EXECUTION * 0.1);
|
|
53
|
+
buffer.events.splice(0, toRemove);
|
|
54
|
+
console.warn("[EventBuffer] Buffer size limit reached, removing oldest events", {
|
|
55
|
+
executionId,
|
|
56
|
+
removedCount: toRemove,
|
|
57
|
+
remainingCount: buffer.events.length,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
console.log("[EventBuffer] Event added to buffer", {
|
|
61
|
+
executionId,
|
|
62
|
+
eventType: event.type,
|
|
63
|
+
sequenceNumber: bufferedEvent.sequenceNumber,
|
|
64
|
+
totalEvents: buffer.events.length,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Get all buffered events for an execution
|
|
69
|
+
*
|
|
70
|
+
* @param executionId - Execution ID
|
|
71
|
+
* @param fromSequence - Optional: only return events >= this sequence number
|
|
72
|
+
* @returns Array of buffered events, or empty array if no buffer exists
|
|
73
|
+
*/
|
|
74
|
+
getEvents(executionId, fromSequence) {
|
|
75
|
+
const buffer = this.buffers.get(executionId);
|
|
76
|
+
if (!buffer) {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
if (fromSequence !== undefined) {
|
|
80
|
+
return buffer.events.filter((e) => e.sequenceNumber >= fromSequence);
|
|
81
|
+
}
|
|
82
|
+
return [...buffer.events];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Check if a buffer exists for an execution
|
|
86
|
+
*
|
|
87
|
+
* @param executionId - Execution ID
|
|
88
|
+
* @returns true if buffer exists
|
|
89
|
+
*/
|
|
90
|
+
hasBuffer(executionId) {
|
|
91
|
+
return this.buffers.has(executionId);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get buffer metadata without events
|
|
95
|
+
*
|
|
96
|
+
* @param executionId - Execution ID
|
|
97
|
+
* @returns Buffer metadata or null if not found
|
|
98
|
+
*/
|
|
99
|
+
getBufferInfo(executionId) {
|
|
100
|
+
const buffer = this.buffers.get(executionId);
|
|
101
|
+
if (!buffer) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
executionId: buffer.executionId,
|
|
106
|
+
nextSequence: buffer.nextSequence,
|
|
107
|
+
createdAt: buffer.createdAt,
|
|
108
|
+
lastUpdatedAt: buffer.lastUpdatedAt,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Remove a buffer for an execution
|
|
113
|
+
*
|
|
114
|
+
* @param executionId - Execution ID
|
|
115
|
+
* @returns true if buffer was removed, false if it didn't exist
|
|
116
|
+
*/
|
|
117
|
+
removeBuffer(executionId) {
|
|
118
|
+
const existed = this.buffers.has(executionId);
|
|
119
|
+
if (existed) {
|
|
120
|
+
this.buffers.delete(executionId);
|
|
121
|
+
console.log("[EventBuffer] Buffer removed", {
|
|
122
|
+
executionId,
|
|
123
|
+
timestamp: new Date().toISOString(),
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return existed;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Clear all buffers
|
|
130
|
+
*/
|
|
131
|
+
clearAll() {
|
|
132
|
+
const count = this.buffers.size;
|
|
133
|
+
this.buffers.clear();
|
|
134
|
+
console.log("[EventBuffer] All buffers cleared", { count });
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Prune stale buffers that haven't been updated recently
|
|
138
|
+
*
|
|
139
|
+
* Should be called periodically to prevent memory leaks.
|
|
140
|
+
*
|
|
141
|
+
* @returns Number of buffers pruned
|
|
142
|
+
*/
|
|
143
|
+
pruneStale() {
|
|
144
|
+
const now = Date.now();
|
|
145
|
+
const threshold = now - this.RETENTION_MS;
|
|
146
|
+
let pruned = 0;
|
|
147
|
+
for (const [executionId, buffer] of this.buffers.entries()) {
|
|
148
|
+
if (buffer.lastUpdatedAt < threshold) {
|
|
149
|
+
this.buffers.delete(executionId);
|
|
150
|
+
pruned++;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (pruned > 0) {
|
|
154
|
+
console.log("[EventBuffer] Pruned stale buffers", {
|
|
155
|
+
count: pruned,
|
|
156
|
+
remaining: this.buffers.size,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
return pruned;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Get total number of buffers
|
|
163
|
+
*
|
|
164
|
+
* @returns Number of active buffers
|
|
165
|
+
*/
|
|
166
|
+
getBufferCount() {
|
|
167
|
+
return this.buffers.size;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Get total number of events across all buffers
|
|
171
|
+
*
|
|
172
|
+
* @returns Total event count
|
|
173
|
+
*/
|
|
174
|
+
getTotalEventCount() {
|
|
175
|
+
let total = 0;
|
|
176
|
+
for (const buffer of this.buffers.values()) {
|
|
177
|
+
total += buffer.events.length;
|
|
178
|
+
}
|
|
179
|
+
return total;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Get statistics about buffer usage
|
|
183
|
+
*
|
|
184
|
+
* @returns Buffer statistics
|
|
185
|
+
*/
|
|
186
|
+
getStats() {
|
|
187
|
+
const bufferCount = this.buffers.size;
|
|
188
|
+
const totalEvents = this.getTotalEventCount();
|
|
189
|
+
let oldest = null;
|
|
190
|
+
let newest = null;
|
|
191
|
+
for (const buffer of this.buffers.values()) {
|
|
192
|
+
if (oldest === null || buffer.createdAt < oldest) {
|
|
193
|
+
oldest = buffer.createdAt;
|
|
194
|
+
}
|
|
195
|
+
if (newest === null || buffer.createdAt > newest) {
|
|
196
|
+
newest = buffer.createdAt;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
bufferCount,
|
|
201
|
+
totalEvents,
|
|
202
|
+
avgEventsPerBuffer: bufferCount > 0 ? totalEvents / bufferCount : 0,
|
|
203
|
+
oldestBuffer: oldest,
|
|
204
|
+
newestBuffer: newest,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=event-buffer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-buffer.js","sourceRoot":"","sources":["../../../src/execution/transport/event-buffer.ts"],"names":[],"mappings":"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CAAC;YACnE,YAAY,EAAE,MAAM;YACpB,YAAY,EAAE,MAAM;SACrB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transport Layer
|
|
3
|
+
*
|
|
4
|
+
* Exports transport implementations for streaming AG-UI events to clients.
|
|
5
|
+
*
|
|
6
|
+
* @module execution/transport
|
|
7
|
+
*/
|
|
8
|
+
export { SseTransport } from './sse-transport.js';
|
|
9
|
+
export { TransportManager } from './transport-manager.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/execution/transport/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transport Layer
|
|
3
|
+
*
|
|
4
|
+
* Exports transport implementations for streaming AG-UI events to clients.
|
|
5
|
+
*
|
|
6
|
+
* @module execution/transport
|
|
7
|
+
*/
|
|
8
|
+
export { SseTransport } from './sse-transport.js';
|
|
9
|
+
export { TransportManager } from './transport-manager.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/execution/transport/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|