@semiont/cli 0.5.1 → 0.5.2

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 (102) hide show
  1. package/dist/cli.mjs +234 -134
  2. package/dist/frontend/dist/assets/{CookiePreferences-D5wgmVC7.js → CookiePreferences-5feiOAX4.js} +2 -2
  3. package/dist/frontend/dist/assets/{CookiePreferences-D5wgmVC7.js.map → CookiePreferences-5feiOAX4.js.map} +1 -1
  4. package/dist/frontend/dist/assets/{PdfAnnotationCanvas.client-5QESNO5H-B7UjwjIX.js → PdfAnnotationCanvas.client-5QESNO5H-Cxm4Es_X.js} +2 -2
  5. package/dist/frontend/dist/assets/{PdfAnnotationCanvas.client-5QESNO5H-B7UjwjIX.js.map → PdfAnnotationCanvas.client-5QESNO5H-Cxm4Es_X.js.map} +1 -1
  6. package/dist/frontend/dist/assets/ToolbarPanels-D5L18Wxk.js +2 -0
  7. package/dist/frontend/dist/assets/ToolbarPanels-D5L18Wxk.js.map +1 -0
  8. package/dist/frontend/dist/assets/client-BmABw25x.js +2 -0
  9. package/dist/frontend/dist/assets/client-BmABw25x.js.map +1 -0
  10. package/dist/frontend/dist/assets/client-CTyYgbIC.js +2 -0
  11. package/dist/frontend/dist/assets/client-CTyYgbIC.js.map +1 -0
  12. package/dist/frontend/dist/assets/client-Cjf1Te8y.js +2 -0
  13. package/dist/frontend/dist/assets/client-Cjf1Te8y.js.map +1 -0
  14. package/dist/frontend/dist/assets/client-D7w_vlsg.js +2 -0
  15. package/dist/frontend/dist/assets/client-D7w_vlsg.js.map +1 -0
  16. package/dist/frontend/dist/assets/index-BVOR3arc.js +169 -0
  17. package/dist/frontend/dist/assets/index-BVOR3arc.js.map +1 -0
  18. package/dist/frontend/dist/assets/{layout-BNfHKiGS.js → layout-B1HJjFMW.js} +2 -2
  19. package/dist/frontend/dist/assets/layout-B1HJjFMW.js.map +1 -0
  20. package/dist/frontend/dist/assets/layout-B7mIcfJU.js +2 -0
  21. package/dist/frontend/dist/assets/layout-B7mIcfJU.js.map +1 -0
  22. package/dist/frontend/dist/assets/{layout-G6HeeKIH.js → layout-BK6OF3Hx.js} +2 -2
  23. package/dist/frontend/dist/assets/{layout-G6HeeKIH.js.map → layout-BK6OF3Hx.js.map} +1 -1
  24. package/dist/frontend/dist/assets/{layout-Delbhxmy.js → layout-Cw-T4GPy.js} +2 -2
  25. package/dist/frontend/dist/assets/{layout-Delbhxmy.js.map → layout-Cw-T4GPy.js.map} +1 -1
  26. package/dist/frontend/dist/assets/{not-found-CtwZrTVU.js → not-found-uRBdv-bF.js} +2 -2
  27. package/dist/frontend/dist/assets/{not-found-CtwZrTVU.js.map → not-found-uRBdv-bF.js.map} +1 -1
  28. package/dist/frontend/dist/assets/{page-DSW3JQF2.js → page-5wC1as95.js} +2 -2
  29. package/dist/frontend/dist/assets/{page-DSW3JQF2.js.map → page-5wC1as95.js.map} +1 -1
  30. package/dist/frontend/dist/assets/{page-VPeYeXi6.js → page-B6XEk2Ue.js} +2 -2
  31. package/dist/frontend/dist/assets/{page-VPeYeXi6.js.map → page-B6XEk2Ue.js.map} +1 -1
  32. package/dist/frontend/dist/assets/{page-CkiQdVlI.js → page-BLt9SJto.js} +2 -2
  33. package/dist/frontend/dist/assets/page-BLt9SJto.js.map +1 -0
  34. package/dist/frontend/dist/assets/{page-DBlue8Rh.js → page-BNaAGnc3.js} +2 -2
  35. package/dist/frontend/dist/assets/{page-DBlue8Rh.js.map → page-BNaAGnc3.js.map} +1 -1
  36. package/dist/frontend/dist/assets/{page-CjI_QXry.js → page-Bcljtfsa.js} +2 -2
  37. package/dist/frontend/dist/assets/{page-CjI_QXry.js.map → page-Bcljtfsa.js.map} +1 -1
  38. package/dist/frontend/dist/assets/{page-DBYS9qIU.js → page-Bf4MMijQ.js} +2 -2
  39. package/dist/frontend/dist/assets/{page-DBYS9qIU.js.map → page-Bf4MMijQ.js.map} +1 -1
  40. package/dist/frontend/dist/assets/page-BlU7QK_-.js +2 -0
  41. package/dist/frontend/dist/assets/page-BlU7QK_-.js.map +1 -0
  42. package/dist/frontend/dist/assets/{page-CI8oLbhf.js → page-Bnawjb1Y.js} +2 -2
  43. package/dist/frontend/dist/assets/{page-CI8oLbhf.js.map → page-Bnawjb1Y.js.map} +1 -1
  44. package/dist/frontend/dist/assets/page-C7vfVcap.js +2 -0
  45. package/dist/frontend/dist/assets/{page-DU909Np3.js.map → page-C7vfVcap.js.map} +1 -1
  46. package/dist/frontend/dist/assets/page-CBL0MuAo.js +2 -0
  47. package/dist/frontend/dist/assets/page-CBL0MuAo.js.map +1 -0
  48. package/dist/frontend/dist/assets/page-CKCKmPQO.js +2 -0
  49. package/dist/frontend/dist/assets/page-CKCKmPQO.js.map +1 -0
  50. package/dist/frontend/dist/assets/page-CdqGKYBH.js +2 -0
  51. package/dist/frontend/dist/assets/page-CdqGKYBH.js.map +1 -0
  52. package/dist/frontend/dist/assets/{page-Bb5SB6_Q.js → page-CfMLSllg.js} +2 -2
  53. package/dist/frontend/dist/assets/{page-Bb5SB6_Q.js.map → page-CfMLSllg.js.map} +1 -1
  54. package/dist/frontend/dist/assets/{page-C_fIdKsk.js → page-D7w7NNd7.js} +2 -2
  55. package/dist/frontend/dist/assets/{page-C_fIdKsk.js.map → page-D7w7NNd7.js.map} +1 -1
  56. package/dist/frontend/dist/assets/{page-kVSb0jfm.js → page-DAH06BM4.js} +2 -2
  57. package/dist/frontend/dist/assets/{page-kVSb0jfm.js.map → page-DAH06BM4.js.map} +1 -1
  58. package/dist/frontend/dist/assets/page-Dgqi9Orl.js +2 -0
  59. package/dist/frontend/dist/assets/page-Dgqi9Orl.js.map +1 -0
  60. package/dist/frontend/dist/assets/{page-RgfG8Fre.js → page-SrDV7XYv.js} +2 -2
  61. package/dist/frontend/dist/assets/{page-RgfG8Fre.js.map → page-SrDV7XYv.js.map} +1 -1
  62. package/dist/frontend/dist/assets/{page-D_6K1M4j.js → page-wxqWVnqc.js} +2 -2
  63. package/dist/frontend/dist/assets/page-wxqWVnqc.js.map +1 -0
  64. package/dist/frontend/dist/assets/{privacy-NaGU1hj4.js → privacy-Kk_oWnpO.js} +2 -2
  65. package/dist/frontend/dist/assets/{privacy-NaGU1hj4.js.map → privacy-Kk_oWnpO.js.map} +1 -1
  66. package/dist/frontend/dist/assets/{routing-o1npPvOW.js → routing-CGghUc0N.js} +2 -2
  67. package/dist/frontend/dist/assets/{routing-o1npPvOW.js.map → routing-CGghUc0N.js.map} +1 -1
  68. package/dist/frontend/dist/assets/{routing-BybXhU8X.js → routing-CKNCPdYO.js} +2 -2
  69. package/dist/frontend/dist/assets/{routing-BybXhU8X.js.map → routing-CKNCPdYO.js.map} +1 -1
  70. package/dist/frontend/dist/assets/{web-DAOI6EsG.js → web-DdXPBk3h.js} +2 -2
  71. package/dist/frontend/dist/assets/{web-DAOI6EsG.js.map → web-DdXPBk3h.js.map} +1 -1
  72. package/dist/frontend/dist/index.html +1 -1
  73. package/dist/frontend/package.json +1 -1
  74. package/package.json +8 -8
  75. package/dist/frontend/dist/assets/ToolbarPanels-CjWlSOUC.js +0 -2
  76. package/dist/frontend/dist/assets/ToolbarPanels-CjWlSOUC.js.map +0 -1
  77. package/dist/frontend/dist/assets/client-B-MtBLP9.js +0 -2
  78. package/dist/frontend/dist/assets/client-B-MtBLP9.js.map +0 -1
  79. package/dist/frontend/dist/assets/client-DX1ckM1P.js +0 -2
  80. package/dist/frontend/dist/assets/client-DX1ckM1P.js.map +0 -1
  81. package/dist/frontend/dist/assets/client-Dh9ak8Fa.js +0 -2
  82. package/dist/frontend/dist/assets/client-Dh9ak8Fa.js.map +0 -1
  83. package/dist/frontend/dist/assets/client-DsP3tx7D.js +0 -2
  84. package/dist/frontend/dist/assets/client-DsP3tx7D.js.map +0 -1
  85. package/dist/frontend/dist/assets/index-DoPpOINE.js +0 -169
  86. package/dist/frontend/dist/assets/index-DoPpOINE.js.map +0 -1
  87. package/dist/frontend/dist/assets/layout-BNfHKiGS.js.map +0 -1
  88. package/dist/frontend/dist/assets/layout-CMpievJ_.js +0 -2
  89. package/dist/frontend/dist/assets/layout-CMpievJ_.js.map +0 -1
  90. package/dist/frontend/dist/assets/page-7nyyO6Jy.js +0 -2
  91. package/dist/frontend/dist/assets/page-7nyyO6Jy.js.map +0 -1
  92. package/dist/frontend/dist/assets/page-BEhfXGas.js +0 -2
  93. package/dist/frontend/dist/assets/page-BEhfXGas.js.map +0 -1
  94. package/dist/frontend/dist/assets/page-CV0h_zZE.js +0 -2
  95. package/dist/frontend/dist/assets/page-CV0h_zZE.js.map +0 -1
  96. package/dist/frontend/dist/assets/page-CkiQdVlI.js.map +0 -1
  97. package/dist/frontend/dist/assets/page-D5qkLwSn.js +0 -2
  98. package/dist/frontend/dist/assets/page-D5qkLwSn.js.map +0 -1
  99. package/dist/frontend/dist/assets/page-DU909Np3.js +0 -2
  100. package/dist/frontend/dist/assets/page-DV9q0oju.js +0 -2
  101. package/dist/frontend/dist/assets/page-DV9q0oju.js.map +0 -1
  102. package/dist/frontend/dist/assets/page-D_6K1M4j.js.map +0 -1
package/dist/cli.mjs CHANGED
@@ -8378,26 +8378,26 @@ var require_BehaviorSubject = __commonJS({
8378
8378
  Object.defineProperty(exports, "__esModule", { value: true });
8379
8379
  exports.BehaviorSubject = void 0;
8380
8380
  var Subject_1 = require_Subject();
8381
- var BehaviorSubject3 = (function(_super) {
8382
- __extends(BehaviorSubject4, _super);
8383
- function BehaviorSubject4(_value) {
8381
+ var BehaviorSubject2 = (function(_super) {
8382
+ __extends(BehaviorSubject3, _super);
8383
+ function BehaviorSubject3(_value) {
8384
8384
  var _this = _super.call(this) || this;
8385
8385
  _this._value = _value;
8386
8386
  return _this;
8387
8387
  }
8388
- Object.defineProperty(BehaviorSubject4.prototype, "value", {
8388
+ Object.defineProperty(BehaviorSubject3.prototype, "value", {
8389
8389
  get: function() {
8390
8390
  return this.getValue();
8391
8391
  },
8392
8392
  enumerable: false,
8393
8393
  configurable: true
8394
8394
  });
8395
- BehaviorSubject4.prototype._subscribe = function(subscriber) {
8395
+ BehaviorSubject3.prototype._subscribe = function(subscriber) {
8396
8396
  var subscription = _super.prototype._subscribe.call(this, subscriber);
8397
8397
  !subscription.closed && subscriber.next(this._value);
8398
8398
  return subscription;
8399
8399
  };
8400
- BehaviorSubject4.prototype.getValue = function() {
8400
+ BehaviorSubject3.prototype.getValue = function() {
8401
8401
  var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, _value = _a._value;
8402
8402
  if (hasError) {
8403
8403
  throw thrownError;
@@ -8405,12 +8405,12 @@ var require_BehaviorSubject = __commonJS({
8405
8405
  this._throwIfClosed();
8406
8406
  return _value;
8407
8407
  };
8408
- BehaviorSubject4.prototype.next = function(value) {
8408
+ BehaviorSubject3.prototype.next = function(value) {
8409
8409
  _super.prototype.next.call(this, this._value = value);
8410
8410
  };
8411
- return BehaviorSubject4;
8411
+ return BehaviorSubject3;
8412
8412
  })(Subject_1.Subject);
8413
- exports.BehaviorSubject = BehaviorSubject3;
8413
+ exports.BehaviorSubject = BehaviorSubject2;
8414
8414
  }
8415
8415
  });
8416
8416
 
@@ -16922,10 +16922,10 @@ var require_operators = __commonJS({
16922
16922
  });
16923
16923
 
16924
16924
  // ../../packages/sdk/dist/index.js
16925
- import { SemiontError, annotationId, resourceId, email, googleCredential, refreshToken, EventBus, baseUrl, accessToken, isHighlight, isComment, isAssessment, isReference, isTag, decodeWithCharset, getPrimaryMediaType, userDID, searchQuery } from "@semiont/core";
16925
+ import { SemiontError, annotationId, resourceId, email, googleCredential, refreshToken, EventBus, baseUrl, accessToken, searchQuery } from "@semiont/core";
16926
16926
  import { SemiontError as SemiontError2, accessToken as accessToken2, annotationId as annotationId2, baseUrl as baseUrl2, entityType, refreshToken as refreshToken2, resourceId as resourceId2, userId } from "@semiont/core";
16927
- import { HttpTransport, HttpContentTransport, createActorVM, APIError } from "@semiont/api-client";
16928
- import { APIError as APIError2, DEGRADED_THRESHOLD_MS, HttpContentTransport as HttpContentTransport2, HttpTransport as HttpTransport2, createActorVM as createActorVM2 } from "@semiont/api-client";
16927
+ import { HttpTransport, HttpContentTransport, APIError } from "@semiont/api-client";
16928
+ import { APIError as APIError2, HttpContentTransport as HttpContentTransport2, HttpTransport as HttpTransport2 } from "@semiont/api-client";
16929
16929
  async function busRequest(bus, emitChannel, payload, resultChannel, failureChannel, timeoutMs = 3e4) {
16930
16930
  const correlationId = crypto.randomUUID();
16931
16931
  const fullPayload = { ...payload, correlationId };
@@ -17035,7 +17035,17 @@ function createCache(fetchFn) {
17035
17035
  }
17036
17036
  };
17037
17037
  }
17038
- var import_rxjs, import_operators, StreamObservable, CacheObservable, wrapperCache, BusRequestError, ENTITY_TYPES_KEY, BrowseNamespace, MarkNamespace, BindNamespace, GatherNamespace, MatchNamespace, YieldNamespace, BeckonNamespace, JobNamespace, AuthNamespace, AdminNamespace, SemiontClient, REFRESH_BEFORE_EXP_MS;
17038
+ function wrapAsStream(source) {
17039
+ return new StreamObservable((subscriber) => {
17040
+ const sub = source.subscribe({
17041
+ next: (v) => subscriber.next(v),
17042
+ error: (e) => subscriber.error(e),
17043
+ complete: () => subscriber.complete()
17044
+ });
17045
+ return () => sub.unsubscribe();
17046
+ });
17047
+ }
17048
+ var import_rxjs, import_operators, StreamObservable, CacheObservable, wrapperCache, UploadObservable, BusRequestError, ENTITY_TYPES_KEY, BrowseNamespace, MarkNamespace, BindNamespace, GatherNamespace, MatchNamespace, YieldNamespace, BeckonNamespace, FrameNamespace, JobNamespace, AuthNamespace, AdminNamespace, SemiontClient, REFRESH_BEFORE_EXP_MS;
17039
17049
  var init_dist = __esm({
17040
17050
  "../../packages/sdk/dist/index.js"() {
17041
17051
  "use strict";
@@ -17062,7 +17072,7 @@ var init_dist = __esm({
17062
17072
  * Observable per key (its B4 contract), so this preserves that contract
17063
17073
  * through the awaitable wrapping. Without the memo, every public-method
17064
17074
  * call would produce a fresh wrapper and break referential-equality
17065
- * guarantees that React-side consumers depend on.
17075
+ * guarantees that hook-style reactive consumers depend on.
17066
17076
  *
17067
17077
  * Backed by a `WeakMap`, so wrappers are GC'd when their source is.
17068
17078
  */
@@ -17076,6 +17086,17 @@ var init_dist = __esm({
17076
17086
  }
17077
17087
  };
17078
17088
  wrapperCache = /* @__PURE__ */ new WeakMap();
17089
+ UploadObservable = class extends import_rxjs.Observable {
17090
+ then(onfulfilled, onrejected) {
17091
+ return (0, import_rxjs.lastValueFrom)(this).then((v) => {
17092
+ if (v.phase !== "finished") {
17093
+ throw new Error(`UploadObservable resolved on a non-finished event: ${v.phase}`);
17094
+ }
17095
+ const result = { resourceId: v.resourceId };
17096
+ return onfulfilled ? onfulfilled(result) : result;
17097
+ }, onrejected);
17098
+ }
17099
+ };
17079
17100
  BusRequestError = class extends SemiontError {
17080
17101
  constructor(message, code, details) {
17081
17102
  super(message, code, details);
@@ -17422,7 +17443,7 @@ var init_dist = __esm({
17422
17443
  this.on("yield:update-ok", this.onYieldResourceMutated);
17423
17444
  this.on("mark:archived", this.onArchiveToggled);
17424
17445
  this.on("mark:unarchived", this.onArchiveToggled);
17425
- this.on("mark:entity-type-added", () => this.invalidateEntityTypes());
17446
+ this.on("frame:entity-type-added", () => this.invalidateEntityTypes());
17426
17447
  }
17427
17448
  };
17428
17449
  MarkNamespace = class {
@@ -17430,7 +17451,8 @@ var init_dist = __esm({
17430
17451
  this.transport = transport;
17431
17452
  this.bus = bus;
17432
17453
  }
17433
- async annotation(resourceId22, input) {
17454
+ async annotation(input) {
17455
+ const resourceId22 = resourceId(input.target.source);
17434
17456
  const result = await busRequest(
17435
17457
  this.transport,
17436
17458
  "mark:create-request",
@@ -17443,14 +17465,6 @@ var init_dist = __esm({
17443
17465
  async delete(resourceId22, annotationId22) {
17444
17466
  await this.transport.emit("mark:delete", { annotationId: annotationId22, resourceId: resourceId22 });
17445
17467
  }
17446
- async entityType(type2) {
17447
- await this.transport.emit("mark:add-entity-type", { tag: type2 });
17448
- }
17449
- async entityTypes(types) {
17450
- for (const tag of types) {
17451
- await this.transport.emit("mark:add-entity-type", { tag });
17452
- }
17453
- }
17454
17468
  async archive(resourceId22) {
17455
17469
  await this.transport.emit("mark:archive", { resourceId: resourceId22 });
17456
17470
  }
@@ -17605,6 +17619,7 @@ var init_dist = __esm({
17605
17619
  if (options.density !== void 0) params.density = options.density;
17606
17620
  if (options.tone !== void 0) params.tone = options.tone;
17607
17621
  if (options.language !== void 0) params.language = options.language;
17622
+ if (options.sourceLanguage !== void 0) params.sourceLanguage = options.sourceLanguage;
17608
17623
  if (options.schemaId !== void 0) params.schemaId = options.schemaId;
17609
17624
  if (options.categories !== void 0) params.categories = options.categories;
17610
17625
  return busRequest(
@@ -17638,7 +17653,7 @@ var init_dist = __esm({
17638
17653
  this.transport = transport;
17639
17654
  this.bus = bus;
17640
17655
  }
17641
- annotation(annotationId22, resourceId22, options) {
17656
+ annotation(resourceId22, annotationId22, options) {
17642
17657
  return new StreamObservable((subscriber) => {
17643
17658
  const correlationId = crypto.randomUUID();
17644
17659
  const complete$ = this.bus.get("gather:complete").pipe(
@@ -17730,22 +17745,53 @@ var init_dist = __esm({
17730
17745
  this.bus = bus;
17731
17746
  this.content = content;
17732
17747
  }
17733
- async resource(data) {
17734
- const result = await this.content.putBinary({
17735
- name: data.name,
17736
- file: data.file,
17737
- format: data.format,
17738
- storageUri: data.storageUri,
17739
- ...data.entityTypes ? { entityTypes: data.entityTypes } : {},
17740
- ...data.language ? { language: data.language } : {},
17741
- ...data.creationMethod ? { creationMethod: data.creationMethod } : {},
17742
- ...data.sourceAnnotationId ? { sourceAnnotationId: data.sourceAnnotationId } : {},
17743
- ...data.sourceResourceId ? { sourceResourceId: data.sourceResourceId } : {},
17744
- ...data.generationPrompt ? { generationPrompt: data.generationPrompt } : {},
17745
- ...data.generator ? { generator: data.generator } : {},
17746
- ...data.isDraft !== void 0 ? { isDraft: data.isDraft } : {}
17748
+ resource(data) {
17749
+ const totalBytes = typeof Buffer !== "undefined" && data.file instanceof Buffer ? data.file.length : data.file.size;
17750
+ return new UploadObservable((subscriber) => {
17751
+ subscriber.next({ phase: "started", totalBytes });
17752
+ let cancelled = false;
17753
+ const abortController = new AbortController();
17754
+ this.content.putBinary(
17755
+ {
17756
+ name: data.name,
17757
+ file: data.file,
17758
+ format: data.format,
17759
+ storageUri: data.storageUri,
17760
+ ...data.entityTypes ? { entityTypes: data.entityTypes } : {},
17761
+ ...data.language ? { language: data.language } : {},
17762
+ ...data.creationMethod ? { creationMethod: data.creationMethod } : {},
17763
+ ...data.sourceAnnotationId ? { sourceAnnotationId: data.sourceAnnotationId } : {},
17764
+ ...data.sourceResourceId ? { sourceResourceId: data.sourceResourceId } : {},
17765
+ ...data.generationPrompt ? { generationPrompt: data.generationPrompt } : {},
17766
+ ...data.generator ? { generator: data.generator } : {},
17767
+ ...data.isDraft !== void 0 ? { isDraft: data.isDraft } : {}
17768
+ },
17769
+ {
17770
+ // Byte-progress hook. Honored by `HttpContentTransport`'s XHR
17771
+ // path; ignored by ky-path uploads (no `onProgress` consumer)
17772
+ // and by `LocalContentTransport` (no wire to observe).
17773
+ onProgress: ({ bytesUploaded, totalBytes: txTotal }) => {
17774
+ if (cancelled) return;
17775
+ const total = txTotal > 0 ? txTotal : totalBytes;
17776
+ subscriber.next({ phase: "progress", bytesUploaded, totalBytes: total });
17777
+ },
17778
+ signal: abortController.signal
17779
+ }
17780
+ ).then((result) => {
17781
+ if (cancelled) return;
17782
+ subscriber.next({
17783
+ phase: "finished",
17784
+ resourceId: resourceId(result.resourceId)
17785
+ });
17786
+ subscriber.complete();
17787
+ }).catch((err) => {
17788
+ if (!cancelled) subscriber.error(err);
17789
+ });
17790
+ return () => {
17791
+ cancelled = true;
17792
+ abortController.abort();
17793
+ };
17747
17794
  });
17748
- return { resourceId: result.resourceId };
17749
17795
  }
17750
17796
  fromAnnotation(resourceId22, annotationId22, options) {
17751
17797
  return new StreamObservable((subscriber) => {
@@ -17836,6 +17882,7 @@ var init_dist = __esm({
17836
17882
  title: options.title,
17837
17883
  prompt: options.prompt,
17838
17884
  language: options.language,
17885
+ sourceLanguage: options.sourceLanguage,
17839
17886
  temperature: options.temperature,
17840
17887
  maxTokens: options.maxTokens,
17841
17888
  storageUri: options.storageUri,
@@ -17881,13 +17928,14 @@ var init_dist = __esm({
17881
17928
  return result.sourceResource;
17882
17929
  }
17883
17930
  async createFromToken(options) {
17884
- return busRequest(
17931
+ const result = await busRequest(
17885
17932
  this.transport,
17886
17933
  "yield:clone-create",
17887
17934
  options,
17888
17935
  "yield:clone-created",
17889
17936
  "yield:clone-create-failed"
17890
17937
  );
17938
+ return { resourceId: resourceId(result.resourceId) };
17891
17939
  }
17892
17940
  clone() {
17893
17941
  this.bus.get("yield:clone").next(void 0);
@@ -17898,7 +17946,7 @@ var init_dist = __esm({
17898
17946
  this.transport = transport;
17899
17947
  this.bus = bus;
17900
17948
  }
17901
- attention(annotationId22, resourceId22) {
17949
+ attention(resourceId22, annotationId22) {
17902
17950
  void this.transport.emit("beckon:focus", { annotationId: annotationId22, resourceId: resourceId22 });
17903
17951
  }
17904
17952
  hover(annotationId22) {
@@ -17908,6 +17956,19 @@ var init_dist = __esm({
17908
17956
  this.bus.get("beckon:sparkle").next({ annotationId: annotationId22 });
17909
17957
  }
17910
17958
  };
17959
+ FrameNamespace = class {
17960
+ constructor(transport) {
17961
+ this.transport = transport;
17962
+ }
17963
+ async addEntityType(type2) {
17964
+ await this.transport.emit("frame:add-entity-type", { tag: type2 });
17965
+ }
17966
+ async addEntityTypes(types) {
17967
+ for (const tag of types) {
17968
+ await this.transport.emit("frame:add-entity-type", { tag });
17969
+ }
17970
+ }
17971
+ };
17911
17972
  JobNamespace = class {
17912
17973
  constructor(transport, bus) {
17913
17974
  this.transport = transport;
@@ -17944,7 +18005,7 @@ var init_dist = __esm({
17944
18005
  }
17945
18006
  async pollUntilComplete(jobId, options) {
17946
18007
  const interval = options?.interval ?? 1e3;
17947
- const timeout7 = options?.timeout ?? 6e4;
18008
+ const timeout6 = options?.timeout ?? 6e4;
17948
18009
  const startTime = Date.now();
17949
18010
  while (true) {
17950
18011
  const status = await this.status(jobId);
@@ -17952,85 +18013,83 @@ var init_dist = __esm({
17952
18013
  if (status.status === "complete" || status.status === "failed" || status.status === "cancelled") {
17953
18014
  return status;
17954
18015
  }
17955
- if (Date.now() - startTime > timeout7) {
17956
- throw new Error(`Job polling timeout after ${timeout7}ms`);
18016
+ if (Date.now() - startTime > timeout6) {
18017
+ throw new Error(`Job polling timeout after ${timeout6}ms`);
17957
18018
  }
17958
18019
  await new Promise((resolve9) => setTimeout(resolve9, interval));
17959
18020
  }
17960
18021
  }
17961
- async cancel(_jobId, type2) {
17962
- await this.transport.emit("job:cancel-requested", {
17963
- jobType: type2 === "generation" ? "generation" : "annotation"
17964
- });
18022
+ async cancelByType(jobType) {
18023
+ await this.transport.emit("job:cancel-requested", { jobType });
17965
18024
  }
17966
18025
  cancelRequest(jobType) {
17967
18026
  this.bus.get("job:cancel-requested").next({ jobType });
17968
18027
  }
17969
18028
  };
17970
18029
  AuthNamespace = class {
17971
- constructor(transport) {
17972
- this.transport = transport;
18030
+ constructor(backend) {
18031
+ this.backend = backend;
17973
18032
  }
17974
18033
  async password(emailStr, passwordStr) {
17975
- return this.transport.authenticatePassword(email(emailStr), passwordStr);
18034
+ return this.backend.authenticatePassword(email(emailStr), passwordStr);
17976
18035
  }
17977
18036
  async google(credential) {
17978
- return this.transport.authenticateGoogle(googleCredential(credential));
18037
+ return this.backend.authenticateGoogle(googleCredential(credential));
17979
18038
  }
17980
18039
  async refresh(token) {
17981
- return this.transport.refreshAccessToken(refreshToken(token));
18040
+ return this.backend.refreshAccessToken(refreshToken(token));
17982
18041
  }
17983
18042
  async logout() {
17984
- await this.transport.logout();
18043
+ await this.backend.logout();
17985
18044
  }
17986
18045
  async me() {
17987
- return this.transport.getCurrentUser();
18046
+ return this.backend.getCurrentUser();
17988
18047
  }
17989
18048
  async acceptTerms() {
17990
- await this.transport.acceptTerms();
18049
+ await this.backend.acceptTerms();
17991
18050
  }
17992
18051
  async mcpToken() {
17993
- return this.transport.generateMcpToken();
18052
+ return this.backend.generateMcpToken();
17994
18053
  }
17995
18054
  async mediaToken(resourceId22) {
17996
- return this.transport.getMediaToken(resourceId22);
18055
+ return this.backend.getMediaToken(resourceId22);
17997
18056
  }
17998
18057
  };
17999
18058
  AdminNamespace = class {
18000
- constructor(transport) {
18001
- this.transport = transport;
18059
+ constructor(backend) {
18060
+ this.backend = backend;
18002
18061
  }
18003
18062
  async users() {
18004
- const result = await this.transport.listUsers();
18063
+ const result = await this.backend.listUsers();
18005
18064
  return result.users;
18006
18065
  }
18007
18066
  async userStats() {
18008
- return this.transport.getUserStats();
18067
+ return this.backend.getUserStats();
18009
18068
  }
18010
18069
  async updateUser(userId2, data) {
18011
- const result = await this.transport.updateUser(userId2, data);
18070
+ const result = await this.backend.updateUser(userId2, data);
18012
18071
  return result.user;
18013
18072
  }
18014
18073
  async oauthConfig() {
18015
- return this.transport.getOAuthConfig();
18074
+ return this.backend.getOAuthConfig();
18016
18075
  }
18017
18076
  async healthCheck() {
18018
- return this.transport.healthCheck();
18077
+ return this.backend.healthCheck();
18019
18078
  }
18020
18079
  async status() {
18021
- return this.transport.getStatus();
18080
+ return this.backend.getStatus();
18022
18081
  }
18023
18082
  async backup() {
18024
- return this.transport.backupKnowledgeBase();
18083
+ return this.backend.backupKnowledgeBase();
18025
18084
  }
18026
- async restore(file, onProgress) {
18027
- return this.transport.restoreKnowledgeBase(file, onProgress);
18085
+ restore(file) {
18086
+ return wrapAsStream(this.backend.restoreKnowledgeBase(file));
18028
18087
  }
18029
18088
  async exportKnowledgeBase(params) {
18030
- return this.transport.exportKnowledgeBase(params);
18089
+ return this.backend.exportKnowledgeBase(params);
18031
18090
  }
18032
- async importKnowledgeBase(file, onProgress) {
18033
- return this.transport.importKnowledgeBase(file, onProgress);
18091
+ importKnowledgeBase(file) {
18092
+ return wrapAsStream(this.backend.importKnowledgeBase(file));
18034
18093
  }
18035
18094
  };
18036
18095
  SemiontClient = class _SemiontClient {
@@ -18052,6 +18111,15 @@ var init_dist = __esm({
18052
18111
  bus;
18053
18112
  baseUrl;
18054
18113
  // ── Verb-oriented namespace API ──────────────────────────────────────────
18114
+ //
18115
+ // The first nine namespaces are bus-driven and always present. `frame`
18116
+ // is the schema-layer flow's surface (eighth flow); the other eight are
18117
+ // content-layer flows plus `job`. `auth` and `admin` are backend-ops
18118
+ // namespaces — they're only constructed when the caller passes an
18119
+ // `IBackendOperations` instance to the constructor. A `SemiontClient`
18120
+ // over a transport-only setup (e.g. `LocalTransport`) has
18121
+ // `auth === undefined` / `admin === undefined`.
18122
+ frame;
18055
18123
  browse;
18056
18124
  mark;
18057
18125
  bind;
@@ -18074,13 +18142,20 @@ var init_dist = __esm({
18074
18142
  * Callers do not pass a bus in. If they need to interact with the bus
18075
18143
  * (e.g. for tests or to subscribe to arbitrary channels), they read it
18076
18144
  * back via `client.bus`.
18145
+ *
18146
+ * `backend` is optional. When provided, the `auth` and `admin`
18147
+ * namespaces are constructed against it; when omitted, they're
18148
+ * `undefined`. For HTTP setups this is conventionally the same
18149
+ * `HttpTransport` instance that's also passed as `transport` (HTTP
18150
+ * implements both `ITransport` and `IBackendOperations`).
18077
18151
  */
18078
- constructor(transport, content) {
18152
+ constructor(transport, content, backend) {
18079
18153
  this.transport = transport;
18080
18154
  this.content = content;
18081
18155
  this.baseUrl = transport.baseUrl;
18082
18156
  this.bus = new EventBus();
18083
18157
  this.transport.bridgeInto(this.bus);
18158
+ this.frame = new FrameNamespace(this.transport);
18084
18159
  this.browse = new BrowseNamespace(this.transport, this.bus, this.content);
18085
18160
  this.mark = new MarkNamespace(this.transport, this.bus);
18086
18161
  this.bind = new BindNamespace(this.transport, this.bus);
@@ -18089,8 +18164,8 @@ var init_dist = __esm({
18089
18164
  this.yield = new YieldNamespace(this.transport, this.bus, this.content);
18090
18165
  this.beckon = new BeckonNamespace(this.transport, this.bus);
18091
18166
  this.job = new JobNamespace(this.transport, this.bus);
18092
- this.auth = new AuthNamespace(this.transport);
18093
- this.admin = new AdminNamespace(this.transport);
18167
+ this.auth = backend ? new AuthNamespace(backend) : void 0;
18168
+ this.admin = backend ? new AdminNamespace(backend) : void 0;
18094
18169
  }
18095
18170
  /** Transport-level connection state. HTTP reflects SSE health; local is always 'connected'. */
18096
18171
  get state$() {
@@ -18112,9 +18187,10 @@ var init_dist = __esm({
18112
18187
  * Use this for one-shot scripts, CLI commands, or any consumer that
18113
18188
  * doesn't need to drive the token from outside (no manual refresh,
18114
18189
  * no cross-tab sync). For long-running scripts that need refresh,
18115
- * use `SemiontSession.fromHttp(...)` instead it owns the same
18116
- * transport/client wiring plus the proactive-refresh + storage
18117
- * machinery.
18190
+ * use `SemiontSession.fromHttp(...)` (with a token already on hand)
18191
+ * or `SemiontSession.signInHttp(...)` (credentials-first) instead
18192
+ * either owns the same transport/client wiring plus the
18193
+ * proactive-refresh + storage machinery.
18118
18194
  *
18119
18195
  * Strings are accepted for `baseUrl` and `token`; they are branded
18120
18196
  * via `baseUrl()` / `accessToken()` from `@semiont/core` automatically.
@@ -18128,13 +18204,13 @@ var init_dist = __esm({
18128
18204
  const token$ = new import_rxjs.BehaviorSubject(tok);
18129
18205
  const transport = new HttpTransport({ baseUrl: url, token$ });
18130
18206
  const content = new HttpContentTransport(transport);
18131
- return new _SemiontClient(transport, content);
18207
+ return new _SemiontClient(transport, content, transport);
18132
18208
  }
18133
18209
  /**
18134
18210
  * Async factory for the credentials-first script case. Builds a
18135
- * transient transport, calls `auth.password(email, password)` to
18136
- * acquire an access token, and returns the wired client with the
18137
- * token populated.
18211
+ * transient HTTP transport, calls `auth.password(email, password)`
18212
+ * to acquire an access token, and returns the wired client with
18213
+ * the token populated.
18138
18214
  *
18139
18215
  * This is the right entry point for skills, CLI scripts, and any
18140
18216
  * consumer that starts with email + password rather than a JWT
@@ -18143,18 +18219,24 @@ var init_dist = __esm({
18143
18219
  * `fromHttp({ baseUrl, token })` instead.
18144
18220
  *
18145
18221
  * For long-running scripts that need refresh, use
18146
- * `SemiontSession.signIn(...)` — same credentials shape, plus the
18147
- * session machinery for proactive refresh and persistence.
18222
+ * `SemiontSession.signInHttp(...)` — same credentials shape, plus
18223
+ * the session machinery for proactive refresh and persistence.
18224
+ *
18225
+ * Named `signInHttp` because email+password authentication is
18226
+ * inherently an HTTP-shaped operation in the current backend; an
18227
+ * in-process `LocalTransport` doesn't have a credentials login
18228
+ * path. Non-HTTP transports construct the client directly from
18229
+ * their package's transport instance.
18148
18230
  *
18149
18231
  * Throws if authentication fails. The transient client is disposed
18150
18232
  * before the throw, so no resources leak on failure.
18151
18233
  */
18152
- static async signIn(opts) {
18234
+ static async signInHttp(opts) {
18153
18235
  const url = typeof opts.baseUrl === "string" ? baseUrl(opts.baseUrl) : opts.baseUrl;
18154
18236
  const token$ = new import_rxjs.BehaviorSubject(null);
18155
18237
  const transport = new HttpTransport({ baseUrl: url, token$ });
18156
18238
  const content = new HttpContentTransport(transport);
18157
- const client = new _SemiontClient(transport, content);
18239
+ const client = new _SemiontClient(transport, content, transport);
18158
18240
  try {
18159
18241
  const auth = await client.auth.password(opts.email, opts.password);
18160
18242
  token$.next(accessToken(auth.token));
@@ -18257,7 +18339,7 @@ var init_backend_check = __esm({
18257
18339
  if (status === "unhealthy" || status === "unknown") {
18258
18340
  const localUrl = `http://localhost:${config.port}`;
18259
18341
  const transport = new HttpTransport3({ baseUrl: baseUrl3(localUrl) });
18260
- const client = new SemiontClient(transport, new HttpContentTransport3(transport));
18342
+ const client = new SemiontClient(transport, new HttpContentTransport3(transport), transport);
18261
18343
  try {
18262
18344
  const healthData = await client.admin.healthCheck();
18263
18345
  healthy = true;
@@ -21418,7 +21500,7 @@ var init_web_check = __esm({
21418
21500
  if (isBackend) {
21419
21501
  const backendConfig = config;
21420
21502
  const transport = new HttpTransport4({ baseUrl: baseUrl4(backendConfig.publicURL) });
21421
- const client = new SemiontClient(transport, new HttpContentTransport4(transport));
21503
+ const client = new SemiontClient(transport, new HttpContentTransport4(transport), transport);
21422
21504
  try {
21423
21505
  const healthData = await client.admin.healthCheck();
21424
21506
  health = {
@@ -32935,7 +33017,7 @@ var require_package = __commonJS({
32935
33017
  "package.json"(exports, module) {
32936
33018
  module.exports = {
32937
33019
  name: "@semiont/cli",
32938
- version: "0.5.1",
33020
+ version: "0.5.2",
32939
33021
  description: "Semiont CLI - Unified environment management tool",
32940
33022
  _comment: "AWS SDK dependencies (@aws-sdk/*) are only used by platforms/aws",
32941
33023
  type: "module",
@@ -32982,13 +33064,13 @@ var require_package = __commonJS({
32982
33064
  "test:watch:unit": "vitest --watch --config vitest.config.unit.ts"
32983
33065
  },
32984
33066
  dependencies: {
32985
- "@semiont/api-client": "0.5.1",
32986
- "@semiont/content": "0.5.1",
32987
- "@semiont/core": "0.5.1",
32988
- "@semiont/event-sourcing": "0.5.1",
32989
- "@semiont/graph": "0.5.1",
32990
- "@semiont/sdk": "0.5.1",
32991
- "@semiont/make-meaning": "0.5.1",
33067
+ "@semiont/api-client": "0.5.2",
33068
+ "@semiont/content": "0.5.2",
33069
+ "@semiont/core": "0.5.2",
33070
+ "@semiont/event-sourcing": "0.5.2",
33071
+ "@semiont/graph": "0.5.2",
33072
+ "@semiont/sdk": "0.5.2",
33073
+ "@semiont/make-meaning": "0.5.2",
32992
33074
  arg: "^5.0.2",
32993
33075
  argon2: "^0.44.0",
32994
33076
  express: "^5.2.1",
@@ -35640,7 +35722,7 @@ var mvCmd = new CommandBuilder().name("mv").description("Move (rename) a tracked
35640
35722
 
35641
35723
  // src/core/commands/yield.ts
35642
35724
  init_zod();
35643
- var import_rxjs3 = __toESM(require_cjs(), 1);
35725
+ var import_rxjs2 = __toESM(require_cjs(), 1);
35644
35726
  init_command_definition();
35645
35727
  init_base_options_schema();
35646
35728
  init_cli_logger();
@@ -35651,14 +35733,11 @@ import { resourceId as toResourceId, annotationId as toAnnotationId } from "@sem
35651
35733
 
35652
35734
  // src/core/api-client-factory.ts
35653
35735
  init_dist();
35654
- var import_rxjs2 = __toESM(require_cjs(), 1);
35655
35736
  import * as fs45 from "fs";
35656
35737
  import * as path37 from "path";
35657
35738
  import * as os6 from "os";
35658
- import { HttpContentTransport as HttpContentTransport5, HttpTransport as HttpTransport5 } from "@semiont/api-client";
35659
35739
  import {
35660
- accessToken as toAccessToken,
35661
- baseUrl as toBaseUrl
35740
+ accessToken as toAccessToken
35662
35741
  } from "@semiont/core";
35663
35742
  var TOKEN_CACHE_TTL_MS = 864e5;
35664
35743
  function authStoreDir() {
@@ -35688,8 +35767,7 @@ function isTokenValid(cache) {
35688
35767
  return Date.now() < cachedAt + TOKEN_CACHE_TTL_MS;
35689
35768
  }
35690
35769
  async function acquireToken(rawBusUrl, emailStr, passwordStr) {
35691
- const transport = new HttpTransport5({ baseUrl: toBaseUrl(rawBusUrl) });
35692
- const semiont = new SemiontClient(transport, new HttpContentTransport5(transport));
35770
+ const semiont = SemiontClient.fromHttp({ baseUrl: rawBusUrl });
35693
35771
  const authResult = await semiont.auth.password(emailStr, passwordStr);
35694
35772
  const cache = {
35695
35773
  bus: rawBusUrl,
@@ -35709,9 +35787,7 @@ Run: semiont login --bus ${rawBusUrl}`
35709
35787
  );
35710
35788
  }
35711
35789
  const token = toAccessToken(cached.token);
35712
- const token$ = new import_rxjs2.BehaviorSubject(token);
35713
- const transport = new HttpTransport5({ baseUrl: toBaseUrl(rawBusUrl), token$ });
35714
- const semiont = new SemiontClient(transport, new HttpContentTransport5(transport));
35790
+ const semiont = SemiontClient.fromHttp({ baseUrl: rawBusUrl, token });
35715
35791
  return { semiont, token };
35716
35792
  }
35717
35793
  function resolveBusUrl(busFlag) {
@@ -35754,7 +35830,14 @@ var YieldOptionsSchema = ApiOptionsSchema.extend({
35754
35830
  // Delegate mode optional
35755
35831
  title: external_exports.string().optional(),
35756
35832
  prompt: external_exports.string().optional(),
35833
+ /** BCP-47 tag — language the *generated resource* is written in. */
35757
35834
  language: external_exports.string().optional(),
35835
+ /**
35836
+ * BCP-47 tag — language of the *source resource* the annotation lives on.
35837
+ * Goes into the prompt so the LLM understands embedded source-context
35838
+ * snippets correctly when source ≠ target language.
35839
+ */
35840
+ sourceLanguage: external_exports.string().optional(),
35758
35841
  temperature: external_exports.coerce.number().min(0).max(1).optional(),
35759
35842
  maxTokens: external_exports.coerce.number().int().min(100).max(4e3).optional(),
35760
35843
  contextWindow: external_exports.coerce.number().int().min(100).max(5e3).default(1e3)
@@ -35781,18 +35864,20 @@ async function runDelegate(semiont, options) {
35781
35864
  const rawAnnotationId = options.annotation;
35782
35865
  const rId = toResourceId(rawResourceId);
35783
35866
  const aId = toAnnotationId(rawAnnotationId);
35784
- const context = await (0, import_rxjs3.lastValueFrom)(
35785
- semiont.gather.annotation(aId, rId, { contextWindow: options.contextWindow })
35867
+ const context = await (0, import_rxjs2.lastValueFrom)(
35868
+ semiont.gather.annotation(rId, aId, { contextWindow: options.contextWindow })
35786
35869
  );
35787
35870
  if (!options.quiet) process.stderr.write(`Generating from annotation ${rawAnnotationId}...
35788
35871
  `);
35789
- const final = await (0, import_rxjs3.lastValueFrom)(
35872
+ const ctxSourceLanguage = context?.metadata?.language;
35873
+ const final = await (0, import_rxjs2.lastValueFrom)(
35790
35874
  semiont.yield.fromAnnotation(rId, aId, {
35791
35875
  title: options.title ?? rawAnnotationId,
35792
35876
  storageUri: options.storageUri,
35793
35877
  context,
35794
35878
  prompt: options.prompt,
35795
35879
  language: options.language,
35880
+ sourceLanguage: options.sourceLanguage ?? ctxSourceLanguage,
35796
35881
  temperature: options.temperature,
35797
35882
  maxTokens: options.maxTokens
35798
35883
  })
@@ -35930,7 +36015,7 @@ init_command_definition();
35930
36015
  init_base_options_schema();
35931
36016
  init_cli_logger();
35932
36017
  import { resourceId as toResourceId2 } from "@semiont/core";
35933
- var import_rxjs4 = __toESM(require_cjs(), 1);
36018
+ var import_rxjs3 = __toESM(require_cjs(), 1);
35934
36019
  var MOTIVATIONS = ["highlighting", "commenting", "tagging", "assessing", "linking"];
35935
36020
  var CONTEXT_WINDOW = 32;
35936
36021
  var MarkOptionsSchema = ApiOptionsSchema.extend({
@@ -35963,6 +36048,19 @@ var MarkOptionsSchema = ApiOptionsSchema.extend({
35963
36048
  instructions: external_exports.string().optional(),
35964
36049
  density: external_exports.coerce.number().int().optional(),
35965
36050
  tone: external_exports.enum(["scholarly", "explanatory", "conversational", "technical", "analytical", "critical", "balanced", "constructive"]).optional(),
36051
+ /**
36052
+ * BCP-47 tag for the annotation body language. Tells the LLM what language
36053
+ * to write generated body text in (comment/assessment) and stamps the
36054
+ * `language` field on every TextualBody the worker produces. Independent
36055
+ * from --source-language; this one is about the *output*.
36056
+ */
36057
+ language: external_exports.string().optional(),
36058
+ /**
36059
+ * BCP-47 tag for the source-resource language. Goes into the prompt so the
36060
+ * LLM analyzes non-English source correctly. Independent from --language;
36061
+ * this one is about the *input*.
36062
+ */
36063
+ sourceLanguage: external_exports.string().optional(),
35966
36064
  // ── Delegate mode: linking ─────────────────────────────────────────────
35967
36065
  entityType: external_exports.array(external_exports.string()).default([]),
35968
36066
  includeDescriptive: external_exports.boolean().default(false),
@@ -36068,10 +36166,10 @@ function buildBody(options) {
36068
36166
  async function runDelegate2(semiont, options) {
36069
36167
  const rawResourceId = options.resourceIdArr[0];
36070
36168
  const rId = toResourceId2(rawResourceId);
36071
- const { motivation, instructions, density, tone, entityType: entityType2, includeDescriptive, schemaId, category } = options;
36169
+ const { motivation, instructions, density, tone, entityType: entityType2, includeDescriptive, schemaId, category, language, sourceLanguage } = options;
36072
36170
  if (!options.quiet) process.stderr.write(`Annotating ${motivation} on ${rawResourceId}...
36073
36171
  `);
36074
- const final = await (0, import_rxjs4.lastValueFrom)(
36172
+ const final = await (0, import_rxjs3.lastValueFrom)(
36075
36173
  semiont.mark.assist(rId, motivation, {
36076
36174
  instructions,
36077
36175
  density,
@@ -36079,7 +36177,9 @@ async function runDelegate2(semiont, options) {
36079
36177
  entityTypes: entityType2,
36080
36178
  includeDescriptiveReferences: includeDescriptive,
36081
36179
  schemaId,
36082
- categories: category
36180
+ categories: category,
36181
+ language,
36182
+ sourceLanguage
36083
36183
  })
36084
36184
  );
36085
36185
  const r = (final.kind === "complete" ? final.data.result : void 0) ?? {};
@@ -36116,7 +36216,7 @@ async function runMark(options) {
36116
36216
  target,
36117
36217
  body
36118
36218
  };
36119
- const { annotationId: annotationId3 } = await semiont.mark.annotation(resourceId3, request);
36219
+ const { annotationId: annotationId3 } = await semiont.mark.annotation(request);
36120
36220
  if (!options.quiet) printSuccess(`Marked: ${rawResourceId} \u2192 ${annotationId3}`);
36121
36221
  return {
36122
36222
  command: "mark",
@@ -36256,7 +36356,7 @@ var markCmd = new CommandBuilder().name("mark").description(
36256
36356
 
36257
36357
  // src/core/commands/gather.ts
36258
36358
  init_zod();
36259
- var import_rxjs5 = __toESM(require_cjs(), 1);
36359
+ var import_rxjs4 = __toESM(require_cjs(), 1);
36260
36360
  init_command_definition();
36261
36361
  init_base_options_schema();
36262
36362
  import { resourceId as toResourceId3, annotationId as toAnnotationId2 } from "@semiont/core";
@@ -36283,8 +36383,8 @@ async function runGather(options) {
36283
36383
  }
36284
36384
  const rid = toResourceId3(rawResourceId);
36285
36385
  const aid = toAnnotationId2(rawAnnotationId);
36286
- result = await (0, import_rxjs5.lastValueFrom)(
36287
- semiont.gather.annotation(aid, rid, { contextWindow: options.contextWindow })
36386
+ result = await (0, import_rxjs4.lastValueFrom)(
36387
+ semiont.gather.annotation(rid, aid, { contextWindow: options.contextWindow })
36288
36388
  );
36289
36389
  } else {
36290
36390
  throw new Error(`Unknown subcommand: ${subcommand}. Use 'resource' or 'annotation'.`);
@@ -36326,7 +36426,7 @@ var gatherCmd = new CommandBuilder().name("gather").description("Fetch LLM-optim
36326
36426
 
36327
36427
  // src/core/commands/match.ts
36328
36428
  init_zod();
36329
- var import_rxjs6 = __toESM(require_cjs(), 1);
36429
+ var import_rxjs5 = __toESM(require_cjs(), 1);
36330
36430
  init_command_definition();
36331
36431
  init_base_options_schema();
36332
36432
  import { resourceId as toResourceId4, annotationId as toAnnotationId3 } from "@semiont/core";
@@ -36344,13 +36444,13 @@ async function runMatch(options) {
36344
36444
  const annotationId3 = toAnnotationId3(rawAnnotationId);
36345
36445
  const rawBusUrl = resolveBusUrl(options.bus);
36346
36446
  const { semiont } = loadCachedClient(rawBusUrl);
36347
- let context = await (0, import_rxjs6.lastValueFrom)(
36348
- semiont.gather.annotation(annotationId3, resourceId3, { contextWindow: options.contextWindow })
36447
+ let context = await (0, import_rxjs5.lastValueFrom)(
36448
+ semiont.gather.annotation(resourceId3, annotationId3, { contextWindow: options.contextWindow })
36349
36449
  );
36350
36450
  if (options.userHint) {
36351
36451
  context = { ...context, userHint: options.userHint };
36352
36452
  }
36353
- const searchResult = await (0, import_rxjs6.firstValueFrom)(
36453
+ const searchResult = await (0, import_rxjs5.firstValueFrom)(
36354
36454
  semiont.match.search(resourceId3, annotationId3, context, {
36355
36455
  limit: options.limit,
36356
36456
  useSemanticScoring: !options.noSemantic
@@ -36499,7 +36599,7 @@ var beckonCmd = new CommandBuilder().name("beckon").description(
36499
36599
 
36500
36600
  // src/core/commands/browse.ts
36501
36601
  init_zod();
36502
- var import_rxjs7 = __toESM(require_cjs(), 1);
36602
+ var import_rxjs6 = __toESM(require_cjs(), 1);
36503
36603
  var import_operators2 = __toESM(require_operators(), 1);
36504
36604
  init_command_definition();
36505
36605
  init_base_options_schema();
@@ -36548,15 +36648,15 @@ async function runBrowse(options) {
36548
36648
  if (subcommand === "resources") {
36549
36649
  const filters = { limit: options.limit };
36550
36650
  if (options.search) filters.search = options.search;
36551
- const items = await (0, import_rxjs7.firstValueFrom)(semiont.browse.resources(filters).pipe((0, import_operators2.filter)(defined)));
36651
+ const items = await (0, import_rxjs6.firstValueFrom)(semiont.browse.resources(filters).pipe((0, import_operators2.filter)(defined)));
36552
36652
  result = items;
36553
36653
  label = `${items.length} resource${items.length !== 1 ? "s" : ""} found`;
36554
36654
  } else if (subcommand === "resource") {
36555
36655
  const id = toResourceId6(rawResourceId);
36556
- const resourceData = await (0, import_rxjs7.firstValueFrom)(semiont.browse.resource(id).pipe((0, import_operators2.filter)(defined)));
36656
+ const resourceData = await (0, import_rxjs6.firstValueFrom)(semiont.browse.resource(id).pipe((0, import_operators2.filter)(defined)));
36557
36657
  if (options.annotations || options.references) {
36558
- const annotations = options.annotations ? await (0, import_rxjs7.firstValueFrom)(semiont.browse.annotations(id).pipe((0, import_operators2.filter)(defined))) : void 0;
36559
- const referencedBy = options.references ? await (0, import_rxjs7.firstValueFrom)(semiont.browse.referencedBy(id).pipe((0, import_operators2.filter)(defined))) : void 0;
36658
+ const annotations = options.annotations ? await (0, import_rxjs6.firstValueFrom)(semiont.browse.annotations(id).pipe((0, import_operators2.filter)(defined))) : void 0;
36659
+ const referencedBy = options.references ? await (0, import_rxjs6.firstValueFrom)(semiont.browse.referencedBy(id).pipe((0, import_operators2.filter)(defined))) : void 0;
36560
36660
  result = {
36561
36661
  ...resourceData,
36562
36662
  ...annotations ? { annotations } : {},
@@ -36569,11 +36669,11 @@ async function runBrowse(options) {
36569
36669
  } else if (subcommand === "annotation") {
36570
36670
  const resourceId3 = toResourceId6(rawResourceId);
36571
36671
  const annotationId3 = toAnnotationId5(rawAnnotationId);
36572
- result = await (0, import_rxjs7.firstValueFrom)(semiont.browse.annotation(resourceId3, annotationId3).pipe((0, import_operators2.filter)(defined)));
36672
+ result = await (0, import_rxjs6.firstValueFrom)(semiont.browse.annotation(resourceId3, annotationId3).pipe((0, import_operators2.filter)(defined)));
36573
36673
  label = `${rawAnnotationId}: annotation on ${rawResourceId}`;
36574
36674
  } else if (subcommand === "references") {
36575
36675
  const id = toResourceId6(rawResourceId);
36576
- const refs = await (0, import_rxjs7.firstValueFrom)(semiont.browse.referencedBy(id).pipe((0, import_operators2.filter)(defined)));
36676
+ const refs = await (0, import_rxjs6.firstValueFrom)(semiont.browse.referencedBy(id).pipe((0, import_operators2.filter)(defined)));
36577
36677
  result = refs;
36578
36678
  label = `${refs.length} resource${refs.length !== 1 ? "s" : ""} reference ${rawResourceId}`;
36579
36679
  } else if (subcommand === "events") {
@@ -36593,7 +36693,7 @@ async function runBrowse(options) {
36593
36693
  const entries = data?.entries ?? [];
36594
36694
  label = `${entries.length} entr${entries.length !== 1 ? "ies" : "y"} in ${dirPath ?? "/"}`;
36595
36695
  } else {
36596
- const tags = await (0, import_rxjs7.firstValueFrom)(semiont.browse.entityTypes().pipe((0, import_operators2.filter)(defined)));
36696
+ const tags = await (0, import_rxjs6.firstValueFrom)(semiont.browse.entityTypes().pipe((0, import_operators2.filter)(defined)));
36597
36697
  result = tags;
36598
36698
  label = `${tags.length} entity type${tags.length !== 1 ? "s" : ""}`;
36599
36699
  }
@@ -36668,7 +36768,7 @@ init_zod();
36668
36768
  init_command_definition();
36669
36769
  init_base_options_schema();
36670
36770
  import { resourceId as toResourceId7 } from "@semiont/core";
36671
- import { createActorVM as createActorVM3 } from "@semiont/api-client";
36771
+ import { createActorStateUnit } from "@semiont/api-client";
36672
36772
  var ListenOptionsSchema = ApiOptionsSchema.extend({
36673
36773
  args: external_exports.array(external_exports.string()).default([])
36674
36774
  }).superRefine((val, ctx) => {
@@ -36694,7 +36794,7 @@ var ALL_EVENT_TYPES = [
36694
36794
  "mark:unarchived",
36695
36795
  "mark:entity-tag-added",
36696
36796
  "mark:entity-tag-removed",
36697
- "mark:entity-type-added",
36797
+ "frame:entity-type-added",
36698
36798
  "job:started",
36699
36799
  "job:progress",
36700
36800
  "job:completed",
@@ -36709,7 +36809,7 @@ async function runListen(options) {
36709
36809
  let eventCount = 0;
36710
36810
  const label = isResourceScoped ? `Listening for events on resource ${rawResourceId}` : "Listening for global events";
36711
36811
  if (!options.quiet) process.stderr.write(label + " (Ctrl-C to stop)\n");
36712
- const actor = createActorVM3({
36812
+ const actor = createActorStateUnit({
36713
36813
  baseUrl: rawBusUrl,
36714
36814
  token,
36715
36815
  channels: isResourceScoped ? [] : [...ALL_EVENT_TYPES]
@@ -37982,7 +38082,7 @@ async function generateGlobalHelp() {
37982
38082
  }
37983
38083
 
37984
38084
  // src/cli.ts
37985
- var VERSION = "0.5.1";
38085
+ var VERSION = "0.5.2";
37986
38086
  function printVersion() {
37987
38087
  console.log(`Semiont CLI v${VERSION}`);
37988
38088
  }