@shepai/cli 1.107.1-pr331.6d15c65 → 1.107.1-pr332.9596579
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 +12 -0
- package/dist/packages/core/src/infrastructure/services/pr-sync/pr-sync-watcher.service.d.ts +13 -2
- 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 +80 -3
- package/dist/src/presentation/cli/commands/ui.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/ui.command.js +3 -1
- package/dist/src/presentation/web/app/actions/get-feature-drawer-data.d.ts +3 -0
- 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 +7 -32
- package/dist/src/presentation/web/app/build-feature-node-data.d.ts.map +1 -1
- package/dist/src/presentation/web/app/build-feature-node-data.js +0 -1
- package/dist/src/presentation/web/app/build-graph-nodes.js +0 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +4 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.stories.js +0 -4
- package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts +0 -2
- package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts.map +1 -1
- package/dist/src/presentation/web/dev-server.js +3 -1
- 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/403f9_next_dist_esm_build_templates_app-route_370c43b1.js +1 -1
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js.map +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]__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]__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]__5d87af2e._.js +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]__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]__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/{_009b553a._.js → _26322be1._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_009b553a._.js.map → _26322be1._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_fbe2e6ed._.js → _6dc86a79._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_fbe2e6ed._.js.map → _6dc86a79._.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/{_5e8e6f99._.js → _b00b81e2._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_5e8e6f99._.js.map → _b00b81e2._.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_ca99d62d._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js.map +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_bf50c527._.js.map +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_de814675._.js.map +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/{f331e267f1008da7.js → 0aebfe0cc138d8e5.js} +1 -1
- package/web/.next/static/chunks/{83f3c9e9d0e63222.js → 459bde4dc76e7515.js} +1 -1
- package/web/.next/static/chunks/{219c9142273c0178.js → 6dc8ef32b30d7a72.js} +1 -1
- package/web/.next/static/chunks/{61d699f0a9ff3f82.js → 97a78353a41c1e0e.js} +1 -1
- package/web/.next/static/chunks/{38e37ef0a31d0171.js → b87e4a6c062c042b.js} +1 -1
- package/web/.next/static/chunks/{0f013bbb33d20ba8.js → c84e66417125d965.js} +1 -1
- package/web/.next/static/chunks/{2df3e7b6fb1a3f5e.js → d6ec0d0994e29654.js} +1 -1
- package/web/.next/static/chunks/{441bebf02ac97580.js → d818bd28902d366f.js} +2 -2
- package/web/.next/static/chunks/{e5fefd347d73627e.js → e17acc20b8dedaf9.js} +1 -1
- package/web/.next/static/chunks/{aa31bebcdb75e47c.js → e33142f775d270e4.js} +1 -1
- /package/web/.next/static/{KbVNq18_7alcOz7YTGgnN → u6uJlyVULGtO2gAWwb7dm}/_buildManifest.js +0 -0
- /package/web/.next/static/{KbVNq18_7alcOz7YTGgnN → u6uJlyVULGtO2gAWwb7dm}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{KbVNq18_7alcOz7YTGgnN → u6uJlyVULGtO2gAWwb7dm}/_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;AA4gB3C;;;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,6 +499,18 @@ 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
|
+
},
|
|
502
514
|
];
|
|
503
515
|
/**
|
|
504
516
|
* The latest schema version (highest migration version number).
|
|
@@ -13,6 +13,7 @@ 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';
|
|
16
17
|
export declare class PrSyncWatcherService {
|
|
17
18
|
private readonly featureRepo;
|
|
18
19
|
private readonly agentRunRepo;
|
|
@@ -21,12 +22,22 @@ export declare class PrSyncWatcherService {
|
|
|
21
22
|
private readonly pollIntervalMs;
|
|
22
23
|
private readonly trackedFeatures;
|
|
23
24
|
private readonly skippedRepos;
|
|
25
|
+
private readonly rateLimitedUntil;
|
|
26
|
+
private readonly db;
|
|
27
|
+
private readonly processId;
|
|
24
28
|
private intervalId;
|
|
25
|
-
|
|
29
|
+
private pollCycle;
|
|
30
|
+
constructor(featureRepo: IFeatureRepository, agentRunRepo: IAgentRunRepository, gitPrService: IGitPrService, notificationService: INotificationService, pollIntervalMs?: number, db?: Database.Database | null);
|
|
26
31
|
isRunning(): boolean;
|
|
27
32
|
start(): void;
|
|
28
33
|
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;
|
|
29
38
|
private poll;
|
|
39
|
+
private isRateLimited;
|
|
40
|
+
private handleRateLimitError;
|
|
30
41
|
private processRepository;
|
|
31
42
|
private processFeature;
|
|
32
43
|
/** Mark associated agent run as completed so the UI reflects "done" state. */
|
|
@@ -39,7 +50,7 @@ export declare class PrSyncWatcherService {
|
|
|
39
50
|
*
|
|
40
51
|
* @throws Error if the watcher is already initialized
|
|
41
52
|
*/
|
|
42
|
-
export declare function initializePrSyncWatcher(featureRepo: IFeatureRepository, agentRunRepo: IAgentRunRepository, gitPrService: IGitPrService, notificationService: INotificationService, pollIntervalMs?: number): void;
|
|
53
|
+
export declare function initializePrSyncWatcher(featureRepo: IFeatureRepository, agentRunRepo: IAgentRunRepository, gitPrService: IGitPrService, notificationService: INotificationService, pollIntervalMs?: number, db?: Database.Database | null): void;
|
|
43
54
|
/**
|
|
44
55
|
* Get the PR sync watcher singleton.
|
|
45
56
|
*
|
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;AACzH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAqB3C,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,QAAQ,CAAC,gBAAgB,CAA6B;IAC9D,OAAO,CAAC,QAAQ,CAAC,EAAE,CAA2B;IAC9C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,UAAU,CAA+C;IACjE,OAAO,CAAC,SAAS,CAAK;gBAGpB,WAAW,EAAE,kBAAkB,EAC/B,YAAY,EAAE,mBAAmB,EACjC,YAAY,EAAE,aAAa,EAC3B,mBAAmB,EAAE,oBAAoB,EACzC,cAAc,GAAE,MAAiC,EACjD,EAAE,GAAE,QAAQ,CAAC,QAAQ,GAAG,IAAW;IAWrC,SAAS,IAAI,OAAO;IAIpB,KAAK,IAAI,IAAI;IAcb,IAAI,IAAI,IAAI;IASZ,gFAAgF;IAChF,OAAO,CAAC,cAAc;IAiBtB,0FAA0F;IAC1F,OAAO,CAAC,iBAAiB;YAUX,IAAI;IA6ClB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,oBAAoB;YAYd,iBAAiB;YA+CjB,cAAc;IAoL5B,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,EACvB,EAAE,CAAC,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI,GAC5B,IAAI,CAaN;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,6 +11,8 @@
|
|
|
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;
|
|
14
16
|
const TAG = '[PrSyncWatcher]';
|
|
15
17
|
const CI_STATUS_MAP = {
|
|
16
18
|
success: CiStatus.Success,
|
|
@@ -25,13 +27,19 @@ export class PrSyncWatcherService {
|
|
|
25
27
|
pollIntervalMs;
|
|
26
28
|
trackedFeatures = new Map();
|
|
27
29
|
skippedRepos = new Set();
|
|
30
|
+
rateLimitedUntil = new Map();
|
|
31
|
+
db;
|
|
32
|
+
processId;
|
|
28
33
|
intervalId = null;
|
|
29
|
-
|
|
34
|
+
pollCycle = 0;
|
|
35
|
+
constructor(featureRepo, agentRunRepo, gitPrService, notificationService, pollIntervalMs = DEFAULT_POLL_INTERVAL_MS, db = null) {
|
|
30
36
|
this.featureRepo = featureRepo;
|
|
31
37
|
this.agentRunRepo = agentRunRepo;
|
|
32
38
|
this.gitPrService = gitPrService;
|
|
33
39
|
this.notificationService = notificationService;
|
|
34
40
|
this.pollIntervalMs = pollIntervalMs;
|
|
41
|
+
this.db = db;
|
|
42
|
+
this.processId = `${process.pid}-${Date.now()}`;
|
|
35
43
|
}
|
|
36
44
|
isRunning() {
|
|
37
45
|
return this.intervalId !== null;
|
|
@@ -55,8 +63,40 @@ export class PrSyncWatcherService {
|
|
|
55
63
|
console.log(`${TAG} Stopped`);
|
|
56
64
|
}
|
|
57
65
|
}
|
|
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
|
+
}
|
|
58
94
|
async poll() {
|
|
59
95
|
try {
|
|
96
|
+
if (!this.tryAcquireLock()) {
|
|
97
|
+
return; // another process holds the lock — skip this cycle
|
|
98
|
+
}
|
|
99
|
+
this.pollCycle++;
|
|
60
100
|
const allFeatures = await this.featureRepo.list({ lifecycle: SdlcLifecycle.Review });
|
|
61
101
|
// Include features with a valid repositoryPath (with or without PR data)
|
|
62
102
|
const features = allFeatures.filter((f) => f.repositoryPath);
|
|
@@ -89,9 +129,32 @@ export class PrSyncWatcherService {
|
|
|
89
129
|
console.warn(`${TAG} Poll failed: ${msg}`);
|
|
90
130
|
}
|
|
91
131
|
}
|
|
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
|
+
}
|
|
92
153
|
async processRepository(repoPath, features) {
|
|
93
154
|
if (this.skippedRepos.has(repoPath))
|
|
94
155
|
return;
|
|
156
|
+
if (this.isRateLimited(repoPath))
|
|
157
|
+
return;
|
|
95
158
|
// Skip repos without a git remote — gh pr list will always fail
|
|
96
159
|
try {
|
|
97
160
|
if (!(await this.gitPrService.hasRemote(repoPath))) {
|
|
@@ -110,6 +173,8 @@ export class PrSyncWatcherService {
|
|
|
110
173
|
}
|
|
111
174
|
catch (error) {
|
|
112
175
|
const msg = error instanceof Error ? error.message : String(error);
|
|
176
|
+
if (error instanceof Error)
|
|
177
|
+
this.handleRateLimitError(repoPath, error);
|
|
113
178
|
// eslint-disable-next-line no-console
|
|
114
179
|
console.warn(`${TAG} listPrStatuses failed for ${repoPath}: ${msg}`);
|
|
115
180
|
return;
|
|
@@ -153,10 +218,15 @@ export class PrSyncWatcherService {
|
|
|
153
218
|
ciStatus: undefined,
|
|
154
219
|
mergeable: undefined,
|
|
155
220
|
featureName: feature.name,
|
|
221
|
+
unchangedCycles: 0,
|
|
156
222
|
});
|
|
157
223
|
await this.featureRepo.update(feature);
|
|
158
224
|
return;
|
|
159
225
|
}
|
|
226
|
+
// Check exponential backoff — skip features that haven't changed recently
|
|
227
|
+
if (!this.shouldPollFeature(feature.id)) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
160
230
|
const pr = feature.pr;
|
|
161
231
|
const prStatusInfo = statusByNumber.get(pr.number);
|
|
162
232
|
let needsUpdate = false;
|
|
@@ -169,6 +239,7 @@ export class PrSyncWatcherService {
|
|
|
169
239
|
ciStatus: pr.ciStatus,
|
|
170
240
|
mergeable: pr.mergeable,
|
|
171
241
|
featureName: feature.name,
|
|
242
|
+
unchangedCycles: 0,
|
|
172
243
|
});
|
|
173
244
|
}
|
|
174
245
|
const tracked = this.trackedFeatures.get(feature.id);
|
|
@@ -223,12 +294,18 @@ export class PrSyncWatcherService {
|
|
|
223
294
|
}
|
|
224
295
|
catch (error) {
|
|
225
296
|
const msg = error instanceof Error ? error.message : String(error);
|
|
297
|
+
if (error instanceof Error)
|
|
298
|
+
this.handleRateLimitError(feature.repositoryPath, error);
|
|
226
299
|
// eslint-disable-next-line no-console
|
|
227
300
|
console.warn(`${TAG} getCiStatus failed for "${feature.name}": ${msg}`);
|
|
228
301
|
}
|
|
229
302
|
if (needsUpdate) {
|
|
303
|
+
tracked.unchangedCycles = 0;
|
|
230
304
|
await this.featureRepo.update(feature);
|
|
231
305
|
}
|
|
306
|
+
else {
|
|
307
|
+
tracked.unchangedCycles++;
|
|
308
|
+
}
|
|
232
309
|
}
|
|
233
310
|
/** Mark associated agent run as completed so the UI reflects "done" state. */
|
|
234
311
|
async completeAgentRun(feature) {
|
|
@@ -264,11 +341,11 @@ let watcherInstance = null;
|
|
|
264
341
|
*
|
|
265
342
|
* @throws Error if the watcher is already initialized
|
|
266
343
|
*/
|
|
267
|
-
export function initializePrSyncWatcher(featureRepo, agentRunRepo, gitPrService, notificationService, pollIntervalMs) {
|
|
344
|
+
export function initializePrSyncWatcher(featureRepo, agentRunRepo, gitPrService, notificationService, pollIntervalMs, db) {
|
|
268
345
|
if (watcherInstance !== null) {
|
|
269
346
|
throw new Error('PR sync watcher already initialized. Cannot re-initialize.');
|
|
270
347
|
}
|
|
271
|
-
watcherInstance = new PrSyncWatcherService(featureRepo, agentRunRepo, gitPrService, notificationService, pollIntervalMs);
|
|
348
|
+
watcherInstance = new PrSyncWatcherService(featureRepo, agentRunRepo, gitPrService, notificationService, pollIntervalMs, db ?? null);
|
|
272
349
|
}
|
|
273
350
|
/**
|
|
274
351
|
* 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;AAgC1D;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CA0FzC"}
|
|
@@ -21,6 +21,7 @@ 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';
|
|
24
25
|
import { BrowserOpenerService } from '../../../../packages/core/src/infrastructure/services/browser-opener.service.js';
|
|
25
26
|
import { colors, fmt, messages } from '../ui/index.js';
|
|
26
27
|
function parsePort(value) {
|
|
@@ -66,7 +67,8 @@ Examples:
|
|
|
66
67
|
getNotificationWatcher().start();
|
|
67
68
|
// Start PR sync watcher to detect PR/CI status transitions on GitHub
|
|
68
69
|
const gitPrService = container.resolve('IGitPrService');
|
|
69
|
-
|
|
70
|
+
const db = getExistingConnection();
|
|
71
|
+
initializePrSyncWatcher(featureRepo, runRepo, gitPrService, notificationService, undefined, db);
|
|
70
72
|
getPrSyncWatcher().start();
|
|
71
73
|
const url = `http://localhost:${port}`;
|
|
72
74
|
messages.success(`Server ready at ${fmt.code(url)}`);
|
|
@@ -3,6 +3,9 @@ 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.
|
|
6
9
|
*/
|
|
7
10
|
export declare function getFeatureDrawerData(featureId: string): Promise<FeatureNodeData | null>;
|
|
8
11
|
//# 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":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAgC7F"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
'use server';
|
|
2
2
|
import { resolve } from '../../lib/server-container.js';
|
|
3
|
-
import { CiStatus } from '../../../../../packages/core/src/domain/generated/output.js';
|
|
4
3
|
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
|
-
};
|
|
10
4
|
/**
|
|
11
5
|
* Fetches full FeatureNodeData for a given feature ID.
|
|
12
6
|
* Used by the drawer for targeted data syncing without triggering
|
|
13
7
|
* 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.
|
|
14
11
|
*/
|
|
15
12
|
export async function getFeatureDrawerData(featureId) {
|
|
16
13
|
try {
|
|
@@ -23,37 +20,15 @@ export async function getFeatureDrawerData(featureId) {
|
|
|
23
20
|
if (!feature)
|
|
24
21
|
return null;
|
|
25
22
|
const run = feature.agentRunId ? await agentRunRepo.findById(feature.agentRunId) : null;
|
|
26
|
-
|
|
23
|
+
// CI status and mergeable status are read from the feature record (updated by
|
|
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([
|
|
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),
|
|
39
31
|
]);
|
|
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
|
-
}
|
|
57
32
|
return buildFeatureNodeData(feature, run, {
|
|
58
33
|
repositoryName: repo?.name,
|
|
59
34
|
baseBranch,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-feature-node-data.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/web/app/build-feature-node-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAQ9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,MAAM,WAAW,2BAA2B;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,QAAQ,GAAG,IAAI,EACpB,OAAO,CAAC,EAAE,2BAA2B,GACpC,eAAe,
|
|
1
|
+
{"version":3,"file":"build-feature-node-data.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/web/app/build-feature-node-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAQ9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,MAAM,WAAW,2BAA2B;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,QAAQ,GAAG,IAAI,EACpB,OAAO,CAAC,EAAE,2BAA2B,GACpC,eAAe,CAyCjB"}
|
|
@@ -30,7 +30,6 @@ export function buildFeatureNodeData(feature, run, options) {
|
|
|
30
30
|
...(run?.agentType && { agentType: run.agentType }),
|
|
31
31
|
...(run?.modelId && { modelId: run.modelId }),
|
|
32
32
|
...(run?.error && { errorMessage: run.error }),
|
|
33
|
-
...(feature.plan != null && { hasPlan: true }),
|
|
34
33
|
...(feature.pr && {
|
|
35
34
|
pr: {
|
|
36
35
|
url: feature.pr.url,
|
|
@@ -114,7 +114,6 @@ function appendFeatureNodes(repoFeatures, repoNodeId, allFeaturesWithRuns, nodes
|
|
|
114
114
|
...(run?.modelId && { modelId: run.modelId }),
|
|
115
115
|
...(run?.error && { errorMessage: run.error }),
|
|
116
116
|
...(blockedBy && { blockedBy }),
|
|
117
|
-
...(feature.plan != null && { hasPlan: true }),
|
|
118
117
|
...(feature.pr && {
|
|
119
118
|
pr: {
|
|
120
119
|
url: feature.pr.url,
|
package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-drawer-tabs.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAS9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAMxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAQ9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;
|
|
1
|
+
{"version":3,"file":"feature-drawer-tabs.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAS9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAMxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAQ9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAC;AAiD3F,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,eAAe,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,gFAAgF;IAChF,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,mFAAmF;IACnF,SAAS,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAGzC,OAAO,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;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{ key: 'product-decisions', label: 'Product' },
|
|
29
29
|
{ key: 'merge-review', label: 'Merge Review' },
|
|
30
30
|
];
|
|
31
|
+
/** Phases where a plan exists (planning happens at start of implementation). */
|
|
32
|
+
const PLAN_PHASES = new Set(['implementation', 'review', 'deploy', 'maintain']);
|
|
31
33
|
/** Compute which tabs are visible based on feature lifecycle + state. */
|
|
32
34
|
function computeVisibleTabs(node) {
|
|
33
35
|
const tabs = ['overview', 'activity', 'log'];
|
|
34
|
-
if (node.
|
|
36
|
+
if (PLAN_PHASES.has(node.lifecycle) &&
|
|
37
|
+
!(node.lifecycle === 'implementation' && node.state === 'action-required')) {
|
|
35
38
|
tabs.push('plan');
|
|
36
39
|
}
|
|
37
40
|
if (node.lifecycle === 'requirements' && node.state === 'action-required') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-drawer-tabs.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAO1D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,iBAAiB,CAcxC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,iBAAiB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"feature-drawer-tabs.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAO1D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,iBAAiB,CAcxC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAqPhD,qEAAqE;AACrE,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,gBAAgB,EAAE,KAK9B,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,EAAE,KAK/B,CAAC;AAEF,8BAA8B;AAC9B,eAAO,MAAM,UAAU,EAAE,KAKxB,CAAC;AAyBF,oEAAoE;AACpE,eAAO,MAAM,eAAe,EAAE,KAK7B,CAAC;AAMF,6EAA6E;AAC7E,eAAO,MAAM,eAAe,EAAE,KAW7B,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,gBAAgB,EAAE,KAU9B,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,EAAE,KAS/B,CAAC"}
|
|
@@ -33,7 +33,6 @@ const runningFeature = {
|
|
|
33
33
|
createdAt: Date.now() - 2 * 60 * 60 * 1000, // 2 hours ago
|
|
34
34
|
repositoryName: 'my-repo',
|
|
35
35
|
baseBranch: 'main',
|
|
36
|
-
hasPlan: true,
|
|
37
36
|
pr: {
|
|
38
37
|
url: 'https://github.com/org/repo/pull/42',
|
|
39
38
|
number: 42,
|
|
@@ -58,7 +57,6 @@ const doneFeature = {
|
|
|
58
57
|
createdAt: Date.now() - 3 * 24 * 60 * 60 * 1000, // 3 days ago
|
|
59
58
|
repositoryName: 'my-repo',
|
|
60
59
|
baseBranch: 'main',
|
|
61
|
-
hasPlan: true,
|
|
62
60
|
pr: {
|
|
63
61
|
url: 'https://github.com/org/repo/pull/55',
|
|
64
62
|
number: 55,
|
|
@@ -114,7 +112,6 @@ const mergeReviewFeature = {
|
|
|
114
112
|
createdAt: Date.now() - 2 * 24 * 60 * 60 * 1000, // 2 days ago
|
|
115
113
|
repositoryName: 'my-repo',
|
|
116
114
|
baseBranch: 'main',
|
|
117
|
-
hasPlan: true,
|
|
118
115
|
pr: {
|
|
119
116
|
url: 'https://github.com/shep-ai/cli/pull/42',
|
|
120
117
|
number: 42,
|
|
@@ -139,7 +136,6 @@ const errorFeature = {
|
|
|
139
136
|
createdAt: Date.now() - 7 * 24 * 60 * 60 * 1000, // 1 week ago
|
|
140
137
|
repositoryName: 'my-repo',
|
|
141
138
|
baseBranch: 'main',
|
|
142
|
-
hasPlan: true,
|
|
143
139
|
};
|
|
144
140
|
/* ---------------------------------------------------------------------------
|
|
145
141
|
* Review data fixtures
|
package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts
CHANGED
|
@@ -59,8 +59,6 @@ export interface FeatureNodeData {
|
|
|
59
59
|
commitHash?: string;
|
|
60
60
|
mergeable?: boolean;
|
|
61
61
|
};
|
|
62
|
-
/** Whether the feature has plan data available */
|
|
63
|
-
hasPlan?: boolean;
|
|
64
62
|
/** Deployment status for features with an active deployment */
|
|
65
63
|
deployment?: {
|
|
66
64
|
status: DeploymentState;
|
package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-node-state-config.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-node/feature-node-state-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,SAAS,GACT,iBAAiB,GACjB,MAAM,GACN,SAAS,GACT,OAAO,GACP,UAAU,CAAC;AAEf,MAAM,MAAM,qBAAqB,GAC7B,cAAc,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,CAAC;IACnB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,EAAE,CAAC,EAAE;QACH,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,QAAQ,CAAC;QACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;IACF
|
|
1
|
+
{"version":3,"file":"feature-node-state-config.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/feature-node/feature-node-state-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,SAAS,GACT,iBAAiB,GACjB,MAAM,GACN,SAAS,GACT,OAAO,GACP,UAAU,CAAC;AAEf,MAAM,MAAM,qBAAqB,GAC7B,cAAc,GACd,UAAU,GACV,gBAAgB,GAChB,QAAQ,GACR,QAAQ,GACR,UAAU,CAAC;AAEf,0DAA0D;AAC1D,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,qBAAqB,EAAE,MAAM,CAOxE,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,qBAAqB,EAAE,MAAM,CAOvE,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,CAAC,GAAG,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,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,+DAA+D;IAC/D,UAAU,CAAC,EAAE;QACX,MAAM,EAAE,eAAe,CAAC;QACxB,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1D,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;AAEnE,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,gBAAgB,EAAE,sBAAsB,CAuEnF,CAAC"}
|
|
@@ -19,6 +19,7 @@ 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';
|
|
22
23
|
const DEFAULT_PORT = 3000;
|
|
23
24
|
async function isPortAvailable(port) {
|
|
24
25
|
return new Promise((resolve) => {
|
|
@@ -64,7 +65,8 @@ async function main() {
|
|
|
64
65
|
getNotificationWatcher().start();
|
|
65
66
|
// Start PR sync watcher to detect PR/CI status transitions on GitHub
|
|
66
67
|
const gitPrService = container.resolve('IGitPrService');
|
|
67
|
-
|
|
68
|
+
const db = getExistingConnection();
|
|
69
|
+
initializePrSyncWatcher(featureRepo, runRepo, gitPrService, notificationService, undefined, db);
|
|
68
70
|
getPrSyncWatcher().start();
|
|
69
71
|
}
|
|
70
72
|
catch (error) {
|