@fbincon/claude-code-statusline 3.11.0 → 3.13.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 +82 -79
- package/candidate.json +356 -254
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js +9 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js +23 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/config/profile-command.js +7 -3
- package/node_modules/@fbincon/statusline-cli/dist/src/config/profile-command.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/config/reuse.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/reuse.js +62 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/reuse.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/structural-review.d.ts +5 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/structural-review.js +45 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/structural-review.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js +5 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor-bootstrap.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor-bootstrap.js +41 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor-bootstrap.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor-worker-entry.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor-worker-entry.js +14 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor-worker-entry.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js +9 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/management/execution-worker-entry.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/execution-worker-entry.js +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/execution-worker-entry.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/execution.d.ts +29 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/execution.js +228 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/execution.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/history.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/history.js +150 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/history.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/inspection.js +30 -13
- package/node_modules/@fbincon/statusline-cli/dist/src/management/inspection.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/management/mod-transition.js +2 -2
- package/node_modules/@fbincon/statusline-cli/dist/src/management/mod-transition.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/management/review-jobs.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/review-jobs.js +11 -6
- package/node_modules/@fbincon/statusline-cli/dist/src/management/review-jobs.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/management/service.d.ts +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/management/service.js +9 -5
- package/node_modules/@fbincon/statusline-cli/dist/src/management/service.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/management/store.js +6 -6
- package/node_modules/@fbincon/statusline-cli/dist/src/management/store.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic-state.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic-state.js +6 -6
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic-state.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic.js +76 -28
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/automatic.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/bindings.d.ts +17 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/bindings.js +176 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/bindings.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/command.js +11 -3
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/command.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/providers.js +26 -8
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/providers.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.js +54 -14
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.d.ts +3 -3
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js +50 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/.claude-plugin/plugin.json +1 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/register.ts +30 -18
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/backend.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/keys.ts +14 -3
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/settings.ts +8 -5
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/alignment-manager.ts +2 -2
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/change-review.ts +109 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/color-manager.ts +1 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/draft.ts +74 -21
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/forms.ts +2 -9
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/group-manager.ts +2 -3
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/groups.ts +2 -2
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/history.ts +33 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/package-manager.ts +164 -291
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/package-validation.ts +10 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/reuse-manager.ts +150 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/reuse.ts +96 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/source-compatibility.ts +7 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/source-manager.ts +64 -45
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/source-summary.ts +22 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/source-validation.ts +11 -2
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/structure.ts +30 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-contracts.ts +49 -6
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/generated-locales.ts +7 -12722
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/locales/en.ts +2291 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/locales/ja.ts +2291 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/locales/ko.ts +2291 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/locales/zh-CN.ts +2291 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/locales/zh-HK.ts +2291 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/locales/zh-TW.ts +2291 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/resource-manifest.json +35 -22
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/draw.ts +4 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/help.ts +3 -2
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/.claude-plugin/plugin.json +1 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/hooks/observe.ts +10 -3
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/resource-manifest.json +4 -4
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.d.ts +127 -6
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js +2 -2
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/alignment-manager.js +2 -2
- package/node_modules/@fbincon/statusline-core/dist/src/editor/alignment-manager.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/change-review.d.ts +32 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/change-review.js +155 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/change-review.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/color-manager.js +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/color-manager.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.d.ts +20 -3
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js +121 -23
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js +2 -10
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/group-manager.js +2 -5
- package/node_modules/@fbincon/statusline-core/dist/src/editor/group-manager.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/groups.d.ts +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/groups.js +2 -2
- package/node_modules/@fbincon/statusline-core/dist/src/editor/groups.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/history.d.ts +22 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/history.js +37 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/history.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/package-manager.d.ts +12 -4
- package/node_modules/@fbincon/statusline-core/dist/src/editor/package-manager.js +302 -85
- package/node_modules/@fbincon/statusline-core/dist/src/editor/package-manager.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/package-validation.js +12 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/package-validation.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/reuse-manager.d.ts +39 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/reuse-manager.js +271 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/reuse-manager.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/reuse.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/reuse.js +135 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/reuse.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-compatibility.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-compatibility.js +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-compatibility.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.d.ts +9 -3
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.js +85 -30
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-summary.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-summary.js +25 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-summary.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.d.ts +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.js +13 -2
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/structure.d.ts +16 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/structure.js +28 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/structure.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.js +15 -3
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.d.ts +1032 -12
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js +1038 -18
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/management/compatibility.js +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/management/compatibility.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/release.d.ts +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/release.js +1 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/en.json +173 -3
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ja.json +173 -3
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ko.json +173 -3
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-CN.json +173 -3
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-HK.json +173 -3
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-TW.json +173 -3
- package/node_modules/@fbincon/statusline-platform/dist/src/native.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/native.js +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/native.js.map +1 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/npm.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/npm.js +20 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/npm.js.map +1 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/private-state.d.ts +3 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/private-state.js +53 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/private-state.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.js +45 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.js.map +1 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.d.ts +5 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.js +8 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js +6 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/shortcuts.js +3 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/shortcuts.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/session.d.ts +2 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js +26 -6
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/state.d.ts +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js +39 -9
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../src/editor/history.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { PackageStatus, PackageReviewJob, PackageReviewRequest, Operation, ResultFor } from '../contracts/ui.js';
|
|
1
|
+
import type { PackageStatus, PackageReviewJob, PackageReviewRequest, PackageExecution, PackageCleanupReview, PackageControl, Operation, ResultFor } from '../contracts/ui.js';
|
|
2
|
+
import type { Editor } from './draft.js';
|
|
2
3
|
import { type Language, type LocalizedText } from '../i18n/messages.js';
|
|
3
4
|
import { type TextInput, type TextKey } from './text-input.js';
|
|
4
5
|
interface Row {
|
|
@@ -12,6 +13,8 @@ export interface PackageManager {
|
|
|
12
13
|
owner: string;
|
|
13
14
|
status: PackageStatus | null;
|
|
14
15
|
job: PackageReviewJob | null;
|
|
16
|
+
execution: PackageExecution | null;
|
|
17
|
+
cleanup: PackageCleanupReview | null;
|
|
15
18
|
prefix: string;
|
|
16
19
|
target: string;
|
|
17
20
|
channel: 'latest' | 'beta' | null;
|
|
@@ -21,9 +24,13 @@ export interface PackageManager {
|
|
|
21
24
|
rows: Row[];
|
|
22
25
|
capacity: number;
|
|
23
26
|
input: TextInput | null;
|
|
24
|
-
editing: 'prefix' | 'target' | null;
|
|
27
|
+
editing: 'prefix' | 'target' | 'export_path' | null;
|
|
28
|
+
export_path: string;
|
|
25
29
|
message: LocalizedText | string | null;
|
|
26
|
-
effect: 'load' | 'start' | 'status' | 'cancel' | 'close' | null;
|
|
30
|
+
effect: 'load' | 'start' | 'status' | 'cancel' | 'close' | 'execute' | 'save-draft' | 'discard-draft' | 'export-draft' | 'reconcile-draft' | 'cleanup-review' | 'cleanup-apply' | null;
|
|
31
|
+
mode: 'status' | 'draft' | 'execute-confirm' | 'cleanup' | 'cleanup-confirm';
|
|
32
|
+
cleanupId: string | null;
|
|
33
|
+
draftPrepared: boolean;
|
|
27
34
|
action: PackageReviewRequest['action'];
|
|
28
35
|
backup: string | null;
|
|
29
36
|
busy: boolean;
|
|
@@ -33,9 +40,10 @@ export interface PackageManager {
|
|
|
33
40
|
export declare function packageManager(): PackageManager;
|
|
34
41
|
export interface PackageBackend {
|
|
35
42
|
request<O extends Operation>(operation: O, payload?: unknown): ResultFor<O> | Promise<ResultFor<O>>;
|
|
43
|
+
control?<O extends Operation>(control: PackageControl, operation: O, payload?: unknown): ResultFor<O> | Promise<ResultFor<O>>;
|
|
36
44
|
}
|
|
37
45
|
export declare function closePackage(view: PackageManager, backend: PackageBackend): Promise<void>;
|
|
38
|
-
export declare function performPackage(view: PackageManager, backend: PackageBackend): Promise<void>;
|
|
46
|
+
export declare function performPackage(view: PackageManager, backend: PackageBackend, editor?: Editor): Promise<void>;
|
|
39
47
|
export declare function packageView(view: PackageManager, language: Language, width: number, height: number): Row[];
|
|
40
48
|
export declare function packageKey(view: PackageManager, event: TextKey): 'packages' | null;
|
|
41
49
|
export {};
|
|
@@ -1,23 +1,33 @@
|
|
|
1
|
+
import { closeSourceDraft } from './source-manager.js';
|
|
1
2
|
import { t, text, renderMessage } from '../i18n/messages.js';
|
|
2
3
|
import { inputKey, inputView, textInput } from './text-input.js';
|
|
3
4
|
import { wrapText } from './text.js';
|
|
4
5
|
import { BackendError } from './backend.js';
|
|
5
6
|
export function packageManager() {
|
|
6
|
-
return { owner: 'viewer-' + Date.now().toString(36) + '-' + Math.random().toString(36).slice(2), status: null, job: null,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
return { owner: 'viewer-' + Date.now().toString(36) + '-' + Math.random().toString(36).slice(2), status: null, job: null, execution: null, cleanup: null, prefix: '', target: '', channel: null, offset: 0, selected: 'prefix', scroll: 0, rows: [], capacity: 1, input: null, editing: null, export_path: 'statusline-before-update.json', message: null, effect: 'load', mode: 'status', cleanupId: null, draftPrepared: false, action: 'check', backup: null, busy: false, closed: false, generation: 0 };
|
|
8
|
+
}
|
|
9
|
+
function request(view, backend, operation, payload) {
|
|
10
|
+
return view.execution && backend.control ? backend.control(view.execution.control, operation, payload) : backend.request(operation, payload);
|
|
9
11
|
}
|
|
10
12
|
export async function closePackage(view, backend) {
|
|
11
13
|
view.closed = true;
|
|
12
14
|
view.generation++;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
if (view.execution)
|
|
16
|
+
try {
|
|
17
|
+
await request(view, backend, 'package_execute_detach', { id: view.execution.id, owner: view.owner });
|
|
18
|
+
}
|
|
19
|
+
catch { /* Detach never cancels an executor. */ }
|
|
20
|
+
if (view.job)
|
|
15
21
|
try {
|
|
16
|
-
await
|
|
22
|
+
await request(view, backend, 'package_review_cancel', { id: view.job.id, owner: view.owner });
|
|
17
23
|
}
|
|
18
|
-
catch { /*
|
|
24
|
+
catch { /* Review deadlines still bound disconnected views. */ }
|
|
19
25
|
}
|
|
20
|
-
|
|
26
|
+
function verified(view) {
|
|
27
|
+
const job = view.job, review = job?.review;
|
|
28
|
+
return job?.state === 'complete' && !!review?.compatible && job.request.action !== 'check' && (review.artifact_verified || job.request.action === 'restore-config');
|
|
29
|
+
}
|
|
30
|
+
export async function performPackage(view, backend, editor) {
|
|
21
31
|
const effect = view.effect;
|
|
22
32
|
if (!effect || view.busy)
|
|
23
33
|
return;
|
|
@@ -31,7 +41,7 @@ export async function performPackage(view, backend) {
|
|
|
31
41
|
try {
|
|
32
42
|
if (effect === 'load') {
|
|
33
43
|
if (view.job && view.prefix && view.job.request.prefix !== view.prefix) {
|
|
34
|
-
const cancelled = await
|
|
44
|
+
const cancelled = await request(view, backend, 'package_review_cancel', { id: view.job.id, owner: view.owner });
|
|
35
45
|
if (view.closed || generation !== view.generation)
|
|
36
46
|
return;
|
|
37
47
|
if (cancelled.state !== 'cancelled') {
|
|
@@ -42,7 +52,7 @@ export async function performPackage(view, backend) {
|
|
|
42
52
|
}
|
|
43
53
|
view.job = null;
|
|
44
54
|
}
|
|
45
|
-
const status = await
|
|
55
|
+
const status = await request(view, backend, 'package_status', { prefix: view.prefix || null, offset: view.offset });
|
|
46
56
|
if (view.closed || generation !== view.generation)
|
|
47
57
|
return;
|
|
48
58
|
if (view.job && status.revision !== view.job.request.expected_revision) {
|
|
@@ -52,25 +62,27 @@ export async function performPackage(view, backend) {
|
|
|
52
62
|
}
|
|
53
63
|
view.status = status;
|
|
54
64
|
view.prefix = status.prefix ?? view.prefix;
|
|
65
|
+
if (status.execution) {
|
|
66
|
+
view.execution = status.execution;
|
|
67
|
+
if (editor)
|
|
68
|
+
editor.packageLocked = true;
|
|
69
|
+
view.selected = 'execution';
|
|
70
|
+
}
|
|
55
71
|
}
|
|
56
72
|
else if (effect === 'start') {
|
|
57
73
|
if (!view.status?.prefix)
|
|
58
74
|
throw new BackendError('prefix', text('package.reason_prefix'));
|
|
59
|
-
if (view.job?.state === 'running')
|
|
75
|
+
if (view.job?.state === 'running' || view.execution?.running !== false && view.execution?.state === 'running')
|
|
60
76
|
return;
|
|
61
77
|
const previous = view.job;
|
|
62
|
-
let target = view.action === 'recover-package' ? view.status.pending?.version ?? view.target : view.target || null;
|
|
63
|
-
|
|
64
|
-
if (view.action === 'update' && previous?.state === 'complete' && previous.request.action === 'check' && previous.request.expected_revision === view.status.revision && previous.review &&
|
|
65
|
-
(!target || target === previous.review.target) && (!view.channel || view.channel === previous.review.channel || !!target)) {
|
|
78
|
+
let target = view.action === 'recover-package' ? view.status.pending?.version ?? view.target : view.target || null, integrity = null;
|
|
79
|
+
if (view.action === 'update' && previous?.state === 'complete' && previous.request.action === 'check' && previous.request.expected_revision === view.status.revision && previous.review && (!target || target === previous.review.target) && (!view.channel || view.channel === previous.review.channel || !!target)) {
|
|
66
80
|
target = previous.review.target;
|
|
67
81
|
integrity = previous.review.integrity;
|
|
68
82
|
}
|
|
69
|
-
const
|
|
70
|
-
target: view.action === 'restore-config' ? null : target, channel: !target && ['check', 'update'].includes(view.action) ? view.channel : null,
|
|
71
|
-
backup_id: view.action === 'restore-config' ? view.backup : null, expected_integrity: integrity };
|
|
83
|
+
const reviewRequest = { action: view.action, prefix: view.status.prefix, expected_revision: view.status.revision, target: view.action === 'restore-config' ? null : target, channel: !target && ['check', 'update'].includes(view.action) ? view.channel : null, backup_id: view.action === 'restore-config' ? view.backup : null, expected_integrity: integrity };
|
|
72
84
|
if (previous) {
|
|
73
|
-
const cancelled = await
|
|
85
|
+
const cancelled = await request(view, backend, 'package_review_cancel', { id: previous.id, owner: view.owner });
|
|
74
86
|
if (view.closed || generation !== view.generation)
|
|
75
87
|
return;
|
|
76
88
|
if (cancelled.state !== 'cancelled') {
|
|
@@ -81,31 +93,132 @@ export async function performPackage(view, backend) {
|
|
|
81
93
|
}
|
|
82
94
|
view.job = null;
|
|
83
95
|
}
|
|
84
|
-
const job = await
|
|
96
|
+
const job = await request(view, backend, 'package_review_start', { request: reviewRequest, owner: view.owner });
|
|
85
97
|
if (view.closed || generation !== view.generation) {
|
|
86
|
-
await
|
|
98
|
+
await request(view, backend, 'package_review_cancel', { id: job.id, owner: view.owner });
|
|
87
99
|
return;
|
|
88
100
|
}
|
|
89
101
|
view.job = job;
|
|
102
|
+
view.mode = 'status';
|
|
103
|
+
view.draftPrepared = false;
|
|
90
104
|
view.message = null;
|
|
91
105
|
view.selected = 'job';
|
|
92
106
|
}
|
|
107
|
+
else if (effect === 'execute') {
|
|
108
|
+
if (!editor || !verified(view))
|
|
109
|
+
throw new BackendError('integrity', text('package.reason_integrity'));
|
|
110
|
+
if (editor.saveState !== 'idle') {
|
|
111
|
+
view.mode = 'draft';
|
|
112
|
+
view.message = text('editor.save_unknown');
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (!view.draftPrepared) {
|
|
116
|
+
if (!editor.acceptNumeric()) {
|
|
117
|
+
view.message = text('package.ui.draft_required');
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
view.mode = editor.modified ? 'draft' : 'execute-confirm';
|
|
121
|
+
view.selected = editor.modified ? 'draft-cancel' : 'execute-confirm';
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
editor.packageLocked = true;
|
|
125
|
+
const execution = await request(view, backend, 'package_execute_start', { id: view.job.id, owner: view.owner });
|
|
126
|
+
view.execution = execution;
|
|
127
|
+
view.mode = 'status';
|
|
128
|
+
view.selected = 'execution';
|
|
129
|
+
view.message = text('package.ui.editor_locked');
|
|
130
|
+
await closeSourceDraft(editor, { request: (operation, payload) => request(view, backend, operation, payload) });
|
|
131
|
+
if (view.closed || generation !== view.generation)
|
|
132
|
+
await request(view, backend, 'package_execute_detach', { id: execution.id, owner: view.owner });
|
|
133
|
+
}
|
|
134
|
+
else if (effect === 'discard-draft') {
|
|
135
|
+
if (!editor || editor.saveState !== 'idle')
|
|
136
|
+
throw new BackendError('configuration_conflict', text('editor.save_locked'));
|
|
137
|
+
editor.replaceDraft(editor.baseline.draft);
|
|
138
|
+
view.draftPrepared = true;
|
|
139
|
+
view.mode = 'execute-confirm';
|
|
140
|
+
view.selected = 'execute-confirm';
|
|
141
|
+
}
|
|
142
|
+
else if (effect === 'save-draft') {
|
|
143
|
+
if (!editor || editor.saveState !== 'idle')
|
|
144
|
+
throw new BackendError('configuration_conflict', text('editor.save_locked'));
|
|
145
|
+
if (!editor.acceptNumeric()) {
|
|
146
|
+
view.message = text('package.ui.draft_required');
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const submitted = editor.beginSave();
|
|
150
|
+
try {
|
|
151
|
+
const saved = await backend.request('apply', { draft: submitted.draft, expected_revision: submitted.revision, ...(submitted.target ? { target: submitted.target } : {}) });
|
|
152
|
+
editor.committed(saved);
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
editor.saveFailed(error instanceof BackendError ? error.code : '');
|
|
156
|
+
throw error;
|
|
157
|
+
}
|
|
158
|
+
view.mode = 'status';
|
|
159
|
+
view.job = null;
|
|
160
|
+
view.status = null;
|
|
161
|
+
view.effect = 'load';
|
|
162
|
+
view.message = text('package.ui.review_again');
|
|
163
|
+
}
|
|
164
|
+
else if (effect === 'export-draft') {
|
|
165
|
+
if (!editor || editor.saveState !== 'idle')
|
|
166
|
+
throw new BackendError('configuration_conflict', text('editor.save_locked'));
|
|
167
|
+
await backend.request('export', { draft: editor.draft, path: view.export_path, overwrite: false });
|
|
168
|
+
view.draftPrepared = true;
|
|
169
|
+
view.mode = 'execute-confirm';
|
|
170
|
+
view.selected = 'execute-confirm';
|
|
171
|
+
view.message = text('package.ui.exported');
|
|
172
|
+
}
|
|
173
|
+
else if (effect === 'reconcile-draft') {
|
|
174
|
+
if (!editor?.pendingSave)
|
|
175
|
+
return;
|
|
176
|
+
const pending = editor.pendingSave;
|
|
177
|
+
editor.setSaveState('pending');
|
|
178
|
+
try {
|
|
179
|
+
const current = await backend.request('read', pending.target ? { target: pending.target } : {});
|
|
180
|
+
const result = editor.reconcileSave(current);
|
|
181
|
+
view.message = text('editor.' + result);
|
|
182
|
+
view.mode = 'status';
|
|
183
|
+
view.job = null;
|
|
184
|
+
view.status = null;
|
|
185
|
+
view.effect = 'load';
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
editor.setSaveState('unknown');
|
|
189
|
+
throw error;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
else if (effect === 'cleanup-review') {
|
|
193
|
+
if (!view.prefix)
|
|
194
|
+
throw new BackendError('prefix', text('package.reason_prefix'));
|
|
195
|
+
view.cleanup = await request(view, backend, 'package_cleanup_review', { prefix: view.prefix, offset: view.offset });
|
|
196
|
+
view.mode = 'cleanup';
|
|
197
|
+
view.selected = view.cleanup.rows[0] ? 'cleanup:' + view.cleanup.rows[0].id : 'cleanup-message';
|
|
198
|
+
}
|
|
199
|
+
else if (effect === 'cleanup-apply') {
|
|
200
|
+
view.cleanup = await request(view, backend, 'package_cleanup_apply', { prefix: view.prefix, revision: view.cleanup.revision, ids: [view.cleanupId] });
|
|
201
|
+
view.mode = 'cleanup';
|
|
202
|
+
view.selected = 'cleanup-message';
|
|
203
|
+
view.message = text('package.ui.cleaned');
|
|
204
|
+
}
|
|
205
|
+
else if (effect === 'status' && view.execution) {
|
|
206
|
+
view.execution = await request(view, backend, 'package_execute_status', { id: view.execution.id });
|
|
207
|
+
view.selected = 'execution';
|
|
208
|
+
}
|
|
93
209
|
else if (view.job) {
|
|
94
|
-
const job = await
|
|
210
|
+
const job = await request(view, backend, effect === 'cancel' ? 'package_review_cancel' : 'package_review_status', { id: view.job.id, owner: view.owner });
|
|
95
211
|
if (view.closed || generation !== view.generation)
|
|
96
212
|
return;
|
|
97
213
|
const cancelled = effect === 'cancel' && job.state === 'cancelled';
|
|
98
214
|
view.job = cancelled ? null : job;
|
|
99
215
|
view.message = effect === 'cancel' ? text(cancelled ? 'package.cancelled' : 'package.ui.cancel_requested') : null;
|
|
100
|
-
|
|
101
|
-
view.selected = 'message';
|
|
102
|
-
else if (job.state !== 'running') {
|
|
103
|
-
view.selected = job.review ? 'verification' : job.error ? 'job-error' : 'job';
|
|
104
|
-
view.scroll = Math.max(0, view.rows.findIndex(row => row.key === 'job'));
|
|
105
|
-
}
|
|
216
|
+
view.selected = effect === 'cancel' ? 'message' : job.review ? 'verification' : job.error ? 'job-error' : 'job';
|
|
106
217
|
}
|
|
107
218
|
}
|
|
108
219
|
catch (error) {
|
|
220
|
+
if (effect === 'execute' && editor && !view.execution && error instanceof BackendError && ['arguments', 'conflict', 'integrity', 'identity', 'busy', 'development', 'permission', 'configuration', 'journal'].includes(error.code))
|
|
221
|
+
editor.packageLocked = false;
|
|
109
222
|
if (!view.closed && generation === view.generation) {
|
|
110
223
|
view.message = error instanceof BackendError && error.localization ? error.localization : text('package.reason_io_error');
|
|
111
224
|
view.selected = 'message';
|
|
@@ -117,57 +230,102 @@ export async function performPackage(view, backend) {
|
|
|
117
230
|
}
|
|
118
231
|
}
|
|
119
232
|
export function packageView(view, language, width, height) {
|
|
120
|
-
const tr = (key, params = {}) => t(key, language, params), rows = [];
|
|
233
|
+
const tr = (key, params = {}) => t('package.ui.' + key, language, params), rows = [];
|
|
121
234
|
const add = (key, value, action, backup) => wrapText([value.replace(/[\p{Cc}\p{Cs}]/gu, '')], Math.max(2, width - 2)).forEach((line, index) => rows.push({ key: index ? key + ':' + index : key, text: line, ...(action ? { action } : {}), ...(backup ? { backup } : {}) }));
|
|
122
235
|
const status = view.status;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
add('
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
add('
|
|
236
|
+
if (view.mode === 'draft') {
|
|
237
|
+
add('notice', tr('draft_required'));
|
|
238
|
+
add('draft-save', tr('draft_save'));
|
|
239
|
+
add('draft-export', tr('draft_export'));
|
|
240
|
+
add('draft-discard', tr('draft_discard'));
|
|
241
|
+
add('draft-cancel', tr('draft_cancel'));
|
|
242
|
+
add('draft-reconcile', tr('draft_reconcile'));
|
|
243
|
+
}
|
|
244
|
+
else if (view.mode === 'execute-confirm') {
|
|
245
|
+
add('notice', tr('execute_notice'));
|
|
246
|
+
add('execute-confirm', tr('execute_confirm'));
|
|
247
|
+
add('draft-cancel', tr('draft_cancel'));
|
|
248
|
+
}
|
|
249
|
+
else if (view.mode === 'cleanup' || view.mode === 'cleanup-confirm') {
|
|
250
|
+
add('cleanup-message', tr(view.cleanup?.uncertain ? 'cleanup_uncertain' : 'cleanup_notice'));
|
|
251
|
+
if (view.mode === 'cleanup-confirm') {
|
|
252
|
+
add('cleanup-confirm', tr('cleanup_confirm'));
|
|
253
|
+
add('cleanup-selected', view.cleanupId ?? '');
|
|
254
|
+
}
|
|
255
|
+
else
|
|
256
|
+
for (const row of view.cleanup?.rows ?? [])
|
|
257
|
+
add('cleanup:' + row.id, `${row.id} · ${row.version ?? '—'} · ${tr(row.removable ? 'cleanup_unused' : 'cleanup_protected')}${row.reasons.map(reason => ' · ' + tr('protect_' + reason)).join('')}`);
|
|
258
|
+
add('previous-page', tr('previous_page'));
|
|
259
|
+
add('next-page', tr('next_page'));
|
|
260
|
+
}
|
|
129
261
|
else {
|
|
130
|
-
add('
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
add('
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
add(
|
|
140
|
-
|
|
141
|
-
add('
|
|
142
|
-
|
|
143
|
-
|
|
262
|
+
add('notice', tr('local_notice'));
|
|
263
|
+
if (status)
|
|
264
|
+
add('current', tr('current', { value: status.current ?? t('task.unknown', language) }));
|
|
265
|
+
add('prefix', tr('prefix', { value: view.editing === 'prefix' && view.input ? inputView(view.input, Math.max(2, width - 12)) : view.prefix || t('task.unknown', language) }));
|
|
266
|
+
if (!status)
|
|
267
|
+
add('loading', t(view.busy ? 'profiles.loading' : 'task.unknown', language));
|
|
268
|
+
else {
|
|
269
|
+
add('entry', tr('entry', { value: status.entry ?? t('task.unknown', language) }));
|
|
270
|
+
add('config', tr('config', { value: status.config_dir }));
|
|
271
|
+
add('previous', tr('previous', { value: status.previous ?? t('task.unknown', language) }));
|
|
272
|
+
add('observed-channel', tr('channel', { value: status.channel ?? t('task.unknown', language) }));
|
|
273
|
+
add('runtime', `Node ${status.node_version} · Claude ${status.host ?? t('task.unknown', language)}`);
|
|
274
|
+
status.reasons.forEach(reason => add('reason:' + reason, t('package.reason_' + reason, language, {}, reason)));
|
|
275
|
+
if (!view.execution || view.execution.running === false) {
|
|
276
|
+
add('target', tr('target', { value: view.editing === 'target' && view.input ? inputView(view.input, Math.max(2, width - 12)) : view.target || tr('default_target') }));
|
|
277
|
+
add('channel', tr('channel', { value: view.channel ?? tr('inherit') }));
|
|
278
|
+
for (const action of ['check', 'update', 'rollback', 'recover-package'])
|
|
279
|
+
add(action, 'Enter · ' + tr(action), action);
|
|
280
|
+
add('cleanup-review', tr('cleanup_review'));
|
|
281
|
+
}
|
|
282
|
+
if (status.pending)
|
|
283
|
+
add('pending', tr('pending', { id: status.pending.id, stage: tr('stage_' + status.pending.stage), running: status.pending.running ? t('task.value.running', language) : t('task.unknown', language) }));
|
|
284
|
+
for (const record of status.history)
|
|
285
|
+
add('backup:' + record.id, `${record.id} · ${record.version ?? '—'} · ${tr('stage_' + record.stage)} · ${tr('backup_' + record.backup)}`, record.backup === 'verified' ? 'restore-config' : undefined, record.id);
|
|
286
|
+
if (status.total > 16) {
|
|
287
|
+
add('previous-page', tr('previous_page'));
|
|
288
|
+
add('next-page', tr('next_page'));
|
|
289
|
+
}
|
|
144
290
|
}
|
|
145
|
-
if (
|
|
146
|
-
|
|
147
|
-
add('
|
|
291
|
+
if (view.job) {
|
|
292
|
+
const job = view.job;
|
|
293
|
+
add('job', tr('job', { id: job.id, state: tr('state_' + job.state) }));
|
|
294
|
+
if (job.error)
|
|
295
|
+
add('job-error', t('package.reason_' + job.error, language, {}, job.error));
|
|
296
|
+
if (job.review) {
|
|
297
|
+
const review = job.review;
|
|
298
|
+
add('verification', tr(review.action === 'restore-config' ? 'restore_review' : review.artifact_verified ? 'verified' : 'unverified'));
|
|
299
|
+
add('review-target', `${review.current ?? '—'} → ${review.target ?? '—'}`);
|
|
300
|
+
add('review-config', tr('config', { value: review.config_dir }));
|
|
301
|
+
if (review.registry)
|
|
302
|
+
add('registry', review.registry);
|
|
303
|
+
if (review.integrity)
|
|
304
|
+
add('integrity', review.integrity);
|
|
305
|
+
if (review.node_engine)
|
|
306
|
+
add('engine', 'Node ' + review.node_engine);
|
|
307
|
+
review.reasons.forEach(reason => add('review-reason:' + reason, t('package.reason_' + reason, language, {}, reason)));
|
|
308
|
+
review.configuration_conflicts.forEach(file => add('conflict:' + file, file));
|
|
309
|
+
review.files.forEach(file => add('restore:' + file, file));
|
|
310
|
+
if (verified(view))
|
|
311
|
+
add('execute', tr('execute'));
|
|
312
|
+
}
|
|
148
313
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
add('
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
add('
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if (review.registry)
|
|
161
|
-
add('registry', review.registry);
|
|
162
|
-
if (review.integrity)
|
|
163
|
-
add('integrity', review.integrity);
|
|
164
|
-
if (review.node_engine)
|
|
165
|
-
add('engine', 'Node ' + review.node_engine);
|
|
166
|
-
review.reasons.forEach(reason => add('review-reason:' + reason, t('package.reason_' + reason, language, {}, reason)));
|
|
167
|
-
review.configuration_conflicts.forEach(file => add('conflict:' + file, file));
|
|
168
|
-
review.files.forEach(file => add('restore:' + file, file));
|
|
314
|
+
if (view.execution) {
|
|
315
|
+
const run = view.execution;
|
|
316
|
+
add('execution', tr('execution', { id: run.transaction_id ?? run.id, state: tr('execution_state_' + run.state), stage: t('package.ui.stage_' + run.stage, language, {}, run.stage) }));
|
|
317
|
+
add('execution-results', tr('execution_results', { package: tr(run.results.package === null ? 'result_na' : run.results.package ? 'result_done' : 'result_pending'), integration: tr(run.results.integration === null ? 'result_na' : run.results.integration ? 'result_done' : 'result_pending'), configuration: tr(run.results.configuration === null ? 'result_na' : run.results.configuration ? 'result_done' : 'result_pending') }));
|
|
318
|
+
add('execution-control', tr('control', { executable: run.control.executable, entry: run.control.args[0] ?? '' }));
|
|
319
|
+
add('execution-control-help', tr('control_help', { directory: run.control.config_dir }));
|
|
320
|
+
if (run.error)
|
|
321
|
+
add('execution-error', t('package.reason_' + run.error, language, {}, run.error));
|
|
322
|
+
add('reload-required', tr('editor_locked'));
|
|
323
|
+
if (run.state === 'complete')
|
|
324
|
+
add('reopen', tr('reopen'));
|
|
169
325
|
}
|
|
170
326
|
}
|
|
327
|
+
if (view.input && view.editing === 'export_path')
|
|
328
|
+
add('export-path', tr('export_path', { value: inputView(view.input, Math.max(2, width - 16)) }));
|
|
171
329
|
if (view.message)
|
|
172
330
|
add('message', renderMessage(view.message, language));
|
|
173
331
|
let index = rows.findIndex(row => row.key === view.selected);
|
|
@@ -194,42 +352,50 @@ export function packageKey(view, event) {
|
|
|
194
352
|
view[field] = view.input.value;
|
|
195
353
|
view.input = null;
|
|
196
354
|
view.editing = null;
|
|
197
|
-
if (field === '
|
|
198
|
-
view.
|
|
199
|
-
if (field === 'target' && view.job) {
|
|
200
|
-
view.effect = 'cancel';
|
|
355
|
+
if (field === 'export_path') {
|
|
356
|
+
view.effect = 'export-draft';
|
|
201
357
|
return 'packages';
|
|
202
358
|
}
|
|
203
359
|
if (field === 'prefix') {
|
|
360
|
+
view.status = null;
|
|
204
361
|
view.offset = 0;
|
|
205
362
|
view.effect = 'load';
|
|
206
363
|
return 'packages';
|
|
207
364
|
}
|
|
365
|
+
if (field === 'target' && view.job) {
|
|
366
|
+
view.effect = 'cancel';
|
|
367
|
+
return 'packages';
|
|
368
|
+
}
|
|
208
369
|
return null;
|
|
209
370
|
}
|
|
210
|
-
const result = inputKey(view.input.value, view.input, event, view.editing === '
|
|
371
|
+
const result = inputKey(view.input.value, view.input, event, view.editing === 'target' ? 100 : 4096);
|
|
211
372
|
view.input = result.state;
|
|
212
373
|
if (result.error)
|
|
213
|
-
view.message = text('input.' + result.error, { limit: view.editing === '
|
|
374
|
+
view.message = text('input.' + result.error, { limit: view.editing === 'target' ? 100 : 4096 });
|
|
214
375
|
return null;
|
|
215
376
|
}
|
|
216
377
|
if (event.text || event.paste || event.meta)
|
|
217
378
|
return null;
|
|
218
379
|
if (cancel || !event.ctrl && key.toLowerCase() === 'q') {
|
|
380
|
+
if (view.mode !== 'status') {
|
|
381
|
+
view.mode = 'status';
|
|
382
|
+
view.draftPrepared = false;
|
|
383
|
+
return null;
|
|
384
|
+
}
|
|
219
385
|
view.effect = 'close';
|
|
220
386
|
return 'packages';
|
|
221
387
|
}
|
|
222
388
|
if (event.ctrl || view.busy)
|
|
223
389
|
return null;
|
|
224
390
|
if (key.toLowerCase() === 'r') {
|
|
225
|
-
view.effect = view.job ? 'status' : 'load';
|
|
391
|
+
view.effect = view.mode === 'cleanup' ? 'cleanup-review' : view.execution || view.job ? 'status' : 'load';
|
|
226
392
|
return 'packages';
|
|
227
393
|
}
|
|
228
394
|
if (key.toLowerCase() === 'l') {
|
|
229
395
|
view.effect = 'load';
|
|
230
396
|
return 'packages';
|
|
231
397
|
}
|
|
232
|
-
if (key.toLowerCase() === 'c' && view.job) {
|
|
398
|
+
if (key.toLowerCase() === 'c' && view.job && !view.execution) {
|
|
233
399
|
view.effect = 'cancel';
|
|
234
400
|
return 'packages';
|
|
235
401
|
}
|
|
@@ -250,12 +416,62 @@ export function packageKey(view, event) {
|
|
|
250
416
|
if (key !== 'enter')
|
|
251
417
|
return null;
|
|
252
418
|
const selectedKey = view.selected.replace(/:\d+$/u, '');
|
|
253
|
-
if (selectedKey === '
|
|
419
|
+
if (selectedKey === 'draft-cancel') {
|
|
420
|
+
view.mode = 'status';
|
|
421
|
+
view.draftPrepared = false;
|
|
422
|
+
return null;
|
|
423
|
+
}
|
|
424
|
+
if (selectedKey === 'draft-save') {
|
|
425
|
+
view.effect = 'save-draft';
|
|
426
|
+
return 'packages';
|
|
427
|
+
}
|
|
428
|
+
if (selectedKey === 'draft-reconcile') {
|
|
429
|
+
view.effect = 'reconcile-draft';
|
|
430
|
+
return 'packages';
|
|
431
|
+
}
|
|
432
|
+
if (selectedKey === 'draft-export') {
|
|
433
|
+
view.editing = 'export_path';
|
|
434
|
+
view.input = textInput(view.export_path);
|
|
435
|
+
return null;
|
|
436
|
+
}
|
|
437
|
+
if (selectedKey === 'draft-discard') {
|
|
438
|
+
view.effect = 'discard-draft';
|
|
439
|
+
return 'packages';
|
|
440
|
+
}
|
|
441
|
+
if (selectedKey === 'execute') {
|
|
442
|
+
view.draftPrepared = false;
|
|
443
|
+
view.effect = 'execute';
|
|
444
|
+
return 'packages';
|
|
445
|
+
}
|
|
446
|
+
if (selectedKey === 'execute-confirm') {
|
|
447
|
+
view.draftPrepared = true;
|
|
448
|
+
view.effect = 'execute';
|
|
449
|
+
return 'packages';
|
|
450
|
+
}
|
|
451
|
+
if (selectedKey === 'cleanup-review') {
|
|
452
|
+
view.offset = 0;
|
|
453
|
+
view.effect = 'cleanup-review';
|
|
454
|
+
return 'packages';
|
|
455
|
+
}
|
|
456
|
+
if (selectedKey === 'cleanup-confirm') {
|
|
457
|
+
view.effect = 'cleanup-apply';
|
|
458
|
+
return 'packages';
|
|
459
|
+
}
|
|
460
|
+
if (selectedKey.startsWith('cleanup:')) {
|
|
461
|
+
const row = view.cleanup?.rows.find(row => 'cleanup:' + row.id === selectedKey);
|
|
462
|
+
if (row?.removable) {
|
|
463
|
+
view.cleanupId = row.id;
|
|
464
|
+
view.mode = 'cleanup-confirm';
|
|
465
|
+
view.selected = 'cleanup-confirm';
|
|
466
|
+
}
|
|
467
|
+
return null;
|
|
468
|
+
}
|
|
469
|
+
if ((selectedKey === 'prefix' || selectedKey === 'target') && !view.execution) {
|
|
254
470
|
view.editing = selectedKey;
|
|
255
|
-
view.input = textInput(view[
|
|
471
|
+
view.input = textInput(view[selectedKey]);
|
|
256
472
|
return null;
|
|
257
473
|
}
|
|
258
|
-
if (selectedKey === 'channel') {
|
|
474
|
+
if (selectedKey === 'channel' && !view.execution) {
|
|
259
475
|
const channels = [null, 'latest', 'beta'];
|
|
260
476
|
view.channel = channels[(channels.indexOf(view.channel) + 1) % 3];
|
|
261
477
|
if (view.job) {
|
|
@@ -265,8 +481,9 @@ export function packageKey(view, event) {
|
|
|
265
481
|
return null;
|
|
266
482
|
}
|
|
267
483
|
if (['next-page', 'previous-page'].includes(selectedKey)) {
|
|
268
|
-
|
|
269
|
-
view.
|
|
484
|
+
const total = view.mode === 'cleanup' ? view.cleanup?.total : view.status?.total;
|
|
485
|
+
view.offset = Math.max(0, Math.min(view.offset + (selectedKey === 'next-page' ? 16 : -16), Math.max(0, Math.floor(((total ?? 1) - 1) / 16) * 16)));
|
|
486
|
+
view.effect = view.mode === 'cleanup' ? 'cleanup-review' : 'load';
|
|
270
487
|
return 'packages';
|
|
271
488
|
}
|
|
272
489
|
const selected = view.rows.find(row => row.key === view.selected);
|