@cutos/core 4.0.1 → 4.0.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/README.md CHANGED
@@ -135,9 +135,9 @@ provider.emit("statusChanged", {
135
135
  Use Mock Dev when developing an LWA without a local CUTOS Node.
136
136
 
137
137
  ```ts
138
- import { CoreAPI, cutos, installCutosMock } from "@cutos/core"
138
+ import { CoreAPI, cutos, CutosMock } from "@cutos/core"
139
139
 
140
- installCutosMock({
140
+ CutosMock.install({
141
141
  capabilities: {
142
142
  "hello-device": {
143
143
  methods: {
@@ -147,12 +147,18 @@ installCutosMock({
147
147
  }
148
148
  })
149
149
 
150
- await CoreAPI.init()
150
+ await CoreAPI.init("mock")
151
151
 
152
152
  const hello = cutos.capability("hello-device")
153
153
  const result = await hello.call("echo", { message: "hello" })
154
154
  ```
155
155
 
156
+ For simple UI development, set the CUTOS host to `mock` and keep application code unchanged:
157
+
158
+ ```bash
159
+ VITE_CUTOS_BROKER_URL=mock
160
+ ```
161
+
156
162
  Mock Dev is intended for UI and SDK integration development. Real IPC, WebView host behavior, and Node Provider behavior should still be verified with a CUTOS Node before release.
157
163
 
158
164
  # Platform API
package/dist/cutos.cjs.js CHANGED
@@ -398,7 +398,7 @@ const cutosAPI$2 = {
398
398
  var cutosApi = cutosAPI$2;
399
399
 
400
400
  var name = "@cutos/core";
401
- var version = "4.0.1";
401
+ var version = "4.0.2";
402
402
  var description = "The CUTOS (CUT Operating System) Core API is a JavaScript library that provides essential functionalities for LWA (Local Web Application) edge computing and communication in the CUTOS ecosystem. ";
403
403
  var main = "dist/cutos.cjs.js";
404
404
  var module$1 = "dist/cutos.esm.js";
@@ -2066,6 +2066,19 @@ const {CoreAPI, CoreDefine, CoreClass, cutosAPI, cutos, CutosError} = cutos$3;
2066
2066
  const {CoreSimulator} = coreSimulator;
2067
2067
  const {CutosMock, installCutosMock, uninstallCutosMock} = mock;
2068
2068
 
2069
+ const coreInit = CoreAPI.init.bind(CoreAPI);
2070
+
2071
+ CoreAPI.init = function (host = 'localhost', callback) {
2072
+ if (typeof host === 'function') {
2073
+ callback = host;
2074
+ host = 'localhost';
2075
+ }
2076
+ if (host === 'mock' || host === 'cutos://mock') {
2077
+ installCutosMock();
2078
+ return CoreAPI.init('localhost', callback);
2079
+ }
2080
+ return coreInit(host, callback);
2081
+ };
2069
2082
 
2070
2083
  var CoreAPI_1 = src.CoreAPI = CoreAPI;
2071
2084
  var CoreDefine_1 = src.CoreDefine = CoreDefine;
package/dist/cutos.esm.js CHANGED
@@ -690,7 +690,7 @@ const cutosAPI$2 = {
690
690
  var cutosApi = cutosAPI$2;
691
691
 
692
692
  var name = "@cutos/core";
693
- var version = "4.0.1";
693
+ var version = "4.0.2";
694
694
  var description = "The CUTOS (CUT Operating System) Core API is a JavaScript library that provides essential functionalities for LWA (Local Web Application) edge computing and communication in the CUTOS ecosystem. ";
695
695
  var main = "dist/cutos.cjs.js";
696
696
  var module = "dist/cutos.esm.js";
@@ -2358,6 +2358,19 @@ const {CoreAPI, CoreDefine, CoreClass, cutosAPI, cutos, CutosError} = cutos$3;
2358
2358
  const {CoreSimulator} = coreSimulator;
2359
2359
  const {CutosMock, installCutosMock, uninstallCutosMock} = mock;
2360
2360
 
2361
+ const coreInit = CoreAPI.init.bind(CoreAPI);
2362
+
2363
+ CoreAPI.init = function (host = 'localhost', callback) {
2364
+ if (typeof host === 'function') {
2365
+ callback = host;
2366
+ host = 'localhost';
2367
+ }
2368
+ if (host === 'mock' || host === 'cutos://mock') {
2369
+ installCutosMock();
2370
+ return CoreAPI.init('localhost', callback);
2371
+ }
2372
+ return coreInit(host, callback);
2373
+ };
2361
2374
 
2362
2375
  var CoreAPI_1 = src.CoreAPI = CoreAPI;
2363
2376
  var CoreDefine_1 = src.CoreDefine = CoreDefine;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cutos/core",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "The CUTOS (CUT Operating System) Core API is a JavaScript library that provides essential functionalities for LWA (Local Web Application) edge computing and communication in the CUTOS ecosystem. ",
5
5
  "main": "dist/cutos.cjs.js",
6
6
  "module": "dist/cutos.esm.js",