oasis_test 0.1.82 → 0.1.83

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.
@@ -18,26 +18,32 @@
18
18
  set -euo pipefail
19
19
 
20
20
  # Resolve the real binary path (avoid recursion into self).
21
- # If ${OASIS_BIN_VAR} is already set (injected by inject()), use it.
22
- # Otherwise, scan PATH for the first executable that isn't this wrapper.
21
+ # If ${OASIS_BIN_VAR} is already set (injected by inject()), use it — unless it points
22
+ # back at this very wrapper. Otherwise scan PATH for the first executable that isn't us.
23
23
  oasis_resolve_bin() {
24
24
  local bin_var="${OASIS_BIN_VAR:?OASIS_BIN_VAR must be set}"
25
25
  local cmd_name="${OASIS_CMD_NAME:?OASIS_CMD_NAME must be set}"
26
26
 
27
- # If already set by inject() AND executable on THIS machine, skip PATH scan.
28
- # ${OASIS_BIN_VAR} (LARK_BIN/GH_BIN) is resolved server-side via `which`; on a remote
29
- # node the real binary may live at a different path than the server's. Don't blindly
30
- # exec a stale/non-existent path fall through to the PATH scan below (which skips
31
- # this wrapper to avoid recursion) so a node-local install is still found.
32
- if [ -n "${!bin_var:-}" ] && [ -x "${!bin_var:-}" ]; then
27
+ local SELF
28
+ SELF="$(realpath "$0" 2>/dev/null || echo "$0")"
29
+
30
+ # If already set by inject() AND executable on THIS machine, skip the PATH scan
31
+ # but **only if it isn't this wrapper itself**.
32
+ #
33
+ # 为什么要查自指(2026-08-03 实测踩到):inject() 用 `which <cmd>` 在 **daemon 进程的
34
+ # PATH** 下解析真实二进制,而 daemon 的 PATH 可能被 agent 会话的 wrapper 目录污染
35
+ # (`oasis daemon start` 会把当时 shell 的 PATH 固化进 systemd unit;在 agent 会话里
36
+ # 触发更新就会把 /tmp/oasis-conn-* 带进去)。于是 GH_BIN 指向 wrapper 自己 →
37
+ # 这里的快路径直接 return → 后面 exec "$GH_BIN" 就是无限递归调用自身。
38
+ # 症状还特别误导:递归被 oasis_check_available 拦下,报的是「cli is upgrading」。
39
+ if [ -n "${!bin_var:-}" ] && [ -x "${!bin_var:-}" ] \
40
+ && [ "$(realpath "${!bin_var}" 2>/dev/null)" != "$SELF" ]; then
33
41
  return 0
34
42
  fi
35
- # Stale/non-executable injected path: clear it so the PATH scan can repopulate cleanly.
43
+ # / 不可执行 / 指向自己:清掉,让下面的 PATH 扫描重新填。
36
44
  unset "$bin_var" 2>/dev/null || true
37
45
 
38
46
  # Fallback: scan PATH for real binary (skip self to avoid recursion)
39
- local SELF
40
- SELF="$(realpath "$0" 2>/dev/null || echo "$0")"
41
47
  local candidate
42
48
  while IFS= read -r dir; do
43
49
  candidate="$dir/$cmd_name"
@@ -55,13 +61,21 @@ oasis_check_available() {
55
61
  local bin_var="${OASIS_BIN_VAR:?OASIS_BIN_VAR must be set}"
56
62
  local bin_path="${!bin_var:-}"
57
63
 
64
+ # 报错要分流:说清是「PATH 上根本没有真实 CLI」还是「找到了但跑不起来」。
65
+ # 旧实现两种都打「cli is upgrading, try again in 30 seconds」——那句话在真正的
66
+ # 升级窗口里是对的,但在「PATH 被污染、解析到 wrapper 自己」时纯属误导:等多久都不会好。
58
67
  if [ -z "$bin_path" ]; then
59
- echo "error: The requested cli is upgrading, please try again in 30 seconds." >&2
68
+ echo "error: ${OASIS_CMD_NAME:-cli} not found on PATH 连接器需要的真实 CLI 未安装,或 PATH 上只剩 oasis wrapper。" >&2
69
+ exit 1
70
+ fi
71
+
72
+ if [ ! -x "$bin_path" ]; then
73
+ echo "error: ${OASIS_BIN_VAR} 指向的 $bin_path 不可执行。" >&2
60
74
  exit 1
61
75
  fi
62
76
 
63
- if [ ! -x "$bin_path" ] || ! "$bin_path" --version >/dev/null 2>&1; then
64
- echo "error: The requested cli is upgrading, please try again in 30 seconds." >&2
77
+ if ! "$bin_path" --version >/dev/null 2>&1; then
78
+ echo "error: $bin_path --version 失败——真实 CLI 可能正在升级,30 秒后重试;若持续失败请检查该路径是否指向 oasis wrapper 自身。" >&2
65
79
  exit 1
66
80
  fi
67
81
  }
package/dist/index.js CHANGED
@@ -1794,9 +1794,9 @@ function resolveNodeRef(ref2, candidates) {
1794
1794
  const hit = candidates.find((n) => n.id === r);
1795
1795
  return hit ? { ok: true, id: hit.id } : { ok: false, reason: "not_found" };
1796
1796
  }
1797
- const sep3 = r.indexOf(":");
1798
- const type = (sep3 >= 0 ? r.slice(0, sep3) : r).trim().toLowerCase();
1799
- const title = sep3 >= 0 ? r.slice(sep3 + 1).trim().toLowerCase() : null;
1797
+ const sep4 = r.indexOf(":");
1798
+ const type = (sep4 >= 0 ? r.slice(0, sep4) : r).trim().toLowerCase();
1799
+ const title = sep4 >= 0 ? r.slice(sep4 + 1).trim().toLowerCase() : null;
1800
1800
  const matches = candidates.filter((n) => n.type.toLowerCase() === type && (title === null || (n.title ?? "").toLowerCase() === title));
1801
1801
  if (matches.length === 0) return { ok: false, reason: "not_found" };
1802
1802
  if (matches.length === 1) return { ok: true, id: matches[0].id };
@@ -6562,8 +6562,8 @@ var init_dispatcher = __esm({
6562
6562
  /** 从 produce jobKey 解析 artifactId:`produce::<artifactId>` 或 `produce::<artifactId>::<part>`。 */
6563
6563
  artifactIdFromJobKey(jobKey) {
6564
6564
  const rest = jobKey.slice(jobKey.indexOf("::") + 2);
6565
- const sep3 = rest.indexOf("::");
6566
- return sep3 >= 0 ? rest.slice(0, sep3) : rest;
6565
+ const sep4 = rest.indexOf("::");
6566
+ return sep4 >= 0 ? rest.slice(0, sep4) : rest;
6567
6567
  }
6568
6568
  /**
6569
6569
  * 某节点的派发器运行时信号(stuckDiagnosis 的非 oplog 那半;proposal 协调者阻塞诊断 D1)。
@@ -139424,9 +139424,9 @@ function agentEdgesFor(dependsOn, nodes, briefId, issues) {
139424
139424
  edges.add(briefId);
139425
139425
  continue;
139426
139426
  }
139427
- const sep3 = d.indexOf(":");
139428
- const depType = (sep3 >= 0 ? d.slice(0, sep3) : d).trim().toLowerCase();
139429
- const depTitle = sep3 >= 0 ? d.slice(sep3 + 1).trim().toLowerCase() : null;
139427
+ const sep4 = d.indexOf(":");
139428
+ const depType = (sep4 >= 0 ? d.slice(0, sep4) : d).trim().toLowerCase();
139429
+ const depTitle = sep4 >= 0 ? d.slice(sep4 + 1).trim().toLowerCase() : null;
139430
139430
  const match = nodes.find((n) => n.type === depType && (depTitle === null || (n.title ?? "").toLowerCase() === depTitle));
139431
139431
  if (match) edges.add(match.id);
139432
139432
  else issues.push({ code: "planner_invalid", severity: "warning", message: `\u8282\u70B9\u4F9D\u8D56\u300C${dep}\u300D\u627E\u4E0D\u5230\u5BF9\u5E94\u4E0A\u6E38\uFF08\u6309 type:title \u5339\u914D\uFF09\uFF0C\u5DF2\u5FFD\u7565\u8FD9\u6761\u8FB9\u3002` });
@@ -140764,6 +140764,13 @@ function resolveWrapperScript(wrapperDir, slug6) {
140764
140764
  }
140765
140765
  return null;
140766
140766
  }
140767
+ function isOasisWrapperPath(p2) {
140768
+ try {
140769
+ return (0, import_node_fs2.realpathSync)(p2).endsWith(`${import_node_path.sep}wrapper.sh`);
140770
+ } catch {
140771
+ return false;
140772
+ }
140773
+ }
140767
140774
  function wrapperCandidates(wrapperDir, slug6) {
140768
140775
  const override = process.env[ASSETS_DIR_ENV];
140769
140776
  if (override) return [(0, import_node_path.resolve)(override, slug6, "wrapper.sh")];
@@ -141061,13 +141068,27 @@ var init_cli_connector = __esm({
141061
141068
  }
141062
141069
  }
141063
141070
  /**
141064
- * 用 `which` 解析真实二进制的绝对路径;找不到就原样返回命令名。
141065
- * 必须在**跑 agent 的那台机器**上解析——server 侧算出的路径在远程节点上并不存在。
141071
+ * 用 `which -a` 解析真实二进制的绝对路径,**跳过 oasis 自己 stage 出来的 wrapper**;
141072
+ * 一个都没有就原样返回命令名。必须在**跑 agent 的那台机器**上解析——server 侧算出的
141073
+ * 路径在远程节点上并不存在。
141074
+ *
141075
+ * 为什么要跳过 wrapper(2026-08-03 实测踩到):`which` 吃的是**本进程的 PATH**,而
141076
+ * daemon 的 PATH 可能被 agent 会话的 wrapper 目录污染(`oasis daemon start` 把当时
141077
+ * shell 的 PATH 固化进 systemd unit——在 agent 会话里触发更新就会带进 /tmp/oasis-conn-*)。
141078
+ * 裸 `which gh` 于是解析到 wrapper 自己,注入的 GH_BIN 指回 wrapper,wrapper 再 exec
141079
+ * 它 → 无限递归。节点侧已在 daemon 启动时清洗 PATH,这里是第二道闸:
141080
+ * **解析结果一旦是我们自己的 wrapper 就继续往后找。**
141066
141081
  */
141067
141082
  async resolveRealBin(name) {
141068
141083
  try {
141069
- const { stdout } = await execFile3("which", [name]);
141070
- return stdout.trim();
141084
+ const { stdout } = await execFile3("which", ["-a", name]);
141085
+ for (const line of stdout.split("\n")) {
141086
+ const candidate = line.trim();
141087
+ if (!candidate) continue;
141088
+ if (isOasisWrapperPath(candidate)) continue;
141089
+ return candidate;
141090
+ }
141091
+ return name;
141071
141092
  } catch {
141072
141093
  return name;
141073
141094
  }
@@ -141618,7 +141639,10 @@ var init_github = __esm({
141618
141639
  "GIT_AUTHOR_EMAIL",
141619
141640
  "GIT_COMMITTER_NAME",
141620
141641
  "GIT_COMMITTER_EMAIL",
141621
- "EMAIL"
141642
+ "EMAIL",
141643
+ "GIT_CONFIG_COUNT",
141644
+ "GIT_CONFIG_KEY_0",
141645
+ "GIT_CONFIG_VALUE_0"
141622
141646
  ];
141623
141647
  /** 自检:问 GitHub「我是谁」——这是唯一能戳穿「静默用成宿主机身份」的检查。 */
141624
141648
  verifyArgs = ["api", "user", "--jq", ".login"];
@@ -141658,6 +141682,9 @@ var init_github = __esm({
141658
141682
  sessionEnv.set("GIT_COMMITTER_NAME", name);
141659
141683
  sessionEnv.set("GIT_COMMITTER_EMAIL", "");
141660
141684
  sessionEnv.set("EMAIL", "");
141685
+ sessionEnv.set("GIT_CONFIG_COUNT", "1");
141686
+ sessionEnv.set("GIT_CONFIG_KEY_0", "credential.https://github.com.helper");
141687
+ sessionEnv.set("GIT_CONFIG_VALUE_0", "!gh auth git-credential");
141661
141688
  }
141662
141689
  };
141663
141690
  }
@@ -149711,10 +149738,10 @@ function createTokenIssuer(opts = {}) {
149711
149738
  if (revoked.has(token)) return null;
149712
149739
  if (!token.startsWith(SESSION_TOKEN_PREFIX)) return null;
149713
149740
  const encoded = token.slice(SESSION_TOKEN_PREFIX.length);
149714
- const sep3 = encoded.indexOf(".");
149715
- if (sep3 <= 0) return null;
149716
- const payload = encoded.slice(0, sep3);
149717
- const actualSig = encoded.slice(sep3 + 1);
149741
+ const sep4 = encoded.indexOf(".");
149742
+ if (sep4 <= 0) return null;
149743
+ const payload = encoded.slice(0, sep4);
149744
+ const actualSig = encoded.slice(sep4 + 1);
149718
149745
  const expectedSig = sign(secret, payload);
149719
149746
  if (!signatureMatches(actualSig, expectedSig)) return null;
149720
149747
  let claims;
@@ -170517,10 +170544,10 @@ var require_resolve_block_map = __commonJS({
170517
170544
  let offset = bm.offset;
170518
170545
  let commentEnd = null;
170519
170546
  for (const collItem of bm.items) {
170520
- const { start, key, sep: sep3, value: value2 } = collItem;
170547
+ const { start, key, sep: sep4, value: value2 } = collItem;
170521
170548
  const keyProps = resolveProps.resolveProps(start, {
170522
170549
  indicator: "explicit-key-ind",
170523
- next: key ?? sep3?.[0],
170550
+ next: key ?? sep4?.[0],
170524
170551
  offset,
170525
170552
  onError,
170526
170553
  parentIndent: bm.indent,
@@ -170534,7 +170561,7 @@ var require_resolve_block_map = __commonJS({
170534
170561
  else if ("indent" in key && key.indent !== bm.indent)
170535
170562
  onError(offset, "BAD_INDENT", startColMsg);
170536
170563
  }
170537
- if (!keyProps.anchor && !keyProps.tag && !sep3) {
170564
+ if (!keyProps.anchor && !keyProps.tag && !sep4) {
170538
170565
  commentEnd = keyProps.end;
170539
170566
  if (keyProps.comment) {
170540
170567
  if (map.comment)
@@ -170558,7 +170585,7 @@ var require_resolve_block_map = __commonJS({
170558
170585
  ctx.atKey = false;
170559
170586
  if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
170560
170587
  onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
170561
- const valueProps = resolveProps.resolveProps(sep3 ?? [], {
170588
+ const valueProps = resolveProps.resolveProps(sep4 ?? [], {
170562
170589
  indicator: "map-value-ind",
170563
170590
  next: value2,
170564
170591
  offset: keyNode.range[2],
@@ -170574,7 +170601,7 @@ var require_resolve_block_map = __commonJS({
170574
170601
  if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
170575
170602
  onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
170576
170603
  }
170577
- const valueNode = value2 ? composeNode(ctx, value2, valueProps, onError) : composeEmptyNode(ctx, offset, sep3, null, valueProps, onError);
170604
+ const valueNode = value2 ? composeNode(ctx, value2, valueProps, onError) : composeEmptyNode(ctx, offset, sep4, null, valueProps, onError);
170578
170605
  if (ctx.schema.compat)
170579
170606
  utilFlowIndentCheck.flowIndentCheck(bm.indent, value2, onError);
170580
170607
  offset = valueNode.range[2];
@@ -170665,7 +170692,7 @@ var require_resolve_end = __commonJS({
170665
170692
  let comment = "";
170666
170693
  if (end) {
170667
170694
  let hasSpace = false;
170668
- let sep3 = "";
170695
+ let sep4 = "";
170669
170696
  for (const token of end) {
170670
170697
  const { source, type } = token;
170671
170698
  switch (type) {
@@ -170679,13 +170706,13 @@ var require_resolve_end = __commonJS({
170679
170706
  if (!comment)
170680
170707
  comment = cb;
170681
170708
  else
170682
- comment += sep3 + cb;
170683
- sep3 = "";
170709
+ comment += sep4 + cb;
170710
+ sep4 = "";
170684
170711
  break;
170685
170712
  }
170686
170713
  case "newline":
170687
170714
  if (comment)
170688
- sep3 += source;
170715
+ sep4 += source;
170689
170716
  hasSpace = true;
170690
170717
  break;
170691
170718
  default:
@@ -170728,18 +170755,18 @@ var require_resolve_flow_collection = __commonJS({
170728
170755
  let offset = fc.offset + fc.start.source.length;
170729
170756
  for (let i = 0; i < fc.items.length; ++i) {
170730
170757
  const collItem = fc.items[i];
170731
- const { start, key, sep: sep3, value: value2 } = collItem;
170758
+ const { start, key, sep: sep4, value: value2 } = collItem;
170732
170759
  const props = resolveProps.resolveProps(start, {
170733
170760
  flow: fcName,
170734
170761
  indicator: "explicit-key-ind",
170735
- next: key ?? sep3?.[0],
170762
+ next: key ?? sep4?.[0],
170736
170763
  offset,
170737
170764
  onError,
170738
170765
  parentIndent: fc.indent,
170739
170766
  startOnNewline: false
170740
170767
  });
170741
170768
  if (!props.found) {
170742
- if (!props.anchor && !props.tag && !sep3 && !value2) {
170769
+ if (!props.anchor && !props.tag && !sep4 && !value2) {
170743
170770
  if (i === 0 && props.comma)
170744
170771
  onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
170745
170772
  else if (i < fc.items.length - 1)
@@ -170793,8 +170820,8 @@ var require_resolve_flow_collection = __commonJS({
170793
170820
  }
170794
170821
  }
170795
170822
  }
170796
- if (!isMap && !sep3 && !props.found) {
170797
- const valueNode = value2 ? composeNode(ctx, value2, props, onError) : composeEmptyNode(ctx, props.end, sep3, null, props, onError);
170823
+ if (!isMap && !sep4 && !props.found) {
170824
+ const valueNode = value2 ? composeNode(ctx, value2, props, onError) : composeEmptyNode(ctx, props.end, sep4, null, props, onError);
170798
170825
  coll.items.push(valueNode);
170799
170826
  offset = valueNode.range[2];
170800
170827
  if (isBlock(value2))
@@ -170806,7 +170833,7 @@ var require_resolve_flow_collection = __commonJS({
170806
170833
  if (isBlock(key))
170807
170834
  onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
170808
170835
  ctx.atKey = false;
170809
- const valueProps = resolveProps.resolveProps(sep3 ?? [], {
170836
+ const valueProps = resolveProps.resolveProps(sep4 ?? [], {
170810
170837
  flow: fcName,
170811
170838
  indicator: "map-value-ind",
170812
170839
  next: value2,
@@ -170817,8 +170844,8 @@ var require_resolve_flow_collection = __commonJS({
170817
170844
  });
170818
170845
  if (valueProps.found) {
170819
170846
  if (!isMap && !props.found && ctx.options.strict) {
170820
- if (sep3)
170821
- for (const st of sep3) {
170847
+ if (sep4)
170848
+ for (const st of sep4) {
170822
170849
  if (st === valueProps.found)
170823
170850
  break;
170824
170851
  if (st.type === "newline") {
@@ -170835,7 +170862,7 @@ var require_resolve_flow_collection = __commonJS({
170835
170862
  else
170836
170863
  onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
170837
170864
  }
170838
- const valueNode = value2 ? composeNode(ctx, value2, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep3, null, valueProps, onError) : null;
170865
+ const valueNode = value2 ? composeNode(ctx, value2, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep4, null, valueProps, onError) : null;
170839
170866
  if (valueNode) {
170840
170867
  if (isBlock(value2))
170841
170868
  onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
@@ -171015,7 +171042,7 @@ var require_resolve_block_scalar = __commonJS({
171015
171042
  chompStart = i + 1;
171016
171043
  }
171017
171044
  let value2 = "";
171018
- let sep3 = "";
171045
+ let sep4 = "";
171019
171046
  let prevMoreIndented = false;
171020
171047
  for (let i = 0; i < contentStart; ++i)
171021
171048
  value2 += lines[i][0].slice(trimIndent) + "\n";
@@ -171032,24 +171059,24 @@ var require_resolve_block_scalar = __commonJS({
171032
171059
  indent = "";
171033
171060
  }
171034
171061
  if (type === Scalar.Scalar.BLOCK_LITERAL) {
171035
- value2 += sep3 + indent.slice(trimIndent) + content;
171036
- sep3 = "\n";
171062
+ value2 += sep4 + indent.slice(trimIndent) + content;
171063
+ sep4 = "\n";
171037
171064
  } else if (indent.length > trimIndent || content[0] === " ") {
171038
- if (sep3 === " ")
171039
- sep3 = "\n";
171040
- else if (!prevMoreIndented && sep3 === "\n")
171041
- sep3 = "\n\n";
171042
- value2 += sep3 + indent.slice(trimIndent) + content;
171043
- sep3 = "\n";
171065
+ if (sep4 === " ")
171066
+ sep4 = "\n";
171067
+ else if (!prevMoreIndented && sep4 === "\n")
171068
+ sep4 = "\n\n";
171069
+ value2 += sep4 + indent.slice(trimIndent) + content;
171070
+ sep4 = "\n";
171044
171071
  prevMoreIndented = true;
171045
171072
  } else if (content === "") {
171046
- if (sep3 === "\n")
171073
+ if (sep4 === "\n")
171047
171074
  value2 += "\n";
171048
171075
  else
171049
- sep3 = "\n";
171076
+ sep4 = "\n";
171050
171077
  } else {
171051
- value2 += sep3 + content;
171052
- sep3 = " ";
171078
+ value2 += sep4 + content;
171079
+ sep4 = " ";
171053
171080
  prevMoreIndented = false;
171054
171081
  }
171055
171082
  }
@@ -171231,25 +171258,25 @@ var require_resolve_flow_scalar = __commonJS({
171231
171258
  if (!match)
171232
171259
  return source;
171233
171260
  let res = match[1];
171234
- let sep3 = " ";
171261
+ let sep4 = " ";
171235
171262
  let pos = first.lastIndex;
171236
171263
  line.lastIndex = pos;
171237
171264
  while (match = line.exec(source)) {
171238
171265
  if (match[1] === "") {
171239
- if (sep3 === "\n")
171240
- res += sep3;
171266
+ if (sep4 === "\n")
171267
+ res += sep4;
171241
171268
  else
171242
- sep3 = "\n";
171269
+ sep4 = "\n";
171243
171270
  } else {
171244
- res += sep3 + match[1];
171245
- sep3 = " ";
171271
+ res += sep4 + match[1];
171272
+ sep4 = " ";
171246
171273
  }
171247
171274
  pos = line.lastIndex;
171248
171275
  }
171249
171276
  const last = /[ \t]*(.*)/sy;
171250
171277
  last.lastIndex = pos;
171251
171278
  match = last.exec(source);
171252
- return res + sep3 + (match?.[1] ?? "");
171279
+ return res + sep4 + (match?.[1] ?? "");
171253
171280
  }
171254
171281
  function doubleQuotedValue(source, onError) {
171255
171282
  let res = "";
@@ -172059,14 +172086,14 @@ var require_cst_stringify = __commonJS({
172059
172086
  }
172060
172087
  }
172061
172088
  }
172062
- function stringifyItem({ start, key, sep: sep3, value: value2 }) {
172089
+ function stringifyItem({ start, key, sep: sep4, value: value2 }) {
172063
172090
  let res = "";
172064
172091
  for (const st of start)
172065
172092
  res += st.source;
172066
172093
  if (key)
172067
172094
  res += stringifyToken(key);
172068
- if (sep3)
172069
- for (const st of sep3)
172095
+ if (sep4)
172096
+ for (const st of sep4)
172070
172097
  res += st.source;
172071
172098
  if (value2)
172072
172099
  res += stringifyToken(value2);
@@ -173233,18 +173260,18 @@ var require_parser = __commonJS({
173233
173260
  if (this.type === "map-value-ind") {
173234
173261
  const prev = getPrevProps(this.peek(2));
173235
173262
  const start = getFirstKeyStartProps(prev);
173236
- let sep3;
173263
+ let sep4;
173237
173264
  if (scalar.end) {
173238
- sep3 = scalar.end;
173239
- sep3.push(this.sourceToken);
173265
+ sep4 = scalar.end;
173266
+ sep4.push(this.sourceToken);
173240
173267
  delete scalar.end;
173241
173268
  } else
173242
- sep3 = [this.sourceToken];
173269
+ sep4 = [this.sourceToken];
173243
173270
  const map = {
173244
173271
  type: "block-map",
173245
173272
  offset: scalar.offset,
173246
173273
  indent: scalar.indent,
173247
- items: [{ start, key: scalar, sep: sep3 }]
173274
+ items: [{ start, key: scalar, sep: sep4 }]
173248
173275
  };
173249
173276
  this.onKeyLine = true;
173250
173277
  this.stack[this.stack.length - 1] = map;
@@ -173397,15 +173424,15 @@ var require_parser = __commonJS({
173397
173424
  } else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
173398
173425
  const start2 = getFirstKeyStartProps(it.start);
173399
173426
  const key = it.key;
173400
- const sep3 = it.sep;
173401
- sep3.push(this.sourceToken);
173427
+ const sep4 = it.sep;
173428
+ sep4.push(this.sourceToken);
173402
173429
  delete it.key;
173403
173430
  delete it.sep;
173404
173431
  this.stack.push({
173405
173432
  type: "block-map",
173406
173433
  offset: this.offset,
173407
173434
  indent: this.indent,
173408
- items: [{ start: start2, key, sep: sep3 }]
173435
+ items: [{ start: start2, key, sep: sep4 }]
173409
173436
  });
173410
173437
  } else if (start.length > 0) {
173411
173438
  it.sep = it.sep.concat(start, this.sourceToken);
@@ -173599,13 +173626,13 @@ var require_parser = __commonJS({
173599
173626
  const prev = getPrevProps(parent);
173600
173627
  const start = getFirstKeyStartProps(prev);
173601
173628
  fixFlowSeqItems(fc);
173602
- const sep3 = fc.end.splice(1, fc.end.length);
173603
- sep3.push(this.sourceToken);
173629
+ const sep4 = fc.end.splice(1, fc.end.length);
173630
+ sep4.push(this.sourceToken);
173604
173631
  const map = {
173605
173632
  type: "block-map",
173606
173633
  offset: fc.offset,
173607
173634
  indent: fc.indent,
173608
- items: [{ start, key: fc, sep: sep3 }]
173635
+ items: [{ start, key: fc, sep: sep4 }]
173609
173636
  };
173610
173637
  this.onKeyLine = true;
173611
173638
  this.stack[this.stack.length - 1] = map;
@@ -188036,8 +188063,8 @@ exec ${JSON.stringify(tsx)} ${JSON.stringify(main)} "$@"
188036
188063
  return wrapper;
188037
188064
  }
188038
188065
  function splitIdentityFiles3(prompt) {
188039
- const sep3 = /<!-- FILE: (.+?) -->\n?/g;
188040
- const parts = prompt.split(sep3);
188066
+ const sep4 = /<!-- FILE: (.+?) -->\n?/g;
188067
+ const parts = prompt.split(sep4);
188041
188068
  if (parts.length === 1) return { "identity/AGENTS.md": prompt };
188042
188069
  const out = {};
188043
188070
  for (let i = 1; i < parts.length; i += 2) {
@@ -193807,6 +193834,14 @@ init_src5();
193807
193834
  var fs34 = __toESM(require("node:fs"));
193808
193835
  var path28 = __toESM(require("node:path"));
193809
193836
  var ASSET_EXT = ".sh";
193837
+ var SESSION_SCOPED_PREFIXES = ["oasis-conn-", "oasis-wrappers-", "oasis-cli-"];
193838
+ function sanitizeDaemonPath(rawPath) {
193839
+ return (rawPath ?? "").split(":").filter((dir) => {
193840
+ if (!dir) return false;
193841
+ const base = path28.basename(dir);
193842
+ return !SESSION_SCOPED_PREFIXES.some((p2) => base.startsWith(p2));
193843
+ }).join(":");
193844
+ }
193810
193845
  function installRuntimeAssets(srcRoot, binDir) {
193811
193846
  if (path28.resolve(srcRoot) === path28.resolve(binDir)) return 0;
193812
193847
  let copied = 0;
@@ -193847,7 +193882,7 @@ function syncRuntimeAssets(candidateRoots, binDir) {
193847
193882
  }
193848
193883
 
193849
193884
  // src/index.ts
193850
- var PKG_VERSION = true ? "0.1.82" : "dev";
193885
+ var PKG_VERSION = true ? "0.1.83" : "dev";
193851
193886
  var OASIS_DIR = path29.join(os9.homedir(), ".oasis");
193852
193887
  var CONFIG_FILE = path29.join(OASIS_DIR, "node-config.json");
193853
193888
  var PID_FILE = path29.join(OASIS_DIR, "node.pid");
@@ -193925,7 +193960,7 @@ function setupAutostart() {
193925
193960
  path29.join(home, ".local", "bin"),
193926
193961
  "/usr/local/bin"
193927
193962
  ];
193928
- const daemonPath = [process.env["PATH"] ?? "", ...extraBins].filter(Boolean).join(":");
193963
+ const daemonPath = sanitizeDaemonPath([process.env["PATH"] ?? "", ...extraBins].filter(Boolean).join(":"));
193929
193964
  if (process.platform === "linux") {
193930
193965
  const unitDir = path29.join(os9.homedir(), ".config", "systemd", "user");
193931
193966
  fs35.mkdirSync(unitDir, { recursive: true });
@@ -194071,6 +194106,11 @@ void (async () => {
194071
194106
  cleanup();
194072
194107
  process.exit(0);
194073
194108
  });
194109
+ const cleanPath = sanitizeDaemonPath(process.env["PATH"]);
194110
+ if (cleanPath !== process.env["PATH"]) {
194111
+ console.error(`[oasis] daemon PATH \u5DF2\u6E05\u6D17\uFF1A\u5254\u9664 agent \u4F1A\u8BDD\u4E34\u65F6 wrapper \u76EE\u5F55 ${(process.env["PATH"] ?? "").split(":").length - cleanPath.split(":").length} \u6761`);
194112
+ process.env["PATH"] = cleanPath;
194113
+ }
194074
194114
  try {
194075
194115
  ensureRuntimeAssets();
194076
194116
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oasis_test",
3
- "version": "0.1.82",
3
+ "version": "0.1.83",
4
4
  "description": "Oasis node daemon + CLI — background daemon, auto-start, full server CLI",
5
5
  "bin": {
6
6
  "oasis": "./dist/index.js"