@autohq/cli 0.1.238 → 0.1.240

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.
@@ -23340,7 +23340,7 @@ Object.assign(lookup, {
23340
23340
  // package.json
23341
23341
  var package_default = {
23342
23342
  name: "@autohq/cli",
23343
- version: "0.1.238",
23343
+ version: "0.1.240",
23344
23344
  license: "SEE LICENSE IN README.md",
23345
23345
  publishConfig: {
23346
23346
  access: "public"
package/dist/index.js CHANGED
@@ -21834,20 +21834,40 @@ function secretPath(organizationId, projectId, name) {
21834
21834
  }
21835
21835
  function runListSearchParams(options) {
21836
21836
  const searchParams = [];
21837
- if (options.includeArchived) {
21837
+ if (options.archived) {
21838
+ searchParams.push(["archived", options.archived]);
21839
+ } else if (options.includeArchived) {
21838
21840
  searchParams.push(["include_archived", "true"]);
21839
21841
  }
21842
+ for (const agentName of options.agentNames ?? []) {
21843
+ searchParams.push(["agent", agentName]);
21844
+ }
21840
21845
  for (const status of options.statuses ?? []) {
21841
21846
  searchParams.push(["status", status]);
21842
21847
  }
21843
21848
  if (options.since) {
21844
21849
  searchParams.push(["created_after", options.since]);
21845
21850
  }
21851
+ if (options.createdBefore) {
21852
+ searchParams.push(["created_before", options.createdBefore]);
21853
+ }
21854
+ if (options.orderBy) {
21855
+ searchParams.push(["order_by", listRunsOrderByParam(options.orderBy)]);
21856
+ }
21846
21857
  if (options.limit !== void 0) {
21847
21858
  searchParams.push(["limit", String(options.limit)]);
21848
21859
  }
21849
21860
  return searchParams;
21850
21861
  }
21862
+ function listRunsOrderByParam(orderBy) {
21863
+ if (orderBy === "updatedAt") {
21864
+ return "updated_at";
21865
+ }
21866
+ if (orderBy === "duration") {
21867
+ return "duration";
21868
+ }
21869
+ return "created_at";
21870
+ }
21851
21871
  var init_client = __esm({
21852
21872
  "src/lib/api/client.ts"() {
21853
21873
  "use strict";
@@ -22390,7 +22410,7 @@ var init_package = __esm({
22390
22410
  "package.json"() {
22391
22411
  package_default = {
22392
22412
  name: "@autohq/cli",
22393
- version: "0.1.238",
22413
+ version: "0.1.240",
22394
22414
  license: "SEE LICENSE IN README.md",
22395
22415
  publishConfig: {
22396
22416
  access: "public"
@@ -28162,7 +28182,9 @@ function agentSessionsQueryOptions(client, agentName, apiUrl, includeArchived =
28162
28182
  queryFn: async () => {
28163
28183
  const res = await client.listAgentSessions(agentName ?? "", {
28164
28184
  apiBaseUrl: apiUrl,
28185
+ archived: includeArchived ? "archived" : "active",
28165
28186
  includeArchived,
28187
+ orderBy: "updatedAt",
28166
28188
  // The session-list routes default to 50; ask for the server max so the
28167
28189
  // TUI keeps showing deep history.
28168
28190
  limit: TUI_SESSION_LIST_LIMIT
@@ -28179,7 +28201,9 @@ function sessionsQueryOptions(client, apiUrl, includeArchived = false) {
28179
28201
  queryFn: async () => {
28180
28202
  const res = await client.listSessions({
28181
28203
  apiBaseUrl: apiUrl,
28204
+ archived: includeArchived ? "archived" : "active",
28182
28205
  includeArchived,
28206
+ orderBy: "updatedAt",
28183
28207
  limit: TUI_SESSION_LIST_LIMIT
28184
28208
  });
28185
28209
  return res.sessions;
@@ -28545,8 +28569,6 @@ function errorMessage4(session) {
28545
28569
  function sessionsForArchiveMode(sessions, showArchived) {
28546
28570
  return sessions.filter(
28547
28571
  (session) => showArchived ? Boolean(session.archivedAt) : !session.archivedAt
28548
- ).slice().sort(
28549
- (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
28550
28572
  );
28551
28573
  }
28552
28574
  var COL_SELECTED, COL_ID, COL_STATUS2, COL_AGENT, COL_TRIGGER, COL_STARTED, COL_DURATION, ROW_GAP_COUNT2, EMPTY_SELECTED_RUN_IDS, CHROME_ROWS;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.238",
3
+ "version": "0.1.240",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"