@dxos/functions-testing 0.8.4-main.d05539e30a → 0.8.4-main.d9fc60f731

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/functions-testing",
3
- "version": "0.8.4-main.d05539e30a",
3
+ "version": "0.8.4-main.d9fc60f731",
4
4
  "description": "Functions tests",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -30,23 +30,24 @@
30
30
  "src"
31
31
  ],
32
32
  "dependencies": {
33
- "@effect/platform": "0.94.4",
34
- "@dxos/assistant-toolkit": "0.8.4-main.d05539e30a",
35
- "@dxos/async": "0.8.4-main.d05539e30a",
36
- "@dxos/client": "0.8.4-main.d05539e30a",
37
- "@dxos/compute": "0.8.4-main.d05539e30a",
38
- "@dxos/config": "0.8.4-main.d05539e30a",
39
- "@dxos/context": "0.8.4-main.d05539e30a",
40
- "@dxos/echo": "0.8.4-main.d05539e30a",
41
- "@dxos/functions": "0.8.4-main.d05539e30a",
42
- "@dxos/functions-runtime": "0.8.4-main.d05539e30a",
43
- "@dxos/functions-runtime-cloudflare": "0.8.4-main.d05539e30a",
44
- "@dxos/log": "0.8.4-main.d05539e30a",
45
- "@dxos/invariant": "0.8.4-main.d05539e30a",
46
- "@dxos/operation": "0.8.4-main.d05539e30a",
47
- "@dxos/protocols": "0.8.4-main.d05539e30a",
48
- "@dxos/schema": "0.8.4-main.d05539e30a",
49
- "@dxos/util": "0.8.4-main.d05539e30a"
33
+ "@effect/platform": "0.96.1",
34
+ "@dxos/async": "0.8.4-main.d9fc60f731",
35
+ "@dxos/assistant-toolkit": "0.8.4-main.d9fc60f731",
36
+ "@dxos/client": "0.8.4-main.d9fc60f731",
37
+ "@dxos/compute": "0.8.4-main.d9fc60f731",
38
+ "@dxos/echo": "0.8.4-main.d9fc60f731",
39
+ "@dxos/config": "0.8.4-main.d9fc60f731",
40
+ "@dxos/context": "0.8.4-main.d9fc60f731",
41
+ "@dxos/invariant": "0.8.4-main.d9fc60f731",
42
+ "@dxos/functions": "0.8.4-main.d9fc60f731",
43
+ "@dxos/log": "0.8.4-main.d9fc60f731",
44
+ "@dxos/functions-runtime": "0.8.4-main.d9fc60f731",
45
+ "@dxos/functions-runtime-cloudflare": "0.8.4-main.d9fc60f731",
46
+ "@dxos/keys": "0.8.4-main.d9fc60f731",
47
+ "@dxos/util": "0.8.4-main.d9fc60f731",
48
+ "@dxos/protocols": "0.8.4-main.d9fc60f731",
49
+ "@dxos/operation": "0.8.4-main.d9fc60f731",
50
+ "@dxos/schema": "0.8.4-main.d9fc60f731"
50
51
  },
51
52
  "publishConfig": {
52
53
  "access": "public"
@@ -10,7 +10,7 @@ import { Client } from '@dxos/client';
10
10
  import { Blueprint, Operation, Routine, Trigger } from '@dxos/compute';
11
11
  import { configPreset } from '@dxos/config';
12
12
  import { Context } from '@dxos/context';
13
- import { Feed, Obj, Ref } from '@dxos/echo';
13
+ import { Feed, Obj, Ref, Type } from '@dxos/echo';
14
14
  import { TestSchema } from '@dxos/echo/testing';
15
15
  import { dbg, log } from '@dxos/log';
16
16
  import { ErrorCodec } from '@dxos/protocols';
@@ -66,7 +66,7 @@ describe('Edge routine', { tags: ['functions-e2e'] }, () => {
66
66
  name: 'edge-e2e-count-orgs-db-blueprint',
67
67
  instructions: trim`
68
68
  You have access to the Database blueprint tools.
69
- Use the Query tool exactly once with typename "${TestSchema.Organization.typename}" and no other arguments.
69
+ Use the Query tool exactly once with typename "${Type.getTypename(TestSchema.Organization)}" and no other arguments.
70
70
  Then call completeJob with the output object { "count": <number of rows returned by Query> }.
71
71
  If you are unable to query -- fail.
72
72
  Do not list schemas first.
@@ -6,10 +6,11 @@ import * as Schema from 'effect/Schema';
6
6
 
7
7
  import { Operation } from '@dxos/compute';
8
8
  import { Database } from '@dxos/echo';
9
+ import { DXN } from '@dxos/keys';
9
10
 
10
11
  export const Fibonacci = Operation.make({
11
12
  meta: {
12
- key: 'org.example.function.fib',
13
+ key: DXN.make('org.example.function.fib'),
13
14
  name: 'Fibonacci',
14
15
  description: 'Function that calculates a Fibonacci number',
15
16
  },
@@ -26,7 +27,7 @@ export const Fibonacci = Operation.make({
26
27
 
27
28
  export const Reply = Operation.make({
28
29
  meta: {
29
- key: 'org.example.function.reply',
30
+ key: DXN.make('org.example.function.reply'),
30
31
  name: 'Reply',
31
32
  description: 'Function that echoes the input',
32
33
  },
@@ -36,7 +37,7 @@ export const Reply = Operation.make({
36
37
 
37
38
  export const Sleep = Operation.make({
38
39
  meta: {
39
- key: 'org.example.function.sleep',
40
+ key: DXN.make('org.example.function.sleep'),
40
41
  name: 'Sleep',
41
42
  description: 'Function that sleeps for a given amount of time',
42
43
  },
@@ -51,7 +52,7 @@ export const Sleep = Operation.make({
51
52
 
52
53
  export const QueryDb = Operation.make({
53
54
  meta: {
54
- key: 'org.example.function.query',
55
+ key: DXN.make('org.example.function.query'),
55
56
  name: 'Query',
56
57
  description: 'Queries the database',
57
58
  },
@@ -11,10 +11,11 @@ import * as Schedule from 'effect/Schedule';
11
11
  import * as Schema from 'effect/Schema';
12
12
 
13
13
  import { Operation } from '@dxos/compute';
14
+ import { DXN } from '@dxos/keys';
14
15
 
15
16
  const ForexEffect = Operation.make({
16
17
  meta: {
17
- key: 'org.dxos.script.forex-effect',
18
+ key: DXN.make('org.dxos.script.forexEffect'),
18
19
  name: 'Forex Effect',
19
20
  description: 'Returns the exchange rate between two currencies.',
20
21
  },
@@ -84,8 +84,10 @@ export const observeInvocations = async (space: Space, maxCount: number | null)
84
84
  while (true) {
85
85
  try {
86
86
  const traceFeed = space.properties.invocationTraceFeed?.target;
87
- const traceFeedDXN = traceFeed ? Feed.getQueueDxn(traceFeed) : undefined;
88
- const invocations = traceFeedDXN ? ((await space.queues.get(traceFeedDXN).queryObjects()) ?? []) : [];
87
+ const traceFeedDXN = traceFeed ? Feed.getQueueUri(traceFeed) : undefined;
88
+ const invocations = traceFeedDXN
89
+ ? ((await space.queues.get(traceFeedDXN, { subspaceTag: traceFeed!.namespace }).queryObjects()) ?? [])
90
+ : [];
89
91
 
90
92
  for (const invocation of invocations) {
91
93
  if (Obj.instanceOf(InvocationTraceStartEvent, invocation)) {