@impulselab/hepha 0.2.650 → 0.2.652

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/index.js CHANGED
@@ -367,7 +367,7 @@ SESSIONS
367
367
  hepha sessions get <id>
368
368
  hepha sessions logs <id> [--after <sequence>] [--limit N] [--follow]
369
369
  hepha sessions send <id> "<message>"
370
- hepha sessions pause|resume|archive <id>
370
+ hepha sessions pause|resume|trash <id>
371
371
  hepha sessions kill <id> [--reason "\u2026"]
372
372
  hepha sessions checks|pr|verify <id>
373
373
 
@@ -3769,7 +3769,7 @@ var ACTIONS4 = [
3769
3769
  "pause",
3770
3770
  "resume",
3771
3771
  "kill",
3772
- "archive",
3772
+ "trash",
3773
3773
  "checks",
3774
3774
  "pr",
3775
3775
  "verify"
@@ -3777,8 +3777,7 @@ var ACTIONS4 = [
3777
3777
  var CONTROL_PATHS = {
3778
3778
  pause: "pause",
3779
3779
  resume: "resume",
3780
- kill: "kill",
3781
- archive: "archive"
3780
+ kill: "kill"
3782
3781
  };
3783
3782
  var STATUS_GROUPS = ["active", "waiting", "done"];
3784
3783
  var SESSION_FIELDS = {
@@ -3922,6 +3921,23 @@ var sessionActions = {
3922
3921
  send: sendSessionMessage
3923
3922
  };
3924
3923
 
3924
+ // src/commands/sessions/trash-session.ts
3925
+ async function trashSession(sessionId, asJson) {
3926
+ const result = expectShape(
3927
+ await api(path`/sessions/${sessionId}`, { method: "DELETE" }),
3928
+ "DELETE /sessions/{id}",
3929
+ {
3930
+ sessionId: (value) => value === sessionId,
3931
+ deletedAt: (value) => value === null || typeof value === "string" && Number.isFinite(Date.parse(value))
3932
+ }
3933
+ );
3934
+ if (asJson) {
3935
+ out.json(result);
3936
+ return;
3937
+ }
3938
+ out.line(`Trashed ${out.safe(result.sessionId)}`);
3939
+ }
3940
+
3925
3941
  // src/commands/detail/detail.ts
3926
3942
  function detail(payload, endpoint) {
3927
3943
  return expectShape(payload, endpoint, SESSION_FIELDS);
@@ -3954,6 +3970,10 @@ async function runSessionOperation(parsed, action, asJson) {
3954
3970
  ...action === "kill" ? { flags: ["reason"] } : {}
3955
3971
  });
3956
3972
  const sessionId = args.required(parsed, 1, "sessionId");
3973
+ if (action === "trash") {
3974
+ await trashSession(sessionId, asJson);
3975
+ return;
3976
+ }
3957
3977
  if (action === "get") {
3958
3978
  const session = detail(
3959
3979
  await api(path`/sessions/${sessionId}`),