@qilin-agent/host-directory-picker-auto 3.1.3 → 3.1.4

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.i18n.yaml CHANGED
@@ -5,54 +5,54 @@
5
5
  /:
6
6
  en: 347a16b9a8de1f7c
7
7
  zh: 5fb4c04b69c2f947
8
- /qilin-host-directory-picker-auto:
9
- en: a92535cc73cc4544
10
- zh: 8ab5f2a3b7c904e7
11
- /qilin-host-directory-picker-auto/summary:
8
+ /qilin-agent-host-directory-picker-auto:
9
+ en: 28cce9a944c129cc
10
+ zh: e9bd702c43ad3440
11
+ /qilin-agent-host-directory-picker-auto/summary:
12
12
  en: b326093eb624a49b
13
13
  zh: 3dbf447dd3589d7c
14
- /qilin-host-directory-picker-auto/table-of-contents:
14
+ /qilin-agent-host-directory-picker-auto/table-of-contents:
15
15
  en: d152484eb41ac6b4
16
16
  zh: 09388d293f9be9cb
17
- /qilin-host-directory-picker-auto/use-this-package:
17
+ /qilin-agent-host-directory-picker-auto/use-this-package:
18
18
  en: 9ed11c3e0a03da01
19
19
  zh: ffa5e373dfc99bb8
20
- /qilin-host-directory-picker-auto/use-this-package/how-the-choice-is-made:
20
+ /qilin-agent-host-directory-picker-auto/use-this-package/how-the-choice-is-made:
21
21
  en: 85d6d6c34c3c563e
22
22
  zh: f1f30c634caf31c5
23
- /qilin-host-directory-picker-auto/use-this-package/what-you-get:
23
+ /qilin-agent-host-directory-picker-auto/use-this-package/what-you-get:
24
24
  en: 6571c17daecc1e29
25
25
  zh: d70089d67e41a32e
26
- /qilin-host-directory-picker-auto/use-this-package/pinning-an-interaction:
26
+ /qilin-agent-host-directory-picker-auto/use-this-package/pinning-an-interaction:
27
27
  en: a7e61292ef261aa8
28
28
  zh: ae8bb5a1ada21d21
29
- /qilin-host-directory-picker-auto/use-this-package/observable-failures:
29
+ /qilin-agent-host-directory-picker-auto/use-this-package/observable-failures:
30
30
  en: 764e80ffbfd4d19e
31
31
  zh: dd2f61b462023031
32
- /qilin-host-directory-picker-auto/understand-the-implementation:
32
+ /qilin-agent-host-directory-picker-auto/understand-the-implementation:
33
33
  en: 42b15ac6321706aa
34
34
  zh: 4ed0861911abaf5d
35
- /qilin-host-directory-picker-auto/understand-the-implementation/design-concept:
35
+ /qilin-agent-host-directory-picker-auto/understand-the-implementation/design-concept:
36
36
  en: abc8d3962e4580c3
37
37
  zh: 4442dde69faf680f
38
- /qilin-host-directory-picker-auto/understand-the-implementation/the-resolution-table:
38
+ /qilin-agent-host-directory-picker-auto/understand-the-implementation/the-resolution-table:
39
39
  en: 70aa594193336a2a
40
40
  zh: 9ff39c2878e8f471
41
- /qilin-host-directory-picker-auto/understand-the-implementation/source-map:
41
+ /qilin-agent-host-directory-picker-auto/understand-the-implementation/source-map:
42
42
  en: 43a0268a54380a72
43
43
  zh: a8f8cd0c3f502e6b
44
- /qilin-host-directory-picker-auto/further-exploration:
44
+ /qilin-agent-host-directory-picker-auto/further-exploration:
45
45
  en: 10161a0581f2fa65
46
46
  zh: 08181092c73b18b4
47
- /qilin-host-directory-picker-auto/model-experience:
47
+ /qilin-agent-host-directory-picker-auto/model-experience:
48
48
  en: 4cf1e8312ed3f5e6
49
49
  zh: 5410cb77865fca9e
50
- /qilin-host-directory-picker-auto/model-experience/kv-cache-effect:
50
+ /qilin-agent-host-directory-picker-auto/model-experience/kv-cache-effect:
51
51
  en: ca75c51c89c2c9b0
52
52
  zh: de54f3467ef3b9be
53
- /qilin-host-directory-picker-auto/known-limitations-and-deferred-work:
53
+ /qilin-agent-host-directory-picker-auto/known-limitations-and-deferred-work:
54
54
  en: 2caf1f412c050856
55
55
  zh: 0e71bc66bc54bbb4
56
- /qilin-host-directory-picker-auto/known-limitations-and-deferred-work/dev-note:
56
+ /qilin-agent-host-directory-picker-auto/known-limitations-and-deferred-work/dev-note:
57
57
  en: e67f633dc6fe7773
58
58
  zh: 3bb0c20c93f16f98
package/lib/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { launchEnvironmentOf, launchedThroughSsh } from "@qilin-agent/launch-environment";
2
2
  import { accessSync, constants } from "node:fs";
3
3
  import { delimiter, join } from "node:path";
4
+ import { isLoopbackHost } from "@qilin-agent/host-webserver";
4
5
  //#region lib/types/probe.js
5
6
  /**
6
7
  * PATH probe for the native backend's Linux chooser binaries: one boot-time
@@ -51,7 +52,7 @@ const present = (value) => value !== void 0 && value !== "";
51
52
  /**
52
53
  * Resolve which backend serves this boot. `native` requires every signal that
53
54
  * the operator can see the host display and the native backend can serve it:
54
- * a loopback-only bind (an all-interfaces bind admits remote browsers no OS
55
+ * a loopback bind (any other bind admits remote browsers no OS
55
56
  * chooser can reach), no SSH launch (under SSH port-forwarding the chooser
56
57
  * would open on the unattended server), and a servable display session —
57
58
  * assumed on darwin/win32, requiring `DISPLAY`/`WAYLAND_DISPLAY` plus a
@@ -62,7 +63,7 @@ const present = (value) => value !== void 0 && value !== "";
62
63
  * @returns the backend kind to mount.
63
64
  */
64
65
  function resolveDirectoryPickerBackend(facts) {
65
- if (facts.bindHost !== "127.0.0.1") return "browse";
66
+ if (!isLoopbackHost(facts.bindHost)) return "browse";
66
67
  if (facts.ssh) return "browse";
67
68
  if (facts.platform === "darwin" || facts.platform === "win32") return "native";
68
69
  if (facts.platform !== "linux" || !facts.linuxChooser) return "browse";
@@ -5,14 +5,14 @@
5
5
  * stable for the service lifetime as the seam requires.
6
6
  * @module @qilin-agent/host-directory-picker-auto/resolve
7
7
  */
8
- import type { Config as HttpServerConfig } from '@qilin-agent/host-webserver';
8
+ import { type Config as HttpServerConfig } from '@qilin-agent/host-webserver';
9
9
  /** Concrete interaction backend the resolver chooses between. */
10
10
  export type DirectoryPickerBackendKind = 'native' | 'browse';
11
11
  /** Environment keys the resolution reads (a `process.env` subset). */
12
12
  export type DirectoryPickerEnv = Readonly<Partial<Record<'DISPLAY' | 'WAYLAND_DISPLAY', string>>>;
13
13
  /** Host facts the backend choice is a pure function of, sampled once at boot. */
14
14
  export interface DirectoryPickerHostFacts {
15
- /** Effective webserver bind host (the schema's closed loopback/all-interfaces union). */
15
+ /** Effective webserver bind host: one concrete interface literal the webserver accepted. */
16
16
  bindHost: HttpServerConfig['host'];
17
17
  /** Host process platform. */
18
18
  platform: NodeJS.Platform;
@@ -26,7 +26,7 @@ export interface DirectoryPickerHostFacts {
26
26
  /**
27
27
  * Resolve which backend serves this boot. `native` requires every signal that
28
28
  * the operator can see the host display and the native backend can serve it:
29
- * a loopback-only bind (an all-interfaces bind admits remote browsers no OS
29
+ * a loopback bind (any other bind admits remote browsers no OS
30
30
  * chooser can reach), no SSH launch (under SSH port-forwarding the chooser
31
31
  * would open on the unattended server), and a servable display session —
32
32
  * assumed on darwin/win32, requiring `DISPLAY`/`WAYLAND_DISPLAY` plus a
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qilin-agent/host-directory-picker-auto",
3
3
  "description": "Adaptive chooser of the directory-picker seam: resolves the host situation at boot and mounts the native or browse backend for the QiLin web GUI host",
4
- "version": "3.1.3",
4
+ "version": "3.1.4",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -30,26 +30,26 @@
30
30
  ],
31
31
  "license": "MIT",
32
32
  "peerDependencies": {
33
- "@qilin-agent/kylin-plugin-loader": "~1.0.4",
34
33
  "@qilin-agent/kylin": "~4.0.3",
35
- "@qilin-agent/client-ui-directory-picker-browse": "3.1.3",
36
- "@qilin-agent/host-directory-picker-browse": "3.1.3",
37
- "@qilin-agent/client-ui-directory-picker-native": "3.1.3",
38
- "@qilin-agent/host-directory-picker-native": "3.1.3",
39
- "@qilin-agent/host-webserver": "3.1.3"
34
+ "@qilin-agent/kylin-plugin-loader": "~1.0.4",
35
+ "@qilin-agent/client-ui-directory-picker-browse": "3.1.4",
36
+ "@qilin-agent/host-directory-picker-native": "3.1.4",
37
+ "@qilin-agent/host-directory-picker-browse": "3.1.4",
38
+ "@qilin-agent/client-ui-directory-picker-native": "3.1.4",
39
+ "@qilin-agent/host-webserver": "3.1.4"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@qilin-agent/kylin": "~4.0.3",
43
- "@qilin-agent/kylin-plugin-loader": "~1.0.4",
44
- "@qilin-agent/client-ui-directory-picker-browse": "3.1.3",
45
- "@qilin-agent/client-ui-directory-picker-native": "3.1.3",
46
- "@qilin-agent/host-directory-picker-browse": "3.1.3",
47
- "@qilin-agent/host-directory-picker": "3.1.3",
48
43
  "@qilin-agent/kylin-plugin-include": "~1.0.8",
49
- "@qilin-agent/host-directory-picker-native": "3.1.3",
50
- "@qilin-agent/host-webserver": "3.1.3"
44
+ "@qilin-agent/client-ui-directory-picker-browse": "3.1.4",
45
+ "@qilin-agent/kylin-plugin-loader": "~1.0.4",
46
+ "@qilin-agent/client-ui-directory-picker-native": "3.1.4",
47
+ "@qilin-agent/host-directory-picker-browse": "3.1.4",
48
+ "@qilin-agent/host-directory-picker": "3.1.4",
49
+ "@qilin-agent/host-directory-picker-native": "3.1.4",
50
+ "@qilin-agent/host-webserver": "3.1.4"
51
51
  },
52
52
  "dependencies": {
53
- "@qilin-agent/launch-environment": "3.1.3"
53
+ "@qilin-agent/launch-environment": "3.1.4"
54
54
  }
55
55
  }