maka-agent 0.2.0-dev.14.20260902 → 0.2.0-dev.16.20260903

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.
Files changed (160) hide show
  1. package/dist/cli-core.js +0 -1
  2. package/dist/pi-transcript.js +48 -0
  3. package/dist/pi-tui-form-interaction.js +497 -0
  4. package/dist/pi-tui-pickers.js +256 -55
  5. package/dist/pi-tui-runner.js +215 -12
  6. package/dist/runtime-host-cli.js +17 -42
  7. package/dist/runtime-host-lifecycle-transaction.js +31 -13
  8. package/dist/runtime-host-managed-lifecycle-manager.js +1 -1
  9. package/dist/runtime-host-onboarding.js +3 -1
  10. package/dist/runtime-host-openrc-service.js +469 -0
  11. package/dist/runtime-host-run-command.js +6 -2
  12. package/dist/runtime-host-service-command.js +3 -3
  13. package/dist/runtime-host-service-management-command.js +43 -15
  14. package/dist/runtime-host-session-channel.js +3 -0
  15. package/dist/runtime-host-session-driver.js +21 -6
  16. package/dist/runtime-host-setup-command.js +30 -31
  17. package/dist/tui-context-refresh.js +103 -0
  18. package/dist/tui-copy-catalog.js +73 -0
  19. package/native/runtime-host-peer/prebuilds/darwin-arm64/maka_runtime_host_peer.node +0 -0
  20. package/native/runtime-host-peer/prebuilds/linux-arm64/maka_runtime_host_peer.node +0 -0
  21. package/native/runtime-host-peer/prebuilds/linux-x64/maka_runtime_host_peer.node +0 -0
  22. package/native/runtime-host-peer/prebuilds/win32-x64/maka_runtime_host_peer.node +0 -0
  23. package/node_modules/@maka/core/dist/chat-model-choice.js +4 -0
  24. package/node_modules/@maka/core/dist/computer-use.js +27 -92
  25. package/node_modules/@maka/core/dist/interaction.js +577 -3
  26. package/node_modules/@maka/core/dist/llm-connections.js +4 -0
  27. package/node_modules/@maka/core/dist/local-memory.js +2 -2
  28. package/node_modules/@maka/core/dist/model-call-usage-projection.js +3 -0
  29. package/node_modules/@maka/core/dist/model-metadata.js +26 -7
  30. package/node_modules/@maka/core/dist/model-thinking.js +17 -0
  31. package/node_modules/@maka/core/dist/provider-registry.js +1 -0
  32. package/node_modules/@maka/core/dist/runtime-event.js +23 -1
  33. package/node_modules/@maka/core/dist/scheduled-task.js +4 -0
  34. package/node_modules/@maka/core/dist/session.js +95 -2
  35. package/node_modules/@maka/core/dist/text-sanitize.js +19 -0
  36. package/node_modules/@maka/core/dist/usage-ledger-merge.js +3 -0
  37. package/node_modules/@maka/core/dist/usage-record-schema.js +11 -5
  38. package/node_modules/@maka/core/dist/workhub-creation-intent.js +75 -9
  39. package/node_modules/@maka/core/dist/workhub-session-resolver.js +50 -0
  40. package/node_modules/@maka/core/package.json +2 -0
  41. package/node_modules/@maka/eval/dist/harbor-external-subject.js +2 -1
  42. package/node_modules/@maka/eval/dist/harness-executor.js +3 -2
  43. package/node_modules/@maka/eval/dist/install-preflight.js +39 -10
  44. package/node_modules/@maka/eval/dist/process-termination.js +83 -0
  45. package/node_modules/@maka/mcp/dist/sep-2243.js +3 -3
  46. package/node_modules/@maka/runtime/dist/agent-run.js +6 -3
  47. package/node_modules/@maka/runtime/dist/ai-sdk-backend.js +332 -118
  48. package/node_modules/@maka/runtime/dist/ai-sdk-compaction-contract.js +6 -1
  49. package/node_modules/@maka/runtime/dist/ai-sdk-compaction.js +171 -341
  50. package/node_modules/@maka/runtime/dist/bots/telegram-bridge.js +3 -26
  51. package/node_modules/@maka/runtime/dist/bundled-skill-catalog.generated.js +1 -1
  52. package/node_modules/@maka/runtime/dist/computer-use-codec.js +1 -141
  53. package/node_modules/@maka/runtime/dist/computer-use-tools.js +23 -105
  54. package/node_modules/@maka/runtime/dist/context-budget-policy.js +20 -26
  55. package/node_modules/@maka/runtime/dist/context-budget.js +18 -20
  56. package/node_modules/@maka/runtime/dist/conversation-copy.js +23 -19
  57. package/node_modules/@maka/runtime/dist/cua-frame-state.js +1 -69
  58. package/node_modules/@maka/runtime/dist/github-copilot-oauth-enrollment.js +267 -0
  59. package/node_modules/@maka/runtime/dist/history-compact-checkpoint.js +6 -9
  60. package/node_modules/@maka/runtime/dist/history-compact-summarizer.js +67 -23
  61. package/node_modules/@maka/runtime/dist/history-compact-summary-validation.js +11 -18
  62. package/node_modules/@maka/runtime/dist/history-compaction.js +66 -73
  63. package/node_modules/@maka/runtime/dist/interaction-authority.js +69 -0
  64. package/node_modules/@maka/runtime/dist/mcp-tools.js +13 -1
  65. package/node_modules/@maka/runtime/dist/memory-extraction.js +11 -11
  66. package/node_modules/@maka/runtime/dist/model-adapter.js +24 -6
  67. package/node_modules/@maka/runtime/dist/model-factory.js +14 -5
  68. package/node_modules/@maka/runtime/dist/oauth-provider-contracts.js +28 -1
  69. package/node_modules/@maka/runtime/dist/openai-codex-history-compactor.js +7 -6
  70. package/node_modules/@maka/runtime/dist/opencode-session-header.js +29 -0
  71. package/node_modules/@maka/runtime/dist/runtime-event-read-model.js +11 -1
  72. package/node_modules/@maka/runtime/dist/runtime-kernel.js +12 -11
  73. package/node_modules/@maka/runtime/dist/runtime-read-model.js +51 -13
  74. package/node_modules/@maka/runtime/dist/scheduled-task-tools.js +3 -0
  75. package/node_modules/@maka/runtime/dist/session-event-runtime-mapper.js +26 -0
  76. package/node_modules/@maka/runtime/dist/session-manager.js +1 -0
  77. package/node_modules/@maka/runtime/dist/session-projection-helpers.js +16 -1
  78. package/node_modules/@maka/runtime/dist/stream-graph-projection.js +6 -0
  79. package/node_modules/@maka/runtime/dist/stream-graph-read-model.js +5 -0
  80. package/node_modules/@maka/runtime/dist/stream-usage-fallback-fetch.js +74 -0
  81. package/node_modules/@maka/runtime/dist/subscription-credentials.js +51 -4
  82. package/node_modules/@maka/runtime/dist/subscription-model-fetch.js +47 -3
  83. package/node_modules/@maka/runtime/dist/system-prompt/main-session-prompt.js +20 -1
  84. package/node_modules/@maka/runtime/dist/test-connection.js +18 -11
  85. package/node_modules/@maka/runtime/dist/tool-runtime.js +183 -0
  86. package/node_modules/@maka/runtime/package.json +1 -0
  87. package/node_modules/@maka/runtime-host/dist/adapter/session-projector.js +14 -0
  88. package/node_modules/@maka/runtime-host/dist/client/client-capability-channel.js +84 -1
  89. package/node_modules/@maka/runtime-host/dist/client/host-profile.js +68 -51
  90. package/node_modules/@maka/runtime-host/dist/client/index.js +1 -1
  91. package/node_modules/@maka/runtime-host/dist/client/owner-connection-code.js +8 -5
  92. package/node_modules/@maka/runtime-host/dist/client/peer-client.js +342 -36
  93. package/node_modules/@maka/runtime-host/dist/client/reconnect-lifecycle.js +60 -4
  94. package/node_modules/@maka/runtime-host/dist/peer-mesh/index.js +3 -3
  95. package/node_modules/@maka/runtime-host/dist/peer-mesh/limits.js +1 -1
  96. package/node_modules/@maka/runtime-host/dist/peer-mesh/model.js +48 -60
  97. package/node_modules/@maka/runtime-host/dist/peer-mesh/node.js +847 -431
  98. package/node_modules/@maka/runtime-host/dist/peer-mesh/owner.js +33 -74
  99. package/node_modules/@maka/runtime-host/dist/peer-mesh/store.js +82 -69
  100. package/node_modules/@maka/runtime-host/dist/peer-reachability/index.js +21 -0
  101. package/node_modules/@maka/runtime-host/dist/peer-reachability/model.js +202 -0
  102. package/node_modules/@maka/runtime-host/dist/peer-reachability/owner.js +119 -0
  103. package/node_modules/@maka/runtime-host/dist/peer-reachability/publisher.js +245 -0
  104. package/node_modules/@maka/runtime-host/dist/protocol/agent-graph.js +4 -1
  105. package/node_modules/@maka/runtime-host/dist/protocol/client-capability.js +68 -0
  106. package/node_modules/@maka/runtime-host/dist/protocol/connection-effects.js +15 -8
  107. package/node_modules/@maka/runtime-host/dist/protocol/host-status.js +7 -23
  108. package/node_modules/@maka/runtime-host/dist/protocol/index.js +47 -1
  109. package/node_modules/@maka/runtime-host/dist/protocol/oauth.js +25 -1
  110. package/node_modules/@maka/runtime-host/dist/protocol/operations.js +1 -0
  111. package/node_modules/@maka/runtime-host/dist/protocol/peer-mesh.js +14 -31
  112. package/node_modules/@maka/runtime-host/dist/protocol/scheduled-task.js +19 -6
  113. package/node_modules/@maka/runtime-host/dist/protocol/session-collaboration.js +36 -1
  114. package/node_modules/@maka/runtime-host/dist/protocol/session-revision.js +11 -2
  115. package/node_modules/@maka/runtime-host/dist/protocol/usage-pricing.js +16 -2
  116. package/node_modules/@maka/runtime-host/dist/protocol/workhub-coordination.js +51 -2
  117. package/node_modules/@maka/runtime-host/dist/server/access-authority.js +35 -2
  118. package/node_modules/@maka/runtime-host/dist/server/access-credential-store.js +1 -0
  119. package/node_modules/@maka/runtime-host/dist/server/client-capability-coordinator.js +12 -10
  120. package/node_modules/@maka/runtime-host/dist/server/client-capability-invocation-broker.js +163 -30
  121. package/node_modules/@maka/runtime-host/dist/server/connection-effect-coordinator.js +38 -14
  122. package/node_modules/@maka/runtime-host/dist/server/daily-review-coordinator.js +45 -22
  123. package/node_modules/@maka/runtime-host/dist/server/execution-composition.js +78 -20
  124. package/node_modules/@maka/runtime-host/dist/server/execution-model-authority.js +4 -2
  125. package/node_modules/@maka/runtime-host/dist/server/execution-model-composition.js +2 -1
  126. package/node_modules/@maka/runtime-host/dist/server/execution-service.js +49 -28
  127. package/node_modules/@maka/runtime-host/dist/server/host-kernel.js +3 -6
  128. package/node_modules/@maka/runtime-host/dist/server/interaction-coordinator.js +130 -27
  129. package/node_modules/@maka/runtime-host/dist/server/interaction-projection.js +30 -1
  130. package/node_modules/@maka/runtime-host/dist/server/listener-set.js +2 -4
  131. package/node_modules/@maka/runtime-host/dist/server/message-coordinator.js +16 -3
  132. package/node_modules/@maka/runtime-host/dist/server/oauth-coordinator.js +66 -3
  133. package/node_modules/@maka/runtime-host/dist/server/oauth-execution-authority.js +20 -3
  134. package/node_modules/@maka/runtime-host/dist/server/peer-listener.js +8 -21
  135. package/node_modules/@maka/runtime-host/dist/server/peer-mesh-authority.js +1 -1
  136. package/node_modules/@maka/runtime-host/dist/server/root-turn-coordinator.js +6 -3
  137. package/node_modules/@maka/runtime-host/dist/server/scheduled-task-coordinator.js +72 -12
  138. package/node_modules/@maka/runtime-host/dist/server/session-revision-coordinator.js +48 -18
  139. package/node_modules/@maka/runtime-host/dist/server/session-turn-access-request-coordinator.js +43 -26
  140. package/node_modules/@maka/runtime-host/dist/server/usage-pricing-coordinator.js +15 -1
  141. package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-action-gate.js +229 -4
  142. package/node_modules/@maka/runtime-host/dist/server/workhub-coordination-coordinator.js +146 -8
  143. package/node_modules/@maka/runtime-host/dist/transport/peer-native.js +32 -6
  144. package/node_modules/@maka/runtime-host/package.json +1 -0
  145. package/node_modules/@maka/storage/dist/agent-run-store.js +18 -5
  146. package/node_modules/@maka/storage/dist/codex-session-adapter.js +14 -0
  147. package/node_modules/@maka/storage/dist/execution-stores.js +5 -0
  148. package/node_modules/@maka/storage/dist/interaction-store.js +13 -1
  149. package/node_modules/@maka/storage/dist/runtime-policy/connection-catalog-document.js +9 -3
  150. package/node_modules/@maka/storage/dist/runtime-policy/coordinator.js +49 -19
  151. package/node_modules/@maka/storage/dist/runtime-policy/oauth-login-receipt-document.js +3 -1
  152. package/node_modules/@maka/storage/dist/runtime-policy/onboarding-transaction.js +13 -5
  153. package/node_modules/@maka/storage/dist/session-copy-cleanup.js +4 -2
  154. package/node_modules/@maka/storage/dist/session-store.js +39 -6
  155. package/node_modules/@maka/storage/dist/sqlite-runtime-store.js +16 -9
  156. package/node_modules/@maka/storage/dist/sqlite-session-metadata-schema.js +30 -3
  157. package/node_modules/@maka/storage/dist/sqlite-session-metadata-store.js +117 -0
  158. package/node_modules/@maka/storage/dist/sqlite-usage-store.js +29 -6
  159. package/node_modules/@maka/storage/dist/usage-stores.js +3 -1
  160. package/package.json +1 -1
@@ -18,9 +18,9 @@
18
18
  */
19
19
  import { createHash, createPrivateKey, createPublicKey, generateKeyPairSync, randomBytes, sign, timingSafeEqual, verify, } from 'node:crypto';
20
20
  import { decodePeerMeshInvitation as decodePeerMeshInvitationWire, } from '../protocol/peer-mesh.js';
21
- import { PEER_MESH_MAX_MEMBERS, PEER_MESH_MAX_ROUTE_HINTS, PEER_MESH_ROUTE_RECORD_MAX_BYTES, } from './limits.js';
21
+ import { PEER_MESH_MEMBER_ADVERTISEMENT_MAX_BYTES, PEER_MESH_MAX_MEMBERS } from './limits.js';
22
22
  import { canonicalPeerMeshDisplayName } from './display-name.js';
23
- export { PEER_MESH_MAX_INVITATION_RECORDS, PEER_MESH_MAX_MEMBERS, PEER_MESH_MAX_MESHES, PEER_MESH_MAX_PENDING_INVITATIONS, PEER_MESH_MAX_ROUTE_HINTS, PEER_MESH_MAX_TRANSIT_ADDRESSES_PER_RELAY, PEER_MESH_MAX_TRANSIT_RELAY_ADDRESSES, PEER_MESH_ROUTE_RECORD_MAX_BYTES, } from './limits.js';
23
+ export { PEER_MESH_MAX_INVITATION_RECORDS, PEER_MESH_MAX_MEMBERS, PEER_MESH_MAX_MESHES, PEER_MESH_MAX_PENDING_INVITATIONS, PEER_MESH_MAX_ROUTE_HINTS, PEER_MESH_MAX_TRANSIT_ADDRESSES_PER_RELAY, PEER_MESH_MAX_TRANSIT_RELAY_ADDRESSES, PEER_MESH_MEMBER_ADVERTISEMENT_MAX_BYTES, } from './limits.js';
24
24
  export function generatePeerMeshAuthorityKeyPair() {
25
25
  const { publicKey, privateKey } = generateKeyPairSync('ed25519');
26
26
  return Object.freeze({
@@ -61,12 +61,17 @@ export function validatePeerMeshAuthorityKeyPair(keys) {
61
61
  });
62
62
  }
63
63
  catch (error) {
64
- throw new Error('Invalid Peer Mesh authority private key', { cause: error });
64
+ throw new Error('Invalid Peer Mesh authority private key', {
65
+ cause: error,
66
+ });
65
67
  }
66
68
  if (privateKey.asymmetricKeyType !== 'ed25519') {
67
69
  throw new Error('Peer Mesh authority key must be Ed25519');
68
70
  }
69
- const derived = createPublicKey(privateKey).export({ format: 'der', type: 'spki' });
71
+ const derived = createPublicKey(privateKey).export({
72
+ format: 'der',
73
+ type: 'spki',
74
+ });
70
75
  if (derived.toString('base64url') !== keys.publicKey) {
71
76
  throw new Error('Peer Mesh authority private key does not match its public key');
72
77
  }
@@ -115,7 +120,7 @@ export function validatePeerMeshInvitation(value) {
115
120
  });
116
121
  }
117
122
  export function canonicalPeerMeshRoster(value) {
118
- const keys = ['version', 'meshId', 'revision', 'members', 'closed'];
123
+ const keys = ['version', 'meshId', 'authorityPeerId', 'revision', 'members', 'closed'];
119
124
  if (value && typeof value === 'object' && !Array.isArray(value)) {
120
125
  if (Object.hasOwn(value, 'displayName'))
121
126
  keys.push('displayName');
@@ -129,11 +134,16 @@ export function canonicalPeerMeshRoster(value) {
129
134
  if (members.length === 0 || new Set(members).size !== members.length) {
130
135
  throw new Error('Peer Mesh roster members must be unique and non-empty');
131
136
  }
137
+ const authorityPeerId = token(record.authorityPeerId, 'authorityPeerId', 256);
138
+ if (!members.includes(authorityPeerId)) {
139
+ throw new Error('Peer Mesh authority must be present in its roster');
140
+ }
132
141
  if (typeof record.closed !== 'boolean')
133
142
  throw new Error('Invalid Peer Mesh roster closed');
134
143
  return Object.freeze({
135
144
  version: 1,
136
145
  meshId: string(record.meshId, 'meshId', 128),
146
+ authorityPeerId,
137
147
  revision: integer(record.revision, 'revision', 1),
138
148
  members: Object.freeze(members),
139
149
  closed: record.closed,
@@ -142,85 +152,71 @@ export function canonicalPeerMeshRoster(value) {
142
152
  : { displayName: canonicalPeerMeshDisplayName(record.displayName) }),
143
153
  });
144
154
  }
145
- export function decodeAuthorityTarget(value) {
146
- const record = exactObject(value, 'Peer Mesh authority target', [
147
- 'peerId',
148
- 'routeHints',
149
- 'coordinationRelays',
150
- ]);
151
- return Object.freeze({
152
- peerId: token(record.peerId, 'peerId', 256),
153
- routeHints: Object.freeze(addressArray(record.routeHints, 'routeHints')),
154
- coordinationRelays: Object.freeze(addressArray(record.coordinationRelays, 'coordinationRelays')),
155
- });
156
- }
157
- export function canonicalPeerMeshRouteRecord(value) {
158
- const keys = ['version', 'peerId', 'sequence', 'expiresAt', 'routeHints', 'coordinationRelays'];
155
+ export function canonicalPeerMeshMemberAdvertisement(value) {
156
+ const keys = ['version', 'meshId', 'peerId', 'revision', 'offersTransit'];
159
157
  if (value && typeof value === 'object' && !Array.isArray(value)) {
160
158
  if (Object.hasOwn(value, 'endpointKind'))
161
159
  keys.push('endpointKind');
162
160
  if (Object.hasOwn(value, 'displayName'))
163
161
  keys.push('displayName');
164
- if (Object.hasOwn(value, 'transitMeshId'))
165
- keys.push('transitMeshId');
166
162
  }
167
- const record = exactObject(value, 'Peer Mesh route record', keys);
168
- if (record.version !== 1)
169
- throw new Error('Unsupported Peer Mesh route record version');
163
+ const record = exactObject(value, 'Peer Mesh member advertisement', keys);
164
+ if (record.version !== 1) {
165
+ throw new Error('Unsupported Peer Mesh member advertisement version');
166
+ }
170
167
  if (record.endpointKind !== undefined &&
171
168
  record.endpointKind !== 'client' &&
172
169
  record.endpointKind !== 'host') {
173
170
  throw new Error('Invalid Peer Mesh endpoint kind');
174
171
  }
175
- const route = Object.freeze({
172
+ if (typeof record.offersTransit !== 'boolean') {
173
+ throw new Error('Invalid Peer Mesh transit advertisement');
174
+ }
175
+ const advertisement = Object.freeze({
176
176
  version: 1,
177
+ meshId: string(record.meshId, 'meshId', 128),
177
178
  peerId: token(record.peerId, 'peerId', 256),
178
- sequence: integer(record.sequence, 'route sequence', 1),
179
- expiresAt: integer(record.expiresAt, 'route expiry', 1),
180
- routeHints: Object.freeze(addressArray(record.routeHints, 'routeHints')),
181
- coordinationRelays: Object.freeze(addressArray(record.coordinationRelays, 'coordinationRelays')),
179
+ revision: integer(record.revision, 'advertisement revision', 1),
182
180
  ...(record.endpointKind === undefined ? {} : { endpointKind: record.endpointKind }),
183
181
  ...(record.displayName === undefined
184
182
  ? {}
185
183
  : { displayName: canonicalPeerMeshDisplayName(record.displayName) }),
186
- ...(record.transitMeshId === undefined
187
- ? {}
188
- : { transitMeshId: string(record.transitMeshId, 'transitMeshId', 128) }),
184
+ offersTransit: record.offersTransit,
189
185
  });
190
- if (peerMeshRouteRecordSigningBytes(route).byteLength > PEER_MESH_ROUTE_RECORD_MAX_BYTES) {
191
- throw new Error('Peer Mesh route record is too large');
186
+ if (peerMeshMemberAdvertisementSigningBytes(advertisement).byteLength >
187
+ PEER_MESH_MEMBER_ADVERTISEMENT_MAX_BYTES) {
188
+ throw new Error('Peer Mesh member advertisement is too large');
192
189
  }
193
- return route;
190
+ return advertisement;
194
191
  }
195
- export function decodeSignedPeerMeshRouteRecord(value) {
196
- const record = exactObject(value, 'signed Peer Mesh route record', [
197
- 'route',
192
+ export function decodeSignedPeerMeshMemberAdvertisement(value) {
193
+ const record = exactObject(value, 'signed Peer Mesh member advertisement', [
194
+ 'advertisement',
198
195
  'publicKey',
199
196
  'signature',
200
197
  ]);
201
- const publicKey = canonicalProof(record.publicKey, 'route public key', 256);
202
- const signature = canonicalProof(record.signature, 'route signature', 256);
198
+ const publicKey = canonicalProof(record.publicKey, 'advertisement public key', 256);
199
+ const signature = canonicalProof(record.signature, 'advertisement signature', 256);
203
200
  return Object.freeze({
204
- route: canonicalPeerMeshRouteRecord(record.route),
201
+ advertisement: canonicalPeerMeshMemberAdvertisement(record.advertisement),
205
202
  publicKey,
206
203
  signature,
207
204
  });
208
205
  }
209
- export function peerMeshRouteRecordSigningBytes(route) {
210
- return Buffer.from(`maka.peer-mesh.route.v1\n${JSON.stringify({
211
- coordinationRelays: route.coordinationRelays,
212
- ...(route.displayName ? { displayName: route.displayName } : {}),
213
- ...(route.endpointKind ? { endpointKind: route.endpointKind } : {}),
214
- expiresAt: route.expiresAt,
215
- peerId: route.peerId,
216
- routeHints: route.routeHints,
217
- sequence: route.sequence,
218
- ...(route.transitMeshId ? { transitMeshId: route.transitMeshId } : {}),
219
- version: route.version,
206
+ export function peerMeshMemberAdvertisementSigningBytes(advertisement) {
207
+ return Buffer.from(`maka.peer-mesh.member-advertisement.v1\n${JSON.stringify({
208
+ ...(advertisement.displayName ? { displayName: advertisement.displayName } : {}),
209
+ ...(advertisement.endpointKind ? { endpointKind: advertisement.endpointKind } : {}),
210
+ meshId: advertisement.meshId,
211
+ offersTransit: advertisement.offersTransit,
212
+ peerId: advertisement.peerId,
213
+ revision: advertisement.revision,
214
+ version: advertisement.version,
220
215
  })}`);
221
216
  }
222
217
  function encodeRoster(roster) {
223
218
  return Buffer.from(`maka.peer-mesh.roster.v1\n${JSON.stringify({
219
+ authorityPeerId: roster.authorityPeerId,
224
220
  closed: roster.closed,
225
221
  ...(roster.displayName ? { displayName: roster.displayName } : {}),
226
222
  members: roster.members,
@@ -311,11 +307,3 @@ function stringArray(value, label, maxItems, maxLength) {
311
307
  }
312
308
  return value.map((item) => string(item, label, maxLength));
313
309
  }
314
- function addressArray(value, label) {
315
- const addresses = stringArray(value, label, PEER_MESH_MAX_ROUTE_HINTS, 1024);
316
- if (addresses.some((address) => !address.startsWith('/') || /\s|[\u0000-\u001f\u007f]/u.test(address)) ||
317
- new Set(addresses).size !== addresses.length) {
318
- throw new Error(`Invalid Peer Mesh ${label}`);
319
- }
320
- return addresses;
321
- }