@sapienx/agentos 0.5.3 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/bin/agentos.js +580 -31
- package/bin/terminal-boot.js +620 -0
- package/bundle/.next/BUILD_ID +1 -1
- package/bundle/.next/app-path-routes-manifest.json +9 -9
- package/bundle/.next/build-manifest.json +2 -2
- package/bundle/.next/prerender-manifest.json +3 -3
- package/bundle/.next/required-server-files.json +1 -1
- package/bundle/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/bundle/.next/server/app/_global-error.html +1 -1
- package/bundle/.next/server/app/_global-error.rsc +1 -1
- package/bundle/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/bundle/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/bundle/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/bundle/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/bundle/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/bundle/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/bundle/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/bundle/.next/server/app/_not-found.html +1 -1
- package/bundle/.next/server/app/_not-found.rsc +1 -1
- package/bundle/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/bundle/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/bundle/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/bundle/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/bundle/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/bundle/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/bundle/.next/server/app/api/agents/[agentId]/chat/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/agents/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/diagnostics/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/gateway/control/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/mission/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/models/catalog/route.js +2 -1
- package/bundle/.next/server/app/api/models/catalog/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/models/providers/route.js +2 -1
- package/bundle/.next/server/app/api/models/providers/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/onboarding/models/route.js +8 -7
- package/bundle/.next/server/app/api/onboarding/models/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/onboarding/route.js +12 -6
- package/bundle/.next/server/app/api/onboarding/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/planner/[planId]/deploy/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/planner/[planId]/document-rewrite/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/planner/[planId]/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/planner/[planId]/simulate/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/planner/[planId]/turn/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/planner/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/reset/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/runtimes/[runtimeId]/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/settings/gateway/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/settings/openclaw-binary/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/settings/workspace-root/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/snapshot/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/stream/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/tasks/[taskId]/abort/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/tasks/[taskId]/control/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/tasks/[taskId]/stream/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/update/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/channels/discovered-groups/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/channels/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/edit-draft/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/files/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/workspaces/[workspaceId]/surfaces/discovery/route.js.nft.json +1 -1
- package/bundle/.next/server/app/api/workspaces/route.js.nft.json +1 -1
- package/bundle/.next/server/app/page.js.nft.json +1 -1
- package/bundle/.next/server/app/page_client-reference-manifest.js +1 -1
- package/bundle/.next/server/app/settings/page.js.nft.json +1 -1
- package/bundle/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/bundle/.next/server/app-paths-manifest.json +9 -9
- package/bundle/.next/server/chunks/4767.js +9 -9
- package/bundle/.next/server/chunks/5151.js +2 -2
- package/bundle/.next/server/chunks/6639.js +6 -5
- package/bundle/.next/server/chunks/7125.js +4 -4
- package/bundle/.next/server/middleware-build-manifest.js +1 -1
- package/bundle/.next/server/pages/404.html +1 -1
- package/bundle/.next/server/pages/500.html +1 -1
- package/bundle/.next/server/server-reference-manifest.json +1 -1
- package/bundle/.next/static/chunks/{7442-f5f805e43da2c5b6.js → 7442-e148a49efcfa2d32.js} +4 -4
- package/bundle/server.js +1 -1
- package/package.json +1 -1
- package/bundle/.next/server/chunks/5831.js +0 -2
- /package/bundle/.next/static/{easVJgXM2ae2U4xGhNmSj → ujFbMZ9arxb7I3_g4GzfY}/_buildManifest.js +0 -0
- /package/bundle/.next/static/{easVJgXM2ae2U4xGhNmSj → ujFbMZ9arxb7I3_g4GzfY}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
import readline from "node:readline";
|
|
2
|
+
|
|
3
|
+
export const AGENTOS_BOOT_HEADER = ` █████╗ ██████╗ ███████╗███╗ ██╗████████╗ ██████╗ ███████╗
|
|
4
|
+
██╔══██╗██╔════╝ ██╔════╝████╗ ██║╚══██╔══╝██╔═══██╗██╔════╝
|
|
5
|
+
███████║██║ ███╗█████╗ ██╔██╗ ██║ ██║ ██║ ██║███████╗
|
|
6
|
+
██╔══██║██║ ██║██╔══╝ ██║╚██╗██║ ██║ ██║ ██║╚════██║
|
|
7
|
+
██║ ██║╚██████╔╝███████╗██║ ╚████║ ██║ ╚██████╔╝███████║
|
|
8
|
+
╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═════╝ ╚══════╝`;
|
|
9
|
+
|
|
10
|
+
export const TERMINAL_THEME = {
|
|
11
|
+
primaryCyan: "#36D7E8",
|
|
12
|
+
softCyan: "#8BE9FD",
|
|
13
|
+
successGreen: "#39D353",
|
|
14
|
+
warningAmber: "#D7BA2F",
|
|
15
|
+
dangerRed: "#FF5C5C",
|
|
16
|
+
mutedGray: "#8B949E",
|
|
17
|
+
textWhite: "#F0F6FC",
|
|
18
|
+
dividerGray: "#30363D"
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const BOOT_TAGLINE = "Built on OpenClaw · Human operating layer for AI agents";
|
|
22
|
+
const COMPACT_HEADER = "AgentOS · Built on OpenClaw";
|
|
23
|
+
const MEDIUM_HEADER_MIN_COLUMNS = 48;
|
|
24
|
+
const LARGE_HEADER_MIN_COLUMNS = 82;
|
|
25
|
+
const MEDIUM_WORDMARK = [
|
|
26
|
+
"▄▀█ █▀▀ █▀▀ █▄░█ ▀█▀ █▀█ █▀",
|
|
27
|
+
"█▀█ █▄█ ██▄ █░▀█ █ █▄█ ▄█"
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const STATE_META = {
|
|
31
|
+
checking: { label: "CHECKING", color: "primary", symbol: "…", ascii: "..." },
|
|
32
|
+
waiting: { label: "WAITING", color: "muted", symbol: "…", ascii: "..." },
|
|
33
|
+
loading: { label: "LOADING", color: "primary", symbol: "…", ascii: "..." },
|
|
34
|
+
starting: { label: "STARTING", color: "primary", symbol: "…", ascii: "..." },
|
|
35
|
+
resolving: { label: "RESOLVING", color: "primary", symbol: "…", ascii: "..." },
|
|
36
|
+
preparing: { label: "PREPARING", color: "primary", symbol: "…", ascii: "..." },
|
|
37
|
+
connected: { label: "CONNECTED", color: "success", symbol: "✓", ascii: "OK" },
|
|
38
|
+
active: { label: "ACTIVE", color: "success", symbol: "✓", ascii: "OK" },
|
|
39
|
+
ready: { label: "READY", color: "success", symbol: "✓", ascii: "OK" },
|
|
40
|
+
success: { label: "SUCCESS", color: "success", symbol: "✓", ascii: "OK" },
|
|
41
|
+
ok: { label: "OK", color: "success", symbol: "✓", ascii: "OK" },
|
|
42
|
+
warning: { label: "WARNING", color: "warning", symbol: "⚠", ascii: "!" },
|
|
43
|
+
degraded: { label: "DEGRADED", color: "warning", symbol: "⚠", ascii: "!" },
|
|
44
|
+
failed: { label: "FAILED", color: "danger", symbol: "✕", ascii: "x" },
|
|
45
|
+
unreachable: { label: "UNREACHABLE", color: "danger", symbol: "✕", ascii: "x" },
|
|
46
|
+
broken: { label: "BROKEN", color: "danger", symbol: "✕", ascii: "x" },
|
|
47
|
+
disabled: { label: "DISABLED", color: "muted", symbol: "–", ascii: "-" },
|
|
48
|
+
skipped: { label: "SKIPPED", color: "muted", symbol: "–", ascii: "-" },
|
|
49
|
+
inactive: { label: "INACTIVE", color: "muted", symbol: "–", ascii: "-" },
|
|
50
|
+
pending: { label: "PENDING", color: "muted", symbol: "–", ascii: "-" }
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const VALID_STATES = new Set(Object.keys(STATE_META));
|
|
54
|
+
|
|
55
|
+
const STATUS_ROWS = [
|
|
56
|
+
["agentosVersion", "AgentOS", "ready", ""],
|
|
57
|
+
["update", "Update", "pending", ""],
|
|
58
|
+
["openclawGateway", "OpenClaw Gateway", "checking", ""],
|
|
59
|
+
["nativeGateway", "Native Gateway", "waiting", ""],
|
|
60
|
+
["workspaceEngine", "Workspace Engine", "loading", ""],
|
|
61
|
+
["agentRuntime", "Agent Runtime", "starting", ""],
|
|
62
|
+
["models", "Models", "resolving", ""],
|
|
63
|
+
["channels", "Channels", "preparing", ""],
|
|
64
|
+
["localServerUrl", "Local Server URL", "pending", ""]
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
const UNICODE_FRAMES = [
|
|
68
|
+
"Workspace ▣──◆──▢ Agent ▢────▣ Channel",
|
|
69
|
+
"Workspace ▣────▣ Agent ▢──◆──▢ Channel",
|
|
70
|
+
"Workspace ▢────▣ Agent ▣──◆──▢ Channel",
|
|
71
|
+
"Workspace ▢──◆──▢ Agent ▣────▣ Channel"
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
const ASCII_FRAMES = [
|
|
75
|
+
"Workspace [#]--<>--[ ] Agent [ ]----[#] Channel",
|
|
76
|
+
"Workspace [#]----[#] Agent [ ]--<>--[ ] Channel",
|
|
77
|
+
"Workspace [ ]----[#] Agent [#]--<>--[ ] Channel",
|
|
78
|
+
"Workspace [ ]--<>--[ ] Agent [#]----[#] Channel"
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
export function createTerminalBoot(options = {}) {
|
|
82
|
+
return new TerminalBoot(options);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function shouldUsePlainBoot(options = {}) {
|
|
86
|
+
const env = options.env ?? process.env;
|
|
87
|
+
const stdout = options.stdout ?? process.stdout;
|
|
88
|
+
const stderr = options.stderr ?? process.stderr;
|
|
89
|
+
|
|
90
|
+
if (options.plain) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (env.CI || env.AGENTOS_BOOT_UI === "0") {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (env.AGENTOS_FORCE_BOOT_UI === "1") {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return !stdout.isTTY || !stderr.isTTY;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function supportsBootColor(options = {}) {
|
|
106
|
+
const env = options.env ?? process.env;
|
|
107
|
+
const stdout = options.stdout ?? process.stdout;
|
|
108
|
+
|
|
109
|
+
if (env.NO_COLOR || env.FORCE_COLOR === "0") {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return Boolean(stdout.isTTY || env.AGENTOS_FORCE_BOOT_UI === "1") && env.TERM !== "dumb";
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function supportsBootUnicode(env = process.env) {
|
|
117
|
+
if (env.AGENTOS_ASCII_BOOT === "1") {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (process.platform !== "win32") {
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return Boolean(env.WT_SESSION || env.TERM_PROGRAM || env.ConEmuANSI === "ON" || env.ANSICON);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function renderBootFrame(options = {}) {
|
|
129
|
+
const env = options.env ?? process.env;
|
|
130
|
+
const columns = normalizeColumns(options.columns);
|
|
131
|
+
const color = createColor(options.color);
|
|
132
|
+
const unicode = options.unicode ?? supportsBootUnicode(env);
|
|
133
|
+
const compact = !unicode || columns < MEDIUM_HEADER_MIN_COLUMNS;
|
|
134
|
+
const forceLarge = env.AGENTOS_LARGE_BOOT_HEADER === "1";
|
|
135
|
+
const large = !compact && (forceLarge || columns >= LARGE_HEADER_MIN_COLUMNS) && env.AGENTOS_MEDIUM_BOOT_HEADER !== "1";
|
|
136
|
+
const statusRows = normalizeRows(options.statusRows);
|
|
137
|
+
const complete = Boolean(options.complete);
|
|
138
|
+
const frameIndex = options.frameIndex ?? 0;
|
|
139
|
+
|
|
140
|
+
if (complete) {
|
|
141
|
+
return renderCompleteFrame({
|
|
142
|
+
color,
|
|
143
|
+
columns,
|
|
144
|
+
compact,
|
|
145
|
+
large,
|
|
146
|
+
unicode,
|
|
147
|
+
statusRows,
|
|
148
|
+
finalInfo: options.finalInfo
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const lines = [""];
|
|
153
|
+
|
|
154
|
+
lines.push(...renderHeaderLines({
|
|
155
|
+
color,
|
|
156
|
+
columns,
|
|
157
|
+
compact,
|
|
158
|
+
large
|
|
159
|
+
}));
|
|
160
|
+
|
|
161
|
+
lines.push("");
|
|
162
|
+
|
|
163
|
+
const frames = unicode ? UNICODE_FRAMES : ASCII_FRAMES;
|
|
164
|
+
lines.push(color.muted(truncate(frames[frameIndex % frames.length], columns)));
|
|
165
|
+
lines.push("");
|
|
166
|
+
lines.push(...renderStatusSection({
|
|
167
|
+
title: "SYSTEM CHECK",
|
|
168
|
+
rows: statusRows,
|
|
169
|
+
color,
|
|
170
|
+
columns,
|
|
171
|
+
unicode
|
|
172
|
+
}));
|
|
173
|
+
|
|
174
|
+
return lines.join("\n");
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export function renderStatusDashboard(options = {}) {
|
|
178
|
+
const env = options.env ?? process.env;
|
|
179
|
+
const columns = normalizeColumns(options.columns ?? process.stdout.columns);
|
|
180
|
+
const colorEnabled = options.color ?? supportsBootColor({ stdout: options.stdout, env });
|
|
181
|
+
const color = createColor(colorEnabled);
|
|
182
|
+
const unicode = options.unicode ?? supportsBootUnicode(env);
|
|
183
|
+
const rows = normalizeRows(options.rows);
|
|
184
|
+
const lines = [""];
|
|
185
|
+
|
|
186
|
+
if (options.header !== false) {
|
|
187
|
+
lines.push(...renderHeaderLines({
|
|
188
|
+
color,
|
|
189
|
+
columns,
|
|
190
|
+
compact: !unicode || columns < MEDIUM_HEADER_MIN_COLUMNS,
|
|
191
|
+
large: unicode && columns >= LARGE_HEADER_MIN_COLUMNS
|
|
192
|
+
}));
|
|
193
|
+
lines.push("");
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
lines.push(...renderStatusSection({
|
|
197
|
+
title: options.title || "SYSTEM CHECK",
|
|
198
|
+
rows,
|
|
199
|
+
color,
|
|
200
|
+
columns,
|
|
201
|
+
unicode
|
|
202
|
+
}));
|
|
203
|
+
|
|
204
|
+
if (options.finalInfo) {
|
|
205
|
+
lines.push("");
|
|
206
|
+
lines.push(color.bold(color.success(`AgentOS ready · ${options.finalInfo}`)));
|
|
207
|
+
} else if (options.footer) {
|
|
208
|
+
lines.push("");
|
|
209
|
+
lines.push(color.muted(options.footer));
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return lines.join("\n");
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export function renderDoctorReport(options = {}) {
|
|
216
|
+
const env = options.env ?? process.env;
|
|
217
|
+
const columns = normalizeColumns(options.columns ?? process.stdout.columns);
|
|
218
|
+
const colorEnabled = options.color ?? supportsBootColor({ stdout: options.stdout, env });
|
|
219
|
+
const color = createColor(colorEnabled);
|
|
220
|
+
const unicode = options.unicode ?? supportsBootUnicode(env);
|
|
221
|
+
const rows = normalizeRows(options.rows);
|
|
222
|
+
const lines = [""];
|
|
223
|
+
|
|
224
|
+
lines.push(color.bold(color.primary(options.title || "AGENTOS DOCTOR")));
|
|
225
|
+
lines.push(color.muted(truncate(options.subtitle || BOOT_TAGLINE, columns)));
|
|
226
|
+
lines.push(color.divider(divider(columns)));
|
|
227
|
+
lines.push(...formatStatusRows(rows, {
|
|
228
|
+
color,
|
|
229
|
+
columns,
|
|
230
|
+
unicode
|
|
231
|
+
}));
|
|
232
|
+
|
|
233
|
+
if (options.footer) {
|
|
234
|
+
lines.push(color.divider(divider(columns)));
|
|
235
|
+
lines.push(color.muted(truncate(options.footer, columns)));
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return lines.join("\n");
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export function formatStatusBadge(state, options = {}) {
|
|
242
|
+
const color = options.color ?? createColor(false);
|
|
243
|
+
const unicode = options.unicode ?? true;
|
|
244
|
+
const meta = getStateMeta(state);
|
|
245
|
+
const symbol = unicode ? meta.symbol : meta.ascii;
|
|
246
|
+
const text = `${symbol} ${meta.label}`;
|
|
247
|
+
const padded = text.padEnd(options.width ?? 15);
|
|
248
|
+
|
|
249
|
+
return color[meta.color](padded);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
class TerminalBoot {
|
|
253
|
+
constructor(options = {}) {
|
|
254
|
+
this.stdout = options.stdout ?? process.stdout;
|
|
255
|
+
this.stderr = options.stderr ?? process.stderr;
|
|
256
|
+
this.env = options.env ?? process.env;
|
|
257
|
+
this.plain = shouldUsePlainBoot({
|
|
258
|
+
plain: options.plain,
|
|
259
|
+
stdout: this.stdout,
|
|
260
|
+
stderr: this.stderr,
|
|
261
|
+
env: this.env
|
|
262
|
+
});
|
|
263
|
+
this.colorEnabled = supportsBootColor({
|
|
264
|
+
stdout: this.stdout,
|
|
265
|
+
env: this.env
|
|
266
|
+
});
|
|
267
|
+
this.unicode = supportsBootUnicode(this.env);
|
|
268
|
+
this.frameIndex = 0;
|
|
269
|
+
this.lineCount = 0;
|
|
270
|
+
this.timer = null;
|
|
271
|
+
this.started = false;
|
|
272
|
+
this.completed = false;
|
|
273
|
+
this.statusRows = STATUS_ROWS.map(([key, label, state, message]) => ({
|
|
274
|
+
key,
|
|
275
|
+
label,
|
|
276
|
+
state,
|
|
277
|
+
message
|
|
278
|
+
}));
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
isPlain() {
|
|
282
|
+
return this.plain;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
start() {
|
|
286
|
+
if (this.plain || this.started) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
this.started = true;
|
|
291
|
+
this.render();
|
|
292
|
+
this.timer = setInterval(() => {
|
|
293
|
+
this.frameIndex += 1;
|
|
294
|
+
this.render();
|
|
295
|
+
}, 220);
|
|
296
|
+
this.timer.unref?.();
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
updateStatus(key, state, message = "") {
|
|
300
|
+
const row = this.statusRows.find((entry) => entry.key === key);
|
|
301
|
+
|
|
302
|
+
if (!row) {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
row.state = VALID_STATES.has(state) ? state : "warning";
|
|
307
|
+
row.message = message;
|
|
308
|
+
this.render();
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
log(message) {
|
|
312
|
+
this.writeLog(message, this.stdout);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
warn(message) {
|
|
316
|
+
this.writeLog(message, this.stderr);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
error(error) {
|
|
320
|
+
const message = error instanceof Error ? error.stack || error.message : String(error);
|
|
321
|
+
this.writeLog(message, this.stderr);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
complete(finalInfo = "") {
|
|
325
|
+
if (this.plain || this.completed) {
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
this.completed = true;
|
|
330
|
+
this.stopTimer();
|
|
331
|
+
this.clear();
|
|
332
|
+
this.stdout.write(`${this.renderFrame({
|
|
333
|
+
complete: true,
|
|
334
|
+
finalInfo
|
|
335
|
+
})}\n\n`);
|
|
336
|
+
this.lineCount = 0;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
stop(options = {}) {
|
|
340
|
+
if (this.plain) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
this.stopTimer();
|
|
345
|
+
|
|
346
|
+
if (options.clear) {
|
|
347
|
+
this.clear();
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
render() {
|
|
352
|
+
if (this.plain || !this.started || this.completed) {
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
this.clear();
|
|
357
|
+
const output = this.renderFrame();
|
|
358
|
+
this.stdout.write(output);
|
|
359
|
+
this.lineCount = countTerminalLines(output, this.stdout.columns);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
renderFrame(options = {}) {
|
|
363
|
+
return renderBootFrame({
|
|
364
|
+
...options,
|
|
365
|
+
color: this.colorEnabled,
|
|
366
|
+
unicode: this.unicode,
|
|
367
|
+
columns: this.stdout.columns,
|
|
368
|
+
frameIndex: this.frameIndex,
|
|
369
|
+
statusRows: this.statusRows
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
writeLog(message, stream) {
|
|
374
|
+
if (this.plain || !this.started || this.completed) {
|
|
375
|
+
stream.write(ensureNewline(String(message)));
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
this.clear();
|
|
380
|
+
stream.write(ensureNewline(String(message)));
|
|
381
|
+
this.render();
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
clear() {
|
|
385
|
+
if (!this.lineCount) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
readline.cursorTo(this.stdout, 0);
|
|
390
|
+
readline.moveCursor(this.stdout, 0, -Math.max(0, this.lineCount - 1));
|
|
391
|
+
readline.clearScreenDown(this.stdout);
|
|
392
|
+
this.lineCount = 0;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
stopTimer() {
|
|
396
|
+
if (!this.timer) {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
clearInterval(this.timer);
|
|
401
|
+
this.timer = null;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
function normalizeRows(rows = []) {
|
|
406
|
+
if (!rows.length) {
|
|
407
|
+
return STATUS_ROWS.map(([key, label, state, message]) => ({
|
|
408
|
+
key,
|
|
409
|
+
label,
|
|
410
|
+
state,
|
|
411
|
+
message
|
|
412
|
+
}));
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return rows.map((row) => ({
|
|
416
|
+
...row,
|
|
417
|
+
state: VALID_STATES.has(row.state) ? row.state : "warning"
|
|
418
|
+
}));
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
function renderStatusSection(options) {
|
|
422
|
+
const title = options.title || "SYSTEM CHECK";
|
|
423
|
+
const lines = [
|
|
424
|
+
options.color.bold(options.color.text(title)),
|
|
425
|
+
options.color.divider(divider(options.columns))
|
|
426
|
+
];
|
|
427
|
+
|
|
428
|
+
lines.push(...formatStatusRows(options.rows, options));
|
|
429
|
+
lines.push(options.color.divider(divider(options.columns)));
|
|
430
|
+
|
|
431
|
+
return lines;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
function formatStatusRows(rows, options) {
|
|
435
|
+
const compact = options.columns < 62;
|
|
436
|
+
const labelWidth = compact ? 17 : Math.min(22, Math.max(17, ...rows.map((row) => row.label.length)));
|
|
437
|
+
const badgeWidth = compact ? 14 : 15;
|
|
438
|
+
|
|
439
|
+
return rows.map((row) => formatStatusRow(row, {
|
|
440
|
+
...options,
|
|
441
|
+
compact,
|
|
442
|
+
labelWidth,
|
|
443
|
+
badgeWidth
|
|
444
|
+
}));
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
function formatStatusRow(row, options) {
|
|
448
|
+
const state = row.state || "pending";
|
|
449
|
+
const detail = row.message || row.detail || "";
|
|
450
|
+
const label = truncate(row.label, options.labelWidth).padEnd(options.labelWidth);
|
|
451
|
+
const badge = formatStatusBadge(state, {
|
|
452
|
+
color: options.color,
|
|
453
|
+
unicode: options.unicode,
|
|
454
|
+
width: options.badgeWidth
|
|
455
|
+
});
|
|
456
|
+
const availableDetailWidth = Math.max(0, options.columns - options.labelWidth - options.badgeWidth - 4);
|
|
457
|
+
const detailText = truncate(String(detail), availableDetailWidth);
|
|
458
|
+
const formattedDetail = formatDetail(detailText, options.color);
|
|
459
|
+
|
|
460
|
+
return `${options.color.text(label)} ${badge} ${formattedDetail}`;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
function renderMediumHeader(options) {
|
|
464
|
+
const available = Math.max(0, options.columns - 4);
|
|
465
|
+
|
|
466
|
+
return [
|
|
467
|
+
...MEDIUM_WORDMARK.map((line) => ` ${options.color.bold(options.color.primary(line))}`),
|
|
468
|
+
` ${options.color.muted(truncate(BOOT_TAGLINE, available))}`,
|
|
469
|
+
` ${options.color.divider(divider(Math.min(available, 72)))}`
|
|
470
|
+
];
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
function renderCompleteFrame(options) {
|
|
474
|
+
const lines = [""];
|
|
475
|
+
const message = options.finalInfo ? `AgentOS ready · ${options.finalInfo}` : "AgentOS ready";
|
|
476
|
+
|
|
477
|
+
lines.push(...renderHeaderLines(options));
|
|
478
|
+
lines.push("");
|
|
479
|
+
lines.push(...renderStatusSection({
|
|
480
|
+
title: "SYSTEM CHECK",
|
|
481
|
+
rows: options.statusRows,
|
|
482
|
+
color: options.color,
|
|
483
|
+
columns: options.columns,
|
|
484
|
+
unicode: options.unicode
|
|
485
|
+
}));
|
|
486
|
+
lines.push("");
|
|
487
|
+
lines.push(options.color.bold(options.color.success(message)));
|
|
488
|
+
|
|
489
|
+
return lines.join("\n");
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
function renderHeaderLines(options) {
|
|
493
|
+
if (options.compact) {
|
|
494
|
+
return [
|
|
495
|
+
options.color.bold(options.color.primary(COMPACT_HEADER)),
|
|
496
|
+
options.color.divider(divider(options.columns))
|
|
497
|
+
];
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
if (options.large) {
|
|
501
|
+
return [
|
|
502
|
+
...AGENTOS_BOOT_HEADER.split("\n").map((line, index) => options.color.gradient(line, index)),
|
|
503
|
+
options.color.muted(BOOT_TAGLINE),
|
|
504
|
+
options.color.divider(divider(options.columns))
|
|
505
|
+
];
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
return renderMediumHeader(options);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
function createColor(enabled) {
|
|
512
|
+
const wrap = (code, value) => enabled ? `\u001B[${code}m${value}\u001B[0m` : value;
|
|
513
|
+
const hex = (value, text) => {
|
|
514
|
+
if (!enabled) {
|
|
515
|
+
return text;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
const [red, green, blue] = parseHex(value);
|
|
519
|
+
return `\u001B[38;2;${red};${green};${blue}m${text}\u001B[0m`;
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
return {
|
|
523
|
+
bold: (value) => wrap("1", value),
|
|
524
|
+
dim: (value) => wrap("2", value),
|
|
525
|
+
primary: (value) => hex(TERMINAL_THEME.primaryCyan, value),
|
|
526
|
+
soft: (value) => hex(TERMINAL_THEME.softCyan, value),
|
|
527
|
+
success: (value) => hex(TERMINAL_THEME.successGreen, value),
|
|
528
|
+
warning: (value) => hex(TERMINAL_THEME.warningAmber, value),
|
|
529
|
+
danger: (value) => hex(TERMINAL_THEME.dangerRed, value),
|
|
530
|
+
muted: (value) => hex(TERMINAL_THEME.mutedGray, value),
|
|
531
|
+
text: (value) => hex(TERMINAL_THEME.textWhite, value),
|
|
532
|
+
divider: (value) => hex(TERMINAL_THEME.dividerGray, value),
|
|
533
|
+
cyan: (value) => hex(TERMINAL_THEME.primaryCyan, value),
|
|
534
|
+
green: (value) => hex(TERMINAL_THEME.successGreen, value),
|
|
535
|
+
yellow: (value) => hex(TERMINAL_THEME.warningAmber, value),
|
|
536
|
+
red: (value) => hex(TERMINAL_THEME.dangerRed, value),
|
|
537
|
+
gradient: (value, index) => {
|
|
538
|
+
const palette = [
|
|
539
|
+
TERMINAL_THEME.softCyan,
|
|
540
|
+
TERMINAL_THEME.primaryCyan,
|
|
541
|
+
TERMINAL_THEME.softCyan,
|
|
542
|
+
TERMINAL_THEME.primaryCyan,
|
|
543
|
+
TERMINAL_THEME.softCyan,
|
|
544
|
+
TERMINAL_THEME.primaryCyan
|
|
545
|
+
];
|
|
546
|
+
return hex(palette[index % palette.length], value);
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
function getStateMeta(state) {
|
|
552
|
+
return STATE_META[state] || STATE_META.warning;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function formatDetail(value, color) {
|
|
556
|
+
if (!value) {
|
|
557
|
+
return "";
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
if (/^https?:\/\//i.test(value)) {
|
|
561
|
+
return color.soft(value);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
return color.text(value);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
function divider(columns) {
|
|
568
|
+
return "─".repeat(Math.max(24, Math.min(normalizeColumns(columns), 96)));
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
function parseHex(value) {
|
|
572
|
+
const normalized = value.replace(/^#/, "");
|
|
573
|
+
const red = Number.parseInt(normalized.slice(0, 2), 16);
|
|
574
|
+
const green = Number.parseInt(normalized.slice(2, 4), 16);
|
|
575
|
+
const blue = Number.parseInt(normalized.slice(4, 6), 16);
|
|
576
|
+
return [red, green, blue];
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
function truncate(value, width) {
|
|
580
|
+
if (width <= 0) {
|
|
581
|
+
return "";
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
if (value.length <= width) {
|
|
585
|
+
return value;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
if (width <= 3) {
|
|
589
|
+
return value.slice(0, width);
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
return `${value.slice(0, width - 3)}...`;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
function normalizeColumns(columns) {
|
|
596
|
+
return typeof columns === "number" && Number.isFinite(columns) && columns > 0 ? columns : 80;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
function countTerminalLines(value, columns) {
|
|
600
|
+
const normalized = value.endsWith("\n") ? value.slice(0, -1) : value;
|
|
601
|
+
|
|
602
|
+
if (!normalized) {
|
|
603
|
+
return 0;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
const width = normalizeColumns(columns);
|
|
607
|
+
|
|
608
|
+
return normalized.split("\n").reduce((total, line) => {
|
|
609
|
+
const visibleLength = stripAnsi(line).length;
|
|
610
|
+
return total + Math.max(1, Math.floor(Math.max(visibleLength - 1, 0) / width) + 1);
|
|
611
|
+
}, 0);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
function stripAnsi(value) {
|
|
615
|
+
return value.replace(/\u001B\[[0-9;]*m/g, "");
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
function ensureNewline(value) {
|
|
619
|
+
return value.endsWith("\n") ? value : `${value}\n`;
|
|
620
|
+
}
|
package/bundle/.next/BUILD_ID
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ujFbMZ9arxb7I3_g4GzfY
|
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
"/_not-found/page": "/_not-found",
|
|
3
3
|
"/_global-error/page": "/_global-error",
|
|
4
4
|
"/api/openclaw/capabilities/route": "/api/openclaw/capabilities",
|
|
5
|
-
"/api/agents/route": "/api/agents",
|
|
6
5
|
"/api/diagnostics/route": "/api/diagnostics",
|
|
6
|
+
"/api/agents/route": "/api/agents",
|
|
7
|
+
"/api/agents/[agentId]/chat/route": "/api/agents/[agentId]/chat",
|
|
7
8
|
"/api/files/reveal/route": "/api/files/reveal",
|
|
8
|
-
"/api/mission/route": "/api/mission",
|
|
9
9
|
"/api/gateway/control/route": "/api/gateway/control",
|
|
10
|
-
"/api/
|
|
10
|
+
"/api/mission/route": "/api/mission",
|
|
11
11
|
"/api/models/catalog/route": "/api/models/catalog",
|
|
12
|
+
"/api/models/providers/route": "/api/models/providers",
|
|
12
13
|
"/api/planner/[planId]/deploy/route": "/api/planner/[planId]/deploy",
|
|
14
|
+
"/api/onboarding/models/route": "/api/onboarding/models",
|
|
13
15
|
"/api/planner/[planId]/document-rewrite/route": "/api/planner/[planId]/document-rewrite",
|
|
14
16
|
"/api/planner/[planId]/route": "/api/planner/[planId]",
|
|
15
17
|
"/api/planner/[planId]/simulate/route": "/api/planner/[planId]/simulate",
|
|
16
18
|
"/api/planner/[planId]/turn/route": "/api/planner/[planId]/turn",
|
|
19
|
+
"/api/onboarding/route": "/api/onboarding",
|
|
17
20
|
"/api/planner/route": "/api/planner",
|
|
18
21
|
"/api/reset/route": "/api/reset",
|
|
19
22
|
"/api/runtimes/[runtimeId]/route": "/api/runtimes/[runtimeId]",
|
|
@@ -26,16 +29,13 @@
|
|
|
26
29
|
"/api/tasks/[taskId]/abort/route": "/api/tasks/[taskId]/abort",
|
|
27
30
|
"/api/tasks/[taskId]/control/route": "/api/tasks/[taskId]/control",
|
|
28
31
|
"/api/tasks/[taskId]/stream/route": "/api/tasks/[taskId]/stream",
|
|
29
|
-
"/api/onboarding/route": "/api/onboarding",
|
|
30
|
-
"/api/models/providers/route": "/api/models/providers",
|
|
31
|
-
"/api/onboarding/models/route": "/api/onboarding/models",
|
|
32
|
-
"/api/workspaces/[workspaceId]/edit-draft/route": "/api/workspaces/[workspaceId]/edit-draft",
|
|
33
32
|
"/api/workspaces/[workspaceId]/channels/discovered-groups/route": "/api/workspaces/[workspaceId]/channels/discovered-groups",
|
|
33
|
+
"/api/workspaces/[workspaceId]/edit-draft/route": "/api/workspaces/[workspaceId]/edit-draft",
|
|
34
|
+
"/api/update/route": "/api/update",
|
|
35
|
+
"/api/workspaces/[workspaceId]/channels/route": "/api/workspaces/[workspaceId]/channels",
|
|
34
36
|
"/api/workspaces/[workspaceId]/files/route": "/api/workspaces/[workspaceId]/files",
|
|
35
37
|
"/api/workspaces/[workspaceId]/surfaces/discovery/route": "/api/workspaces/[workspaceId]/surfaces/discovery",
|
|
36
|
-
"/api/workspaces/[workspaceId]/channels/route": "/api/workspaces/[workspaceId]/channels",
|
|
37
38
|
"/api/workspaces/route": "/api/workspaces",
|
|
38
|
-
"/api/update/route": "/api/update",
|
|
39
39
|
"/page": "/",
|
|
40
40
|
"/settings/page": "/settings"
|
|
41
41
|
}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
],
|
|
5
5
|
"devFiles": [],
|
|
6
6
|
"lowPriorityFiles": [
|
|
7
|
-
"static/
|
|
8
|
-
"static/
|
|
7
|
+
"static/ujFbMZ9arxb7I3_g4GzfY/_buildManifest.js",
|
|
8
|
+
"static/ujFbMZ9arxb7I3_g4GzfY/_ssgManifest.js"
|
|
9
9
|
],
|
|
10
10
|
"rootMainFiles": [
|
|
11
11
|
"static/chunks/webpack-49728cc9bb386219.js",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"dynamicRoutes": {},
|
|
55
55
|
"notFoundRoutes": [],
|
|
56
56
|
"preview": {
|
|
57
|
-
"previewModeId": "
|
|
58
|
-
"previewModeSigningKey": "
|
|
59
|
-
"previewModeEncryptionKey": "
|
|
57
|
+
"previewModeId": "1dda17a0e917f3b72277d20ca99330be",
|
|
58
|
+
"previewModeSigningKey": "4aefd6868bb017fcab771d10341334dbaf145ed5f90660ca87ee0fd60a2e6687",
|
|
59
|
+
"previewModeEncryptionKey": "1b9303da6c194fba07b81daee1a62a793151e3b7d88e4db28704051bc63cf5ef"
|
|
60
60
|
}
|
|
61
61
|
}
|