Update subproject commit and modify state management in QuickJS bootstrap

- Updated the subproject commit reference in the skills directory.
- Adjusted the state management functions to utilize the __store for get, set, and delete operations, ensuring consistency in data handling.
- Removed obsolete store functions to streamline the codebase.
This commit is contained in:
Steven Enamakel
2026-02-09 03:52:22 +05:30
parent 5e36676ba5
commit f53d8cb62e
2 changed files with 17 additions and 22 deletions
+1 -1
Submodule skills updated: 16670661a8...e76e5fc072
+16 -21
View File
@@ -669,7 +669,7 @@ globalThis.performance = {
// ============================================================================
// Skill Bridge API
// ============================================================================
// These are exposed to skills via the `platform`, `db`, `store`, etc globals
// These are exposed to skills via the `platform`, `db`, `state`, etc globals
globalThis.__db = {
exec: function (sql, paramsJson) {
@@ -741,23 +741,6 @@ globalThis.db = {
},
};
globalThis.store = {
get: function (key) {
var result = __store.get(key);
return JSON.parse(result);
},
set: function (key, value) {
return __store.set(key, JSON.stringify(value));
},
delete: function (key) {
return __store.delete(key);
},
keys: function () {
var result = __store.keys();
return JSON.parse(result);
},
};
globalThis.net = {
fetch: function (url, options) {
var result = __net.fetch(url, options ? JSON.stringify(options) : '{}');
@@ -791,14 +774,26 @@ globalThis.__state = {
globalThis.state = {
get: function (key) {
var result = __state.get(key);
var result = __store.get(key);
return JSON.parse(result);
},
set: function (key, value) {
return __state.set(key, JSON.stringify(value));
__store.set(key, JSON.stringify(value));
__state.set(key, JSON.stringify(value));
},
setPartial: function (partial) {
return __state.setPartial(JSON.stringify(partial));
var keys = Object.keys(partial);
for (var i = 0; i < keys.length; i++) {
__store.set(keys[i], JSON.stringify(partial[keys[i]]));
}
__state.setPartial(JSON.stringify(partial));
},
delete: function (key) {
return __store.delete(key);
},
keys: function () {
var result = __store.keys();
return JSON.parse(result);
},
};