@silicaclaw/cli 1.0.0-beta.17 → 1.0.0-beta.19
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.
|
@@ -427,6 +427,22 @@
|
|
|
427
427
|
white-space: pre-wrap;
|
|
428
428
|
word-break: break-word;
|
|
429
429
|
}
|
|
430
|
+
.advanced-panel {
|
|
431
|
+
margin-top: 10px;
|
|
432
|
+
}
|
|
433
|
+
.advanced-panel summary {
|
|
434
|
+
cursor: pointer;
|
|
435
|
+
list-style: none;
|
|
436
|
+
user-select: none;
|
|
437
|
+
}
|
|
438
|
+
.advanced-panel summary::-webkit-details-marker { display: none; }
|
|
439
|
+
.advanced-panel summary::after {
|
|
440
|
+
content: "Show";
|
|
441
|
+
float: right;
|
|
442
|
+
color: var(--muted);
|
|
443
|
+
font-size: 12px;
|
|
444
|
+
}
|
|
445
|
+
.advanced-panel[open] summary::after { content: "Hide"; }
|
|
430
446
|
|
|
431
447
|
.toast {
|
|
432
448
|
position: fixed;
|
|
@@ -474,10 +490,7 @@
|
|
|
474
490
|
<button class="tab active" data-tab="overview">Overview</button>
|
|
475
491
|
<button class="tab" data-tab="profile">Profile</button>
|
|
476
492
|
<button class="tab" data-tab="network">Network</button>
|
|
477
|
-
<button class="tab" data-tab="
|
|
478
|
-
<button class="tab" data-tab="discovery">Discovery Events</button>
|
|
479
|
-
<button class="tab" data-tab="social">Social Config</button>
|
|
480
|
-
<button class="tab" data-tab="logs">Logs</button>
|
|
493
|
+
<button class="tab" data-tab="social">Social</button>
|
|
481
494
|
</nav>
|
|
482
495
|
|
|
483
496
|
<div class="sidebar-foot" id="sideMeta">adapter: -<br/>namespace: -</div>
|
|
@@ -602,15 +615,20 @@
|
|
|
602
615
|
<div class="mono" id="networkComponents"></div>
|
|
603
616
|
</div>
|
|
604
617
|
<div class="card">
|
|
605
|
-
<h3 class="title-sm">Actions</h3>
|
|
618
|
+
<h3 class="title-sm">Quick Actions</h3>
|
|
606
619
|
<div class="actions">
|
|
607
620
|
<button id="startBroadcastBtn">Start Broadcast</button>
|
|
608
621
|
<button class="secondary" id="stopBroadcastBtn">Stop Broadcast</button>
|
|
609
622
|
<button class="secondary" id="broadcastNowBtn">Broadcast Now</button>
|
|
623
|
+
</div>
|
|
624
|
+
<details class="advanced-panel">
|
|
625
|
+
<summary class="title-sm">Advanced Actions</summary>
|
|
626
|
+
<div class="actions" style="margin-top:10px;">
|
|
610
627
|
<button class="secondary" id="refreshCacheBtn">Refresh Cache</button>
|
|
611
628
|
<button class="secondary" id="clearCacheBtn">Clear Discovered Cache</button>
|
|
612
629
|
<button class="secondary" id="quickGlobalPreviewBtn">Enable Cross-network Preview</button>
|
|
613
630
|
</div>
|
|
631
|
+
</details>
|
|
614
632
|
<div id="networkFeedback" class="feedback" style="margin-top:10px;">Ready.</div>
|
|
615
633
|
</div>
|
|
616
634
|
</div>
|
|
@@ -624,32 +642,47 @@
|
|
|
624
642
|
<div class="mono mono-block" id="networkStatsSnapshot">-</div>
|
|
625
643
|
</div>
|
|
626
644
|
</div>
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
<div class="grid" id="peerCards"></div>
|
|
631
|
-
<div class="card" style="margin-top:10px;">
|
|
632
|
-
<h3 class="title-sm">Peer Inventory</h3>
|
|
633
|
-
<div id="peerTableWrap"></div>
|
|
634
|
-
</div>
|
|
635
|
-
<div class="card" style="margin-top:10px;">
|
|
636
|
-
<h3 class="title-sm">Peer Discovery Stats</h3>
|
|
637
|
-
<div class="mono mono-block" id="peerStatsWrap">-</div>
|
|
638
|
-
</div>
|
|
639
|
-
</section>
|
|
640
|
-
|
|
641
|
-
<section id="view-discovery" class="view">
|
|
642
|
-
<div class="grid" id="discoveryCards"></div>
|
|
643
|
-
<div class="split">
|
|
645
|
+
<details class="advanced-panel card">
|
|
646
|
+
<summary class="title-sm">Diagnostics</summary>
|
|
647
|
+
<div class="grid" id="peerCards" style="margin-top:10px;"></div>
|
|
644
648
|
<div class="card" style="margin-top:10px;">
|
|
645
|
-
<h3 class="title-sm">
|
|
646
|
-
<div
|
|
649
|
+
<h3 class="title-sm">Peer Inventory</h3>
|
|
650
|
+
<div id="peerTableWrap"></div>
|
|
647
651
|
</div>
|
|
648
652
|
<div class="card" style="margin-top:10px;">
|
|
649
|
-
<h3 class="title-sm">Discovery
|
|
650
|
-
<div class="mono mono-block" id="
|
|
653
|
+
<h3 class="title-sm">Peer Discovery Stats</h3>
|
|
654
|
+
<div class="mono mono-block" id="peerStatsWrap">-</div>
|
|
651
655
|
</div>
|
|
652
|
-
|
|
656
|
+
<div class="grid" id="discoveryCards" style="margin-top:10px;"></div>
|
|
657
|
+
<div class="split">
|
|
658
|
+
<div class="card" style="margin-top:10px;">
|
|
659
|
+
<h3 class="title-sm">Recent Discovery Events</h3>
|
|
660
|
+
<div class="logs" id="discoveryEventList"></div>
|
|
661
|
+
</div>
|
|
662
|
+
<div class="card" style="margin-top:10px;">
|
|
663
|
+
<h3 class="title-sm">Discovery Snapshot</h3>
|
|
664
|
+
<div class="mono mono-block" id="discoverySnapshot">-</div>
|
|
665
|
+
</div>
|
|
666
|
+
</div>
|
|
667
|
+
<div class="card" style="margin-top:10px;">
|
|
668
|
+
<h3 class="title-sm">Logs</h3>
|
|
669
|
+
<div class="toolbar">
|
|
670
|
+
<div class="field">
|
|
671
|
+
<label for="logLevelFilter">Category</label>
|
|
672
|
+
<select id="logLevelFilter">
|
|
673
|
+
<option value="all">all</option>
|
|
674
|
+
<option value="info">info</option>
|
|
675
|
+
<option value="warn">warn</option>
|
|
676
|
+
<option value="error">error</option>
|
|
677
|
+
</select>
|
|
678
|
+
</div>
|
|
679
|
+
<div>
|
|
680
|
+
<button type="button" class="secondary" id="refreshLogsBtn">Refresh Logs</button>
|
|
681
|
+
</div>
|
|
682
|
+
</div>
|
|
683
|
+
<div class="logs" id="logList"></div>
|
|
684
|
+
</div>
|
|
685
|
+
</details>
|
|
653
686
|
</section>
|
|
654
687
|
|
|
655
688
|
<section id="view-social" class="view">
|
|
@@ -666,22 +699,25 @@
|
|
|
666
699
|
<div class="grid" id="socialAdvancedCards" style="margin-top:10px;"></div>
|
|
667
700
|
<div class="mono mono-block" id="socialAdvancedWrap" style="margin-top:10px;">-</div>
|
|
668
701
|
</details>
|
|
669
|
-
<
|
|
670
|
-
<
|
|
671
|
-
|
|
672
|
-
<div class="
|
|
673
|
-
|
|
674
|
-
|
|
702
|
+
<details class="advanced-panel card">
|
|
703
|
+
<summary class="title-sm">Source / Runtime / Template</summary>
|
|
704
|
+
<div class="split">
|
|
705
|
+
<div class="card" style="margin-top:10px;">
|
|
706
|
+
<h3 class="title-sm">Source & Parsed Frontmatter</h3>
|
|
707
|
+
<div class="mono mono-block" id="socialSourceWrap">-</div>
|
|
708
|
+
<div style="height:10px;"></div>
|
|
709
|
+
<div class="mono mono-block" id="socialRawWrap">-</div>
|
|
710
|
+
</div>
|
|
711
|
+
<div class="card" style="margin-top:10px;">
|
|
712
|
+
<h3 class="title-sm">Runtime Summary</h3>
|
|
713
|
+
<div class="mono mono-block" id="socialRuntimeWrap">-</div>
|
|
714
|
+
</div>
|
|
675
715
|
</div>
|
|
676
716
|
<div class="card" style="margin-top:10px;">
|
|
677
|
-
<h3 class="title-sm">
|
|
678
|
-
<div class="mono mono-block" id="
|
|
717
|
+
<h3 class="title-sm">Export Template Preview</h3>
|
|
718
|
+
<div class="mono mono-block" id="socialTemplateWrap">-</div>
|
|
679
719
|
</div>
|
|
680
|
-
</
|
|
681
|
-
<div class="card" style="margin-top:10px;">
|
|
682
|
-
<h3 class="title-sm">Export Template Preview</h3>
|
|
683
|
-
<div class="mono mono-block" id="socialTemplateWrap">-</div>
|
|
684
|
-
</div>
|
|
720
|
+
</details>
|
|
685
721
|
<div class="card" style="margin-top:10px;">
|
|
686
722
|
<h3 class="title-sm">Actions</h3>
|
|
687
723
|
<div class="toolbar">
|
|
@@ -707,27 +743,6 @@
|
|
|
707
743
|
<div id="socialFeedback" class="feedback" style="margin-top:10px;">Ready.</div>
|
|
708
744
|
</div>
|
|
709
745
|
</section>
|
|
710
|
-
|
|
711
|
-
<section id="view-logs" class="view">
|
|
712
|
-
<div class="card">
|
|
713
|
-
<h3 class="title-sm">Recent Logs</h3>
|
|
714
|
-
<div class="toolbar">
|
|
715
|
-
<div class="field">
|
|
716
|
-
<label for="logLevelFilter">Category</label>
|
|
717
|
-
<select id="logLevelFilter">
|
|
718
|
-
<option value="all">all</option>
|
|
719
|
-
<option value="info">info</option>
|
|
720
|
-
<option value="warn">warn</option>
|
|
721
|
-
<option value="error">error</option>
|
|
722
|
-
</select>
|
|
723
|
-
</div>
|
|
724
|
-
<div>
|
|
725
|
-
<button type="button" class="secondary" id="refreshLogsBtn">Refresh Logs</button>
|
|
726
|
-
</div>
|
|
727
|
-
</div>
|
|
728
|
-
<div class="logs" id="logList"></div>
|
|
729
|
-
</div>
|
|
730
|
-
</section>
|
|
731
746
|
</main>
|
|
732
747
|
</div>
|
|
733
748
|
|
|
@@ -919,7 +934,7 @@
|
|
|
919
934
|
}
|
|
920
935
|
activeTab = tab;
|
|
921
936
|
document.querySelectorAll('.tab').forEach((b) => b.classList.toggle('active', b.dataset.tab === tab));
|
|
922
|
-
['overview', 'profile', 'network', '
|
|
937
|
+
['overview', 'profile', 'network', 'social'].forEach((k) => {
|
|
923
938
|
document.getElementById(`view-${k}`).classList.toggle('active', k === tab);
|
|
924
939
|
});
|
|
925
940
|
if (tab === 'profile' && !profileDirty && !profileSaving) {
|
|
@@ -1320,7 +1335,10 @@
|
|
|
1320
1335
|
|
|
1321
1336
|
async function refreshAll() {
|
|
1322
1337
|
try {
|
|
1323
|
-
const tasks = [refreshOverview(), refreshNetwork(),
|
|
1338
|
+
const tasks = [refreshOverview(), refreshNetwork(), refreshSocial(), refreshPublicProfilePreview()];
|
|
1339
|
+
if (activeTab === 'network') {
|
|
1340
|
+
tasks.push(refreshPeers(), refreshDiscovery(), refreshLogs());
|
|
1341
|
+
}
|
|
1324
1342
|
const shouldRefreshProfile = !(activeTab === 'profile' && profileDirty);
|
|
1325
1343
|
if (shouldRefreshProfile) {
|
|
1326
1344
|
tasks.push(refreshProfile());
|
package/package.json
CHANGED
|
@@ -207,13 +207,23 @@ function resolveProfileInputWithSocial(args) {
|
|
|
207
207
|
const baseBio = existingProfile?.bio || "";
|
|
208
208
|
const baseAvatarUrl = existingProfile?.avatar_url || "";
|
|
209
209
|
const baseTags = existingProfile?.tags || [];
|
|
210
|
+
// Preserve values saved from local-console first; only fall back to social/openclaw defaults
|
|
211
|
+
// when local profile fields are empty.
|
|
212
|
+
const displayName = baseDisplayName || socialConfig.identity.display_name || openclawProfile?.display_name || "";
|
|
213
|
+
const bio = baseBio || socialConfig.identity.bio || openclawProfile?.bio || "";
|
|
214
|
+
const avatarUrl = baseAvatarUrl || socialConfig.identity.avatar_url || openclawProfile?.avatar_url || "";
|
|
215
|
+
const tags = baseTags.length > 0
|
|
216
|
+
? baseTags
|
|
217
|
+
: socialConfig.identity.tags.length > 0
|
|
218
|
+
? socialConfig.identity.tags
|
|
219
|
+
: openclawProfile?.tags || [];
|
|
210
220
|
return {
|
|
211
221
|
agent_id: agentId,
|
|
212
|
-
display_name:
|
|
213
|
-
bio
|
|
214
|
-
avatar_url:
|
|
215
|
-
tags
|
|
216
|
-
public_enabled: socialConfig.public_enabled,
|
|
222
|
+
display_name: displayName,
|
|
223
|
+
bio,
|
|
224
|
+
avatar_url: avatarUrl,
|
|
225
|
+
tags,
|
|
226
|
+
public_enabled: existingProfile?.public_enabled ?? socialConfig.public_enabled,
|
|
217
227
|
};
|
|
218
228
|
}
|
|
219
229
|
function ensureDefaultSocialMd(rootDir = process.cwd(), options = {}) {
|
|
@@ -257,13 +257,25 @@ export function resolveProfileInputWithSocial(args: {
|
|
|
257
257
|
const baseAvatarUrl = existingProfile?.avatar_url || "";
|
|
258
258
|
const baseTags = existingProfile?.tags || [];
|
|
259
259
|
|
|
260
|
+
// Preserve values saved from local-console first; only fall back to social/openclaw defaults
|
|
261
|
+
// when local profile fields are empty.
|
|
262
|
+
const displayName = baseDisplayName || socialConfig.identity.display_name || openclawProfile?.display_name || "";
|
|
263
|
+
const bio = baseBio || socialConfig.identity.bio || openclawProfile?.bio || "";
|
|
264
|
+
const avatarUrl = baseAvatarUrl || socialConfig.identity.avatar_url || openclawProfile?.avatar_url || "";
|
|
265
|
+
const tags =
|
|
266
|
+
baseTags.length > 0
|
|
267
|
+
? baseTags
|
|
268
|
+
: socialConfig.identity.tags.length > 0
|
|
269
|
+
? socialConfig.identity.tags
|
|
270
|
+
: openclawProfile?.tags || [];
|
|
271
|
+
|
|
260
272
|
return {
|
|
261
273
|
agent_id: agentId,
|
|
262
|
-
display_name:
|
|
263
|
-
bio
|
|
264
|
-
avatar_url:
|
|
265
|
-
tags
|
|
266
|
-
public_enabled: socialConfig.public_enabled,
|
|
274
|
+
display_name: displayName,
|
|
275
|
+
bio,
|
|
276
|
+
avatar_url: avatarUrl,
|
|
277
|
+
tags,
|
|
278
|
+
public_enabled: existingProfile?.public_enabled ?? socialConfig.public_enabled,
|
|
267
279
|
};
|
|
268
280
|
}
|
|
269
281
|
|
|
@@ -37,6 +37,19 @@ function runCapture(cmd, args, extra = {}) {
|
|
|
37
37
|
return result;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
function runInherit(cmd, args, extra = {}) {
|
|
41
|
+
const result = spawnSync(cmd, args, {
|
|
42
|
+
cwd: ROOT_DIR,
|
|
43
|
+
stdio: "inherit",
|
|
44
|
+
env: process.env,
|
|
45
|
+
...extra,
|
|
46
|
+
});
|
|
47
|
+
if (result.error) {
|
|
48
|
+
throw result.error;
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
|
|
40
53
|
function readVersion() {
|
|
41
54
|
const versionFile = resolve(ROOT_DIR, "VERSION");
|
|
42
55
|
if (!existsSync(versionFile)) return "unknown";
|
|
@@ -89,11 +102,11 @@ function showUpdateGuide(current, latest, beta) {
|
|
|
89
102
|
console.log("");
|
|
90
103
|
console.log("Quick next commands:");
|
|
91
104
|
console.log("1) Start local gateway");
|
|
92
|
-
console.log(" silicaclaw
|
|
105
|
+
console.log(" silicaclaw start --mode=local");
|
|
93
106
|
console.log("2) Check gateway status");
|
|
94
|
-
console.log(" silicaclaw
|
|
107
|
+
console.log(" silicaclaw status");
|
|
95
108
|
console.log("3) npx one-shot (no alias/global install)");
|
|
96
|
-
console.log(" npx -y @silicaclaw/cli@beta
|
|
109
|
+
console.log(" npx -y @silicaclaw/cli@beta start --mode=local");
|
|
97
110
|
console.log("");
|
|
98
111
|
|
|
99
112
|
const writableGlobal = canWriteGlobalPrefix();
|
|
@@ -112,6 +125,49 @@ function showUpdateGuide(current, latest, beta) {
|
|
|
112
125
|
}
|
|
113
126
|
}
|
|
114
127
|
|
|
128
|
+
function getGatewayStatus() {
|
|
129
|
+
try {
|
|
130
|
+
const result = runCapture("node", [resolve(ROOT_DIR, "scripts", "silicaclaw-gateway.mjs"), "status"], {
|
|
131
|
+
cwd: process.cwd(),
|
|
132
|
+
});
|
|
133
|
+
if ((result.status ?? 1) !== 0) return null;
|
|
134
|
+
const text = String(result.stdout || "").trim();
|
|
135
|
+
return text ? JSON.parse(text) : null;
|
|
136
|
+
} catch {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function restartGatewayIfRunning() {
|
|
142
|
+
const status = getGatewayStatus();
|
|
143
|
+
const localRunning = Boolean(status?.local_console?.running);
|
|
144
|
+
const signalingRunning = Boolean(status?.signaling?.running);
|
|
145
|
+
if (!localRunning && !signalingRunning) {
|
|
146
|
+
console.log("Gateway not running: no restart needed.");
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const mode = String(status?.mode || "local");
|
|
151
|
+
const args = [resolve(ROOT_DIR, "scripts", "silicaclaw-gateway.mjs"), "restart", `--mode=${mode}`];
|
|
152
|
+
if (mode === "global-preview" && status?.signaling?.url) {
|
|
153
|
+
args.push(`--signaling-url=${status.signaling.url}`);
|
|
154
|
+
}
|
|
155
|
+
if (mode === "global-preview" && status?.signaling?.room) {
|
|
156
|
+
args.push(`--room=${status.signaling.room}`);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
console.log("Refreshing gateway services...");
|
|
160
|
+
runInherit("node", args, { cwd: process.cwd() });
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function tryGlobalUpgrade(beta) {
|
|
164
|
+
const writableGlobal = canWriteGlobalPrefix();
|
|
165
|
+
if (!writableGlobal) return false;
|
|
166
|
+
console.log(`Installing @silicaclaw/cli@${beta} globally...`);
|
|
167
|
+
const result = runInherit("npm", ["i", "-g", `@silicaclaw/cli@${beta}`]);
|
|
168
|
+
return (result.status ?? 1) === 0;
|
|
169
|
+
}
|
|
170
|
+
|
|
115
171
|
function update() {
|
|
116
172
|
const current = readPackageVersion();
|
|
117
173
|
try {
|
|
@@ -126,6 +182,20 @@ function update() {
|
|
|
126
182
|
const latest = tags.latest ? String(tags.latest) : "";
|
|
127
183
|
const beta = tags.beta ? String(tags.beta) : "";
|
|
128
184
|
showUpdateGuide(current, latest, beta);
|
|
185
|
+
const hasNewBeta = Boolean(beta) && beta !== current;
|
|
186
|
+
const npxRuntime = isNpxRun();
|
|
187
|
+
|
|
188
|
+
if (hasNewBeta) {
|
|
189
|
+
if (npxRuntime) {
|
|
190
|
+
console.log(`New beta detected (${beta}). npx will use latest on next run.`);
|
|
191
|
+
} else if (tryGlobalUpgrade(beta)) {
|
|
192
|
+
console.log(`Global upgrade completed: ${beta}`);
|
|
193
|
+
} else {
|
|
194
|
+
console.log("Skipped global upgrade (no write permission or upgrade failed).");
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
restartGatewayIfRunning();
|
|
129
199
|
process.exit(0);
|
|
130
200
|
} catch (error) {
|
|
131
201
|
console.error(`Update check failed: ${error.message}`);
|