@knowlearning/agents 0.9.102 → 0.9.104

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.
@@ -50,7 +50,8 @@ export default function Agent({ Connection, domain, token, uuid, fetch, applyPat
50
50
  interact,
51
51
  fetch,
52
52
  synced,
53
- metadata
53
+ metadata,
54
+ log
54
55
  }
55
56
 
56
57
  const [ watch, removeWatcher ] = watchImplementation(internalReferences)
@@ -1,7 +1,7 @@
1
1
  import { v4 as uuid, validate as isUUID } from 'uuid'
2
2
  import MutableProxy from '../../persistence/json.js'
3
3
 
4
- export default function(scope='[]', user, domain, { keyToSubscriptionId, watchers, states, create, environment, lastMessageResponse, lastInteractionResponse, tagIfNotYetTaggedInSession, interact }) {
4
+ export default function(scope='[]', user, domain, { keyToSubscriptionId, watchers, states, create, environment, lastMessageResponse, lastInteractionResponse, tagIfNotYetTaggedInSession, interact, log }) {
5
5
  let resolveMetadataPromise
6
6
  let metadataPromise = new Promise(resolve => resolveMetadataPromise = resolve)
7
7
 
@@ -27,10 +27,14 @@ export default function(scope='[]', user, domain, { keyToSubscriptionId, watcher
27
27
  })
28
28
  }
29
29
 
30
+ log('AWAITING LAST INTERACTION', qualifiedScope)
30
31
  await lastInteractionResponse[qualifiedScope]
32
+ log('GOT LAST INTERACTION', qualifiedScope)
31
33
 
32
34
  try {
35
+ log('GETTING STATE FOR', qualifiedScope)
33
36
  const data = structuredClone(await states[qualifiedScope])
37
+ log('GOT STATE FOR', qualifiedScope)
34
38
  const active = data.active
35
39
  delete data.active
36
40
  resolveMetadataPromise(data)
package/deno.js CHANGED
@@ -26,6 +26,8 @@ const agent = new Agent({
26
26
  token: () => AGENT_TOKEN,
27
27
  uuid: () => crypto.randomUUID(),
28
28
  async log() {
29
+ await new Promise(r => r()) // so we can access our own agent instance
30
+
29
31
  const { session } = await agent.environment()
30
32
  let value
31
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.9.102",
3
+ "version": "0.9.104",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",