@rogatio/cli 6.6.2 → 6.6.4

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.
@@ -479,6 +479,10 @@
479
479
  font-size: 0.9rem;
480
480
  line-height: 1;
481
481
  }
482
+ .rogatio-editor [data-group-list-section] {
483
+ display: grid;
484
+ gap: 0.85rem;
485
+ }
482
486
  .rogatio-editor [data-group-list] {
483
487
  list-style: none;
484
488
  margin: 0;
@@ -497,6 +501,13 @@
497
501
  background: var(--rogatio-card-group);
498
502
  padding: 0.65rem 0.85rem;
499
503
  }
504
+ .rogatio-editor [data-group-row-actions] {
505
+ display: flex;
506
+ flex-wrap: wrap;
507
+ align-items: center;
508
+ gap: 0.5rem;
509
+ margin-left: auto;
510
+ }
500
511
  .rogatio-editor [data-rules-section] {
501
512
  display: grid;
502
513
  gap: 0.85rem;
@@ -3732,17 +3732,7 @@ var EditorControllerImpl = class {
3732
3732
  );
3733
3733
  }
3734
3734
  tools.append(this.createCommandButton("Validate", "validate", this.saving));
3735
- if (this.route.kind === "project") {
3736
- tools.append(
3737
- this.createCommandButton(
3738
- "Add group",
3739
- "add-group",
3740
- this.saving,
3741
- {},
3742
- "primary"
3743
- )
3744
- );
3745
- } else if (this.route.kind === "test") {
3735
+ if (this.route.kind === "test") {
3746
3736
  tools.append(
3747
3737
  this.createCommandButton(
3748
3738
  "Run test",
@@ -3868,10 +3858,12 @@ var EditorControllerImpl = class {
3868
3858
  dock.append(row);
3869
3859
  }
3870
3860
  /**
3871
- * Repeats the actions a long page would otherwise hide: under the last rule,
3872
- * under the project group list, or under the test results.
3861
+ * Repeats the actions a long page would otherwise hide: under the last rule
3862
+ * on a group page, or under the test results. The project page stays short,
3863
+ * so Add group lives on the Groups heading and that route has no ledger.
3873
3864
  */
3874
3865
  renderActionDock() {
3866
+ if (this.route.kind === "project") return;
3875
3867
  const dock = this.document.createElement("section");
3876
3868
  dock.dataset.actionDock = "end";
3877
3869
  dock.setAttribute("aria-label", "Repeated actions");
@@ -3898,19 +3890,6 @@ var EditorControllerImpl = class {
3898
3890
  this.createGroupActionClusters(groupId, groupName)
3899
3891
  );
3900
3892
  }
3901
- } else if (this.route.kind === "project") {
3902
- const addGroup = this.document.createElement("div");
3903
- addGroup.dataset.actionCluster = "safe";
3904
- addGroup.append(
3905
- this.createCommandButton(
3906
- "Add group",
3907
- "add-group",
3908
- this.saving,
3909
- {},
3910
- "primary"
3911
- )
3912
- );
3913
- this.appendDockRow(dock, "Groups", addGroup);
3914
3893
  } else {
3915
3894
  const run = this.document.createElement("div");
3916
3895
  run.dataset.actionCluster = "safe";
@@ -3956,9 +3935,21 @@ var EditorControllerImpl = class {
3956
3935
  this.form.append(fields);
3957
3936
  const groups = this.document.createElement("section");
3958
3937
  groups.dataset.groupListSection = "true";
3938
+ const groupsHeadingRow = this.document.createElement("div");
3939
+ groupsHeadingRow.dataset.sectionHeading = "true";
3959
3940
  const groupsHeading = this.document.createElement("h2");
3960
3941
  groupsHeading.textContent = "Groups";
3961
- groups.append(groupsHeading);
3942
+ groupsHeadingRow.append(
3943
+ groupsHeading,
3944
+ this.createCommandButton(
3945
+ "Add group",
3946
+ "add-group",
3947
+ this.saving,
3948
+ {},
3949
+ "primary"
3950
+ )
3951
+ );
3952
+ groups.append(groupsHeadingRow);
3962
3953
  if (this.draft.groups.length === 0) {
3963
3954
  const empty = this.document.createElement("p");
3964
3955
  empty.textContent = "No groups yet.";
@@ -3971,13 +3962,13 @@ var EditorControllerImpl = class {
3971
3962
  const groupName = displayName(group.name, "Unnamed group");
3972
3963
  const item = this.document.createElement("li");
3973
3964
  item.dataset.groupRow = "true";
3974
- const open = this.createButton(
3975
- `Edit group ${groupName}`,
3976
- `route:group:${groupId}`
3977
- );
3965
+ const open = this.createButton(groupName, `route:group:${groupId}`);
3978
3966
  open.dataset.route = "group";
3979
3967
  open.dataset.groupId = groupId;
3980
3968
  open.dataset.btn = "secondary";
3969
+ open.setAttribute("aria-label", `Open group ${groupName}`);
3970
+ const actions = this.document.createElement("div");
3971
+ actions.dataset.groupRowActions = "true";
3981
3972
  const copy = this.createCommandButton(
3982
3973
  "Copy group",
3983
3974
  "copy-group",
@@ -3993,7 +3984,8 @@ var EditorControllerImpl = class {
3993
3984
  "danger"
3994
3985
  );
3995
3986
  remove.setAttribute("aria-label", `Remove group ${groupName}`);
3996
- item.append(open, copy, remove);
3987
+ actions.append(copy, remove);
3988
+ item.append(open, actions);
3997
3989
  list.append(item);
3998
3990
  }
3999
3991
  groups.append(list);
@@ -25210,8 +25210,68 @@ async function runNativeHost(options) {
25210
25210
  }
25211
25211
  await host.start();
25212
25212
  const stdin = options.stdin ?? process.stdin;
25213
- if (options.onReady) options.onReady();
25213
+ stdout.on("error", (error) => {
25214
+ if (error.code === "EPIPE") return;
25215
+ console.error("[rogatio-host] stdout error:", error.message);
25216
+ });
25214
25217
  let buffer = Buffer2.alloc(0);
25218
+ let commandChain = Promise.resolve();
25219
+ let pumping = false;
25220
+ function writeResponse2(response) {
25221
+ if (response && stdout.writable) {
25222
+ console.error(
25223
+ "[rogatio-host] writing response:",
25224
+ response.length,
25225
+ "bytes"
25226
+ );
25227
+ stdout.write(Buffer2.from(response));
25228
+ return;
25229
+ }
25230
+ console.error("[rogatio-host] no response to write");
25231
+ }
25232
+ function isHostReply(frame) {
25233
+ try {
25234
+ const envelope = decodeEnvelopeFrame(frame);
25235
+ return typeof envelope.requestId === "string" && envelope.requestId.startsWith("host-");
25236
+ } catch {
25237
+ return false;
25238
+ }
25239
+ }
25240
+ function dispatch(frame) {
25241
+ if (isHostReply(frame)) {
25242
+ void host.processFrame(frame).then(writeResponse2);
25243
+ return;
25244
+ }
25245
+ commandChain = commandChain.then(async () => {
25246
+ console.error(
25247
+ "[rogatio-host] processing frame:",
25248
+ frame.byteLength,
25249
+ "bytes"
25250
+ );
25251
+ writeResponse2(await host.processFrame(frame));
25252
+ }).catch((error) => {
25253
+ console.error(
25254
+ "[rogatio-host] frame failed:",
25255
+ error instanceof Error ? error.message : String(error)
25256
+ );
25257
+ });
25258
+ }
25259
+ function pump() {
25260
+ if (pumping) return;
25261
+ pumping = true;
25262
+ try {
25263
+ for (; ; ) {
25264
+ if (buffer.length < 4) break;
25265
+ const length = buffer.readUInt32LE(0);
25266
+ if (buffer.length < 4 + length) break;
25267
+ const frame = Buffer2.from(buffer.subarray(0, 4 + length));
25268
+ buffer = buffer.subarray(4 + length);
25269
+ dispatch(frame);
25270
+ }
25271
+ } finally {
25272
+ pumping = false;
25273
+ }
25274
+ }
25215
25275
  stdin.on("data", (chunk) => {
25216
25276
  const buf = Buffer2.isBuffer(chunk) ? Buffer2.from(chunk) : Buffer2.from(chunk);
25217
25277
  console.error(
@@ -25221,36 +25281,14 @@ async function runNativeHost(options) {
25221
25281
  buffer.length
25222
25282
  );
25223
25283
  buffer = Buffer2.concat([buffer, buf]);
25224
- void (async () => {
25225
- for (; ; ) {
25226
- if (buffer.length < 4) break;
25227
- const length = buffer.readUInt32LE(0);
25228
- if (buffer.length < 4 + length) break;
25229
- const frame = new Uint8Array(
25230
- buffer.buffer,
25231
- buffer.byteOffset,
25232
- 4 + length
25233
- );
25234
- console.error("[rogatio-host] processing frame:", 4 + length, "bytes");
25235
- const response = await host.processFrame(frame);
25236
- buffer = buffer.subarray(4 + length);
25237
- if (response && stdout.writable) {
25238
- console.error(
25239
- "[rogatio-host] writing response:",
25240
- response.length,
25241
- "bytes"
25242
- );
25243
- stdout.write(Buffer2.from(response));
25244
- } else {
25245
- console.error("[rogatio-host] no response to write");
25246
- }
25247
- }
25248
- })();
25284
+ pump();
25249
25285
  });
25250
25286
  await new Promise((resolve22) => {
25251
25287
  stdin.on("end", () => {
25252
- void host.stop().then(resolve22);
25288
+ void commandChain.finally(() => host.stop()).then(() => resolve22());
25253
25289
  });
25290
+ if (options.onReady) options.onReady();
25291
+ pump();
25254
25292
  });
25255
25293
  }
25256
25294
  var NATIVE_FRAME_MAX_BYTES = 64 * 1024;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogatio/cli",
3
- "version": "6.6.2",
3
+ "version": "6.6.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Local-first browser request and response rules — editor host, file verification, test runner, and runtime dispatch.",