@finogeeks2026/finshield-kilo 0.0.0-stage → 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/LICENSE.rtf ADDED
@@ -0,0 +1,28 @@
1
+ {\rtf1\ansi\deff0{\fonttbl{\f0 Microsoft YaHei;}}
2
+ \viewkind4\uc1\pard\f0 \fs24\b \u26234?\u23433?\u30462?\u26700?\u-26782?\u-28817?\u20214?\u-29768?\u21487?\u21327?\u-29778?\b0\fs18\par
3
+ \b \u26356?\u26032?\u26085?\u26399?\u-230?2026 \u24180? 10 \u26376? 11 \u26085?\b0\par
4
+ \b 1. \u25509?\u21463?\u21327?\u-29778?\b0\par
5
+ \u23433?\u-30523?\u25110?\u20351?\u29992?\u26234?\u23433?\u30462?\u-244?\u21363?\u-30616?\u31034?\u24744?\u21516?\u24847?\u26412?\u21327?\u-29778?\u12290?\u22914?\u26524?\u24744?\u19981?\u21516?\u24847?\u-244?\u-29705?\u19981?\u-30335?\u23433?\u-30523?\u25110?\u20351?\u29992?\u26412?\u-28817?\u20214?\u12290?\par
6
+ \b 2. \u-29768?\u21487?\u-31997?\u22260?\b0\par
7
+ \u28145?\u22323?\u20961?\u27888?\u26497?\u23458?\u31185?\u25216?\u26377?\u-27056?\u-29405?\u20219?\u20844?\u21496?\u25480?\u20104?\u24744?\u26377?\u-27056?\u30340?\u12289?\u-26786?\u29420?\u21344?\u30340?\u12289?\u19981?\u21487?\u-28820?\u-29783?\u30340?\u-28817?\u20214?\u20351?\u29992?\u-29768?\u21487?\u12290?\u20855?\u20307?\u20351?\u29992?\u-31997?\u22260?\u21516?\u26102?\u21463?\u-28670?\u29992?\u30340?\u-29790?\u21333?\u12289?\u-29790?\u-27131?\u21327?\u-29778?\u25110?\u20225?\u19994?\u21327?\u-29778?\u32422?\u26463?\u12290?\par
8
+ \u-27036?\u-26786?\u27861?\u24459?\u25110?\u20070?\u-26782?\u21327?\u-29778?\u20801?\u-29768?\u-244?\u24744?\u19981?\u24471?\u20986?\u21806?\u12289?\u20986?\u31199?\u12289?\u20877?\u20998?\u21457?\u26412?\u-28817?\u20214?\u-244?\u19981?\u24471?\u32469?\u-28729?\u-29768?\u21487?\u-29759?\u25110?\u25216?\u26415?\u-27056?\u21046?\u-244?\u20063?\u19981?\u24471?\u21024?\u-27036?\u-28817?\u20214?\u20013?\u30340?\u26435?\u21033?\u22768?\u26126?\u12290?\par
9
+ \b 3. \u-28817?\u20214?\u21151?\u-32515?\u19982?\u25480?\u26435?\b0\par
10
+ \u26234?\u23433?\u30462?\u21487?\u20197?\u25353?\u29031?\u-28339?\u32622?\u31649?\u25511? WorkBuddy \u30340?\u26435?\u-27056?\u12290?\par
11
+ \u22312?\u24744?\u26126?\u30830?\u25480?\u26435?\u21518?\u-244?\u26234?\u23433?\u30462?\u21487?\u-32515?\u-230?\par
12
+ - \u20462?\u25913?\u25991?\u20214?\u21644?\u30446?\u24405?\u-29761?\u-27154?\u26435?\u-27056?\u-229?\par
13
+ - \u21019?\u24314?\u25110?\u-28339?\u32622? Windows AppContainer \u-29013?\u20221?\u-229?\par
14
+ - \u-28339?\u32622?\u32593?\u32476?\u-28729?\u28388?\u12289?\u20195?\u29702?\u21644?\u22238?\u29615?\u-29761?\u-27154?\u26435?\u-27056?\u-229?\par
15
+ - \u21019?\u24314?\u25110?\u26356?\u26032?\u-29791?\u21010?\u20219?\u21153?\u-229?\par
16
+ - \u22312?\u26412?\u26426?\u20445?\u23384?\u-28339?\u32622?\u12289?\u25480?\u26435?\u22238?\u25191?\u12289?\u-28720?\u-30644?\u26085?\u24535?\u21644?\u23457?\u-29791?\u-29776?\u24405?\u12290?\par
17
+ \u-29705?\u22312?\u25480?\u26435?\u21069?\u26816?\u26597?\u-26507?\u-26782?\u26174?\u31034?\u30340?\u26435?\u-27056?\u-31997?\u22260?\u-244?\u24182?\u22312?\u30446?\u26631?\u29615?\u22659?\u20013?\u-25972?\u-29759?\u-28339?\u32622?\u12290?\par
18
+ \b 4. \u25968?\u25454?\u20445?\u25252?\b0\par
19
+ \u26234?\u23433?\u30462?\u19981?\u20250?\u20026?\u-32278?\u-29013?\u30446?\u30340?\u25910?\u-26938?\u25110?\u19978?\u20256?\u29992?\u25143?\u25968?\u25454?\u-244?\u20063?\u19981?\u20250?\u23558?\u29992?\u25143?\u25968?\u25454?\u21457?\u-28671?\u32473?\u20961?\u27888?\u26497?\u23458?\u12290?\par
20
+ \u26234?\u23433?\u30462?\u20165?\u25353?\u29031?\u29992?\u25143?\u-28339?\u32622?\u25191?\u-30644?\u26435?\u-27056?\u31649?\u25511?\u21644?\u24517?\u-30335?\u30340?\u32593?\u32476?\u-28820?\u21457?\u12290?\u22240?\u29992?\u25143?\u-28339?\u32622?\u20135?\u29983?\u30340?\u32593?\u32476?\u-28646?\u20449?\u21482?\u21457?\u-28671?\u21040?\u29992?\u25143?\u25351?\u23450?\u30340?\u26381?\u21153?\u12290?\u-28339?\u32622?\u12289?\u25480?\u26435?\u22238?\u25191?\u12289?\u-28720?\u-30644?\u26085?\u24535?\u21644?\u23457?\u-29791?\u-29776?\u24405?\u20445?\u23384?\u22312?\u26412?\u26426?\u12290?\par
21
+ \b 5. \u20445?\u-29759?\u19982?\u-29405?\u20219?\b0\par
22
+ \u22312?\u27861?\u24459?\u20801?\u-29768?\u30340?\u-31997?\u22260?\u20869?\u-244?\u26412?\u-28817?\u20214?\u25353?\u8220?\u29616?\u29366?\u8221?\u25552?\u20379?\u12290?\u25105?\u20204?\u19981?\u20445?\u-29759?\u-28817?\u20214?\u19981?\u20250?\u20013?\u26029?\u12289?\u27809?\u26377?\u-27367?\u-29713?\u-244?\u25110?\u-32515?\u22815?\u-27077?\u27490?\u25152?\u26377?\u23433?\u20840?\u-26418?\u-27031?\u12290?\par
23
+ \u23545?\u20110?\u19981?\u-32515?\u20381?\u27861?\u25490?\u-27036?\u25110?\u-27056?\u21046?\u30340?\u-29405?\u20219?\u-244?\u25353?\u29031?\u-28670?\u29992?\u27861?\u24459?\u21450?\u21452?\u26041?\u31614?\u32626?\u30340?\u20070?\u-26782?\u21327?\u-29778?\u22788?\u29702?\u12290?\par
24
+ \b 6. \u32456?\u27490?\u21644?\u20854?\u20182?\u26465?\u27454?\b0\par
25
+ \u-28707?\u21453?\u26412?\u21327?\u-29778?\u21487?\u-32515?\u23548?\u-32268?\u-29768?\u21487?\u32456?\u27490?\u12290?\u20572?\u27490?\u20351?\u29992?\u26102?\u-244?\u-29705?\u25353?\u29031?\u20135?\u21697?\u-29708?\u26126?\u-30237?\u-27036?\u26234?\u23433?\u30462?\u-28339?\u32622?\u30340?\u26435?\u-27056?\u24182?\u21368?\u-28803?\u-28817?\u20214?\u12290?\par
26
+ \u21452?\u26041?\u31614?\u32626?\u30340?\u20070?\u-26782?\u21327?\u-29778?\u19982?\u26412?\u21327?\u-29778?\u19981?\u19968?\u-32268?\u26102?\u-244?\u20197?\u20070?\u-26782?\u21327?\u-29778?\u20026?\u20934?\u12290?\par
27
+ \u-32684?\u31995?\u26041?\u24335?\u-230?contact@finogeeks.com\par
28
+ }
package/README-zh.md ADDED
@@ -0,0 +1,52 @@
1
+ # FinShield Kilo Windows 插件
2
+
3
+ 当前为 debug 待验收版本,尚未上架市场。支持 Windows x64、Kilo CLI 7.8.27 的本地交互终端;当前插件未验证 Kilo Desktop 兼容性。
4
+
5
+ 后续测试包发布到 npm 的固定 `debug` 标签,保留既有 `latest`。首发 beta 自动生成的 `latest` 已按用户决定保留。
6
+ 本轮插件版本为 `0.11.1-debug.1`,原生 FinShield 固定为 `0.11.1`。
7
+ 发布后,在普通 Kilo 的命令面板选择 **Install plugin**,输入完整测试版本,或执行:
8
+
9
+ ```powershell
10
+ kilo plugin @finogeeks2026/finshield-kilo@0.11.1-debug.1 --global
11
+ ```
12
+
13
+ 安装后关闭并重开 Kilo。以后测试新版时使用完整版本号;替换已有包条目可在 CLI 增加 `--force`。
14
+ 首次安装也可使用 `@finogeeks2026/finshield-kilo@debug`。不要只依赖 `@debug` 标签刷新:Kilo 按安装 spec 缓存 npm 包,可能继续使用已有缓存。
15
+
16
+ 正式发布后,在普通 Kilo 的命令面板选择 **Install plugin**,输入
17
+ `@finogeeks2026/finshield-kilo`,选择项目或全局范围。也可执行:
18
+
19
+ ```powershell
20
+ kilo plugin @finogeeks2026/finshield-kilo --global
21
+ ```
22
+
23
+ 首次启用时,外部普通权限协调器下载并校验对应版本的官方安装程序,调用原生安装、配置和授权流程。
24
+ 安全域为 `finsafe.kilo`。正式版插件与 FinShield 版本一致;beta 插件递增测试后缀,原生版本由包内 `finshield.nativeVersion` 明确指定。需要提权时由 Windows 原生流程显示 UAC。
25
+ 取消或失败会显示实际结果,不会自动重试授权。准备完成后确认重启;选择稍后时,当前普通会话仍显示未保护。
26
+
27
+ 首次准备时,Kilo 页面内会自动打开 **FinShield preparation** 进度面板,显示下载、安装、授权阶段及原生实际百分比。
28
+ 没有百分比时显示等待状态,不模拟进度。若正在使用其他 Kilo 对话框,先显示阶段通知,关闭该对话框后再打开面板。
29
+ 选择 **Continue in background** 或关闭面板只收起提示,授权继续,不会每次轮询重新弹出;可通过命令面板的 **FinShield** 再次打开。
30
+ 新版本需关闭并重开 Kilo 才会加载;正在进行的授权应先等待结束。
31
+
32
+ 以后环境已就绪时,插件按 DSH 加 `appReady` 之前的流程自动包裹。
33
+ **同版本卸载重装可能在插件管理器操作结束前立即重启 Kilo,这是首版保留的已知行为。**
34
+ 安装或重新启用前请保存工作。不需要每次手动点击启动保护。
35
+
36
+ 使用命令面板的 **FinShield** 查看真实进程保护状态、准备进度、当前和目标版本,以及重启、更新、停用和原生卸载入口。
37
+ 更新使用 Kilo 的安装入口,并选择原来的安装范围。Kilo 7.8.27 不会在安装更新后重新加载已有插件代码,停用再启用也仍用旧回调。安装后保存工作、关闭并正常重开 Kilo,才能加载新版插件并准备对应原生版本;准备完成后再确认受保护重启。
38
+ 模型和凭据继续由 Kilo 管理,不复制 DSH 的 Key,不另建体验环境。
39
+
40
+ 默认原生目录为 `%ProgramFiles%\FinSAFE\kilo-plugin-versions\<版本>`;
41
+ 专属配置为 `%ProgramData%\FinSAFE\kilo-plugin-versions\<版本>\config`;
42
+ 协调器为 `%LOCALAPPDATA%\FinSAFE\kilo-updater\<插件版本>`;诊断和当前实例选择在 `%LOCALAPPDATA%\FinSAFE\kilo`。
43
+ Kilo 工作区是实际项目或调用目录,没有固定默认工作区。
44
+ 其数据、配置、缓存和状态默认在用户目录下的 `.local/share/kilo`、`.config/kilo`、`.cache/kilo`、`.local/state/kilo`。
45
+
46
+ 停用使用 Kilo 自己的插件管理器。当前 AppContainer 仍保持隔离直到退出。
47
+ 移除插件时先停用、关闭会话,再从原安装范围的 TUI 配置移除包条目;Kilo 的公开 API 尚无移除包的回调,包缓存由 Kilo 管理。
48
+ 原生卸载是独立操作:可在保留的普通会话中确认卸载所选实例,或使用对应 Windows 已安装应用卸载入口。
49
+ 原生卸载器负责权限清理和提权,不要以删除其他 FinShield 实例代替。
50
+
51
+ 更多配置、限制、错误恢复与支持信息见 [英文说明](README.md)。
52
+ 许可采用 [FinShield 产品协议](LICENSE.rtf),第三方信息见 [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md)。
package/README.md CHANGED
@@ -1,3 +1,185 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # FinShield for Kilo CLI on Windows
2
+
3
+ FinShield prepares a dedicated Windows installation and policy for Kilo, then
4
+ restarts the local Kilo TUI in AppContainer. Its tools run under the same
5
+ confinement. The formal security domain is **finsafe.kilo**. The plugin and
6
+ native FinShield use the same release version for stable releases. Test plugin
7
+ versions use a prerelease suffix; `finshield.nativeVersion` explicitly selects
8
+ the native release. This debug build targets native **0.11.1**.
9
+
10
+ Supported: Windows x64, native Kilo CLI **7.8.27**, local interactive TUI.
11
+ Headless `kilo run`, remote attach/daemon workspaces, mini mode, the VS Code
12
+ extension, Kilo Desktop, Linux and macOS are outside this release's verified scope.
13
+
14
+ **Release status:** lifecycle source and package are under acceptance. This
15
+ package uses the fixed npm `debug` test channel and is not listed in the Kilo marketplace.
16
+ Installed-product authorization, dedicated-domain interactive acceptance and
17
+ marketplace installation are still required before public release. The steps
18
+ below describe the release flow; they are not an announcement of availability.
19
+
20
+ ## Installation and first use
21
+
22
+ After this debug publication, install the exact test version through Kilo:
23
+
24
+ ```powershell
25
+ kilo plugin @finogeeks2026/finshield-kilo@0.11.1-debug.1 --global
26
+ ```
27
+
28
+ First installs can also use `@finogeeks2026/finshield-kilo@debug`.
29
+ Close and reopen Kilo after installation. For later test versions, use the exact
30
+ version and the original scope; the CLI's `--force` replaces an existing package
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.
35
+
36
+ After publication, open ordinary Kilo in your workspace. Use the command
37
+ palette's **Install plugin**, enter `@finogeeks2026/finshield-kilo`, and choose
38
+ project or global scope. The official CLI alternative is:
39
+
40
+ ```powershell
41
+ kilo plugin @finogeeks2026/finshield-kilo --global
42
+ ```
43
+
44
+ Kilo installs the npm dependency and updates its own TUI configuration. No
45
+ separate FinShield launcher, experience profile, hand-written YAML or copied
46
+ model credential is required. Keep using Kilo's normal provider configuration.
47
+
48
+ On first activation, Kilo remains open while an ordinary FinShield coordinator:
49
+
50
+ 1. Downloads the matching official Windows setup and verifies its SHA256.
51
+ 2. Calls native setup for a separate Kilo installation and configuration.
52
+ 3. Runs the existing native authorization workflow, including Windows UAC when
53
+ required. Authorization keeps the initiating user distinct from the elevated
54
+ executor. Cancellation or failure stays visible and does not auto-retry.
55
+ 4. Offers a restart after the selected native policy is ready. Choose **Later**
56
+ to continue the current session, which is still shown as not protected.
57
+
58
+ Open **FinShield** in the Kilo command palette for preparation progress, actual
59
+ current-process protection, requested/current native release, restart, update,
60
+ disable and native uninstall controls.
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
+
73
+ When an activation finds the matching installation and authorization already
74
+ ready, it automatically restarts through `finsafe self-confine`. This follows
75
+ DSH's behavior from before its appReady revision. **A same-version runtime
76
+ uninstall/reinstall can restart Kilo immediately before the plugin manager
77
+ reports completion.** Save work before installing or re-enabling the plugin.
78
+ There is no per-launch manual Start protection requirement.
79
+
80
+ The original process is retained by PID and creation time. Only that generation
81
+ is stopped. The replacement retains the resolved project, arguments and native
82
+ console handles, sets `KILO_NO_DAEMON=1`, and uses its real AppContainer token as
83
+ the loop guard. A failed protected launch reports the native error; it does not
84
+ restart an unconfined replacement. Kilo keeps its normal exit controls, including
85
+ its default two Ctrl+C presses within one second at an empty focused prompt.
86
+
87
+ ## Configuration and data
88
+
89
+ Default owned locations:
90
+
91
+ | Content | Location |
92
+ |---|---|
93
+ | Versioned native installation | `%ProgramFiles%\FinSAFE\kilo-plugin-versions\<nativeVersion>` |
94
+ | Versioned configuration | `%ProgramData%\FinSAFE\kilo-plugin-versions\<nativeVersion>\config` |
95
+ | Native coordinator code | `%LOCALAPPDATA%\FinSAFE\kilo-updater\<pluginVersion>` |
96
+ | Profile selection and diagnostics | `%LOCALAPPDATA%\FinSAFE\kilo` |
97
+ | Verified setup downloads | `%LOCALAPPDATA%\FinSAFE\kilo\downloads` |
98
+
99
+ Candidate is packaged; Configuration materializes Effective for the actual
100
+ machine/user. Installer owns the selected configuration directory; temporary
101
+ Candidate staging stays in the user download directory. Native instance records
102
+ and preparation results remain authoritative. `selected.json` selects the
103
+ current installation/configuration across version updates; it is not an
104
+ authorization receipt.
105
+
106
+ The base follows DSH's declared volume RW coverage, host network and resource
107
+ limits, with shared mandatory rules. Kilo-specific rules cover its default data,
108
+ config, cache, state, project metadata and temp directories. CLI/package and
109
+ coordinator code roots are read-only. Custom policy roots require the same native
110
+ configuration/authorization workflow; the plugin does not silently widen a failed
111
+ policy or change its security domain. `--integration-id kilo` attributes records
112
+ and does not select permissions.
113
+
114
+ Kilo has no fixed default workspace: it uses the actual project/caller directory.
115
+ Default user data is `~/.local/share/kilo`, config `~/.config/kilo`, cache
116
+ `~/.cache/kilo`, state `~/.local/state/kilo`, and temp `<os.tmpdir()>/kilo`.
117
+ Kilo owns its database, sessions, provider settings and credentials. FinShield
118
+ does not copy a DSH API key or replace Kilo's home/XDG environment.
119
+
120
+ Optional plugin settings are absolute Windows paths: `nativeVersionRoot`,
121
+ `configurationVersionRoot`, `stateDirectory`; `visible` defaults
122
+ to true for the coordinator/replacement console. Normal installation needs no
123
+ options. Installer payload staging remains under the mandatory-protected FinSAFE
124
+ data root. The client-only DLL copy uses Kilo's actual state directory, obtained
125
+ from its SDK, because protected Kilo cannot write FinSAFE's own directories.
126
+ Keep existing Kilo plugin entries when configuring advanced options.
127
+
128
+ ## Update
129
+
130
+ Use **FinShield → Update plugin through Kilo**, or Kilo's **Install plugin**
131
+ command again with the package name and original installation scope. Kilo owns
132
+ package installation. **Kilo 7.8.27 does not reload an existing plugin callback
133
+ after installation; disabling and re-enabling also retains the old callback.**
134
+ Save work, close the current session and reopen ordinary Kilo to load the update.
135
+
136
+ The new activation selects the previous native instance from profile settings,
137
+ preserves its desired configuration through Configuration's staging API, and
138
+ prepares the matching requested native version in a separate versioned location.
139
+ After preparation, confirm a protected restart. A cancelled/failed update stays
140
+ visible and does not auto-retry permissions. New code roots are supplied by the
141
+ new ordinary coordinator; a stale coordinator rejects changed roots instead of
142
+ silently authorizing a policy that protects the previous package location.
143
+
144
+ ## Disable and remove
145
+
146
+ **Disable plugin** uses Kilo's plugin manager and disposes this plugin's UI and
147
+ observation. Future starts respect Kilo's disabled state. A running AppContainer
148
+ cannot be unconfined by disabling a plugin and stays confined until exit.
149
+
150
+ To remove the Kilo plugin entry, disable it in **Plugins**, close the session,
151
+ and remove its package entry from the TUI configuration in the original project
152
+ or global installation scope. Kilo owns package-cache cleanup; the current public
153
+ API has no package-remove callback. This does not uninstall native FinShield or
154
+ remove its authorization.
155
+
156
+ Native removal is a separate operation. In an ordinary kept session, use
157
+ **Uninstall selected native FinShield** and its confirmation. Otherwise use the
158
+ registered Windows uninstall entry and verify the selected Kilo installation
159
+ path. The existing native uninstaller owns cleanup and UAC. Protected Kilo cannot
160
+ run native uninstall. Do not remove shared or personal FinShield installations
161
+ as a substitute. This plugin does not edit Kilo vendor settings that need
162
+ historical restoration.
163
+
164
+ For permanent removal, disable/remove the Kilo plugin entry before the next
165
+ startup. If it remains enabled, a later activation prepares its integration again.
166
+
167
+ ## Errors and support
168
+
169
+ The **FinShield** command separates actual AppContainer protection from native
170
+ preparation/update state. Read the native phase, progress and error before
171
+ restarting. After a cancelled or failed attempt, correct the stated cause,
172
+ close Kilo, and start it again to request a new attempt. Startup diagnostics are
173
+ in the profile's `startup-*` directories; native installation/authorization keeps
174
+ its existing logs. Bootstrap inputs travel directly in the creator's Windows
175
+ process arguments. Environment blocks and model credentials are not written
176
+ into plugin bootstrap files.
177
+
178
+ Report the Kilo/FinShield versions and relevant diagnostics through
179
+ [FinShield support](https://github.com/finogeeks/finsafe/issues). Avoid including
180
+ model credentials or private project content in reports.
181
+
182
+ License: proprietary product terms in [LICENSE.rtf](LICENSE.rtf).
183
+ See [third-party notices](THIRD-PARTY-NOTICES.md). The package does not redistribute
184
+ Kilo or a full FinShield installer; native setup is downloaded from the official
185
+ release. Marketplace validation is separate from runtime acceptance.
@@ -0,0 +1,212 @@
1
+ # Third-party notices
2
+
3
+ FinShield plugin code is proprietary under LICENSE.rtf. The plugin native DLL
4
+ is built from FinShield APIs. The separately installed FinShield runtime supplies
5
+ its own product license and notices. This package does not redistribute Kilo
6
+ or the full FinShield installer.
7
+
8
+ The runtime dependency Koffi 3.3.8 and its Windows prebuilt dependency are
9
+ distributed under the MIT license. npm installs them as dependencies with
10
+ their own license files. Koffi's notice follows.
11
+
12
+ MIT License
13
+
14
+ Copyright (C) 2026 Niels Martignène <niels.martignene@protonmail.com>
15
+
16
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
17
+ this software and associated documentation files (the “Software”), to deal in
18
+ the Software without restriction, including without limitation the rights to
19
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
20
+ the Software, and to permit persons to whom the Software is furnished to do so,
21
+ subject to the following conditions:
22
+
23
+ The above copyright notice and this permission notice shall be included in all
24
+ copies or substantial portions of the Software.
25
+
26
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32
+ SOFTWARE.
33
+
34
+ ## AppSeam pnpm metadata reader
35
+
36
+ The native AppSeam adapter includes the official pnpm metadata reader and these
37
+ transitive dependencies. Generated notices follow.
38
+
39
+ @pnpm/graceful-fs 1000.1.0
40
+ The MIT License (MIT)
41
+
42
+ Copyright (c) 2015-2016 Rico Sta. Cruz and other contributors
43
+ Copyright (c) 2016-2026 Zoltan Kochan and other contributors
44
+
45
+ Permission is hereby granted, free of charge, to any person obtaining a copy
46
+ of this software and associated documentation files (the "Software"), to deal
47
+ in the Software without restriction, including without limitation the rights
48
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
49
+ copies of the Software, and to permit persons to whom the Software is
50
+ furnished to do so, subject to the following conditions:
51
+
52
+ The above copyright notice and this permission notice shall be included in all
53
+ copies or substantial portions of the Software.
54
+
55
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
56
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
57
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
58
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
59
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
60
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
61
+ SOFTWARE.
62
+
63
+
64
+ @pnpm/modules-yaml 1002.0.1
65
+ The MIT License (MIT)
66
+
67
+ Copyright (c) 2015-2016 Rico Sta. Cruz and other contributors
68
+ Copyright (c) 2016-2026 Zoltan Kochan and other contributors
69
+
70
+ Permission is hereby granted, free of charge, to any person obtaining a copy
71
+ of this software and associated documentation files (the "Software"), to deal
72
+ in the Software without restriction, including without limitation the rights
73
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
74
+ copies of the Software, and to permit persons to whom the Software is
75
+ furnished to do so, subject to the following conditions:
76
+
77
+ The above copyright notice and this permission notice shall be included in all
78
+ copies or substantial portions of the Software.
79
+
80
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
81
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
82
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
83
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
84
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
85
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
86
+ SOFTWARE.
87
+
88
+
89
+ @pnpm/ramda 0.28.1
90
+ The MIT License (MIT)
91
+
92
+ Copyright (c) 2013-2020 Scott Sauyet and Michael Hurley
93
+
94
+ Permission is hereby granted, free of charge, to any person obtaining a copy
95
+ of this software and associated documentation files (the "Software"), to deal
96
+ in the Software without restriction, including without limitation the rights
97
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
98
+ copies of the Software, and to permit persons to whom the Software is
99
+ furnished to do so, subject to the following conditions:
100
+
101
+ The above copyright notice and this permission notice shall be included in
102
+ all copies or substantial portions of the Software.
103
+
104
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
105
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
106
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
107
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
108
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
109
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
110
+ THE SOFTWARE.
111
+
112
+
113
+ graceful-fs 4.2.11
114
+ The ISC License
115
+
116
+ Copyright (c) 2011-2022 Isaac Z. Schlueter, Ben Noordhuis, and Contributors
117
+
118
+ Permission to use, copy, modify, and/or distribute this software for any
119
+ purpose with or without fee is hereby granted, provided that the above
120
+ copyright notice and this permission notice appear in all copies.
121
+
122
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
123
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
124
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
125
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
126
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
127
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
128
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
129
+
130
+
131
+ is-windows 1.0.2
132
+ The MIT License (MIT)
133
+
134
+ Copyright (c) 2015-2018, Jon Schlinkert.
135
+
136
+ Permission is hereby granted, free of charge, to any person obtaining a copy
137
+ of this software and associated documentation files (the "Software"), to deal
138
+ in the Software without restriction, including without limitation the rights
139
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
140
+ copies of the Software, and to permit persons to whom the Software is
141
+ furnished to do so, subject to the following conditions:
142
+
143
+ The above copyright notice and this permission notice shall be included in
144
+ all copies or substantial portions of the Software.
145
+
146
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
147
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
148
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
149
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
150
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
151
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
152
+ THE SOFTWARE.
153
+
154
+
155
+ js-yaml 4.3.2
156
+ (The MIT License)
157
+
158
+ Copyright (C) 2011-2015 by Vitaly Puzrin
159
+
160
+ Permission is hereby granted, free of charge, to any person obtaining a copy
161
+ of this software and associated documentation files (the "Software"), to deal
162
+ in the Software without restriction, including without limitation the rights
163
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
164
+ copies of the Software, and to permit persons to whom the Software is
165
+ furnished to do so, subject to the following conditions:
166
+
167
+ The above copyright notice and this permission notice shall be included in
168
+ all copies or substantial portions of the Software.
169
+
170
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
171
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
172
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
173
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
174
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
175
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
176
+ THE SOFTWARE.
177
+
178
+
179
+ read-yaml-file 2.1.0
180
+ MIT License
181
+
182
+ Copyright (c) 2018-2021 Zoltan Kochan <z@kochan.io>
183
+
184
+ Permission is hereby granted, free of charge, to any person obtaining a copy
185
+ of this software and associated documentation files (the "Software"), to deal
186
+ in the Software without restriction, including without limitation the rights
187
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
188
+ copies of the Software, and to permit persons to whom the Software is
189
+ furnished to do so, subject to the following conditions:
190
+
191
+ The above copyright notice and this permission notice shall be included in all
192
+ copies or substantial portions of the Software.
193
+
194
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
195
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
196
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
197
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
198
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
199
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
200
+ SOFTWARE.
201
+
202
+
203
+ strip-bom 4.0.0
204
+ MIT License
205
+
206
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
207
+
208
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
209
+
210
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
211
+
212
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Binary file
@@ -0,0 +1,3 @@
1
+ {
2
+ "cdnBaseUrl": "https://temp-1251849568.cos.ap-guangzhou.myqcloud.com/releases/finsafe"
3
+ }
@@ -0,0 +1,138 @@
1
+ import {createHash,randomUUID} from 'node:crypto';
2
+ import {existsSync,mkdirSync,mkdtempSync,readFileSync,writeFileSync} from 'node:fs';
3
+ import {join} from 'node:path';
4
+ import {execFile} from 'node:child_process';
5
+ import {fileURLToPath,pathToFileURL} from 'node:url';
6
+ import {parseArgs} from 'node:util';
7
+ import {nativeAdapter} from '../updater/native.js';
8
+
9
+ export const runtimeFiles=['finsafe.exe','finsafe-desktop.exe','finsafe-service.exe','finsafe-installer-actions.exe',
10
+ 'finsafe-uninstall.exe','finsafe_runtime_pipe.dll','finsafe_electron_launch.dll','finsafe_runtime_pipe.manifest.json'];
11
+
12
+ export function verifyPayload(bytes,sums,name) {
13
+ const matches=sums.split(/\r?\n/).map(line=>/^([a-f0-9]{64})\s+\*?(.+)$/i.exec(line))
14
+ .filter(match=>match?.[2]===name);
15
+ if(matches.length!==1) throw new Error('Expected exactly one official Windows payload checksum');
16
+ if(createHash('sha256').update(bytes).digest('hex')!==matches[0][1].toLowerCase()) throw new Error('FinSAFE payload SHA256 mismatch');
17
+ }
18
+
19
+ class DownloadFailure extends Error {}
20
+
21
+ /** Stage only verified release bytes. No setup or shared native state changes. */
22
+ export async function stageRuntime(destination,version,options={}) {
23
+ if(options.confined) throw new Error('Protected Host cannot install or prepare native FinSAFE; reopen ordinary Kilo');
24
+ if(!/^\d+\.\d+\.\d+$/.test(version)) throw new Error('A stable FinSAFE version is required');
25
+ const name=`finshield-${version}-x64-setup.exe`;
26
+ const {cdnBaseUrl}=JSON.parse(readFileSync(new URL('./download-source.json',import.meta.url),'utf8'));
27
+ const base=`${cdnBaseUrl.replace(/\/$/,'')}/releases/download/v${version}`;
28
+ async function download(url,format) {
29
+ options.signal?.throwIfAborted();
30
+ const timeout=AbortSignal.timeout(30_000);
31
+ const signal=options.signal?AbortSignal.any([options.signal,timeout]):timeout;
32
+ try {
33
+ const response=await fetch(url,{signal});
34
+ if(!response.ok) throw new DownloadFailure(`FinShield download returned HTTP ${response.status}: ${url}`);
35
+ return await response[format]();
36
+ } catch(error) {
37
+ options.signal?.throwIfAborted();
38
+ if(error instanceof SyntaxError||error instanceof DownloadFailure)throw error;
39
+ throw new DownloadFailure(`FinShield download failed: ${url}: ${error.message}`,{cause:error});
40
+ }
41
+ }
42
+ let bytes;
43
+ try {
44
+ const metadata=await download(`${base}/release.json`,'json');
45
+ const assets=metadata?.version===version&&Array.isArray(metadata.assets)
46
+ ?metadata.assets.filter(asset=>asset?.name===name&&asset.kind==='windows-installer'):[];
47
+ const asset=assets[0];
48
+ const mirrorPrefix=`finshield-${version}-x64-setup-`;
49
+ if(assets.length!==1||typeof asset.mirror_name!=='string'||!asset.mirror_name.startsWith(mirrorPrefix)
50
+ ||!(/^[a-f0-9]{32}\.exe$/).test(asset.mirror_name.slice(mirrorPrefix.length))
51
+ ||!(/^[a-f0-9]{64}$/i).test(asset.sha256)) throw new Error('Invalid FinShield release metadata for requested Windows installer');
52
+ bytes=Buffer.from(await download(`${base}/${asset.mirror_name}`,'arrayBuffer'));
53
+ verifyPayload(bytes,`${asset.sha256} ${name}`,name);
54
+ } catch(error) {
55
+ if(!(error instanceof DownloadFailure))throw error;
56
+ const github=`https://github.com/finogeeks/finsafe/releases/download/v${version}`;
57
+ try {
58
+ const [payload,sums]=await Promise.all([
59
+ download(`${github}/${name}`,'arrayBuffer'),download(`${github}/SHA256SUMS`,'text')]);
60
+ bytes=Buffer.from(payload);
61
+ verifyPayload(bytes,sums,name);
62
+ } catch(fallbackError) {
63
+ options.signal?.throwIfAborted();
64
+ throw new AggregateError([error,fallbackError],`FinShield CDN and GitHub download failed: ${error.message}; ${fallbackError.message}`);
65
+ }
66
+ }
67
+ mkdirSync(destination,{recursive:true});
68
+ const root=mkdtempSync(join(destination,version+'-'));
69
+ writeFileSync(join(root,name),bytes);
70
+ return {version,package:join(root,name)};
71
+ }
72
+
73
+ /** Run the selected full setup after admission. Native setup owns all mutations. */
74
+ export async function installRuntime(destination,version,options={}) {
75
+ if(options.confined)throw Error('Protected Host cannot install native FinSAFE');
76
+ const staged=options.staged??await stageRuntime(destination,version,options);
77
+ if(staged.version!==version)throw Error('Staged release differs from requested native target');
78
+ const packagePath=staged.package;
79
+ const operationId=randomUUID();
80
+ const request={version,package:packagePath,operation_id:operationId,
81
+ installation:options.installation || join(process.env.ProgramFiles,'FinSAFE','dsh-plugin'),
82
+ configuration:options.configuration || join(process.env.ProgramData,'FinSAFE','dsh-plugin','config'),
83
+ previousInstallation:options.previousInstallation,
84
+ candidate:options.candidate || fileURLToPath(new URL('../policy/candidate.yaml',import.meta.url)),
85
+ integration_outputs:false,self_update_enabled:false};
86
+ options.onRequest?.(request);
87
+ const result=await (options.execute || (request=>executeSetup(request,options)))(request);
88
+ if(![0,3010,1641].includes(result.code)) {
89
+ const error=new Error(`Windows setup returned ${result.code}: ${result.detail || result.stderr || ''}`);
90
+ error.setupCode=result.code;
91
+ const observed=observeSetupResult({phase:'installing'},result.resultPath);
92
+ error.result={...observed,phase:observed.nativeSetup?observed.phase:'failed',
93
+ error:observed.error||error.message,nativeSetup:observed.nativeSetup??{code:result.code}};
94
+ throw error;
95
+ }
96
+ return {executable:join(request.installation,'finsafe.exe'),yamlPath:join(request.configuration,'effective.yaml'),
97
+ configuration:request.configuration,exitCode:result.code,
98
+ resultPath:result.resultPath,retainedWorker:result.retainedWorker,rebootRequired:result.code!==0};
99
+ }
100
+
101
+ export function runProcess(executable,args,options={}) {
102
+ return new Promise((resolve,reject)=>execFile(executable,args,{...options,windowsHide:true,maxBuffer:1024*1024},(error,stdout,stderr)=>{
103
+ if(error && typeof error.code!=='number') return reject(error);
104
+ resolve({code:error?.code || 0,stdout,stderr});
105
+ }));
106
+ }
107
+
108
+ export async function executeSetup(request,{invoke}={}) {
109
+ if(request.self_update_enabled!==false) throw new Error('Plugin setup must disable FinSAFE self-update');
110
+ const call=invoke??nativeAdapter(fileURLToPath(new URL('../',import.meta.url)));
111
+ return call({action:'run_setup',request});
112
+ }
113
+
114
+ /** Native setup owns terminal outcomes. Reading one result does not retry setup or authorize. */
115
+ export function observeSetupResult(state,path) {
116
+ if(!path || !existsSync(path)) return state;
117
+ const result=JSON.parse(readFileSync(path,'utf8'));
118
+ if(!Number.isInteger(result.code) || !['completed','cancelled','failed','reboot-required'].includes(result.phase)) {
119
+ throw new Error('Invalid native setup result');
120
+ }
121
+ return {...state,...(state.phase==='installing'?{phase:result.phase,error:result.detail || undefined}:{}),nativeSetup:result};
122
+ }
123
+
124
+ export function parseRuntimeArguments(args) {
125
+ const {values}=parseArgs({args,options:Object.fromEntries(
126
+ ['downloads','installation','configuration','pwsh','local-app-data'].map(name=>[name,{type:'string'}]))});
127
+ for(const name of ['downloads','installation','configuration']) {
128
+ if(!values[name]) throw new Error(`Missing --${name}`);
129
+ }
130
+ return {destination:values.downloads,options:{installation:values.installation,
131
+ configuration:values.configuration,pwsh:values.pwsh,localAppData:values['local-app-data']}};
132
+ }
133
+
134
+ if(process.argv[1] && import.meta.url===pathToFileURL(process.argv[1]).href) {
135
+ const version=JSON.parse(readFileSync(new URL('../package.json',import.meta.url),'utf8')).version;
136
+ const {destination,options}=parseRuntimeArguments(process.argv.slice(2));
137
+ process.stdout.write(JSON.stringify(await installRuntime(destination,version,options)));
138
+ }