@coasys/ad4m 0.10.1-rc3 → 0.10.1-rc5

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/lib/index.cjs CHANGED
@@ -5083,6 +5083,9 @@ class PerspectiveProxy {
5083
5083
  getNeighbourhoodProxy() {
5084
5084
  return __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").getNeighbourhoodProxy(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid);
5085
5085
  }
5086
+ get ai() {
5087
+ return __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").aiClient;
5088
+ }
5086
5089
  }
5087
5090
  _PerspectiveProxy_handle = new WeakMap(), _PerspectiveProxy_client = new WeakMap(), _PerspectiveProxy_perspectiveLinkAddedCallbacks = new WeakMap(), _PerspectiveProxy_perspectiveLinkRemovedCallbacks = new WeakMap(), _PerspectiveProxy_perspectiveLinkUpdatedCallbacks = new WeakMap(), _PerspectiveProxy_perspectiveSyncStateChangeCallbacks = new WeakMap();
5088
5091
 
@@ -5097,7 +5100,7 @@ var __classPrivateFieldGet$9 = (undefined && undefined.__classPrivateFieldGet) |
5097
5100
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5098
5101
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5099
5102
  };
5100
- var _PerspectiveClient_apolloClient, _PerspectiveClient_perspectiveAddedCallbacks, _PerspectiveClient_perspectiveUpdatedCallbacks, _PerspectiveClient_perspectiveRemovedCallbacks, _PerspectiveClient_perspectiveSyncStateChangeCallbacks, _PerspectiveClient_expressionClient, _PerspectiveClient_neighbourhoodClient;
5103
+ var _PerspectiveClient_apolloClient, _PerspectiveClient_perspectiveAddedCallbacks, _PerspectiveClient_perspectiveUpdatedCallbacks, _PerspectiveClient_perspectiveRemovedCallbacks, _PerspectiveClient_perspectiveSyncStateChangeCallbacks, _PerspectiveClient_expressionClient, _PerspectiveClient_neighbourhoodClient, _PerspectiveClient_aiClient;
5101
5104
  const LINK_EXPRESSION_FIELDS = `
5102
5105
  author
5103
5106
  timestamp
@@ -5135,6 +5138,7 @@ class PerspectiveClient {
5135
5138
  _PerspectiveClient_perspectiveSyncStateChangeCallbacks.set(this, void 0);
5136
5139
  _PerspectiveClient_expressionClient.set(this, void 0);
5137
5140
  _PerspectiveClient_neighbourhoodClient.set(this, void 0);
5141
+ _PerspectiveClient_aiClient.set(this, void 0);
5138
5142
  __classPrivateFieldSet$9(this, _PerspectiveClient_apolloClient, client, "f");
5139
5143
  __classPrivateFieldSet$9(this, _PerspectiveClient_perspectiveAddedCallbacks, [], "f");
5140
5144
  __classPrivateFieldSet$9(this, _PerspectiveClient_perspectiveUpdatedCallbacks, [], "f");
@@ -5152,6 +5156,12 @@ class PerspectiveClient {
5152
5156
  setNeighbourhoodClient(client) {
5153
5157
  __classPrivateFieldSet$9(this, _PerspectiveClient_neighbourhoodClient, client, "f");
5154
5158
  }
5159
+ setAIClient(client) {
5160
+ __classPrivateFieldSet$9(this, _PerspectiveClient_aiClient, client, "f");
5161
+ }
5162
+ get aiClient() {
5163
+ return __classPrivateFieldGet$9(this, _PerspectiveClient_aiClient, "f");
5164
+ }
5155
5165
  async all() {
5156
5166
  const { perspectives } = unwrapApolloResult(await __classPrivateFieldGet$9(this, _PerspectiveClient_apolloClient, "f").query({
5157
5167
  query: gql `query perspectives {
@@ -5523,7 +5533,7 @@ class PerspectiveClient {
5523
5533
  return new NeighbourhoodProxy(__classPrivateFieldGet$9(this, _PerspectiveClient_neighbourhoodClient, "f"), uuid);
5524
5534
  }
5525
5535
  }
5526
- _PerspectiveClient_apolloClient = new WeakMap(), _PerspectiveClient_perspectiveAddedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveUpdatedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveRemovedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveSyncStateChangeCallbacks = new WeakMap(), _PerspectiveClient_expressionClient = new WeakMap(), _PerspectiveClient_neighbourhoodClient = new WeakMap();
5536
+ _PerspectiveClient_apolloClient = new WeakMap(), _PerspectiveClient_perspectiveAddedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveUpdatedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveRemovedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveSyncStateChangeCallbacks = new WeakMap(), _PerspectiveClient_expressionClient = new WeakMap(), _PerspectiveClient_neighbourhoodClient = new WeakMap(), _PerspectiveClient_aiClient = new WeakMap();
5527
5537
 
5528
5538
  var __classPrivateFieldSet$8 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
5529
5539
  if (kind === "m") throw new TypeError("Private method is not writable");
@@ -14352,11 +14362,12 @@ class Ad4mClient {
14352
14362
  __classPrivateFieldSet$2(this, _Ad4mClient_expressionClient, new ExpressionClient(__classPrivateFieldGet$2(this, _Ad4mClient_apolloClient, "f")), "f");
14353
14363
  __classPrivateFieldSet$2(this, _Ad4mClient_languageClient, new LanguageClient(__classPrivateFieldGet$2(this, _Ad4mClient_apolloClient, "f")), "f");
14354
14364
  __classPrivateFieldSet$2(this, _Ad4mClient_neighbourhoodClient, new NeighbourhoodClient(__classPrivateFieldGet$2(this, _Ad4mClient_apolloClient, "f")), "f");
14365
+ __classPrivateFieldSet$2(this, _Ad4mClient_aiClient, new AIClient(__classPrivateFieldGet$2(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
14355
14366
  __classPrivateFieldSet$2(this, _Ad4mClient_perspectiveClient, new PerspectiveClient(__classPrivateFieldGet$2(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
14356
14367
  __classPrivateFieldGet$2(this, _Ad4mClient_perspectiveClient, "f").setExpressionClient(__classPrivateFieldGet$2(this, _Ad4mClient_expressionClient, "f"));
14357
14368
  __classPrivateFieldGet$2(this, _Ad4mClient_perspectiveClient, "f").setNeighbourhoodClient(__classPrivateFieldGet$2(this, _Ad4mClient_neighbourhoodClient, "f"));
14369
+ __classPrivateFieldGet$2(this, _Ad4mClient_perspectiveClient, "f").setAIClient(__classPrivateFieldGet$2(this, _Ad4mClient_aiClient, "f"));
14358
14370
  __classPrivateFieldSet$2(this, _Ad4mClient_runtimeClient, new RuntimeClient(__classPrivateFieldGet$2(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
14359
- __classPrivateFieldSet$2(this, _Ad4mClient_aiClient, new AIClient(__classPrivateFieldGet$2(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
14360
14371
  }
14361
14372
  get agent() {
14362
14373
  return __classPrivateFieldGet$2(this, _Ad4mClient_agentClient, "f");
package/lib/index.js CHANGED
@@ -5079,6 +5079,9 @@ class PerspectiveProxy {
5079
5079
  getNeighbourhoodProxy() {
5080
5080
  return __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").getNeighbourhoodProxy(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid);
5081
5081
  }
5082
+ get ai() {
5083
+ return __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").aiClient;
5084
+ }
5082
5085
  }
5083
5086
  _PerspectiveProxy_handle = new WeakMap(), _PerspectiveProxy_client = new WeakMap(), _PerspectiveProxy_perspectiveLinkAddedCallbacks = new WeakMap(), _PerspectiveProxy_perspectiveLinkRemovedCallbacks = new WeakMap(), _PerspectiveProxy_perspectiveLinkUpdatedCallbacks = new WeakMap(), _PerspectiveProxy_perspectiveSyncStateChangeCallbacks = new WeakMap();
5084
5087
 
@@ -5093,7 +5096,7 @@ var __classPrivateFieldGet$9 = (undefined && undefined.__classPrivateFieldGet) |
5093
5096
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5094
5097
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5095
5098
  };
5096
- var _PerspectiveClient_apolloClient, _PerspectiveClient_perspectiveAddedCallbacks, _PerspectiveClient_perspectiveUpdatedCallbacks, _PerspectiveClient_perspectiveRemovedCallbacks, _PerspectiveClient_perspectiveSyncStateChangeCallbacks, _PerspectiveClient_expressionClient, _PerspectiveClient_neighbourhoodClient;
5099
+ var _PerspectiveClient_apolloClient, _PerspectiveClient_perspectiveAddedCallbacks, _PerspectiveClient_perspectiveUpdatedCallbacks, _PerspectiveClient_perspectiveRemovedCallbacks, _PerspectiveClient_perspectiveSyncStateChangeCallbacks, _PerspectiveClient_expressionClient, _PerspectiveClient_neighbourhoodClient, _PerspectiveClient_aiClient;
5097
5100
  const LINK_EXPRESSION_FIELDS = `
5098
5101
  author
5099
5102
  timestamp
@@ -5131,6 +5134,7 @@ class PerspectiveClient {
5131
5134
  _PerspectiveClient_perspectiveSyncStateChangeCallbacks.set(this, void 0);
5132
5135
  _PerspectiveClient_expressionClient.set(this, void 0);
5133
5136
  _PerspectiveClient_neighbourhoodClient.set(this, void 0);
5137
+ _PerspectiveClient_aiClient.set(this, void 0);
5134
5138
  __classPrivateFieldSet$9(this, _PerspectiveClient_apolloClient, client, "f");
5135
5139
  __classPrivateFieldSet$9(this, _PerspectiveClient_perspectiveAddedCallbacks, [], "f");
5136
5140
  __classPrivateFieldSet$9(this, _PerspectiveClient_perspectiveUpdatedCallbacks, [], "f");
@@ -5148,6 +5152,12 @@ class PerspectiveClient {
5148
5152
  setNeighbourhoodClient(client) {
5149
5153
  __classPrivateFieldSet$9(this, _PerspectiveClient_neighbourhoodClient, client, "f");
5150
5154
  }
5155
+ setAIClient(client) {
5156
+ __classPrivateFieldSet$9(this, _PerspectiveClient_aiClient, client, "f");
5157
+ }
5158
+ get aiClient() {
5159
+ return __classPrivateFieldGet$9(this, _PerspectiveClient_aiClient, "f");
5160
+ }
5151
5161
  async all() {
5152
5162
  const { perspectives } = unwrapApolloResult(await __classPrivateFieldGet$9(this, _PerspectiveClient_apolloClient, "f").query({
5153
5163
  query: gql `query perspectives {
@@ -5519,7 +5529,7 @@ class PerspectiveClient {
5519
5529
  return new NeighbourhoodProxy(__classPrivateFieldGet$9(this, _PerspectiveClient_neighbourhoodClient, "f"), uuid);
5520
5530
  }
5521
5531
  }
5522
- _PerspectiveClient_apolloClient = new WeakMap(), _PerspectiveClient_perspectiveAddedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveUpdatedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveRemovedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveSyncStateChangeCallbacks = new WeakMap(), _PerspectiveClient_expressionClient = new WeakMap(), _PerspectiveClient_neighbourhoodClient = new WeakMap();
5532
+ _PerspectiveClient_apolloClient = new WeakMap(), _PerspectiveClient_perspectiveAddedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveUpdatedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveRemovedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveSyncStateChangeCallbacks = new WeakMap(), _PerspectiveClient_expressionClient = new WeakMap(), _PerspectiveClient_neighbourhoodClient = new WeakMap(), _PerspectiveClient_aiClient = new WeakMap();
5523
5533
 
5524
5534
  var __classPrivateFieldSet$8 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
5525
5535
  if (kind === "m") throw new TypeError("Private method is not writable");
@@ -14348,11 +14358,12 @@ class Ad4mClient {
14348
14358
  __classPrivateFieldSet$2(this, _Ad4mClient_expressionClient, new ExpressionClient(__classPrivateFieldGet$2(this, _Ad4mClient_apolloClient, "f")), "f");
14349
14359
  __classPrivateFieldSet$2(this, _Ad4mClient_languageClient, new LanguageClient(__classPrivateFieldGet$2(this, _Ad4mClient_apolloClient, "f")), "f");
14350
14360
  __classPrivateFieldSet$2(this, _Ad4mClient_neighbourhoodClient, new NeighbourhoodClient(__classPrivateFieldGet$2(this, _Ad4mClient_apolloClient, "f")), "f");
14361
+ __classPrivateFieldSet$2(this, _Ad4mClient_aiClient, new AIClient(__classPrivateFieldGet$2(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
14351
14362
  __classPrivateFieldSet$2(this, _Ad4mClient_perspectiveClient, new PerspectiveClient(__classPrivateFieldGet$2(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
14352
14363
  __classPrivateFieldGet$2(this, _Ad4mClient_perspectiveClient, "f").setExpressionClient(__classPrivateFieldGet$2(this, _Ad4mClient_expressionClient, "f"));
14353
14364
  __classPrivateFieldGet$2(this, _Ad4mClient_perspectiveClient, "f").setNeighbourhoodClient(__classPrivateFieldGet$2(this, _Ad4mClient_neighbourhoodClient, "f"));
14365
+ __classPrivateFieldGet$2(this, _Ad4mClient_perspectiveClient, "f").setAIClient(__classPrivateFieldGet$2(this, _Ad4mClient_aiClient, "f"));
14354
14366
  __classPrivateFieldSet$2(this, _Ad4mClient_runtimeClient, new RuntimeClient(__classPrivateFieldGet$2(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
14355
- __classPrivateFieldSet$2(this, _Ad4mClient_aiClient, new AIClient(__classPrivateFieldGet$2(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
14356
14367
  }
14357
14368
  get agent() {
14358
14369
  return __classPrivateFieldGet$2(this, _Ad4mClient_agentClient, "f");
@@ -41,11 +41,12 @@ export class Ad4mClient {
41
41
  __classPrivateFieldSet(this, _Ad4mClient_expressionClient, new ExpressionClient(__classPrivateFieldGet(this, _Ad4mClient_apolloClient, "f")), "f");
42
42
  __classPrivateFieldSet(this, _Ad4mClient_languageClient, new LanguageClient(__classPrivateFieldGet(this, _Ad4mClient_apolloClient, "f")), "f");
43
43
  __classPrivateFieldSet(this, _Ad4mClient_neighbourhoodClient, new NeighbourhoodClient(__classPrivateFieldGet(this, _Ad4mClient_apolloClient, "f")), "f");
44
+ __classPrivateFieldSet(this, _Ad4mClient_aiClient, new AIClient(__classPrivateFieldGet(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
44
45
  __classPrivateFieldSet(this, _Ad4mClient_perspectiveClient, new PerspectiveClient(__classPrivateFieldGet(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
45
46
  __classPrivateFieldGet(this, _Ad4mClient_perspectiveClient, "f").setExpressionClient(__classPrivateFieldGet(this, _Ad4mClient_expressionClient, "f"));
46
47
  __classPrivateFieldGet(this, _Ad4mClient_perspectiveClient, "f").setNeighbourhoodClient(__classPrivateFieldGet(this, _Ad4mClient_neighbourhoodClient, "f"));
48
+ __classPrivateFieldGet(this, _Ad4mClient_perspectiveClient, "f").setAIClient(__classPrivateFieldGet(this, _Ad4mClient_aiClient, "f"));
47
49
  __classPrivateFieldSet(this, _Ad4mClient_runtimeClient, new RuntimeClient(__classPrivateFieldGet(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
48
- __classPrivateFieldSet(this, _Ad4mClient_aiClient, new AIClient(__classPrivateFieldGet(this, _Ad4mClient_apolloClient, "f"), subscribe), "f");
49
50
  }
50
51
  get agent() {
51
52
  return __classPrivateFieldGet(this, _Ad4mClient_agentClient, "f");
@@ -8,6 +8,7 @@ import { LinkQuery } from "./LinkQuery";
8
8
  import { Perspective } from "./Perspective";
9
9
  import { PerspectiveHandle, PerspectiveState } from "./PerspectiveHandle";
10
10
  import { LinkStatus, PerspectiveProxy } from './PerspectiveProxy';
11
+ import { AIClient } from "../ai/AIClient";
11
12
  export type PerspectiveHandleCallback = (perspective: PerspectiveHandle) => null;
12
13
  export type UuidCallback = (uuid: string) => null;
13
14
  export type LinkCallback = (link: LinkExpression) => null;
@@ -17,6 +18,8 @@ export declare class PerspectiveClient {
17
18
  constructor(client: ApolloClient<any>, subscribe?: boolean);
18
19
  setExpressionClient(client: ExpressionClient): void;
19
20
  setNeighbourhoodClient(client: NeighbourhoodClient): void;
21
+ setAIClient(client: AIClient): void;
22
+ get aiClient(): AIClient;
20
23
  all(): Promise<PerspectiveProxy[]>;
21
24
  byUUID(uuid: string): Promise<PerspectiveProxy | null>;
22
25
  snapshotByUUID(uuid: string): Promise<Perspective | null>;
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
9
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
- var _PerspectiveClient_apolloClient, _PerspectiveClient_perspectiveAddedCallbacks, _PerspectiveClient_perspectiveUpdatedCallbacks, _PerspectiveClient_perspectiveRemovedCallbacks, _PerspectiveClient_perspectiveSyncStateChangeCallbacks, _PerspectiveClient_expressionClient, _PerspectiveClient_neighbourhoodClient;
12
+ var _PerspectiveClient_apolloClient, _PerspectiveClient_perspectiveAddedCallbacks, _PerspectiveClient_perspectiveUpdatedCallbacks, _PerspectiveClient_perspectiveRemovedCallbacks, _PerspectiveClient_perspectiveSyncStateChangeCallbacks, _PerspectiveClient_expressionClient, _PerspectiveClient_neighbourhoodClient, _PerspectiveClient_aiClient;
13
13
  import { gql } from "@apollo/client/core";
14
14
  import { NeighbourhoodProxy } from "../neighbourhood/NeighbourhoodProxy";
15
15
  import unwrapApolloResult from "../unwrapApolloResult";
@@ -51,6 +51,7 @@ export class PerspectiveClient {
51
51
  _PerspectiveClient_perspectiveSyncStateChangeCallbacks.set(this, void 0);
52
52
  _PerspectiveClient_expressionClient.set(this, void 0);
53
53
  _PerspectiveClient_neighbourhoodClient.set(this, void 0);
54
+ _PerspectiveClient_aiClient.set(this, void 0);
54
55
  __classPrivateFieldSet(this, _PerspectiveClient_apolloClient, client, "f");
55
56
  __classPrivateFieldSet(this, _PerspectiveClient_perspectiveAddedCallbacks, [], "f");
56
57
  __classPrivateFieldSet(this, _PerspectiveClient_perspectiveUpdatedCallbacks, [], "f");
@@ -68,6 +69,12 @@ export class PerspectiveClient {
68
69
  setNeighbourhoodClient(client) {
69
70
  __classPrivateFieldSet(this, _PerspectiveClient_neighbourhoodClient, client, "f");
70
71
  }
72
+ setAIClient(client) {
73
+ __classPrivateFieldSet(this, _PerspectiveClient_aiClient, client, "f");
74
+ }
75
+ get aiClient() {
76
+ return __classPrivateFieldGet(this, _PerspectiveClient_aiClient, "f");
77
+ }
71
78
  async all() {
72
79
  const { perspectives } = unwrapApolloResult(await __classPrivateFieldGet(this, _PerspectiveClient_apolloClient, "f").query({
73
80
  query: gql `query perspectives {
@@ -439,4 +446,4 @@ export class PerspectiveClient {
439
446
  return new NeighbourhoodProxy(__classPrivateFieldGet(this, _PerspectiveClient_neighbourhoodClient, "f"), uuid);
440
447
  }
441
448
  }
442
- _PerspectiveClient_apolloClient = new WeakMap(), _PerspectiveClient_perspectiveAddedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveUpdatedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveRemovedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveSyncStateChangeCallbacks = new WeakMap(), _PerspectiveClient_expressionClient = new WeakMap(), _PerspectiveClient_neighbourhoodClient = new WeakMap();
449
+ _PerspectiveClient_apolloClient = new WeakMap(), _PerspectiveClient_perspectiveAddedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveUpdatedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveRemovedCallbacks = new WeakMap(), _PerspectiveClient_perspectiveSyncStateChangeCallbacks = new WeakMap(), _PerspectiveClient_expressionClient = new WeakMap(), _PerspectiveClient_neighbourhoodClient = new WeakMap(), _PerspectiveClient_aiClient = new WeakMap();
@@ -6,6 +6,7 @@ import { Perspective } from "./Perspective";
6
6
  import { ExpressionRendered } from "../expression/Expression";
7
7
  import { NeighbourhoodProxy } from "../neighbourhood/NeighbourhoodProxy";
8
8
  import { NeighbourhoodExpression } from "../neighbourhood/Neighbourhood";
9
+ import { AIClient } from "../ai/AIClient";
9
10
  type PerspectiveListenerTypes = "link-added" | "link-removed" | "link-updated";
10
11
  export type LinkStatus = "shared" | "local";
11
12
  interface Parameter {
@@ -181,5 +182,6 @@ export declare class PerspectiveProxy {
181
182
  */
182
183
  ensureSDNASubjectClass(jsClass: any): Promise<void>;
183
184
  getNeighbourhoodProxy(): NeighbourhoodProxy;
185
+ get ai(): AIClient;
184
186
  }
185
187
  export {};
@@ -490,5 +490,8 @@ export class PerspectiveProxy {
490
490
  getNeighbourhoodProxy() {
491
491
  return __classPrivateFieldGet(this, _PerspectiveProxy_client, "f").getNeighbourhoodProxy(__classPrivateFieldGet(this, _PerspectiveProxy_handle, "f").uuid);
492
492
  }
493
+ get ai() {
494
+ return __classPrivateFieldGet(this, _PerspectiveProxy_client, "f").aiClient;
495
+ }
493
496
  }
494
497
  _PerspectiveProxy_handle = new WeakMap(), _PerspectiveProxy_client = new WeakMap(), _PerspectiveProxy_perspectiveLinkAddedCallbacks = new WeakMap(), _PerspectiveProxy_perspectiveLinkRemovedCallbacks = new WeakMap(), _PerspectiveProxy_perspectiveLinkUpdatedCallbacks = new WeakMap(), _PerspectiveProxy_perspectiveSyncStateChangeCallbacks = new WeakMap();
package/package.json CHANGED
@@ -64,10 +64,10 @@
64
64
  "react-dom": "*"
65
65
  },
66
66
  "patchedDependencies": {},
67
- "version": "0.10.1-rc3",
68
67
  "pnpm": {
69
68
  "patchedDependencies": {
70
69
  "graphql@15.7.2": "patches/graphql@15.7.2.patch"
71
70
  }
72
- }
71
+ },
72
+ "version": "0.10.1-rc5"
73
73
  }
package/src/Ad4mClient.ts CHANGED
@@ -33,11 +33,13 @@ export class Ad4mClient {
33
33
  this.#expressionClient = new ExpressionClient(this.#apolloClient)
34
34
  this.#languageClient = new LanguageClient(this.#apolloClient)
35
35
  this.#neighbourhoodClient = new NeighbourhoodClient(this.#apolloClient)
36
+ this.#aiClient = new AIClient(this.#apolloClient, subscribe)
36
37
  this.#perspectiveClient = new PerspectiveClient(this.#apolloClient, subscribe)
37
38
  this.#perspectiveClient.setExpressionClient(this.#expressionClient)
38
39
  this.#perspectiveClient.setNeighbourhoodClient(this.#neighbourhoodClient)
40
+ this.#perspectiveClient.setAIClient(this.#aiClient)
39
41
  this.#runtimeClient = new RuntimeClient(this.#apolloClient, subscribe)
40
- this.#aiClient = new AIClient(this.#apolloClient, subscribe)
42
+
41
43
  }
42
44
 
43
45
  get agent(): AgentClient {
@@ -9,6 +9,7 @@ import { LinkQuery } from "./LinkQuery";
9
9
  import { Perspective } from "./Perspective";
10
10
  import { PerspectiveHandle, PerspectiveState } from "./PerspectiveHandle";
11
11
  import { LinkStatus, PerspectiveProxy } from './PerspectiveProxy';
12
+ import { AIClient } from "../ai/AIClient";
12
13
 
13
14
  const LINK_EXPRESSION_FIELDS = `
14
15
  author
@@ -53,6 +54,7 @@ export class PerspectiveClient {
53
54
  #perspectiveSyncStateChangeCallbacks: SyncStateChangeCallback[]
54
55
  #expressionClient?: ExpressionClient
55
56
  #neighbourhoodClient?: NeighbourhoodClient
57
+ #aiClient?: AIClient
56
58
 
57
59
  constructor(client: ApolloClient<any>, subscribe: boolean = true) {
58
60
  this.#apolloClient = client
@@ -76,6 +78,14 @@ export class PerspectiveClient {
76
78
  this.#neighbourhoodClient = client
77
79
  }
78
80
 
81
+ setAIClient(client: AIClient) {
82
+ this.#aiClient = client
83
+ }
84
+
85
+ get aiClient(): AIClient {
86
+ return this.#aiClient
87
+ }
88
+
79
89
  async all(): Promise<PerspectiveProxy[]> {
80
90
  const { perspectives } = unwrapApolloResult(await this.#apolloClient.query({
81
91
  query: gql`query perspectives {
@@ -9,6 +9,7 @@ import { ExpressionRendered } from "../expression/Expression";
9
9
  import { collectionAdderToName, collectionRemoverToName, collectionSetterToName } from "../subject/util";
10
10
  import { NeighbourhoodProxy } from "../neighbourhood/NeighbourhoodProxy";
11
11
  import { NeighbourhoodExpression } from "../neighbourhood/Neighbourhood";
12
+ import { AIClient } from "../ai/AIClient";
12
13
 
13
14
  type PerspectiveListenerTypes = "link-added" | "link-removed" | "link-updated"
14
15
 
@@ -571,4 +572,8 @@ export class PerspectiveProxy {
571
572
  return this.#client.getNeighbourhoodProxy(this.#handle.uuid)
572
573
  }
573
574
 
575
+ get ai(): AIClient {
576
+ return this.#client.aiClient
577
+ }
578
+
574
579
  }