@silicaclaw/cli 2026.3.20-2 → 2026.3.20-21
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/CHANGELOG.md +108 -0
- package/INSTALL.md +13 -7
- package/README.md +60 -12
- package/VERSION +1 -1
- package/apps/local-console/dist/apps/local-console/src/server.d.ts +139 -3
- package/apps/local-console/dist/apps/local-console/src/server.js +1029 -92
- package/apps/local-console/dist/packages/core/src/index.d.ts +2 -0
- package/apps/local-console/dist/packages/core/src/index.js +2 -0
- package/apps/local-console/dist/packages/core/src/privateCrypto.d.ts +17 -0
- package/apps/local-console/dist/packages/core/src/privateCrypto.js +40 -0
- package/apps/local-console/dist/packages/core/src/privateMessage.d.ts +23 -0
- package/apps/local-console/dist/packages/core/src/privateMessage.js +74 -0
- package/apps/local-console/dist/packages/core/src/profile.js +2 -0
- package/apps/local-console/dist/packages/core/src/publicProfileSummary.d.ts +4 -0
- package/apps/local-console/dist/packages/core/src/publicProfileSummary.js +3 -0
- package/apps/local-console/dist/packages/core/src/types.d.ts +40 -0
- package/apps/local-console/dist/packages/network/src/relayPreview.d.ts +12 -0
- package/apps/local-console/dist/packages/network/src/relayPreview.js +108 -8
- package/apps/local-console/dist/packages/network/src/types.d.ts +4 -0
- package/apps/local-console/dist/packages/storage/src/repos.d.ts +27 -1
- package/apps/local-console/dist/packages/storage/src/repos.js +35 -1
- package/apps/local-console/public/app/app.js +502 -11
- package/apps/local-console/public/app/events.js +21 -0
- package/apps/local-console/public/app/network.js +144 -32
- package/apps/local-console/public/app/overview.js +57 -27
- package/apps/local-console/public/app/social.js +342 -105
- package/apps/local-console/public/app/styles.css +149 -43
- package/apps/local-console/public/app/template.js +196 -100
- package/apps/local-console/public/app/translations.js +438 -316
- package/apps/local-console/src/server.ts +1177 -90
- package/apps/public-explorer/public/app/template.js +2 -2
- package/apps/public-explorer/public/app/translations.js +36 -36
- package/docs/NEW_USER_OPERATIONS.md +5 -5
- package/docs/OPENCLAW_BRIDGE.md +7 -7
- package/docs/OPENCLAW_BRIDGE_ZH.md +6 -6
- package/node_modules/@silicaclaw/core/dist/packages/core/src/index.d.ts +2 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/index.js +2 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/privateCrypto.d.ts +17 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/privateCrypto.js +40 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/privateMessage.d.ts +23 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/privateMessage.js +74 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/profile.js +2 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/publicProfileSummary.d.ts +4 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/publicProfileSummary.js +3 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/types.d.ts +40 -0
- package/node_modules/@silicaclaw/core/package.json +2 -2
- package/node_modules/@silicaclaw/core/src/index.ts +2 -0
- package/node_modules/@silicaclaw/core/src/privateCrypto.ts +57 -0
- package/node_modules/@silicaclaw/core/src/privateMessage.ts +101 -0
- package/node_modules/@silicaclaw/core/src/profile.ts +2 -0
- package/node_modules/@silicaclaw/core/src/publicProfileSummary.ts +7 -0
- package/node_modules/@silicaclaw/core/src/types.ts +44 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/relayPreview.d.ts +12 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/relayPreview.js +108 -8
- package/node_modules/@silicaclaw/network/dist/packages/network/src/types.d.ts +4 -0
- package/node_modules/@silicaclaw/network/src/relayPreview.ts +120 -10
- package/node_modules/@silicaclaw/network/src/types.ts +2 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/index.d.ts +2 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/index.js +2 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/privateCrypto.d.ts +17 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/privateCrypto.js +40 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/privateMessage.d.ts +23 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/privateMessage.js +74 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/profile.js +2 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/publicProfileSummary.d.ts +4 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/publicProfileSummary.js +3 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/types.d.ts +40 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/repos.d.ts +27 -1
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/repos.js +35 -1
- package/node_modules/@silicaclaw/storage/package.json +2 -2
- package/node_modules/@silicaclaw/storage/src/repos.ts +59 -1
- package/openclaw-skills/silicaclaw-bridge-setup/SKILL.md +18 -0
- package/openclaw-skills/silicaclaw-bridge-setup/VERSION +1 -1
- package/openclaw-skills/silicaclaw-bridge-setup/manifest.json +2 -2
- package/openclaw-skills/silicaclaw-broadcast/SKILL.md +18 -0
- package/openclaw-skills/silicaclaw-broadcast/VERSION +1 -1
- package/openclaw-skills/silicaclaw-broadcast/manifest.json +2 -2
- package/openclaw-skills/silicaclaw-network-config/SKILL.md +158 -0
- package/openclaw-skills/silicaclaw-network-config/VERSION +1 -0
- package/openclaw-skills/silicaclaw-network-config/agents/openai.yaml +6 -0
- package/openclaw-skills/silicaclaw-network-config/manifest.json +27 -0
- package/openclaw-skills/silicaclaw-network-config/references/network-modes.md +22 -0
- package/openclaw-skills/silicaclaw-network-config/references/owner-dialogue-cheatsheet-zh.md +47 -0
- package/openclaw-skills/silicaclaw-network-config/references/public-discovery.md +22 -0
- package/openclaw-skills/silicaclaw-owner-push/SKILL.md +18 -0
- package/openclaw-skills/silicaclaw-owner-push/VERSION +1 -1
- package/openclaw-skills/silicaclaw-owner-push/manifest.json +2 -2
- package/openclaw-skills/silicaclaw-owner-push/references/runtime-setup.md +3 -0
- package/openclaw-skills/silicaclaw-owner-push/scripts/owner-push-forwarder.mjs +151 -9
- package/package.json +1 -1
- package/packages/core/dist/packages/core/src/index.d.ts +2 -0
- package/packages/core/dist/packages/core/src/index.js +2 -0
- package/packages/core/dist/packages/core/src/privateCrypto.d.ts +17 -0
- package/packages/core/dist/packages/core/src/privateCrypto.js +40 -0
- package/packages/core/dist/packages/core/src/privateMessage.d.ts +23 -0
- package/packages/core/dist/packages/core/src/privateMessage.js +74 -0
- package/packages/core/dist/packages/core/src/profile.js +2 -0
- package/packages/core/dist/packages/core/src/publicProfileSummary.d.ts +4 -0
- package/packages/core/dist/packages/core/src/publicProfileSummary.js +3 -0
- package/packages/core/dist/packages/core/src/types.d.ts +40 -0
- package/packages/core/package.json +2 -2
- package/packages/core/src/index.ts +2 -0
- package/packages/core/src/privateCrypto.ts +57 -0
- package/packages/core/src/privateMessage.ts +101 -0
- package/packages/core/src/profile.ts +2 -0
- package/packages/core/src/publicProfileSummary.ts +7 -0
- package/packages/core/src/types.ts +44 -0
- package/packages/network/dist/packages/network/src/relayPreview.d.ts +12 -0
- package/packages/network/dist/packages/network/src/relayPreview.js +108 -8
- package/packages/network/dist/packages/network/src/types.d.ts +4 -0
- package/packages/network/src/relayPreview.ts +120 -10
- package/packages/network/src/types.ts +2 -0
- package/packages/storage/dist/packages/core/src/index.d.ts +2 -0
- package/packages/storage/dist/packages/core/src/index.js +2 -0
- package/packages/storage/dist/packages/core/src/privateCrypto.d.ts +17 -0
- package/packages/storage/dist/packages/core/src/privateCrypto.js +40 -0
- package/packages/storage/dist/packages/core/src/privateMessage.d.ts +23 -0
- package/packages/storage/dist/packages/core/src/privateMessage.js +74 -0
- package/packages/storage/dist/packages/core/src/profile.js +2 -0
- package/packages/storage/dist/packages/core/src/publicProfileSummary.d.ts +4 -0
- package/packages/storage/dist/packages/core/src/publicProfileSummary.js +3 -0
- package/packages/storage/dist/packages/core/src/types.d.ts +40 -0
- package/packages/storage/dist/packages/storage/src/repos.d.ts +27 -1
- package/packages/storage/dist/packages/storage/src/repos.js +35 -1
- package/packages/storage/package.json +2 -2
- package/packages/storage/src/repos.ts +59 -1
- package/scripts/silicaclaw-cli.mjs +4 -1
- package/scripts/silicaclaw-gateway.mjs +114 -2
- package/scripts/validate-openclaw-skill.mjs +19 -0
- package/node_modules/@silicaclaw/storage/dist/index.d.ts +0 -3
- package/node_modules/@silicaclaw/storage/dist/index.js +0 -19
- package/node_modules/@silicaclaw/storage/dist/jsonRepo.d.ts +0 -7
- package/node_modules/@silicaclaw/storage/dist/jsonRepo.js +0 -29
- package/node_modules/@silicaclaw/storage/dist/repos.d.ts +0 -61
- package/node_modules/@silicaclaw/storage/dist/repos.js +0 -67
- package/node_modules/@silicaclaw/storage/dist/socialRuntimeRepo.d.ts +0 -5
- package/node_modules/@silicaclaw/storage/dist/socialRuntimeRepo.js +0 -57
- package/packages/storage/dist/index.d.ts +0 -3
- package/packages/storage/dist/index.js +0 -19
- package/packages/storage/dist/jsonRepo.d.ts +0 -7
- package/packages/storage/dist/jsonRepo.js +0 -29
- package/packages/storage/dist/repos.d.ts +0 -61
- package/packages/storage/dist/repos.js +0 -67
- package/packages/storage/dist/socialRuntimeRepo.d.ts +0 -5
- package/packages/storage/dist/socialRuntimeRepo.js +0 -57
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { resolve } from "path";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
AgentIdentity,
|
|
4
|
+
DirectoryState,
|
|
5
|
+
PrivateEncryptionKeyPair,
|
|
6
|
+
PrivateMessageReceiptRecord,
|
|
7
|
+
PrivateMessageRecord,
|
|
8
|
+
PublicProfile,
|
|
9
|
+
createEmptyDirectoryState,
|
|
10
|
+
} from "@silicaclaw/core";
|
|
3
11
|
import { JsonFileRepo } from "./jsonRepo";
|
|
4
12
|
|
|
5
13
|
export type LogEntry = {
|
|
@@ -43,6 +51,22 @@ export type SocialMessageGovernanceConfig = {
|
|
|
43
51
|
blocked_terms: string[];
|
|
44
52
|
};
|
|
45
53
|
|
|
54
|
+
export type PrivateMessageDecryptedContent = {
|
|
55
|
+
body: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type PrivateMessagingRuntimeState = {
|
|
59
|
+
schema_version: number;
|
|
60
|
+
app_version: string;
|
|
61
|
+
last_started_at: number;
|
|
62
|
+
encryption_public_key: string;
|
|
63
|
+
encryption_public_key_fingerprint: string;
|
|
64
|
+
message_count: number;
|
|
65
|
+
self_sent_count: number;
|
|
66
|
+
cached_plaintext_count: number;
|
|
67
|
+
warnings: string[];
|
|
68
|
+
};
|
|
69
|
+
|
|
46
70
|
export class IdentityRepo extends JsonFileRepo<AgentIdentity | null> {
|
|
47
71
|
constructor(rootDir = process.cwd()) {
|
|
48
72
|
super(resolve(rootDir, "data", "identity.json"), () => null);
|
|
@@ -104,3 +128,37 @@ export class SocialMessageGovernanceRepo extends JsonFileRepo<SocialMessageGover
|
|
|
104
128
|
}));
|
|
105
129
|
}
|
|
106
130
|
}
|
|
131
|
+
|
|
132
|
+
export class PrivateMessageRepo extends JsonFileRepo<PrivateMessageRecord[]> {
|
|
133
|
+
constructor(rootDir = process.cwd()) {
|
|
134
|
+
super(resolve(rootDir, "data", "private-messages.json"), () => []);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export class PrivateMessageReceiptRepo extends JsonFileRepo<PrivateMessageReceiptRecord[]> {
|
|
139
|
+
constructor(rootDir = process.cwd()) {
|
|
140
|
+
super(resolve(rootDir, "data", "private-message-receipts.json"), () => []);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export class PrivateEncryptionKeyRepo extends JsonFileRepo<PrivateEncryptionKeyPair | null> {
|
|
145
|
+
constructor(rootDir = process.cwd()) {
|
|
146
|
+
super(resolve(rootDir, "data", "private-encryption-keypair.json"), () => null);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export class PrivateMessagingRuntimeRepo extends JsonFileRepo<PrivateMessagingRuntimeState> {
|
|
151
|
+
constructor(rootDir = process.cwd()) {
|
|
152
|
+
super(resolve(rootDir, ".silicaclaw", "private-messaging.runtime.json"), () => ({
|
|
153
|
+
schema_version: 1,
|
|
154
|
+
app_version: "",
|
|
155
|
+
last_started_at: 0,
|
|
156
|
+
encryption_public_key: "",
|
|
157
|
+
encryption_public_key_fingerprint: "",
|
|
158
|
+
message_count: 0,
|
|
159
|
+
self_sent_count: 0,
|
|
160
|
+
cached_plaintext_count: 0,
|
|
161
|
+
warnings: [],
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -224,10 +224,12 @@ function shellInitTargets() {
|
|
|
224
224
|
shell.endsWith("/bash") ||
|
|
225
225
|
process.env.BASH_VERSION ||
|
|
226
226
|
existsSync(resolve(home, ".bashrc")) ||
|
|
227
|
-
existsSync(resolve(home, ".bash_profile"))
|
|
227
|
+
existsSync(resolve(home, ".bash_profile")) ||
|
|
228
|
+
existsSync(resolve(home, ".profile"))
|
|
228
229
|
) {
|
|
229
230
|
add(resolve(home, ".bashrc"));
|
|
230
231
|
add(resolve(home, ".bash_profile"));
|
|
232
|
+
add(resolve(home, ".profile"));
|
|
231
233
|
}
|
|
232
234
|
|
|
233
235
|
if (targets.length === 0) {
|
|
@@ -280,6 +282,7 @@ function installPersistentCommand(specifier = readPackageVersion()) {
|
|
|
280
282
|
kv("Command", "silicaclaw");
|
|
281
283
|
console.log("");
|
|
282
284
|
kv("Activate", `source "${envFile}"`);
|
|
285
|
+
kv("Current shell", "run Activate now if `silicaclaw` is not found yet");
|
|
283
286
|
if (configuredFiles.length > 0) {
|
|
284
287
|
kv("Startup", "configured");
|
|
285
288
|
} else {
|
|
@@ -74,6 +74,11 @@ function readJson(file) {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
function readPackageVersionFrom(dir) {
|
|
78
|
+
const pkg = readJson(resolve(dir, "package.json"));
|
|
79
|
+
return String(pkg?.version || "latest").trim() || "latest";
|
|
80
|
+
}
|
|
81
|
+
|
|
77
82
|
function isSilicaClawDir(dir) {
|
|
78
83
|
const pkgPath = join(dir, "package.json");
|
|
79
84
|
if (!existsSync(pkgPath)) return false;
|
|
@@ -144,6 +149,107 @@ function ensureStateDir() {
|
|
|
144
149
|
mkdirSync(STATE_DIR, { recursive: true });
|
|
145
150
|
}
|
|
146
151
|
|
|
152
|
+
function userShimDir() {
|
|
153
|
+
return join(homedir(), ".silicaclaw", "bin");
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function userShimPath() {
|
|
157
|
+
return join(userShimDir(), "silicaclaw");
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function userEnvFile() {
|
|
161
|
+
return join(homedir(), ".silicaclaw", "env.sh");
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function userNpmCacheDir() {
|
|
165
|
+
return join(homedir(), ".silicaclaw", "npm-cache");
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function preferredShellRcFile() {
|
|
169
|
+
const shell = String(process.env.SHELL || "");
|
|
170
|
+
if (shell.endsWith("/zsh")) return resolve(homedir(), ".zshrc");
|
|
171
|
+
if (shell.endsWith("/bash")) return resolve(homedir(), ".bashrc");
|
|
172
|
+
if (process.env.ZSH_VERSION) return resolve(homedir(), ".zshrc");
|
|
173
|
+
return resolve(homedir(), ".bashrc");
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function shellInitTargets() {
|
|
177
|
+
const home = homedir();
|
|
178
|
+
const shell = String(process.env.SHELL || "");
|
|
179
|
+
const targets = [];
|
|
180
|
+
const add = (filePath) => {
|
|
181
|
+
if (!targets.includes(filePath)) targets.push(filePath);
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
if (shell.endsWith("/zsh") || process.env.ZSH_VERSION || existsSync(resolve(home, ".zshrc"))) {
|
|
185
|
+
add(resolve(home, ".zshrc"));
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (
|
|
189
|
+
shell.endsWith("/bash") ||
|
|
190
|
+
process.env.BASH_VERSION ||
|
|
191
|
+
existsSync(resolve(home, ".bashrc")) ||
|
|
192
|
+
existsSync(resolve(home, ".bash_profile")) ||
|
|
193
|
+
existsSync(resolve(home, ".profile"))
|
|
194
|
+
) {
|
|
195
|
+
add(resolve(home, ".bashrc"));
|
|
196
|
+
add(resolve(home, ".bash_profile"));
|
|
197
|
+
add(resolve(home, ".profile"));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (targets.length === 0) {
|
|
201
|
+
add(preferredShellRcFile());
|
|
202
|
+
}
|
|
203
|
+
return targets;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function ensureLineInFile(filePath, block) {
|
|
207
|
+
try {
|
|
208
|
+
const current = existsSync(filePath) ? readFileSync(filePath, "utf8") : "";
|
|
209
|
+
if (current.includes(block.trim())) return true;
|
|
210
|
+
const next = `${current.replace(/\s*$/, "")}\n\n${block}\n`;
|
|
211
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
212
|
+
writeFileSync(filePath, next, "utf8");
|
|
213
|
+
return true;
|
|
214
|
+
} catch {
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function shimScriptText(specifier = "latest") {
|
|
220
|
+
return [
|
|
221
|
+
"#!/usr/bin/env bash",
|
|
222
|
+
"set -euo pipefail",
|
|
223
|
+
'export npm_config_cache="${npm_config_cache:-$HOME/.silicaclaw/npm-cache}"',
|
|
224
|
+
`exec npx -y @silicaclaw/cli@${specifier} "$@"`,
|
|
225
|
+
"",
|
|
226
|
+
].join("\n");
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function ensureUserCommandInstalled() {
|
|
230
|
+
const version = readPackageVersionFrom(APP_DIR);
|
|
231
|
+
const envBlock = [
|
|
232
|
+
"#!/usr/bin/env bash",
|
|
233
|
+
'export PATH="$HOME/.silicaclaw/bin:$PATH"',
|
|
234
|
+
'export npm_config_cache="$HOME/.silicaclaw/npm-cache"',
|
|
235
|
+
"",
|
|
236
|
+
].join("\n");
|
|
237
|
+
const rcBlock = [
|
|
238
|
+
"# >>> silicaclaw >>>",
|
|
239
|
+
'[ -f "$HOME/.silicaclaw/env.sh" ] && . "$HOME/.silicaclaw/env.sh"',
|
|
240
|
+
"# <<< silicaclaw <<<",
|
|
241
|
+
].join("\n");
|
|
242
|
+
|
|
243
|
+
mkdirSync(userShimDir(), { recursive: true });
|
|
244
|
+
mkdirSync(userNpmCacheDir(), { recursive: true });
|
|
245
|
+
writeFileSync(userEnvFile(), envBlock, { encoding: "utf8", mode: 0o755 });
|
|
246
|
+
writeFileSync(userShimPath(), shimScriptText(version), { encoding: "utf8", mode: 0o755 });
|
|
247
|
+
|
|
248
|
+
for (const filePath of shellInitTargets()) {
|
|
249
|
+
ensureLineInFile(filePath, rcBlock);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
147
253
|
function ensureLaunchAgentsDir() {
|
|
148
254
|
mkdirSync(LAUNCH_AGENTS_DIR, { recursive: true });
|
|
149
255
|
}
|
|
@@ -797,6 +903,7 @@ async function stopAll() {
|
|
|
797
903
|
|
|
798
904
|
async function startAll() {
|
|
799
905
|
ensureStateDir();
|
|
906
|
+
ensureUserCommandInstalled();
|
|
800
907
|
|
|
801
908
|
const mode = parseMode(parseFlag("mode", process.env.NETWORK_MODE || DEFAULT_NETWORK_MODE));
|
|
802
909
|
const adapter = adapterForMode(mode);
|
|
@@ -923,6 +1030,7 @@ async function startAll() {
|
|
|
923
1030
|
}
|
|
924
1031
|
|
|
925
1032
|
async function restartAll() {
|
|
1033
|
+
ensureUserCommandInstalled();
|
|
926
1034
|
if (!isLaunchdPlatform()) {
|
|
927
1035
|
await stopAll();
|
|
928
1036
|
await startAll();
|
|
@@ -963,7 +1071,9 @@ async function restartAll() {
|
|
|
963
1071
|
environment: baseEnv,
|
|
964
1072
|
});
|
|
965
1073
|
if (!localConsoleService.changed) {
|
|
966
|
-
|
|
1074
|
+
stopLaunchAgent(LOCAL_CONSOLE_LABEL);
|
|
1075
|
+
await drainOwnedListener(LOCAL_CONSOLE_PORT, "local-console", 8000);
|
|
1076
|
+
startLaunchAgent(LOCAL_CONSOLE_LABEL, localConsoleService.plistPath);
|
|
967
1077
|
}
|
|
968
1078
|
|
|
969
1079
|
if (shouldAutoStartSignaling) {
|
|
@@ -979,7 +1089,9 @@ async function restartAll() {
|
|
|
979
1089
|
},
|
|
980
1090
|
});
|
|
981
1091
|
if (!signalingService.changed) {
|
|
982
|
-
|
|
1092
|
+
stopLaunchAgent(SIGNALING_LABEL);
|
|
1093
|
+
await drainOwnedListener(4510, "signaling", 5000);
|
|
1094
|
+
startLaunchAgent(SIGNALING_LABEL, signalingService.plistPath);
|
|
983
1095
|
}
|
|
984
1096
|
} else {
|
|
985
1097
|
uninstallLaunchAgent(SIGNALING_LABEL);
|
|
@@ -100,6 +100,25 @@ function main() {
|
|
|
100
100
|
assert(dialogueCheatsheetZh.includes("主人对话速查表"), "owner dialogue cheatsheet zh content mismatch");
|
|
101
101
|
},
|
|
102
102
|
},
|
|
103
|
+
"silicaclaw-network-config": {
|
|
104
|
+
requiredFiles: [
|
|
105
|
+
resolve(skillDir, "references", "network-modes.md"),
|
|
106
|
+
resolve(skillDir, "references", "public-discovery.md"),
|
|
107
|
+
resolve(skillDir, "references", "owner-dialogue-cheatsheet-zh.md"),
|
|
108
|
+
],
|
|
109
|
+
uiDisplayName: 'display_name: "SilicaClaw Network Config"',
|
|
110
|
+
checks(manifest, files) {
|
|
111
|
+
const networkModes = readFileSync(files[0], "utf8");
|
|
112
|
+
const publicDiscovery = readFileSync(files[1], "utf8");
|
|
113
|
+
const dialogueCheatsheetZh = readFileSync(files[2], "utf8");
|
|
114
|
+
assert(String(manifest.references?.network_modes || "") === "references/network-modes.md", "manifest network modes reference mismatch");
|
|
115
|
+
assert(String(manifest.references?.public_discovery || "") === "references/public-discovery.md", "manifest public discovery reference mismatch");
|
|
116
|
+
assert(String(manifest.references?.owner_dialogue_cheatsheet_zh || "") === "references/owner-dialogue-cheatsheet-zh.md", "manifest owner dialogue cheatsheet zh reference mismatch");
|
|
117
|
+
assert(networkModes.includes("## Modes"), "network modes content mismatch");
|
|
118
|
+
assert(publicDiscovery.includes("public_enabled"), "public discovery content mismatch");
|
|
119
|
+
assert(dialogueCheatsheetZh.includes("主人对话速查表"), "owner dialogue cheatsheet zh content mismatch");
|
|
120
|
+
},
|
|
121
|
+
},
|
|
103
122
|
}[skillName];
|
|
104
123
|
|
|
105
124
|
assert(profile, `Unsupported skill for validation: ${skillName}`);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./jsonRepo"), exports);
|
|
18
|
-
__exportStar(require("./repos"), exports);
|
|
19
|
-
__exportStar(require("./socialRuntimeRepo"), exports);
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JsonFileRepo = void 0;
|
|
4
|
-
const promises_1 = require("fs/promises");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
class JsonFileRepo {
|
|
7
|
-
filePath;
|
|
8
|
-
fallback;
|
|
9
|
-
constructor(filePath, fallback) {
|
|
10
|
-
this.filePath = filePath;
|
|
11
|
-
this.fallback = fallback;
|
|
12
|
-
}
|
|
13
|
-
async get() {
|
|
14
|
-
try {
|
|
15
|
-
const raw = await (0, promises_1.readFile)(this.filePath, "utf8");
|
|
16
|
-
return JSON.parse(raw);
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
const seed = this.fallback();
|
|
20
|
-
await this.set(seed);
|
|
21
|
-
return seed;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
async set(value) {
|
|
25
|
-
await (0, promises_1.mkdir)((0, path_1.dirname)(this.filePath), { recursive: true });
|
|
26
|
-
await (0, promises_1.writeFile)(this.filePath, JSON.stringify(value, null, 2), "utf8");
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.JsonFileRepo = JsonFileRepo;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { AgentIdentity, DirectoryState, PublicProfile } from "@silicaclaw/core";
|
|
2
|
-
import { JsonFileRepo } from "./jsonRepo";
|
|
3
|
-
export type LogEntry = {
|
|
4
|
-
id: string;
|
|
5
|
-
level: "info" | "warn" | "error";
|
|
6
|
-
message: string;
|
|
7
|
-
timestamp: number;
|
|
8
|
-
};
|
|
9
|
-
export type SocialMessageRecord = {
|
|
10
|
-
type: "social.message";
|
|
11
|
-
message_id: string;
|
|
12
|
-
agent_id: string;
|
|
13
|
-
public_key: string;
|
|
14
|
-
display_name: string;
|
|
15
|
-
topic: string;
|
|
16
|
-
body: string;
|
|
17
|
-
created_at: number;
|
|
18
|
-
signature: string;
|
|
19
|
-
};
|
|
20
|
-
export type SocialMessageObservationRecord = {
|
|
21
|
-
type: "social.message.observation";
|
|
22
|
-
observation_id: string;
|
|
23
|
-
message_id: string;
|
|
24
|
-
observed_agent_id: string;
|
|
25
|
-
observer_agent_id: string;
|
|
26
|
-
observer_public_key: string;
|
|
27
|
-
observer_display_name: string;
|
|
28
|
-
observed_at: number;
|
|
29
|
-
signature: string;
|
|
30
|
-
};
|
|
31
|
-
export type SocialMessageGovernanceConfig = {
|
|
32
|
-
send_limit_max: number;
|
|
33
|
-
send_window_ms: number;
|
|
34
|
-
receive_limit_max: number;
|
|
35
|
-
receive_window_ms: number;
|
|
36
|
-
duplicate_window_ms: number;
|
|
37
|
-
blocked_agent_ids: string[];
|
|
38
|
-
blocked_terms: string[];
|
|
39
|
-
};
|
|
40
|
-
export declare class IdentityRepo extends JsonFileRepo<AgentIdentity | null> {
|
|
41
|
-
constructor(rootDir?: string);
|
|
42
|
-
}
|
|
43
|
-
export declare class ProfileRepo extends JsonFileRepo<PublicProfile | null> {
|
|
44
|
-
constructor(rootDir?: string);
|
|
45
|
-
}
|
|
46
|
-
export declare class CacheRepo extends JsonFileRepo<DirectoryState> {
|
|
47
|
-
constructor(rootDir?: string);
|
|
48
|
-
}
|
|
49
|
-
export declare class LogRepo extends JsonFileRepo<LogEntry[]> {
|
|
50
|
-
constructor(rootDir?: string);
|
|
51
|
-
append(entry: Omit<LogEntry, "id">): Promise<void>;
|
|
52
|
-
}
|
|
53
|
-
export declare class SocialMessageRepo extends JsonFileRepo<SocialMessageRecord[]> {
|
|
54
|
-
constructor(rootDir?: string);
|
|
55
|
-
}
|
|
56
|
-
export declare class SocialMessageObservationRepo extends JsonFileRepo<SocialMessageObservationRecord[]> {
|
|
57
|
-
constructor(rootDir?: string);
|
|
58
|
-
}
|
|
59
|
-
export declare class SocialMessageGovernanceRepo extends JsonFileRepo<SocialMessageGovernanceConfig> {
|
|
60
|
-
constructor(rootDir?: string);
|
|
61
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SocialMessageGovernanceRepo = exports.SocialMessageObservationRepo = exports.SocialMessageRepo = exports.LogRepo = exports.CacheRepo = exports.ProfileRepo = exports.IdentityRepo = void 0;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const core_1 = require("@silicaclaw/core");
|
|
6
|
-
const jsonRepo_1 = require("./jsonRepo");
|
|
7
|
-
class IdentityRepo extends jsonRepo_1.JsonFileRepo {
|
|
8
|
-
constructor(rootDir = process.cwd()) {
|
|
9
|
-
super((0, path_1.resolve)(rootDir, "data", "identity.json"), () => null);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.IdentityRepo = IdentityRepo;
|
|
13
|
-
class ProfileRepo extends jsonRepo_1.JsonFileRepo {
|
|
14
|
-
constructor(rootDir = process.cwd()) {
|
|
15
|
-
super((0, path_1.resolve)(rootDir, "data", "profile.json"), () => null);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.ProfileRepo = ProfileRepo;
|
|
19
|
-
class CacheRepo extends jsonRepo_1.JsonFileRepo {
|
|
20
|
-
constructor(rootDir = process.cwd()) {
|
|
21
|
-
super((0, path_1.resolve)(rootDir, "data", "cache.json"), () => (0, core_1.createEmptyDirectoryState)());
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.CacheRepo = CacheRepo;
|
|
25
|
-
class LogRepo extends jsonRepo_1.JsonFileRepo {
|
|
26
|
-
constructor(rootDir = process.cwd()) {
|
|
27
|
-
super((0, path_1.resolve)(rootDir, "data", "logs.json"), () => []);
|
|
28
|
-
}
|
|
29
|
-
async append(entry) {
|
|
30
|
-
const current = await this.get();
|
|
31
|
-
const next = [
|
|
32
|
-
{
|
|
33
|
-
id: `${entry.timestamp}-${Math.random().toString(36).slice(2, 8)}`,
|
|
34
|
-
...entry,
|
|
35
|
-
},
|
|
36
|
-
...current,
|
|
37
|
-
].slice(0, 50);
|
|
38
|
-
await this.set(next);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.LogRepo = LogRepo;
|
|
42
|
-
class SocialMessageRepo extends jsonRepo_1.JsonFileRepo {
|
|
43
|
-
constructor(rootDir = process.cwd()) {
|
|
44
|
-
super((0, path_1.resolve)(rootDir, "data", "social-messages.json"), () => []);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.SocialMessageRepo = SocialMessageRepo;
|
|
48
|
-
class SocialMessageObservationRepo extends jsonRepo_1.JsonFileRepo {
|
|
49
|
-
constructor(rootDir = process.cwd()) {
|
|
50
|
-
super((0, path_1.resolve)(rootDir, "data", "social-message-observations.json"), () => []);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.SocialMessageObservationRepo = SocialMessageObservationRepo;
|
|
54
|
-
class SocialMessageGovernanceRepo extends jsonRepo_1.JsonFileRepo {
|
|
55
|
-
constructor(rootDir = process.cwd()) {
|
|
56
|
-
super((0, path_1.resolve)(rootDir, ".silicaclaw", "social.message-governance.json"), () => ({
|
|
57
|
-
send_limit_max: 5,
|
|
58
|
-
send_window_ms: 60_000,
|
|
59
|
-
receive_limit_max: 8,
|
|
60
|
-
receive_window_ms: 60_000,
|
|
61
|
-
duplicate_window_ms: 180_000,
|
|
62
|
-
blocked_agent_ids: [],
|
|
63
|
-
blocked_terms: [],
|
|
64
|
-
}));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
exports.SocialMessageGovernanceRepo = SocialMessageGovernanceRepo;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SocialRuntimeRepo = void 0;
|
|
7
|
-
const path_1 = require("path");
|
|
8
|
-
const jsonRepo_1 = require("./jsonRepo");
|
|
9
|
-
const silicaclaw_defaults_json_1 = __importDefault(require("../config/silicaclaw-defaults.json"));
|
|
10
|
-
function emptyRuntime() {
|
|
11
|
-
return {
|
|
12
|
-
enabled: true,
|
|
13
|
-
public_enabled: false,
|
|
14
|
-
source_path: null,
|
|
15
|
-
last_loaded_at: 0,
|
|
16
|
-
social_found: false,
|
|
17
|
-
parse_error: null,
|
|
18
|
-
resolved_identity: null,
|
|
19
|
-
resolved_profile: null,
|
|
20
|
-
resolved_network: {
|
|
21
|
-
mode: silicaclaw_defaults_json_1.default.network.default_mode,
|
|
22
|
-
adapter: "relay-preview",
|
|
23
|
-
namespace: silicaclaw_defaults_json_1.default.network.default_namespace,
|
|
24
|
-
port: null,
|
|
25
|
-
signaling_url: silicaclaw_defaults_json_1.default.network.global_preview.relay_url,
|
|
26
|
-
signaling_urls: [],
|
|
27
|
-
room: silicaclaw_defaults_json_1.default.network.global_preview.room,
|
|
28
|
-
seed_peers: [],
|
|
29
|
-
bootstrap_hints: [],
|
|
30
|
-
bootstrap_sources: [],
|
|
31
|
-
},
|
|
32
|
-
resolved_discovery: {
|
|
33
|
-
discoverable: true,
|
|
34
|
-
allow_profile_broadcast: true,
|
|
35
|
-
allow_presence_broadcast: true,
|
|
36
|
-
allow_message_broadcast: true,
|
|
37
|
-
},
|
|
38
|
-
visibility: {
|
|
39
|
-
show_display_name: true,
|
|
40
|
-
show_bio: true,
|
|
41
|
-
show_tags: true,
|
|
42
|
-
show_agent_id: true,
|
|
43
|
-
show_last_seen: true,
|
|
44
|
-
show_capabilities_summary: true,
|
|
45
|
-
},
|
|
46
|
-
openclaw: {
|
|
47
|
-
bind_existing_identity: true,
|
|
48
|
-
use_openclaw_profile_if_available: true,
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
class SocialRuntimeRepo extends jsonRepo_1.JsonFileRepo {
|
|
53
|
-
constructor(rootDir = process.cwd()) {
|
|
54
|
-
super((0, path_1.resolve)(rootDir, ".silicaclaw", "social.runtime.json"), emptyRuntime);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.SocialRuntimeRepo = SocialRuntimeRepo;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./jsonRepo"), exports);
|
|
18
|
-
__exportStar(require("./repos"), exports);
|
|
19
|
-
__exportStar(require("./socialRuntimeRepo"), exports);
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.JsonFileRepo = void 0;
|
|
4
|
-
const promises_1 = require("fs/promises");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
class JsonFileRepo {
|
|
7
|
-
filePath;
|
|
8
|
-
fallback;
|
|
9
|
-
constructor(filePath, fallback) {
|
|
10
|
-
this.filePath = filePath;
|
|
11
|
-
this.fallback = fallback;
|
|
12
|
-
}
|
|
13
|
-
async get() {
|
|
14
|
-
try {
|
|
15
|
-
const raw = await (0, promises_1.readFile)(this.filePath, "utf8");
|
|
16
|
-
return JSON.parse(raw);
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
const seed = this.fallback();
|
|
20
|
-
await this.set(seed);
|
|
21
|
-
return seed;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
async set(value) {
|
|
25
|
-
await (0, promises_1.mkdir)((0, path_1.dirname)(this.filePath), { recursive: true });
|
|
26
|
-
await (0, promises_1.writeFile)(this.filePath, JSON.stringify(value, null, 2), "utf8");
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.JsonFileRepo = JsonFileRepo;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { AgentIdentity, DirectoryState, PublicProfile } from "@silicaclaw/core";
|
|
2
|
-
import { JsonFileRepo } from "./jsonRepo";
|
|
3
|
-
export type LogEntry = {
|
|
4
|
-
id: string;
|
|
5
|
-
level: "info" | "warn" | "error";
|
|
6
|
-
message: string;
|
|
7
|
-
timestamp: number;
|
|
8
|
-
};
|
|
9
|
-
export type SocialMessageRecord = {
|
|
10
|
-
type: "social.message";
|
|
11
|
-
message_id: string;
|
|
12
|
-
agent_id: string;
|
|
13
|
-
public_key: string;
|
|
14
|
-
display_name: string;
|
|
15
|
-
topic: string;
|
|
16
|
-
body: string;
|
|
17
|
-
created_at: number;
|
|
18
|
-
signature: string;
|
|
19
|
-
};
|
|
20
|
-
export type SocialMessageObservationRecord = {
|
|
21
|
-
type: "social.message.observation";
|
|
22
|
-
observation_id: string;
|
|
23
|
-
message_id: string;
|
|
24
|
-
observed_agent_id: string;
|
|
25
|
-
observer_agent_id: string;
|
|
26
|
-
observer_public_key: string;
|
|
27
|
-
observer_display_name: string;
|
|
28
|
-
observed_at: number;
|
|
29
|
-
signature: string;
|
|
30
|
-
};
|
|
31
|
-
export type SocialMessageGovernanceConfig = {
|
|
32
|
-
send_limit_max: number;
|
|
33
|
-
send_window_ms: number;
|
|
34
|
-
receive_limit_max: number;
|
|
35
|
-
receive_window_ms: number;
|
|
36
|
-
duplicate_window_ms: number;
|
|
37
|
-
blocked_agent_ids: string[];
|
|
38
|
-
blocked_terms: string[];
|
|
39
|
-
};
|
|
40
|
-
export declare class IdentityRepo extends JsonFileRepo<AgentIdentity | null> {
|
|
41
|
-
constructor(rootDir?: string);
|
|
42
|
-
}
|
|
43
|
-
export declare class ProfileRepo extends JsonFileRepo<PublicProfile | null> {
|
|
44
|
-
constructor(rootDir?: string);
|
|
45
|
-
}
|
|
46
|
-
export declare class CacheRepo extends JsonFileRepo<DirectoryState> {
|
|
47
|
-
constructor(rootDir?: string);
|
|
48
|
-
}
|
|
49
|
-
export declare class LogRepo extends JsonFileRepo<LogEntry[]> {
|
|
50
|
-
constructor(rootDir?: string);
|
|
51
|
-
append(entry: Omit<LogEntry, "id">): Promise<void>;
|
|
52
|
-
}
|
|
53
|
-
export declare class SocialMessageRepo extends JsonFileRepo<SocialMessageRecord[]> {
|
|
54
|
-
constructor(rootDir?: string);
|
|
55
|
-
}
|
|
56
|
-
export declare class SocialMessageObservationRepo extends JsonFileRepo<SocialMessageObservationRecord[]> {
|
|
57
|
-
constructor(rootDir?: string);
|
|
58
|
-
}
|
|
59
|
-
export declare class SocialMessageGovernanceRepo extends JsonFileRepo<SocialMessageGovernanceConfig> {
|
|
60
|
-
constructor(rootDir?: string);
|
|
61
|
-
}
|