@x-otto/install 0.0.1-alpha.0 → 0.0.1-alpha.2

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
@@ -65,7 +65,7 @@ await manager.install('./dir', { as: 'plugin' })
65
65
  - `sanitizeSourceUrl()` — Strip credentials from stored URLs
66
66
 
67
67
  ### Registry Discovery
68
- - `RegistryClient` — Multi-source registry index fetch/cache/aggregation (RFC-201)
68
+ - `RegistryClient` — Multi-source registry index fetch/cache/aggregation
69
69
  - `parseRegistry()` — Zod-validated registry JSON parsing with fail-soft per-entry handling
70
70
 
71
71
  ## Dependencies
package/dist/index.d.ts CHANGED
@@ -2402,8 +2402,20 @@ declare class RegistryClient {
2402
2402
  });
2403
2403
  private get registriesPath();
2404
2404
  private get cacheDir();
2405
- /** 读源清单(官方源恒在首位;用户文件坏/缺时退化为仅官方源)。 */
2405
+ /** 读源清单(官方源恒在首位;用户文件坏/缺时退化为仅官方源)。不含内网源——同步场景
2406
+ * (如 `/registry remove` 参数补全)不该为一次可能的网络探测阻塞输入响应,见 `listSourcesAsync`。 */
2406
2407
  listSources(): RegistrySourceConfig[];
2408
+ /**
2409
+ * 读源清单 + 内网可达时自动追加内网官方源(RFC-341 G2)——`otto-official`(公网)恒在
2410
+ * 首位,`otto-official-internal`(内网)紧随其后(仅内网可达 + `OTTO_INTERNAL_REGISTRY_URL`
2411
+ * 已配置时才出现),随后是用户自定义源。
2412
+ *
2413
+ * 与 `listSources()` 的取舍:本方法可能触发一次网络探测(`isIntranetReachable()` 内部
2414
+ * 5 分钟缓存,非首次调用通常走缓存零延迟)——`loadAll()`/`/registry` 面板等本就是
2415
+ * 异步流程的场景改用它;纯同步场景(如参数补全建议器)继续用 `listSources()`,
2416
+ * 不因偶发探测延迟阻塞按键响应。
2417
+ */
2418
+ listSourcesAsync(): Promise<RegistrySourceConfig[]>;
2407
2419
  addSource(name: string, url: string): void;
2408
2420
  removeSource(name: string): void;
2409
2421
  /**
@@ -2412,7 +2424,9 @@ declare class RegistryClient {
2412
2424
  * - 第三方源:改写用户配置中该条目的 disabled 字段;条目不存在则抛错。
2413
2425
  */
2414
2426
  setSourceEnabled(name: string, enabled: boolean): void;
2415
- /** 拉取全部启用源(缓存优先 → fetch → 陈旧缓存降级)。坏源跳过并记 warning。 */
2427
+ /** 拉取全部启用源(缓存优先 → fetch → 陈旧缓存降级)。坏源跳过并记 warning。
2428
+ * RFC-341 G2:内网可达时自动含内网官方源(`listSourcesAsync`),公网用户/公网环境
2429
+ * 不受影响(探测目标未配置时零网络请求、零延迟,见 `isIntranetReachable` doc)。 */
2416
2430
  loadAll(): Promise<{
2417
2431
  registries: LoadedRegistry[];
2418
2432
  warnings: string[];