kokorobox-native 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,7 +46,7 @@ The full TypeScript declarations are shipped in
46
46
  | macOS application routing | `applyMacosApplicationRouting`, `getMacosApplicationRoutingStatus`, `stopMacosApplicationRouting`, `openMacosApplicationRoutingSettings` |
47
47
  | Core permissions | `getCorePrivilegeStatus`, `setCorePrivileges` |
48
48
  | Privileged operations | `runServiceLifecycleElevated`, `cleanupLegacyMacosService`, `stopMacosManagedService`, `repairManagedFilePermissions` |
49
- | Windows | `getCurrentUserSid`, `isRunningAsAdmin`, `relaunchCurrentApplicationWithPrivilege`, `setupFirewallRules` |
49
+ | Windows | `getCurrentUserSid`, `isRunningAsAdmin`, `relaunchCurrentApplicationWithPrivilege`, `ensureKokoroBoxCoreFirewall` |
50
50
 
51
51
  `inspectApplication` validates the input for the current platform and resolves
52
52
  it to a routing identifier: an executable path on Windows and Linux, or a code
@@ -59,6 +59,10 @@ list.
59
59
  tools. It returns canonical paths for stable deduplication; prefix matching is
60
60
  available only when explicitly requested.
61
61
 
62
+ `ensureKokoroBoxCoreFirewall` accepts the two Mihomo executable paths and the
63
+ KokoroBox application path. Native fixes the three rule names and validates
64
+ the executable basenames before changing Windows Firewall state.
65
+
62
66
  `fileToStr` converts a rule file and returns each generated output keyed by its
63
67
  behavior, metadata for those outputs, and rules that were skipped. Its optional
64
68
  `RuleConvertOptions` accepts Mihomo, General, Egern, and sing-box targets and
@@ -108,7 +112,6 @@ support than the package itself:
108
112
 
109
113
  | Capability | Supported platforms |
110
114
  | --- | --- |
111
- | `networkDnsMutation` | macOS |
112
115
  | `serviceLifecycle` | Windows, macOS, Linux |
113
116
  | `managedFilePermissions` | macOS, Linux |
114
117
  | `windowsPrivilegeRelaunch` | Windows |
package/index.d.ts CHANGED
@@ -1,8 +1,3 @@
1
- export interface FirewallRule {
2
- name: string;
3
- applicationPath: string;
4
- }
5
-
6
1
  export interface UwpLoopbackApp {
7
2
  sid: string;
8
3
  packageName: string;
@@ -20,7 +15,6 @@ export interface NativeCapabilities {
20
15
  launchAtLogin: boolean;
21
16
  networkContext: boolean;
22
17
  networkMonitor: boolean;
23
- networkDnsMutation: boolean;
24
18
  serviceLifecycle: boolean;
25
19
  managedFilePermissions: boolean;
26
20
  macosServiceManagement: boolean;
@@ -29,6 +23,7 @@ export interface NativeCapabilities {
29
23
  windowsUwpLoopback: boolean;
30
24
  coreFilePrivileges: boolean;
31
25
  serviceIdentity: boolean;
26
+ linuxTerminalProxy: boolean;
32
27
  }
33
28
 
34
29
  export interface ExecutableSearchOptions {
@@ -188,6 +183,10 @@ export function fileToStr(
188
183
  ): RuleStringResult;
189
184
  export function getAppName(path: string): string;
190
185
  export function getNativeCapabilities(): NativeCapabilities;
186
+ /** Write KokoroBox's Linux user-session proxy file and update systemd --user over D-Bus. */
187
+ export function setTerminalProxyEnvironment(host: string, port: number, bypass: string[]): Promise<boolean>;
188
+ /** Remove only KokoroBox's Linux user-session proxy file and clear its session variables. */
189
+ export function clearTerminalProxyEnvironment(): Promise<boolean | null>;
191
190
  /** Resolve the executable shipped beside the current platform binding. */
192
191
  export function getTrafficPresenterPath(): string;
193
192
  export function findExecutables(options: ExecutableSearchOptions): Promise<ExecutableCandidate[]>;
@@ -197,8 +196,6 @@ export function setLaunchAtLogin(
197
196
  enabled: boolean,
198
197
  ): Promise<LaunchAtLoginStatus>;
199
198
  export function getNetworkContext(): Promise<NetworkContext>;
200
- /** Set DNS on the active macOS network service; [] restores automatic DNS. */
201
- export function setActiveNetworkDns(servers: string[]): Promise<void>;
202
199
  /** Resolve when the native network snapshot changes, or `undefined` on timeout. */
203
200
  export function waitForNetworkContextChange(
204
201
  previous: NetworkContext,
@@ -292,6 +289,10 @@ export function scanWindowsApplications(
292
289
  ): Promise<ApplicationScanResult>;
293
290
  export function getCurrentUserSid(): string;
294
291
  export function isRunningAsAdmin(): boolean;
295
- export function setupFirewallRules(rules: FirewallRule[]): void;
292
+ export function ensureKokoroBoxCoreFirewall(
293
+ mihomoPath: string,
294
+ mihomoAlphaPath: string,
295
+ applicationPath: string,
296
+ ): void;
296
297
  export function listUwpLoopbackApps(): UwpLoopbackApp[];
297
298
  export function setUwpLoopbackExemption(sid: string, enabled: boolean): void;
package/index.js CHANGED
@@ -100,11 +100,12 @@ export const fileToDataUrl = nativeBinding.fileToDataUrl;
100
100
  export const fileToStr = nativeBinding.fileToStr;
101
101
  export const getAppName = nativeBinding.getAppName;
102
102
  export const getNativeCapabilities = nativeBinding.getNativeCapabilities;
103
+ export const setTerminalProxyEnvironment = nativeBinding.setTerminalProxyEnvironment;
104
+ export const clearTerminalProxyEnvironment = nativeBinding.clearTerminalProxyEnvironment;
103
105
  export const findExecutables = nativeBinding.findExecutables;
104
106
  export const getLaunchAtLogin = nativeBinding.getLaunchAtLogin;
105
107
  export const setLaunchAtLogin = nativeBinding.setLaunchAtLogin;
106
108
  export const getNetworkContext = nativeBinding.getNetworkContext;
107
- export const setActiveNetworkDns = nativeBinding.setActiveNetworkDns;
108
109
  export const waitForNetworkContextChange = nativeBinding.waitForNetworkContextChange;
109
110
  export const getMacosManagedServiceStatus = nativeBinding.getMacosManagedServiceStatus;
110
111
  export const registerMacosManagedService = nativeBinding.registerMacosManagedService;
@@ -126,7 +127,7 @@ export const inspectApplication = nativeBinding.inspectApplication;
126
127
  export const scanWindowsApplications = nativeBinding.scanWindowsApplications;
127
128
  export const getCurrentUserSid = nativeBinding.getCurrentUserSid;
128
129
  export const isRunningAsAdmin = nativeBinding.isRunningAsAdmin;
129
- export const setupFirewallRules = nativeBinding.setupFirewallRules;
130
+ export const ensureKokoroBoxCoreFirewall = nativeBinding.ensureKokoroBoxCoreFirewall;
130
131
  export const listUwpLoopbackApps = nativeBinding.listUwpLoopbackApps;
131
132
  export const setUwpLoopbackExemption = nativeBinding.setUwpLoopbackExemption;
132
133
  export const ServiceIdentity = nativeBinding.ServiceIdentity;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kokorobox-native",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "KokoroBox native bridge",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -48,11 +48,11 @@
48
48
  "access": "public"
49
49
  },
50
50
  "optionalDependencies": {
51
- "kokorobox-native-win32-x64-msvc": "0.12.0",
52
- "kokorobox-native-win32-arm64-msvc": "0.12.0",
53
- "kokorobox-native-darwin-x64": "0.12.0",
54
- "kokorobox-native-darwin-arm64": "0.12.0",
55
- "kokorobox-native-linux-x64-gnu": "0.12.0",
56
- "kokorobox-native-linux-arm64-gnu": "0.12.0"
51
+ "kokorobox-native-win32-x64-msvc": "0.14.0",
52
+ "kokorobox-native-win32-arm64-msvc": "0.14.0",
53
+ "kokorobox-native-darwin-x64": "0.14.0",
54
+ "kokorobox-native-darwin-arm64": "0.14.0",
55
+ "kokorobox-native-linux-x64-gnu": "0.14.0",
56
+ "kokorobox-native-linux-arm64-gnu": "0.14.0"
57
57
  }
58
58
  }