specweave 0.28.68 → 0.29.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/CLAUDE.md +3 -2
- package/README.md +19 -2
- package/dist/src/cli/commands/discrepancies.d.ts +89 -0
- package/dist/src/cli/commands/discrepancies.d.ts.map +1 -0
- package/dist/src/cli/commands/discrepancies.js +385 -0
- package/dist/src/cli/commands/discrepancies.js.map +1 -0
- package/dist/src/cli/commands/notifications.d.ts +70 -0
- package/dist/src/cli/commands/notifications.d.ts.map +1 -0
- package/dist/src/cli/commands/notifications.js +236 -0
- package/dist/src/cli/commands/notifications.js.map +1 -0
- package/dist/src/cli/commands/sync-logs.d.ts +54 -0
- package/dist/src/cli/commands/sync-logs.d.ts.map +1 -0
- package/dist/src/cli/commands/sync-logs.js +240 -0
- package/dist/src/cli/commands/sync-logs.js.map +1 -0
- package/dist/src/cli/commands/sync-monitor.d.ts +42 -0
- package/dist/src/cli/commands/sync-monitor.d.ts.map +1 -0
- package/dist/src/cli/commands/sync-monitor.js +191 -0
- package/dist/src/cli/commands/sync-monitor.js.map +1 -0
- package/dist/src/cli/helpers/init/brownfield-analysis.d.ts +45 -0
- package/dist/src/cli/helpers/init/brownfield-analysis.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/brownfield-analysis.js +431 -0
- package/dist/src/cli/helpers/init/brownfield-analysis.js.map +1 -0
- package/dist/src/cli/helpers/init/index.d.ts +1 -0
- package/dist/src/cli/helpers/init/index.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/index.js +2 -0
- package/dist/src/cli/helpers/init/index.js.map +1 -1
- package/dist/src/cli/workers/brownfield-worker.d.ts +66 -0
- package/dist/src/cli/workers/brownfield-worker.d.ts.map +1 -0
- package/dist/src/cli/workers/brownfield-worker.js +417 -0
- package/dist/src/cli/workers/brownfield-worker.js.map +1 -0
- package/dist/src/core/background/brownfield-launcher.d.ts +86 -0
- package/dist/src/core/background/brownfield-launcher.d.ts.map +1 -0
- package/dist/src/core/background/brownfield-launcher.js +295 -0
- package/dist/src/core/background/brownfield-launcher.js.map +1 -0
- package/dist/src/core/background/index.d.ts +2 -0
- package/dist/src/core/background/index.d.ts.map +1 -1
- package/dist/src/core/background/index.js +2 -0
- package/dist/src/core/background/index.js.map +1 -1
- package/dist/src/core/background/types.d.ts +23 -2
- package/dist/src/core/background/types.d.ts.map +1 -1
- package/dist/src/core/config/index.d.ts +1 -0
- package/dist/src/core/config/index.d.ts.map +1 -1
- package/dist/src/core/config/index.js +1 -0
- package/dist/src/core/config/index.js.map +1 -1
- package/dist/src/core/config/types.d.ts +6 -0
- package/dist/src/core/config/types.d.ts.map +1 -1
- package/dist/src/core/config/types.js.map +1 -1
- package/dist/src/core/dashboard/dashboard-data.d.ts +156 -0
- package/dist/src/core/dashboard/dashboard-data.d.ts.map +1 -0
- package/dist/src/core/dashboard/dashboard-data.js +191 -0
- package/dist/src/core/dashboard/dashboard-data.js.map +1 -0
- package/dist/src/core/dashboard/index.d.ts +9 -0
- package/dist/src/core/dashboard/index.d.ts.map +1 -0
- package/dist/src/core/dashboard/index.js +9 -0
- package/dist/src/core/dashboard/index.js.map +1 -0
- package/dist/src/core/discrepancy/analyzers/api-route-analyzer.d.ts +77 -0
- package/dist/src/core/discrepancy/analyzers/api-route-analyzer.d.ts.map +1 -0
- package/dist/src/core/discrepancy/analyzers/api-route-analyzer.js +286 -0
- package/dist/src/core/discrepancy/analyzers/api-route-analyzer.js.map +1 -0
- package/dist/src/core/discrepancy/analyzers/index.d.ts +8 -0
- package/dist/src/core/discrepancy/analyzers/index.d.ts.map +1 -0
- package/dist/src/core/discrepancy/analyzers/index.js +8 -0
- package/dist/src/core/discrepancy/analyzers/index.js.map +1 -0
- package/dist/src/core/discrepancy/analyzers/typescript-analyzer.d.ts +96 -0
- package/dist/src/core/discrepancy/analyzers/typescript-analyzer.d.ts.map +1 -0
- package/dist/src/core/discrepancy/analyzers/typescript-analyzer.js +247 -0
- package/dist/src/core/discrepancy/analyzers/typescript-analyzer.js.map +1 -0
- package/dist/src/core/discrepancy/brownfield-manager.d.ts +88 -0
- package/dist/src/core/discrepancy/brownfield-manager.d.ts.map +1 -0
- package/dist/src/core/discrepancy/brownfield-manager.js +520 -0
- package/dist/src/core/discrepancy/brownfield-manager.js.map +1 -0
- package/dist/src/core/discrepancy/brownfield-types.d.ts +174 -0
- package/dist/src/core/discrepancy/brownfield-types.d.ts.map +1 -0
- package/dist/src/core/discrepancy/brownfield-types.js +11 -0
- package/dist/src/core/discrepancy/brownfield-types.js.map +1 -0
- package/dist/src/core/discrepancy/detector.d.ts +92 -0
- package/dist/src/core/discrepancy/detector.d.ts.map +1 -0
- package/dist/src/core/discrepancy/detector.js +346 -0
- package/dist/src/core/discrepancy/detector.js.map +1 -0
- package/dist/src/core/discrepancy/increment-generator.d.ts +51 -0
- package/dist/src/core/discrepancy/increment-generator.d.ts.map +1 -0
- package/dist/src/core/discrepancy/increment-generator.js +234 -0
- package/dist/src/core/discrepancy/increment-generator.js.map +1 -0
- package/dist/src/core/discrepancy/index.d.ts +18 -0
- package/dist/src/core/discrepancy/index.d.ts.map +1 -0
- package/dist/src/core/discrepancy/index.js +24 -0
- package/dist/src/core/discrepancy/index.js.map +1 -0
- package/dist/src/core/discrepancy/severity-classifier.d.ts +81 -0
- package/dist/src/core/discrepancy/severity-classifier.d.ts.map +1 -0
- package/dist/src/core/discrepancy/severity-classifier.js +289 -0
- package/dist/src/core/discrepancy/severity-classifier.js.map +1 -0
- package/dist/src/core/discrepancy/spec-parser.d.ts +74 -0
- package/dist/src/core/discrepancy/spec-parser.d.ts.map +1 -0
- package/dist/src/core/discrepancy/spec-parser.js +213 -0
- package/dist/src/core/discrepancy/spec-parser.js.map +1 -0
- package/dist/src/core/discrepancy/update-recommender.d.ts +77 -0
- package/dist/src/core/discrepancy/update-recommender.d.ts.map +1 -0
- package/dist/src/core/discrepancy/update-recommender.js +323 -0
- package/dist/src/core/discrepancy/update-recommender.js.map +1 -0
- package/dist/src/core/living-docs/living-docs-sync.d.ts +13 -16
- package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.js +31 -112
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
- package/dist/src/core/logs/index.d.ts +10 -0
- package/dist/src/core/logs/index.d.ts.map +1 -0
- package/dist/src/core/logs/index.js +10 -0
- package/dist/src/core/logs/index.js.map +1 -0
- package/dist/src/core/logs/log-aggregator.d.ts +130 -0
- package/dist/src/core/logs/log-aggregator.d.ts.map +1 -0
- package/dist/src/core/logs/log-aggregator.js +206 -0
- package/dist/src/core/logs/log-aggregator.js.map +1 -0
- package/dist/src/core/logs/log-exporter.d.ts +81 -0
- package/dist/src/core/logs/log-exporter.d.ts.map +1 -0
- package/dist/src/core/logs/log-exporter.js +141 -0
- package/dist/src/core/logs/log-exporter.js.map +1 -0
- package/dist/src/core/notifications/command-integration.d.ts +82 -0
- package/dist/src/core/notifications/command-integration.d.ts.map +1 -0
- package/dist/src/core/notifications/command-integration.js +80 -0
- package/dist/src/core/notifications/command-integration.js.map +1 -0
- package/dist/src/core/notifications/index.d.ts +12 -0
- package/dist/src/core/notifications/index.d.ts.map +1 -0
- package/dist/src/core/notifications/index.js +12 -0
- package/dist/src/core/notifications/index.js.map +1 -0
- package/dist/src/core/notifications/notification-display.d.ts +70 -0
- package/dist/src/core/notifications/notification-display.d.ts.map +1 -0
- package/dist/src/core/notifications/notification-display.js +177 -0
- package/dist/src/core/notifications/notification-display.js.map +1 -0
- package/dist/src/core/notifications/notification-manager.d.ts +126 -0
- package/dist/src/core/notifications/notification-manager.d.ts.map +1 -0
- package/dist/src/core/notifications/notification-manager.js +287 -0
- package/dist/src/core/notifications/notification-manager.js.map +1 -0
- package/dist/src/core/notifications/notification-types.d.ts +159 -0
- package/dist/src/core/notifications/notification-types.d.ts.map +1 -0
- package/dist/src/core/notifications/notification-types.js +93 -0
- package/dist/src/core/notifications/notification-types.js.map +1 -0
- package/dist/src/core/scheduler/index.d.ts +11 -0
- package/dist/src/core/scheduler/index.d.ts.map +1 -0
- package/dist/src/core/scheduler/index.js +11 -0
- package/dist/src/core/scheduler/index.js.map +1 -0
- package/dist/src/core/scheduler/job-scheduler.d.ts +179 -0
- package/dist/src/core/scheduler/job-scheduler.d.ts.map +1 -0
- package/dist/src/core/scheduler/job-scheduler.js +282 -0
- package/dist/src/core/scheduler/job-scheduler.js.map +1 -0
- package/dist/src/core/scheduler/schedule-persistence.d.ts +83 -0
- package/dist/src/core/scheduler/schedule-persistence.d.ts.map +1 -0
- package/dist/src/core/scheduler/schedule-persistence.js +180 -0
- package/dist/src/core/scheduler/schedule-persistence.js.map +1 -0
- package/dist/src/core/scheduler/scheduled-job.d.ts +188 -0
- package/dist/src/core/scheduler/scheduled-job.d.ts.map +1 -0
- package/dist/src/core/scheduler/scheduled-job.js +182 -0
- package/dist/src/core/scheduler/scheduled-job.js.map +1 -0
- package/dist/src/core/sync/permission-enforcer.d.ts +206 -0
- package/dist/src/core/sync/permission-enforcer.d.ts.map +1 -0
- package/dist/src/core/sync/permission-enforcer.js +268 -0
- package/dist/src/core/sync/permission-enforcer.js.map +1 -0
- package/dist/src/core/sync/sync-audit-logger.d.ts +217 -0
- package/dist/src/core/sync/sync-audit-logger.d.ts.map +1 -0
- package/dist/src/core/sync/sync-audit-logger.js +327 -0
- package/dist/src/core/sync/sync-audit-logger.js.map +1 -0
- package/dist/src/core/sync/sync-interceptor.d.ts +190 -0
- package/dist/src/core/sync/sync-interceptor.d.ts.map +1 -0
- package/dist/src/core/sync/sync-interceptor.js +224 -0
- package/dist/src/core/sync/sync-interceptor.js.map +1 -0
- package/dist/src/core/types/increment-metadata.d.ts +5 -2
- package/dist/src/core/types/increment-metadata.d.ts.map +1 -1
- package/dist/src/core/types/sync-config.d.ts +267 -0
- package/dist/src/core/types/sync-config.d.ts.map +1 -0
- package/dist/src/core/types/sync-config.js +304 -0
- package/dist/src/core/types/sync-config.js.map +1 -0
- package/dist/src/hooks/index.d.ts +11 -0
- package/dist/src/hooks/index.d.ts.map +1 -0
- package/dist/src/hooks/index.js +11 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/hooks/platform.d.ts +125 -0
- package/dist/src/hooks/platform.d.ts.map +1 -0
- package/dist/src/hooks/platform.js +325 -0
- package/dist/src/hooks/platform.js.map +1 -0
- package/dist/src/hooks/processor.d.ts +20 -0
- package/dist/src/hooks/processor.d.ts.map +1 -0
- package/dist/src/hooks/processor.js +317 -0
- package/dist/src/hooks/processor.js.map +1 -0
- package/dist/src/hooks/scheduler-startup.d.ts +19 -0
- package/dist/src/hooks/scheduler-startup.d.ts.map +1 -0
- package/dist/src/hooks/scheduler-startup.js +92 -0
- package/dist/src/hooks/scheduler-startup.js.map +1 -0
- package/dist/src/hooks/session-start.d.ts +16 -0
- package/dist/src/hooks/session-start.d.ts.map +1 -0
- package/dist/src/hooks/session-start.js +92 -0
- package/dist/src/hooks/session-start.js.map +1 -0
- package/dist/src/importers/duplicate-detector.d.ts +13 -2
- package/dist/src/importers/duplicate-detector.d.ts.map +1 -1
- package/dist/src/importers/duplicate-detector.js +21 -2
- package/dist/src/importers/duplicate-detector.js.map +1 -1
- package/dist/src/importers/item-converter.d.ts +41 -2
- package/dist/src/importers/item-converter.d.ts.map +1 -1
- package/dist/src/importers/item-converter.js +225 -38
- package/dist/src/importers/item-converter.js.map +1 -1
- package/dist/src/living-docs/fs-id-allocator.d.ts +7 -0
- package/dist/src/living-docs/fs-id-allocator.d.ts.map +1 -1
- package/dist/src/living-docs/fs-id-allocator.js +30 -4
- package/dist/src/living-docs/fs-id-allocator.js.map +1 -1
- package/dist/src/sync/ado-sync-wrapper.d.ts +137 -0
- package/dist/src/sync/ado-sync-wrapper.d.ts.map +1 -0
- package/dist/src/sync/ado-sync-wrapper.js +148 -0
- package/dist/src/sync/ado-sync-wrapper.js.map +1 -0
- package/dist/src/sync/github-sync-wrapper.d.ts +195 -0
- package/dist/src/sync/github-sync-wrapper.d.ts.map +1 -0
- package/dist/src/sync/github-sync-wrapper.js +220 -0
- package/dist/src/sync/github-sync-wrapper.js.map +1 -0
- package/dist/src/sync/jira-sync-wrapper.d.ts +155 -0
- package/dist/src/sync/jira-sync-wrapper.d.ts.map +1 -0
- package/dist/src/sync/jira-sync-wrapper.js +175 -0
- package/dist/src/sync/jira-sync-wrapper.js.map +1 -0
- package/dist/src/utils/feature-id-derivation.d.ts +58 -0
- package/dist/src/utils/feature-id-derivation.d.ts.map +1 -0
- package/dist/src/utils/feature-id-derivation.js +77 -0
- package/dist/src/utils/feature-id-derivation.js.map +1 -0
- package/package.json +3 -1
- package/plugins/specweave/commands/specweave-discrepancies.md +141 -0
- package/plugins/specweave/commands/specweave-discrepancy-to-increment.md +160 -0
- package/plugins/specweave/commands/specweave-jobs.md +45 -2
- package/plugins/specweave/commands/specweave-notifications.md +92 -0
- package/plugins/specweave/commands/specweave-sync-logs.md +131 -0
- package/plugins/specweave/commands/specweave-sync-monitor.md +57 -0
- package/plugins/specweave/hooks/hooks.json +3 -3
- package/plugins/specweave/hooks/lib/scheduler-startup.sh +72 -0
- package/plugins/specweave/hooks/universal/dispatcher.mjs +246 -0
- package/plugins/specweave/hooks/universal/session-start.cmd +16 -0
- package/plugins/specweave/hooks/universal/session-start.ps1 +16 -0
- package/plugins/specweave/hooks/v2/dispatchers/session-start.sh +14 -5
- package/plugins/specweave/lib/vendor/core/types/increment-metadata.d.ts +5 -2
- package/plugins/specweave/skills/discrepancy-viewer.md +154 -0
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +46 -0
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +69 -0
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts +0 -26
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.d.ts.map +0 -1
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.js +0 -249
- package/dist/plugins/specweave-github/lib/enhanced-github-sync.js.map +0 -1
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts +0 -28
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.d.ts.map +0 -1
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -156
- package/dist/plugins/specweave-jira/lib/enhanced-jira-sync.js.map +0 -1
- package/dist/src/core/sync/bidirectional-engine.d.ts +0 -119
- package/dist/src/core/sync/bidirectional-engine.d.ts.map +0 -1
- package/dist/src/core/sync/bidirectional-engine.js +0 -359
- package/dist/src/core/sync/bidirectional-engine.js.map +0 -1
- package/dist/src/core/sync/conflict-resolver.d.ts +0 -66
- package/dist/src/core/sync/conflict-resolver.d.ts.map +0 -1
- package/dist/src/core/sync/conflict-resolver.js +0 -108
- package/dist/src/core/sync/conflict-resolver.js.map +0 -1
- package/dist/src/core/sync/enhanced-content-builder.d.ts +0 -55
- package/dist/src/core/sync/enhanced-content-builder.d.ts.map +0 -1
- package/dist/src/core/sync/enhanced-content-builder.js +0 -203
- package/dist/src/core/sync/enhanced-content-builder.js.map +0 -1
- package/dist/src/core/sync/folder-mapper.d.ts +0 -71
- package/dist/src/core/sync/folder-mapper.d.ts.map +0 -1
- package/dist/src/core/sync/folder-mapper.js +0 -203
- package/dist/src/core/sync/folder-mapper.js.map +0 -1
- package/dist/src/core/sync/label-detector.d.ts +0 -66
- package/dist/src/core/sync/label-detector.d.ts.map +0 -1
- package/dist/src/core/sync/label-detector.js +0 -224
- package/dist/src/core/sync/label-detector.js.map +0 -1
- package/dist/src/core/sync/performance-optimizer.d.ts +0 -153
- package/dist/src/core/sync/performance-optimizer.d.ts.map +0 -1
- package/dist/src/core/sync/performance-optimizer.js +0 -220
- package/dist/src/core/sync/performance-optimizer.js.map +0 -1
- package/dist/src/core/sync/profile-selector.d.ts +0 -52
- package/dist/src/core/sync/profile-selector.d.ts.map +0 -1
- package/dist/src/core/sync/profile-selector.js +0 -179
- package/dist/src/core/sync/profile-selector.js.map +0 -1
- package/dist/src/core/sync/profile-validator.d.ts +0 -52
- package/dist/src/core/sync/profile-validator.d.ts.map +0 -1
- package/dist/src/core/sync/profile-validator.js +0 -170
- package/dist/src/core/sync/profile-validator.js.map +0 -1
- package/dist/src/core/sync/rate-limiter.d.ts +0 -116
- package/dist/src/core/sync/rate-limiter.d.ts.map +0 -1
- package/dist/src/core/sync/rate-limiter.js +0 -308
- package/dist/src/core/sync/rate-limiter.js.map +0 -1
- package/dist/src/core/sync/retry-handler.d.ts +0 -98
- package/dist/src/core/sync/retry-handler.d.ts.map +0 -1
- package/dist/src/core/sync/retry-handler.js +0 -196
- package/dist/src/core/sync/retry-handler.js.map +0 -1
- package/dist/src/core/sync/retry-logic.d.ts +0 -64
- package/dist/src/core/sync/retry-logic.d.ts.map +0 -1
- package/dist/src/core/sync/retry-logic.js +0 -165
- package/dist/src/core/sync/retry-logic.js.map +0 -1
- package/dist/src/core/sync/status-cache.d.ts +0 -91
- package/dist/src/core/sync/status-cache.d.ts.map +0 -1
- package/dist/src/core/sync/status-cache.js +0 -140
- package/dist/src/core/sync/status-cache.js.map +0 -1
- package/dist/src/core/sync/status-mapper.d.ts +0 -69
- package/dist/src/core/sync/status-mapper.d.ts.map +0 -1
- package/dist/src/core/sync/status-mapper.js +0 -90
- package/dist/src/core/sync/status-mapper.js.map +0 -1
- package/dist/src/core/sync/status-sync-engine.d.ts +0 -162
- package/dist/src/core/sync/status-sync-engine.d.ts.map +0 -1
- package/dist/src/core/sync/status-sync-engine.js +0 -347
- package/dist/src/core/sync/status-sync-engine.js.map +0 -1
- package/dist/src/core/sync/sync-event-logger.d.ts +0 -113
- package/dist/src/core/sync/sync-event-logger.d.ts.map +0 -1
- package/dist/src/core/sync/sync-event-logger.js +0 -141
- package/dist/src/core/sync/sync-event-logger.js.map +0 -1
- package/dist/src/core/sync/time-range-selector.d.ts +0 -48
- package/dist/src/core/sync/time-range-selector.d.ts.map +0 -1
- package/dist/src/core/sync/time-range-selector.js +0 -224
- package/dist/src/core/sync/time-range-selector.js.map +0 -1
- package/dist/src/core/sync/types.d.ts +0 -52
- package/dist/src/core/sync/types.d.ts.map +0 -1
- package/dist/src/core/sync/types.js +0 -5
- package/dist/src/core/sync/types.js.map +0 -1
- package/dist/src/core/sync/workflow-detector.d.ts +0 -95
- package/dist/src/core/sync/workflow-detector.d.ts.map +0 -1
- package/dist/src/core/sync/workflow-detector.js +0 -175
- package/dist/src/core/sync/workflow-detector.js.map +0 -1
- package/plugins/specweave-github/lib/enhanced-github-sync.js +0 -220
- package/plugins/specweave-github/lib/enhanced-github-sync.ts +0 -322
- package/plugins/specweave-jira/lib/enhanced-jira-sync.js +0 -134
- package/plugins/specweave-jira/lib/enhanced-jira-sync.ts +0 -196
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Status Cache
|
|
3
|
-
*
|
|
4
|
-
* Caches external tool statuses to reduce API calls.
|
|
5
|
-
* Uses in-memory cache with TTL (default: 5 minutes).
|
|
6
|
-
*
|
|
7
|
-
* Performance Optimization:
|
|
8
|
-
* - Reduces redundant API calls
|
|
9
|
-
* - Improves sync speed
|
|
10
|
-
* - Respects rate limits
|
|
11
|
-
*
|
|
12
|
-
* @module status-cache
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Status Cache
|
|
16
|
-
*
|
|
17
|
-
* Generic cache for external tool statuses.
|
|
18
|
-
*/
|
|
19
|
-
export class StatusCache {
|
|
20
|
-
constructor(options) {
|
|
21
|
-
this.cache = new Map();
|
|
22
|
-
this.defaultTtl = options?.ttl || 5 * 60 * 1000; // 5 minutes default
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Get value from cache
|
|
26
|
-
*
|
|
27
|
-
* @param key - Cache key
|
|
28
|
-
* @returns Cached value or undefined if not found/expired
|
|
29
|
-
*/
|
|
30
|
-
get(key) {
|
|
31
|
-
const entry = this.cache.get(key);
|
|
32
|
-
if (!entry) {
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
// Check if expired
|
|
36
|
-
const now = Date.now();
|
|
37
|
-
const age = now - entry.timestamp;
|
|
38
|
-
if (age > entry.ttl) {
|
|
39
|
-
// Expired - remove and return undefined
|
|
40
|
-
this.cache.delete(key);
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
return entry.value;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Set value in cache
|
|
47
|
-
*
|
|
48
|
-
* @param key - Cache key
|
|
49
|
-
* @param value - Value to cache
|
|
50
|
-
* @param ttl - Optional TTL override (ms)
|
|
51
|
-
*/
|
|
52
|
-
set(key, value, ttl) {
|
|
53
|
-
const entry = {
|
|
54
|
-
value,
|
|
55
|
-
timestamp: Date.now(),
|
|
56
|
-
ttl: ttl || this.defaultTtl
|
|
57
|
-
};
|
|
58
|
-
this.cache.set(key, entry);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Check if key exists and is not expired
|
|
62
|
-
*
|
|
63
|
-
* @param key - Cache key
|
|
64
|
-
* @returns True if key exists and is not expired
|
|
65
|
-
*/
|
|
66
|
-
has(key) {
|
|
67
|
-
return this.get(key) !== undefined;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Delete key from cache
|
|
71
|
-
*
|
|
72
|
-
* @param key - Cache key
|
|
73
|
-
*/
|
|
74
|
-
delete(key) {
|
|
75
|
-
this.cache.delete(key);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Clear all cache entries
|
|
79
|
-
*/
|
|
80
|
-
clear() {
|
|
81
|
-
this.cache.clear();
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Get cache size
|
|
85
|
-
*
|
|
86
|
-
* @returns Number of entries in cache
|
|
87
|
-
*/
|
|
88
|
-
size() {
|
|
89
|
-
// Clean up expired entries first
|
|
90
|
-
this.cleanup();
|
|
91
|
-
return this.cache.size;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Clean up expired entries
|
|
95
|
-
*
|
|
96
|
-
* Removes all expired entries from cache.
|
|
97
|
-
*/
|
|
98
|
-
cleanup() {
|
|
99
|
-
const now = Date.now();
|
|
100
|
-
const keysToDelete = [];
|
|
101
|
-
for (const [key, entry] of this.cache.entries()) {
|
|
102
|
-
const age = now - entry.timestamp;
|
|
103
|
-
if (age > entry.ttl) {
|
|
104
|
-
keysToDelete.push(key);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
for (const key of keysToDelete) {
|
|
108
|
-
this.cache.delete(key);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Get cache statistics
|
|
113
|
-
*
|
|
114
|
-
* @returns Cache statistics (size, oldest entry age)
|
|
115
|
-
*/
|
|
116
|
-
getStats() {
|
|
117
|
-
this.cleanup();
|
|
118
|
-
if (this.cache.size === 0) {
|
|
119
|
-
return { size: 0, oldestEntryAge: null };
|
|
120
|
-
}
|
|
121
|
-
const now = Date.now();
|
|
122
|
-
let oldestTimestamp = now;
|
|
123
|
-
for (const entry of this.cache.values()) {
|
|
124
|
-
if (entry.timestamp < oldestTimestamp) {
|
|
125
|
-
oldestTimestamp = entry.timestamp;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return {
|
|
129
|
-
size: this.cache.size,
|
|
130
|
-
oldestEntryAge: now - oldestTimestamp
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Global status cache instance
|
|
136
|
-
*
|
|
137
|
-
* Used across all sync operations for maximum efficiency.
|
|
138
|
-
*/
|
|
139
|
-
export const globalStatusCache = new StatusCache();
|
|
140
|
-
//# sourceMappingURL=status-cache.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status-cache.js","sourceRoot":"","sources":["../../../../src/core/sync/status-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAYH;;;;GAIG;AACH,MAAM,OAAO,WAAW;IAItB,YAAY,OAAsB;QAChC,IA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AO;YACL,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YACrB,cAAc,EAAE,GAAG,GAAG,eAAe;SACtC,CAAC;IACJ,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,WAAW,EAAE,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Status Mapper
|
|
3
|
-
*
|
|
4
|
-
* Maps SpecWeave increment statuses to tool-specific statuses for
|
|
5
|
-
* GitHub, JIRA, and Azure DevOps.
|
|
6
|
-
*
|
|
7
|
-
* Supports both simple string mappings and complex mappings with
|
|
8
|
-
* labels/tags for more granular status representation.
|
|
9
|
-
*/
|
|
10
|
-
export type ExternalTool = 'github' | 'jira' | 'ado';
|
|
11
|
-
export type SpecWeaveStatus = 'planning' | 'active' | 'paused' | 'completed' | 'abandoned';
|
|
12
|
-
export interface StatusMappingConfig {
|
|
13
|
-
state: string;
|
|
14
|
-
labels?: string[];
|
|
15
|
-
tags?: string[];
|
|
16
|
-
}
|
|
17
|
-
export type StatusMappingValue = string | StatusMappingConfig;
|
|
18
|
-
export interface ToolStatusMappings {
|
|
19
|
-
planning: StatusMappingValue;
|
|
20
|
-
active: StatusMappingValue;
|
|
21
|
-
paused: StatusMappingValue;
|
|
22
|
-
completed: StatusMappingValue;
|
|
23
|
-
abandoned: StatusMappingValue;
|
|
24
|
-
}
|
|
25
|
-
export interface StatusSyncConfig {
|
|
26
|
-
enabled: boolean;
|
|
27
|
-
autoSync?: boolean;
|
|
28
|
-
promptUser?: boolean;
|
|
29
|
-
conflictResolution?: 'prompt' | 'last-write-wins' | 'specweave-wins' | 'external-wins';
|
|
30
|
-
mappings: {
|
|
31
|
-
github?: ToolStatusMappings;
|
|
32
|
-
jira?: ToolStatusMappings;
|
|
33
|
-
ado?: ToolStatusMappings;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export interface ValidationResult {
|
|
37
|
-
valid: boolean;
|
|
38
|
-
errors: string[];
|
|
39
|
-
}
|
|
40
|
-
export interface SyncConfig {
|
|
41
|
-
sync: {
|
|
42
|
-
statusSync: StatusSyncConfig;
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
export declare class StatusMapper {
|
|
46
|
-
private config;
|
|
47
|
-
constructor(config: SyncConfig);
|
|
48
|
-
/**
|
|
49
|
-
* Map SpecWeave status to external tool status
|
|
50
|
-
*/
|
|
51
|
-
mapToExternal(specweaveStatus: string, tool: ExternalTool): StatusMappingConfig;
|
|
52
|
-
/**
|
|
53
|
-
* Map external tool status to SpecWeave status (reverse lookup)
|
|
54
|
-
*/
|
|
55
|
-
mapFromExternal(externalStatus: string, tool: ExternalTool): SpecWeaveStatus | null;
|
|
56
|
-
/**
|
|
57
|
-
* Validate status mapping configuration
|
|
58
|
-
*/
|
|
59
|
-
validate(): ValidationResult;
|
|
60
|
-
/**
|
|
61
|
-
* Get all required SpecWeave statuses
|
|
62
|
-
*/
|
|
63
|
-
getRequiredStatuses(): SpecWeaveStatus[];
|
|
64
|
-
/**
|
|
65
|
-
* Get all supported external tools
|
|
66
|
-
*/
|
|
67
|
-
getSupportedTools(): ExternalTool[];
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=status-mapper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status-mapper.d.ts","sourceRoot":"","sources":["../../../../src/core/sync/status-mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AAErD,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC;AAE3F,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC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@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Status Mapper
|
|
3
|
-
*
|
|
4
|
-
* Maps SpecWeave increment statuses to tool-specific statuses for
|
|
5
|
-
* GitHub, JIRA, and Azure DevOps.
|
|
6
|
-
*
|
|
7
|
-
* Supports both simple string mappings and complex mappings with
|
|
8
|
-
* labels/tags for more granular status representation.
|
|
9
|
-
*/
|
|
10
|
-
export class StatusMapper {
|
|
11
|
-
constructor(config) {
|
|
12
|
-
this.config = config;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Map SpecWeave status to external tool status
|
|
16
|
-
*/
|
|
17
|
-
mapToExternal(specweaveStatus, tool) {
|
|
18
|
-
const mappings = this.config.sync.statusSync.mappings[tool];
|
|
19
|
-
if (!mappings) {
|
|
20
|
-
throw new Error(`No status mappings configured for ${tool}`);
|
|
21
|
-
}
|
|
22
|
-
const mapping = mappings[specweaveStatus];
|
|
23
|
-
if (!mapping) {
|
|
24
|
-
throw new Error(`No mapping for status "${specweaveStatus}" in ${tool}`);
|
|
25
|
-
}
|
|
26
|
-
// Normalize to StatusMappingConfig
|
|
27
|
-
if (typeof mapping === 'string') {
|
|
28
|
-
return { state: mapping };
|
|
29
|
-
}
|
|
30
|
-
return mapping;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Map external tool status to SpecWeave status (reverse lookup)
|
|
34
|
-
*/
|
|
35
|
-
mapFromExternal(externalStatus, tool) {
|
|
36
|
-
const mappings = this.config.sync.statusSync.mappings[tool];
|
|
37
|
-
if (!mappings) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
for (const [specweaveStatus, mapping] of Object.entries(mappings)) {
|
|
41
|
-
const state = typeof mapping === 'string' ? mapping : mapping.state;
|
|
42
|
-
if (state === externalStatus) {
|
|
43
|
-
return specweaveStatus;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return null; // Unknown external status
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Validate status mapping configuration
|
|
50
|
-
*/
|
|
51
|
-
validate() {
|
|
52
|
-
const errors = [];
|
|
53
|
-
const requiredStatuses = [
|
|
54
|
-
'planning',
|
|
55
|
-
'active',
|
|
56
|
-
'paused',
|
|
57
|
-
'completed',
|
|
58
|
-
'abandoned'
|
|
59
|
-
];
|
|
60
|
-
for (const tool of ['github', 'jira', 'ado']) {
|
|
61
|
-
const mappings = this.config.sync.statusSync.mappings[tool];
|
|
62
|
-
if (!mappings) {
|
|
63
|
-
errors.push(`No mappings configured for ${tool}`);
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
for (const status of requiredStatuses) {
|
|
67
|
-
if (!mappings[status]) {
|
|
68
|
-
errors.push(`Missing mapping for "${status}" in ${tool}`);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
valid: errors.length === 0,
|
|
74
|
-
errors
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Get all required SpecWeave statuses
|
|
79
|
-
*/
|
|
80
|
-
getRequiredStatuses() {
|
|
81
|
-
return ['planning', 'active', 'paused', 'completed', 'abandoned'];
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Get all supported external tools
|
|
85
|
-
*/
|
|
86
|
-
getSupportedTools() {
|
|
87
|
-
return ['github', 'jira', 'ado'];
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=status-mapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status-mapper.js","sourceRoot":"","sources":["../../../../src/core/sync/status-mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA6CH,MAAM,OAAO,YAAY;IAGvB,YAAY,MAAkB;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;OAEG;IACI,aAAa,CAClB,eAAuB,EACvB,IAAkB;QAElB,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C,UAAU;YACV,QAAQ;YACR,QAAQ;YACR,WAAW;YACX,WAAW;SACZ,CAAC;QAEF,KAAK,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAU,EAAE,CAAC;YACtD,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAE5D,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,MAAM,CAAC,IAAI,CAAC,8BAA8B,IAAI,EAAE,CAAC,CAAC;gBAClD,SAAS;YACX,CAAC;YAED,KAAK,MAAM,MAAM,IAAI,gBAAgB,EAAE,CAAC;gBACtC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;oBACtB,MAAM,CAAC,IAAI,CAAC,wBAAwB,MAAM,QAAQ,IAAI,EAAE,CAAC,CAAC;gBAC5D,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;YAC1B,MAAM;SACP,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,mBAAmB;QACxB,OAAO,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACI,iBAAiB;QACtB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Status Sync Engine
|
|
3
|
-
*
|
|
4
|
-
* Core orchestration logic for status synchronization between SpecWeave
|
|
5
|
-
* increments and external tools (GitHub, JIRA, Azure DevOps).
|
|
6
|
-
*
|
|
7
|
-
* Responsibilities:
|
|
8
|
-
* - Orchestrate bidirectional status sync
|
|
9
|
-
* - Detect and resolve conflicts
|
|
10
|
-
* - Map statuses between SpecWeave and external tools
|
|
11
|
-
* - Respect user preferences (autoSync, promptUser, conflictResolution)
|
|
12
|
-
*/
|
|
13
|
-
import { StatusMappingConfig, ExternalTool, SpecWeaveStatus } from './status-mapper.js';
|
|
14
|
-
import { StatusConflict, ConflictResolution, ConflictResolutionStrategy } from './conflict-resolver.js';
|
|
15
|
-
export type SyncDirection = 'to-external' | 'from-external' | 'bidirectional';
|
|
16
|
-
export type SyncAction = 'no-sync-needed' | 'sync-to-external' | 'sync-from-external';
|
|
17
|
-
export interface SyncInput {
|
|
18
|
-
incrementId: string;
|
|
19
|
-
tool: ExternalTool;
|
|
20
|
-
localStatus: SpecWeaveStatus;
|
|
21
|
-
remoteStatus: string;
|
|
22
|
-
localTimestamp: string;
|
|
23
|
-
remoteTimestamp: string;
|
|
24
|
-
}
|
|
25
|
-
export interface SyncResult {
|
|
26
|
-
success: boolean;
|
|
27
|
-
direction: SyncDirection;
|
|
28
|
-
action: SyncAction;
|
|
29
|
-
conflict: StatusConflict | null;
|
|
30
|
-
resolution: ConflictResolution | null;
|
|
31
|
-
externalMapping: StatusMappingConfig | null;
|
|
32
|
-
error?: string;
|
|
33
|
-
wasAutomatic?: boolean;
|
|
34
|
-
wasPrompted?: boolean;
|
|
35
|
-
}
|
|
36
|
-
export interface StatusSyncConfig {
|
|
37
|
-
sync: {
|
|
38
|
-
statusSync: {
|
|
39
|
-
enabled: boolean;
|
|
40
|
-
autoSync?: boolean;
|
|
41
|
-
promptUser?: boolean;
|
|
42
|
-
conflictResolution?: ConflictResolutionStrategy;
|
|
43
|
-
mappings: {
|
|
44
|
-
github?: any;
|
|
45
|
-
jira?: any;
|
|
46
|
-
ado?: any;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Bulk sync input (multiple increments)
|
|
53
|
-
*/
|
|
54
|
-
export type BulkSyncInput = SyncInput;
|
|
55
|
-
/**
|
|
56
|
-
* Bulk sync options
|
|
57
|
-
*/
|
|
58
|
-
export interface BulkSyncOptions {
|
|
59
|
-
batchSize?: number;
|
|
60
|
-
delayMs?: number;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Individual sync result with increment ID
|
|
64
|
-
*/
|
|
65
|
-
export interface BulkSyncItemResult extends SyncResult {
|
|
66
|
-
incrementId: string;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Bulk sync result
|
|
70
|
-
*/
|
|
71
|
-
export interface BulkSyncResult {
|
|
72
|
-
totalItems: number;
|
|
73
|
-
successCount: number;
|
|
74
|
-
failureCount: number;
|
|
75
|
-
results: BulkSyncItemResult[];
|
|
76
|
-
duration: string;
|
|
77
|
-
}
|
|
78
|
-
export declare class StatusSyncEngine {
|
|
79
|
-
private mapper;
|
|
80
|
-
private resolver;
|
|
81
|
-
private config;
|
|
82
|
-
constructor(config: StatusSyncConfig);
|
|
83
|
-
/**
|
|
84
|
-
* Sync SpecWeave status to external tool (one-way: SpecWeave → External)
|
|
85
|
-
*
|
|
86
|
-
* @param input - Sync input with local/remote statuses
|
|
87
|
-
* @returns Sync result with conflict resolution details
|
|
88
|
-
*/
|
|
89
|
-
syncToExternal(input: SyncInput): Promise<SyncResult>;
|
|
90
|
-
/**
|
|
91
|
-
* Sync external status to SpecWeave (one-way: External → SpecWeave)
|
|
92
|
-
*
|
|
93
|
-
* @param input - Sync input with local/remote statuses
|
|
94
|
-
* @returns Sync result with conflict resolution details
|
|
95
|
-
*/
|
|
96
|
-
syncFromExternal(input: SyncInput): Promise<SyncResult>;
|
|
97
|
-
/**
|
|
98
|
-
* Three-permission sync (SpecWeave ↔ External)
|
|
99
|
-
*
|
|
100
|
-
* Detects conflict and resolves based on strategy.
|
|
101
|
-
* Syncs in the direction indicated by resolution.
|
|
102
|
-
*
|
|
103
|
-
* @param input - Sync input with local/remote statuses
|
|
104
|
-
* @returns Sync result with conflict resolution details
|
|
105
|
-
*/
|
|
106
|
-
bidirectionalSync(input: SyncInput): Promise<SyncResult>;
|
|
107
|
-
/**
|
|
108
|
-
* Bulk sync multiple increments to external tools
|
|
109
|
-
*
|
|
110
|
-
* Batches requests to avoid rate limiting.
|
|
111
|
-
* Adds delays between batches.
|
|
112
|
-
* Returns aggregate results with success/failure counts.
|
|
113
|
-
*
|
|
114
|
-
* @param inputs - Array of sync inputs
|
|
115
|
-
* @param options - Bulk sync options (batch size, delay)
|
|
116
|
-
* @returns Bulk sync result
|
|
117
|
-
*/
|
|
118
|
-
bulkSyncToExternal(inputs: BulkSyncInput[], options?: BulkSyncOptions): Promise<BulkSyncResult>;
|
|
119
|
-
/**
|
|
120
|
-
* Check if auto-sync is enabled
|
|
121
|
-
*
|
|
122
|
-
* @returns True if auto-sync is enabled
|
|
123
|
-
*/
|
|
124
|
-
isAutoSyncEnabled(): boolean;
|
|
125
|
-
/**
|
|
126
|
-
* Check if user should be prompted
|
|
127
|
-
*
|
|
128
|
-
* @returns True if user should be prompted (default: true)
|
|
129
|
-
*/
|
|
130
|
-
shouldPromptUser(): boolean;
|
|
131
|
-
/**
|
|
132
|
-
* Execute automatic sync without prompting
|
|
133
|
-
*
|
|
134
|
-
* Validates that auto-sync is enabled.
|
|
135
|
-
* Handles errors gracefully (doesn't throw, returns error in result).
|
|
136
|
-
*
|
|
137
|
-
* @param input - Sync input
|
|
138
|
-
* @returns Sync result with wasAutomatic flag
|
|
139
|
-
*/
|
|
140
|
-
executeAutoSync(input: SyncInput): Promise<SyncResult>;
|
|
141
|
-
/**
|
|
142
|
-
* Calculate batches from input array
|
|
143
|
-
*
|
|
144
|
-
* @param inputs - Array of inputs
|
|
145
|
-
* @param batchSize - Size of each batch
|
|
146
|
-
* @returns Array of batches
|
|
147
|
-
*/
|
|
148
|
-
private calculateBatches;
|
|
149
|
-
/**
|
|
150
|
-
* Delay execution for specified milliseconds
|
|
151
|
-
*
|
|
152
|
-
* @param ms - Milliseconds to delay
|
|
153
|
-
*/
|
|
154
|
-
private delay;
|
|
155
|
-
/**
|
|
156
|
-
* Validate that status synchronization is enabled
|
|
157
|
-
*
|
|
158
|
-
* @throws Error if sync is disabled
|
|
159
|
-
*/
|
|
160
|
-
private validateSyncEnabled;
|
|
161
|
-
}
|
|
162
|
-
//# sourceMappingURL=status-sync-engine.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status-sync-engine.d.ts","sourceRoot":"","sources":["../../../../src/core/sync/status-sync-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAgB,mBAAmB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACtG,OAAO,EAAoB,cAAc,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAE1H,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,eAAe,GAAG,eAAe,CAAC;AAE9E,MAAM,MAAM,UAAU,GAClB,gBAAgB,GAChB,kBAAkB,GAClB,oBAAoB,CAAC;AAEzB,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,eAAe,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,aAAa,CAAC;IACzB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACtC,eAAe,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE;QACJ,UAAU,EAAE;Y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