proxylang 0.13.0 → 0.13.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
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 从一份 Profile 开始
6
6
 
7
- 安装 `proxylang`,在项目根目录创建 `proxylang.config.ts`:
7
+ 使用 Node 24(>=24.11.0)或 Node 26。安装 `proxylang`,在项目根目录创建 `proxylang.config.ts`:
8
8
 
9
9
  ```ts
10
10
  import {
@@ -2520,6 +2520,7 @@ const targetCatalog = deepFreeze([
2520
2520
  //#region src/engines/sing-box/render.ts
2521
2521
  const DIRECT = "pl-direct";
2522
2522
  const DNS = "pl-dns";
2523
+ const RULESET_DIRECT = "pl-ruleset-direct";
2523
2524
  const actionTag = (a, name) => a.type === "route" ? name(a.to) : a.type === "direct" ? DIRECT : "pl-reject";
2524
2525
  function singCondition(condition) {
2525
2526
  switch (condition.type) {
@@ -2610,14 +2611,24 @@ function singbox(plan, secret) {
2610
2611
  inbound: ["pl-dns-listener"],
2611
2612
  action: "hijack-dns"
2612
2613
  });
2613
- if (plan.nativeRuleSets.length) routing.rule_set = plan.nativeRuleSets.map((r) => ({
2614
- type: "remote",
2615
- tag: r.id,
2616
- url: r.url,
2617
- format: r.format,
2618
- update_interval: `${r.intervalSeconds}s`,
2619
- download_detour: DIRECT
2620
- }));
2614
+ if (plan.nativeRuleSets.length) {
2615
+ if (routedDns) outbounds.push({
2616
+ type: "direct",
2617
+ tag: RULESET_DIRECT,
2618
+ domain_resolver: {
2619
+ server: DNS,
2620
+ strategy: "prefer_ipv4"
2621
+ }
2622
+ });
2623
+ routing.rule_set = plan.nativeRuleSets.map((r) => ({
2624
+ type: "remote",
2625
+ tag: r.id,
2626
+ url: r.url,
2627
+ format: r.format,
2628
+ update_interval: `${r.intervalSeconds}s`,
2629
+ download_detour: routedDns ? RULESET_DIRECT : DIRECT
2630
+ }));
2631
+ }
2621
2632
  if (model.fallback.type === "reject") rules.push(singAction(model.fallback, name));
2622
2633
  else routing.final = actionTag(model.fallback, name);
2623
2634
  const config = {
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { C as definitionDiagnostic, i as targetCatalog } from "./build-B_eJXR4E.js";
2
+ import { C as definitionDiagnostic, i as targetCatalog } from "./build-LwRF2Zm0.js";
3
3
  import { pathToFileURL } from "node:url";
4
4
  import { resolve } from "node:path";
5
5
  import { lstat, open, stat } from "node:fs/promises";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as ProfileDefinitionError, T as inspectDefinition, _ as endpointSchema, a as defineBuild, b as nativeRuleSetSchema, c as dnsRulesSchema, d as tunnelSchema, f as created, g as requireKind, h as parsed, l as conditionSchema, m as inspectRecord, n as runBuild, o as secretSources, p as flatten, r as explainProfile, s as defineProfile, t as checkBuild, u as groupTestSchema, v as idSchema, w as exactDefinition, x as nodeSchema, y as matchSchema } from "./build-B_eJXR4E.js";
1
+ import { S as ProfileDefinitionError, T as inspectDefinition, _ as endpointSchema, a as defineBuild, b as nativeRuleSetSchema, c as dnsRulesSchema, d as tunnelSchema, f as created, g as requireKind, h as parsed, l as conditionSchema, m as inspectRecord, n as runBuild, o as secretSources, p as flatten, r as explainProfile, s as defineProfile, t as checkBuild, u as groupTestSchema, v as idSchema, w as exactDefinition, x as nodeSchema, y as matchSchema } from "./build-LwRF2Zm0.js";
2
2
  import { createHash } from "node:crypto";
3
3
  //#region src/authoring/resources.ts
4
4
  const builtin = (builtin) => created({ builtin }, "builtin");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proxylang",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "Composable routing policies in TypeScript with explicit platform targets",
5
5
  "homepage": "https://github.com/CorrectRoadH/proxylang#readme",
6
6
  "bugs": {
@@ -57,7 +57,7 @@
57
57
  "vite": "npm:@voidzero-dev/vite-plus-core@1.3.0"
58
58
  },
59
59
  "engines": {
60
- "node": ">=24.11.0 <25"
60
+ "node": ">=24.11.0 <25 || >=26.0.0 <27"
61
61
  },
62
62
  "packageManager": "npm@11.12.1"
63
63
  }