@finogeeks2026/finshield-kilo 0.11.1-beta.1 → 0.11.1-debug.1

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-zh.md CHANGED
@@ -1,16 +1,17 @@
1
1
  # FinShield Kilo Windows 插件
2
2
 
3
- 当前为 beta 待验收版本,尚未上架市场。支持 Windows x64、Kilo CLI 7.8.27 的本地交互终端。
3
+ 当前为 debug 待验收版本,尚未上架市场。支持 Windows x64、Kilo CLI 7.8.27 的本地交互终端;当前插件未验证 Kilo Desktop 兼容性。
4
4
 
5
- beta 包发布到 npm 的 `beta` 标签,不改 `latest`。本轮插件版本为 `0.11.1-beta.1`,原生 FinShield 固定为 `0.11.1`。
5
+ 后续测试包发布到 npm 的固定 `debug` 标签,保留既有 `latest`。首发 beta 自动生成的 `latest` 已按用户决定保留。
6
+ 本轮插件版本为 `0.11.1-debug.1`,原生 FinShield 固定为 `0.11.1`。
6
7
  发布后,在普通 Kilo 的命令面板选择 **Install plugin**,输入完整测试版本,或执行:
7
8
 
8
9
  ```powershell
9
- kilo plugin @finogeeks2026/finshield-kilo@0.11.1-beta.1 --global
10
+ kilo plugin @finogeeks2026/finshield-kilo@0.11.1-debug.1 --global
10
11
  ```
11
12
 
12
13
  安装后关闭并重开 Kilo。以后测试新版时使用完整版本号;替换已有包条目可在 CLI 增加 `--force`。
13
- 不要只依赖 `@beta` 标签刷新:Kilo 按安装 spec 缓存 npm 包,可能继续使用已有缓存。
14
+ 首次安装也可使用 `@finogeeks2026/finshield-kilo@debug`。不要只依赖 `@debug` 标签刷新:Kilo 按安装 spec 缓存 npm 包,可能继续使用已有缓存。
14
15
 
15
16
  正式发布后,在普通 Kilo 的命令面板选择 **Install plugin**,输入
16
17
  `@finogeeks2026/finshield-kilo`,选择项目或全局范围。也可执行:
@@ -23,6 +24,11 @@ kilo plugin @finogeeks2026/finshield-kilo --global
23
24
  安全域为 `finsafe.kilo`。正式版插件与 FinShield 版本一致;beta 插件递增测试后缀,原生版本由包内 `finshield.nativeVersion` 明确指定。需要提权时由 Windows 原生流程显示 UAC。
24
25
  取消或失败会显示实际结果,不会自动重试授权。准备完成后确认重启;选择稍后时,当前普通会话仍显示未保护。
25
26
 
27
+ 首次准备时,Kilo 页面内会自动打开 **FinShield preparation** 进度面板,显示下载、安装、授权阶段及原生实际百分比。
28
+ 没有百分比时显示等待状态,不模拟进度。若正在使用其他 Kilo 对话框,先显示阶段通知,关闭该对话框后再打开面板。
29
+ 选择 **Continue in background** 或关闭面板只收起提示,授权继续,不会每次轮询重新弹出;可通过命令面板的 **FinShield** 再次打开。
30
+ 新版本需关闭并重开 Kilo 才会加载;正在进行的授权应先等待结束。
31
+
26
32
  以后环境已就绪时,插件按 DSH 加 `appReady` 之前的流程自动包裹。
27
33
  **同版本卸载重装可能在插件管理器操作结束前立即重启 Kilo,这是首版保留的已知行为。**
28
34
  安装或重新启用前请保存工作。不需要每次手动点击启动保护。
package/README.md CHANGED
@@ -3,33 +3,35 @@
3
3
  FinShield prepares a dedicated Windows installation and policy for Kilo, then
4
4
  restarts the local Kilo TUI in AppContainer. Its tools run under the same
5
5
  confinement. The formal security domain is **finsafe.kilo**. The plugin and
6
- native FinShield use the same release version for stable releases. Beta plugin
6
+ native FinShield use the same release version for stable releases. Test plugin
7
7
  versions use a prerelease suffix; `finshield.nativeVersion` explicitly selects
8
- the native release. This beta targets native **0.11.1**.
8
+ the native release. This debug build targets native **0.11.1**.
9
9
 
10
10
  Supported: Windows x64, native Kilo CLI **7.8.27**, local interactive TUI.
11
11
  Headless `kilo run`, remote attach/daemon workspaces, mini mode, the VS Code
12
- extension, Linux and macOS are outside this release.
12
+ extension, Kilo Desktop, Linux and macOS are outside this release's verified scope.
13
13
 
14
14
  **Release status:** lifecycle source and package are under acceptance. This
15
- package uses the npm `beta` channel and is not listed in the Kilo marketplace.
15
+ package uses the fixed npm `debug` test channel and is not listed in the Kilo marketplace.
16
16
  Installed-product authorization, dedicated-domain interactive acceptance and
17
17
  marketplace installation are still required before public release. The steps
18
18
  below describe the release flow; they are not an announcement of availability.
19
19
 
20
20
  ## Installation and first use
21
21
 
22
- After beta publication, install the exact test version through Kilo:
22
+ After this debug publication, install the exact test version through Kilo:
23
23
 
24
24
  ```powershell
25
- kilo plugin @finogeeks2026/finshield-kilo@0.11.1-beta.1 --global
25
+ kilo plugin @finogeeks2026/finshield-kilo@0.11.1-debug.1 --global
26
26
  ```
27
27
 
28
- Close and reopen Kilo after installation. For later beta versions, use the exact
28
+ First installs can also use `@finogeeks2026/finshield-kilo@debug`.
29
+ Close and reopen Kilo after installation. For later test versions, use the exact
29
30
  version and the original scope; the CLI's `--force` replaces an existing package
30
- entry. Kilo caches packages by install spec, so an existing `@beta` cache may
31
- continue resolving the older package. Beta publication uses `--tag beta` and
32
- does not update `latest`.
31
+ entry. Kilo caches packages by install spec, so an existing `@debug` cache may
32
+ continue resolving the older package. Subsequent test publications use
33
+ `--tag debug` and preserve existing `latest`. npm created an initial `latest`
34
+ during the first beta publication; the owner chose to retain that initial state.
33
35
 
34
36
  After publication, open ordinary Kilo in your workspace. Use the command
35
37
  palette's **Install plugin**, enter `@finogeeks2026/finshield-kilo`, and choose
@@ -57,6 +59,17 @@ Open **FinShield** in the Kilo command palette for preparation progress, actual
57
59
  current-process protection, requested/current native release, restart, update,
58
60
  disable and native uninstall controls.
59
61
 
62
+ During first preparation, a **FinShield preparation** panel opens inside Kilo.
63
+ It shows downloading, installation and authorization stages, and a bar only
64
+ when native progress supplies a percentage. Unknown progress is shown as not
65
+ reported; no simulated percentage is used. If another Kilo dialog is open, a
66
+ stage notice appears first and the panel waits for that dialog to close.
67
+ **Continue in background**, Escape or closing the panel only hides it; native
68
+ preparation continues. Polling does not reopen a dismissed panel. Use the
69
+ FinShield command to reopen it. Ready Restart/Later confirmation is unchanged.
70
+ Wait for an active authorization to finish before updating and reopening Kilo;
71
+ the running plugin cannot hot-load this new UI.
72
+
60
73
  When an activation finds the matching installation and authorization already
61
74
  ready, it automatically restarts through `finsafe self-confine`. This follows
62
75
  DSH's behavior from before its appReady revision. **A same-version runtime
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finogeeks2026/finshield-kilo",
3
- "version": "0.11.1-beta.1",
3
+ "version": "0.11.1-debug.1",
4
4
  "description": "FinShield lifecycle and AppContainer protection for the Windows Kilo CLI",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.rtf",
@@ -1,29 +1,51 @@
1
1
  import {pluginVersion} from './lifecycle-settings.mjs';
2
2
  export const packageName = '@finogeeks2026/finshield-kilo';
3
+ const preparationPhases = new Set(['starting', 'downloading', 'installing', 'authorizing', 'waiting-authorization']);
4
+ const phaseNames = {starting: 'Starting FinShield', downloading: 'Downloading FinShield', installing: 'Installing FinShield',
5
+ authorizing: 'Authorizing Kilo access', 'waiting-authorization': 'Waiting for existing authorization',
6
+ ready: 'Ready to restart', protected: 'Protected', restarting: 'Restarting Kilo',
7
+ cancelled: 'Preparation cancelled', failed: 'Preparation failed', 'reboot-required': 'Windows restart required'};
8
+ const phaseName = state => phaseNames[state.phase] ?? state.phase;
9
+ const percentage = state => {
10
+ const value = state.progress?.overall_percent;
11
+ return Number.isFinite(value) && value >= 0 && value <= 100 ? value : undefined;
12
+ };
13
+ const progressText = state => {
14
+ const percent = percentage(state);
15
+ if (percent === undefined) return 'Progress not reported yet';
16
+ const filled = Math.floor(percent / 5);
17
+ return `[${'#'.repeat(filled)}${'-'.repeat(20 - filled)}] ${percent}%`;
18
+ };
19
+ const panelKey = state => JSON.stringify([state.phase, percentage(state), state.error, state.currentProtected,
20
+ state.currentRelease, state.requestedRelease, state.restartPolicy]);
3
21
 
4
22
  export function registerManagement(api, activation, {observe, schedule = setInterval, cancel = clearInterval}) {
5
- let disposed = false, viewing = false, busy = false, reminder;
23
+ let disposed = false, viewing = false, busy = false, reminder, automaticShown = false, rendered, lastNotice;
24
+ let selected = 'background';
6
25
  const fail = error => api.ui.toast({variant: 'error', message: `FinShield: ${error.message}`});
7
26
  async function status() {
8
27
  const token = observe();
9
28
  return {...await activation.status(), currentProtected: token.appContainer === true};
10
29
  }
11
30
  function confirmRestart() {
31
+ viewing = false;
12
32
  api.ui.dialog.replace(() => api.ui.DialogConfirm({title: 'Restart Kilo with FinShield?',
13
33
  message: 'FinShield is ready. The current Kilo process will close. Running work will stop. A protected Kilo will open in its terminal.',
14
34
  onConfirm: () => {api.ui.dialog.clear();void activation.restart().catch(fail);},
15
35
  onCancel: () => {api.ui.dialog.clear();void activation.later().catch(fail);}}));
16
36
  }
17
- async function show() {
18
- viewing = true;
19
- try {
20
- const state = await status();if (disposed) return;
37
+ function renderPanel(state) {
38
+ const preparing = !state.currentProtected && preparationPhases.has(state.phase);
39
+ if (preparing) automaticShown = true;
21
40
  const protectedText = state.currentProtected ? 'Protected (AppContainer)' : 'Not protected';
22
41
  const wrapper = state.currentProtected ? state.currentRelease ?? 'unavailable' : 'none (ordinary Kilo)';
23
42
  const rows = [
24
43
  {title: protectedText, value: 'status', description: `Plugin: ${pluginVersion}. Preparation: ${state.phase}. Current wrapper: ${wrapper}; requested release: ${state.requestedRelease ?? 'loading'}`, disabled: true},
25
- ...(state.progress?.overall_percent == null ? [] : [{title: `Preparation ${state.progress.overall_percent}%`, value: 'progress', disabled: true}]),
44
+ {title: phaseName(state), value: 'phase', disabled: true},
45
+ ...(preparing || percentage(state) !== undefined ? [{title: progressText(state), value: 'progress', disabled: true,
46
+ description: preparing ? 'Closing this panel does not cancel native preparation.' : undefined}] : []),
26
47
  ...(state.error ? [{title: 'Operation failed', value: 'error', description: state.error, disabled: true}] : []),
48
+ {title: preparing ? 'Continue in background' : 'Close panel', value: 'background'},
27
49
  {title: 'Refresh status', value: 'refresh'},
28
50
  {title: 'Restart with prepared protection', value: 'restart', disabled: state.phase !== 'ready' || state.restartPolicy !== 'confirm'},
29
51
  {title: 'Update plugin through Kilo', value: 'update', description: `Use Install plugin with the full target version of ${packageName}; select the original install scope.`},
@@ -32,8 +54,10 @@ export function registerManagement(api, activation, {observe, schedule = setInte
32
54
  description: 'Separate from disabling the plugin. Native Windows uninstall owns authorization cleanup and UAC.'},
33
55
  {title: 'Removal and recovery instructions', value: 'help'},
34
56
  ];
35
- api.ui.dialog.replace(() => api.ui.DialogSelect({title: 'FinShield', options: rows, onSelect: option => {
57
+ api.ui.dialog.replace(() => api.ui.DialogSelect({title: preparing ? 'FinShield preparation' : 'FinShield', options: rows,
58
+ skipFilter: true, current: selected, onMove: option => {selected = option.value;}, onSelect: option => {
36
59
  if (option.disabled || busy) return;
60
+ if (option.value === 'background') {api.ui.dialog.clear();return;}
37
61
  if (option.value === 'refresh') {void show();return;}
38
62
  if (option.value === 'restart') {confirmRestart();return;}
39
63
  if (option.value === 'update') {
@@ -54,16 +78,35 @@ export function registerManagement(api, activation, {observe, schedule = setInte
54
78
  void (nativeRemoval ? activation.uninstall() : api.plugins.deactivate(packageName))
55
79
  .catch(fail).finally(() => {busy = false;if (!disposed && nativeRemoval) void show();});
56
80
  }}));
57
- }}), () => {viewing = false;});
81
+ }}), () => {viewing = false;rendered = undefined;});
82
+ // Kilo closes the old dialog synchronously during replace. Set ownership
83
+ // after replacement so that old onClose cannot stop progress refreshes.
84
+ viewing = true;rendered = panelKey(state);
85
+ }
86
+ async function show() {
87
+ try {
88
+ const state = await status();if (!disposed) renderPanel(state);
58
89
  } catch (error) {fail(error);}
59
90
  }
60
91
  const unregister = api.keymap.registerLayer({commands: [{name: 'finshield.manage', title: 'FinShield', category: 'Tools', namespace: 'palette', run: show}]});
61
92
  const timer = schedule(() => {
62
93
  void status().then(state => {
63
94
  if (disposed || busy) return;
95
+ const notice = JSON.stringify([state.phase, state.error, state.currentProtected]);
96
+ if (notice !== lastNotice) {
97
+ lastNotice = notice;
98
+ api.ui.toast({title: 'FinShield', duration: state.error ? 15000 : 8000,
99
+ variant: state.error || state.phase === 'failed' ? 'error' : state.phase === 'cancelled' ? 'warning' : state.currentProtected ? 'success' : 'info',
100
+ message: `${phaseName(state)}${state.error ? ': ' + state.error : '. Open FinShield for progress and protection status.'}`});
101
+ }
64
102
  if (state.phase === 'ready' && state.restartPolicy === 'confirm' && !state.reminderDismissed && state.reminderId !== reminder) {
65
103
  reminder = state.reminderId;confirmRestart();
66
- } else if (viewing && !api.ui.dialog.open) {viewing = false;}
104
+ } else if (viewing) {
105
+ if (!api.ui.dialog.open) viewing = false;
106
+ else if (rendered !== panelKey(state)) renderPanel(state);
107
+ } else if (!automaticShown && !state.currentProtected && preparationPhases.has(state.phase) && !api.ui.dialog.open) {
108
+ renderPanel(state);
109
+ }
67
110
  }).catch(fail);
68
111
  }, 2000);
69
112
  return {show, dispose() {disposed = true;cancel(timer);unregister?.();}};
package/src/tui.mjs CHANGED
@@ -16,6 +16,8 @@ export async function initializeProduct(api, options, injected) {
16
16
  const native = windowsNative();
17
17
  return {observe: () => native.currentIdentity(), connect: hostConnections, env: knownFolderEnvironment()};
18
18
  })();
19
+ api.ui.toast({variant: 'info', title: 'FinShield', duration: 10000,
20
+ message: 'Starting FinShield. Preparation progress will appear in Kilo; use the FinShield command to reopen it.'});
19
21
  const settings = lifecycleSettings(options, ports.env);
20
22
  if (ports.observe().appContainer) {
21
23
  const paths = ports.clientPaths ? await ports.clientPaths() : (await api.client.path.get(undefined, {throwOnError: true})).data;