@dxos/functions 0.9.1-main.c7dcc2e112 → 0.9.1-staging.ee54ba693a

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",
3
- "version": "0.9.1-main.c7dcc2e112",
3
+ "version": "0.9.1-staging.ee54ba693a",
4
4
  "description": "Functions API.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -28,22 +28,22 @@
28
28
  "dependencies": {
29
29
  "@effect-atom/atom": "^0.5.3",
30
30
  "@effect/ai-anthropic": "0.26.0",
31
- "@effect/platform": "0.96.1",
32
- "effect": "3.21.3",
33
- "@dxos/ai": "0.9.1-main.c7dcc2e112",
34
- "@dxos/compute": "0.9.1-main.c7dcc2e112",
35
- "@dxos/echo": "0.9.1-main.c7dcc2e112",
36
- "@dxos/echo-client": "0.9.1-main.c7dcc2e112",
37
- "@dxos/effect": "0.9.1-main.c7dcc2e112",
38
- "@dxos/errors": "0.9.1-main.c7dcc2e112",
39
- "@dxos/invariant": "0.9.1-main.c7dcc2e112",
40
- "@dxos/keys": "0.9.1-main.c7dcc2e112",
41
- "@dxos/context": "0.9.1-main.c7dcc2e112",
42
- "@dxos/log": "0.9.1-main.c7dcc2e112",
43
- "@dxos/node-std": "0.9.1-main.c7dcc2e112",
44
- "@dxos/protocols": "0.9.1-main.c7dcc2e112",
45
- "@dxos/schema": "0.9.1-main.c7dcc2e112",
46
- "@dxos/types": "0.9.1-main.c7dcc2e112"
31
+ "@effect/platform": "0.96.2",
32
+ "effect": "3.21.4",
33
+ "@dxos/ai": "0.9.1-staging.ee54ba693a",
34
+ "@dxos/context": "0.9.1-staging.ee54ba693a",
35
+ "@dxos/compute": "0.9.1-staging.ee54ba693a",
36
+ "@dxos/echo": "0.9.1-staging.ee54ba693a",
37
+ "@dxos/echo-client": "0.9.1-staging.ee54ba693a",
38
+ "@dxos/effect": "0.9.1-staging.ee54ba693a",
39
+ "@dxos/errors": "0.9.1-staging.ee54ba693a",
40
+ "@dxos/keys": "0.9.1-staging.ee54ba693a",
41
+ "@dxos/node-std": "0.9.1-staging.ee54ba693a",
42
+ "@dxos/log": "0.9.1-staging.ee54ba693a",
43
+ "@dxos/protocols": "0.9.1-staging.ee54ba693a",
44
+ "@dxos/schema": "0.9.1-staging.ee54ba693a",
45
+ "@dxos/types": "0.9.1-staging.ee54ba693a",
46
+ "@dxos/invariant": "0.9.1-staging.ee54ba693a"
47
47
  },
48
48
  "publishConfig": {
49
49
  "access": "public"
@@ -19,8 +19,8 @@ import {
19
19
  Trace,
20
20
  } from '@dxos/compute';
21
21
  import { LifecycleState, Resource } from '@dxos/context';
22
- import { Database, Feed, JsonSchema, Ref, Registry, type Type } from '@dxos/echo';
23
- import { createFeedServiceLayer, EchoClient, type DatabaseImpl, makeRegistry } from '@dxos/echo-client';
22
+ import { Database, JsonSchema, Ref, Registry, type Type } from '@dxos/echo';
23
+ import { type DatabaseImpl, EchoClient, makeRegistry } from '@dxos/echo-client';
24
24
  import { refFromEncodedReference } from '@dxos/echo/internal';
25
25
  import { EffectEx } from '@dxos/effect';
26
26
  import { assertState, failedInvariant, invariant } from '@dxos/invariant';
@@ -29,7 +29,7 @@ import { log } from '@dxos/log';
29
29
  import { EdgeFunctionEnv, ErrorCodec, type FunctionProtocol, type TraceProtocol } from '@dxos/protocols';
30
30
 
31
31
  import { type FunctionServices } from '../sdk';
32
- import { configuredCredentialsLayer, credentialsLayerFromDatabase, FunctionInvocationService } from '../services';
32
+ import { FunctionInvocationService, configuredCredentialsLayer, credentialsLayerFromDatabase } from '../services';
33
33
  import { FunctionsAiHttpClient } from './functions-ai-http-client';
34
34
 
35
35
  export interface FunctionWrappingOptions {
@@ -68,7 +68,7 @@ export const wrapFunctionHandler = (
68
68
  },
69
69
  handler: async ({ data, context }) => {
70
70
  if (
71
- (serviceTags.includes(Database.Service.key) || serviceTags.includes(Feed.FeedService.key)) &&
71
+ serviceTags.includes(Database.Service.key) &&
72
72
  (!context.services.dataService || !context.services.queryService)
73
73
  ) {
74
74
  throw new FunctionError({
@@ -192,7 +192,6 @@ class FunctionContext extends Resource {
192
192
  assertState(this._lifecycleState === LifecycleState.OPEN, 'FunctionContext is not open');
193
193
 
194
194
  const dbLayer = this.db ? Database.layer(this.db) : Database.notAvailable;
195
- const feedLayer = this.db ? createFeedServiceLayer(this.db) : Feed.notAvailable;
196
195
  const credentials = dbLayer
197
196
  ? credentialsLayerFromDatabase({ caching: true }).pipe(Layer.provide(dbLayer))
198
197
  : configuredCredentialsLayer([]);
@@ -225,7 +224,6 @@ class FunctionContext extends Resource {
225
224
 
226
225
  return Layer.mergeAll(
227
226
  dbLayer,
228
- feedLayer,
229
227
  credentials,
230
228
  operationServiceLayer,
231
229
  aiLayer,
@@ -291,7 +289,7 @@ const makeOperationServiceLayer = (
291
289
  const result = await functionsService.invoke(op.meta.deployedId, input, {
292
290
  spaceId: options?.spaceId,
293
291
  // Forward the conversation DXN so the remote runtime can rebuild conversation-scoped
294
- // services (e.g. `AiContext.Service`) needed by operations like `GetContext`.
292
+ // services (e.g. `HarnessService`) needed by operations like `GetContext`.
295
293
  conversation: options?.conversation,
296
294
  });
297
295
  if (result._kind === 'success') {
package/src/sdk.ts CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { type AiService } from '@dxos/ai';
6
6
  import { type Credential, type Operation, type Trace } from '@dxos/compute';
7
- import { type Database, type Feed } from '@dxos/echo';
7
+ import { type Database } from '@dxos/echo';
8
8
 
9
9
  import { type FunctionInvocationService } from './services';
10
10
 
@@ -21,7 +21,6 @@ export type FunctionServices =
21
21
  | AiService.AiService
22
22
  | Credential.CredentialsService
23
23
  | Database.Service
24
- | Feed.FeedService
25
24
  | Trace.TraceService
26
25
  // TODO(dmaretskyi): `FunctionInvocationService` is being phased out in favour of `Operation.Service`;
27
26
  // it's kept in the union until `functions-runtime/local-function-execution.ts` migrates.
@@ -89,6 +89,7 @@ export const credentialsLayerFromDatabase = ({ caching = false }: { caching?: bo
89
89
  .map((accessToken) => ({
90
90
  service: accessToken.source,
91
91
  apiKey: accessToken.token,
92
+ account: accessToken.account,
92
93
  }));
93
94
 
94
95
  if (caching) {