@silicaclaw/cli 2026.3.19-19 → 2026.3.19-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 +12 -0
- package/INSTALL.md +12 -8
- package/README.md +16 -12
- package/VERSION +1 -1
- package/apps/local-console/dist/apps/local-console/src/server.d.ts +2 -0
- package/apps/local-console/dist/apps/local-console/src/server.js +25 -1
- package/apps/local-console/public/app/social.js +17 -1
- package/apps/local-console/public/app/translations.js +8 -4
- package/apps/local-console/src/server.ts +32 -1
- package/dist/apps/local-console/src/server.d.ts +1 -0
- package/dist/apps/local-console/src/server.js +555 -0
- package/docs/NEW_USER_INSTALL.md +13 -10
- package/docs/NEW_USER_OPERATIONS.md +3 -3
- package/node_modules/@silicaclaw/storage/dist/config/silicaclaw-defaults.json +19 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/crypto.d.ts +6 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/crypto.js +50 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/directory.d.ts +17 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/directory.js +145 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/identity.d.ts +2 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/identity.js +18 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/index.d.ts +12 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/index.js +28 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/indexing.d.ts +6 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/indexing.js +43 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/presence.d.ts +4 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/presence.js +23 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/profile.d.ts +4 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/profile.js +39 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/publicProfileSummary.d.ts +70 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/publicProfileSummary.js +103 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialConfig.d.ts +100 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialConfig.js +300 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialMessage.d.ts +19 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialMessage.js +69 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialResolver.d.ts +46 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialResolver.js +237 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialTemplate.d.ts +2 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/socialTemplate.js +90 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/types.d.ts +59 -0
- package/node_modules/@silicaclaw/storage/dist/packages/core/src/types.js +2 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/config/silicaclaw-defaults.json +19 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/index.d.ts +3 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/index.js +19 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/jsonRepo.d.ts +7 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/jsonRepo.js +29 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/repos.d.ts +61 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/repos.js +67 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/socialRuntimeRepo.d.ts +5 -0
- package/node_modules/@silicaclaw/storage/dist/packages/storage/src/socialRuntimeRepo.js +57 -0
- package/node_modules/@silicaclaw/storage/tsconfig.json +1 -6
- package/openclaw-skills/silicaclaw-broadcast/VERSION +1 -1
- package/openclaw-skills/silicaclaw-broadcast/manifest.json +1 -1
- package/package.json +3 -1
- package/packages/storage/dist/config/silicaclaw-defaults.json +19 -0
- package/packages/storage/dist/packages/core/src/crypto.d.ts +6 -0
- package/packages/storage/dist/packages/core/src/crypto.js +50 -0
- package/packages/storage/dist/packages/core/src/directory.d.ts +17 -0
- package/packages/storage/dist/packages/core/src/directory.js +145 -0
- package/packages/storage/dist/packages/core/src/identity.d.ts +2 -0
- package/packages/storage/dist/packages/core/src/identity.js +18 -0
- package/packages/storage/dist/packages/core/src/index.d.ts +12 -0
- package/packages/storage/dist/packages/core/src/index.js +28 -0
- package/packages/storage/dist/packages/core/src/indexing.d.ts +6 -0
- package/packages/storage/dist/packages/core/src/indexing.js +43 -0
- package/packages/storage/dist/packages/core/src/presence.d.ts +4 -0
- package/packages/storage/dist/packages/core/src/presence.js +23 -0
- package/packages/storage/dist/packages/core/src/profile.d.ts +4 -0
- package/packages/storage/dist/packages/core/src/profile.js +39 -0
- package/packages/storage/dist/packages/core/src/publicProfileSummary.d.ts +70 -0
- package/packages/storage/dist/packages/core/src/publicProfileSummary.js +103 -0
- package/packages/storage/dist/packages/core/src/socialConfig.d.ts +100 -0
- package/packages/storage/dist/packages/core/src/socialConfig.js +300 -0
- package/packages/storage/dist/packages/core/src/socialMessage.d.ts +19 -0
- package/packages/storage/dist/packages/core/src/socialMessage.js +69 -0
- package/packages/storage/dist/packages/core/src/socialResolver.d.ts +46 -0
- package/packages/storage/dist/packages/core/src/socialResolver.js +237 -0
- package/packages/storage/dist/packages/core/src/socialTemplate.d.ts +2 -0
- package/packages/storage/dist/packages/core/src/socialTemplate.js +90 -0
- package/packages/storage/dist/packages/core/src/types.d.ts +59 -0
- package/packages/storage/dist/packages/core/src/types.js +2 -0
- package/packages/storage/dist/packages/storage/config/silicaclaw-defaults.json +19 -0
- package/packages/storage/dist/packages/storage/src/index.d.ts +3 -0
- package/packages/storage/dist/packages/storage/src/index.js +19 -0
- package/packages/storage/dist/packages/storage/src/jsonRepo.d.ts +7 -0
- package/packages/storage/dist/packages/storage/src/jsonRepo.js +29 -0
- package/packages/storage/dist/packages/storage/src/repos.d.ts +61 -0
- package/packages/storage/dist/packages/storage/src/repos.js +67 -0
- package/packages/storage/dist/packages/storage/src/socialRuntimeRepo.d.ts +5 -0
- package/packages/storage/dist/packages/storage/src/socialRuntimeRepo.js +57 -0
- package/packages/storage/tsconfig.json +1 -6
- package/scripts/quickstart.sh +1 -1
- package/scripts/silicaclaw-cli.mjs +2 -1
- package/scripts/silicaclaw-gateway.mjs +209 -32
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateSocialMdTemplate = generateSocialMdTemplate;
|
|
4
|
+
function asBool(value, fallback) {
|
|
5
|
+
return typeof value === "boolean" ? value : fallback;
|
|
6
|
+
}
|
|
7
|
+
function asString(value, fallback) {
|
|
8
|
+
return typeof value === "string" ? value : fallback;
|
|
9
|
+
}
|
|
10
|
+
function asStringArray(value, fallback) {
|
|
11
|
+
if (!Array.isArray(value))
|
|
12
|
+
return fallback;
|
|
13
|
+
return value.map((item) => String(item).trim()).filter(Boolean);
|
|
14
|
+
}
|
|
15
|
+
function yamlString(input) {
|
|
16
|
+
return JSON.stringify(input ?? "");
|
|
17
|
+
}
|
|
18
|
+
function yamlStringList(values, indent = " ") {
|
|
19
|
+
if (!values.length) {
|
|
20
|
+
return `${indent}[]`;
|
|
21
|
+
}
|
|
22
|
+
return values.map((value) => `${indent}- ${yamlString(value)}`).join("\n");
|
|
23
|
+
}
|
|
24
|
+
function generateSocialMdTemplate(runtimeConfig) {
|
|
25
|
+
const enabled = asBool(runtimeConfig?.enabled, true);
|
|
26
|
+
const publicEnabled = asBool(runtimeConfig?.public_enabled, false);
|
|
27
|
+
const profile = runtimeConfig?.resolved_profile ?? null;
|
|
28
|
+
const network = runtimeConfig?.resolved_network ?? null;
|
|
29
|
+
const discovery = runtimeConfig?.resolved_discovery ?? null;
|
|
30
|
+
const visibility = runtimeConfig?.visibility ?? null;
|
|
31
|
+
const openclaw = runtimeConfig?.openclaw ?? null;
|
|
32
|
+
const displayName = asString(profile?.display_name, "");
|
|
33
|
+
const bio = asString(profile?.bio, "");
|
|
34
|
+
const tags = asStringArray(profile?.tags, ["openclaw", "local-first"]);
|
|
35
|
+
const mode = network?.mode === "local" || network?.mode === "lan" || network?.mode === "global-preview"
|
|
36
|
+
? network.mode
|
|
37
|
+
: "global-preview";
|
|
38
|
+
const discoverable = asBool(discovery?.discoverable, true);
|
|
39
|
+
const allowProfileBroadcast = asBool(discovery?.allow_profile_broadcast, true);
|
|
40
|
+
const allowPresenceBroadcast = asBool(discovery?.allow_presence_broadcast, true);
|
|
41
|
+
const allowMessageBroadcast = asBool(discovery?.allow_message_broadcast, true);
|
|
42
|
+
const showDisplayName = asBool(visibility?.show_display_name, true);
|
|
43
|
+
const showBio = asBool(visibility?.show_bio, true);
|
|
44
|
+
const showTags = asBool(visibility?.show_tags, true);
|
|
45
|
+
const showAgentId = asBool(visibility?.show_agent_id, true);
|
|
46
|
+
const showLastSeen = asBool(visibility?.show_last_seen, true);
|
|
47
|
+
const showCapabilitiesSummary = asBool(visibility?.show_capabilities_summary, true);
|
|
48
|
+
const bindExistingIdentity = asBool(openclaw?.bind_existing_identity, true);
|
|
49
|
+
const useOpenClawProfile = asBool(openclaw?.use_openclaw_profile_if_available, true);
|
|
50
|
+
return `---
|
|
51
|
+
enabled: ${enabled}
|
|
52
|
+
public_enabled: ${publicEnabled}
|
|
53
|
+
|
|
54
|
+
identity:
|
|
55
|
+
display_name: ${yamlString(displayName)}
|
|
56
|
+
bio: ${yamlString(bio)}
|
|
57
|
+
tags:
|
|
58
|
+
${yamlStringList(tags.map((tag) => asString(tag, "")), " ")}
|
|
59
|
+
|
|
60
|
+
network:
|
|
61
|
+
mode: ${yamlString(mode)}
|
|
62
|
+
|
|
63
|
+
discovery:
|
|
64
|
+
discoverable: ${discoverable}
|
|
65
|
+
allow_profile_broadcast: ${allowProfileBroadcast}
|
|
66
|
+
allow_presence_broadcast: ${allowPresenceBroadcast}
|
|
67
|
+
allow_message_broadcast: ${allowMessageBroadcast}
|
|
68
|
+
|
|
69
|
+
visibility:
|
|
70
|
+
show_display_name: ${showDisplayName}
|
|
71
|
+
show_bio: ${showBio}
|
|
72
|
+
show_tags: ${showTags}
|
|
73
|
+
show_agent_id: ${showAgentId}
|
|
74
|
+
show_last_seen: ${showLastSeen}
|
|
75
|
+
show_capabilities_summary: ${showCapabilitiesSummary}
|
|
76
|
+
|
|
77
|
+
openclaw:
|
|
78
|
+
bind_existing_identity: ${bindExistingIdentity}
|
|
79
|
+
use_openclaw_profile_if_available: ${useOpenClawProfile}
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
# Social
|
|
83
|
+
|
|
84
|
+
Generated from current SilicaClaw runtime state.
|
|
85
|
+
|
|
86
|
+
- Save as \`social.md\` in your OpenClaw workspace.
|
|
87
|
+
- This export does not auto-overwrite any existing file.
|
|
88
|
+
- Advanced network fields are intentionally hidden in template and resolved in runtime.
|
|
89
|
+
`;
|
|
90
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export type AgentIdentity = {
|
|
2
|
+
agent_id: string;
|
|
3
|
+
public_key: string;
|
|
4
|
+
private_key: string;
|
|
5
|
+
created_at: number;
|
|
6
|
+
};
|
|
7
|
+
export type PublicProfile = {
|
|
8
|
+
agent_id: string;
|
|
9
|
+
display_name: string;
|
|
10
|
+
bio: string;
|
|
11
|
+
tags: string[];
|
|
12
|
+
avatar_url?: string;
|
|
13
|
+
public_enabled: boolean;
|
|
14
|
+
updated_at: number;
|
|
15
|
+
signature: string;
|
|
16
|
+
};
|
|
17
|
+
export type SignedProfileRecord = {
|
|
18
|
+
type: "profile";
|
|
19
|
+
profile: PublicProfile;
|
|
20
|
+
};
|
|
21
|
+
export type PresenceRecord = {
|
|
22
|
+
type: "presence";
|
|
23
|
+
agent_id: string;
|
|
24
|
+
timestamp: number;
|
|
25
|
+
signature: string;
|
|
26
|
+
};
|
|
27
|
+
export type IndexRefRecord = {
|
|
28
|
+
type: "index";
|
|
29
|
+
key: string;
|
|
30
|
+
agent_id: string;
|
|
31
|
+
};
|
|
32
|
+
export type SocialMessageRecord = {
|
|
33
|
+
type: "social.message";
|
|
34
|
+
message_id: string;
|
|
35
|
+
agent_id: string;
|
|
36
|
+
public_key: string;
|
|
37
|
+
display_name: string;
|
|
38
|
+
topic: string;
|
|
39
|
+
body: string;
|
|
40
|
+
created_at: number;
|
|
41
|
+
signature: string;
|
|
42
|
+
};
|
|
43
|
+
export type SocialMessageObservationRecord = {
|
|
44
|
+
type: "social.message.observation";
|
|
45
|
+
observation_id: string;
|
|
46
|
+
message_id: string;
|
|
47
|
+
observed_agent_id: string;
|
|
48
|
+
observer_agent_id: string;
|
|
49
|
+
observer_public_key: string;
|
|
50
|
+
observer_display_name: string;
|
|
51
|
+
observed_at: number;
|
|
52
|
+
signature: string;
|
|
53
|
+
};
|
|
54
|
+
export type DirectoryState = {
|
|
55
|
+
profiles: Record<string, PublicProfile>;
|
|
56
|
+
presence: Record<string, number>;
|
|
57
|
+
index: Record<string, string[]>;
|
|
58
|
+
};
|
|
59
|
+
export type ProfileInput = Omit<PublicProfile, "signature" | "updated_at">;
|
package/node_modules/@silicaclaw/storage/dist/packages/storage/config/silicaclaw-defaults.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ports": {
|
|
3
|
+
"local_console": 4310,
|
|
4
|
+
"public_explorer": 4311,
|
|
5
|
+
"openclaw_gateway": 18789,
|
|
6
|
+
"network_default": 44123
|
|
7
|
+
},
|
|
8
|
+
"network": {
|
|
9
|
+
"default_mode": "global-preview",
|
|
10
|
+
"default_namespace": "silicaclaw.preview",
|
|
11
|
+
"global_preview": {
|
|
12
|
+
"relay_url": "https://relay.silicaclaw.com",
|
|
13
|
+
"room": "silicaclaw-global-preview"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"bridge": {
|
|
17
|
+
"api_base": "http://localhost:4310"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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);
|
|
@@ -0,0 +1,29 @@
|
|
|
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;
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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;
|
|
@@ -0,0 +1,57 @@
|
|
|
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,12 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": "../../tsconfig.base.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"outDir": "./dist"
|
|
5
|
-
"rootDir": "./src",
|
|
6
|
-
"baseUrl": ".",
|
|
7
|
-
"paths": {
|
|
8
|
-
"@silicaclaw/core": ["../../packages/core/dist/index.d.ts"]
|
|
9
|
-
}
|
|
4
|
+
"outDir": "./dist"
|
|
10
5
|
},
|
|
11
6
|
"include": ["src"]
|
|
12
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
2026.3.19-beta.
|
|
1
|
+
2026.3.19-beta.21
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "silicaclaw-broadcast",
|
|
3
|
-
"version": "2026.3.19-beta.
|
|
3
|
+
"version": "2026.3.19-beta.21",
|
|
4
4
|
"display_name": "SilicaClaw Broadcast",
|
|
5
5
|
"description": "OpenClaw skill for reading SilicaClaw public broadcasts, publishing public broadcasts, and forwarding relevant updates to the owner through OpenClaw's native social channel.",
|
|
6
6
|
"entrypoints": {
|
package/package.json
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silicaclaw/cli",
|
|
3
|
-
"version": "2026.3.19-
|
|
3
|
+
"version": "2026.3.19-21",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"config/**",
|
|
10
|
+
"dist/apps/local-console/**",
|
|
11
|
+
"dist/apps/public-explorer/**",
|
|
10
12
|
"apps/local-console/package.json",
|
|
11
13
|
"apps/local-console/dist/**",
|
|
12
14
|
"apps/local-console/public/**",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"ports": {
|
|
3
|
+
"local_console": 4310,
|
|
4
|
+
"public_explorer": 4311,
|
|
5
|
+
"openclaw_gateway": 18789,
|
|
6
|
+
"network_default": 44123
|
|
7
|
+
},
|
|
8
|
+
"network": {
|
|
9
|
+
"default_mode": "global-preview",
|
|
10
|
+
"default_namespace": "silicaclaw.preview",
|
|
11
|
+
"global_preview": {
|
|
12
|
+
"relay_url": "https://relay.silicaclaw.com",
|
|
13
|
+
"room": "silicaclaw-global-preview"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"bridge": {
|
|
17
|
+
"api_base": "http://localhost:4310"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function toBase64(input: Uint8Array): string;
|
|
2
|
+
export declare function fromBase64(input: string): Uint8Array;
|
|
3
|
+
export declare function hashPublicKey(publicKey: Uint8Array): string;
|
|
4
|
+
export declare function stableStringify(input: unknown): string;
|
|
5
|
+
export declare function signPayload(payload: unknown, privateKeyBase64: string): string;
|
|
6
|
+
export declare function verifyPayload(payload: unknown, signatureBase64: string, publicKeyBase64: string): boolean;
|
|
@@ -0,0 +1,50 @@
|
|
|
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.toBase64 = toBase64;
|
|
7
|
+
exports.fromBase64 = fromBase64;
|
|
8
|
+
exports.hashPublicKey = hashPublicKey;
|
|
9
|
+
exports.stableStringify = stableStringify;
|
|
10
|
+
exports.signPayload = signPayload;
|
|
11
|
+
exports.verifyPayload = verifyPayload;
|
|
12
|
+
const crypto_1 = require("crypto");
|
|
13
|
+
const tweetnacl_1 = __importDefault(require("tweetnacl"));
|
|
14
|
+
function toBase64(input) {
|
|
15
|
+
return Buffer.from(input).toString("base64");
|
|
16
|
+
}
|
|
17
|
+
function fromBase64(input) {
|
|
18
|
+
return new Uint8Array(Buffer.from(input, "base64"));
|
|
19
|
+
}
|
|
20
|
+
function hashPublicKey(publicKey) {
|
|
21
|
+
return (0, crypto_1.createHash)("sha256").update(publicKey).digest("hex");
|
|
22
|
+
}
|
|
23
|
+
function stableStringify(input) {
|
|
24
|
+
if (input === null || typeof input !== "object") {
|
|
25
|
+
return JSON.stringify(input);
|
|
26
|
+
}
|
|
27
|
+
if (Array.isArray(input)) {
|
|
28
|
+
return `[${input.map((item) => stableStringify(item)).join(",")}]`;
|
|
29
|
+
}
|
|
30
|
+
const entries = Object.entries(input)
|
|
31
|
+
.filter(([, value]) => value !== undefined)
|
|
32
|
+
.sort(([a], [b]) => a.localeCompare(b));
|
|
33
|
+
return `{${entries
|
|
34
|
+
.map(([key, value]) => `${JSON.stringify(key)}:${stableStringify(value)}`)
|
|
35
|
+
.join(",")}}`;
|
|
36
|
+
}
|
|
37
|
+
function signPayload(payload, privateKeyBase64) {
|
|
38
|
+
const payloadString = stableStringify(payload);
|
|
39
|
+
const signature = tweetnacl_1.default.sign.detached(Buffer.from(payloadString), fromBase64(privateKeyBase64));
|
|
40
|
+
return toBase64(signature);
|
|
41
|
+
}
|
|
42
|
+
function verifyPayload(payload, signatureBase64, publicKeyBase64) {
|
|
43
|
+
try {
|
|
44
|
+
const payloadString = stableStringify(payload);
|
|
45
|
+
return tweetnacl_1.default.sign.detached.verify(Buffer.from(payloadString), fromBase64(signatureBase64), fromBase64(publicKeyBase64));
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DirectoryState, IndexRefRecord, PresenceRecord, PublicProfile, SignedProfileRecord } from "./types";
|
|
2
|
+
export declare const DEFAULT_PRESENCE_TTL_MS = 30000;
|
|
3
|
+
export declare function createEmptyDirectoryState(): DirectoryState;
|
|
4
|
+
export declare function ingestProfileRecord(state: DirectoryState, record: SignedProfileRecord): DirectoryState;
|
|
5
|
+
export declare function ingestPresenceRecord(state: DirectoryState, record: PresenceRecord): DirectoryState;
|
|
6
|
+
export declare function ingestIndexRecord(state: DirectoryState, record: IndexRefRecord): DirectoryState;
|
|
7
|
+
export declare function isAgentOnline(lastSeenAt: number | undefined, now?: number, ttlMs?: number): boolean;
|
|
8
|
+
export declare function cleanupExpiredPresence(state: DirectoryState, now?: number, ttlMs?: number): {
|
|
9
|
+
state: DirectoryState;
|
|
10
|
+
removed: number;
|
|
11
|
+
};
|
|
12
|
+
export declare function rebuildIndexForProfile(state: DirectoryState, profile: PublicProfile): DirectoryState;
|
|
13
|
+
export declare function dedupeIndex(state: DirectoryState): DirectoryState;
|
|
14
|
+
export declare function searchDirectory(state: DirectoryState, keyword: string, options?: {
|
|
15
|
+
now?: number;
|
|
16
|
+
presenceTTLms?: number;
|
|
17
|
+
}): PublicProfile[];
|