@knowlearning/agents 0.3.0 → 0.3.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/agents/browser/embedded.js +5 -0
- package/agents/generic.js +5 -0
- package/browser.js +1 -1
- package/package.json +1 -1
|
@@ -104,6 +104,10 @@ export default function EmbeddedAgent() {
|
|
|
104
104
|
else return new MutableProxy({}, handlePatch)
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
function reset(scope) {
|
|
108
|
+
return interact(scope, [{ op: 'add', path:[], value: null }])
|
|
109
|
+
}
|
|
110
|
+
|
|
107
111
|
function interact(scope, patch) {
|
|
108
112
|
return send({ type: 'interact', scope, patch })
|
|
109
113
|
}
|
|
@@ -154,6 +158,7 @@ export default function EmbeddedAgent() {
|
|
|
154
158
|
interact,
|
|
155
159
|
patch,
|
|
156
160
|
mutate,
|
|
161
|
+
reset,
|
|
157
162
|
metadata,
|
|
158
163
|
disconnect,
|
|
159
164
|
reconnect
|
package/agents/generic.js
CHANGED
|
@@ -292,6 +292,10 @@ export default function Agent({ host, token, WebSocket, protocol='ws', uuid, fet
|
|
|
292
292
|
return new MutableProxy(initial, patch => interact(scope, patch))
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
+
function reset(scope) {
|
|
296
|
+
return interact(scope, [{ op: 'add', path:[], value: null }])
|
|
297
|
+
}
|
|
298
|
+
|
|
295
299
|
function metadata(id) {
|
|
296
300
|
return state(id, 'metadata', 'core')
|
|
297
301
|
}
|
|
@@ -317,6 +321,7 @@ export default function Agent({ host, token, WebSocket, protocol='ws', uuid, fet
|
|
|
317
321
|
interact,
|
|
318
322
|
patch,
|
|
319
323
|
mutate,
|
|
324
|
+
reset,
|
|
320
325
|
metadata,
|
|
321
326
|
disconnect,
|
|
322
327
|
reconnect
|
package/browser.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// TODO: export browser, node, deno, and generic agents
|
|
2
2
|
export { default as GenericAgent } from './agents/generic.js'
|
|
3
|
-
export { default as browserAgent } from './agents/browser/
|
|
3
|
+
export { default as browserAgent } from './agents/browser/initialize.js'
|
|
4
4
|
export { default as vuePersistentStore } from './persistence/vuex.js'
|
|
5
5
|
export { default as vueContentComponent } from './vue/3/content.vue'
|
|
6
6
|
export { default as vuePersistentComponent } from './vue/3/component.js'
|