@shepai/cli 1.108.0-pr332.8cf962c → 1.108.0-pr336.2b9e458
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/dist/packages/core/src/infrastructure/persistence/sqlite/migrations.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations.js +0 -12
- package/dist/packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.d.ts +2 -13
- package/dist/packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.js +3 -80
- package/dist/src/presentation/cli/commands/ui.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/ui.command.js +1 -3
- package/dist/src/presentation/web/app/actions/get-feature-drawer-data.d.ts +0 -3
- package/dist/src/presentation/web/app/actions/get-feature-drawer-data.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/get-feature-drawer-data.js +32 -7
- package/dist/src/presentation/web/dev-server.js +1 -3
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +1 -1
- package/web/.next/required-server-files.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +20 -20
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_a1104008.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_a1104008.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_92642200.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_92642200.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__039967e3._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__039967e3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__07a39ff2._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__07a39ff2._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0880ff0e._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0880ff0e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__23b5ca2c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__23b5ca2c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__24dd0927._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2773312c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2773312c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__52485955._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5edfc56b._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5edfc56b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__684a868c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__684a868c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6eb2a2b0._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6eb2a2b0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__89e8a5cc._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8c88ef55._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8c88ef55._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c16bf5de._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c16bf5de._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c9777776._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c9777776._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__cbd8062c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__cbd8062c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e70c5627._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e70c5627._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_45b7d3eb._.js → _2e327754._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_45b7d3eb._.js.map → _2e327754._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_5ddf836c._.js → _5ffdac22._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_5ddf836c._.js.map → _5ffdac22._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_fc8685d7._.js → _67212c06._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_fc8685d7._.js.map → _67212c06._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_888633e1.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_888633e1.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_global-error_tsx_14c389b5._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ce7cbc3c._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_ce7cbc3c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_e2604413._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_e2604413._.js.map +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +31 -31
- package/web/.next/static/chunks/{db8326cb0236e4a7.js → 04b121d0b16f6b98.js} +1 -1
- package/web/.next/static/chunks/{95604c1ec5bdb960.js → 5a31cf2cb9ca4d2e.js} +1 -1
- package/web/.next/static/chunks/{6e96bceeaf056aa2.js → 66786ccc87e49bb4.js} +1 -1
- package/web/.next/static/chunks/{ee9f1f905411e3ba.js → 79319b844432f7c8.js} +1 -1
- package/web/.next/static/chunks/{c8ca2125f658ddd5.js → 7c5b62bb3e064a45.js} +1 -1
- package/web/.next/static/chunks/{532f0c713d1969b7.js → 9a98adf806f4006b.js} +1 -1
- package/web/.next/static/chunks/{f95307a5e64df918.js → c7b9d1b6222c9b38.js} +1 -1
- package/web/.next/static/chunks/c842c8ea06cf4dce.js +2 -0
- package/web/.next/static/chunks/{0a0206ad1fc60d8e.js → cd8fbe1136e8fc20.js} +2 -2
- package/web/.next/static/chunks/{753ffe2d4d6d04e7.js → ffcb9f4667a9868b.js} +1 -1
- package/web/.next/static/chunks/d1b86569309f86ed.js +0 -2
- /package/web/.next/static/{jKP4x-I_CWWBxvSpUJF0y → -nUEwAzhjD5orQOIIPcy-}/_buildManifest.js +0 -0
- /package/web/.next/static/{jKP4x-I_CWWBxvSpUJF0y → -nUEwAzhjD5orQOIIPcy-}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{jKP4x-I_CWWBxvSpUJF0y → -nUEwAzhjD5orQOIIPcy-}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/persistence/sqlite/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/persistence/sqlite/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAggB3C;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAA4C,CAAC;AAE/E;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CA4B9E"}
|
|
@@ -499,18 +499,6 @@ WHERE repository_path NOT IN (SELECT path FROM repositories WHERE path IS NOT NU
|
|
|
499
499
|
// Migration 032: Change envDeploy feature flag default to enabled (1).
|
|
500
500
|
sql: `UPDATE settings SET feature_flag_env_deploy = 1 WHERE feature_flag_env_deploy = 0;`,
|
|
501
501
|
},
|
|
502
|
-
{
|
|
503
|
-
version: 33,
|
|
504
|
-
sql: `
|
|
505
|
-
-- Migration 033: Create pr_sync_lock table for cross-process poll coordination
|
|
506
|
-
CREATE TABLE IF NOT EXISTS pr_sync_lock (
|
|
507
|
-
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
508
|
-
locked_by TEXT NOT NULL,
|
|
509
|
-
locked_at INTEGER NOT NULL,
|
|
510
|
-
expires_at INTEGER NOT NULL
|
|
511
|
-
);
|
|
512
|
-
`,
|
|
513
|
-
},
|
|
514
502
|
];
|
|
515
503
|
/**
|
|
516
504
|
* The latest schema version (highest migration version number).
|
|
@@ -13,7 +13,6 @@ import type { IFeatureRepository } from '../../../application/ports/output/repos
|
|
|
13
13
|
import type { IAgentRunRepository } from '../../../application/ports/output/agents/agent-run-repository.interface.js';
|
|
14
14
|
import type { IGitPrService } from '../../../application/ports/output/services/git-pr-service.interface.js';
|
|
15
15
|
import type { INotificationService } from '../../../application/ports/output/services/notification-service.interface.js';
|
|
16
|
-
import type Database from 'better-sqlite3';
|
|
17
16
|
export declare class PrSyncWatcherService {
|
|
18
17
|
private readonly featureRepo;
|
|
19
18
|
private readonly agentRunRepo;
|
|
@@ -22,22 +21,12 @@ export declare class PrSyncWatcherService {
|
|
|
22
21
|
private readonly pollIntervalMs;
|
|
23
22
|
private readonly trackedFeatures;
|
|
24
23
|
private readonly skippedRepos;
|
|
25
|
-
private readonly rateLimitedUntil;
|
|
26
|
-
private readonly db;
|
|
27
|
-
private readonly processId;
|
|
28
24
|
private intervalId;
|
|
29
|
-
|
|
30
|
-
constructor(featureRepo: IFeatureRepository, agentRunRepo: IAgentRunRepository, gitPrService: IGitPrService, notificationService: INotificationService, pollIntervalMs?: number, db?: Database.Database | null);
|
|
25
|
+
constructor(featureRepo: IFeatureRepository, agentRunRepo: IAgentRunRepository, gitPrService: IGitPrService, notificationService: INotificationService, pollIntervalMs?: number);
|
|
31
26
|
isRunning(): boolean;
|
|
32
27
|
start(): void;
|
|
33
28
|
stop(): void;
|
|
34
|
-
/** Attempt to acquire the cross-process poll lock. Returns true if acquired. */
|
|
35
|
-
private tryAcquireLock;
|
|
36
|
-
/** Check if a feature should be polled this cycle based on its unchanged cycles count. */
|
|
37
|
-
private shouldPollFeature;
|
|
38
29
|
private poll;
|
|
39
|
-
private isRateLimited;
|
|
40
|
-
private handleRateLimitError;
|
|
41
30
|
private processRepository;
|
|
42
31
|
private processFeature;
|
|
43
32
|
/** Mark associated agent run as completed so the UI reflects "done" state. */
|
|
@@ -50,7 +39,7 @@ export declare class PrSyncWatcherService {
|
|
|
50
39
|
*
|
|
51
40
|
* @throws Error if the watcher is already initialized
|
|
52
41
|
*/
|
|
53
|
-
export declare function initializePrSyncWatcher(featureRepo: IFeatureRepository, agentRunRepo: IAgentRunRepository, gitPrService: IGitPrService, notificationService: INotificationService, pollIntervalMs?: number
|
|
42
|
+
export declare function initializePrSyncWatcher(featureRepo: IFeatureRepository, agentRunRepo: IAgentRunRepository, gitPrService: IGitPrService, notificationService: INotificationService, pollIntervalMs?: number): void;
|
|
54
43
|
/**
|
|
55
44
|
* Get the PR sync watcher singleton.
|
|
56
45
|
*
|
package/dist/packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr-sync-watcher.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gFAAgF,CAAC;AACzH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4EAA4E,CAAC;AACtH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wEAAwE,CAAC;AAK5G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8EAA8E,CAAC;
|
|
1
|
+
{"version":3,"file":"pr-sync-watcher.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAWH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gFAAgF,CAAC;AACzH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4EAA4E,CAAC;AACtH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wEAAwE,CAAC;AAK5G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8EAA8E,CAAC;AAkBzH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IACjD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsB;IACnD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgB;IAC7C,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAuB;IAC3D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAqC;IACrE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAqB;IAClD,OAAO,CAAC,UAAU,CAA+C;gBAG/D,WAAW,EAAE,kBAAkB,EAC/B,YAAY,EAAE,mBAAmB,EACjC,YAAY,EAAE,aAAa,EAC3B,mBAAmB,EAAE,oBAAoB,EACzC,cAAc,GAAE,MAAiC;IASnD,SAAS,IAAI,OAAO;IAIpB,KAAK,IAAI,IAAI;IAcb,IAAI,IAAI,IAAI;YASE,IAAI;YAuCJ,iBAAiB;YA6CjB,cAAc;IAyK5B,8EAA8E;YAChE,gBAAgB;IAW9B,OAAO,CAAC,gBAAgB;CAoBzB;AAMD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,kBAAkB,EAC/B,YAAY,EAAE,mBAAmB,EACjC,YAAY,EAAE,aAAa,EAC3B,mBAAmB,EAAE,oBAAoB,EACzC,cAAc,CAAC,EAAE,MAAM,GACtB,IAAI,CAYN;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,oBAAoB,CAQvD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAKzC"}
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { SdlcLifecycle, PrStatus, CiStatus, AgentRunStatus, NotificationEventType, NotificationSeverity, } from '../../../domain/generated/output.js';
|
|
13
13
|
const DEFAULT_POLL_INTERVAL_MS = 30_000;
|
|
14
|
-
const LOCK_TTL_MS = 60_000;
|
|
15
|
-
const RATE_LIMIT_BACKOFF_MS = 5 * 60_000;
|
|
16
14
|
const TAG = '[PrSyncWatcher]';
|
|
17
15
|
const CI_STATUS_MAP = {
|
|
18
16
|
success: CiStatus.Success,
|
|
@@ -27,19 +25,13 @@ export class PrSyncWatcherService {
|
|
|
27
25
|
pollIntervalMs;
|
|
28
26
|
trackedFeatures = new Map();
|
|
29
27
|
skippedRepos = new Set();
|
|
30
|
-
rateLimitedUntil = new Map();
|
|
31
|
-
db;
|
|
32
|
-
processId;
|
|
33
28
|
intervalId = null;
|
|
34
|
-
|
|
35
|
-
constructor(featureRepo, agentRunRepo, gitPrService, notificationService, pollIntervalMs = DEFAULT_POLL_INTERVAL_MS, db = null) {
|
|
29
|
+
constructor(featureRepo, agentRunRepo, gitPrService, notificationService, pollIntervalMs = DEFAULT_POLL_INTERVAL_MS) {
|
|
36
30
|
this.featureRepo = featureRepo;
|
|
37
31
|
this.agentRunRepo = agentRunRepo;
|
|
38
32
|
this.gitPrService = gitPrService;
|
|
39
33
|
this.notificationService = notificationService;
|
|
40
34
|
this.pollIntervalMs = pollIntervalMs;
|
|
41
|
-
this.db = db;
|
|
42
|
-
this.processId = `${process.pid}-${Date.now()}`;
|
|
43
35
|
}
|
|
44
36
|
isRunning() {
|
|
45
37
|
return this.intervalId !== null;
|
|
@@ -63,40 +55,8 @@ export class PrSyncWatcherService {
|
|
|
63
55
|
console.log(`${TAG} Stopped`);
|
|
64
56
|
}
|
|
65
57
|
}
|
|
66
|
-
/** Attempt to acquire the cross-process poll lock. Returns true if acquired. */
|
|
67
|
-
tryAcquireLock() {
|
|
68
|
-
if (!this.db)
|
|
69
|
-
return true; // no DB → single-process mode, always proceed
|
|
70
|
-
const now = Date.now();
|
|
71
|
-
const expiresAt = now + LOCK_TTL_MS;
|
|
72
|
-
const stmt = this.db.prepare(`
|
|
73
|
-
INSERT OR REPLACE INTO pr_sync_lock (id, locked_by, locked_at, expires_at)
|
|
74
|
-
SELECT 1, ?, ?, ?
|
|
75
|
-
WHERE NOT EXISTS (
|
|
76
|
-
SELECT 1 FROM pr_sync_lock WHERE id = 1 AND locked_by != ? AND expires_at > ?
|
|
77
|
-
)
|
|
78
|
-
`);
|
|
79
|
-
const result = stmt.run(this.processId, now, expiresAt, this.processId, now);
|
|
80
|
-
return result.changes > 0;
|
|
81
|
-
}
|
|
82
|
-
/** Check if a feature should be polled this cycle based on its unchanged cycles count. */
|
|
83
|
-
shouldPollFeature(featureId) {
|
|
84
|
-
const tracked = this.trackedFeatures.get(featureId);
|
|
85
|
-
if (!tracked)
|
|
86
|
-
return true; // new feature, always poll
|
|
87
|
-
const uc = tracked.unchangedCycles;
|
|
88
|
-
if (uc <= 2)
|
|
89
|
-
return true; // poll every cycle
|
|
90
|
-
if (uc <= 5)
|
|
91
|
-
return this.pollCycle % 2 === 0; // poll every 2nd cycle
|
|
92
|
-
return this.pollCycle % 4 === 0; // poll every 4th cycle
|
|
93
|
-
}
|
|
94
58
|
async poll() {
|
|
95
59
|
try {
|
|
96
|
-
if (!this.tryAcquireLock()) {
|
|
97
|
-
return; // another process holds the lock — skip this cycle
|
|
98
|
-
}
|
|
99
|
-
this.pollCycle++;
|
|
100
60
|
const allFeatures = await this.featureRepo.list({ lifecycle: SdlcLifecycle.Review });
|
|
101
61
|
// Include features with a valid repositoryPath (with or without PR data)
|
|
102
62
|
const features = allFeatures.filter((f) => f.repositoryPath);
|
|
@@ -129,32 +89,9 @@ export class PrSyncWatcherService {
|
|
|
129
89
|
console.warn(`${TAG} Poll failed: ${msg}`);
|
|
130
90
|
}
|
|
131
91
|
}
|
|
132
|
-
isRateLimited(repoPath) {
|
|
133
|
-
const until = this.rateLimitedUntil.get(repoPath);
|
|
134
|
-
if (until === undefined)
|
|
135
|
-
return false;
|
|
136
|
-
if (Date.now() >= until) {
|
|
137
|
-
this.rateLimitedUntil.delete(repoPath);
|
|
138
|
-
// eslint-disable-next-line no-console
|
|
139
|
-
console.log(`${TAG} Rate limit backoff expired for ${repoPath}`);
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
return true;
|
|
143
|
-
}
|
|
144
|
-
handleRateLimitError(repoPath, error) {
|
|
145
|
-
const msg = error.message;
|
|
146
|
-
if (msg.includes('API rate limit exceeded') || msg.includes('rate limit')) {
|
|
147
|
-
const backoffUntil = Date.now() + RATE_LIMIT_BACKOFF_MS;
|
|
148
|
-
this.rateLimitedUntil.set(repoPath, backoffUntil);
|
|
149
|
-
// eslint-disable-next-line no-console
|
|
150
|
-
console.warn(`${TAG} Rate limited for ${repoPath}, backing off until ${new Date(backoffUntil).toISOString()}`);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
92
|
async processRepository(repoPath, features) {
|
|
154
93
|
if (this.skippedRepos.has(repoPath))
|
|
155
94
|
return;
|
|
156
|
-
if (this.isRateLimited(repoPath))
|
|
157
|
-
return;
|
|
158
95
|
// Skip repos without a git remote — gh pr list will always fail
|
|
159
96
|
try {
|
|
160
97
|
if (!(await this.gitPrService.hasRemote(repoPath))) {
|
|
@@ -173,8 +110,6 @@ export class PrSyncWatcherService {
|
|
|
173
110
|
}
|
|
174
111
|
catch (error) {
|
|
175
112
|
const msg = error instanceof Error ? error.message : String(error);
|
|
176
|
-
if (error instanceof Error)
|
|
177
|
-
this.handleRateLimitError(repoPath, error);
|
|
178
113
|
// eslint-disable-next-line no-console
|
|
179
114
|
console.warn(`${TAG} listPrStatuses failed for ${repoPath}: ${msg}`);
|
|
180
115
|
return;
|
|
@@ -218,15 +153,10 @@ export class PrSyncWatcherService {
|
|
|
218
153
|
ciStatus: undefined,
|
|
219
154
|
mergeable: undefined,
|
|
220
155
|
featureName: feature.name,
|
|
221
|
-
unchangedCycles: 0,
|
|
222
156
|
});
|
|
223
157
|
await this.featureRepo.update(feature);
|
|
224
158
|
return;
|
|
225
159
|
}
|
|
226
|
-
// Check exponential backoff — skip features that haven't changed recently
|
|
227
|
-
if (!this.shouldPollFeature(feature.id)) {
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
160
|
const pr = feature.pr;
|
|
231
161
|
const prStatusInfo = statusByNumber.get(pr.number);
|
|
232
162
|
let needsUpdate = false;
|
|
@@ -239,7 +169,6 @@ export class PrSyncWatcherService {
|
|
|
239
169
|
ciStatus: pr.ciStatus,
|
|
240
170
|
mergeable: pr.mergeable,
|
|
241
171
|
featureName: feature.name,
|
|
242
|
-
unchangedCycles: 0,
|
|
243
172
|
});
|
|
244
173
|
}
|
|
245
174
|
const tracked = this.trackedFeatures.get(feature.id);
|
|
@@ -294,18 +223,12 @@ export class PrSyncWatcherService {
|
|
|
294
223
|
}
|
|
295
224
|
catch (error) {
|
|
296
225
|
const msg = error instanceof Error ? error.message : String(error);
|
|
297
|
-
if (error instanceof Error)
|
|
298
|
-
this.handleRateLimitError(feature.repositoryPath, error);
|
|
299
226
|
// eslint-disable-next-line no-console
|
|
300
227
|
console.warn(`${TAG} getCiStatus failed for "${feature.name}": ${msg}`);
|
|
301
228
|
}
|
|
302
229
|
if (needsUpdate) {
|
|
303
|
-
tracked.unchangedCycles = 0;
|
|
304
230
|
await this.featureRepo.update(feature);
|
|
305
231
|
}
|
|
306
|
-
else {
|
|
307
|
-
tracked.unchangedCycles++;
|
|
308
|
-
}
|
|
309
232
|
}
|
|
310
233
|
/** Mark associated agent run as completed so the UI reflects "done" state. */
|
|
311
234
|
async completeAgentRun(feature) {
|
|
@@ -341,11 +264,11 @@ let watcherInstance = null;
|
|
|
341
264
|
*
|
|
342
265
|
* @throws Error if the watcher is already initialized
|
|
343
266
|
*/
|
|
344
|
-
export function initializePrSyncWatcher(featureRepo, agentRunRepo, gitPrService, notificationService, pollIntervalMs
|
|
267
|
+
export function initializePrSyncWatcher(featureRepo, agentRunRepo, gitPrService, notificationService, pollIntervalMs) {
|
|
345
268
|
if (watcherInstance !== null) {
|
|
346
269
|
throw new Error('PR sync watcher already initialized. Cannot re-initialize.');
|
|
347
270
|
}
|
|
348
|
-
watcherInstance = new PrSyncWatcherService(featureRepo, agentRunRepo, gitPrService, notificationService, pollIntervalMs
|
|
271
|
+
watcherInstance = new PrSyncWatcherService(featureRepo, agentRunRepo, gitPrService, notificationService, pollIntervalMs);
|
|
349
272
|
}
|
|
350
273
|
/**
|
|
351
274
|
* Get the PR sync watcher singleton.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.command.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/commands/ui.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAwB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ui.command.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/commands/ui.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAwB,MAAM,WAAW,CAAC;AA+B1D;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAkFzC"}
|
|
@@ -21,7 +21,6 @@ import { setVersionEnvVars } from '../../../../packages/core/src/infrastructure/
|
|
|
21
21
|
import { resolveWebDir } from '../../../../packages/core/src/infrastructure/services/web-server.service.js';
|
|
22
22
|
import { initializeNotificationWatcher, getNotificationWatcher, } from '../../../../packages/core/src/infrastructure/services/notifications/notification-watcher.service.js';
|
|
23
23
|
import { initializePrSyncWatcher, getPrSyncWatcher, } from '../../../../packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.js';
|
|
24
|
-
import { getExistingConnection } from '../../../../packages/core/src/infrastructure/persistence/sqlite/connection.js';
|
|
25
24
|
import { BrowserOpenerService } from '../../../../packages/core/src/infrastructure/services/browser-opener.service.js';
|
|
26
25
|
import { colors, fmt, messages } from '../ui/index.js';
|
|
27
26
|
function parsePort(value) {
|
|
@@ -67,8 +66,7 @@ Examples:
|
|
|
67
66
|
getNotificationWatcher().start();
|
|
68
67
|
// Start PR sync watcher to detect PR/CI status transitions on GitHub
|
|
69
68
|
const gitPrService = container.resolve('IGitPrService');
|
|
70
|
-
|
|
71
|
-
initializePrSyncWatcher(featureRepo, runRepo, gitPrService, notificationService, undefined, db);
|
|
69
|
+
initializePrSyncWatcher(featureRepo, runRepo, gitPrService, notificationService);
|
|
72
70
|
getPrSyncWatcher().start();
|
|
73
71
|
const url = `http://localhost:${port}`;
|
|
74
72
|
messages.success(`Server ready at ${fmt.code(url)}`);
|
|
@@ -3,9 +3,6 @@ import type { FeatureNodeData } from '../../components/common/feature-node/index
|
|
|
3
3
|
* Fetches full FeatureNodeData for a given feature ID.
|
|
4
4
|
* Used by the drawer for targeted data syncing without triggering
|
|
5
5
|
* a full router.refresh() / server component re-render.
|
|
6
|
-
*
|
|
7
|
-
* CI status and mergeable status are read from the DB (already updated
|
|
8
|
-
* by PrSyncWatcherService) instead of making duplicate GitHub API calls.
|
|
9
6
|
*/
|
|
10
7
|
export declare function getFeatureDrawerData(featureId: string): Promise<FeatureNodeData | null>;
|
|
11
8
|
//# sourceMappingURL=get-feature-drawer-data.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-feature-drawer-data.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/get-feature-drawer-data.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-feature-drawer-data.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/get-feature-drawer-data.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAQxE;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAsD7F"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
'use server';
|
|
2
2
|
import { resolve } from '../../lib/server-container.js';
|
|
3
|
+
import { CiStatus } from '../../../../../packages/core/src/domain/generated/output.js';
|
|
3
4
|
import { buildFeatureNodeData } from '../build-feature-node-data.js';
|
|
5
|
+
const CI_STATUS_MAP = {
|
|
6
|
+
success: CiStatus.Success,
|
|
7
|
+
failure: CiStatus.Failure,
|
|
8
|
+
pending: CiStatus.Pending,
|
|
9
|
+
};
|
|
4
10
|
/**
|
|
5
11
|
* Fetches full FeatureNodeData for a given feature ID.
|
|
6
12
|
* Used by the drawer for targeted data syncing without triggering
|
|
7
13
|
* a full router.refresh() / server component re-render.
|
|
8
|
-
*
|
|
9
|
-
* CI status and mergeable status are read from the DB (already updated
|
|
10
|
-
* by PrSyncWatcherService) instead of making duplicate GitHub API calls.
|
|
11
14
|
*/
|
|
12
15
|
export async function getFeatureDrawerData(featureId) {
|
|
13
16
|
try {
|
|
@@ -20,15 +23,37 @@ export async function getFeatureDrawerData(featureId) {
|
|
|
20
23
|
if (!feature)
|
|
21
24
|
return null;
|
|
22
25
|
const run = feature.agentRunId ? await agentRunRepo.findById(feature.agentRunId) : null;
|
|
23
|
-
|
|
24
|
-
// PrSyncWatcherService every 30s) — no duplicate GitHub API calls needed.
|
|
25
|
-
// Only getDefaultBranch and getRemoteUrl are kept as they are local git operations.
|
|
26
|
-
const [repo, baseBranch, artifact, remoteUrl] = await Promise.all([
|
|
26
|
+
const [repo, baseBranch, artifact, remoteUrl, liveMergeable, liveCiResult] = await Promise.all([
|
|
27
27
|
repoRepo.findByPath(feature.repositoryPath).catch(() => null),
|
|
28
28
|
gitPrService.getDefaultBranch(feature.repositoryPath).catch(() => 'main'),
|
|
29
29
|
getArtifact.execute(featureId).catch(() => null),
|
|
30
30
|
gitPrService.getRemoteUrl(feature.repositoryPath).catch(() => null),
|
|
31
|
+
feature.pr?.number
|
|
32
|
+
? gitPrService
|
|
33
|
+
.getMergeableStatus(feature.repositoryPath, feature.pr.number)
|
|
34
|
+
.catch(() => undefined)
|
|
35
|
+
: Promise.resolve(undefined),
|
|
36
|
+
feature.branch
|
|
37
|
+
? gitPrService.getCiStatus(feature.repositoryPath, feature.branch).catch(() => undefined)
|
|
38
|
+
: Promise.resolve(undefined),
|
|
31
39
|
]);
|
|
40
|
+
// Merge live PR status into feature data
|
|
41
|
+
if (feature.pr) {
|
|
42
|
+
const liveCiStatus = liveCiResult
|
|
43
|
+
? (CI_STATUS_MAP[liveCiResult.status] ?? CiStatus.Pending)
|
|
44
|
+
: undefined;
|
|
45
|
+
const updates = {};
|
|
46
|
+
if (liveMergeable !== undefined)
|
|
47
|
+
updates.mergeable = liveMergeable;
|
|
48
|
+
if (liveCiStatus !== undefined)
|
|
49
|
+
updates.ciStatus = liveCiStatus;
|
|
50
|
+
if (Object.keys(updates).length > 0) {
|
|
51
|
+
feature.pr = { ...feature.pr, ...updates };
|
|
52
|
+
featureRepo.update(feature).catch(() => {
|
|
53
|
+
/* best-effort persist */
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
32
57
|
return buildFeatureNodeData(feature, run, {
|
|
33
58
|
repositoryName: repo?.name,
|
|
34
59
|
baseBranch,
|
|
@@ -19,7 +19,6 @@ import { InitializeSettingsUseCase } from '../../../packages/core/src/applicatio
|
|
|
19
19
|
import { initializeSettings } from '../../../packages/core/src/infrastructure/services/settings.service.js';
|
|
20
20
|
import { initializeNotificationWatcher, getNotificationWatcher, } from '../../../packages/core/src/infrastructure/services/notifications/notification-watcher.service.js';
|
|
21
21
|
import { initializePrSyncWatcher, getPrSyncWatcher, } from '../../../packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.js';
|
|
22
|
-
import { getExistingConnection } from '../../../packages/core/src/infrastructure/persistence/sqlite/connection.js';
|
|
23
22
|
const DEFAULT_PORT = 3000;
|
|
24
23
|
async function isPortAvailable(port) {
|
|
25
24
|
return new Promise((resolve) => {
|
|
@@ -65,8 +64,7 @@ async function main() {
|
|
|
65
64
|
getNotificationWatcher().start();
|
|
66
65
|
// Start PR sync watcher to detect PR/CI status transitions on GitHub
|
|
67
66
|
const gitPrService = container.resolve('IGitPrService');
|
|
68
|
-
|
|
69
|
-
initializePrSyncWatcher(featureRepo, runRepo, gitPrService, notificationService, undefined, db);
|
|
67
|
+
initializePrSyncWatcher(featureRepo, runRepo, gitPrService, notificationService);
|
|
70
68
|
getPrSyncWatcher().start();
|
|
71
69
|
}
|
|
72
70
|
catch (error) {
|