@mohou/panel 1.0.20 → 1.0.22
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/lib/types/index.d.ts +2 -2
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/labels.d.ts +10 -0
- package/lib/types/labels.d.ts.map +1 -1
- package/lib/types/settings/client.d.ts +21 -0
- package/lib/types/settings/client.d.ts.map +1 -1
- package/lib/types/settings/form.d.ts +24 -0
- package/lib/types/settings/form.d.ts.map +1 -1
- package/lib/types/settings/state.d.ts +12 -0
- package/lib/types/settings/state.d.ts.map +1 -1
- package/lib/types/settings/update-dialog.d.ts +2 -1
- package/lib/types/settings/update-dialog.d.ts.map +1 -1
- package/lib/types/settings/update-source.d.ts +13 -0
- package/lib/types/settings/update-source.d.ts.map +1 -0
- package/lib/types/settings/view.d.ts.map +1 -1
- package/lib/types/surface/view.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +2 -2
- package/src/labels.ts +20 -0
- package/src/settings/client.ts +17 -0
- package/src/settings/form.ts +45 -0
- package/src/settings/state.ts +26 -4
- package/src/settings/update-dialog.tsx +6 -2
- package/src/settings/update-source.tsx +57 -0
- package/src/settings/view.tsx +82 -3
- package/src/surface/view.tsx +3 -0
package/lib/types/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/** Panel chrome labels. Not the app's own strings. @module @mohou/panel */
|
|
2
2
|
export declare const packageId: "@mohou/panel";
|
|
3
3
|
export { isPanelLocale, panelLocales, panelText, type PanelLabelKey, type PanelLabelMode, type PanelLocale, } from './labels.ts';
|
|
4
|
-
export { admitPanelPort, panelLanguageFields, panelPortBound, type PanelPortResult } from './settings/form.ts';
|
|
4
|
+
export { admitPanelPort, admitUpdateRegistry, panelLanguageFields, panelPortBound, registryChoice, updateRegistryPresets, type PanelPortResult, type PanelRegistryChoice, type PanelRegistryResult } from './settings/form.ts';
|
|
5
5
|
export { filterGallery, galleryCardStyles, galleryKind, isGalleryCardStyle, type GalleryApp, type GalleryCardStyle, type GalleryKind, } from './gallery/list.ts';
|
|
6
6
|
export { closeTab, deletePrompt, initialTabs, openAppTab, switchTab, type AppTab, type DeletePrompt, type PanelTab, type PanelTabs, type TabChange, } from './gallery/tabs.ts';
|
|
7
7
|
export { PanelClientError, type PanelClient } from './gallery/client.ts';
|
|
8
8
|
export { loadGallery, loadTrash, galleryState, reduceGallery, viewKind, visibleApps, type GalleryAction, type PanelShell, type GalleryState, } from './gallery/state.ts';
|
|
9
9
|
export { PanelGallery } from './gallery/view.tsx';
|
|
10
|
-
export { panelUpdateFailureCodes, type McpCheckResult, type McpServerDraft, type PanelAbout, type PanelCredential, type PanelCredentials, type PanelMcpFailure, type PanelMcpList, type PanelAuthorMcpAgent, type PanelAuthorMcpStatus, type PanelPolicy, type PanelPolicyWrite, type PanelProbe, type PanelRuntime, type PanelSettingsClient, type PanelSkillAgent, type PanelSkillStatus, type PanelUpdateAttempt, type PanelUpdateCheck, type PanelUpdateFailureCode } from './settings/client.ts';
|
|
10
|
+
export { panelUpdateFailureCodes, type McpCheckResult, type McpServerDraft, type PanelAbout, type PanelCredential, type PanelCredentials, type PanelMcpFailure, type PanelMcpList, type PanelAuthorMcpAgent, type PanelAuthorMcpStatus, type PanelPolicy, type PanelPolicyWrite, type PanelProbe, type PanelRuntime, type PanelSettingsClient, type PanelSkillAgent, type PanelSkillStatus, type PanelUpdateAttempt, type PanelUpdateCheck, type PanelUpdateFailureCode, type PanelUpdateSource } from './settings/client.ts';
|
|
11
11
|
export { loadSettings, reduceSettings, settingsDraft, settingsState, type SettingsAction, type SettingsState } from './settings/state.ts';
|
|
12
12
|
export { PanelSettings } from './settings/view.tsx';
|
|
13
13
|
export type { HistoryClient, HistoryCommit, HistoryDetail, HistoryFile } from './history/client.ts';
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAE3E,eAAO,MAAM,SAAS,EAAG,cAAuB,CAAA;AAEhD,OAAO,EACL,aAAa,EACb,YAAY,EACZ,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,GACjB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAE3E,eAAO,MAAM,SAAS,EAAG,cAAuB,CAAA;AAEhD,OAAO,EACL,aAAa,EACb,YAAY,EACZ,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,GACjB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,cAAc,EAAE,cAAc,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,KAAK,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC9N,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,UAAU,EACV,SAAS,EACT,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,SAAS,GACf,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACxE,OAAO,EACL,WAAW,EACX,SAAS,EACT,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,EACX,KAAK,aAAa,EAClB,KA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YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3F,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACpH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACzI,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA"}
|
package/lib/types/labels.d.ts
CHANGED
|
@@ -28,6 +28,13 @@ declare const en: {
|
|
|
28
28
|
readonly 'delete-failed': "Delete failed";
|
|
29
29
|
readonly 'unsaved-confirm': "Discard unsaved changes?";
|
|
30
30
|
readonly 'port-invalid': "Port must be from 1024 to 65535";
|
|
31
|
+
readonly 'update-registry': "Update registry";
|
|
32
|
+
readonly 'update-registry-default': "Packaged default";
|
|
33
|
+
readonly 'update-registry-npmmirror': "Alibaba npmmirror";
|
|
34
|
+
readonly 'update-registry-tencent': "Tencent Cloud";
|
|
35
|
+
readonly 'update-registry-custom': "Custom…";
|
|
36
|
+
readonly 'update-registry-hint': "Only this product's own update check and install use it. Your npm config, and an app's own dependency installs, are untouched.";
|
|
37
|
+
readonly 'update-registry-invalid': "Use an https url without a username or password.";
|
|
31
38
|
readonly 'save-failed': "Save failed";
|
|
32
39
|
readonly 'update-failed': "Update check failed";
|
|
33
40
|
readonly 'storage-failed': "Storage failed to load";
|
|
@@ -218,6 +225,9 @@ declare const en: {
|
|
|
218
225
|
readonly update: "Check for updates";
|
|
219
226
|
readonly 'update-install': "Install update";
|
|
220
227
|
readonly 'update-install-failed': "The update could not be installed.";
|
|
228
|
+
readonly 'update-source': "Update source";
|
|
229
|
+
readonly 'update-source-tarball': "Local packages";
|
|
230
|
+
readonly 'update-source-none': "No install prefix (source tree)";
|
|
221
231
|
readonly 'update-card-title': "Update available";
|
|
222
232
|
readonly 'update-card-current': "Current";
|
|
223
233
|
readonly 'update-card-latest': "Latest";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/labels.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,eAAO,MAAM,YAAY,0BAA2B,CAAA;AAEpD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,YAAY,CAAA;AAEzD,QAAA,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../../src/labels.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,eAAO,MAAM,YAAY,0BAA2B,CAAA;AAEpD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,YAAY,CAAA;AAEzD,QAAA,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoQE,CAAA;AAwQV,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,EAAE,CAAA;AAO3C;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM,CAMnF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,WAAW,CAEjE"}
|
|
@@ -13,6 +13,8 @@ export interface PanelPolicy {
|
|
|
13
13
|
readonly id: string;
|
|
14
14
|
};
|
|
15
15
|
readonly defaultWorkbenchId?: string;
|
|
16
|
+
/** Registry for this product's own update check and install. Empty follows the packaged default. */
|
|
17
|
+
readonly updateRegistry?: string;
|
|
16
18
|
}
|
|
17
19
|
export interface PanelPolicyWrite {
|
|
18
20
|
readonly policy: PanelPolicy;
|
|
@@ -57,11 +59,26 @@ export interface PanelAuthorMcpAgent {
|
|
|
57
59
|
export interface PanelAuthorMcpStatus {
|
|
58
60
|
readonly agents: readonly PanelAuthorMcpAgent[];
|
|
59
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Where this install updates from. `none` is a source tree with no install prefix.
|
|
64
|
+
* A registry names its host; a tarball channel names its drop folder.
|
|
65
|
+
*/
|
|
66
|
+
export type PanelUpdateSource = {
|
|
67
|
+
readonly channel: 'registry';
|
|
68
|
+
readonly registry: string;
|
|
69
|
+
} | {
|
|
70
|
+
readonly channel: 'tarball';
|
|
71
|
+
readonly tarballDir: string;
|
|
72
|
+
} | {
|
|
73
|
+
readonly channel: 'none';
|
|
74
|
+
};
|
|
60
75
|
/** Owner about block, including the authoring MCP snippet. */
|
|
61
76
|
export interface PanelAbout {
|
|
62
77
|
readonly name: string;
|
|
63
78
|
readonly current: string;
|
|
64
79
|
readonly platform: string;
|
|
80
|
+
/** Where an update would come from. */
|
|
81
|
+
readonly source?: PanelUpdateSource;
|
|
65
82
|
readonly authoring: {
|
|
66
83
|
readonly url: string;
|
|
67
84
|
readonly token: string;
|
|
@@ -101,6 +118,10 @@ export interface PanelUpdateCheck {
|
|
|
101
118
|
readonly updateAvailable: boolean;
|
|
102
119
|
readonly channel?: 'registry' | 'tarball';
|
|
103
120
|
readonly installable?: boolean;
|
|
121
|
+
/** The host an update would install from, when the prefix names one. */
|
|
122
|
+
readonly registry?: string;
|
|
123
|
+
/** The folder a tarball update would install from. */
|
|
124
|
+
readonly tarballDir?: string;
|
|
104
125
|
readonly error?: string;
|
|
105
126
|
/** The last install this machine recorded, when one is on disk. The panel shows it once. */
|
|
106
127
|
readonly lastAttempt?: PanelUpdateAttempt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/settings/client.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;IAC3C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,GAAG,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;IAC1E,QAAQ,CAAC,eAAe,EAAE;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IACjD,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/settings/client.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;IAC3C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,QA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AE,KAAK,GAAG,iBAAiB,CAAA;IAC9C,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACpD;AAED,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAChD;AAED,kDAAkD;AAClD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAA;IACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B"}
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
import { type PanelLocale } from '../labels.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The mirrors the form offers. The packaged default is not one of them: an empty value means it,
|
|
4
|
+
* so a build with a different default needs no change here.
|
|
5
|
+
*/
|
|
6
|
+
export declare const updateRegistryPresets: {
|
|
7
|
+
readonly npmmirror: "https://registry.npmmirror.com";
|
|
8
|
+
readonly tencent: "https://mirrors.cloud.tencent.com/npm/";
|
|
9
|
+
};
|
|
10
|
+
export type PanelRegistryChoice = 'default' | keyof typeof updateRegistryPresets | 'custom';
|
|
11
|
+
export type PanelRegistryResult = {
|
|
12
|
+
readonly ok: true;
|
|
13
|
+
readonly registry: string;
|
|
14
|
+
} | {
|
|
15
|
+
readonly ok: false;
|
|
16
|
+
readonly key: 'registry-invalid';
|
|
17
|
+
};
|
|
18
|
+
/** Which preset a stored value is, or `custom` for anything else an owner typed. */
|
|
19
|
+
export declare function registryChoice(registry: string): PanelRegistryChoice;
|
|
20
|
+
/**
|
|
21
|
+
* Admit the update registry before any write. Empty means the packaged default.
|
|
22
|
+
* A mirror is installed from, so it must be https with no credentials in the url.
|
|
23
|
+
* @param value - the form value
|
|
24
|
+
*/
|
|
25
|
+
export declare function admitUpdateRegistry(value: string): PanelRegistryResult;
|
|
2
26
|
/** Settings port range. Locked in the product decisions, not a host tunable. */
|
|
3
27
|
export declare const panelPortBound: {
|
|
4
28
|
readonly min: 1024;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/settings/form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAE9D,gFAAgF;AAChF,eAAO,MAAM,cAAc;;;CAAqC,CAAA;AAEhE,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAA;CAAE,CAAA;AAExD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAI9D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,YAAY,EAAE,WAAW,CAAA;CAAE,CAGtG"}
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../src/settings/form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAE9D;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;CAGxB,CAAA;AAEV,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,MAAM,OAAO,qBAAqB,GAAG,QAAQ,CAAA;AAE3F,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAE5D,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,CAOpE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,CAatE;AAED,gFAAgF;AAChF,eAAO,MAAM,cAAc;;;CAAqC,CAAA;AAEhE,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAA;CAAE,CAAA;AAExD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAI9D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,YAAY,EAAE,WAAW,CAAA;CAAE,CAGtG"}
|
|
@@ -5,12 +5,14 @@ export interface SettingsState {
|
|
|
5
5
|
readonly palette: string;
|
|
6
6
|
readonly locale: string;
|
|
7
7
|
readonly port: string;
|
|
8
|
+
readonly registry: string;
|
|
8
9
|
readonly providerId: string;
|
|
9
10
|
readonly modelProvider: string;
|
|
10
11
|
readonly model: string;
|
|
11
12
|
readonly workbenchId: string;
|
|
12
13
|
readonly dirty: boolean;
|
|
13
14
|
readonly portError: boolean;
|
|
15
|
+
readonly registryError: boolean;
|
|
14
16
|
readonly saveError: boolean;
|
|
15
17
|
readonly saveMessage?: string;
|
|
16
18
|
readonly pending?: 'close' | 'restore';
|
|
@@ -37,6 +39,9 @@ export type SettingsAction = {
|
|
|
37
39
|
} | {
|
|
38
40
|
readonly type: 'edit-port';
|
|
39
41
|
readonly port: string;
|
|
42
|
+
} | {
|
|
43
|
+
readonly type: 'edit-registry';
|
|
44
|
+
readonly registry: string;
|
|
40
45
|
} | {
|
|
41
46
|
readonly type: 'edit-provider';
|
|
42
47
|
readonly providerId: string;
|
|
@@ -57,6 +62,12 @@ export type SettingsAction = {
|
|
|
57
62
|
readonly policy: PanelPolicy;
|
|
58
63
|
} | {
|
|
59
64
|
readonly type: 'port-invalid';
|
|
65
|
+
} | {
|
|
66
|
+
readonly type: 'registry-invalid';
|
|
67
|
+
}
|
|
68
|
+
/** The form could not be built at all (an unsupported locale). */
|
|
69
|
+
| {
|
|
70
|
+
readonly type: 'save-blocked';
|
|
60
71
|
} | {
|
|
61
72
|
readonly type: 'save-failed';
|
|
62
73
|
readonly message?: string;
|
|
@@ -88,6 +99,7 @@ export declare function settingsDraft(state: SettingsState): {
|
|
|
88
99
|
policy: PanelPolicy;
|
|
89
100
|
} | {
|
|
90
101
|
ok: false;
|
|
102
|
+
key: 'port-invalid' | 'registry-invalid' | 'save-blocked';
|
|
91
103
|
};
|
|
92
104
|
/** Load policy into the form. */
|
|
93
105
|
export declare function loadSettings(client: PanelSettingsClient, dispatch: (action: SettingsAction) => void): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/settings/state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAErF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,KAAK,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
|
|
3
|
-
import type { PanelUpdateAttempt } from './client.ts';
|
|
3
|
+
import type { PanelUpdateAttempt, PanelUpdateSource } from './client.ts';
|
|
4
4
|
/** The one update card. The on-open check and the settings check open this card. */
|
|
5
5
|
export type UpdateCard = {
|
|
6
6
|
readonly kind: 'offer';
|
|
7
7
|
readonly current: string;
|
|
8
8
|
readonly latest: string;
|
|
9
9
|
readonly channel?: 'registry' | 'tarball';
|
|
10
|
+
readonly source?: PanelUpdateSource;
|
|
10
11
|
} | {
|
|
11
12
|
readonly kind: 'installing';
|
|
12
13
|
readonly version: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-dialog.d.ts","sourceRoot":"","sources":["../../../src/settings/update-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAG3D,OAAO,EAAa,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAG/E,OAAO,KAAK,EAAE,kBAAkB,EAA0B,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"update-dialog.d.ts","sourceRoot":"","sources":["../../../src/settings/update-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAG3D,OAAO,EAAa,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAG/E,OAAO,KAAK,EAAE,kBAAkB,EAA0B,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAGhG,oFAAoF;AACpF,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,iBAA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AAC,MAAM,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;IAC5B,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9C,GAAG,SAAS,CAYZ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { PanelUpdateCheck, PanelUpdateSource } from './client.ts';
|
|
3
|
+
/** The source a check named, when it named a complete one. */
|
|
4
|
+
export declare function checkSource(check: PanelUpdateCheck): PanelUpdateSource | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* One chip naming where the next update would install from.
|
|
7
|
+
* @param props - the source, and the label lookup
|
|
8
|
+
*/
|
|
9
|
+
export declare function UpdateSourceChip(props: {
|
|
10
|
+
readonly source: PanelUpdateSource;
|
|
11
|
+
readonly label: (key: string) => string;
|
|
12
|
+
}): ReactNode;
|
|
13
|
+
//# sourceMappingURL=update-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-source.d.ts","sourceRoot":"","sources":["../../../src/settings/update-source.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEtE,8DAA8D;AAC9D,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,SAAS,CAMlF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IAClC,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;CACxC,GAAG,SAAS,CAaZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/settings/view.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/settings/view.tsx"],"names":[],"mappings":"AACA,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE/E,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC7E,OAAO,EAA4B,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAE9F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGrD,OAAO,KAAK,EAAoC,WAAW,EAAgB,mBAAmB,EAAoB,gBAAgB,EAAqB,MAAM,aAAa,CAAA;AAiB1K;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAA;IACrC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,WAAW,EAAE,CAAA;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAA;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACxD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAA;IACjD,+DAA+D;IAC/D,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,CAAA;IACjC,wFAAwF;IACxF,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAA;IACxD,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAA;CAC5D,GAAG,SAAS,CAwTZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/surface/view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAA4B,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAC9F,OAAO,KAAK,EAAe,mBAAmB,EAAoB,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../../src/surface/view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAGvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAA4B,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAC9F,OAAO,KAAK,EAAe,mBAAmB,EAAoB,MAAM,uBAAuB,CAAA;AAK/F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEzD,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAIlE,2FAA2F;AAC3F,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5C,UAAU,CAAC,KAAK,EAAE,MA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31
31
|
"react-dom": "^19.3.0",
|
|
32
|
-
"@mohou/app-view": "^1.0.
|
|
32
|
+
"@mohou/app-view": "^1.0.22"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/react": "^19.3.0",
|
package/src/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ export {
|
|
|
10
10
|
type PanelLabelMode,
|
|
11
11
|
type PanelLocale,
|
|
12
12
|
} from './labels.ts'
|
|
13
|
-
export { admitPanelPort, panelLanguageFields, panelPortBound, type PanelPortResult } from './settings/form.ts'
|
|
13
|
+
export { admitPanelPort, admitUpdateRegistry, panelLanguageFields, panelPortBound, registryChoice, updateRegistryPresets, type PanelPortResult, type PanelRegistryChoice, type PanelRegistryResult } from './settings/form.ts'
|
|
14
14
|
export {
|
|
15
15
|
filterGallery,
|
|
16
16
|
galleryCardStyles,
|
|
@@ -45,7 +45,7 @@ export {
|
|
|
45
45
|
type GalleryState,
|
|
46
46
|
} from './gallery/state.ts'
|
|
47
47
|
export { PanelGallery } from './gallery/view.tsx'
|
|
48
|
-
export { panelUpdateFailureCodes, type McpCheckResult, type McpServerDraft, type PanelAbout, type PanelCredential, type PanelCredentials, type PanelMcpFailure, type PanelMcpList, type PanelAuthorMcpAgent, type PanelAuthorMcpStatus, type PanelPolicy, type PanelPolicyWrite, type PanelProbe, type PanelRuntime, type PanelSettingsClient, type PanelSkillAgent, type PanelSkillStatus, type PanelUpdateAttempt, type PanelUpdateCheck, type PanelUpdateFailureCode } from './settings/client.ts'
|
|
48
|
+
export { panelUpdateFailureCodes, type McpCheckResult, type McpServerDraft, type PanelAbout, type PanelCredential, type PanelCredentials, type PanelMcpFailure, type PanelMcpList, type PanelAuthorMcpAgent, type PanelAuthorMcpStatus, type PanelPolicy, type PanelPolicyWrite, type PanelProbe, type PanelRuntime, type PanelSettingsClient, type PanelSkillAgent, type PanelSkillStatus, type PanelUpdateAttempt, type PanelUpdateCheck, type PanelUpdateFailureCode, type PanelUpdateSource } from './settings/client.ts'
|
|
49
49
|
export { loadSettings, reduceSettings, settingsDraft, settingsState, type SettingsAction, type SettingsState } from './settings/state.ts'
|
|
50
50
|
export { PanelSettings } from './settings/view.tsx'
|
|
51
51
|
export type { HistoryClient, HistoryCommit, HistoryDetail, HistoryFile } from './history/client.ts'
|
package/src/labels.ts
CHANGED
|
@@ -31,6 +31,13 @@ const en = {
|
|
|
31
31
|
'delete-failed': 'Delete failed',
|
|
32
32
|
'unsaved-confirm': 'Discard unsaved changes?',
|
|
33
33
|
'port-invalid': 'Port must be from 1024 to 65535',
|
|
34
|
+
'update-registry': 'Update registry',
|
|
35
|
+
'update-registry-default': 'Packaged default',
|
|
36
|
+
'update-registry-npmmirror': 'Alibaba npmmirror',
|
|
37
|
+
'update-registry-tencent': 'Tencent Cloud',
|
|
38
|
+
'update-registry-custom': 'Custom…',
|
|
39
|
+
'update-registry-hint': 'Only this product\'s own update check and install use it. Your npm config, and an app\'s own dependency installs, are untouched.',
|
|
40
|
+
'update-registry-invalid': 'Use an https url without a username or password.',
|
|
34
41
|
'save-failed': 'Save failed',
|
|
35
42
|
'update-failed': 'Update check failed',
|
|
36
43
|
'storage-failed': 'Storage failed to load',
|
|
@@ -221,6 +228,9 @@ const en = {
|
|
|
221
228
|
update: 'Check for updates',
|
|
222
229
|
'update-install': 'Install update',
|
|
223
230
|
'update-install-failed': 'The update could not be installed.',
|
|
231
|
+
'update-source': 'Update source',
|
|
232
|
+
'update-source-tarball': 'Local packages',
|
|
233
|
+
'update-source-none': 'No install prefix (source tree)',
|
|
224
234
|
'update-card-title': 'Update available',
|
|
225
235
|
'update-card-current': 'Current',
|
|
226
236
|
'update-card-latest': 'Latest',
|
|
@@ -283,6 +293,13 @@ const zhCN = {
|
|
|
283
293
|
'delete-failed': '删除失败',
|
|
284
294
|
'unsaved-confirm': '放弃未保存的修改?',
|
|
285
295
|
'port-invalid': '端口必须在 1024 到 65535 之间',
|
|
296
|
+
'update-registry': '更新源 registry',
|
|
297
|
+
'update-registry-default': '安装包默认',
|
|
298
|
+
'update-registry-npmmirror': '阿里 npmmirror',
|
|
299
|
+
'update-registry-tencent': '腾讯云',
|
|
300
|
+
'update-registry-custom': '自定义…',
|
|
301
|
+
'update-registry-hint': '只有 Mohou 自己的“检查更新/安装更新”用它;不动你的 npm 配置,也不影响小程序自身的依赖安装。',
|
|
302
|
+
'update-registry-invalid': '请填 https 地址,且不要带用户名密码。',
|
|
286
303
|
'save-failed': '保存失败',
|
|
287
304
|
'update-failed': '更新检查失败',
|
|
288
305
|
'storage-failed': '存储加载失败',
|
|
@@ -473,6 +490,9 @@ const zhCN = {
|
|
|
473
490
|
update: '检查更新',
|
|
474
491
|
'update-install': '安装更新',
|
|
475
492
|
'update-install-failed': '更新没能装上。',
|
|
493
|
+
'update-source': '更新源',
|
|
494
|
+
'update-source-tarball': '本地包',
|
|
495
|
+
'update-source-none': '无安装前缀(源码树)',
|
|
476
496
|
'update-card-title': '有新版本',
|
|
477
497
|
'update-card-current': '当前',
|
|
478
498
|
'update-card-latest': '最新',
|
package/src/settings/client.ts
CHANGED
|
@@ -8,6 +8,8 @@ export interface PanelPolicy {
|
|
|
8
8
|
readonly llm: { readonly provider: string; readonly model: string } | null
|
|
9
9
|
readonly runtimeProvider: { readonly id: string }
|
|
10
10
|
readonly defaultWorkbenchId?: string
|
|
11
|
+
/** Registry for this product's own update check and install. Empty follows the packaged default. */
|
|
12
|
+
readonly updateRegistry?: string
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export interface PanelPolicyWrite {
|
|
@@ -58,11 +60,22 @@ export interface PanelAuthorMcpStatus {
|
|
|
58
60
|
readonly agents: readonly PanelAuthorMcpAgent[]
|
|
59
61
|
}
|
|
60
62
|
|
|
63
|
+
/**
|
|
64
|
+
* Where this install updates from. `none` is a source tree with no install prefix.
|
|
65
|
+
* A registry names its host; a tarball channel names its drop folder.
|
|
66
|
+
*/
|
|
67
|
+
export type PanelUpdateSource =
|
|
68
|
+
| { readonly channel: 'registry'; readonly registry: string }
|
|
69
|
+
| { readonly channel: 'tarball'; readonly tarballDir: string }
|
|
70
|
+
| { readonly channel: 'none' }
|
|
71
|
+
|
|
61
72
|
/** Owner about block, including the authoring MCP snippet. */
|
|
62
73
|
export interface PanelAbout {
|
|
63
74
|
readonly name: string
|
|
64
75
|
readonly current: string
|
|
65
76
|
readonly platform: string
|
|
77
|
+
/** Where an update would come from. */
|
|
78
|
+
readonly source?: PanelUpdateSource
|
|
66
79
|
readonly authoring: {
|
|
67
80
|
readonly url: string
|
|
68
81
|
readonly token: string
|
|
@@ -105,6 +118,10 @@ export interface PanelUpdateCheck {
|
|
|
105
118
|
readonly updateAvailable: boolean
|
|
106
119
|
readonly channel?: 'registry' | 'tarball'
|
|
107
120
|
readonly installable?: boolean
|
|
121
|
+
/** The host an update would install from, when the prefix names one. */
|
|
122
|
+
readonly registry?: string
|
|
123
|
+
/** The folder a tarball update would install from. */
|
|
124
|
+
readonly tarballDir?: string
|
|
108
125
|
readonly error?: string
|
|
109
126
|
/** The last install this machine recorded, when one is on disk. The panel shows it once. */
|
|
110
127
|
readonly lastAttempt?: PanelUpdateAttempt
|
package/src/settings/form.ts
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
import { isPanelLocale, type PanelLocale } from '../labels.ts'
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* The mirrors the form offers. The packaged default is not one of them: an empty value means it,
|
|
5
|
+
* so a build with a different default needs no change here.
|
|
6
|
+
*/
|
|
7
|
+
export const updateRegistryPresets = {
|
|
8
|
+
npmmirror: 'https://registry.npmmirror.com',
|
|
9
|
+
tencent: 'https://mirrors.cloud.tencent.com/npm/',
|
|
10
|
+
} as const
|
|
11
|
+
|
|
12
|
+
export type PanelRegistryChoice = 'default' | keyof typeof updateRegistryPresets | 'custom'
|
|
13
|
+
|
|
14
|
+
export type PanelRegistryResult =
|
|
15
|
+
| { readonly ok: true; readonly registry: string }
|
|
16
|
+
| { readonly ok: false; readonly key: 'registry-invalid' }
|
|
17
|
+
|
|
18
|
+
/** Which preset a stored value is, or `custom` for anything else an owner typed. */
|
|
19
|
+
export function registryChoice(registry: string): PanelRegistryChoice {
|
|
20
|
+
const value = registry.trim()
|
|
21
|
+
if (value.length === 0) return 'default'
|
|
22
|
+
for (const [name, url] of Object.entries(updateRegistryPresets)) {
|
|
23
|
+
if (value === url) return name as PanelRegistryChoice
|
|
24
|
+
}
|
|
25
|
+
return 'custom'
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Admit the update registry before any write. Empty means the packaged default.
|
|
30
|
+
* A mirror is installed from, so it must be https with no credentials in the url.
|
|
31
|
+
* @param value - the form value
|
|
32
|
+
*/
|
|
33
|
+
export function admitUpdateRegistry(value: string): PanelRegistryResult {
|
|
34
|
+
const registry = value.trim()
|
|
35
|
+
if (registry.length === 0) return { ok: true, registry: '' }
|
|
36
|
+
let url: URL
|
|
37
|
+
try {
|
|
38
|
+
url = new URL(registry)
|
|
39
|
+
} catch {
|
|
40
|
+
return { ok: false, key: 'registry-invalid' }
|
|
41
|
+
}
|
|
42
|
+
if (url.protocol !== 'https:' || url.hostname.length === 0 || url.username.length > 0 || url.password.length > 0) {
|
|
43
|
+
return { ok: false, key: 'registry-invalid' }
|
|
44
|
+
}
|
|
45
|
+
return { ok: true, registry }
|
|
46
|
+
}
|
|
47
|
+
|
|
3
48
|
/** Settings port range. Locked in the product decisions, not a host tunable. */
|
|
4
49
|
export const panelPortBound = { min: 1024, max: 65535 } as const
|
|
5
50
|
|
package/src/settings/state.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { admitPanelPort, panelLanguageFields } from './form.ts'
|
|
1
|
+
import { admitPanelPort, admitUpdateRegistry, panelLanguageFields } from './form.ts'
|
|
2
2
|
import type { PanelPolicy, PanelPolicyWrite, PanelSettingsClient } from './client.ts'
|
|
3
3
|
|
|
4
4
|
export interface SettingsState {
|
|
@@ -7,12 +7,14 @@ export interface SettingsState {
|
|
|
7
7
|
readonly palette: string
|
|
8
8
|
readonly locale: string
|
|
9
9
|
readonly port: string
|
|
10
|
+
readonly registry: string
|
|
10
11
|
readonly providerId: string
|
|
11
12
|
readonly modelProvider: string
|
|
12
13
|
readonly model: string
|
|
13
14
|
readonly workbenchId: string
|
|
14
15
|
readonly dirty: boolean
|
|
15
16
|
readonly portError: boolean
|
|
17
|
+
readonly registryError: boolean
|
|
16
18
|
readonly saveError: boolean
|
|
17
19
|
readonly saveMessage?: string
|
|
18
20
|
readonly pending?: 'close' | 'restore'
|
|
@@ -31,6 +33,7 @@ export type SettingsAction =
|
|
|
31
33
|
| { readonly type: 'edit-palette'; readonly palette: string }
|
|
32
34
|
| { readonly type: 'edit-locale'; readonly locale: string }
|
|
33
35
|
| { readonly type: 'edit-port'; readonly port: string }
|
|
36
|
+
| { readonly type: 'edit-registry'; readonly registry: string }
|
|
34
37
|
| { readonly type: 'edit-provider'; readonly providerId: string }
|
|
35
38
|
| { readonly type: 'edit-model'; readonly provider: string; readonly model: string }
|
|
36
39
|
| { readonly type: 'edit-workbench'; readonly workbenchId: string }
|
|
@@ -38,6 +41,9 @@ export type SettingsAction =
|
|
|
38
41
|
/** Host policy written elsewhere (theme menu). Keeps appearance fields in sync. */
|
|
39
42
|
| { readonly type: 'host-policy'; readonly policy: PanelPolicy }
|
|
40
43
|
| { readonly type: 'port-invalid' }
|
|
44
|
+
| { readonly type: 'registry-invalid' }
|
|
45
|
+
/** The form could not be built at all (an unsupported locale). */
|
|
46
|
+
| { readonly type: 'save-blocked' }
|
|
41
47
|
| { readonly type: 'save-failed'; readonly message?: string }
|
|
42
48
|
| { readonly type: 'escape' }
|
|
43
49
|
| { readonly type: 'restore' }
|
|
@@ -52,12 +58,14 @@ export function settingsState(): SettingsState {
|
|
|
52
58
|
palette: '',
|
|
53
59
|
locale: 'en',
|
|
54
60
|
port: '',
|
|
61
|
+
registry: '',
|
|
55
62
|
providerId: '',
|
|
56
63
|
modelProvider: '',
|
|
57
64
|
model: '',
|
|
58
65
|
workbenchId: 'default',
|
|
59
66
|
dirty: false,
|
|
60
67
|
portError: false,
|
|
68
|
+
registryError: false,
|
|
61
69
|
saveError: false,
|
|
62
70
|
closed: false,
|
|
63
71
|
restartRequired: false,
|
|
@@ -85,6 +93,8 @@ export function reduceSettings(state: SettingsState, action: SettingsAction): Se
|
|
|
85
93
|
return { ...state, locale: action.locale, dirty: true, saveError: false }
|
|
86
94
|
case 'edit-port':
|
|
87
95
|
return { ...state, port: action.port, dirty: true, portError: false, saveError: false }
|
|
96
|
+
case 'edit-registry':
|
|
97
|
+
return { ...state, registry: action.registry, dirty: true, registryError: false, saveError: false }
|
|
88
98
|
case 'edit-provider':
|
|
89
99
|
return { ...state, providerId: action.providerId, dirty: true, saveError: false }
|
|
90
100
|
case 'edit-model':
|
|
@@ -126,6 +136,10 @@ export function reduceSettings(state: SettingsState, action: SettingsAction): Se
|
|
|
126
136
|
}
|
|
127
137
|
case 'port-invalid':
|
|
128
138
|
return { ...state, portError: true, dirty: true }
|
|
139
|
+
case 'registry-invalid':
|
|
140
|
+
return { ...state, registryError: true, dirty: true }
|
|
141
|
+
case 'save-blocked':
|
|
142
|
+
return { ...omitSaveMessage(state), saveError: true, dirty: true }
|
|
129
143
|
case 'save-failed':
|
|
130
144
|
return {
|
|
131
145
|
...omitSaveMessage(state),
|
|
@@ -159,14 +173,19 @@ export function reduceSettings(state: SettingsState, action: SettingsAction): Se
|
|
|
159
173
|
}
|
|
160
174
|
|
|
161
175
|
/** Policy to write, or a port error that must not be sent. */
|
|
162
|
-
export function settingsDraft(state: SettingsState): {
|
|
176
|
+
export function settingsDraft(state: SettingsState): {
|
|
177
|
+
ok: true
|
|
178
|
+
policy: PanelPolicy
|
|
179
|
+
} | { ok: false; key: 'port-invalid' | 'registry-invalid' | 'save-blocked' } {
|
|
163
180
|
const port = admitPanelPort(Number(state.port))
|
|
164
|
-
if (!port.ok) return { ok: false }
|
|
181
|
+
if (!port.ok) return { ok: false, key: 'port-invalid' }
|
|
182
|
+
const registry = admitUpdateRegistry(state.registry)
|
|
183
|
+
if (!registry.ok) return { ok: false, key: 'registry-invalid' }
|
|
165
184
|
let language: ReturnType<typeof panelLanguageFields>
|
|
166
185
|
try {
|
|
167
186
|
language = panelLanguageFields(state.locale)
|
|
168
187
|
} catch {
|
|
169
|
-
return { ok: false }
|
|
188
|
+
return { ok: false, key: 'save-blocked' }
|
|
170
189
|
}
|
|
171
190
|
return {
|
|
172
191
|
ok: true,
|
|
@@ -178,6 +197,7 @@ export function settingsDraft(state: SettingsState): { ok: true; policy: PanelPo
|
|
|
178
197
|
hostPort: port.port,
|
|
179
198
|
llm: state.modelProvider === '' && state.model === '' ? null : { provider: state.modelProvider, model: state.model },
|
|
180
199
|
runtimeProvider: { id: state.providerId },
|
|
200
|
+
updateRegistry: registry.registry,
|
|
181
201
|
...state.workbenchId === 'default' ? {} : { defaultWorkbenchId: state.workbenchId },
|
|
182
202
|
},
|
|
183
203
|
}
|
|
@@ -198,12 +218,14 @@ function fromPolicy(policy: PanelPolicy): SettingsState {
|
|
|
198
218
|
palette: policy.palette,
|
|
199
219
|
locale: policy.locale,
|
|
200
220
|
port: String(policy.hostPort),
|
|
221
|
+
registry: policy.updateRegistry ?? '',
|
|
201
222
|
providerId: policy.runtimeProvider.id,
|
|
202
223
|
modelProvider: policy.llm?.provider ?? '',
|
|
203
224
|
model: policy.llm?.model ?? '',
|
|
204
225
|
workbenchId: policy.defaultWorkbenchId ?? 'default',
|
|
205
226
|
dirty: false,
|
|
206
227
|
portError: false,
|
|
228
|
+
registryError: false,
|
|
207
229
|
saveError: false,
|
|
208
230
|
closed: false,
|
|
209
231
|
restartRequired: false,
|
|
@@ -4,11 +4,12 @@ import { Loader2 } from 'lucide-react'
|
|
|
4
4
|
import { panelText, type PanelLabelMode, type PanelLocale } from '../labels.ts'
|
|
5
5
|
import { Dialog } from '../ui/dialog.tsx'
|
|
6
6
|
|
|
7
|
-
import type { PanelUpdateAttempt, PanelUpdateFailureCode } from './client.ts'
|
|
7
|
+
import type { PanelUpdateAttempt, PanelUpdateFailureCode, PanelUpdateSource } from './client.ts'
|
|
8
|
+
import { UpdateSourceChip } from './update-source.tsx'
|
|
8
9
|
|
|
9
10
|
/** The one update card. The on-open check and the settings check open this card. */
|
|
10
11
|
export type UpdateCard =
|
|
11
|
-
| { readonly kind: 'offer'; readonly current: string; readonly latest: string; readonly channel?: 'registry' | 'tarball' }
|
|
12
|
+
| { readonly kind: 'offer'; readonly current: string; readonly latest: string; readonly channel?: 'registry' | 'tarball'; readonly source?: PanelUpdateSource }
|
|
12
13
|
| { readonly kind: 'installing'; readonly version: string; readonly startedAt: number }
|
|
13
14
|
| { readonly kind: 'failed'; readonly reason: UpdateReason; readonly target?: string; readonly back?: string; readonly log?: string }
|
|
14
15
|
| { readonly kind: 'done'; readonly version: string }
|
|
@@ -96,6 +97,9 @@ function Offer(props: {
|
|
|
96
97
|
</span>
|
|
97
98
|
)}
|
|
98
99
|
</div>
|
|
100
|
+
{props.card.source === undefined ? null : (
|
|
101
|
+
<div className="mt-3"><UpdateSourceChip source={props.card.source} label={props.label} /></div>
|
|
102
|
+
)}
|
|
99
103
|
<p className="mt-4 text-sm text-muted-foreground">{props.label('update-card-note')}</p>
|
|
100
104
|
<div className="mt-5 flex justify-end gap-2">
|
|
101
105
|
<button type="button" className="h-8 rounded-lg border px-3 text-sm" onClick={props.onClose}>{props.label('cancel')}</button>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
|
+
import { Globe, HardDrive, Terminal } from 'lucide-react'
|
|
3
|
+
|
|
4
|
+
import type { PanelUpdateCheck, PanelUpdateSource } from './client.ts'
|
|
5
|
+
|
|
6
|
+
/** The source a check named, when it named a complete one. */
|
|
7
|
+
export function checkSource(check: PanelUpdateCheck): PanelUpdateSource | undefined {
|
|
8
|
+
if (check.channel === 'registry') return { channel: 'registry', registry: check.registry ?? 'https://registry.npmjs.org' }
|
|
9
|
+
if (check.channel === 'tarball' && check.tarballDir !== undefined) {
|
|
10
|
+
return { channel: 'tarball', tarballDir: check.tarballDir }
|
|
11
|
+
}
|
|
12
|
+
return undefined
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* One chip naming where the next update would install from.
|
|
17
|
+
* @param props - the source, and the label lookup
|
|
18
|
+
*/
|
|
19
|
+
export function UpdateSourceChip(props: {
|
|
20
|
+
readonly source: PanelUpdateSource
|
|
21
|
+
readonly label: (key: string) => string
|
|
22
|
+
}): ReactNode {
|
|
23
|
+
const Icon = props.source.channel === 'registry' ? Globe : props.source.channel === 'tarball' ? HardDrive : Terminal
|
|
24
|
+
const title = sourceTitle(props.source)
|
|
25
|
+
return (
|
|
26
|
+
<span
|
|
27
|
+
className="inline-flex max-w-full items-center gap-1.5 rounded-full border px-2.5 py-1 text-[11px] leading-none text-muted-foreground"
|
|
28
|
+
{...title.length === 0 ? {} : { title }}
|
|
29
|
+
>
|
|
30
|
+
<Icon size={12} className="shrink-0" aria-hidden />
|
|
31
|
+
<span className="shrink-0">{props.label('update-source')}</span>
|
|
32
|
+
<span className="truncate font-mono">{sourceText(props.source, props.label)}</span>
|
|
33
|
+
</span>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function sourceText(source: PanelUpdateSource, label: (key: string) => string): string {
|
|
38
|
+
if (source.channel === 'registry') return hostOf(source.registry)
|
|
39
|
+
if (source.channel === 'tarball') return `${label('update-source-tarball')} · ${collapseHome(source.tarballDir)}`
|
|
40
|
+
return label('update-source-none')
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The full value, for the hover title. Empty when the source is a sentence already. */
|
|
44
|
+
function sourceTitle(source: PanelUpdateSource): string {
|
|
45
|
+
if (source.channel === 'registry') return source.registry
|
|
46
|
+
return source.channel === 'tarball' ? source.tarballDir : ''
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** `https://registry.npmjs.org/` reads as `registry.npmjs.org`. */
|
|
50
|
+
function hostOf(registry: string): string {
|
|
51
|
+
return registry.replace(/^https?:\/\//, '').replace(/\/$/, '')
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** `/Users/name/.mini-app/packages` reads as `~/.mini-app/packages`. */
|
|
55
|
+
function collapseHome(path: string): string {
|
|
56
|
+
return path.replace(/^\/(?:Users|home)\/[^/]+\//, '~/')
|
|
57
|
+
}
|
package/src/settings/view.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Check, ExternalLink, Loader2, Pencil, RefreshCw } from 'lucide-react'
|
|
2
|
-
import { useEffect, useReducer, useState, type ReactNode } from 'react'
|
|
2
|
+
import { useEffect, useReducer, useRef, useState, type ReactNode } from 'react'
|
|
3
3
|
|
|
4
4
|
import { galleryCardStyles, type GalleryCardStyle } from '../gallery/list.ts'
|
|
5
5
|
import { isPanelLocale, panelText, type PanelLabelMode, type PanelLocale } from '../labels.ts'
|
|
@@ -7,10 +7,12 @@ import { Dialog } from '../ui/dialog.tsx'
|
|
|
7
7
|
import type { PaletteChip } from '../theme/client.ts'
|
|
8
8
|
import { applyDocumentMode, paintHostStyle } from '../theme/menu.tsx'
|
|
9
9
|
import { AuthorMcpInstall } from './author-mcp-view.tsx'
|
|
10
|
-
import type { PanelAbout, PanelAuthorMcpStatus, PanelPolicy, PanelRuntime, PanelSettingsClient, PanelSkillStatus, PanelUpdateCheck } from './client.ts'
|
|
10
|
+
import type { PanelAbout, PanelAuthorMcpStatus, PanelPolicy, PanelRuntime, PanelSettingsClient, PanelSkillStatus, PanelUpdateCheck, PanelUpdateSource } from './client.ts'
|
|
11
|
+
import { UpdateSourceChip } from './update-source.tsx'
|
|
11
12
|
import { CredentialSettings } from './credentials-view.tsx'
|
|
12
13
|
import { McpSettings } from './mcp-view.tsx'
|
|
13
14
|
import { SkillInstall } from './skill-install.tsx'
|
|
15
|
+
import { registryChoice, updateRegistryPresets } from './form.ts'
|
|
14
16
|
import { loadSettings, reduceSettings, settingsDraft, settingsState } from './state.ts'
|
|
15
17
|
|
|
16
18
|
/** The rail. Credentials appear only when Host exposes the read call, so a store-less host shows no entry. */
|
|
@@ -48,6 +50,7 @@ export function PanelSettings(props: {
|
|
|
48
50
|
const [runtimes, setRuntimes] = useState<readonly PanelRuntime[]>([])
|
|
49
51
|
const [runtimeBusy, setRuntimeBusy] = useState(false)
|
|
50
52
|
const [update, setUpdate] = useState<PanelUpdateCheck | 'checking' | 'failed' | undefined>(undefined)
|
|
53
|
+
const [about, setAbout] = useState<PanelAbout | undefined>(undefined)
|
|
51
54
|
const [restarting, setRestarting] = useState(false)
|
|
52
55
|
const [portUnlocked, setPortUnlocked] = useState(false)
|
|
53
56
|
useEffect(() => {
|
|
@@ -61,6 +64,13 @@ export function PanelSettings(props: {
|
|
|
61
64
|
if (props.hostPolicy === undefined) return
|
|
62
65
|
dispatch({ type: 'host-policy', policy: props.hostPolicy })
|
|
63
66
|
}, [props.hostPolicy])
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
// The source is a fact about this install, not a network answer, so it loads with the block.
|
|
69
|
+
if (section !== 'about' || about !== undefined) return
|
|
70
|
+
const read = props.client?.readAbout
|
|
71
|
+
if (read === undefined) return
|
|
72
|
+
void read().then(setAbout, () => undefined)
|
|
73
|
+
}, [section, about, props.client])
|
|
64
74
|
useEffect(() => {
|
|
65
75
|
if (state.closed) props.onClose?.()
|
|
66
76
|
}, [state.closed])
|
|
@@ -96,6 +106,8 @@ export function PanelSettings(props: {
|
|
|
96
106
|
return
|
|
97
107
|
}
|
|
98
108
|
props.onPolicy?.(written)
|
|
109
|
+
// The about chip reads the source once; a saved registry changes it.
|
|
110
|
+
setAbout(undefined)
|
|
99
111
|
setSaveFeedback('saved')
|
|
100
112
|
window.setTimeout(() => setSaveFeedback('idle'), 2000)
|
|
101
113
|
}
|
|
@@ -240,6 +252,7 @@ export function PanelSettings(props: {
|
|
|
240
252
|
</div>
|
|
241
253
|
)}
|
|
242
254
|
{state.portError ? <p className="text-xs text-muted-foreground">{label('port-invalid')}</p> : null}
|
|
255
|
+
<RegistryField state={state} dispatch={dispatch} label={label} />
|
|
243
256
|
</div>
|
|
244
257
|
</section>
|
|
245
258
|
) : null}
|
|
@@ -281,6 +294,7 @@ export function PanelSettings(props: {
|
|
|
281
294
|
<AboutSection
|
|
282
295
|
update={update}
|
|
283
296
|
label={label}
|
|
297
|
+
{...about?.source === undefined ? {} : { source: about.source }}
|
|
284
298
|
{...props.versions === undefined ? {} : { versions: props.versions }}
|
|
285
299
|
{...client.checkUpdate === undefined ? {} : { onCheck: () => { void readUpdate(client, setUpdate, props.onUpdateOffer) } }}
|
|
286
300
|
/>
|
|
@@ -445,6 +459,7 @@ function AgentSection(props: {
|
|
|
445
459
|
function AboutSection(props: {
|
|
446
460
|
readonly versions?: string
|
|
447
461
|
readonly update: PanelUpdateCheck | 'checking' | 'failed' | undefined
|
|
462
|
+
readonly source?: PanelUpdateSource
|
|
448
463
|
readonly label: (key: string) => string
|
|
449
464
|
readonly onCheck?: () => void
|
|
450
465
|
}): ReactNode {
|
|
@@ -463,6 +478,9 @@ function AboutSection(props: {
|
|
|
463
478
|
{lines.map(line => <li key={line}>{line}</li>)}
|
|
464
479
|
</ul>
|
|
465
480
|
)}
|
|
481
|
+
{props.source === undefined ? null : (
|
|
482
|
+
<div className="mb-4"><UpdateSourceChip source={props.source} label={props.label} /></div>
|
|
483
|
+
)}
|
|
466
484
|
{props.onCheck === undefined ? null : (
|
|
467
485
|
<button type="button" className="h-8 rounded-lg border px-3 text-sm hover:bg-muted" onClick={props.onCheck}>{props.label('update')}</button>
|
|
468
486
|
)}
|
|
@@ -534,6 +552,67 @@ function cardKey(style: GalleryCardStyle): 'card-hero' | 'card-stamp' | 'card-et
|
|
|
534
552
|
return 'card-hero'
|
|
535
553
|
}
|
|
536
554
|
|
|
555
|
+
/**
|
|
556
|
+
* The update registry: a preset, or the owner's own url. Only this product's own update
|
|
557
|
+
* check and install use it; `~/.npmrc` and app dependency installs are untouched.
|
|
558
|
+
* @param props - the form state, its dispatch, and the label lookup
|
|
559
|
+
*/
|
|
560
|
+
function RegistryField(props: {
|
|
561
|
+
readonly state: ReturnType<typeof settingsState>
|
|
562
|
+
readonly dispatch: (action: Parameters<typeof reduceSettings>[1]) => void
|
|
563
|
+
readonly label: (key: string) => string
|
|
564
|
+
}): ReactNode {
|
|
565
|
+
const choice = registryChoice(props.state.registry)
|
|
566
|
+
// A stored url that matches a preset is that preset. Choosing "custom" is a form mode,
|
|
567
|
+
// so it lives here rather than in the value.
|
|
568
|
+
const [custom, setCustom] = useState(choice === 'custom')
|
|
569
|
+
const seen = useRef(props.state.registry)
|
|
570
|
+
useEffect(() => {
|
|
571
|
+
// Only a value that changed elsewhere (a restore, another writer) leaves custom mode.
|
|
572
|
+
if (seen.current === props.state.registry) return
|
|
573
|
+
seen.current = props.state.registry
|
|
574
|
+
if (choice !== 'custom') setCustom(false)
|
|
575
|
+
}, [choice, props.state.registry])
|
|
576
|
+
const shown = custom ? 'custom' : choice
|
|
577
|
+
return (
|
|
578
|
+
<div className="mt-2 flex flex-col gap-2">
|
|
579
|
+
<label className="text-sm text-muted-foreground" htmlFor="settings-update-registry">{props.label('update-registry')}</label>
|
|
580
|
+
<p className="m-0 max-w-xl text-xs leading-5 text-muted-foreground">{props.label('update-registry-hint')}</p>
|
|
581
|
+
<select
|
|
582
|
+
id="settings-update-registry"
|
|
583
|
+
data-field="update-registry"
|
|
584
|
+
className="h-9 max-w-md rounded-lg border bg-card px-3 text-sm outline-none"
|
|
585
|
+
value={shown}
|
|
586
|
+
onChange={(event) => {
|
|
587
|
+
const picked = event.target.value
|
|
588
|
+
setCustom(picked === 'custom')
|
|
589
|
+
props.dispatch({
|
|
590
|
+
type: 'edit-registry',
|
|
591
|
+
registry: picked === 'default'
|
|
592
|
+
? ''
|
|
593
|
+
: picked === 'custom' ? props.state.registry : updateRegistryPresets[picked as keyof typeof updateRegistryPresets],
|
|
594
|
+
})
|
|
595
|
+
}}
|
|
596
|
+
>
|
|
597
|
+
<option value="default">{props.label('update-registry-default')}</option>
|
|
598
|
+
<option value="npmmirror">{`${props.label('update-registry-npmmirror')} · ${updateRegistryPresets.npmmirror}`}</option>
|
|
599
|
+
<option value="tencent">{`${props.label('update-registry-tencent')} · ${updateRegistryPresets.tencent}`}</option>
|
|
600
|
+
<option value="custom">{props.label('update-registry-custom')}</option>
|
|
601
|
+
</select>
|
|
602
|
+
{shown !== 'custom' ? null : (
|
|
603
|
+
<input
|
|
604
|
+
data-field="update-registry-custom"
|
|
605
|
+
className="h-9 max-w-md rounded-lg border bg-card px-3 font-mono text-sm outline-none"
|
|
606
|
+
placeholder="https://registry.example.com/"
|
|
607
|
+
value={props.state.registry}
|
|
608
|
+
onChange={event => props.dispatch({ type: 'edit-registry', registry: event.target.value })}
|
|
609
|
+
/>
|
|
610
|
+
)}
|
|
611
|
+
{props.state.registryError ? <p className="m-0 text-xs text-destructive">{props.label('update-registry-invalid')}</p> : null}
|
|
612
|
+
</div>
|
|
613
|
+
)
|
|
614
|
+
}
|
|
615
|
+
|
|
537
616
|
async function saveSettings(
|
|
538
617
|
client: PanelSettingsClient,
|
|
539
618
|
state: ReturnType<typeof settingsState>,
|
|
@@ -541,7 +620,7 @@ async function saveSettings(
|
|
|
541
620
|
): Promise<PanelPolicy | undefined> {
|
|
542
621
|
const draft = settingsDraft(state)
|
|
543
622
|
if (!draft.ok) {
|
|
544
|
-
dispatch({ type:
|
|
623
|
+
dispatch({ type: draft.key })
|
|
545
624
|
return undefined
|
|
546
625
|
}
|
|
547
626
|
try {
|
package/src/surface/view.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import type { HistoryClient } from '../history/client.ts'
|
|
|
8
8
|
import { isPanelLocale, panelText, type PanelLabelMode, type PanelLocale } from '../labels.ts'
|
|
9
9
|
import type { PanelPolicy, PanelSettingsClient, PanelUpdateCheck } from '../settings/client.ts'
|
|
10
10
|
import { attemptCard, UpdateDialog, type UpdateCard } from '../settings/update-dialog.tsx'
|
|
11
|
+
import { checkSource } from '../settings/update-source.tsx'
|
|
11
12
|
import { Tooltip } from '../ui/tooltip.tsx'
|
|
12
13
|
import { PanelSettings } from '../settings/view.tsx'
|
|
13
14
|
import type { StorageClient } from '../storage/client.ts'
|
|
@@ -246,10 +247,12 @@ function receiveUpdate(check: PanelUpdateCheck, settings: PanelSettingsClient |
|
|
|
246
247
|
function offerCard(check: PanelUpdateCheck): UpdateCard | undefined {
|
|
247
248
|
if (!check.updateAvailable || check.installable !== true || check.latest === null) return undefined
|
|
248
249
|
if (sessionStorage.getItem(updateDismissedKey) === check.latest) return undefined
|
|
250
|
+
const source = checkSource(check)
|
|
249
251
|
return {
|
|
250
252
|
kind: 'offer',
|
|
251
253
|
current: check.current,
|
|
252
254
|
latest: check.latest,
|
|
253
255
|
...check.channel === undefined ? {} : { channel: check.channel },
|
|
256
|
+
...source === undefined ? {} : { source },
|
|
254
257
|
}
|
|
255
258
|
}
|