@wujie-shell/core 0.1.4 → 0.1.5

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.
@@ -0,0 +1,258 @@
1
+ /**
2
+ * Wujie Shell terminal startup logo - the 无界 door morphs into a ">".
3
+ *
4
+ * Zero-dependency Node module. Renders the animation at the cursor position
5
+ * using half-block characters and truecolor ANSI (dark backgrounds).
6
+ *
7
+ * import { playWujieLogo } from "./wujie-logo.mjs";
8
+ * await playWujieLogo({ title: "WUJIE SHELL", subtitle: "v1.0.0" });
9
+ *
10
+ * CLI demo: node wujie-logo.mjs
11
+ * No-anim dump: WUJIE_LOGO_STATIC=1 node wujie-logo.mjs
12
+ */
13
+
14
+ import { readFileSync } from "node:fs";
15
+
16
+ const YELLOW = [253, 214, 2]; // #FDD602
17
+
18
+ // Bar geometry in a 100x100 box (mirrors generate.py).
19
+ // door p0 door p1 w0 chev p0 chev p1 w1 bow stagger
20
+ const BARS = {
21
+ LT: [[46, 13], [88, 19], 11, [32, 22], [76, 50], 15, 8.0, 0.0],
22
+ RJ: [[90, 25], [90, 86], 7, [76, 50], [32, 78], 15, 10.0, 0.06],
23
+ LJ: [[46, 13], [46, 94], 12, [32, 22], [32, 22], 12, -3.0, -0.04],
24
+ };
25
+ const LJ_VIA = [44, 26];
26
+ const ORDER = ["LJ", "RJ", "LT"];
27
+
28
+ const ease = (t) => {
29
+ t = Math.min(1, Math.max(0, t));
30
+ return t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
31
+ };
32
+ const spring = (t) => ease(t) + 0.06 * Math.sin(Math.PI * Math.pow(Math.min(1, t), 1.5)) * t;
33
+ const lerp = (a, b, t) => a + (b - a) * t;
34
+
35
+ function barState(name, t) {
36
+ const [p0d, p1d, w0, p0c, p1c, w1, bow, stag] = BARS[name];
37
+ const raw = Math.min(1, Math.max(0, (t - Math.max(0, stag)) / (1 - Math.abs(stag))));
38
+ const tt = ease(raw);
39
+ const ts = name === "LJ" ? tt : spring(raw);
40
+ const x0 = lerp(p0d[0], p0c[0], tt), y0 = lerp(p0d[1], p0c[1], tt);
41
+ let x1, y1;
42
+ if (name === "LJ") {
43
+ if (tt < 0.55) {
44
+ const u = tt / 0.55;
45
+ x1 = lerp(p1d[0], LJ_VIA[0], u); y1 = lerp(p1d[1], LJ_VIA[1], u);
46
+ } else {
47
+ const u = (tt - 0.55) / 0.45;
48
+ x1 = lerp(LJ_VIA[0], p1c[0], u); y1 = lerp(LJ_VIA[1], p1c[1], u);
49
+ }
50
+ } else {
51
+ x1 = lerp(p1d[0], p1c[0], ts); y1 = lerp(p1d[1], p1c[1], ts);
52
+ }
53
+ const w = lerp(w0, w1, tt);
54
+ const mx = (x0 + x1) / 2, my = (y0 + y1) / 2;
55
+ const dx = x1 - x0, dy = y1 - y0;
56
+ const ln = Math.hypot(dx, dy) || 1;
57
+ const amp = Math.sin(Math.PI * Math.min(1, Math.max(0, t))) * bow;
58
+ return { p0: [x0, y0], p1: [x1, y1], c: [mx - (dy / ln) * amp, my + (dx / ln) * amp], w };
59
+ }
60
+
61
+ function barPolyline({ p0, c, p1 }, segs = 16) {
62
+ const pts = [];
63
+ for (let i = 0; i <= segs; i++) {
64
+ const u = i / segs;
65
+ pts.push([
66
+ (1 - u) ** 2 * p0[0] + 2 * (1 - u) * u * c[0] + u ** 2 * p1[0],
67
+ (1 - u) ** 2 * p0[1] + 2 * (1 - u) * u * c[1] + u ** 2 * p1[1],
68
+ ]);
69
+ }
70
+ return pts;
71
+ }
72
+
73
+ function distToPolyline(x, y, pts) {
74
+ let best = Infinity;
75
+ for (let i = 0; i < pts.length - 1; i++) {
76
+ const [ax, ay] = pts[i], [bx, by] = pts[i + 1];
77
+ const vx = bx - ax, vy = by - ay;
78
+ const L2 = vx * vx + vy * vy || 1e-9;
79
+ const u = Math.max(0, Math.min(1, ((x - ax) * vx + (y - ay) * vy) / L2));
80
+ best = Math.min(best, Math.hypot(x - (ax + u * vx), y - (ay + u * vy)));
81
+ }
82
+ return best;
83
+ }
84
+
85
+ /** Coverage grid (px*px, values 0..1) for morph progress t. */
86
+ export function rasterize(t, px) {
87
+ const bars = ORDER.map((n) => {
88
+ const s = barState(n, t);
89
+ return { pts: barPolyline(s), hw: s.w / 2 };
90
+ });
91
+ const k = 100 / px;
92
+ const grid = [];
93
+ for (let y = 0; y < px; y++) {
94
+ const row = [];
95
+ for (let x = 0; x < px; x++) {
96
+ let cov = 0;
97
+ for (const sx of [0.25, 0.75]) {
98
+ for (const sy of [0.25, 0.75]) {
99
+ const gx = (x + sx) * k, gy = (y + sy) * k;
100
+ for (const b of bars) {
101
+ if (distToPolyline(gx, gy, b.pts) <= b.hw) { cov += 0.25; break; }
102
+ }
103
+ }
104
+ }
105
+ row.push(cov);
106
+ }
107
+ grid.push(row);
108
+ }
109
+ return grid;
110
+ }
111
+
112
+ const fg = ([r, g, b]) => `\x1b[38;2;${r};${g};${b}m`;
113
+ const bg = ([r, g, b]) => `\x1b[48;2;${r};${g};${b}m`;
114
+ const RESET = "\x1b[0m";
115
+ const DIM = "\x1b[2m";
116
+ const BOLD = "\x1b[1m";
117
+ const shade = (cov) => YELLOW.map((c) => Math.round(c * cov));
118
+
119
+ // eslint-disable-next-line no-control-regex -- 需要剥离 ANSI 转义算可见宽度
120
+ const ANSI_RE = /\x1b\[[0-9;]*m/g;
121
+ // 终端列宽:CJK 等宽字符占 2 列,否则方框右边线对不齐
122
+ function visibleWidth(s) {
123
+ let w = 0;
124
+ for (const ch of s.replace(ANSI_RE, "")) {
125
+ w +=
126
+ /[ᄀ-ᅟ⺀-꓏가-힣豈-﫿︰-﹏＀-⦆¢-₩]/.test(
127
+ ch,
128
+ )
129
+ ? 2
130
+ : 1;
131
+ }
132
+ return w;
133
+ }
134
+
135
+ /** Wrap content lines in a rounded box (Claude Code 风格欢迎框). */
136
+ export function boxLines(lines, innerWidth) {
137
+ const top = `${DIM}╭${"─".repeat(innerWidth + 2)}╮${RESET}`;
138
+ const bottom = `${DIM}╰${"─".repeat(innerWidth + 2)}╯${RESET}`;
139
+ const out = [top];
140
+ for (const line of lines) {
141
+ const pad = " ".repeat(Math.max(0, innerWidth - visibleWidth(line)));
142
+ out.push(`${DIM}│${RESET} ${line}${pad} ${DIM}│${RESET}`);
143
+ }
144
+ out.push(bottom);
145
+ return out;
146
+ }
147
+
148
+ /** Render grid to text lines using half blocks (2 px per char vertically).
149
+ * Anti-aliased: half-cell brightness follows coverage (designed for dark
150
+ * terminal themes). */
151
+ export function frameLines(grid, px, rightText = []) {
152
+ const lines = [];
153
+ for (let y = 0; y < px; y += 2) {
154
+ let line = "";
155
+ for (let x = 0; x < px; x++) {
156
+ const top = grid[y][x], bot = grid[y + 1] ? grid[y + 1][x] : 0;
157
+ if (top < 0.1 && bot < 0.1) line += " ";
158
+ else line += fg(shade(top)) + bg(shade(bot)) + "▀" + RESET;
159
+ }
160
+ const row = y / 2;
161
+ const extra = rightText[row];
162
+ if (extra) line += " " + extra;
163
+ lines.push(line);
164
+ }
165
+ return lines;
166
+ }
167
+
168
+ /**
169
+ * Play the startup animation at the current cursor position.
170
+ * Resolves when done; leaves the final chevron + title printed.
171
+ */
172
+ export async function playWujieLogo({
173
+ stream = process.stdout,
174
+ px = 20, // logo size in pixels (chars wide; half that in rows)
175
+ durationMs = 900,
176
+ fps = 30,
177
+ title = "WUJIE SHELL",
178
+ subtitle = "",
179
+ details = [], // [label, value] pairs shown under the title
180
+ box = false, // draw a rounded welcome box around the logo
181
+ animate = undefined, // default: only when TTY
182
+ } = {}) {
183
+ const rows = Math.ceil(px / 2);
184
+ const mid = Math.floor(rows / 2);
185
+ const text = [];
186
+ if (details.length > 0) {
187
+ // 有信息行时整体上移:标题置顶,信息行排在下半区
188
+ text[1] = `${BOLD}${fg(YELLOW)}${title}${RESET}`;
189
+ if (subtitle) text[2] = `${DIM}${subtitle}${RESET}`;
190
+ const labelWidth = Math.max(...details.map(([label]) => label.length));
191
+ details.forEach(([label, value], idx) => {
192
+ text[4 + idx] = `${DIM}${label.padEnd(labelWidth + 2)}${RESET}${value}`;
193
+ });
194
+ } else {
195
+ text[mid - 1] = `${BOLD}${fg(YELLOW)}${title}${RESET}`;
196
+ if (subtitle) text[mid] = `${DIM}${subtitle}${RESET}`;
197
+ }
198
+
199
+ const innerWidth =
200
+ px + Math.max(0, ...text.filter(Boolean).map((l) => 2 + visibleWidth(l)));
201
+ const decorate = (lines) => (box ? boxLines(lines, innerWidth) : lines);
202
+ const frameHeight = rows + (box ? 2 : 0);
203
+
204
+ const doAnim = animate ?? (stream.isTTY && !process.env.WUJIE_LOGO_STATIC);
205
+ const write = (s) => stream.write(s);
206
+
207
+ if (!doAnim) {
208
+ write(decorate(frameLines(rasterize(1, px), px, text)).join("\n") + "\n");
209
+ return;
210
+ }
211
+
212
+ const nFrames = Math.max(2, Math.round((durationMs / 1000) * fps));
213
+ const holdFrames = Math.round(fps * 0.25); // brief hold on the door
214
+ write("\x1b[?25l"); // hide cursor
215
+ try {
216
+ let first = true;
217
+ for (let i = -holdFrames; i <= nFrames; i++) {
218
+ const t = Math.max(0, i) / nFrames;
219
+ const lines = decorate(
220
+ frameLines(rasterize(t, px), px, i >= nFrames ? text : [])
221
+ );
222
+ if (!first) write(`\x1b[${frameHeight}A`); // cursor back up
223
+ write(lines.map((l) => "\x1b[2K" + l).join("\n") + "\n");
224
+ first = false;
225
+ if (i <= nFrames) await new Promise((r) => setTimeout(r, 1000 / fps));
226
+ }
227
+ } finally {
228
+ write("\x1b[?25h"); // show cursor
229
+ }
230
+ }
231
+
232
+ /** 启动横幅信息:模型/gateway 读 wrapper 注入的 OPENCLAW_CONFIG_PATH. */
233
+ export function readStartupDetails(env = process.env) {
234
+ let model = "";
235
+ let port = 18789;
236
+ try {
237
+ const cfg = JSON.parse(readFileSync(env.OPENCLAW_CONFIG_PATH, "utf8"));
238
+ model = cfg?.agents?.defaults?.model?.primary || "";
239
+ if (Number.isInteger(cfg?.gateway?.port)) port = cfg.gateway.port;
240
+ } catch {
241
+ // 配置缺失时仍展示横幅,只是没有模型信息
242
+ }
243
+ return [
244
+ ["Using", model || "not configured"],
245
+ ["Gateway", `ws://127.0.0.1:${port}`],
246
+ ["Version", env.WUJIE_SHELL_VERSION || "v0.01"],
247
+ ];
248
+ }
249
+
250
+ // CLI entry (wrapper 启动横幅)
251
+ if (import.meta.url === `file://${process.argv[1]}`) {
252
+ playWujieLogo({
253
+ title: "WUJIE SHELL",
254
+ subtitle: "无界 · the door is open",
255
+ details: readStartupDetails(),
256
+ box: true,
257
+ });
258
+ }
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- (function(_0x3fe431,_0x4c1610){const _0xa57b3e=_0x2818,_0x50633e=_0x3fe431();while(!![]){try{const _0x3444e2=parseInt(_0xa57b3e(0x1e5))/0x1+parseInt(_0xa57b3e(0x1e7))/0x2+-parseInt(_0xa57b3e(0x1fb))/0x3*(parseInt(_0xa57b3e(0x1f5))/0x4)+parseInt(_0xa57b3e(0x1fc))/0x5*(parseInt(_0xa57b3e(0x1fa))/0x6)+-parseInt(_0xa57b3e(0x1dd))/0x7+parseInt(_0xa57b3e(0x1fe))/0x8+parseInt(_0xa57b3e(0x1de))/0x9*(-parseInt(_0xa57b3e(0x1f6))/0xa);if(_0x3444e2===_0x4c1610)break;else _0x50633e['push'](_0x50633e['shift']());}catch(_0x3676c8){_0x50633e['push'](_0x50633e['shift']());}}}(_0x51b0,0xb6c4e));function _0x51b0(){const _0x5184d9=['help','2755900pDATiF','-shell\x20s','slice','stringif','cwd','plugins','message','jie-shel','--help','argv','stack','ntime','/.tmp/ru','project>','1483992dXZcnB','648350BFqWms','ect\x20<ui-','e\x20--proj','oject\x20<u','18pNlPqL','12GCJJgV','1474745atVbuF','project','5292976uzvEXW','sync','length','ge:\x0a\x20\x20wu','i-projec','ell\x0a\x0aUsa','Version','ync\x20--pr','t>\x0a','9532271ZiArTA','45JFMtpn','unknown\x20','wujie-sh','log','error','exit','isArray','994123qaXYys'];_0x51b0=function(){return _0x5184d9;};return _0x51b0();}function _0x2818(_0x4e5f67,_0x2e315e){_0x4e5f67=_0x4e5f67-0x1d9;const _0x51b04e=_0x51b0();let _0x2818f2=_0x51b04e[_0x4e5f67];return _0x2818f2;}import{resolve}from'node:path';import{loadShellConfig}from'@wujie-shell/config';import{prepareRuntime}from'../src/runtime.mjs';function parseArgs(_0x49b380){const _0x21f077=_0x2818,_0x3ccf92=[..._0x49b380],_0x46dfe5=_0x3ccf92['shift']()||_0x21f077(0x1e6),_0x55ae26={'project':process[_0x21f077(0x1eb)]()};for(let _0xfe4df=0x0;_0xfe4df<_0x3ccf92[_0x21f077(0x200)];_0xfe4df+=0x1){const _0x420c71=_0x3ccf92[_0xfe4df];(_0x420c71==='--projec'+'t'||_0x420c71==='-p')&&(_0x55ae26['project']=_0x3ccf92[_0xfe4df+0x1],_0xfe4df+=0x1);}return{'command':_0x46dfe5,'options':_0x55ae26};}function usage(){const _0x578eaf=_0x2818;console[_0x578eaf(0x1e1)](_0x578eaf(0x1e0)+_0x578eaf(0x1d9)+_0x578eaf(0x201)+_0x578eaf(0x1ee)+'l\x20prepar'+_0x578eaf(0x1f8)+_0x578eaf(0x1f7)+_0x578eaf(0x1f4)+'\x0a\x20\x20wujie'+_0x578eaf(0x1e8)+_0x578eaf(0x1db)+_0x578eaf(0x1f9)+_0x578eaf(0x202)+_0x578eaf(0x1dc));}async function main(){const _0x3809c7=_0x2818,{command:_0x743112,options:_0x3d08c6}=parseArgs(process[_0x3809c7(0x1f0)][_0x3809c7(0x1e9)](0x2));if(_0x743112===_0x3809c7(0x1e6)||_0x743112===_0x3809c7(0x1ef)||_0x743112==='-h'){usage();return;}if(_0x743112!=='prepare'&&_0x743112!==_0x3809c7(0x1ff))throw new Error(_0x3809c7(0x1df)+'command:'+'\x20'+_0x743112);const _0x44888f=resolve(_0x3d08c6[_0x3809c7(0x1fd)]),_0x3545c0=await loadShellConfig(_0x44888f),_0x3f3cbc=await prepareRuntime(_0x3545c0,{'syncOnly':_0x743112===_0x3809c7(0x1ff)});console[_0x3809c7(0x1e1)](JSON[_0x3809c7(0x1ea)+'y']({'ok':!![],'command':_0x743112,'projectRoot':_0x44888f,'runtimeRoot':_0x44888f+(_0x3809c7(0x1f3)+_0x3809c7(0x1f2)),'openclawVersion':_0x3f3cbc['openclaw'+_0x3809c7(0x1da)],'pluginCount':Array[_0x3809c7(0x1e4)](_0x3f3cbc[_0x3809c7(0x1ec)])?_0x3f3cbc[_0x3809c7(0x1ec)]['length']:0x0},null,0x2));}main()['catch'](_0x4aa694=>{const _0x11c0c8=_0x2818;console[_0x11c0c8(0x1e2)](_0x4aa694 instanceof Error?_0x4aa694[_0x11c0c8(0x1f1)]||_0x4aa694[_0x11c0c8(0x1ed)]:String(_0x4aa694)),process[_0x11c0c8(0x1e3)](0x1);});
2
+ function _0x525e(_0x4d99fd,_0x53d628){_0x4d99fd=_0x4d99fd-0xc5;const _0x4a178f=_0x4a17();let _0x525e29=_0x4a178f[_0x4d99fd];return _0x525e29;}(function(_0x5d62b7,_0x53b93b){const _0x366155=_0x525e,_0x252c5b=_0x5d62b7();while(!![]){try{const _0x551249=-parseInt(_0x366155(0xe9))/0x1*(-parseInt(_0x366155(0xc6))/0x2)+-parseInt(_0x366155(0xe2))/0x3+-parseInt(_0x366155(0xd3))/0x4*(-parseInt(_0x366155(0xdd))/0x5)+parseInt(_0x366155(0xdb))/0x6*(parseInt(_0x366155(0xe4))/0x7)+parseInt(_0x366155(0xcd))/0x8+parseInt(_0x366155(0xe6))/0x9+-parseInt(_0x366155(0xcf))/0xa*(parseInt(_0x366155(0xdf))/0xb);if(_0x551249===_0x53b93b)break;else _0x252c5b['push'](_0x252c5b['shift']());}catch(_0x4dcca1){_0x252c5b['push'](_0x252c5b['shift']());}}}(_0x4a17,0x864fd));import{resolve}from'node:path';import{loadShellConfig}from'@wujie-shell/config';import{prepareRuntime}from'../src/runtime.mjs';function parseArgs(_0x42f503){const _0x26c039=_0x525e,_0x128f55=[..._0x42f503],_0x2df09d=_0x128f55[_0x26c039(0xed)]()||_0x26c039(0xc9),_0x41a96c={'project':process[_0x26c039(0xd6)]()};for(let _0x2774e7=0x0;_0x2774e7<_0x128f55['length'];_0x2774e7+=0x1){const _0x1fdbb1=_0x128f55[_0x2774e7];(_0x1fdbb1===_0x26c039(0xd4)+'t'||_0x1fdbb1==='-p')&&(_0x41a96c[_0x26c039(0xe8)]=_0x128f55[_0x2774e7+0x1],_0x2774e7+=0x1);}return{'command':_0x2df09d,'options':_0x41a96c};}function usage(){const _0x4fc9c4=_0x525e;console[_0x4fc9c4(0xd0)](_0x4fc9c4(0xdc)+_0x4fc9c4(0xd9)+_0x4fc9c4(0xe1)+_0x4fc9c4(0xeb)+'l\x20prepar'+_0x4fc9c4(0xda)+_0x4fc9c4(0xe5)+_0x4fc9c4(0xde)+_0x4fc9c4(0xd1)+_0x4fc9c4(0xee)+_0x4fc9c4(0xc7)+'oject\x20<u'+'i-projec'+_0x4fc9c4(0xd8));}function _0x4a17(){const _0xeb6d7=['ect\x20<ui-','1625391JChuDF','plugins','project','29TYahAb','command:','jie-shel','slice','shift','-shell\x20s','Version','stack','46760IbMguV','ync\x20--pr','--help','help','exit','prepare','length','7126104ntJlDu','/.tmp/ru','20700qvJNsN','log','\x0a\x20\x20wujie','ntime','2174136sPncet','--projec','error','cwd','stringif','t>\x0a','ell\x0a\x0aUsa','e\x20--proj','19014vhIBzE','wujie-sh','5NhzcIi','project>','4950iwfpdz','sync','ge:\x0a\x20\x20wu','2443332PUnlnP','unknown\x20','7yhnkPN'];_0x4a17=function(){return _0xeb6d7;};return _0x4a17();}async function main(){const _0x289d2b=_0x525e,{command:_0x20ba1f,options:_0x536c5c}=parseArgs(process['argv'][_0x289d2b(0xec)](0x2));if(_0x20ba1f===_0x289d2b(0xc9)||_0x20ba1f===_0x289d2b(0xc8)||_0x20ba1f==='-h'){usage();return;}if(_0x20ba1f!==_0x289d2b(0xcb)&&_0x20ba1f!==_0x289d2b(0xe0))throw new Error(_0x289d2b(0xe3)+_0x289d2b(0xea)+'\x20'+_0x20ba1f);const _0x523a56=resolve(_0x536c5c[_0x289d2b(0xe8)]),_0x148cf0=await loadShellConfig(_0x523a56),_0x117c70=await prepareRuntime(_0x148cf0,{'syncOnly':_0x20ba1f===_0x289d2b(0xe0)});console[_0x289d2b(0xd0)](JSON[_0x289d2b(0xd7)+'y']({'ok':!![],'command':_0x20ba1f,'projectRoot':_0x523a56,'runtimeRoot':_0x523a56+(_0x289d2b(0xce)+_0x289d2b(0xd2)),'openclawVersion':_0x117c70['openclaw'+_0x289d2b(0xef)],'pluginCount':Array['isArray'](_0x117c70['plugins'])?_0x117c70[_0x289d2b(0xe7)][_0x289d2b(0xcc)]:0x0},null,0x2));}main()['catch'](_0x5b08d7=>{const _0x5afd38=_0x525e;console[_0x5afd38(0xd5)](_0x5b08d7 instanceof Error?_0x5b08d7[_0x5afd38(0xc5)]||_0x5b08d7['message']:String(_0x5b08d7)),process[_0x5afd38(0xca)](0x1);});
@@ -1 +1 @@
1
- function _0x41fe(_0x88d858,_0xd89c55){_0x88d858=_0x88d858-0x13d;const _0xff427=_0xff42();let _0x41fe06=_0xff427[_0x88d858];return _0x41fe06;}(function(_0x1c17b8,_0x2bdf66){const _0x2e69bb=_0x41fe,_0x5e7de6=_0x1c17b8();while(!![]){try{const _0x3c132a=-parseInt(_0x2e69bb(0x144))/0x1+-parseInt(_0x2e69bb(0x146))/0x2+parseInt(_0x2e69bb(0x14c))/0x3*(parseInt(_0x2e69bb(0x151))/0x4)+-parseInt(_0x2e69bb(0x154))/0x5+-parseInt(_0x2e69bb(0x161))/0x6*(-parseInt(_0x2e69bb(0x14f))/0x7)+-parseInt(_0x2e69bb(0x13f))/0x8+parseInt(_0x2e69bb(0x15e))/0x9;if(_0x3c132a===_0x2bdf66)break;else _0x5e7de6['push'](_0x5e7de6['shift']());}catch(_0xdbb249){_0x5e7de6['push'](_0x5e7de6['shift']());}}}(_0xff42,0xda263));import{existsSync}from'node:fs';import{readdir}from'node:fs/promises';import{join}from'node:path';import{asRecord,asStringArray,dedupeStrings,getTrimmedString}from'./utils.mjs';async function listValidSkillKeys(_0x162d63,_0x4c365a){const _0x32b2e4=_0x41fe;if(!existsSync(_0x162d63))return[];let _0x526234=[];try{_0x526234=await readdir(_0x162d63,{'withFileTypes':!![],'encoding':_0x32b2e4(0x15d)});}catch(_0x3a4c1d){return console['warn'](_0x32b2e4(0x148)+_0x32b2e4(0x142)+_0x32b2e4(0x160)+_0x32b2e4(0x158)+_0x32b2e4(0x162)+'ls\x20dir\x20a'+_0x32b2e4(0x150)+_0x4c365a,_0x3a4c1d),[];}const _0x5031c2=[];for(const _0x55d521 of _0x526234){if(!_0x55d521['isDirect'+_0x32b2e4(0x155)]())continue;const _0xc0958b=_0x55d521[_0x32b2e4(0x159)][_0x32b2e4(0x140)]();if(!_0xc0958b||_0xc0958b[_0x32b2e4(0x143)+'th']('_'))continue;if(existsSync(join(_0x162d63,_0xc0958b,'SKILL.md')))_0x5031c2[_0x32b2e4(0x156)](_0xc0958b);}return _0x5031c2;}export async function discoverBundledAgentSkills(_0x38e387,_0x29008c){const _0x30a9d1=_0x41fe,_0x10055b=[],_0x37a26e={},_0xa83a3d={};for(const _0x2813af of _0x38e387){const _0x3dc42e=_0x29008c(_0x2813af),_0x4df0fa=await listValidSkillKeys(_0x3dc42e,_0x2813af);_0xa83a3d[_0x2813af]=_0x4df0fa,_0x4df0fa['length']>0x0&&(_0x10055b[_0x30a9d1(0x156)](_0x3dc42e),_0x37a26e[_0x2813af]=_0x3dc42e);}return{'extraDirs':_0x10055b,'extraDirByAgent':_0x37a26e,'agentAllowlist':_0xa83a3d};}function _0xff42(){const _0x231fb4=['main','13043936cLrlob','trim','length','hell:ski','startsWi','516753PFbiXH','stringif','2672726kexHch','load','[wujie-s','isArray','list','owlist','3hjzuRi','entries','agents','285257bcGWZy','gent=','3502612dMablz','object','find','7043370geOczA','ory','push','agentAll','led\x20to\x20r','name','map','skills','extraDir','utf8','29154393cPlekT','filter','lls]\x20fai','246tMPYqf','ead\x20skil','has'];_0xff42=function(){return _0x231fb4;};return _0xff42();}export async function syncBundledAgentSkillsToConfig({agentIds:_0xccb2b2,resolveSkillsDir:_0x58e11a,readConfig:_0x445679,writeConfig:_0x3d269f,markConfigWriteHandledInternally:_0x58c25a}){const _0x4c46d7=_0x41fe,_0x7b3989=await discoverBundledAgentSkills(_0xccb2b2,_0x58e11a);if(_0xccb2b2[_0x4c46d7(0x141)]===0x0)return{'discovery':_0x7b3989,'changed':![]};const _0x424f2d=await _0x445679();let _0x3c1ee4=![];const _0x47edfe=asRecord(_0x424f2d[_0x4c46d7(0x15b)]),_0x2af3f3=asRecord(_0x47edfe[_0x4c46d7(0x147)]),_0x1b46bc=asStringArray(_0x2af3f3[_0x4c46d7(0x15c)+'s']),_0x2dae3f=dedupeStrings([..._0x1b46bc,..._0x7b3989[_0x4c46d7(0x15c)+'s']]);JSON[_0x4c46d7(0x145)+'y'](_0x1b46bc)!==JSON[_0x4c46d7(0x145)+'y'](_0x2dae3f)&&(_0x2af3f3[_0x4c46d7(0x15c)+'s']=_0x2dae3f,_0x47edfe[_0x4c46d7(0x147)]=_0x2af3f3,_0x424f2d[_0x4c46d7(0x15b)]=_0x47edfe,_0x3c1ee4=!![]);const _0x4d7a2b=asRecord(_0x424f2d[_0x4c46d7(0x14e)]),_0x3998f7=Array[_0x4c46d7(0x149)](_0x4d7a2b['list'])?_0x4d7a2b[_0x4c46d7(0x14a)]:[];if(_0x3998f7[_0x4c46d7(0x141)]>0x0){const _0x4adcca=_0x3998f7[_0x4c46d7(0x15a)](_0x52b8d3=>_0x52b8d3&&typeof _0x52b8d3===_0x4c46d7(0x152)?{..._0x52b8d3}:_0x52b8d3);let _0x46f582=![];for(const [_0x4be54c,_0x175618]of Object[_0x4c46d7(0x14d)](_0x7b3989[_0x4c46d7(0x157)+_0x4c46d7(0x14b)])){if(_0x4be54c===_0x4c46d7(0x13e))continue;const _0x32080e=_0x4adcca['find'](_0x4b8bd3=>asRecord(_0x4b8bd3)['id']===_0x4be54c);if(!_0x32080e)continue;const _0xc1b916=Array[_0x4c46d7(0x149)](_0x32080e[_0x4c46d7(0x15b)])?_0x32080e[_0x4c46d7(0x15b)]:null;(!_0xc1b916||JSON['stringif'+'y'](_0xc1b916)!==JSON[_0x4c46d7(0x145)+'y'](_0x175618))&&(_0x32080e[_0x4c46d7(0x15b)]=_0x175618,_0x46f582=!![]);}_0x46f582&&(_0x4d7a2b['list']=_0x4adcca,_0x424f2d[_0x4c46d7(0x14e)]=_0x4d7a2b,_0x3c1ee4=!![]);}return _0x3c1ee4&&(_0x58c25a?.(),await _0x3d269f(_0x424f2d)),{'discovery':_0x7b3989,'changed':_0x3c1ee4};}export function filterSkillsForAgent(_0x5585e1,_0x594a24,_0x35ff33=''){const _0x1fd05c=_0x41fe,_0x348805=Array[_0x1fd05c(0x149)](asRecord(_0x5585e1)[_0x1fd05c(0x15b)])?asRecord(_0x5585e1)[_0x1fd05c(0x15b)]:[],_0x5375ae=getTrimmedString(_0x35ff33)||_0x1fd05c(0x13e),_0x21fa70=Array[_0x1fd05c(0x149)](asRecord(asRecord(_0x594a24)['agents'])[_0x1fd05c(0x14a)])?asRecord(asRecord(_0x594a24)[_0x1fd05c(0x14e)])[_0x1fd05c(0x14a)]:[],_0x240c3f=_0x21fa70[_0x1fd05c(0x15a)](asRecord)[_0x1fd05c(0x153)](_0x5dc655=>getTrimmedString(_0x5dc655['id'])===_0x5375ae),_0x50619c=_0x240c3f&&Array[_0x1fd05c(0x149)](_0x240c3f['skills'])?new Set(asStringArray(_0x240c3f[_0x1fd05c(0x15b)])):null;if(!_0x50619c)return _0x5585e1;return{...asRecord(_0x5585e1),'skills':_0x348805[_0x1fd05c(0x15f)](_0x22532e=>_0x50619c[_0x1fd05c(0x13d)](getTrimmedString(asRecord(_0x22532e)[_0x1fd05c(0x159)])))};}
1
+ (function(_0x21725c,_0x15d903){const _0x50205e=_0x2b3f,_0x49bfb5=_0x21725c();while(!![]){try{const _0x4643e3=parseInt(_0x50205e(0x8e))/0x1*(parseInt(_0x50205e(0x80))/0x2)+parseInt(_0x50205e(0x7e))/0x3+parseInt(_0x50205e(0x9e))/0x4*(parseInt(_0x50205e(0x9d))/0x5)+parseInt(_0x50205e(0x85))/0x6+parseInt(_0x50205e(0x82))/0x7+-parseInt(_0x50205e(0xa1))/0x8+-parseInt(_0x50205e(0x90))/0x9*(parseInt(_0x50205e(0x98))/0xa);if(_0x4643e3===_0x15d903)break;else _0x49bfb5['push'](_0x49bfb5['shift']());}catch(_0x1dec81){_0x49bfb5['push'](_0x49bfb5['shift']());}}}(_0x1ebc,0x8e05f));import{existsSync}from'node:fs';function _0x1ebc(){const _0x3dfb90=['filter','skills','led\x20to\x20r','main','isArray','1PxMPxz','trim','823869RtHbTc','object','startsWi','ead\x20skil','push','lls]\x20fai','agents','ory','200zUnwCi','stringif','list','has','load','610FExZbR','15364xcnPHc','utf8','extraDir','6536624IzPgtP','876264kYeesA','name','2252800aMVcXF','entries','7819553eZAEPH','hell:ski','agentAll','1352736JuAwEu','find','length','map'];_0x1ebc=function(){return _0x3dfb90;};return _0x1ebc();}function _0x2b3f(_0x1c1615,_0x1f39c1){_0x1c1615=_0x1c1615-0x7e;const _0x1ebc90=_0x1ebc();let _0x2b3f60=_0x1ebc90[_0x1c1615];return _0x2b3f60;}import{readdir}from'node:fs/promises';import{join}from'node:path';import{asRecord,asStringArray,dedupeStrings,getTrimmedString}from'./utils.mjs';async function listValidSkillKeys(_0x57892b,_0x3fee07){const _0x3f7ad1=_0x2b3f;if(!existsSync(_0x57892b))return[];let _0x3c42fb=[];try{_0x3c42fb=await readdir(_0x57892b,{'withFileTypes':!![],'encoding':_0x3f7ad1(0x9f)});}catch(_0x3158e5){return console['warn']('[wujie-s'+_0x3f7ad1(0x83)+_0x3f7ad1(0x95)+_0x3f7ad1(0x8b)+_0x3f7ad1(0x93)+'ls\x20dir\x20a'+'gent='+_0x3fee07,_0x3158e5),[];}const _0x6d6ee3=[];for(const _0x1151ff of _0x3c42fb){if(!_0x1151ff['isDirect'+_0x3f7ad1(0x97)]())continue;const _0x8aae6e=_0x1151ff[_0x3f7ad1(0x7f)][_0x3f7ad1(0x8f)]();if(!_0x8aae6e||_0x8aae6e[_0x3f7ad1(0x92)+'th']('_'))continue;if(existsSync(join(_0x57892b,_0x8aae6e,'SKILL.md')))_0x6d6ee3['push'](_0x8aae6e);}return _0x6d6ee3;}export async function discoverBundledAgentSkills(_0x2d27bd,_0x48dacd){const _0x357be5=_0x2b3f,_0x2adb12=[],_0x16cf88={},_0xd951c8={};for(const _0x1f6be5 of _0x2d27bd){const _0xaa953=_0x48dacd(_0x1f6be5),_0x238a1a=await listValidSkillKeys(_0xaa953,_0x1f6be5);_0xd951c8[_0x1f6be5]=_0x238a1a,_0x238a1a['length']>0x0&&(_0x2adb12[_0x357be5(0x94)](_0xaa953),_0x16cf88[_0x1f6be5]=_0xaa953);}return{'extraDirs':_0x2adb12,'extraDirByAgent':_0x16cf88,'agentAllowlist':_0xd951c8};}export async function syncBundledAgentSkillsToConfig({agentIds:_0x18a978,resolveSkillsDir:_0x93fd61,readConfig:_0x3797bf,writeConfig:_0xa0a835,markConfigWriteHandledInternally:_0x4afcd9}){const _0xd8cff4=_0x2b3f,_0x4ef429=await discoverBundledAgentSkills(_0x18a978,_0x93fd61);if(_0x18a978[_0xd8cff4(0x87)]===0x0)return{'discovery':_0x4ef429,'changed':![]};const _0x2bed85=await _0x3797bf();let _0xe52d=![];const _0x19197c=asRecord(_0x2bed85['skills']),_0x276f1e=asRecord(_0x19197c[_0xd8cff4(0x9c)]),_0x5ee61d=asStringArray(_0x276f1e[_0xd8cff4(0xa0)+'s']),_0x32730c=dedupeStrings([..._0x5ee61d,..._0x4ef429['extraDir'+'s']]);JSON[_0xd8cff4(0x99)+'y'](_0x5ee61d)!==JSON[_0xd8cff4(0x99)+'y'](_0x32730c)&&(_0x276f1e[_0xd8cff4(0xa0)+'s']=_0x32730c,_0x19197c[_0xd8cff4(0x9c)]=_0x276f1e,_0x2bed85[_0xd8cff4(0x8a)]=_0x19197c,_0xe52d=!![]);const _0xddd61a=asRecord(_0x2bed85[_0xd8cff4(0x96)]),_0x492b34=Array[_0xd8cff4(0x8d)](_0xddd61a[_0xd8cff4(0x9a)])?_0xddd61a[_0xd8cff4(0x9a)]:[];if(_0x492b34[_0xd8cff4(0x87)]>0x0){const _0x331929=_0x492b34[_0xd8cff4(0x88)](_0x2ef3cc=>_0x2ef3cc&&typeof _0x2ef3cc===_0xd8cff4(0x91)?{..._0x2ef3cc}:_0x2ef3cc);let _0x8f112d=![];for(const [_0x1c8a6f,_0x141d0a]of Object[_0xd8cff4(0x81)](_0x4ef429[_0xd8cff4(0x84)+'owlist'])){if(_0x1c8a6f===_0xd8cff4(0x8c))continue;const _0x27d42b=_0x331929[_0xd8cff4(0x86)](_0x50ee14=>asRecord(_0x50ee14)['id']===_0x1c8a6f);if(!_0x27d42b)continue;const _0x350375=Array[_0xd8cff4(0x8d)](_0x27d42b[_0xd8cff4(0x8a)])?_0x27d42b[_0xd8cff4(0x8a)]:null;(!_0x350375||JSON[_0xd8cff4(0x99)+'y'](_0x350375)!==JSON[_0xd8cff4(0x99)+'y'](_0x141d0a))&&(_0x27d42b[_0xd8cff4(0x8a)]=_0x141d0a,_0x8f112d=!![]);}_0x8f112d&&(_0xddd61a[_0xd8cff4(0x9a)]=_0x331929,_0x2bed85[_0xd8cff4(0x96)]=_0xddd61a,_0xe52d=!![]);}return _0xe52d&&(_0x4afcd9?.(),await _0xa0a835(_0x2bed85)),{'discovery':_0x4ef429,'changed':_0xe52d};}export function filterSkillsForAgent(_0x5ebfd3,_0x3051c5,_0x3ed5b5=''){const _0x3352a2=_0x2b3f,_0x1bf6a6=Array['isArray'](asRecord(_0x5ebfd3)[_0x3352a2(0x8a)])?asRecord(_0x5ebfd3)[_0x3352a2(0x8a)]:[],_0x559c77=getTrimmedString(_0x3ed5b5)||_0x3352a2(0x8c),_0x30cd63=Array[_0x3352a2(0x8d)](asRecord(asRecord(_0x3051c5)[_0x3352a2(0x96)])[_0x3352a2(0x9a)])?asRecord(asRecord(_0x3051c5)[_0x3352a2(0x96)])['list']:[],_0x1ada21=_0x30cd63['map'](asRecord)['find'](_0x5b6bb7=>getTrimmedString(_0x5b6bb7['id'])===_0x559c77),_0x37271b=_0x1ada21&&Array[_0x3352a2(0x8d)](_0x1ada21[_0x3352a2(0x8a)])?new Set(asStringArray(_0x1ada21[_0x3352a2(0x8a)])):null;if(!_0x37271b)return _0x5ebfd3;return{...asRecord(_0x5ebfd3),'skills':_0x1bf6a6[_0x3352a2(0x89)](_0x5daf80=>_0x37271b[_0x3352a2(0x9b)](getTrimmedString(asRecord(_0x5daf80)[_0x3352a2(0x7f)])))};}
@@ -1 +1 @@
1
- (function(_0x411bae,_0x2b6d2a){const _0x52401a=_0x10ef,_0xbdb2c6=_0x411bae();while(!![]){try{const _0x57c442=-parseInt(_0x52401a(0xd9))/0x1+parseInt(_0x52401a(0xcc))/0x2+parseInt(_0x52401a(0xc6))/0x3+parseInt(_0x52401a(0xf4))/0x4*(-parseInt(_0x52401a(0xd1))/0x5)+parseInt(_0x52401a(0xea))/0x6*(parseInt(_0x52401a(0xc9))/0x7)+-parseInt(_0x52401a(0xef))/0x8+parseInt(_0x52401a(0xd0))/0x9;if(_0x57c442===_0x2b6d2a)break;else _0xbdb2c6['push'](_0xbdb2c6['shift']());}catch(_0x3c5971){_0xbdb2c6['push'](_0xbdb2c6['shift']());}}}(_0x99ef,0xefd1c));import{existsSync}from'node:fs';import{cp,mkdir,readFile,readdir,rm}from'node:fs/promises';import{dirname,join,resolve,sep}from'node:path';function _0x99ef(){const _0x30a024=['afe\x20mana','564906SdMZFE','cnName','toolDoma','101605DEbCLH','emoji','name','205964SjixVX','aths','ory','length','33966468DyuYJd','1349090kosSPJ','ins','ync\x20bund','version','[wujie-s','avatar','error','tyDomain','1706476ytGhLC','isDirect','led\x20agen','model','utf8','isArray','icon','some','capabili','relPath','map','startsWi','main','nts]\x20ski','son','includes','agents','270hPdKDh','parse','find','nts]\x20fai','pped\x20uns','9762248lGbaAi','trim','absPath','readme.j','t\x20\x22','12OEksbS','warn','workspac'];_0x99ef=function(){return _0x30a024;};return _0x99ef();}import{asRecord,asStringArray,getTrimmedString,readJson}from'./utils.mjs';function toOptionalString(_0x3a2b9e){const _0xbc35a3=getTrimmedString(_0x3a2b9e);return _0xbc35a3||undefined;}export async function loadBundledAgents(_0x295081){const _0x46aea0=_0x10ef;let _0x3fb912=[];try{_0x3fb912=await readdir(_0x295081,{'withFileTypes':!![],'encoding':_0x46aea0(0xdd)});}catch{return[];}const _0x1a9741=await Promise['all'](_0x3fb912['filter'](_0x440bf4=>_0x440bf4[_0x46aea0(0xda)+_0x46aea0(0xce)]())[_0x46aea0(0xe3)](async _0x53dfee=>{const _0x1e8f7b=_0x46aea0,_0x24e59d=_0x53dfee[_0x1e8f7b(0xcb)][_0x1e8f7b(0xf0)]();if(!_0x24e59d)return null;const _0x17b8eb=await readJson(join(_0x295081,_0x24e59d,_0x1e8f7b(0xf2)+'son'),{}),_0x59cc8f=asRecord(_0x17b8eb),_0x18c18b=toOptionalString(_0x59cc8f['name'])??_0x24e59d;if(!_0x18c18b)return null;return{'name':_0x18c18b,'cnName':toOptionalString(_0x59cc8f[_0x1e8f7b(0xc7)]),'avatar':toOptionalString(_0x59cc8f[_0x1e8f7b(0xd6)]),'icon':toOptionalString(_0x59cc8f[_0x1e8f7b(0xdf)]),'emoji':toOptionalString(_0x59cc8f[_0x1e8f7b(0xca)]),'model':toOptionalString(_0x59cc8f[_0x1e8f7b(0xdc)]),'version':toOptionalString(_0x59cc8f[_0x1e8f7b(0xd4)]),'capabilityDomains':asStringArray(_0x59cc8f[_0x1e8f7b(0xe1)+_0x1e8f7b(0xd8)+'s']??_0x59cc8f[_0x1e8f7b(0xc8)+_0x1e8f7b(0xd2)]),'managedPaths':asStringArray(_0x59cc8f['managedP'+_0x1e8f7b(0xcd)])};}));return _0x1a9741['filter'](Boolean);}async function readJsonVersion(_0x3a2300){const _0x14d74a=_0x10ef;try{const _0x3b5bbb=JSON[_0x14d74a(0xeb)](await readFile(_0x3a2300,_0x14d74a(0xdd)));return getTrimmedString(asRecord(_0x3b5bbb)[_0x14d74a(0xd4)])||null;}catch{return null;}}function assertSafeManagedPath(_0x2e382a,_0x56bbc3){const _0x4d4237=_0x10ef,_0x50d568=getTrimmedString(_0x56bbc3);if(!_0x50d568||_0x50d568[_0x4d4237(0xe4)+'th']('/')||_0x50d568[_0x4d4237(0xe8)]('..'))return null;const _0x537a99=resolve(_0x2e382a),_0x1c103b=resolve(join(_0x2e382a,_0x50d568));if(_0x1c103b!==_0x537a99&&!_0x1c103b[_0x4d4237(0xe4)+'th'](_0x537a99+sep))return null;return{'relPath':_0x50d568,'absPath':_0x1c103b};}function _0x10ef(_0x3f16c6,_0x40b210){_0x3f16c6=_0x3f16c6-0xc6;const _0x99ef01=_0x99ef();let _0x10efed=_0x99ef01[_0x3f16c6];return _0x10efed;}async function copyManagedPaths(_0x4364c9,_0x786c4b,_0x106f5a){const _0x1ec9f2=_0x10ef;if(_0x106f5a[_0x1ec9f2(0xcf)]===0x0){await cp(_0x4364c9,_0x786c4b,{'recursive':!![]});return;}for(const _0x47dd4a of _0x106f5a){const _0x4b8710=assertSafeManagedPath(_0x786c4b,_0x47dd4a);if(!_0x4b8710){console[_0x1ec9f2(0xf5)](_0x1ec9f2(0xd5)+'hell:age'+_0x1ec9f2(0xe6)+_0x1ec9f2(0xee)+_0x1ec9f2(0xf7)+'gedPath:'+'\x20'+_0x47dd4a);continue;}const _0x230d31=join(_0x4364c9,_0x4b8710[_0x1ec9f2(0xe2)]);if(!existsSync(_0x230d31)){await rm(_0x4b8710['absPath'],{'recursive':!![],'force':!![]});continue;}await rm(_0x4b8710[_0x1ec9f2(0xf1)],{'recursive':!![],'force':!![]}),await mkdir(dirname(_0x4b8710[_0x1ec9f2(0xf1)]),{'recursive':!![]}),await cp(_0x230d31,_0x4b8710['absPath'],{'recursive':!![]});}}export async function ensureBundledAgents({runtimeBundledAgentsDir:_0x1a11a2,stateDir:_0x4faad0,listAgents:_0x3c1fba,createAgent:_0x2302e1,updateAgent:_0x4ede26,syncSkills:_0x19f7dd}){const _0x40cf50=_0x10ef;let _0x312583=![];const _0x3967db=await _0x3c1fba(),_0x145964=Array[_0x40cf50(0xde)](_0x3967db[_0x40cf50(0xe9)])?_0x3967db[_0x40cf50(0xe9)]:[],_0x2477e0=_0x145964[_0x40cf50(0xec)](_0x2a0ecc=>_0x2a0ecc?.['id']==='main'),_0x4bb381=getTrimmedString(_0x2477e0?.['workspac'+'e'])||join(_0x4faad0,_0x40cf50(0xf6)+'e'),_0x2885df=await loadBundledAgents(_0x1a11a2);for(const _0xe9b7b1 of _0x2885df){const {name:_0x1c849c,cnName:_0x26eaaa,avatar:_0x40baf7,emoji:_0x5c01f8,version:_0x1352c3,managedPaths:_0x513cdb}=_0xe9b7b1,_0x1d5d03=_0x1c849c===_0x40cf50(0xe5),_0x147329=_0x1d5d03?_0x4bb381:join(dirname(_0x4bb381),_0x40cf50(0xf6)+'e-'+_0x1c849c),_0x1bae1=join(_0x1a11a2,_0x1c849c);if(!existsSync(_0x1bae1))continue;try{const _0x2d6c94=_0x1d5d03||_0x145964[_0x40cf50(0xe0)](_0x3ae98c=>_0x3ae98c?.['id']===_0x1c849c);if(_0x2d6c94){const _0x3f15b1=await readJsonVersion(join(_0x147329,'readme.j'+_0x40cf50(0xe7)));if(_0x1352c3&&_0x3f15b1&&_0x1352c3===_0x3f15b1)continue;await mkdir(_0x147329,{'recursive':!![]}),await copyManagedPaths(_0x1bae1,_0x147329,_0x513cdb);}else await rm(_0x147329,{'recursive':!![],'force':!![]}),await mkdir(_0x147329,{'recursive':!![]}),await cp(_0x1bae1,_0x147329,{'recursive':!![]});_0x312583=!![];if(_0x1d5d03)continue;if(_0x2d6c94){const _0x5b8878={'agentId':_0x1c849c,'workspace':_0x147329};if(_0x26eaaa)_0x5b8878['name']=_0x26eaaa;if(_0x40baf7)_0x5b8878[_0x40cf50(0xd6)]=_0x40baf7;if(_0x5c01f8)_0x5b8878[_0x40cf50(0xca)]=_0x5c01f8;await _0x4ede26(_0x5b8878);}else{const _0x4690c5={'name':_0x1c849c,'workspace':_0x147329};if(_0x40baf7)_0x4690c5[_0x40cf50(0xd6)]=_0x40baf7;if(_0x5c01f8)_0x4690c5[_0x40cf50(0xca)]=_0x5c01f8;const _0x598b70=asRecord(await _0x2302e1(_0x4690c5));_0x26eaaa&&await _0x4ede26({'agentId':getTrimmedString(_0x598b70['agentId'])||_0x1c849c,'name':_0x26eaaa});}}catch(_0x34271f){console[_0x40cf50(0xd7)](_0x40cf50(0xd5)+'hell:age'+_0x40cf50(0xed)+'led\x20to\x20s'+_0x40cf50(0xd3)+_0x40cf50(0xdb)+_0x40cf50(0xf3)+_0x1c849c+'\x22',_0x34271f);}}return await _0x19f7dd?.({'agentIds':_0x2885df[_0x40cf50(0xe3)](_0xd9bb14=>_0xd9bb14[_0x40cf50(0xcb)]),'mainWorkspace':_0x4bb381}),{'didUpdate':_0x312583,'bundledAgents':_0x2885df};}
1
+ (function(_0x4778a7,_0x353e1b){const _0x2caacd=_0xa985,_0x717dcb=_0x4778a7();while(!![]){try{const _0x10d803=parseInt(_0x2caacd(0x1e6))/0x1+parseInt(_0x2caacd(0x1bd))/0x2+-parseInt(_0x2caacd(0x1e0))/0x3+parseInt(_0x2caacd(0x1c9))/0x4+-parseInt(_0x2caacd(0x1c2))/0x5+-parseInt(_0x2caacd(0x1c0))/0x6*(-parseInt(_0x2caacd(0x1b7))/0x7)+parseInt(_0x2caacd(0x1e3))/0x8*(-parseInt(_0x2caacd(0x1c6))/0x9);if(_0x10d803===_0x353e1b)break;else _0x717dcb['push'](_0x717dcb['shift']());}catch(_0xbe4176){_0x717dcb['push'](_0x717dcb['shift']());}}}(_0x1f4b,0xa0b7b));import{existsSync}from'node:fs';import{cp,mkdir,readFile,readdir,rm}from'node:fs/promises';function _0x1f4b(){const _0x104c56=['parse','includes','1289226LiiFqR','error','6232680RFXMpL','nts]\x20fai','tyDomain','agents','2684754muwTdF','filter','trim','1258284LYHnlO','main','capabili','some','isArray','ync\x20bund','emoji','[wujie-s','managedP','aths','relPath','avatar','afe\x20mana','toolDoma','version','map','led\x20to\x20s','son','absPath','ory','icon','name','cnName','1513998wSfDPo','workspac','readme.j','8XYHbXa','led\x20agen','agentId','498346ZdENxF','all','length','startsWi','warn','35uhzMfW','model','find','nts]\x20ski','hell:age','isDirect','1641070zFPRPJ'];_0x1f4b=function(){return _0x104c56;};return _0x1f4b();}import{dirname,join,resolve,sep}from'node:path';import{asRecord,asStringArray,getTrimmedString,readJson}from'./utils.mjs';function toOptionalString(_0x3a7b83){const _0x361aae=getTrimmedString(_0x3a7b83);return _0x361aae||undefined;}export async function loadBundledAgents(_0x355382){const _0x2b60e2=_0xa985;let _0x2dece7=[];try{_0x2dece7=await readdir(_0x355382,{'withFileTypes':!![],'encoding':'utf8'});}catch{return[];}const _0x5e2a32=await Promise[_0x2b60e2(0x1e7)](_0x2dece7[_0x2b60e2(0x1c7)](_0x19780d=>_0x19780d[_0x2b60e2(0x1bc)+_0x2b60e2(0x1dc)]())[_0x2b60e2(0x1d8)](async _0xfffbfa=>{const _0x1ce901=_0x2b60e2,_0x39a5b3=_0xfffbfa[_0x1ce901(0x1de)][_0x1ce901(0x1c8)]();if(!_0x39a5b3)return null;const _0x466702=await readJson(join(_0x355382,_0x39a5b3,'readme.j'+_0x1ce901(0x1da)),{}),_0x32961f=asRecord(_0x466702),_0x20d280=toOptionalString(_0x32961f[_0x1ce901(0x1de)])??_0x39a5b3;if(!_0x20d280)return null;return{'name':_0x20d280,'cnName':toOptionalString(_0x32961f[_0x1ce901(0x1df)]),'avatar':toOptionalString(_0x32961f[_0x1ce901(0x1d4)]),'icon':toOptionalString(_0x32961f[_0x1ce901(0x1dd)]),'emoji':toOptionalString(_0x32961f[_0x1ce901(0x1cf)]),'model':toOptionalString(_0x32961f[_0x1ce901(0x1b8)]),'version':toOptionalString(_0x32961f['version']),'capabilityDomains':asStringArray(_0x32961f[_0x1ce901(0x1cb)+_0x1ce901(0x1c4)+'s']??_0x32961f[_0x1ce901(0x1d6)+'ins']),'managedPaths':asStringArray(_0x32961f[_0x1ce901(0x1d1)+_0x1ce901(0x1d2)])};}));return _0x5e2a32[_0x2b60e2(0x1c7)](Boolean);}async function readJsonVersion(_0x5d7781){const _0x2408f8=_0xa985;try{const _0x4bc657=JSON[_0x2408f8(0x1be)](await readFile(_0x5d7781,'utf8'));return getTrimmedString(asRecord(_0x4bc657)[_0x2408f8(0x1d7)])||null;}catch{return null;}}function assertSafeManagedPath(_0x3ddd90,_0x29cf3e){const _0x2c06ab=_0xa985,_0x28cdf5=getTrimmedString(_0x29cf3e);if(!_0x28cdf5||_0x28cdf5[_0x2c06ab(0x1e9)+'th']('/')||_0x28cdf5[_0x2c06ab(0x1bf)]('..'))return null;const _0x5e9c3b=resolve(_0x3ddd90),_0x580f0a=resolve(join(_0x3ddd90,_0x28cdf5));if(_0x580f0a!==_0x5e9c3b&&!_0x580f0a[_0x2c06ab(0x1e9)+'th'](_0x5e9c3b+sep))return null;return{'relPath':_0x28cdf5,'absPath':_0x580f0a};}async function copyManagedPaths(_0x304c87,_0x2e1e85,_0x29adb1){const _0x2ee365=_0xa985;if(_0x29adb1[_0x2ee365(0x1e8)]===0x0){await cp(_0x304c87,_0x2e1e85,{'recursive':!![]});return;}for(const _0x819f3b of _0x29adb1){const _0x3d85ab=assertSafeManagedPath(_0x2e1e85,_0x819f3b);if(!_0x3d85ab){console[_0x2ee365(0x1b6)](_0x2ee365(0x1d0)+_0x2ee365(0x1bb)+_0x2ee365(0x1ba)+'pped\x20uns'+_0x2ee365(0x1d5)+'gedPath:'+'\x20'+_0x819f3b);continue;}const _0x31547e=join(_0x304c87,_0x3d85ab[_0x2ee365(0x1d3)]);if(!existsSync(_0x31547e)){await rm(_0x3d85ab['absPath'],{'recursive':!![],'force':!![]});continue;}await rm(_0x3d85ab['absPath'],{'recursive':!![],'force':!![]}),await mkdir(dirname(_0x3d85ab[_0x2ee365(0x1db)]),{'recursive':!![]}),await cp(_0x31547e,_0x3d85ab[_0x2ee365(0x1db)],{'recursive':!![]});}}function _0xa985(_0x29d612,_0x424e36){_0x29d612=_0x29d612-0x1b6;const _0x1f4b9e=_0x1f4b();let _0xa9856f=_0x1f4b9e[_0x29d612];return _0xa9856f;}export async function ensureBundledAgents({runtimeBundledAgentsDir:_0x1c6db4,stateDir:_0x2a84bc,listAgents:_0x226e27,createAgent:_0x36e80c,updateAgent:_0x5e3242,syncSkills:_0x592932}){const _0x1e807b=_0xa985;let _0x528c6d=![];const _0x3960c5=await _0x226e27(),_0x23702f=Array[_0x1e807b(0x1cd)](_0x3960c5[_0x1e807b(0x1c5)])?_0x3960c5[_0x1e807b(0x1c5)]:[],_0x49c622=_0x23702f[_0x1e807b(0x1b9)](_0x462d7a=>_0x462d7a?.['id']==='main'),_0x28d618=getTrimmedString(_0x49c622?.[_0x1e807b(0x1e1)+'e'])||join(_0x2a84bc,_0x1e807b(0x1e1)+'e'),_0x5402b3=await loadBundledAgents(_0x1c6db4);for(const _0x123003 of _0x5402b3){const {name:_0x32e676,cnName:_0x444d5d,avatar:_0x5cf8c5,emoji:_0x181ae1,version:_0x191712,managedPaths:_0x20ec0b}=_0x123003,_0x50f41f=_0x32e676===_0x1e807b(0x1ca),_0x3d67b8=_0x50f41f?_0x28d618:join(dirname(_0x28d618),_0x1e807b(0x1e1)+'e-'+_0x32e676),_0x345a3a=join(_0x1c6db4,_0x32e676);if(!existsSync(_0x345a3a))continue;try{const _0x143cde=_0x50f41f||_0x23702f[_0x1e807b(0x1cc)](_0x537329=>_0x537329?.['id']===_0x32e676);if(_0x143cde){const _0x147df4=await readJsonVersion(join(_0x3d67b8,_0x1e807b(0x1e2)+'son'));if(_0x191712&&_0x147df4&&_0x191712===_0x147df4)continue;await mkdir(_0x3d67b8,{'recursive':!![]}),await copyManagedPaths(_0x345a3a,_0x3d67b8,_0x20ec0b);}else await rm(_0x3d67b8,{'recursive':!![],'force':!![]}),await mkdir(_0x3d67b8,{'recursive':!![]}),await cp(_0x345a3a,_0x3d67b8,{'recursive':!![]});_0x528c6d=!![];if(_0x50f41f)continue;if(_0x143cde){const _0x1984cc={'agentId':_0x32e676,'workspace':_0x3d67b8};if(_0x444d5d)_0x1984cc[_0x1e807b(0x1de)]=_0x444d5d;if(_0x5cf8c5)_0x1984cc[_0x1e807b(0x1d4)]=_0x5cf8c5;if(_0x181ae1)_0x1984cc['emoji']=_0x181ae1;await _0x5e3242(_0x1984cc);}else{const _0x32355c={'name':_0x32e676,'workspace':_0x3d67b8};if(_0x5cf8c5)_0x32355c[_0x1e807b(0x1d4)]=_0x5cf8c5;if(_0x181ae1)_0x32355c[_0x1e807b(0x1cf)]=_0x181ae1;const _0xd76a4c=asRecord(await _0x36e80c(_0x32355c));_0x444d5d&&await _0x5e3242({'agentId':getTrimmedString(_0xd76a4c[_0x1e807b(0x1e5)])||_0x32e676,'name':_0x444d5d});}}catch(_0x56523c){console[_0x1e807b(0x1c1)]('[wujie-s'+_0x1e807b(0x1bb)+_0x1e807b(0x1c3)+_0x1e807b(0x1d9)+_0x1e807b(0x1ce)+_0x1e807b(0x1e4)+'t\x20\x22'+_0x32e676+'\x22',_0x56523c);}}return await _0x592932?.({'agentIds':_0x5402b3[_0x1e807b(0x1d8)](_0x54de8e=>_0x54de8e['name']),'mainWorkspace':_0x28d618}),{'didUpdate':_0x528c6d,'bundledAgents':_0x5402b3};}
@@ -1 +1 @@
1
- const _0x17f4d0=_0x39c5;(function(_0x49a767,_0x3fc9e4){const _0x907562=_0x39c5,_0x4d3b5f=_0x49a767();while(!![]){try{const _0xbf02a9=-parseInt(_0x907562(0x13f))/0x1*(-parseInt(_0x907562(0x143))/0x2)+-parseInt(_0x907562(0x14e))/0x3*(parseInt(_0x907562(0x141))/0x4)+parseInt(_0x907562(0x12c))/0x5*(-parseInt(_0x907562(0x132))/0x6)+-parseInt(_0x907562(0x147))/0x7*(-parseInt(_0x907562(0x16b))/0x8)+parseInt(_0x907562(0x11d))/0x9+parseInt(_0x907562(0x127))/0xa*(parseInt(_0x907562(0x163))/0xb)+-parseInt(_0x907562(0x117))/0xc;if(_0xbf02a9===_0x3fc9e4)break;else _0x4d3b5f['push'](_0x4d3b5f['shift']());}catch(_0xa7f9bf){_0x4d3b5f['push'](_0x4d3b5f['shift']());}}}(_0x2662,0x3cdbe));import{randomBytes}from'node:crypto';import{existsSync,unwatchFile,watchFile}from'node:fs';import{mkdir,writeFile}from'node:fs/promises';function _0x39c5(_0x4cd899,_0x2af9f7){_0x4cd899=_0x4cd899-0xfd;const _0x2662be=_0x2662();let _0x39c587=_0x2662be[_0x4cd899];return _0x39c587;}import{dirname,join}from'node:path';import _0x5e9967,{portNumbers}from'get-port';import{ensureShellStateDirs,getConfigPaths,readJsonFile,writeJsonFile}from'@wujie-shell/config';function _0x2662(){const _0xa26e82=['g\x20writte','585109eJaIiU','onboard','openai','product\x20','slice','config','mode','9EPgLHh','memory-c','local','ent\x20ensu','rated\x20mo','config\x20c','per-chan','protocol','pluginId','ernal\x20ch','isArray','\x20for\x20con','nfig\x20syn','length','toString','written','apiKey','baseUrl','self-ope','load','now','11scAIAS','default','ced','ask-user','info','allow','projectR','modelNam','8EHqnPC','agents','tart','model\x20co','ompletio','keys','initial\x20','last-goo','image','ensure\x20i','entries','lastGood','idle','stringif','fig','hex','eUrl','d\x20opencl','active-m','plugins','defaultM','exists','ing','256kb','restartO','nel-peer','mtimeMs','defaults','environm','model','text','ompleted','manifest','session','cheduled','provider','reload\x20s','error','models','anged','ConfigPa','yName','elPrimar','rnal\x20wri','toISOStr','plugin\x20c','claw\x20con','primary','openai-c','nfig\x20alr','ync','auto','onfig\x20al','ore','entityPa','runtime\x20','aw\x20confi','ports','1813704wdimVp','filter','info\x20loa','her\x20obse','onfig\x20ch','config\x20s','2402514RSoRUE','persiste','push','indexOf','nitial\x20o','emory','her\x20igno','utf8','\x20config\x20','odel','2538840WadxkT','openclaw','configPa','ile\x20watc','ded\x20for\x20','196665vfited','oot','logsDir','-questio','gatewayS','merge','36zolViI','Version','fig\x20chan','penclaw\x20','config\x20f','deviceId','plugins\x20','skills','imageMod','compat','extraDir','created','stateDir','73537EuLSlB','\x20creatin','251480JGCaYT','red','6jgcmQn','ated','changed'];_0x2662=function(){return _0xa26e82;};return _0x2662();}import{asRecord,dedupeStrings,getTrimmedString,writeJson}from'./utils.mjs';import{loadRuntimeInfo}from'./runtime.mjs';import{createRuntimeLogger,summarizeRuntimeManifest}from'./runtime-logger.mjs';import{syncRuntimeManifestPlugins}from'./plugin-sync.mjs';const MEMORY_CORE_PLUGIN_ID=_0x17f4d0(0x14f)+_0x17f4d0(0x112),ACTIVE_MEMORY_PLUGIN_ID=_0x17f4d0(0x17d)+_0x17f4d0(0x122),ASK_USER_QUESTION_PLUGIN_ID=_0x17f4d0(0x166)+_0x17f4d0(0x12f)+'n';function createToken(){const _0x218650=_0x17f4d0;return randomBytes(0x18)[_0x218650(0x15c)](_0x218650(0x17a));}function createProviderModelConfig(_0x5d0450,_0x4e412c=![]){const _0x71b1ad=_0x17f4d0;return{'id':_0x5d0450,'name':_0x5d0450,'reasoning':!![],'input':_0x4e412c?['text',_0x71b1ad(0x173)]:[_0x71b1ad(0x189)],'cost':{'input':0x0,'output':0x0,'cacheRead':0x0,'cacheWrite':0x0},'contextWindow':0x3e800,'maxTokens':0x3e800};}function createProviderConfig(_0x39d136){const _0x2b14f0=_0x17f4d0;return{'apiKey':_0x39d136[_0x2b14f0(0x15e)],'api':_0x39d136[_0x2b14f0(0x155)]==='anthropi'+'c'?'anthropi'+'c-messag'+'es':'openai-c'+_0x2b14f0(0x16f)+'ns',..._0x39d136['baseUrl']?{'baseUrl':_0x39d136[_0x2b14f0(0x15f)]}:{},'models':[createProviderModelConfig(_0x39d136[_0x2b14f0(0x16a)+'e'])]};}function createRuntimePluginBootstrap(_0x1d6f52){const _0x4c0ee5=_0x17f4d0,_0x3ae50d={},_0x25120a=[];for(const _0x1c5150 of _0x1d6f52??[]){const _0x5cd2b9=getTrimmedString(_0x1c5150[_0x4c0ee5(0x156)]);if(!_0x5cd2b9)continue;_0x3ae50d[_0x5cd2b9]={'enabled':!![]},_0x25120a[_0x4c0ee5(0x11f)](_0x5cd2b9);}return!_0x3ae50d[MEMORY_CORE_PLUGIN_ID]&&(_0x3ae50d[MEMORY_CORE_PLUGIN_ID]={'enabled':!![],'config':{'dreaming':{'enabled':!![]}}}),!_0x3ae50d[ACTIVE_MEMORY_PLUGIN_ID]&&(_0x3ae50d[ACTIVE_MEMORY_PLUGIN_ID]={'enabled':!![]}),{'entries':_0x3ae50d,'allow':dedupeStrings([..._0x25120a,MEMORY_CORE_PLUGIN_ID,ACTIVE_MEMORY_PLUGIN_ID]),'bundledDiscovery':_0x4c0ee5(0x13b)};}function createInitialOpenClawConfig(_0x8a7ca5,_0x559e03){const _0x511afb=_0x17f4d0,_0x4d1629=new Date()[_0x511afb(0x109)+_0x511afb(0x181)](),_0x3de880=join(_0x8a7ca5['dataDir'],'workspac'+'e'),_0x418623=asRecord(_0x8a7ca5[_0x511afb(0x103)]),_0x29ff79=getTrimmedString(_0x418623[_0x511afb(0x17f)+'odel']),_0x224d05={'workspace':_0x3de880,'memorySearch':{'enabled':!![],'sources':['memory'],'provider':_0x511afb(0x110)},'compaction':{'memoryFlush':{'enabled':!![],'forceFlushTranscriptBytes':_0x511afb(0x182),'softThresholdTokens':0x30d40}}};return _0x29ff79&&(_0x224d05[_0x511afb(0x188)]={'primary':_0x29ff79}),{'meta':{'lastTouchedVersion':_0x559e03['openclaw'+_0x511afb(0x133)],'lastTouchedAt':_0x4d1629},'wizard':{'lastRunAt':_0x4d1629,'lastRunVersion':_0x559e03[_0x511afb(0x128)+'Version'],'lastRunCommand':_0x511afb(0x148),'lastRunMode':_0x511afb(0x150)},'models':{'mode':'merge','providers':asRecord(_0x418623[_0x511afb(0x100)+'s'])},'agents':{'defaults':_0x224d05},'tools':{'profile':'full'},'plugins':createRuntimePluginBootstrap(_0x559e03[_0x511afb(0x17e)]),'skills':{'load':{'extraDirs':[_0x511afb(0x139)]}},'session':{'dmScope':_0x511afb(0x154)+_0x511afb(0x184),'reset':{'mode':_0x511afb(0x177)}}};}function hasMeaningfulProductModels(_0x4ef3ad){const _0x4eeb4f=_0x17f4d0,_0x2413d0=asRecord(_0x4ef3ad[_0x4eeb4f(0x103)]);return Object[_0x4eeb4f(0x170)](asRecord(_0x2413d0[_0x4eeb4f(0x100)+'s']))[_0x4eeb4f(0x15b)]>0x0||Boolean(getTrimmedString(_0x2413d0[_0x4eeb4f(0x17f)+'odel']));}function summarizeOpenClawConfig(_0xffedea){const _0x555c21=_0x17f4d0,_0x349033=asRecord(_0xffedea[_0x555c21(0x103)]),_0x1de8ee=asRecord(_0x349033['provider'+'s']),_0x15865d=asRecord(_0xffedea['agents']),_0x28e3a0=asRecord(_0x15865d['defaults']),_0x682e1f=asRecord(_0x28e3a0['model']),_0xa2c0a5=asRecord(_0xffedea[_0x555c21(0x17e)]),_0x1a601c=asRecord(_0xa2c0a5[_0x555c21(0x175)]),_0x264e18=asRecord(_0xffedea[_0x555c21(0x139)]),_0x2322e3=asRecord(_0x264e18[_0x555c21(0x161)]),_0x4b19b7=asRecord(_0xffedea[_0x555c21(0xfe)]),_0x5f06c0=Array[_0x555c21(0x158)](_0x2322e3[_0x555c21(0x13c)+'s'])?_0x2322e3['extraDir'+'s']:[];return{'providerCount':Object[_0x555c21(0x170)](_0x1de8ee)['length'],'defaultModel':getTrimmedString(_0x682e1f['primary']),'pluginEntryCount':Object[_0x555c21(0x170)](_0x1a601c)[_0x555c21(0x15b)],'pluginAllowCount':Array['isArray'](_0xa2c0a5['allow'])?_0xa2c0a5[_0x555c21(0x168)]['length']:0x0,'skillExtraDirCount':_0x5f06c0[_0x555c21(0x15b)],'sessionDmScope':getTrimmedString(_0x4b19b7['dmScope'])};}function syncProductModels(_0x101ec5,_0x22ce61){const _0x3cdc8c=_0x17f4d0;if(!hasMeaningfulProductModels(_0x22ce61))return{'config':_0x101ec5,'changed':![]};let _0x1bf28b=![];const _0x2cd1b2=asRecord(_0x22ce61['models']),_0x5749d1=asRecord(_0x2cd1b2['provider'+'s']),_0x286aa3=getTrimmedString(_0x2cd1b2[_0x3cdc8c(0x17f)+_0x3cdc8c(0x126)]),_0x4dd78c=asRecord(_0x101ec5[_0x3cdc8c(0x103)]),_0x40fe02=asRecord(_0x4dd78c[_0x3cdc8c(0x100)+'s']);for(const [_0x28cd88,_0x2ed5c9]of Object['entries'](_0x5749d1)){const _0x1cb1a5=asRecord(_0x40fe02[_0x28cd88]),_0x3d330b=asRecord(_0x2ed5c9);JSON[_0x3cdc8c(0x178)+'y'](_0x1cb1a5)!==JSON[_0x3cdc8c(0x178)+'y'](_0x3d330b)&&(_0x40fe02[_0x28cd88]=_0x3d330b,_0x1bf28b=!![]);}_0x4dd78c[_0x3cdc8c(0x14d)]!==_0x3cdc8c(0x131)&&(_0x4dd78c[_0x3cdc8c(0x14d)]='merge',_0x1bf28b=!![]);_0x4dd78c[_0x3cdc8c(0x100)+'s']!==_0x40fe02&&(_0x4dd78c[_0x3cdc8c(0x100)+'s']=_0x40fe02,_0x1bf28b=!![]);_0x101ec5[_0x3cdc8c(0x103)]!==_0x4dd78c&&(_0x101ec5[_0x3cdc8c(0x103)]=_0x4dd78c,_0x1bf28b=!![]);if(_0x286aa3){const _0xf810fd=asRecord(_0x101ec5['agents']),_0x2d4d2b=asRecord(_0xf810fd[_0x3cdc8c(0x186)]),_0x16d721=asRecord(_0x2d4d2b[_0x3cdc8c(0x188)]);_0x16d721[_0x3cdc8c(0x10c)]!==_0x286aa3&&(_0x2d4d2b[_0x3cdc8c(0x188)]={..._0x16d721,'primary':_0x286aa3},_0xf810fd[_0x3cdc8c(0x186)]=_0x2d4d2b,_0x101ec5['agents']=_0xf810fd,_0x1bf28b=!![]);}return{'config':_0x101ec5,'changed':_0x1bf28b};}export function createConfigController(_0x34d030){const _0x5859e5=_0x17f4d0,_0x25626a=getConfigPaths(_0x34d030),_0x3f4277=createRuntimeLogger(_0x25626a,_0x5859e5(0x14c));let _0x57d797=![],_0x48e6ed=0x0,_0x4161e0=null,_0x216b4a=null;function _0x258400(){const _0x466017=_0x5859e5;return _0x25626a[_0x466017(0x129)+'th'];}function _0x2ea794(){const _0x599c4f=_0x5859e5;return _0x25626a[_0x599c4f(0x13e)];}function _0x391fa9(){const _0x5002fc=_0x5859e5;return _0x25626a[_0x5002fc(0x137)+_0x5002fc(0x113)+'th'];}async function _0x14ca9e(){const _0x462f07=_0x5859e5;await ensureShellStateDirs(_0x34d030),process.env.OPENCLAW_STATE_DIR=_0x25626a['stateDir'],process.env.OPENCLAW_CONFIG_PATH=_0x25626a[_0x462f07(0x129)+'th'],_0x3f4277?.[_0x462f07(0x167)](_0x462f07(0x128)+_0x462f07(0x125)+_0x462f07(0x187)+_0x462f07(0x151)+_0x462f07(0x142),{'stateDir':_0x25626a['stateDir'],'configPath':_0x25626a[_0x462f07(0x129)+'th'],'logsDir':_0x25626a[_0x462f07(0x12e)]});}async function _0x36b57a(){const _0x1df3d2=_0x5859e5,_0x4fc2aa=Date[_0x1df3d2(0x162)]();_0x3f4277?.[_0x1df3d2(0x167)](_0x1df3d2(0x174)+_0x1df3d2(0x121)+_0x1df3d2(0x135)+_0x1df3d2(0x11c)+'tarted',{'configPath':_0x25626a['configPa'+'th'],'stateDir':_0x25626a[_0x1df3d2(0x13e)]});try{await _0x14ca9e();const _0x218090=await loadRuntimeInfo(_0x34d030[_0x1df3d2(0x169)+_0x1df3d2(0x12d)]);_0x3f4277?.[_0x1df3d2(0x167)]('runtime\x20'+_0x1df3d2(0x119)+_0x1df3d2(0x12b)+_0x1df3d2(0x11c)+_0x1df3d2(0x10f),{'runtimeRoot':_0x218090['runtimeR'+'oot'],'manifest':summarizeRuntimeManifest(_0x218090[_0x1df3d2(0xfd)])});if(!existsSync(_0x25626a[_0x1df3d2(0x129)+'th'])){const _0x10ebdb=createInitialOpenClawConfig(_0x34d030,_0x218090);_0x3f4277?.[_0x1df3d2(0x167)](_0x1df3d2(0x171)+'openclaw'+_0x1df3d2(0x125)+'missing;'+_0x1df3d2(0x140)+'g',{'configPath':_0x25626a[_0x1df3d2(0x129)+'th'],'config':summarizeOpenClawConfig(_0x10ebdb)}),_0x261716(),await _0x2ad1da(_0x10ebdb,_0x1df3d2(0x171)+'openclaw'+_0x1df3d2(0x125)+_0x1df3d2(0x13d)),await writeJson(_0x25626a[_0x1df3d2(0x176)+_0x1df3d2(0x105)+'th'],_0x10ebdb),_0x3f4277?.[_0x1df3d2(0x167)]('last-goo'+'d\x20opencl'+_0x1df3d2(0x115)+_0x1df3d2(0x146)+'n',{'path':_0x25626a[_0x1df3d2(0x176)+_0x1df3d2(0x105)+'th'],'reason':_0x1df3d2(0x171)+_0x1df3d2(0x128)+_0x1df3d2(0x125)+_0x1df3d2(0x13d)});}else _0x3f4277?.[_0x1df3d2(0x167)](_0x1df3d2(0x171)+_0x1df3d2(0x128)+'\x20config\x20'+_0x1df3d2(0x180),{'configPath':_0x25626a[_0x1df3d2(0x129)+'th']});await _0x133fa0(),await _0x1d708a(),_0x3f4277?.[_0x1df3d2(0x167)](_0x1df3d2(0x174)+_0x1df3d2(0x121)+_0x1df3d2(0x135)+'config\x20c'+_0x1df3d2(0x18a),{'durationMs':Date[_0x1df3d2(0x162)]()-_0x4fc2aa});}catch(_0x3ff96e){_0x3f4277?.[_0x1df3d2(0x102)](_0x1df3d2(0x174)+_0x1df3d2(0x121)+'penclaw\x20'+_0x1df3d2(0x136)+'ailed',{'durationMs':Date[_0x1df3d2(0x162)]()-_0x4fc2aa,'error':_0x3ff96e});throw _0x3ff96e;}}async function _0x2eea59(){const _0x37b162=_0x5859e5;return await _0x36b57a(),readJsonFile(_0x25626a[_0x37b162(0x129)+'th'],{});}async function _0x5590e6(){const _0x19820b=_0x5859e5;return readJsonFile(_0x25626a[_0x19820b(0x129)+'th'],{});}async function _0x2ad1da(_0x20cf80,_0x5591d8='openclaw'+'\x20config\x20'+_0x5859e5(0x15d)){const _0x3fde7b=_0x5859e5;await mkdir(dirname(_0x25626a[_0x3fde7b(0x129)+'th']),{'recursive':!![]}),await writeFile(_0x25626a[_0x3fde7b(0x129)+'th'],JSON[_0x3fde7b(0x178)+'y'](_0x20cf80,null,0x2)+'\x0a',_0x3fde7b(0x124)),_0x3f4277?.[_0x3fde7b(0x167)](_0x5591d8,{'configPath':_0x25626a[_0x3fde7b(0x129)+'th'],'config':summarizeOpenClawConfig(_0x20cf80)});}async function _0x1d708a(){const _0xb7102f=_0x5859e5,_0x5a3b0a=await loadRuntimeInfo(_0x34d030[_0xb7102f(0x169)+'oot']),_0x59bcd4=await _0x5590e6(),_0x392395=syncRuntimeManifestPlugins(_0x59bcd4['plugins'],_0x5a3b0a['plugins']);_0x392395[_0xb7102f(0x145)]||!_0x59bcd4['plugins']?(_0x59bcd4[_0xb7102f(0x17e)]=_0x392395['plugins'],_0x261716(),await _0x2ad1da(_0x59bcd4,_0xb7102f(0x114)+_0xb7102f(0x138)+'synced\x20i'+'nto\x20open'+_0xb7102f(0x10b)+_0xb7102f(0x179)),_0x3f4277?.['info'](_0xb7102f(0x114)+_0xb7102f(0x10a)+_0xb7102f(0x11b)+_0xb7102f(0x104),{'runtimePluginCount':_0x5a3b0a[_0xb7102f(0x17e)]['length'],'config':summarizeOpenClawConfig(_0x59bcd4)})):_0x3f4277?.[_0xb7102f(0x167)]('runtime\x20'+_0xb7102f(0x10a)+_0xb7102f(0x111)+'ready\x20cu'+'rrent',{'runtimePluginCount':_0x5a3b0a[_0xb7102f(0x17e)][_0xb7102f(0x15b)]});}async function _0x133fa0(){const _0x41b247=_0x5859e5,_0x347aa5=await _0x5590e6(),_0x12339e=syncProductModels(_0x347aa5,_0x34d030);_0x12339e[_0x41b247(0x145)]?(await _0x29c3cc(_0x12339e[_0x41b247(0x14c)],'product\x20'+'model\x20co'+'nfig\x20upd'+_0x41b247(0x144)),_0x3f4277?.[_0x41b247(0x167)](_0x41b247(0x14a)+_0x41b247(0x16e)+_0x41b247(0x15a)+_0x41b247(0x165),{'config':summarizeOpenClawConfig(_0x12339e['config'])})):_0x3f4277?.[_0x41b247(0x167)](_0x41b247(0x14a)+_0x41b247(0x16e)+_0x41b247(0x10e)+'eady\x20cur'+'rent',{'hasProductModels':hasMeaningfulProductModels(_0x34d030)});}async function _0x592570(){const _0xb9321b=_0x5859e5;await _0x36b57a();const _0x3e6bfe=await _0x5e9967({'port':portNumbers(_0x34d030[_0xb9321b(0x116)][_0xb9321b(0x130)+_0xb9321b(0x16d)],_0x34d030[_0xb9321b(0x116)][_0xb9321b(0x130)+'tart']+0x63)});return{'token':createToken(),'port':_0x3e6bfe};}async function _0x4a7f1a(){const _0x2519ef=_0x5859e5,_0x1c2a45=await _0x2eea59(),_0x52a0ac=asRecord(_0x1c2a45[_0x2519ef(0x16c)]),_0x222b41=asRecord(_0x52a0ac[_0x2519ef(0x186)]),_0x45d417=asRecord(_0x222b41[_0x2519ef(0x188)]),_0x44be30=getTrimmedString(_0x45d417[_0x2519ef(0x10c)]),_0x3d3988=_0x44be30[_0x2519ef(0x120)]('/'),_0x323808=_0x3d3988>0x0?_0x44be30[_0x2519ef(0x14b)](0x0,_0x3d3988):_0x44be30,_0x13f8a9=_0x3d3988>0x0?_0x44be30[_0x2519ef(0x14b)](_0x3d3988+0x1):'',_0x2384bf=asRecord(asRecord(_0x1c2a45[_0x2519ef(0x103)])[_0x2519ef(0x100)+'s']),_0x18500c=asRecord(_0x2384bf[_0x323808]);return{'provider':_0x323808||'','apiKey':getTrimmedString(_0x18500c['apiKey']),'modelName':_0x13f8a9,'modelBaseUrl':getTrimmedString(_0x18500c[_0x2519ef(0x15f)])};}async function _0x313d59(_0x13e0f2,_0x5e4dba={}){const _0x2d8fce=_0x5859e5,_0x4c2dc4=await _0x2eea59(),_0x465f35=_0x13e0f2[_0x2d8fce(0x100)]||_0x2d8fce(0x164),_0x273154=_0x465f35+'/'+_0x13e0f2[_0x2d8fce(0x16a)+'e'],_0x386fb4=asRecord(_0x4c2dc4[_0x2d8fce(0x103)]),_0x53bfd3=asRecord(_0x386fb4[_0x2d8fce(0x100)+'s']);_0x53bfd3[_0x465f35]={...asRecord(_0x53bfd3[_0x465f35]),...createProviderConfig({'apiKey':_0x13e0f2[_0x2d8fce(0x15e)]||'','protocol':_0x13e0f2[_0x2d8fce(0x155)]||_0x2d8fce(0x149),'baseUrl':_0x13e0f2['modelBas'+_0x2d8fce(0x17b)]||_0x13e0f2[_0x2d8fce(0x15f)]||'','modelName':_0x13e0f2[_0x2d8fce(0x16a)+'e']})},_0x386fb4[_0x2d8fce(0x100)+'s']=_0x53bfd3,_0x4c2dc4[_0x2d8fce(0x103)]=_0x386fb4;const _0x338eae=asRecord(_0x4c2dc4['agents']),_0x2071e5=asRecord(_0x338eae[_0x2d8fce(0x186)]);return _0x2071e5[_0x2d8fce(0x188)]={...asRecord(_0x2071e5[_0x2d8fce(0x188)]),'primary':_0x273154},_0x2071e5[_0x2d8fce(0x103)]={...asRecord(_0x2071e5[_0x2d8fce(0x103)]),[_0x273154]:asRecord(asRecord(_0x2071e5['models'])[_0x273154])},_0x338eae['defaults']=_0x2071e5,_0x4c2dc4[_0x2d8fce(0x16c)]=_0x338eae,_0x4c2dc4[_0x2d8fce(0xfe)]={...asRecord(_0x4c2dc4[_0x2d8fce(0xfe)]),'dmScope':_0x2d8fce(0x154)+_0x2d8fce(0x184)},await _0x29c3cc(_0x4c2dc4,_0x5e4dba[_0x2d8fce(0x183)+'nChange']?'model\x20se'+'ttings\x20u'+'pdated':''),{'ok':!![]};}async function _0x83cc56(_0x399578){const _0x577bf6=_0x5859e5,_0x98149b=await _0x2eea59(),_0x2bb33d=_0x399578[_0x577bf6(0x100)+'Key'],_0x32513a=asRecord(_0x98149b['models']),_0x7beef=asRecord(_0x32513a[_0x577bf6(0x100)+'s']);_0x7beef[_0x2bb33d]={...asRecord(_0x7beef[_0x2bb33d]),'apiKey':_0x399578[_0x577bf6(0x15e)],'api':_0x577bf6(0x10d)+_0x577bf6(0x16f)+'ns','baseUrl':_0x399578[_0x577bf6(0x15f)],'models':(_0x399578['modelNam'+'es']??[])['map'](_0x53f021=>createProviderModelConfig(_0x53f021,_0x53f021===_0x399578[_0x577bf6(0x13a)+'elPrimar'+_0x577bf6(0x106)]))},_0x32513a[_0x577bf6(0x100)+'s']=_0x7beef,_0x98149b['models']=_0x32513a;if(_0x399578[_0x577bf6(0x13a)+_0x577bf6(0x107)+_0x577bf6(0x106)]){const _0x1ad9eb=asRecord(_0x98149b['agents']),_0x11fc29=asRecord(_0x1ad9eb[_0x577bf6(0x186)]);_0x11fc29[_0x577bf6(0x13a)+'el']={...asRecord(_0x11fc29['imageMod'+'el']),'primary':_0x2bb33d+'/'+_0x399578[_0x577bf6(0x13a)+'elPrimar'+_0x577bf6(0x106)]},_0x1ad9eb[_0x577bf6(0x186)]=_0x11fc29,_0x98149b[_0x577bf6(0x16c)]=_0x1ad9eb;}return await _0x29c3cc(_0x98149b,_0x577bf6(0x160)+_0x577bf6(0x152)+'dels\x20upd'+_0x577bf6(0x144)),{'ok':!![]};}async function _0xb370da({callbackUrl:_0x32f35b,secret:_0x35db08}){const _0xb7f5e5=_0x5859e5,_0x4cca42=await _0x2eea59(),_0x129a10=asRecord(_0x4cca42[_0xb7f5e5(0x17e)]),_0x159c54=asRecord(_0x129a10['entries']),_0x58df5c=asRecord(_0x159c54[ASK_USER_QUESTION_PLUGIN_ID]);return _0x159c54[ASK_USER_QUESTION_PLUGIN_ID]={..._0x58df5c,'enabled':!![],'config':{...asRecord(_0x58df5c[_0xb7f5e5(0x14c)]),'callbackUrl':_0x32f35b,'secret':_0x35db08}},_0x129a10[_0xb7f5e5(0x175)]=_0x159c54,_0x129a10[_0xb7f5e5(0x168)]=dedupeStrings([...(Array['isArray'](_0x129a10[_0xb7f5e5(0x168)])?_0x129a10[_0xb7f5e5(0x168)]:[])[_0xb7f5e5(0x118)](Boolean),ASK_USER_QUESTION_PLUGIN_ID]),_0x4cca42[_0xb7f5e5(0x17e)]=_0x129a10,await _0x29c3cc(_0x4cca42,''),{'ok':!![]};}async function _0x29c3cc(_0x1aa848,_0x418d0a=''){const _0x5c9185=_0x5859e5;_0x261716(),await _0x2ad1da(_0x1aa848,_0x418d0a||_0x5c9185(0x128)+_0x5c9185(0x125)+'persiste'+'d'),await writeJsonFile(_0x25626a['lastGood'+_0x5c9185(0x105)+'th'],_0x1aa848),_0x3f4277?.[_0x5c9185(0x167)](_0x5c9185(0x172)+_0x5c9185(0x17c)+_0x5c9185(0x115)+'g\x20writte'+'n',{'path':_0x25626a[_0x5c9185(0x176)+_0x5c9185(0x105)+'th'],'reason':_0x418d0a||_0x5c9185(0x128)+_0x5c9185(0x125)+_0x5c9185(0x11e)+'d'});if(_0x418d0a)_0x27bc2b(_0x418d0a);}function _0x261716(){if(_0x57d797)_0x48e6ed+=0x1;}function _0x5b2176(_0x726054){_0x216b4a=_0x726054;}function _0x27bc2b(_0x3e1d35){const _0x37ed03=_0x5859e5;if(!_0x216b4a)return;if(_0x4161e0)clearTimeout(_0x4161e0);_0x3f4277?.[_0x37ed03(0x167)]('gateway\x20'+_0x37ed03(0x101)+_0x37ed03(0xff)+_0x37ed03(0x159)+_0x37ed03(0x134)+'ge',{'reason':_0x3e1d35,'debounceMs':0xfa}),_0x4161e0=setTimeout(()=>_0x216b4a(_0x3e1d35),0xfa);}function _0x1dc08b(){const _0x4dc782=_0x5859e5;unwatchFile(_0x25626a[_0x4dc782(0x129)+'th']),_0x57d797=!![],watchFile(_0x25626a[_0x4dc782(0x129)+'th'],{'interval':0x3e8},(_0x31b968,_0x18abe0)=>{const _0x5ce3c2=_0x4dc782;if(_0x31b968[_0x5ce3c2(0x185)]===_0x18abe0['mtimeMs'])return;if(_0x48e6ed>0x0){_0x48e6ed-=0x1,_0x3f4277?.['info']('config\x20f'+_0x5ce3c2(0x12a)+_0x5ce3c2(0x123)+'red\x20inte'+_0x5ce3c2(0x108)+'te',{'configPath':_0x25626a['configPa'+'th'],'ignoredConfigWatchReloads':_0x48e6ed});return;}_0x3f4277?.[_0x5ce3c2(0x167)](_0x5ce3c2(0x136)+_0x5ce3c2(0x12a)+_0x5ce3c2(0x11a)+'rved\x20ext'+_0x5ce3c2(0x157)+'ange',{'configPath':_0x25626a[_0x5ce3c2(0x129)+'th']}),_0x27bc2b(_0x5ce3c2(0x153)+'hange');});}function _0x59d978(){const _0x34651c=_0x5859e5;if(_0x4161e0)clearTimeout(_0x4161e0);unwatchFile(_0x25626a[_0x34651c(0x129)+'th']),_0x57d797=![],_0x48e6ed=0x0;}return{'paths':_0x25626a,'resolveConfigPath':_0x258400,'resolveStateDir':_0x2ea794,'resolveDeviceIdentityPath':_0x391fa9,'ensureConfigPathEnv':_0x14ca9e,'ensureInitialConfig':_0x36b57a,'ensureGatewaySettings':_0x592570,'readConfig':_0x2eea59,'writeConfig':_0x2ad1da,'syncRuntimePlugins':_0x1d708a,'getModelSettings':_0x4a7f1a,'setModelSettings':_0x313d59,'setSelfOperatedModels':_0x83cc56,'ensureAskUserQuestionPluginConfig':_0xb370da,'markConfigWriteHandledInternally':_0x261716,'setGatewayRestartHandler':_0x5b2176,'watchConfigChanges':_0x1dc08b,'dispose':_0x59d978};}
1
+ const _0x382e09=_0x4756;(function(_0x3233bc,_0x2d16cd){const _0x4afdf9=_0x4756,_0x17263b=_0x3233bc();while(!![]){try{const _0x59748b=-parseInt(_0x4afdf9(0x99))/0x1*(parseInt(_0x4afdf9(0xcb))/0x2)+-parseInt(_0x4afdf9(0xf5))/0x3*(parseInt(_0x4afdf9(0xa3))/0x4)+-parseInt(_0x4afdf9(0xae))/0x5+parseInt(_0x4afdf9(0x100))/0x6*(-parseInt(_0x4afdf9(0x105))/0x7)+parseInt(_0x4afdf9(0xc7))/0x8*(-parseInt(_0x4afdf9(0xec))/0x9)+parseInt(_0x4afdf9(0xfe))/0xa*(parseInt(_0x4afdf9(0xd3))/0xb)+parseInt(_0x4afdf9(0xc4))/0xc*(parseInt(_0x4afdf9(0xb7))/0xd);if(_0x59748b===_0x2d16cd)break;else _0x17263b['push'](_0x17263b['shift']());}catch(_0x25e5c3){_0x17263b['push'](_0x17263b['shift']());}}}(_0x2ad1,0x8fe5f));import{randomBytes}from'node:crypto';import{existsSync,unwatchFile,watchFile}from'node:fs';import{mkdir,writeFile}from'node:fs/promises';function _0x2ad1(){const _0x19f648=['anthropi','ompleted','1353HoXAFH','per-chan','map','pdated','gateway\x20','exists','image','stringif','\x20for\x20con','error','session','mtimeMs','ced','her\x20obse','ConfigPa','idle','ync','onfig\x20ch','runtimeR','memory','nfig\x20syn','last-goo','push','c-messag','256kb','5068899ODAJPD','configPa','modelNam','openclaw','ready\x20cu','openai-c','ent\x20ensu','compat','g\x20writte','24pDclEK','now','config\x20s','rnal\x20wri','nto\x20open','ompletio','mode','models','persiste','46910LtFDAX','dmScope','1767732GixVmA','logsDir','gatewayS','config','Key','21TsjPpw','fig\x20chan','info\x20loa','defaults','ttings\x20u','manifest','info','nel-peer','tarted','ensure\x20i','workspac','hex','penclaw\x20','fig','ange','\x20config\x20','model\x20se','skills','deviceId','extraDir','text','product\x20','config\x20c','onfig\x20al','yName','length','memory-c','odel','baseUrl','-questio','utf8','provider','config\x20f','tart','eady\x20cur','plugins','entries','nitial\x20o','her\x20igno','8KJnlkt','ing','toString','ports','primary','emory','oot','modelBas','initial\x20','plugins\x20','160632IWumGR','eUrl','reload\x20s','full','self-ope','filter','ated','model','agents','protocol','model\x20co','4344865OAfexQ','nfig\x20alr','rrent','aw\x20confi','pluginId','runtime\x20','plugin\x20c','merge','stateDir','4886102sLadWU','isArray','ailed','slice','imageMod','red','allow','local','projectR','toISOStr','changed','hange','red\x20inte','96FeFEkP','apiKey','defaultM','8ElLbUY','lastGood','indexOf','nChange','89276UkIyDW','d\x20opencl','ask-user','written','rved\x20ext','active-m'];_0x2ad1=function(){return _0x19f648;};return _0x2ad1();}import{dirname,join}from'node:path';function _0x4756(_0x210d88,_0x4cb2f9){_0x210d88=_0x210d88-0x8f;const _0x2ad19f=_0x2ad1();let _0x47567a=_0x2ad19f[_0x210d88];return _0x47567a;}import _0x5e04fc,{portNumbers}from'get-port';import{ensureShellStateDirs,getConfigPaths,readJsonFile,writeJsonFile}from'@wujie-shell/config';import{asRecord,dedupeStrings,getTrimmedString,writeJson}from'./utils.mjs';import{loadRuntimeInfo}from'./runtime.mjs';import{createRuntimeLogger,summarizeRuntimeManifest}from'./runtime-logger.mjs';import{syncRuntimeManifestPlugins}from'./plugin-sync.mjs';const MEMORY_CORE_PLUGIN_ID=_0x382e09(0x11f)+'ore',ACTIVE_MEMORY_PLUGIN_ID=_0x382e09(0xd0)+_0x382e09(0x9e),ASK_USER_QUESTION_PLUGIN_ID=_0x382e09(0xcd)+_0x382e09(0x8f)+'n';function createToken(){const _0x47af4f=_0x382e09;return randomBytes(0x18)[_0x47af4f(0x9b)](_0x47af4f(0x110));}function createProviderModelConfig(_0x34fd0d,_0x535b70=![]){const _0xad7efe=_0x382e09;return{'id':_0x34fd0d,'name':_0x34fd0d,'reasoning':!![],'input':_0x535b70?[_0xad7efe(0x119),_0xad7efe(0xd9)]:['text'],'cost':{'input':0x0,'output':0x0,'cacheRead':0x0,'cacheWrite':0x0},'contextWindow':0x3e800,'maxTokens':0x3e800};}function createProviderConfig(_0x467ade){const _0x3e08e5=_0x382e09;return{'apiKey':_0x467ade[_0x3e08e5(0xc5)],'api':_0x467ade[_0x3e08e5(0xac)]===_0x3e08e5(0xd1)+'c'?_0x3e08e5(0xd1)+_0x3e08e5(0xea)+'es':_0x3e08e5(0xf1)+_0x3e08e5(0xfa)+'ns',..._0x467ade[_0x3e08e5(0x121)]?{'baseUrl':_0x467ade[_0x3e08e5(0x121)]}:{},'models':[createProviderModelConfig(_0x467ade[_0x3e08e5(0xee)+'e'])]};}function createRuntimePluginBootstrap(_0x373a98){const _0x15e4c9=_0x382e09,_0xbe4663={},_0xff34e1=[];for(const _0x3a5be9 of _0x373a98??[]){const _0x3d7575=getTrimmedString(_0x3a5be9[_0x15e4c9(0xb2)]);if(!_0x3d7575)continue;_0xbe4663[_0x3d7575]={'enabled':!![]},_0xff34e1[_0x15e4c9(0xe9)](_0x3d7575);}return!_0xbe4663[MEMORY_CORE_PLUGIN_ID]&&(_0xbe4663[MEMORY_CORE_PLUGIN_ID]={'enabled':!![],'config':{'dreaming':{'enabled':!![]}}}),!_0xbe4663[ACTIVE_MEMORY_PLUGIN_ID]&&(_0xbe4663[ACTIVE_MEMORY_PLUGIN_ID]={'enabled':!![]}),{'entries':_0xbe4663,'allow':dedupeStrings([..._0xff34e1,MEMORY_CORE_PLUGIN_ID,ACTIVE_MEMORY_PLUGIN_ID]),'bundledDiscovery':_0x15e4c9(0xf3)};}function createInitialOpenClawConfig(_0x6ec7e0,_0x3a5a73){const _0x29b916=_0x382e09,_0x43bd14=new Date()[_0x29b916(0xc0)+_0x29b916(0x9a)](),_0x512d9e=join(_0x6ec7e0['dataDir'],_0x29b916(0x10f)+'e'),_0x1f9670=asRecord(_0x6ec7e0['models']),_0x5c6ea9=getTrimmedString(_0x1f9670[_0x29b916(0xc6)+_0x29b916(0x120)]),_0x180c65={'workspace':_0x512d9e,'memorySearch':{'enabled':!![],'sources':[_0x29b916(0xe6)],'provider':'auto'},'compaction':{'memoryFlush':{'enabled':!![],'forceFlushTranscriptBytes':_0x29b916(0xeb),'softThresholdTokens':0x30d40}}};return _0x5c6ea9&&(_0x180c65[_0x29b916(0xaa)]={'primary':_0x5c6ea9}),{'meta':{'lastTouchedVersion':_0x3a5a73[_0x29b916(0xef)+'Version'],'lastTouchedAt':_0x43bd14},'wizard':{'lastRunAt':_0x43bd14,'lastRunVersion':_0x3a5a73['openclaw'+'Version'],'lastRunCommand':'onboard','lastRunMode':_0x29b916(0xbe)},'models':{'mode':_0x29b916(0xb5),'providers':asRecord(_0x1f9670[_0x29b916(0x91)+'s'])},'agents':{'defaults':_0x180c65},'tools':{'profile':_0x29b916(0xa6)},'plugins':createRuntimePluginBootstrap(_0x3a5a73['plugins']),'skills':{'load':{'extraDirs':['skills']}},'session':{'dmScope':_0x29b916(0xd4)+_0x29b916(0x10c),'reset':{'mode':_0x29b916(0xe2)}}};}function hasMeaningfulProductModels(_0x21dcc4){const _0xa10f64=_0x382e09,_0x902f3=asRecord(_0x21dcc4[_0xa10f64(0xfc)]);return Object['keys'](asRecord(_0x902f3[_0xa10f64(0x91)+'s']))[_0xa10f64(0x11e)]>0x0||Boolean(getTrimmedString(_0x902f3[_0xa10f64(0xc6)+_0xa10f64(0x120)]));}function summarizeOpenClawConfig(_0x5eeb74){const _0x143956=_0x382e09,_0x488566=asRecord(_0x5eeb74[_0x143956(0xfc)]),_0x264ad9=asRecord(_0x488566['provider'+'s']),_0x33f295=asRecord(_0x5eeb74[_0x143956(0xab)]),_0x395072=asRecord(_0x33f295[_0x143956(0x108)]),_0x2f53b3=asRecord(_0x395072['model']),_0x2fc840=asRecord(_0x5eeb74['plugins']),_0x49aa7a=asRecord(_0x2fc840[_0x143956(0x96)]),_0x5b6585=asRecord(_0x5eeb74[_0x143956(0x116)]),_0x43f553=asRecord(_0x5b6585['load']),_0x53a048=asRecord(_0x5eeb74[_0x143956(0xdd)]),_0x5c749b=Array['isArray'](_0x43f553[_0x143956(0x118)+'s'])?_0x43f553[_0x143956(0x118)+'s']:[];return{'providerCount':Object['keys'](_0x264ad9)[_0x143956(0x11e)],'defaultModel':getTrimmedString(_0x2f53b3[_0x143956(0x9d)]),'pluginEntryCount':Object['keys'](_0x49aa7a)[_0x143956(0x11e)],'pluginAllowCount':Array['isArray'](_0x2fc840[_0x143956(0xbd)])?_0x2fc840['allow'][_0x143956(0x11e)]:0x0,'skillExtraDirCount':_0x5c749b[_0x143956(0x11e)],'sessionDmScope':getTrimmedString(_0x53a048[_0x143956(0xff)])};}function syncProductModels(_0x3e9a39,_0x15786b){const _0x51ab2e=_0x382e09;if(!hasMeaningfulProductModels(_0x15786b))return{'config':_0x3e9a39,'changed':![]};let _0x51966f=![];const _0x481e66=asRecord(_0x15786b[_0x51ab2e(0xfc)]),_0xc8ad18=asRecord(_0x481e66[_0x51ab2e(0x91)+'s']),_0x33e31b=getTrimmedString(_0x481e66[_0x51ab2e(0xc6)+_0x51ab2e(0x120)]),_0x44462f=asRecord(_0x3e9a39['models']),_0x1a3655=asRecord(_0x44462f[_0x51ab2e(0x91)+'s']);for(const [_0x43b7ea,_0x42676c]of Object['entries'](_0xc8ad18)){const _0x5b23ef=asRecord(_0x1a3655[_0x43b7ea]),_0x1287bd=asRecord(_0x42676c);JSON[_0x51ab2e(0xda)+'y'](_0x5b23ef)!==JSON['stringif'+'y'](_0x1287bd)&&(_0x1a3655[_0x43b7ea]=_0x1287bd,_0x51966f=!![]);}_0x44462f[_0x51ab2e(0xfb)]!==_0x51ab2e(0xb5)&&(_0x44462f[_0x51ab2e(0xfb)]=_0x51ab2e(0xb5),_0x51966f=!![]);_0x44462f['provider'+'s']!==_0x1a3655&&(_0x44462f[_0x51ab2e(0x91)+'s']=_0x1a3655,_0x51966f=!![]);_0x3e9a39[_0x51ab2e(0xfc)]!==_0x44462f&&(_0x3e9a39[_0x51ab2e(0xfc)]=_0x44462f,_0x51966f=!![]);if(_0x33e31b){const _0x510239=asRecord(_0x3e9a39[_0x51ab2e(0xab)]),_0x4983ea=asRecord(_0x510239[_0x51ab2e(0x108)]),_0x3da56d=asRecord(_0x4983ea[_0x51ab2e(0xaa)]);_0x3da56d['primary']!==_0x33e31b&&(_0x4983ea[_0x51ab2e(0xaa)]={..._0x3da56d,'primary':_0x33e31b},_0x510239[_0x51ab2e(0x108)]=_0x4983ea,_0x3e9a39[_0x51ab2e(0xab)]=_0x510239,_0x51966f=!![]);}return{'config':_0x3e9a39,'changed':_0x51966f};}export function createConfigController(_0x3cda29){const _0x27feac=_0x382e09,_0x52d9f2=getConfigPaths(_0x3cda29),_0x29b4a0=createRuntimeLogger(_0x52d9f2,'config');let _0x27aa30=![],_0x22f32c=0x0,_0x26c575=null,_0x1f1b52=null;function _0x3bcafb(){return _0x52d9f2['configPa'+'th'];}function _0x2bfe6f(){const _0x284c17=_0x4756;return _0x52d9f2[_0x284c17(0xb6)];}function _0x9df177(){const _0x54d7e6=_0x4756;return _0x52d9f2[_0x54d7e6(0x117)+'entityPa'+'th'];}async function _0x16578d(){const _0x33a19d=_0x4756;await ensureShellStateDirs(_0x3cda29),process.env.OPENCLAW_STATE_DIR=_0x52d9f2[_0x33a19d(0xb6)],process.env.OPENCLAW_CONFIG_PATH=_0x52d9f2[_0x33a19d(0xed)+'th'],_0x29b4a0?.[_0x33a19d(0x10b)]('openclaw'+_0x33a19d(0x114)+'environm'+_0x33a19d(0xf2)+_0x33a19d(0xbc),{'stateDir':_0x52d9f2[_0x33a19d(0xb6)],'configPath':_0x52d9f2[_0x33a19d(0xed)+'th'],'logsDir':_0x52d9f2[_0x33a19d(0x101)]});}async function _0x49612c(){const _0x59e26c=_0x4756,_0x26687d=Date[_0x59e26c(0xf6)]();_0x29b4a0?.['info']('ensure\x20i'+_0x59e26c(0x97)+_0x59e26c(0x111)+'config\x20s'+_0x59e26c(0x10d),{'configPath':_0x52d9f2[_0x59e26c(0xed)+'th'],'stateDir':_0x52d9f2[_0x59e26c(0xb6)]});try{await _0x16578d();const _0x48a743=await loadRuntimeInfo(_0x3cda29[_0x59e26c(0xbf)+'oot']);_0x29b4a0?.['info'](_0x59e26c(0xb3)+_0x59e26c(0x107)+'ded\x20for\x20'+_0x59e26c(0xf7)+_0x59e26c(0xe3),{'runtimeRoot':_0x48a743[_0x59e26c(0xe5)+_0x59e26c(0x9f)],'manifest':summarizeRuntimeManifest(_0x48a743[_0x59e26c(0x10a)])});if(!existsSync(_0x52d9f2[_0x59e26c(0xed)+'th'])){const _0x221635=createInitialOpenClawConfig(_0x3cda29,_0x48a743);_0x29b4a0?.['info'](_0x59e26c(0xa1)+_0x59e26c(0xef)+_0x59e26c(0x114)+'missing;'+'\x20creatin'+'g',{'configPath':_0x52d9f2[_0x59e26c(0xed)+'th'],'config':summarizeOpenClawConfig(_0x221635)}),_0x7b32bd(),await _0x574c39(_0x221635,_0x59e26c(0xa1)+_0x59e26c(0xef)+_0x59e26c(0x114)+'created'),await writeJson(_0x52d9f2[_0x59e26c(0xc8)+'ConfigPa'+'th'],_0x221635),_0x29b4a0?.[_0x59e26c(0x10b)](_0x59e26c(0xe8)+'d\x20opencl'+_0x59e26c(0xb1)+_0x59e26c(0xf4)+'n',{'path':_0x52d9f2[_0x59e26c(0xc8)+_0x59e26c(0xe1)+'th'],'reason':_0x59e26c(0xa1)+'openclaw'+_0x59e26c(0x114)+'created'});}else _0x29b4a0?.[_0x59e26c(0x10b)](_0x59e26c(0xa1)+_0x59e26c(0xef)+'\x20config\x20'+_0x59e26c(0xd8),{'configPath':_0x52d9f2[_0x59e26c(0xed)+'th']});await _0x1416f3(),await _0x3f9c43(),_0x29b4a0?.[_0x59e26c(0x10b)]('ensure\x20i'+_0x59e26c(0x97)+_0x59e26c(0x111)+_0x59e26c(0x11b)+_0x59e26c(0xd2),{'durationMs':Date[_0x59e26c(0xf6)]()-_0x26687d});}catch(_0x46f70d){_0x29b4a0?.[_0x59e26c(0xdc)](_0x59e26c(0x10e)+_0x59e26c(0x97)+_0x59e26c(0x111)+'config\x20f'+_0x59e26c(0xb9),{'durationMs':Date[_0x59e26c(0xf6)]()-_0x26687d,'error':_0x46f70d});throw _0x46f70d;}}async function _0x43fe50(){const _0x35bbd4=_0x4756;return await _0x49612c(),readJsonFile(_0x52d9f2[_0x35bbd4(0xed)+'th'],{});}async function _0x4147ff(){return readJsonFile(_0x52d9f2['configPa'+'th'],{});}async function _0x574c39(_0x15cf7f,_0x592d8a=_0x27feac(0xef)+_0x27feac(0x114)+_0x27feac(0xce)){const _0x49a5e9=_0x27feac;await mkdir(dirname(_0x52d9f2[_0x49a5e9(0xed)+'th']),{'recursive':!![]}),await writeFile(_0x52d9f2[_0x49a5e9(0xed)+'th'],JSON[_0x49a5e9(0xda)+'y'](_0x15cf7f,null,0x2)+'\x0a',_0x49a5e9(0x90)),_0x29b4a0?.[_0x49a5e9(0x10b)](_0x592d8a,{'configPath':_0x52d9f2[_0x49a5e9(0xed)+'th'],'config':summarizeOpenClawConfig(_0x15cf7f)});}async function _0x3f9c43(){const _0x4cdcf4=_0x27feac,_0xa03578=await loadRuntimeInfo(_0x3cda29['projectR'+_0x4cdcf4(0x9f)]),_0x144aaf=await _0x4147ff(),_0x12d228=syncRuntimeManifestPlugins(_0x144aaf['plugins'],_0xa03578[_0x4cdcf4(0x95)]);_0x12d228[_0x4cdcf4(0xc1)]||!_0x144aaf[_0x4cdcf4(0x95)]?(_0x144aaf[_0x4cdcf4(0x95)]=_0x12d228[_0x4cdcf4(0x95)],_0x7b32bd(),await _0x574c39(_0x144aaf,_0x4cdcf4(0xb3)+_0x4cdcf4(0xa2)+'synced\x20i'+_0x4cdcf4(0xf9)+'claw\x20con'+_0x4cdcf4(0x112)),_0x29b4a0?.[_0x4cdcf4(0x10b)]('runtime\x20'+_0x4cdcf4(0xb4)+_0x4cdcf4(0xe4)+'anged',{'runtimePluginCount':_0xa03578[_0x4cdcf4(0x95)][_0x4cdcf4(0x11e)],'config':summarizeOpenClawConfig(_0x144aaf)})):_0x29b4a0?.['info'](_0x4cdcf4(0xb3)+_0x4cdcf4(0xb4)+_0x4cdcf4(0x11c)+_0x4cdcf4(0xf0)+_0x4cdcf4(0xb0),{'runtimePluginCount':_0xa03578['plugins']['length']});}async function _0x1416f3(){const _0x40b2c3=_0x27feac,_0x2c4f02=await _0x4147ff(),_0x133dd8=syncProductModels(_0x2c4f02,_0x3cda29);_0x133dd8[_0x40b2c3(0xc1)]?(await _0xeedc9(_0x133dd8[_0x40b2c3(0x103)],_0x40b2c3(0x11a)+_0x40b2c3(0xad)+'nfig\x20upd'+_0x40b2c3(0xa9)),_0x29b4a0?.[_0x40b2c3(0x10b)](_0x40b2c3(0x11a)+_0x40b2c3(0xad)+_0x40b2c3(0xe7)+_0x40b2c3(0xdf),{'config':summarizeOpenClawConfig(_0x133dd8['config'])})):_0x29b4a0?.[_0x40b2c3(0x10b)](_0x40b2c3(0x11a)+_0x40b2c3(0xad)+_0x40b2c3(0xaf)+_0x40b2c3(0x94)+'rent',{'hasProductModels':hasMeaningfulProductModels(_0x3cda29)});}async function _0x47d650(){const _0x19cf99=_0x27feac;await _0x49612c();const _0x38c86a=await _0x5e04fc({'port':portNumbers(_0x3cda29[_0x19cf99(0x9c)][_0x19cf99(0x102)+_0x19cf99(0x93)],_0x3cda29[_0x19cf99(0x9c)][_0x19cf99(0x102)+_0x19cf99(0x93)]+0x63)});return{'token':createToken(),'port':_0x38c86a};}async function _0x354a61(){const _0x378c4b=_0x27feac,_0x25258a=await _0x43fe50(),_0x147fbf=asRecord(_0x25258a[_0x378c4b(0xab)]),_0x2ee768=asRecord(_0x147fbf[_0x378c4b(0x108)]),_0x582e3=asRecord(_0x2ee768[_0x378c4b(0xaa)]),_0x13ab79=getTrimmedString(_0x582e3[_0x378c4b(0x9d)]),_0x147f2f=_0x13ab79[_0x378c4b(0xc9)]('/'),_0x39bf1a=_0x147f2f>0x0?_0x13ab79[_0x378c4b(0xba)](0x0,_0x147f2f):_0x13ab79,_0xb963b0=_0x147f2f>0x0?_0x13ab79[_0x378c4b(0xba)](_0x147f2f+0x1):'',_0xb5cda4=asRecord(asRecord(_0x25258a[_0x378c4b(0xfc)])[_0x378c4b(0x91)+'s']),_0x1ca865=asRecord(_0xb5cda4[_0x39bf1a]);return{'provider':_0x39bf1a||'','apiKey':getTrimmedString(_0x1ca865[_0x378c4b(0xc5)]),'modelName':_0xb963b0,'modelBaseUrl':getTrimmedString(_0x1ca865['baseUrl'])};}async function _0x4c21b7(_0x5d8d23,_0x4bac4c={}){const _0x26ae10=_0x27feac,_0x38aaa5=await _0x43fe50(),_0x394c22=_0x5d8d23[_0x26ae10(0x91)]||'default',_0x26240e=_0x394c22+'/'+_0x5d8d23[_0x26ae10(0xee)+'e'],_0x20505b=asRecord(_0x38aaa5[_0x26ae10(0xfc)]),_0x4cba22=asRecord(_0x20505b['provider'+'s']);_0x4cba22[_0x394c22]={...asRecord(_0x4cba22[_0x394c22]),...createProviderConfig({'apiKey':_0x5d8d23[_0x26ae10(0xc5)]||'','protocol':_0x5d8d23[_0x26ae10(0xac)]||'openai','baseUrl':_0x5d8d23[_0x26ae10(0xa0)+_0x26ae10(0xa4)]||_0x5d8d23[_0x26ae10(0x121)]||'','modelName':_0x5d8d23[_0x26ae10(0xee)+'e']})},_0x20505b['provider'+'s']=_0x4cba22,_0x38aaa5[_0x26ae10(0xfc)]=_0x20505b;const _0x883caa=asRecord(_0x38aaa5[_0x26ae10(0xab)]),_0x212906=asRecord(_0x883caa['defaults']);return _0x212906[_0x26ae10(0xaa)]={...asRecord(_0x212906[_0x26ae10(0xaa)]),'primary':_0x26240e},_0x212906[_0x26ae10(0xfc)]={...asRecord(_0x212906[_0x26ae10(0xfc)]),[_0x26240e]:asRecord(asRecord(_0x212906[_0x26ae10(0xfc)])[_0x26240e])},_0x883caa[_0x26ae10(0x108)]=_0x212906,_0x38aaa5[_0x26ae10(0xab)]=_0x883caa,_0x38aaa5['session']={...asRecord(_0x38aaa5[_0x26ae10(0xdd)]),'dmScope':_0x26ae10(0xd4)+'nel-peer'},await _0xeedc9(_0x38aaa5,_0x4bac4c['restartO'+_0x26ae10(0xca)]?_0x26ae10(0x115)+_0x26ae10(0x109)+_0x26ae10(0xd6):''),{'ok':!![]};}async function _0x1c58b1(_0x45d21b){const _0x137f3e=_0x27feac,_0x2a3225=await _0x43fe50(),_0x25b74e=_0x45d21b[_0x137f3e(0x91)+_0x137f3e(0x104)],_0x4d5af6=asRecord(_0x2a3225[_0x137f3e(0xfc)]),_0x39c70f=asRecord(_0x4d5af6[_0x137f3e(0x91)+'s']);_0x39c70f[_0x25b74e]={...asRecord(_0x39c70f[_0x25b74e]),'apiKey':_0x45d21b[_0x137f3e(0xc5)],'api':'openai-c'+_0x137f3e(0xfa)+'ns','baseUrl':_0x45d21b['baseUrl'],'models':(_0x45d21b[_0x137f3e(0xee)+'es']??[])[_0x137f3e(0xd5)](_0x2572bc=>createProviderModelConfig(_0x2572bc,_0x2572bc===_0x45d21b['imageMod'+'elPrimar'+_0x137f3e(0x11d)]))},_0x4d5af6[_0x137f3e(0x91)+'s']=_0x39c70f,_0x2a3225[_0x137f3e(0xfc)]=_0x4d5af6;if(_0x45d21b['imageMod'+'elPrimar'+'yName']){const _0x4aeb41=asRecord(_0x2a3225['agents']),_0x41f509=asRecord(_0x4aeb41[_0x137f3e(0x108)]);_0x41f509[_0x137f3e(0xbb)+'el']={...asRecord(_0x41f509['imageMod'+'el']),'primary':_0x25b74e+'/'+_0x45d21b[_0x137f3e(0xbb)+'elPrimar'+'yName']},_0x4aeb41[_0x137f3e(0x108)]=_0x41f509,_0x2a3225[_0x137f3e(0xab)]=_0x4aeb41;}return await _0xeedc9(_0x2a3225,_0x137f3e(0xa7)+'rated\x20mo'+'dels\x20upd'+'ated'),{'ok':!![]};}async function _0x5f3c2f({callbackUrl:_0x54b9fb,secret:_0x1eb700}){const _0x17ad26=_0x27feac,_0x8a33f1=await _0x43fe50(),_0x26a5f6=asRecord(_0x8a33f1['plugins']),_0x35c532=asRecord(_0x26a5f6[_0x17ad26(0x96)]),_0x2ee2fe=asRecord(_0x35c532[ASK_USER_QUESTION_PLUGIN_ID]);return _0x35c532[ASK_USER_QUESTION_PLUGIN_ID]={..._0x2ee2fe,'enabled':!![],'config':{...asRecord(_0x2ee2fe[_0x17ad26(0x103)]),'callbackUrl':_0x54b9fb,'secret':_0x1eb700}},_0x26a5f6['entries']=_0x35c532,_0x26a5f6[_0x17ad26(0xbd)]=dedupeStrings([...(Array[_0x17ad26(0xb8)](_0x26a5f6[_0x17ad26(0xbd)])?_0x26a5f6['allow']:[])[_0x17ad26(0xa8)](Boolean),ASK_USER_QUESTION_PLUGIN_ID]),_0x8a33f1[_0x17ad26(0x95)]=_0x26a5f6,await _0xeedc9(_0x8a33f1,''),{'ok':!![]};}async function _0xeedc9(_0x336500,_0x106958=''){const _0x4c5315=_0x27feac;_0x7b32bd(),await _0x574c39(_0x336500,_0x106958||_0x4c5315(0xef)+_0x4c5315(0x114)+'persiste'+'d'),await writeJsonFile(_0x52d9f2['lastGood'+_0x4c5315(0xe1)+'th'],_0x336500),_0x29b4a0?.[_0x4c5315(0x10b)](_0x4c5315(0xe8)+_0x4c5315(0xcc)+'aw\x20confi'+_0x4c5315(0xf4)+'n',{'path':_0x52d9f2[_0x4c5315(0xc8)+_0x4c5315(0xe1)+'th'],'reason':_0x106958||_0x4c5315(0xef)+'\x20config\x20'+_0x4c5315(0xfd)+'d'});if(_0x106958)_0x428b8d(_0x106958);}function _0x7b32bd(){if(_0x27aa30)_0x22f32c+=0x1;}function _0x3a6f35(_0x41ccfc){_0x1f1b52=_0x41ccfc;}function _0x428b8d(_0x42ca19){const _0x54ddd6=_0x27feac;if(!_0x1f1b52)return;if(_0x26c575)clearTimeout(_0x26c575);_0x29b4a0?.[_0x54ddd6(0x10b)](_0x54ddd6(0xd7)+_0x54ddd6(0xa5)+'cheduled'+_0x54ddd6(0xdb)+_0x54ddd6(0x106)+'ge',{'reason':_0x42ca19,'debounceMs':0xfa}),_0x26c575=setTimeout(()=>_0x1f1b52(_0x42ca19),0xfa);}function _0x515b61(){const _0x1f6d07=_0x27feac;unwatchFile(_0x52d9f2[_0x1f6d07(0xed)+'th']),_0x27aa30=!![],watchFile(_0x52d9f2[_0x1f6d07(0xed)+'th'],{'interval':0x3e8},(_0x15a0ff,_0x38abba)=>{const _0x5203e9=_0x1f6d07;if(_0x15a0ff[_0x5203e9(0xde)]===_0x38abba[_0x5203e9(0xde)])return;if(_0x22f32c>0x0){_0x22f32c-=0x1,_0x29b4a0?.['info'](_0x5203e9(0x92)+'ile\x20watc'+_0x5203e9(0x98)+_0x5203e9(0xc3)+_0x5203e9(0xf8)+'te',{'configPath':_0x52d9f2[_0x5203e9(0xed)+'th'],'ignoredConfigWatchReloads':_0x22f32c});return;}_0x29b4a0?.['info']('config\x20f'+'ile\x20watc'+_0x5203e9(0xe0)+_0x5203e9(0xcf)+'ernal\x20ch'+_0x5203e9(0x113),{'configPath':_0x52d9f2['configPa'+'th']}),_0x428b8d(_0x5203e9(0x11b)+_0x5203e9(0xc2));});}function _0x4a8373(){const _0x16729f=_0x27feac;if(_0x26c575)clearTimeout(_0x26c575);unwatchFile(_0x52d9f2[_0x16729f(0xed)+'th']),_0x27aa30=![],_0x22f32c=0x0;}return{'paths':_0x52d9f2,'resolveConfigPath':_0x3bcafb,'resolveStateDir':_0x2bfe6f,'resolveDeviceIdentityPath':_0x9df177,'ensureConfigPathEnv':_0x16578d,'ensureInitialConfig':_0x49612c,'ensureGatewaySettings':_0x47d650,'readConfig':_0x43fe50,'writeConfig':_0x574c39,'syncRuntimePlugins':_0x3f9c43,'getModelSettings':_0x354a61,'setModelSettings':_0x4c21b7,'setSelfOperatedModels':_0x1c58b1,'ensureAskUserQuestionPluginConfig':_0x5f3c2f,'markConfigWriteHandledInternally':_0x7b32bd,'setGatewayRestartHandler':_0x3a6f35,'watchConfigChanges':_0x515b61,'dispose':_0x4a8373};}