@knpkv/codecommit 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/package.json +3 -3
- package/dist/src/tui/Constants.d.ts +0 -7
- package/dist/src/tui/Constants.d.ts.map +1 -1
- package/dist/src/tui/Constants.js +5 -31
- package/dist/src/tui/Constants.js.map +1 -1
- package/dist/src/tui/ListBuilder.d.ts +3 -3
- package/dist/src/tui/ListBuilder.d.ts.map +1 -1
- package/dist/src/tui/ListBuilder.js +3 -3
- package/dist/src/tui/ListBuilder.js.map +1 -1
- package/dist/src/tui/atoms/actions.d.ts +7 -7
- package/dist/src/tui/atoms/actions.d.ts.map +1 -1
- package/dist/src/tui/atoms/actions.js +25 -31
- package/dist/src/tui/atoms/actions.js.map +1 -1
- package/dist/src/tui/atoms/app.d.ts +8 -9
- package/dist/src/tui/atoms/app.d.ts.map +1 -1
- package/dist/src/tui/atoms/app.js +14 -9
- package/dist/src/tui/atoms/app.js.map +1 -1
- package/dist/src/tui/atoms/runtime.d.ts +2 -2
- package/dist/src/tui/atoms/runtime.d.ts.map +1 -1
- package/dist/src/tui/atoms/runtime.js +13 -12
- package/dist/src/tui/atoms/runtime.js.map +1 -1
- package/dist/src/tui/atoms/ui.d.ts +17 -1
- package/dist/src/tui/atoms/ui.d.ts.map +1 -1
- package/dist/src/tui/atoms/ui.js +12 -1
- package/dist/src/tui/atoms/ui.js.map +1 -1
- package/dist/src/tui/components/Header.d.ts.map +1 -1
- package/dist/src/tui/components/Header.js +2 -1
- package/dist/src/tui/components/Header.js.map +1 -1
- package/dist/src/tui/components/MainList.d.ts.map +1 -1
- package/dist/src/tui/components/MainList.js +2 -2
- package/dist/src/tui/components/MainList.js.map +1 -1
- package/dist/src/tui/components/NotificationsTable.js +2 -2
- package/dist/src/tui/components/NotificationsTable.js.map +1 -1
- package/dist/src/tui/components/QuickFilters.d.ts.map +1 -1
- package/dist/src/tui/components/QuickFilters.js.map +1 -1
- package/dist/src/tui/components/SettingsAboutTab.d.ts +2 -0
- package/dist/src/tui/components/SettingsAboutTab.d.ts.map +1 -0
- package/dist/src/tui/components/SettingsAboutTab.js +7 -0
- package/dist/src/tui/components/SettingsAboutTab.js.map +1 -0
- package/dist/src/tui/components/SettingsAccountsTab.d.ts +8 -0
- package/dist/src/tui/components/SettingsAccountsTab.d.ts.map +1 -0
- package/dist/src/tui/components/{SettingsTable.js → SettingsAccountsTab.js} +4 -14
- package/dist/src/tui/components/SettingsAccountsTab.js.map +1 -0
- package/dist/src/tui/components/SettingsConfigTab.d.ts +2 -0
- package/dist/src/tui/components/SettingsConfigTab.d.ts.map +1 -0
- package/dist/src/tui/components/SettingsConfigTab.js +10 -0
- package/dist/src/tui/components/SettingsConfigTab.js.map +1 -0
- package/dist/src/tui/components/SettingsThemeTab.d.ts +2 -0
- package/dist/src/tui/components/SettingsThemeTab.d.ts.map +1 -0
- package/dist/src/tui/components/SettingsThemeTab.js +24 -0
- package/dist/src/tui/components/SettingsThemeTab.js.map +1 -0
- package/dist/src/tui/components/SettingsView.d.ts +8 -0
- package/dist/src/tui/components/SettingsView.d.ts.map +1 -0
- package/dist/src/tui/components/SettingsView.js +33 -0
- package/dist/src/tui/components/SettingsView.js.map +1 -0
- package/dist/src/tui/components/index.d.ts +1 -1
- package/dist/src/tui/components/index.d.ts.map +1 -1
- package/dist/src/tui/components/index.js +1 -1
- package/dist/src/tui/components/index.js.map +1 -1
- package/dist/src/tui/hooks/useKeyboardNav.d.ts +0 -1
- package/dist/src/tui/hooks/useKeyboardNav.d.ts.map +1 -1
- package/dist/src/tui/hooks/useKeyboardNav.js +113 -79
- package/dist/src/tui/hooks/useKeyboardNav.js.map +1 -1
- package/dist/src/tui/mocks.js +1 -1
- package/dist/src/tui/mocks.js.map +1 -1
- package/dist/src/tui/ui/DialogCommand.d.ts.map +1 -1
- package/dist/src/tui/ui/DialogCommand.js +50 -28
- package/dist/src/tui/ui/DialogCommand.js.map +1 -1
- package/dist/src/tui/ui/DialogCreatePR.d.ts.map +1 -1
- package/dist/src/tui/ui/DialogCreatePR.js +4 -4
- package/dist/src/tui/ui/DialogCreatePR.js.map +1 -1
- package/dist/src/tui/ui/index.d.ts +0 -2
- package/dist/src/tui/ui/index.d.ts.map +1 -1
- package/dist/src/tui/ui/index.js +0 -2
- package/dist/src/tui/ui/index.js.map +1 -1
- package/dist/test/ConfigService.test.js +3 -3
- package/dist/test/ConfigService.test.js.map +1 -1
- package/dist/test/ListBuilder.test.js +11 -6
- package/dist/test/ListBuilder.test.js.map +1 -1
- package/dist/test/MainList.test.js +1 -1
- package/dist/test/MainList.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/dist/src/tui/components/SettingsTable.d.ts +0 -12
- package/dist/src/tui/components/SettingsTable.d.ts.map +0 -1
- package/dist/src/tui/components/SettingsTable.js.map +0 -1
- package/dist/src/tui/ui/DialogHelp.d.ts +0 -6
- package/dist/src/tui/ui/DialogHelp.d.ts.map +0 -1
- package/dist/src/tui/ui/DialogHelp.js +0 -93
- package/dist/src/tui/ui/DialogHelp.js.map +0 -1
- package/dist/src/tui/ui/DialogTheme.d.ts +0 -2
- package/dist/src/tui/ui/DialogTheme.d.ts.map +0 -1
- package/dist/src/tui/ui/DialogTheme.js +0 -124
- package/dist/src/tui/ui/DialogTheme.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
CLI and TUI for AWS CodeCommit pull requests.
|
|
4
4
|
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Multi-account, multi-region PR dashboard (TUI and Web)
|
|
8
|
+
- **Local SQLite cache** — PRs are cached locally via libsql for instant search, offline access, and change notifications
|
|
9
|
+
- PR subscriptions with diff-based notifications (title changes, new comments, status updates)
|
|
10
|
+
- Health score ranking (staleness, review urgency)
|
|
11
|
+
- SSO login/logout management
|
|
12
|
+
- Full-text search across cached PRs
|
|
13
|
+
|
|
5
14
|
## Prerequisites
|
|
6
15
|
|
|
7
16
|
- AWS SSO configured (`~/.aws/config`)
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knpkv/codecommit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "TUI for browsing AWS CodeCommit PRs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@effect-atom/atom-react": "latest",
|
|
29
29
|
"@effect/cli": "latest",
|
|
30
|
-
"@effect/platform": "
|
|
31
|
-
"@effect/platform-bun": "
|
|
30
|
+
"@effect/platform": "latest",
|
|
31
|
+
"@effect/platform-bun": "latest",
|
|
32
32
|
"@effect/platform-node": "latest",
|
|
33
33
|
"@knpkv/codecommit-core": "workspace:^",
|
|
34
34
|
"@knpkv/codecommit-web": "workspace:^",
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
export declare const SPINNER_FRAMES: string[];
|
|
2
2
|
export declare const VIEW_TITLES: Record<string, string>;
|
|
3
3
|
export declare const HINTS: Record<string, string>;
|
|
4
|
-
export declare const COMMON_HELP: string;
|
|
5
|
-
export declare const HELP_CONTENT: {
|
|
6
|
-
prs: string;
|
|
7
|
-
settings: string;
|
|
8
|
-
notifications: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const SETTINGS_LEGEND: string;
|
|
11
4
|
//# sourceMappingURL=Constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../src/tui/Constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,UAAqD,CAAA;AAEhF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAK9C,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAKxC,CAAA
|
|
1
|
+
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../src/tui/Constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,UAAqD,CAAA;AAEhF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAK9C,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAKxC,CAAA"}
|
|
@@ -1,40 +1,14 @@
|
|
|
1
1
|
export const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
|
2
2
|
export const VIEW_TITLES = {
|
|
3
3
|
prs: "CodeCommit PRs",
|
|
4
|
-
settings: "
|
|
4
|
+
settings: "Settings",
|
|
5
5
|
notifications: "Notifications",
|
|
6
6
|
details: "PR Details"
|
|
7
7
|
};
|
|
8
8
|
export const HINTS = {
|
|
9
|
-
prs: "Enter: Details |
|
|
10
|
-
settings: "
|
|
11
|
-
notifications: "Enter: Action | r: Refresh |
|
|
12
|
-
details: "Esc: Back | Enter: Open
|
|
9
|
+
prs: "Enter: Details | /: Filter | 1-9: Quick Filter | r: Refresh | n: Notif | [:] Commands",
|
|
10
|
+
settings: "Tab: Switch Section | 1-4: Jump | Esc: Back | [:] Commands",
|
|
11
|
+
notifications: "Enter: Action | r: Refresh | Esc: Back | [:] Commands",
|
|
12
|
+
details: "Esc: Back | Enter: Open | c: Comments | [:] Commands"
|
|
13
13
|
};
|
|
14
|
-
export const COMMON_HELP = " r - Refresh everything\n" +
|
|
15
|
-
" t - Toggle theme\n" +
|
|
16
|
-
" h - Toggle help\n" +
|
|
17
|
-
" q - Quit\n" +
|
|
18
|
-
" Esc - Close help / Clear filter";
|
|
19
|
-
export const HELP_CONTENT = {
|
|
20
|
-
prs: " f - Filter PRs\n" +
|
|
21
|
-
" 1-9 - Quick filters (All/Hot/Mine/Acct/Auth/Scope/Age/Repo/Status)\n" +
|
|
22
|
-
" ←→ - Cycle filter values\n" +
|
|
23
|
-
" Enter - PR Details\n" +
|
|
24
|
-
" o - Open PR in browser\n" +
|
|
25
|
-
" s - Manage Accounts\n" +
|
|
26
|
-
" n - Notifications",
|
|
27
|
-
settings: " Enter - Toggle account sync\n" +
|
|
28
|
-
" s - Back to PRs\n" +
|
|
29
|
-
" n - Notifications",
|
|
30
|
-
notifications: " Enter - Run action\n" +
|
|
31
|
-
" c - Clear all\n" +
|
|
32
|
-
" s - Manage Accounts\n" +
|
|
33
|
-
" n - Back to PRs"
|
|
34
|
-
};
|
|
35
|
-
export const SETTINGS_LEGEND = "\n\n" +
|
|
36
|
-
" Status Icons:\n" +
|
|
37
|
-
" ● - Active & Synced\n" +
|
|
38
|
-
" ○ - Disabled\n" +
|
|
39
|
-
" ⚠ - Error fetching";
|
|
40
14
|
//# sourceMappingURL=Constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../src/tui/Constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAEhF,MAAM,CAAC,MAAM,WAAW,GAA2B;IACjD,GAAG,EAAE,gBAAgB;IACrB,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../src/tui/Constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AAEhF,MAAM,CAAC,MAAM,WAAW,GAA2B;IACjD,GAAG,EAAE,gBAAgB;IACrB,QAAQ,EAAE,UAAU;IACpB,aAAa,EAAE,eAAe;IAC9B,OAAO,EAAE,YAAY;CACtB,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAA2B;IAC3C,GAAG,EAAE,uFAAuF;IAC5F,QAAQ,EAAE,4DAA4D;IACtE,aAAa,EAAE,uDAAuD;IACtE,OAAO,EAAE,sDAAsD;CAChE,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Domain } from "@knpkv/codecommit-core";
|
|
1
|
+
import type { CacheService, Domain } from "@knpkv/codecommit-core";
|
|
2
2
|
import type { QuickFilterType } from "./atoms/ui.js";
|
|
3
3
|
export type TuiView = "prs" | "settings" | "notifications" | "details";
|
|
4
4
|
/**
|
|
@@ -21,12 +21,12 @@ export type ListItem = {
|
|
|
21
21
|
account: Domain.AppState["accounts"][number];
|
|
22
22
|
} | {
|
|
23
23
|
type: "notification";
|
|
24
|
-
notification:
|
|
24
|
+
notification: CacheService.NotificationRow;
|
|
25
25
|
};
|
|
26
26
|
export interface QuickFilter {
|
|
27
27
|
readonly type: QuickFilterType;
|
|
28
28
|
readonly value: string;
|
|
29
29
|
readonly currentUser: string;
|
|
30
30
|
}
|
|
31
|
-
export declare const buildListItems: (state: Domain.AppState, view: TuiView, filterText: string, notifications?: ReadonlyArray<
|
|
31
|
+
export declare const buildListItems: (state: Domain.AppState, view: TuiView, filterText: string, notifications?: ReadonlyArray<CacheService.NotificationRow>, quickFilter?: QuickFilter) => Array<ListItem>;
|
|
32
32
|
//# sourceMappingURL=ListBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListBuilder.d.ts","sourceRoot":"","sources":["../../../src/tui/ListBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"ListBuilder.d.ts","sourceRoot":"","sources":["../../../src/tui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erCase().includes(search) ||
|
|
48
48
|
pr.id.toLowerCase().includes(search) ||
|
|
49
49
|
(pr.description?.toLowerCase().includes(search) ?? false) ||
|
|
50
|
-
pr.account.
|
|
50
|
+
pr.account.profile.toLowerCase().includes(search) ||
|
|
51
51
|
pr.account.region.toLowerCase().includes(search));
|
|
52
52
|
};
|
|
53
53
|
export const buildListItems = (state, view, filterText, notifications = [], quickFilter) => {
|
|
54
54
|
if (view === "prs" || view === "details") {
|
|
55
55
|
const enabledAccounts = state.accounts.filter((a) => a.enabled);
|
|
56
56
|
const prsByAccount = enabledAccounts.map((acc) => {
|
|
57
|
-
const prs = state.pullRequests.filter((pr) => pr.account.
|
|
57
|
+
const prs = state.pullRequests.filter((pr) => pr.account.profile === acc.profile);
|
|
58
58
|
const mostRecent = prs.length > 0
|
|
59
59
|
? Math.max(...prs.map((p) => p.creationDate.getTime()))
|
|
60
60
|
: 0;
|
|
@@ -72,7 +72,7 @@ export const buildListItems = (state, view, filterText, notifications = [], quic
|
|
|
72
72
|
return false;
|
|
73
73
|
return !quickFilter.value || extractScope(pr.title) === quickFilter.value;
|
|
74
74
|
case "account":
|
|
75
|
-
return pr.account.
|
|
75
|
+
return pr.account.profile === quickFilter.value;
|
|
76
76
|
case "author":
|
|
77
77
|
return pr.author === quickFilter.value;
|
|
78
78
|
case "scope":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListBuilder.js","sourceRoot":"","sources":["../../../src/tui/ListBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAK/B;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAAiB,EAAE;IAC3D,4CAA4C;IAC5C,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;IACpD,IAAI,YAAY,EAAE,CAAC,CAAC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AA;YAChC,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YAChC,OAAO;gBACL,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,GAAG;aACb,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,IAAI,KAAK,eAAe,EAAE,CAAC;QAC7B,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC/B,IAAI,EAAE,cAAc;YACpB,YAAY,EAAE,CAAC;SAChB,CAAC,CAAC,CAAA;IACL,CAAC;IAED,OAAO,EAAE,CAAA;AACX,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Domain } from "@knpkv/codecommit-core";
|
|
1
|
+
import { CacheService, type Domain } from "@knpkv/codecommit-core";
|
|
2
2
|
export interface CreatePRInput {
|
|
3
3
|
readonly repositoryName: string;
|
|
4
4
|
readonly title: string;
|
|
@@ -15,30 +15,30 @@ export interface ListBranchesInput {
|
|
|
15
15
|
* Log in to AWS SSO
|
|
16
16
|
* @category atoms
|
|
17
17
|
*/
|
|
18
|
-
export declare const loginToAwsAtom: import("@effect-atom/atom/Atom").AtomResultFn<string & import("effect/Brand").Brand<"AwsProfileName">, void,
|
|
18
|
+
export declare const loginToAwsAtom: import("@effect-atom/atom/Atom").AtomResultFn<string & import("effect/Brand").Brand<"AwsProfileName">, void, CacheService.CacheError | import("@effect/sql/SqlError").SqlError | import("effect/ConfigError").ConfigError | import("@effect/sql/Migrator").MigrationError>;
|
|
19
19
|
/**
|
|
20
20
|
* Copies PR link and runs assume -c for the profile
|
|
21
21
|
* @category atoms
|
|
22
22
|
*/
|
|
23
|
-
export declare const openPrAtom: import("@effect-atom/atom/Atom").AtomResultFn<Domain.PullRequest, void,
|
|
23
|
+
export declare const openPrAtom: import("@effect-atom/atom/Atom").AtomResultFn<Domain.PullRequest, void, CacheService.CacheError | import("@effect/sql/SqlError").SqlError | import("effect/ConfigError").ConfigError | import("@effect/sql/Migrator").MigrationError>;
|
|
24
24
|
/**
|
|
25
25
|
* Opens a URL in the default browser
|
|
26
26
|
* @category atoms
|
|
27
27
|
*/
|
|
28
|
-
export declare const openBrowserAtom: import("@effect-atom/atom/Atom").AtomResultFn<string, void,
|
|
28
|
+
export declare const openBrowserAtom: import("@effect-atom/atom/Atom").AtomResultFn<string, void, import("@effect/sql/SqlError").SqlError | import("effect/ConfigError").ConfigError | import("@effect/sql/Migrator").MigrationError>;
|
|
29
29
|
/**
|
|
30
30
|
* Create a new pull request
|
|
31
31
|
* @category atoms
|
|
32
32
|
*/
|
|
33
|
-
export declare const createPrAtom: import("@effect-atom/atom/Atom").AtomResultFn<CreatePRInput, string,
|
|
33
|
+
export declare const createPrAtom: import("@effect-atom/atom/Atom").AtomResultFn<CreatePRInput, string, CacheService.CacheError | import("@effect/sql/SqlError").SqlError | import("effect/ConfigError").ConfigError | import("@effect/sql/Migrator").MigrationError>;
|
|
34
34
|
/**
|
|
35
35
|
* Fetch comments for a specific PR and return them
|
|
36
36
|
* @category atoms
|
|
37
37
|
*/
|
|
38
|
-
export declare const fetchPrCommentsAtom: import("@effect-atom/atom/Atom").AtomResultFn<Domain.PullRequest, Domain.PRCommentLocation[],
|
|
38
|
+
export declare const fetchPrCommentsAtom: import("@effect-atom/atom/Atom").AtomResultFn<Domain.PullRequest, Domain.PRCommentLocation[], CacheService.CacheError | import("@effect/sql/SqlError").SqlError | import("effect/ConfigError").ConfigError | import("@effect/sql/Migrator").MigrationError>;
|
|
39
39
|
/**
|
|
40
40
|
* List branches for a repository
|
|
41
41
|
* @category atoms
|
|
42
42
|
*/
|
|
43
|
-
export declare const listBranchesAtom: import("@effect-atom/atom/Atom").AtomResultFn<ListBranchesInput, string[],
|
|
43
|
+
export declare const listBranchesAtom: import("@effect-atom/atom/Atom").AtomResultFn<ListBranchesInput, string[], CacheService.CacheError | import("@effect/sql/SqlError").SqlError | import("effect/ConfigError").ConfigError | import("@effect/sql/Migrator").MigrationError>;
|
|
44
44
|
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/tui/atoms/actions.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,MAAM,EAA0B,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/tui/atoms/actions.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,YAAY,EAAE,KAAK,MAAM,EAA0B,MAAM,wBAAwB,CAAA;AAQrG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAA;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAA;CACjC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAA;CACjC;AAyCD;;;GAGG;AACH,eAAO,MAAM,cAAc,4QA4C1B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,uOAuCtB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,iMAwB3B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,oOAsCxB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,6PAgB/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,0OAiB5B,CAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Command } from "@effect/platform";
|
|
2
|
-
import { AwsClient, PRService } from "@knpkv/codecommit-core";
|
|
2
|
+
import { AwsClient, CacheService, PRService } from "@knpkv/codecommit-core";
|
|
3
3
|
import { Effect, Stream } from "effect";
|
|
4
4
|
import { runtimeAtom } from "./runtime.js";
|
|
5
5
|
const isDarwin = process.platform === "darwin";
|
|
6
6
|
const notifyError = (title, error) => Effect.gen(function* () {
|
|
7
|
-
const
|
|
8
|
-
yield*
|
|
7
|
+
const notificationRepo = yield* CacheService.NotificationRepo;
|
|
8
|
+
yield* notificationRepo.addSystem({
|
|
9
9
|
type: "error",
|
|
10
10
|
title,
|
|
11
11
|
message: error.message
|
|
@@ -17,8 +17,8 @@ const copyToClipboard = (text) => Effect.gen(function* () {
|
|
|
17
17
|
: Command.make("xclip", "-selection", "clipboard");
|
|
18
18
|
yield* Command.exitCode(Command.stdin(cmd, Stream.make(text).pipe(Stream.encodeText)));
|
|
19
19
|
}).pipe(Effect.catchAll((error) => Effect.gen(function* () {
|
|
20
|
-
const
|
|
21
|
-
yield*
|
|
20
|
+
const notificationRepo = yield* CacheService.NotificationRepo;
|
|
21
|
+
yield* notificationRepo.addSystem({
|
|
22
22
|
type: "error",
|
|
23
23
|
title: "Clipboard",
|
|
24
24
|
message: error instanceof Error ? error.message : String(error)
|
|
@@ -32,26 +32,26 @@ const copyToClipboard = (text) => Effect.gen(function* () {
|
|
|
32
32
|
* @category atoms
|
|
33
33
|
*/
|
|
34
34
|
export const loginToAwsAtom = runtimeAtom.fn(Effect.fnUntraced(function* (profile) {
|
|
35
|
-
const
|
|
35
|
+
const notificationRepo = yield* CacheService.NotificationRepo;
|
|
36
36
|
if (!profile || profile.trim() === "") {
|
|
37
|
-
yield*
|
|
37
|
+
yield* notificationRepo.addSystem({
|
|
38
38
|
type: "error",
|
|
39
39
|
title: "SSO Login",
|
|
40
40
|
message: "No profile specified"
|
|
41
41
|
});
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
yield*
|
|
44
|
+
yield* notificationRepo.addSystem({
|
|
45
45
|
type: "info",
|
|
46
46
|
title: "SSO Login",
|
|
47
47
|
message: `Opening browser for ${profile}...`
|
|
48
48
|
});
|
|
49
49
|
const cmd = Command.make("aws", "sso", "login", "--profile", profile).pipe(Command.stdout("inherit"), Command.stderr("inherit"));
|
|
50
|
-
yield* Effect.forkDaemon(Command.exitCode(cmd).pipe(Effect.tap(() =>
|
|
50
|
+
yield* Effect.forkDaemon(Command.exitCode(cmd).pipe(Effect.tap(() => notificationRepo.addSystem({
|
|
51
51
|
type: "success",
|
|
52
52
|
title: "SSO Login",
|
|
53
53
|
message: `Login complete for ${profile}`
|
|
54
|
-
})), Effect.catchAll((e) =>
|
|
54
|
+
})), Effect.catchAll((e) => notificationRepo.addSystem({
|
|
55
55
|
type: "error",
|
|
56
56
|
title: "SSO Login Failed",
|
|
57
57
|
message: e instanceof Error ? e.message : String(e)
|
|
@@ -62,20 +62,20 @@ export const loginToAwsAtom = runtimeAtom.fn(Effect.fnUntraced(function* (profil
|
|
|
62
62
|
* @category atoms
|
|
63
63
|
*/
|
|
64
64
|
export const openPrAtom = runtimeAtom.fn(Effect.fnUntraced(function* (pr) {
|
|
65
|
-
const
|
|
66
|
-
const profile = pr.account.
|
|
65
|
+
const notificationRepo = yield* CacheService.NotificationRepo;
|
|
66
|
+
const profile = pr.account.profile;
|
|
67
67
|
yield* copyToClipboard(pr.link);
|
|
68
|
-
yield*
|
|
68
|
+
yield* notificationRepo.addSystem({
|
|
69
69
|
type: "info",
|
|
70
70
|
title: "Assume",
|
|
71
71
|
message: `Opening ${profile} → PR console...`
|
|
72
72
|
});
|
|
73
73
|
const cmd = Command.make("assume", "-cd", pr.link, profile).pipe(Command.stdout("inherit"), Command.stderr("inherit"), Command.env({ GRANTED_ALIAS_CONFIGURED: "true" }));
|
|
74
|
-
yield* Effect.forkDaemon(Command.exitCode(cmd).pipe(Effect.tap(() =>
|
|
74
|
+
yield* Effect.forkDaemon(Command.exitCode(cmd).pipe(Effect.tap(() => notificationRepo.addSystem({
|
|
75
75
|
type: "success",
|
|
76
76
|
title: "Assume",
|
|
77
77
|
message: `Assumed ${profile}`
|
|
78
|
-
})), Effect.catchAll((e) =>
|
|
78
|
+
})), Effect.catchAll((e) => notificationRepo.addSystem({
|
|
79
79
|
type: "error",
|
|
80
80
|
title: "Assume Failed",
|
|
81
81
|
message: e instanceof Error ? e.message : String(e)
|
|
@@ -89,8 +89,8 @@ export const openBrowserAtom = runtimeAtom.fn(Effect.fnUntraced(function* (link)
|
|
|
89
89
|
const openCmd = isDarwin ? "open" : "xdg-open";
|
|
90
90
|
const cmd = Command.make(openCmd, link).pipe(Command.stdout("pipe"), Command.stderr("pipe"));
|
|
91
91
|
yield* Command.exitCode(cmd).pipe(Effect.catchAll((error) => Effect.gen(function* () {
|
|
92
|
-
const
|
|
93
|
-
yield*
|
|
92
|
+
const notificationRepo = yield* CacheService.NotificationRepo;
|
|
93
|
+
yield* notificationRepo.addSystem({
|
|
94
94
|
type: "error",
|
|
95
95
|
title: "Open Browser",
|
|
96
96
|
message: error instanceof Error ? error.message : String(error)
|
|
@@ -104,26 +104,22 @@ export const openBrowserAtom = runtimeAtom.fn(Effect.fnUntraced(function* (link)
|
|
|
104
104
|
export const createPrAtom = runtimeAtom.fn(Effect.fnUntraced(function* (input) {
|
|
105
105
|
const service = yield* PRService.PRService;
|
|
106
106
|
const awsClient = yield* AwsClient.AwsClient;
|
|
107
|
-
yield*
|
|
107
|
+
const notificationRepo = yield* CacheService.NotificationRepo;
|
|
108
|
+
yield* notificationRepo.addSystem({
|
|
108
109
|
type: "info",
|
|
109
110
|
title: "Creating PR",
|
|
110
111
|
message: `${input.title} in ${input.repositoryName}...`
|
|
111
112
|
});
|
|
112
113
|
const prId = yield* awsClient.createPullRequest({
|
|
113
|
-
account: { profile: input.account.
|
|
114
|
+
account: { profile: input.account.profile, region: input.account.region },
|
|
114
115
|
repositoryName: input.repositoryName,
|
|
115
116
|
title: input.title,
|
|
116
117
|
...(input.description && { description: input.description }),
|
|
117
118
|
sourceReference: input.sourceBranch,
|
|
118
119
|
destinationReference: input.destinationBranch
|
|
119
|
-
}).pipe(Effect.tapError((e) => notifyError("Create PR Failed", e)),
|
|
120
|
-
// Error recovery: AwsClient already retries throttle errors with exponential
|
|
121
|
-
// backoff (see throttleRetry). These catchTags handle exhausted retries
|
|
122
|
-
// and non-retryable errors — notifyError shows the user what happened,
|
|
123
|
-
// then we return a fallback so the UI doesn't crash.
|
|
124
|
-
Effect.catchTag("AwsApiError", () => Effect.succeed("")), Effect.catchTag("AwsCredentialError", () => Effect.succeed("")), Effect.catchTag("AwsThrottleError", () => Effect.succeed("")), Effect.withSpan("createPr", { attributes: { repo: input.repositoryName } }));
|
|
120
|
+
}).pipe(Effect.tapError((e) => notifyError("Create PR Failed", e)), Effect.catchTag("AwsApiError", () => Effect.succeed("")), Effect.catchTag("AwsCredentialError", () => Effect.succeed("")), Effect.catchTag("AwsThrottleError", () => Effect.succeed("")), Effect.withSpan("createPr", { attributes: { repo: input.repositoryName } }));
|
|
125
121
|
if (prId) {
|
|
126
|
-
yield*
|
|
122
|
+
yield* notificationRepo.addSystem({
|
|
127
123
|
type: "success",
|
|
128
124
|
title: "PR Created",
|
|
129
125
|
message: `${input.title} (#${prId})`
|
|
@@ -139,7 +135,7 @@ export const createPrAtom = runtimeAtom.fn(Effect.fnUntraced(function* (input) {
|
|
|
139
135
|
export const fetchPrCommentsAtom = runtimeAtom.fn(Effect.fnUntraced(function* (pr) {
|
|
140
136
|
const awsClient = yield* AwsClient.AwsClient;
|
|
141
137
|
return yield* awsClient.getCommentsForPullRequest({
|
|
142
|
-
account: { profile: pr.account.
|
|
138
|
+
account: { profile: pr.account.profile, region: pr.account.region },
|
|
143
139
|
pullRequestId: pr.id,
|
|
144
140
|
repositoryName: pr.repositoryName
|
|
145
141
|
}).pipe(Effect.tapError((e) => notifyError("Fetch Comments Failed", e)), Effect.catchTag("AwsApiError", () => Effect.succeed([])), Effect.catchTag("AwsCredentialError", () => Effect.succeed([])), Effect.catchTag("AwsThrottleError", () => Effect.succeed([])), Effect.withSpan("fetchPrComments", { attributes: { prId: pr.id } }));
|
|
@@ -151,11 +147,9 @@ export const fetchPrCommentsAtom = runtimeAtom.fn(Effect.fnUntraced(function* (p
|
|
|
151
147
|
export const listBranchesAtom = runtimeAtom.fn(Effect.fnUntraced(function* (input) {
|
|
152
148
|
const awsClient = yield* AwsClient.AwsClient;
|
|
153
149
|
const branches = yield* awsClient.listBranches({
|
|
154
|
-
account: { profile: input.account.
|
|
150
|
+
account: { profile: input.account.profile, region: input.account.region },
|
|
155
151
|
repositoryName: input.repositoryName
|
|
156
|
-
}).pipe(Effect.tapError((e) => notifyError("List Branches Failed", e)),
|
|
157
|
-
// Exhausted-retry fallbacks — throttle retry happens inside AwsClient
|
|
158
|
-
Effect.catchTag("AwsApiError", () => Effect.succeed([])), Effect.catchTag("AwsCredentialError", () => Effect.succeed([])), Effect.catchTag("AwsThrottleError", () => Effect.succeed([])), Effect.withSpan("listBranches", { attributes: { repo: input.repositoryName } }));
|
|
152
|
+
}).pipe(Effect.tapError((e) => notifyError("List Branches Failed", e)), Effect.catchTag("AwsApiError", () => Effect.succeed([])), Effect.catchTag("AwsCredentialError", () => Effect.succeed([])), Effect.catchTag("AwsThrottleError", () => Effect.succeed([])), Effect.withSpan("listBranches", { attributes: { repo: input.repositoryName } }));
|
|
159
153
|
return branches.sort();
|
|
160
154
|
}));
|
|
161
155
|
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../../src/tui/atoms/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,SAAS,EAA4B,SAAS,EAAE,MAAM,wBAAwB,CAAA;
|
|
1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gBAAgB,GAAG,WAAW,CAAC,EAAE,CAC5C,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAC,KAAwB;IAClD,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,SAAS,CAAC,SAAS,CAAA;IAE5C,MAAM,QAAQ,GAAkB,KAAK,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC;QAC5D,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE;QACzE,cAAc,EAAE,KAAK,CAAC,cAAc;KACrC,CAAC,CAAC,IAAI,CACL,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,sBAAsB,EAAE,CAAC,CAAC,CAAC,EAC9D,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAgB,EAAE,CAAC,CAAC,EACvE,MAAM,CAAC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAgB,EAAE,CAAC,CAAC,EAC9E,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAgB,EAAE,CAAC,CAAC,EAC5E,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,cAAc,EAAE,EAAE,CAAC,CAChF,CAAA;IAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAA;AACxB,CAAC,CAAC,CACH,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Domain } from "@knpkv/codecommit-core";
|
|
1
|
+
import { CacheService, type Domain } from "@knpkv/codecommit-core";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
/**
|
|
4
4
|
* Subscribes to PRService.state changes
|
|
@@ -9,7 +9,7 @@ export declare const appStateAtom: import("@effect-atom/atom/Atom").Atom<import(
|
|
|
9
9
|
* Triggers a refresh of pull requests
|
|
10
10
|
* @category atoms
|
|
11
11
|
*/
|
|
12
|
-
export declare const refreshAtom: import("@effect-atom/atom/Atom").AtomResultFn<void, void,
|
|
12
|
+
export declare const refreshAtom: import("@effect-atom/atom/Atom").AtomResultFn<void, void, import("@effect/sql/SqlError").SqlError | import("effect/ConfigError").ConfigError | import("@effect/sql/Migrator").MigrationError>;
|
|
13
13
|
/**
|
|
14
14
|
* Cleanup function to abort pending requests on exit
|
|
15
15
|
*/
|
|
@@ -18,7 +18,7 @@ export declare const cleanup: Effect.Effect<void, never, never>;
|
|
|
18
18
|
* Toggles account enabled state in settings
|
|
19
19
|
* @category atoms
|
|
20
20
|
*/
|
|
21
|
-
export declare const toggleAccountAtom: import("@effect-atom/atom/Atom").AtomResultFn<string & import("effect/Brand").Brand<"AwsProfileName">, void,
|
|
21
|
+
export declare const toggleAccountAtom: import("@effect-atom/atom/Atom").AtomResultFn<string & import("effect/Brand").Brand<"AwsProfileName">, void, import("@effect/sql/SqlError").SqlError | import("effect/ConfigError").ConfigError | import("@effect/sql/Migrator").MigrationError>;
|
|
22
22
|
/**
|
|
23
23
|
* Sets all accounts to enabled or disabled
|
|
24
24
|
* @category atoms
|
|
@@ -26,17 +26,16 @@ export declare const toggleAccountAtom: import("@effect-atom/atom/Atom").AtomRes
|
|
|
26
26
|
export declare const setAllAccountsAtom: import("@effect-atom/atom/Atom").AtomResultFn<{
|
|
27
27
|
enabled: boolean;
|
|
28
28
|
profiles?: Array<Domain.AwsProfileName>;
|
|
29
|
-
}, void,
|
|
29
|
+
}, void, import("@effect/sql/SqlError").SqlError | import("effect/ConfigError").ConfigError | import("@effect/sql/Migrator").MigrationError>;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Marks all notifications as read
|
|
32
32
|
* @category atoms
|
|
33
33
|
*/
|
|
34
|
-
export declare const
|
|
34
|
+
export declare const markAllReadAtom: import("@effect-atom/atom/Atom").AtomResultFn<void, void, CacheService.CacheError | import("@effect/sql/SqlError").SqlError | import("effect/ConfigError").ConfigError | import("@effect/sql/Migrator").MigrationError>;
|
|
35
35
|
/**
|
|
36
|
-
* Subscribes to
|
|
36
|
+
* Subscribes to notification changes via EventsHub
|
|
37
37
|
* @category atoms
|
|
38
38
|
*/
|
|
39
|
-
export declare const notificationsAtom: import("@effect-atom/atom/Atom").Atom<import("@effect-atom/atom/Result").Result<
|
|
39
|
+
export declare const notificationsAtom: import("@effect-atom/atom/Atom").Atom<import("@effect-atom/atom/Result").Result<CacheService.PaginatedNotifications, never>>;
|
|
40
40
|
export type AppState = Domain.AppState;
|
|
41
|
-
export type NotificationsState = Domain.NotificationsState;
|
|
42
41
|
//# sourceMappingURL=app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../../src/tui/atoms/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../../src/tui/atoms/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,MAAM,EAAa,MAAM,wBAAwB,CAAA;AAE7E,OAAO,EAAE,MAAM,EAAkC,MAAM,QAAQ,CAAA;AAM/D;;;GAGG;AACH,eAAO,MAAM,YAAY,0GAKxB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,+LAWvB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,mCAKlB,CAAA;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,kPAK7B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB;aACkB,OAAO;eAAa,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC;4IAIhG,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,yNAK3B,CAAA;AAID;;;GAGG;AACH,eAAO,MAAM,iBAAiB,8HA2B7B,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Effect, Fiber } from "effect";
|
|
1
|
+
import { CacheService, PRService } from "@knpkv/codecommit-core";
|
|
2
|
+
import { Effect, Fiber, Stream, SubscriptionRef } from "effect";
|
|
3
3
|
import { runtimeAtom } from "./runtime.js";
|
|
4
4
|
// Track active refresh fiber for cleanup
|
|
5
5
|
let activeRefreshFiber = null;
|
|
@@ -51,19 +51,24 @@ export const setAllAccountsAtom = runtimeAtom.fn(Effect.fnUntraced(function* (pa
|
|
|
51
51
|
yield* Effect.forkDaemon(prService.setAllAccounts(params.enabled, params.profiles));
|
|
52
52
|
}));
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* Marks all notifications as read
|
|
55
55
|
* @category atoms
|
|
56
56
|
*/
|
|
57
|
-
export const
|
|
58
|
-
const
|
|
59
|
-
yield*
|
|
57
|
+
export const markAllReadAtom = runtimeAtom.fn(Effect.fnUntraced(function* () {
|
|
58
|
+
const notificationRepo = yield* CacheService.NotificationRepo;
|
|
59
|
+
yield* notificationRepo.markAllRead();
|
|
60
60
|
}));
|
|
61
|
+
const emptyNotifications = { items: [] };
|
|
61
62
|
/**
|
|
62
|
-
* Subscribes to
|
|
63
|
+
* Subscribes to notification changes via EventsHub
|
|
63
64
|
* @category atoms
|
|
64
65
|
*/
|
|
65
66
|
export const notificationsAtom = runtimeAtom.subscribable(Effect.gen(function* () {
|
|
66
|
-
const
|
|
67
|
-
|
|
67
|
+
const notificationRepo = yield* CacheService.NotificationRepo;
|
|
68
|
+
const hub = yield* CacheService.EventsHub;
|
|
69
|
+
const initial = yield* notificationRepo.findAll({ limit: 50 }).pipe(Effect.catchAll(() => Effect.succeed(emptyNotifications)));
|
|
70
|
+
const ref = yield* SubscriptionRef.make(initial);
|
|
71
|
+
yield* Effect.forkDaemon(Effect.scoped(hub.subscribe.pipe(Stream.filter((e) => e._tag === "Notifications" || e._tag === "SystemNotifications"), Stream.debounce("200 millis"), Stream.runForEach(() => notificationRepo.findAll({ limit: 50 }).pipe(Effect.flatMap((result) => SubscriptionRef.set(ref, result)), Effect.catchAll(() => Effect.void))))));
|
|
72
|
+
return ref;
|
|
68
73
|
}));
|
|
69
74
|
//# sourceMappingURL=app.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../src/tui/atoms/app.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../src/tui/atoms/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAE7E,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,yCAAyC;AACzC,IAAI,kBAAkB,GAA6C,IAAI,CAAA;AAEvE;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC,YAAY,CAClD,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,SAAS,CAAC,SAAS,CAAA;IAC5C,OAAO,SAAS,CAAC,KAAK,CAAA;AACxB,CAAC,CAAC,CACH,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAC,EAAE,CACvC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC;IACzB,8CAA8C;IAC9C,IAAI,kBAAkB,EAAE,CAAC;QACvB,KAAK,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAA;QAC1C,kBAAkB,GAAG,IAAI,CAAA;IAC3B,CA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C,CAAC,MAAM,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,EAC5D,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CACnC,CACF,CACF,CACF,CACF,CAAA;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,CAAC,CACH,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Atom } from "@effect-atom/atom-react";
|
|
2
2
|
import { BunContext } from "@effect/platform-bun";
|
|
3
|
-
import { AwsClient,
|
|
3
|
+
import { AwsClient, CacheService, PRService } from "@knpkv/codecommit-core";
|
|
4
4
|
/**
|
|
5
5
|
* Runtime atom providing Effect services to other atoms
|
|
6
6
|
* @category atoms
|
|
7
7
|
*/
|
|
8
|
-
export declare const runtimeAtom: Atom.AtomRuntime<AwsClient.AwsClient |
|
|
8
|
+
export declare const runtimeAtom: Atom.AtomRuntime<AwsClient.AwsClient | CacheService.EventsHub | CacheService.CommentRepo | CacheService.NotificationRepo | CacheService.PullRequestRepo | CacheService.SubscriptionRepo | CacheService.SyncMetadataRepo | PRService.PRService | BunContext.BunContext, import("@effect/sql/SqlError").SqlError | import("effect/ConfigError").ConfigError | import("@effect/sql/Migrator").MigrationError>;
|
|
9
9
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/tui/atoms/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/tui/atoms/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAmB,YAAY,EAAiB,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAuC3G;;;GAGG;AACH,eAAO,MAAM,WAAW,4YAAyB,CAAA"}
|