@agentshouse/mdruntime-adapter 0.1.0-c05dbdfc6acd9 → 0.1.0-c068fdf374af0

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/dist/discovery.js CHANGED
@@ -2,6 +2,7 @@ import { declaredActions, houseConversationAgents, SITE_SUBMIT } from './actions
2
2
  import { readPosition, roomVersion } from './version.js';
3
3
  export const PROVIDER_ACTIONS = 'provider-actions';
4
4
  export const DISCOVER_PREFIXES = ['/'];
5
+ const PRIVATE_HANDLE = 'private';
5
6
  const BOUND_KEYS = [
6
7
  'max_authored_file_bytes',
7
8
  'max_batch_operations',
@@ -18,7 +19,7 @@ const BOUND_KEYS = [
18
19
  'operation_retention_seconds',
19
20
  ];
20
21
  const OPERATION_KEYS = ['write', 'delete'];
21
- const READ_LEVELS = ['mcp', 'online', 'local'];
22
+ const ACCESS_LEVELS = ['search', 'open', 'keep'];
22
23
  function stringList(value) {
23
24
  if (!Array.isArray(value))
24
25
  return null;
@@ -86,11 +87,11 @@ function parseAuthority(value) {
86
87
  const typedSelection = parseTypedSelection(held.typed_selection);
87
88
  const protectedPaths = stringList(held.protected_paths);
88
89
  const operations = parseOperations(held.operations);
89
- const read = READ_LEVELS.find((level) => level === held.read);
90
+ const level = ACCESS_LEVELS.find((one) => one === held.level);
90
91
  if (at === null ||
91
92
  typedSelection === undefined ||
92
93
  protectedPaths === null ||
93
- read === undefined ||
94
+ level === undefined ||
94
95
  operations === null)
95
96
  return null;
96
97
  if (typeof held.room_ref !== 'string' || held.room_ref.length === 0)
@@ -105,7 +106,7 @@ function parseAuthority(value) {
105
106
  typedSelection,
106
107
  managedReplication: held.managed_replication,
107
108
  protectedPaths,
108
- read,
109
+ level,
109
110
  operations,
110
111
  ...at,
111
112
  };
@@ -220,14 +221,12 @@ export function declaredRetention(bounds) {
220
221
  };
221
222
  }
222
223
  export function capabilities(actions, rooms) {
223
- const house = rooms.find((room) => room.typedSelection !== null);
224
+ const own = rooms.find((room) => room.handle === PRIVATE_HANDLE);
224
225
  return [
225
226
  {
226
227
  name: PROVIDER_ACTIONS,
227
228
  actions: declaredActions(actions),
228
- ...(house === undefined
229
- ? {}
230
- : { conversationAgents: houseConversationAgents(house.authority) }),
229
+ ...(own === undefined ? {} : { conversationAgents: houseConversationAgents(own.authority) }),
231
230
  },
232
231
  ];
233
232
  }
@@ -253,7 +252,7 @@ export function discoveredRoom(authority) {
253
252
  replica: {
254
253
  selection: locator,
255
254
  admission: authority.managedReplication,
256
- offline: authority.read === 'online' ? 'locked' : 'open',
255
+ offline: authority.level === 'open' ? 'locked' : 'open',
257
256
  },
258
257
  ...(authority.typedSelection === null
259
258
  ? {}
package/dist/gather.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export declare function gatheredEach<A, R>(send: (asks: readonly A[], answer: (ask: number, result: R) => void) => Promise<void>): (ask: A) => Promise<R>;
2
1
  export declare function gathered<A, R>(send: (asks: readonly A[]) => Promise<readonly R[]>): (ask: A) => Promise<R>;
3
2
  export declare function selections<T>(items: readonly T[], limit: number): readonly (readonly T[])[];
4
3
  //# sourceMappingURL=gather.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gather.d.ts","sourceRoot":"","sources":["../src/gather.ts"],"names":[],"mappings":"AAMA,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAC/B,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,GACpF,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAwBxB;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAC3B,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,KAAK,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,GAClD,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAMxB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAO3F"}
1
+ {"version":3,"file":"gather.d.ts","sourceRoot":"","sources":["../src/gather.ts"],"names":[],"mappings":"AAkCA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAC3B,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,KAAK,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,GAClD,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAMxB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAO3F"}
package/dist/gather.js CHANGED
@@ -1,4 +1,4 @@
1
- export function gatheredEach(send) {
1
+ function gatheredEach(send) {
2
2
  let held = [];
3
3
  function flush() {
4
4
  const taken = held;