motebit 1.0.1 → 1.1.0

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.
Files changed (2) hide show
  1. package/dist/index.js +31 -3
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -11948,8 +11948,8 @@ var init_config2 = __esm({
11948
11948
  "src/config.ts"() {
11949
11949
  "use strict";
11950
11950
  init_esm_shims();
11951
- VERSION = true ? "1.0.1" : "0.0.0-dev";
11952
- CONFIG_DIR = path2.join(os.homedir(), ".motebit");
11951
+ VERSION = true ? "1.1.0" : "0.0.0-dev";
11952
+ CONFIG_DIR = process.env["MOTEBIT_CONFIG_DIR"] ?? path2.join(os.homedir(), ".motebit");
11953
11953
  CONFIG_PATH = path2.join(CONFIG_DIR, "config.json");
11954
11954
  RELAY_DIR = path2.join(CONFIG_DIR, "relay");
11955
11955
  RELAY_DB_PATH = path2.join(RELAY_DIR, "relay.db");
@@ -56457,6 +56457,7 @@ function createProvider(config, personalityConfig) {
56457
56457
  }
56458
56458
  function buildToolRegistry(config, runtimeRef, motebitId) {
56459
56459
  const registry = new InMemoryToolRegistry();
56460
+ if (config.direct) return registry;
56460
56461
  registry.register(readFileDefinition, createReadFileHandler(config.allowedPaths));
56461
56462
  const braveKey = process.env["BRAVE_SEARCH_API_KEY"];
56462
56463
  let searchProvider;
@@ -82727,7 +82728,34 @@ async function handleServe(config) {
82727
82728
  try {
82728
82729
  const toolNames = runtime.getToolRegistry().list().map((t3) => t3.name);
82729
82730
  const regHeaders = { "Content-Type": "application/json" };
82730
- if (masterToken) regHeaders["Authorization"] = `Bearer ${masterToken}`;
82731
+ if (masterToken) {
82732
+ regHeaders["Authorization"] = `Bearer ${masterToken}`;
82733
+ } else if (servePrivateKey && fullConfigForServe.device_id && publicKeyHex) {
82734
+ try {
82735
+ await fetch(`${syncUrl}/api/v1/agents/bootstrap`, {
82736
+ method: "POST",
82737
+ headers: { "Content-Type": "application/json" },
82738
+ body: JSON.stringify({
82739
+ motebit_id: motebitId,
82740
+ device_id: fullConfigForServe.device_id,
82741
+ public_key: publicKeyHex
82742
+ })
82743
+ });
82744
+ } catch {
82745
+ }
82746
+ const signedToken = await createSignedToken(
82747
+ {
82748
+ mid: motebitId,
82749
+ did: fullConfigForServe.device_id,
82750
+ iat: Date.now(),
82751
+ exp: Date.now() + 24 * 60 * 60 * 1e3,
82752
+ jti: crypto.randomUUID(),
82753
+ aud: "admin:query"
82754
+ },
82755
+ servePrivateKey
82756
+ );
82757
+ regHeaders["Authorization"] = `Bearer ${signedToken}`;
82758
+ }
82731
82759
  const endpointUrl = `http://localhost:${port}`;
82732
82760
  const serveRegBody = {
82733
82761
  motebit_id: motebitId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "motebit",
3
- "version": "1.0.1",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "description": "Reference runtime and operator console for sovereign AI agents — REPL, daemon, delegation, MCP server. Persistent Ed25519 identity, signed execution receipts, governance at the boundary.",
6
6
  "main": "./dist/index.js",
@@ -74,25 +74,25 @@
74
74
  "typescript": "^5.6.0",
75
75
  "vitest": "^2.1.0",
76
76
  "@motebit/ai-core": "0.0.0-private",
77
- "@motebit/api": "0.0.0-private",
78
77
  "@motebit/behavior-engine": "0.0.0-private",
79
- "@motebit/core-identity": "0.0.0-private",
78
+ "@motebit/api": "0.0.0-private",
80
79
  "@motebit/crypto": "1.1.0",
80
+ "@motebit/core-identity": "0.0.0-private",
81
81
  "@motebit/encryption": "0.0.0-private",
82
82
  "@motebit/event-log": "0.0.0-private",
83
83
  "@motebit/gradient": "0.0.0-private",
84
- "@motebit/identity-file": "0.0.0-private",
85
- "@motebit/mcp-client": "0.0.0-private",
86
84
  "@motebit/mcp-server": "0.0.0-private",
87
85
  "@motebit/memory-graph": "0.0.0-private",
88
86
  "@motebit/persistence": "0.0.0-private",
87
+ "@motebit/mcp-client": "0.0.0-private",
89
88
  "@motebit/planner": "0.0.0-private",
90
89
  "@motebit/policy": "0.0.0-private",
91
90
  "@motebit/privacy-layer": "0.0.0-private",
92
91
  "@motebit/runtime": "0.0.0-private",
93
92
  "@motebit/sdk": "1.0.1",
94
- "@motebit/self-knowledge": "0.0.0-private",
93
+ "@motebit/identity-file": "0.0.0-private",
95
94
  "@motebit/state-vector": "0.0.0-private",
95
+ "@motebit/self-knowledge": "0.0.0-private",
96
96
  "@motebit/sync-engine": "0.0.0-private",
97
97
  "@motebit/tools": "0.0.0-private",
98
98
  "@motebit/verify": "1.1.0",