@abraca/dabra 2.5.0 → 2.7.0

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.
@@ -2298,6 +2298,21 @@ var QueryClient = class extends EventEmitter {
2298
2298
  }
2299
2299
  };
2300
2300
 
2301
+ //#endregion
2302
+ //#region packages/provider/src/OutgoingMessages/QueryAwarenessMessage.ts
2303
+ var QueryAwarenessMessage = class extends OutgoingMessage {
2304
+ constructor(..._args) {
2305
+ super(..._args);
2306
+ this.type = MessageType.QueryAwareness;
2307
+ this.description = "Queries awareness states";
2308
+ }
2309
+ get(args) {
2310
+ writeVarString(this.encoder, args.documentName);
2311
+ writeVarUint(this.encoder, this.type);
2312
+ return this.encoder;
2313
+ }
2314
+ };
2315
+
2301
2316
  //#endregion
2302
2317
  //#region packages/provider/src/OutgoingMessages/SyncStepOneMessage.ts
2303
2318
  var SyncStepOneMessage = class extends OutgoingMessage {
@@ -2580,6 +2595,7 @@ var AbracadabraBaseProvider = class extends EventEmitter {
2580
2595
  clients: [this.document.clientID],
2581
2596
  documentName: this.configuration.name
2582
2597
  });
2598
+ if (this.awareness) this.send(QueryAwarenessMessage, { documentName: this.configuration.name });
2583
2599
  }
2584
2600
  send(message, args) {
2585
2601
  if (!this._isAttached) return;
@@ -11062,6 +11078,49 @@ var AbracadabraClient = class {
11062
11078
  return this.request("GET", `/admin/users/${encodeURIComponent(userId)}/docs${qs}`);
11063
11079
  }
11064
11080
  /**
11081
+ * List `service`-role users (runners, demo seeders, automation
11082
+ * identities). Requires Service role. Admins can see service users via
11083
+ * `/admin/users` too but cannot mint or rotate them.
11084
+ */
11085
+ async adminListServiceAccounts() {
11086
+ return this.request("GET", "/admin/service-accounts");
11087
+ }
11088
+ /**
11089
+ * Create a new `service`-role user. When `public_key` is omitted the
11090
+ * server generates a keypair and returns the private half in the
11091
+ * response — show it to the operator **once** and discard; the server
11092
+ * never persists it. Requires Service role.
11093
+ */
11094
+ async adminCreateServiceAccount(body) {
11095
+ return this.request("POST", "/admin/service-accounts", { body });
11096
+ }
11097
+ /**
11098
+ * Rotate the active keypair on a service account. Old JWTs are
11099
+ * invalidated; old device keys are marked revoked; the canonical
11100
+ * `users.public_key` swaps to the new value. `users.id` stays put so
11101
+ * existing permission rows keep matching. Returns the new pubkey (and
11102
+ * private half when the server generated it). Requires Service role.
11103
+ */
11104
+ async adminRotateServiceAccountKey(userId, body = {}) {
11105
+ return this.request("POST", `/admin/service-accounts/${encodeURIComponent(userId)}/rotate-key`, { body });
11106
+ }
11107
+ /**
11108
+ * Lock a service account and revoke all of its device keys. Idempotent.
11109
+ * Refuses targets whose `users.role` isn't `"service"`. Requires
11110
+ * Service role.
11111
+ */
11112
+ async adminRevokeServiceAccount(userId) {
11113
+ await this.request("DELETE", `/admin/service-accounts/${encodeURIComponent(userId)}`);
11114
+ }
11115
+ /**
11116
+ * Revoke a single device key on a user (any role). Bumps
11117
+ * `tokens_invalid_before` so open WS sessions tied to the key must
11118
+ * re-auth. Requires elevated role (Service or Admin@root).
11119
+ */
11120
+ async adminRevokeDeviceKey(userId, keyId) {
11121
+ await this.request("POST", `/admin/users/${encodeURIComponent(userId)}/device-keys/${encodeURIComponent(keyId)}/revoke`);
11122
+ }
11123
+ /**
11065
11124
  * Page through the audit log. Filters AND-combine; `limit` defaults to
11066
11125
  * 100 server-side. Requires elevated role.
11067
11126
  */
@@ -20212,8 +20271,13 @@ var ContentManager = class {
20212
20271
  }
20213
20272
  /**
20214
20273
  * Read document content as markdown.
20215
- * Returns the title extracted from the TipTap documentHeader, the markdown
20216
- * body, tree metadata, and immediate children.
20274
+ *
20275
+ * Returns the markdown body, tree-derived label/type/meta, and immediate
20276
+ * children. `title` mirrors `label` (the tree entry's display name) — it
20277
+ * is *not* derived from a TipTap `documentHeader`, and the markdown body
20278
+ * does NOT include YAML frontmatter. Callers that want frontmatter-style
20279
+ * round-tripping should serialise `meta`/`type` themselves on top of the
20280
+ * returned markdown.
20217
20281
  */
20218
20282
  async read(docId) {
20219
20283
  const fragment = (await this.dm.getChildProvider(docId)).document.getXmlFragment("default");
@@ -20248,7 +20312,7 @@ var ContentManager = class {
20248
20312
  type,
20249
20313
  meta
20250
20314
  }));
20251
- const markdown = yjsToMarkdown(fragment, label, meta, type);
20315
+ const { markdown } = yjsToMarkdown(fragment);
20252
20316
  return {
20253
20317
  label,
20254
20318
  type,