@silicaclaw/cli 2026.3.19-9 → 2026.3.20-2
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 +134 -0
- package/DEMO_GUIDE.md +1 -1
- package/INSTALL.md +47 -13
- package/README.md +54 -19
- package/VERSION +1 -1
- package/apps/local-console/dist/apps/local-console/src/server.d.ts +51 -12
- package/apps/local-console/dist/apps/local-console/src/server.js +619 -183
- package/apps/local-console/dist/config/silicaclaw-defaults.json +19 -0
- package/apps/local-console/dist/packages/core/src/socialConfig.js +9 -5
- package/apps/local-console/dist/packages/network/src/realPreview.js +6 -2
- package/apps/local-console/dist/packages/network/src/relayPreview.js +8 -2
- package/apps/local-console/dist/packages/network/src/transport/udpLanBroadcastTransport.js +2 -1
- package/apps/local-console/dist/packages/network/src/webrtcPreview.js +5 -1
- package/apps/local-console/dist/packages/storage/config/silicaclaw-defaults.json +19 -0
- package/apps/local-console/dist/packages/storage/src/socialRuntimeRepo.js +8 -4
- package/apps/local-console/public/app/app.js +21 -1
- package/apps/local-console/public/app/events.js +40 -2
- package/apps/local-console/public/app/network.js +32 -3
- package/apps/local-console/public/app/overview.js +18 -26
- package/apps/local-console/public/app/shell.js +18 -34
- package/apps/local-console/public/app/social.js +207 -28
- package/apps/local-console/public/app/styles.css +182 -14
- package/apps/local-console/public/app/template.js +76 -31
- package/apps/local-console/public/app/translations.js +147 -51
- package/apps/local-console/src/server.ts +652 -189
- package/apps/public-explorer/dist/apps/public-explorer/src/server.d.ts +1 -0
- package/apps/public-explorer/dist/apps/public-explorer/src/server.js +41 -0
- package/apps/public-explorer/dist/config/silicaclaw-defaults.json +19 -0
- package/apps/public-explorer/public/app/app.js +22 -2
- package/apps/public-explorer/public/app/template.js +4 -4
- package/apps/public-explorer/public/app/translations.js +15 -15
- package/apps/public-explorer/src/server.ts +11 -1
- package/config/silicaclaw-defaults.json +19 -0
- 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 +14 -10
- package/docs/NEW_USER_OPERATIONS.md +4 -4
- package/docs/OPENCLAW_BRIDGE.md +15 -0
- package/docs/OPENCLAW_BRIDGE_ZH.md +15 -0
- package/docs/RELEASE_CHECKLIST.md +95 -0
- package/node_modules/@silicaclaw/core/dist/config/silicaclaw-defaults.json +19 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/crypto.d.ts +6 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/crypto.js +50 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/directory.d.ts +17 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/directory.js +145 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/identity.d.ts +2 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/identity.js +18 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/index.d.ts +12 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/index.js +28 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/indexing.d.ts +6 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/indexing.js +43 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/presence.d.ts +4 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/presence.js +23 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/profile.d.ts +4 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/profile.js +39 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/publicProfileSummary.d.ts +70 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/publicProfileSummary.js +103 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialConfig.d.ts +100 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialConfig.js +300 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialMessage.d.ts +19 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialMessage.js +69 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialResolver.d.ts +46 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialResolver.js +237 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialTemplate.d.ts +2 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/socialTemplate.js +90 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/types.d.ts +59 -0
- package/node_modules/@silicaclaw/core/dist/packages/core/src/types.js +2 -0
- package/node_modules/@silicaclaw/core/src/socialConfig.ts +7 -5
- package/node_modules/@silicaclaw/network/dist/config/silicaclaw-defaults.json +19 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/messageEnvelope.d.ts +28 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/messageEnvelope.js +36 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/peerDiscovery.d.ts +43 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/peerDiscovery.js +2 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/topicCodec.d.ts +4 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/topicCodec.js +2 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/transport.d.ts +36 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/abstractions/transport.js +2 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.d.ts +5 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.js +24 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonTopicCodec.d.ts +5 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/codec/jsonTopicCodec.js +12 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.d.ts +28 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.js +144 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/index.d.ts +14 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/index.js +30 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/localEventBus.d.ts +9 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/localEventBus.js +47 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/mock.d.ts +8 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/mock.js +24 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/realPreview.d.ts +105 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/realPreview.js +331 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/relayPreview.d.ts +166 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/relayPreview.js +448 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/transport/udpLanBroadcastTransport.d.ts +23 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/transport/udpLanBroadcastTransport.js +154 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/types.d.ts +6 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/types.js +2 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/webrtcPreview.d.ts +163 -0
- package/node_modules/@silicaclaw/network/dist/packages/network/src/webrtcPreview.js +848 -0
- package/node_modules/@silicaclaw/network/src/realPreview.ts +3 -2
- package/node_modules/@silicaclaw/network/src/relayPreview.ts +5 -2
- package/node_modules/@silicaclaw/network/src/transport/udpLanBroadcastTransport.ts +2 -1
- package/node_modules/@silicaclaw/network/src/webrtcPreview.ts +2 -1
- package/node_modules/@silicaclaw/storage/config/silicaclaw-defaults.json +19 -0
- 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/dist/socialRuntimeRepo.js +8 -4
- package/node_modules/@silicaclaw/storage/src/socialRuntimeRepo.ts +5 -4
- package/node_modules/@silicaclaw/storage/tsconfig.json +1 -6
- package/openclaw-skills/silicaclaw-bridge-setup/SKILL.md +147 -0
- package/openclaw-skills/silicaclaw-bridge-setup/VERSION +1 -0
- package/openclaw-skills/silicaclaw-bridge-setup/agents/openai.yaml +6 -0
- package/openclaw-skills/silicaclaw-bridge-setup/manifest.json +27 -0
- package/openclaw-skills/silicaclaw-bridge-setup/references/owner-dialogue-cheatsheet-zh.md +58 -0
- package/openclaw-skills/silicaclaw-bridge-setup/references/runtime-setup.md +43 -0
- package/openclaw-skills/silicaclaw-bridge-setup/references/troubleshooting.md +24 -0
- package/openclaw-skills/silicaclaw-broadcast/SKILL.md +132 -0
- package/openclaw-skills/silicaclaw-broadcast/VERSION +1 -1
- package/openclaw-skills/silicaclaw-broadcast/agents/openai.yaml +2 -2
- package/openclaw-skills/silicaclaw-broadcast/manifest.json +3 -2
- package/openclaw-skills/silicaclaw-broadcast/references/owner-dialogue-cheatsheet-zh.md +81 -0
- package/openclaw-skills/silicaclaw-owner-push/SKILL.md +217 -0
- package/openclaw-skills/silicaclaw-owner-push/VERSION +1 -0
- package/openclaw-skills/silicaclaw-owner-push/agents/openai.yaml +6 -0
- package/openclaw-skills/silicaclaw-owner-push/manifest.json +30 -0
- package/openclaw-skills/silicaclaw-owner-push/references/owner-dialogue-cheatsheet-zh.md +87 -0
- package/openclaw-skills/silicaclaw-owner-push/references/push-routing-policy.md +43 -0
- package/openclaw-skills/silicaclaw-owner-push/references/runtime-setup.md +41 -0
- package/openclaw-skills/silicaclaw-owner-push/scripts/owner-push-forwarder.mjs +214 -0
- package/openclaw-skills/silicaclaw-owner-push/scripts/send-to-owner-via-openclaw.mjs +69 -0
- package/package.json +5 -1
- package/packages/core/dist/config/silicaclaw-defaults.json +19 -0
- package/packages/core/dist/packages/core/src/crypto.d.ts +6 -0
- package/packages/core/dist/packages/core/src/crypto.js +50 -0
- package/packages/core/dist/packages/core/src/directory.d.ts +17 -0
- package/packages/core/dist/packages/core/src/directory.js +145 -0
- package/packages/core/dist/packages/core/src/identity.d.ts +2 -0
- package/packages/core/dist/packages/core/src/identity.js +18 -0
- package/packages/core/dist/packages/core/src/index.d.ts +12 -0
- package/packages/core/dist/packages/core/src/index.js +28 -0
- package/packages/core/dist/packages/core/src/indexing.d.ts +6 -0
- package/packages/core/dist/packages/core/src/indexing.js +43 -0
- package/packages/core/dist/packages/core/src/presence.d.ts +4 -0
- package/packages/core/dist/packages/core/src/presence.js +23 -0
- package/packages/core/dist/packages/core/src/profile.d.ts +4 -0
- package/packages/core/dist/packages/core/src/profile.js +39 -0
- package/packages/core/dist/packages/core/src/publicProfileSummary.d.ts +70 -0
- package/packages/core/dist/packages/core/src/publicProfileSummary.js +103 -0
- package/packages/core/dist/packages/core/src/socialConfig.d.ts +100 -0
- package/packages/core/dist/packages/core/src/socialConfig.js +300 -0
- package/packages/core/dist/packages/core/src/socialMessage.d.ts +19 -0
- package/packages/core/dist/packages/core/src/socialMessage.js +69 -0
- package/packages/core/dist/packages/core/src/socialResolver.d.ts +46 -0
- package/packages/core/dist/packages/core/src/socialResolver.js +237 -0
- package/packages/core/dist/packages/core/src/socialTemplate.d.ts +2 -0
- package/packages/core/dist/packages/core/src/socialTemplate.js +90 -0
- package/packages/core/dist/packages/core/src/types.d.ts +59 -0
- package/packages/core/dist/packages/core/src/types.js +2 -0
- package/packages/core/src/socialConfig.ts +7 -5
- package/packages/network/dist/config/silicaclaw-defaults.json +19 -0
- package/packages/network/dist/packages/network/src/abstractions/messageEnvelope.d.ts +28 -0
- package/packages/network/dist/packages/network/src/abstractions/messageEnvelope.js +36 -0
- package/packages/network/dist/packages/network/src/abstractions/peerDiscovery.d.ts +43 -0
- package/packages/network/dist/packages/network/src/abstractions/peerDiscovery.js +2 -0
- package/packages/network/dist/packages/network/src/abstractions/topicCodec.d.ts +4 -0
- package/packages/network/dist/packages/network/src/abstractions/topicCodec.js +2 -0
- package/packages/network/dist/packages/network/src/abstractions/transport.d.ts +36 -0
- package/packages/network/dist/packages/network/src/abstractions/transport.js +2 -0
- package/packages/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.d.ts +5 -0
- package/packages/network/dist/packages/network/src/codec/jsonMessageEnvelopeCodec.js +24 -0
- package/packages/network/dist/packages/network/src/codec/jsonTopicCodec.d.ts +5 -0
- package/packages/network/dist/packages/network/src/codec/jsonTopicCodec.js +12 -0
- package/packages/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.d.ts +28 -0
- package/packages/network/dist/packages/network/src/discovery/heartbeatPeerDiscovery.js +144 -0
- package/packages/network/dist/packages/network/src/index.d.ts +14 -0
- package/packages/network/dist/packages/network/src/index.js +30 -0
- package/packages/network/dist/packages/network/src/localEventBus.d.ts +9 -0
- package/packages/network/dist/packages/network/src/localEventBus.js +47 -0
- package/packages/network/dist/packages/network/src/mock.d.ts +8 -0
- package/packages/network/dist/packages/network/src/mock.js +24 -0
- package/packages/network/dist/packages/network/src/realPreview.d.ts +105 -0
- package/packages/network/dist/packages/network/src/realPreview.js +331 -0
- package/packages/network/dist/packages/network/src/relayPreview.d.ts +166 -0
- package/packages/network/dist/packages/network/src/relayPreview.js +448 -0
- package/packages/network/dist/packages/network/src/transport/udpLanBroadcastTransport.d.ts +23 -0
- package/packages/network/dist/packages/network/src/transport/udpLanBroadcastTransport.js +154 -0
- package/packages/network/dist/packages/network/src/types.d.ts +6 -0
- package/packages/network/dist/packages/network/src/types.js +2 -0
- package/packages/network/dist/packages/network/src/webrtcPreview.d.ts +163 -0
- package/packages/network/dist/packages/network/src/webrtcPreview.js +848 -0
- package/packages/network/src/realPreview.ts +3 -2
- package/packages/network/src/relayPreview.ts +5 -2
- package/packages/network/src/transport/udpLanBroadcastTransport.ts +2 -1
- package/packages/network/src/webrtcPreview.ts +2 -1
- package/packages/storage/config/silicaclaw-defaults.json +19 -0
- 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/dist/socialRuntimeRepo.js +8 -4
- package/packages/storage/src/socialRuntimeRepo.ts +5 -4
- package/packages/storage/tsconfig.json +1 -6
- package/scripts/functional-check.mjs +35 -6
- package/scripts/install-openclaw-skill.mjs +9 -2
- package/scripts/openclaw-bridge-adapter.mjs +3 -1
- package/scripts/openclaw-bridge-client.mjs +3 -1
- package/scripts/openclaw-runtime-demo.mjs +3 -1
- package/scripts/quickstart.sh +14 -10
- package/scripts/release-pack.mjs +59 -1
- package/scripts/silicaclaw-cli.mjs +162 -50
- package/scripts/silicaclaw-gateway.mjs +302 -84
- package/scripts/validate-openclaw-skill.mjs +79 -21
|
@@ -9,6 +9,8 @@ import { fileURLToPath } from "node:url";
|
|
|
9
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
10
10
|
const __dirname = dirname(__filename);
|
|
11
11
|
const ROOT_DIR = resolve(__dirname, "..");
|
|
12
|
+
const INVOCATION_CWD = process.cwd();
|
|
13
|
+
const LOCAL_CONSOLE_BASE_URL = "http://localhost:4310";
|
|
12
14
|
|
|
13
15
|
const COLOR = {
|
|
14
16
|
reset: "\x1b[0m",
|
|
@@ -34,7 +36,7 @@ function displayVersion(raw) {
|
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
function headline() {
|
|
37
|
-
console.log(`${paint("SilicaClaw", COLOR.bold, COLOR.orange)} ${paint(displayVersion(readVersion()), COLOR.dim)}`);
|
|
39
|
+
console.log(`${paint("🦀 SilicaClaw", COLOR.bold, COLOR.orange)} ${paint(displayVersion(readVersion()), COLOR.dim)}`);
|
|
38
40
|
console.log(paint("Public identity and discovery for OpenClaw agents.", COLOR.dim));
|
|
39
41
|
}
|
|
40
42
|
|
|
@@ -50,7 +52,10 @@ function run(cmd, args, extra = {}) {
|
|
|
50
52
|
const result = spawnSync(cmd, args, {
|
|
51
53
|
cwd: ROOT_DIR,
|
|
52
54
|
stdio: "inherit",
|
|
53
|
-
env:
|
|
55
|
+
env: {
|
|
56
|
+
...process.env,
|
|
57
|
+
SILICACLAW_WORKSPACE_DIR: process.env.SILICACLAW_WORKSPACE_DIR || INVOCATION_CWD,
|
|
58
|
+
},
|
|
54
59
|
...extra,
|
|
55
60
|
});
|
|
56
61
|
if (result.error) {
|
|
@@ -68,7 +73,10 @@ function runCapture(cmd, args, extra = {}) {
|
|
|
68
73
|
cwd: ROOT_DIR,
|
|
69
74
|
stdio: ["ignore", "pipe", "pipe"],
|
|
70
75
|
encoding: "utf8",
|
|
71
|
-
env:
|
|
76
|
+
env: {
|
|
77
|
+
...process.env,
|
|
78
|
+
SILICACLAW_WORKSPACE_DIR: process.env.SILICACLAW_WORKSPACE_DIR || INVOCATION_CWD,
|
|
79
|
+
},
|
|
72
80
|
...extra,
|
|
73
81
|
});
|
|
74
82
|
if (result.error) {
|
|
@@ -81,7 +89,10 @@ function runInherit(cmd, args, extra = {}) {
|
|
|
81
89
|
const result = spawnSync(cmd, args, {
|
|
82
90
|
cwd: ROOT_DIR,
|
|
83
91
|
stdio: "inherit",
|
|
84
|
-
env:
|
|
92
|
+
env: {
|
|
93
|
+
...process.env,
|
|
94
|
+
SILICACLAW_WORKSPACE_DIR: process.env.SILICACLAW_WORKSPACE_DIR || INVOCATION_CWD,
|
|
95
|
+
},
|
|
85
96
|
...extra,
|
|
86
97
|
});
|
|
87
98
|
if (result.error) {
|
|
@@ -99,6 +110,10 @@ function compactOutput(text, limit = 18) {
|
|
|
99
110
|
return lines.slice(-limit).join("\n");
|
|
100
111
|
}
|
|
101
112
|
|
|
113
|
+
function sleep(ms) {
|
|
114
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
115
|
+
}
|
|
116
|
+
|
|
102
117
|
function readVersion() {
|
|
103
118
|
return readPackageVersion();
|
|
104
119
|
}
|
|
@@ -138,6 +153,25 @@ function userNpmCacheDir() {
|
|
|
138
153
|
return resolve(homedir(), ".silicaclaw", "npm-cache");
|
|
139
154
|
}
|
|
140
155
|
|
|
156
|
+
function shimScriptText(specifier = "latest") {
|
|
157
|
+
return [
|
|
158
|
+
"#!/usr/bin/env bash",
|
|
159
|
+
"set -euo pipefail",
|
|
160
|
+
'export npm_config_cache="${npm_config_cache:-$HOME/.silicaclaw/npm-cache}"',
|
|
161
|
+
`exec npx -y @silicaclaw/cli@${specifier} "$@"`,
|
|
162
|
+
"",
|
|
163
|
+
].join("\n");
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function ensureUserShim(specifier = "latest") {
|
|
167
|
+
const shimPath = userShimPath();
|
|
168
|
+
const binDir = userShimDir();
|
|
169
|
+
const npmCacheDir = userNpmCacheDir();
|
|
170
|
+
mkdirSync(binDir, { recursive: true });
|
|
171
|
+
mkdirSync(npmCacheDir, { recursive: true });
|
|
172
|
+
writeFileSync(shimPath, shimScriptText(specifier), { encoding: "utf8", mode: 0o755 });
|
|
173
|
+
}
|
|
174
|
+
|
|
141
175
|
function ensureLineInFile(filePath, block) {
|
|
142
176
|
try {
|
|
143
177
|
const current = existsSync(filePath) ? readFileSync(filePath, "utf8") : "";
|
|
@@ -202,7 +236,7 @@ function shellInitTargets() {
|
|
|
202
236
|
return targets;
|
|
203
237
|
}
|
|
204
238
|
|
|
205
|
-
function installPersistentCommand() {
|
|
239
|
+
function installPersistentCommand(specifier = readPackageVersion()) {
|
|
206
240
|
const binDir = userShimDir();
|
|
207
241
|
const shimPath = userShimPath();
|
|
208
242
|
const envFile = userEnvFile();
|
|
@@ -222,17 +256,7 @@ function installPersistentCommand() {
|
|
|
222
256
|
mkdirSync(binDir, { recursive: true });
|
|
223
257
|
mkdirSync(npmCacheDir, { recursive: true });
|
|
224
258
|
writeFileSync(envFile, envBlock, { encoding: "utf8", mode: 0o755 });
|
|
225
|
-
writeFileSync(
|
|
226
|
-
shimPath,
|
|
227
|
-
[
|
|
228
|
-
"#!/usr/bin/env bash",
|
|
229
|
-
"set -euo pipefail",
|
|
230
|
-
'export npm_config_cache="${npm_config_cache:-$HOME/.silicaclaw/npm-cache}"',
|
|
231
|
-
'exec npx -y @silicaclaw/cli@beta "$@"',
|
|
232
|
-
"",
|
|
233
|
-
].join("\n"),
|
|
234
|
-
{ encoding: "utf8", mode: 0o755 }
|
|
235
|
-
);
|
|
259
|
+
writeFileSync(shimPath, shimScriptText(specifier || "latest"), { encoding: "utf8", mode: 0o755 });
|
|
236
260
|
const rcFiles = shellInitTargets();
|
|
237
261
|
const updatedFiles = [];
|
|
238
262
|
const configuredFiles = [];
|
|
@@ -296,20 +320,39 @@ function canWriteGlobalPrefix() {
|
|
|
296
320
|
}
|
|
297
321
|
}
|
|
298
322
|
|
|
299
|
-
function showUpdateGuide(current,
|
|
323
|
+
function showUpdateGuide(current, targetVersion) {
|
|
300
324
|
headline();
|
|
301
325
|
console.log("");
|
|
302
|
-
const upToDate = Boolean(
|
|
326
|
+
const upToDate = Boolean(targetVersion) && current === targetVersion;
|
|
303
327
|
if (upToDate) {
|
|
304
328
|
kv("Status", `up to date (${current})`);
|
|
305
329
|
} else {
|
|
306
|
-
kv("Status", `
|
|
330
|
+
kv("Status", `update available (${targetVersion || "-"})`);
|
|
307
331
|
}
|
|
308
332
|
console.log("");
|
|
309
333
|
kv("Start", "silicaclaw start");
|
|
310
334
|
kv("Status", "silicaclaw status");
|
|
311
335
|
}
|
|
312
336
|
|
|
337
|
+
function preferredTaggedRelease(tags, current) {
|
|
338
|
+
const latest = tags.latest ? String(tags.latest) : "";
|
|
339
|
+
if (latest) return { version: latest, channel: "latest" };
|
|
340
|
+
return { version: current, channel: "unknown" };
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function preferredRegistryRelease(current) {
|
|
344
|
+
try {
|
|
345
|
+
const result = runCapture("npm", ["view", "@silicaclaw/cli", "dist-tags", "--json"]);
|
|
346
|
+
if ((result.status ?? 1) !== 0) return { version: current, channel: "current", tags: null };
|
|
347
|
+
const text = String(result.stdout || "").trim();
|
|
348
|
+
const tags = text ? JSON.parse(text) : {};
|
|
349
|
+
const preferred = preferredTaggedRelease(tags, current);
|
|
350
|
+
return { ...preferred, tags };
|
|
351
|
+
} catch {
|
|
352
|
+
return { version: current, channel: "current", tags: null };
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
313
356
|
function getGatewayStatus() {
|
|
314
357
|
try {
|
|
315
358
|
const result = runCapture("node", [resolve(ROOT_DIR, "scripts", "silicaclaw-gateway.mjs"), "status", "--json"], {
|
|
@@ -369,7 +412,8 @@ function syncCurrentPackageToAppDir(appDir) {
|
|
|
369
412
|
return true;
|
|
370
413
|
}
|
|
371
414
|
|
|
372
|
-
function restartGatewayIfRunning() {
|
|
415
|
+
function restartGatewayIfRunning(options = {}) {
|
|
416
|
+
const preferredSpecifier = String(options.preferredSpecifier || "").trim();
|
|
373
417
|
const status = getGatewayStatus();
|
|
374
418
|
const appDir = status?.app_dir ? String(status.app_dir) : "";
|
|
375
419
|
syncCurrentPackageToAppDir(appDir);
|
|
@@ -377,28 +421,80 @@ function restartGatewayIfRunning() {
|
|
|
377
421
|
const localRunning = Boolean(status?.local_console?.running);
|
|
378
422
|
const signalingRunning = Boolean(status?.signaling?.running);
|
|
379
423
|
if (!localRunning && !signalingRunning) {
|
|
380
|
-
return;
|
|
424
|
+
return { restarted: false };
|
|
381
425
|
}
|
|
382
426
|
|
|
383
427
|
const mode = String(status?.mode || "local");
|
|
384
|
-
const
|
|
428
|
+
const gatewayArgs = ["gateway", "restart", `--mode=${mode}`];
|
|
385
429
|
if (mode === "global-preview" && status?.signaling?.url) {
|
|
386
|
-
|
|
430
|
+
gatewayArgs.push(`--signaling-url=${status.signaling.url}`);
|
|
387
431
|
}
|
|
388
432
|
if (mode === "global-preview" && status?.signaling?.room) {
|
|
389
|
-
|
|
433
|
+
gatewayArgs.push(`--room=${status.signaling.room}`);
|
|
390
434
|
}
|
|
391
435
|
|
|
392
436
|
console.log("");
|
|
393
437
|
console.log(paint("Refreshing services", COLOR.bold));
|
|
394
|
-
|
|
438
|
+
const shimPath = userShimPath();
|
|
439
|
+
const canUseUpdatedShim =
|
|
440
|
+
preferredSpecifier &&
|
|
441
|
+
existsSync(shimPath) &&
|
|
442
|
+
resolve(shimPath) !== process.argv[1];
|
|
443
|
+
|
|
444
|
+
if (canUseUpdatedShim) {
|
|
445
|
+
runInherit(shimPath, gatewayArgs, { cwd: process.cwd() });
|
|
446
|
+
return { restarted: true, usedUpdatedShim: true };
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
runInherit("node", [resolve(ROOT_DIR, "scripts", "silicaclaw-gateway.mjs"), ...gatewayArgs.slice(1)], {
|
|
450
|
+
cwd: process.cwd(),
|
|
451
|
+
});
|
|
452
|
+
return { restarted: true, usedUpdatedShim: false };
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
function readLocalConsoleAppVersion() {
|
|
456
|
+
try {
|
|
457
|
+
const result = runCapture("curl", ["-sS", `${LOCAL_CONSOLE_BASE_URL}/api/overview`], {
|
|
458
|
+
cwd: process.cwd(),
|
|
459
|
+
});
|
|
460
|
+
if ((result.status ?? 1) !== 0) return "";
|
|
461
|
+
const text = String(result.stdout || "").trim();
|
|
462
|
+
if (!text) return "";
|
|
463
|
+
const payload = JSON.parse(text);
|
|
464
|
+
return String(payload?.data?.app_version || "").trim();
|
|
465
|
+
} catch {
|
|
466
|
+
return "";
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
async function waitForLocalConsoleVersion(targetVersion, timeoutMs = 15000) {
|
|
471
|
+
const startedAt = Date.now();
|
|
472
|
+
while (Date.now() - startedAt < timeoutMs) {
|
|
473
|
+
const version = readLocalConsoleAppVersion();
|
|
474
|
+
if (version === targetVersion) return version;
|
|
475
|
+
await sleep(400);
|
|
476
|
+
}
|
|
477
|
+
return readLocalConsoleAppVersion();
|
|
395
478
|
}
|
|
396
479
|
|
|
397
|
-
function
|
|
480
|
+
async function ensureRefreshedConsoleVersion(targetVersion) {
|
|
481
|
+
if (!targetVersion) return "";
|
|
482
|
+
let observed = await waitForLocalConsoleVersion(targetVersion, 12000);
|
|
483
|
+
if (observed === targetVersion) return observed;
|
|
484
|
+
|
|
485
|
+
const shimPath = userShimPath();
|
|
486
|
+
if (!existsSync(shimPath)) return observed;
|
|
487
|
+
|
|
488
|
+
runInherit(shimPath, ["gateway", "restart"], { cwd: process.cwd() });
|
|
489
|
+
observed = await waitForLocalConsoleVersion(targetVersion, 12000);
|
|
490
|
+
return observed;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
function tryGlobalUpgrade(version) {
|
|
398
494
|
const writableGlobal = canWriteGlobalPrefix();
|
|
399
495
|
if (!writableGlobal) return false;
|
|
400
|
-
kv("Upgrade", `installing @silicaclaw/cli@${
|
|
401
|
-
const exactResult = runCapture("npm", ["i", "-g", `@silicaclaw/cli@${
|
|
496
|
+
kv("Upgrade", `installing @silicaclaw/cli@${version} globally`);
|
|
497
|
+
const exactResult = runCapture("npm", ["i", "-g", `@silicaclaw/cli@${version}`]);
|
|
402
498
|
if ((exactResult.status ?? 1) === 0) {
|
|
403
499
|
if (exactResult.stdout) process.stdout.write(exactResult.stdout);
|
|
404
500
|
if (exactResult.stderr) process.stderr.write(exactResult.stderr);
|
|
@@ -407,8 +503,8 @@ function tryGlobalUpgrade(beta) {
|
|
|
407
503
|
|
|
408
504
|
const detail = compactOutput(`${exactResult.stdout || ""}\n${exactResult.stderr || ""}`);
|
|
409
505
|
if (detail.includes("ETARGET") || detail.includes("No matching version found")) {
|
|
410
|
-
kv("Fallback",
|
|
411
|
-
const fallbackResult = runInherit("npm", ["i", "-g",
|
|
506
|
+
kv("Fallback", `registry metadata is still settling, retrying via exact version ${version}`);
|
|
507
|
+
const fallbackResult = runInherit("npm", ["i", "-g", `@silicaclaw/cli@${version}`]);
|
|
412
508
|
return (fallbackResult.status ?? 1) === 0;
|
|
413
509
|
}
|
|
414
510
|
|
|
@@ -419,38 +515,44 @@ function tryGlobalUpgrade(beta) {
|
|
|
419
515
|
return false;
|
|
420
516
|
}
|
|
421
517
|
|
|
422
|
-
function update() {
|
|
518
|
+
async function update() {
|
|
423
519
|
const current = readPackageVersion();
|
|
424
520
|
try {
|
|
425
|
-
const
|
|
426
|
-
if (
|
|
521
|
+
const registry = preferredRegistryRelease(current);
|
|
522
|
+
if (!registry.tags) {
|
|
427
523
|
headline();
|
|
428
524
|
console.log("");
|
|
429
525
|
console.error(paint("Update check failed", COLOR.bold, COLOR.yellow));
|
|
430
|
-
if (result.stderr) console.error(result.stderr.trim());
|
|
431
526
|
console.log("");
|
|
432
527
|
kv("Try", "npm view @silicaclaw/cli dist-tags --json");
|
|
433
|
-
process.exit(
|
|
528
|
+
process.exit(1);
|
|
434
529
|
}
|
|
435
|
-
const
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
const
|
|
439
|
-
showUpdateGuide(current, latest, beta);
|
|
440
|
-
const hasNewBeta = Boolean(beta) && beta !== current;
|
|
530
|
+
const targetVersion = registry.version;
|
|
531
|
+
ensureUserShim(targetVersion || "latest");
|
|
532
|
+
showUpdateGuide(current, targetVersion);
|
|
533
|
+
const hasNewTarget = Boolean(targetVersion) && targetVersion !== current;
|
|
441
534
|
const npxRuntime = isNpxRun();
|
|
442
535
|
|
|
443
|
-
if (
|
|
536
|
+
if (hasNewTarget) {
|
|
444
537
|
if (npxRuntime) {
|
|
445
|
-
kv("Update", `next run will use ${
|
|
446
|
-
} else if (tryGlobalUpgrade(beta)) {
|
|
447
|
-
kv("Update", `installed ${beta}`);
|
|
538
|
+
kv("Update", `next run will use ${targetVersion}`);
|
|
448
539
|
} else {
|
|
449
|
-
kv("Update", `
|
|
540
|
+
kv("Update", `command now points to ${targetVersion}`);
|
|
541
|
+
if (tryGlobalUpgrade(targetVersion)) {
|
|
542
|
+
kv("Global", `installed ${targetVersion}`);
|
|
543
|
+
} else {
|
|
544
|
+
kv("Global", `install ${targetVersion} manually if needed`);
|
|
545
|
+
}
|
|
450
546
|
}
|
|
451
547
|
}
|
|
452
548
|
|
|
453
|
-
restartGatewayIfRunning();
|
|
549
|
+
const restartResult = restartGatewayIfRunning({ preferredSpecifier: hasNewTarget ? targetVersion : "" });
|
|
550
|
+
if (hasNewTarget && restartResult?.restarted) {
|
|
551
|
+
const observedVersion = await ensureRefreshedConsoleVersion(targetVersion);
|
|
552
|
+
if (observedVersion && observedVersion !== targetVersion) {
|
|
553
|
+
kv("Verify", `local console still reports ${observedVersion}`);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
454
556
|
process.exit(0);
|
|
455
557
|
} catch (error) {
|
|
456
558
|
headline();
|
|
@@ -494,7 +596,8 @@ function help() {
|
|
|
494
596
|
headline();
|
|
495
597
|
console.log("");
|
|
496
598
|
section("Commands");
|
|
497
|
-
kv("
|
|
599
|
+
kv("First Run", "npx -y @silicaclaw/cli@latest onboard");
|
|
600
|
+
kv("Install", "npx -y @silicaclaw/cli@latest install");
|
|
498
601
|
kv("Start", "silicaclaw start");
|
|
499
602
|
kv("Status", "silicaclaw status");
|
|
500
603
|
kv("Stop", "silicaclaw stop");
|
|
@@ -509,6 +612,12 @@ function help() {
|
|
|
509
612
|
kv("Logs", "silicaclaw logs local-console");
|
|
510
613
|
kv("Doctor", "silicaclaw doctor");
|
|
511
614
|
kv("Help", "silicaclaw help");
|
|
615
|
+
console.log("");
|
|
616
|
+
section("Meaning");
|
|
617
|
+
kv("onboard", "first-time setup wizard");
|
|
618
|
+
kv("connect", "quick network setup wizard");
|
|
619
|
+
kv("install", "install persistent silicaclaw command only");
|
|
620
|
+
kv("channel", "@latest is the default release channel");
|
|
512
621
|
}
|
|
513
622
|
|
|
514
623
|
const cmd = String(process.argv[2] || "help").trim().toLowerCase();
|
|
@@ -527,10 +636,13 @@ switch (cmd) {
|
|
|
527
636
|
});
|
|
528
637
|
break;
|
|
529
638
|
case "update":
|
|
530
|
-
update();
|
|
639
|
+
await update();
|
|
531
640
|
break;
|
|
532
641
|
case "install":
|
|
533
|
-
|
|
642
|
+
{
|
|
643
|
+
const preferred = preferredRegistryRelease(readPackageVersion());
|
|
644
|
+
installPersistentCommand(preferred.version || readPackageVersion());
|
|
645
|
+
}
|
|
534
646
|
break;
|
|
535
647
|
case "gateway":
|
|
536
648
|
run("node", [resolve(ROOT_DIR, "scripts", "silicaclaw-gateway.mjs"), ...process.argv.slice(3)], {
|