@cydm/happy-elves 0.1.0-beta.294 → 0.1.0-beta.295

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.
@@ -203,6 +203,17 @@ function metadataTags(metadata) {
203
203
  function isRecord(value) {
204
204
  return typeof value === "object" && value !== null && !Array.isArray(value);
205
205
  }
206
+ function sessionHiddenFromDefaultList(metadata) {
207
+ return metadata?.hiddenFromWorkspace === true ||
208
+ metadata?.visibility === "hidden" ||
209
+ metadata?.source === "dogfood";
210
+ }
211
+ async function defaultListIncludesSession(client, session) {
212
+ if (session.status === "closed")
213
+ return false;
214
+ const metadata = await client.decodeSessionMetadata(session);
215
+ return !sessionHiddenFromDefaultList(metadata);
216
+ }
206
217
  function diagnosticSessionMetadata(metadata) {
207
218
  const runtime = isRecord(metadata.runtime) ? metadata.runtime : {};
208
219
  return {
@@ -428,7 +439,9 @@ export async function handleSession({ domain, action, positional, flags }) {
428
439
  name: typeof flags.name === "string" ? flags.name : undefined,
429
440
  ...(tags.length > 0 ? { tags } : {}),
430
441
  });
431
- const visibleSessions = flags.all === true ? allSessions : allSessions.filter((session) => session.status !== "closed");
442
+ const visibleSessions = flags.all === true
443
+ ? allSessions
444
+ : (await Promise.all(allSessions.map(async (session) => (await defaultListIncludesSession(client, session) ? session : undefined)))).filter((session) => Boolean(session));
432
445
  const { items: sessions, page } = selectWindow(visibleSessions, flags, 20);
433
446
  if (wantsJson(flags) || wantsVerbose(flags)) {
434
447
  const machinesById = new Map();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cydm/happy-elves-cli",
3
- "version": "0.1.0-beta.294",
3
+ "version": "0.1.0-beta.295",
4
4
  "private": true,
5
5
  "type": "module"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cydm/happy-elves-daemon",
3
- "version": "0.1.0-beta.294",
3
+ "version": "0.1.0-beta.295",
4
4
  "private": true,
5
5
  "type": "module"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cydm/happy-elves",
3
- "version": "0.1.0-beta.294",
3
+ "version": "0.1.0-beta.295",
4
4
  "description": "Remote controller for local coding agents with hosted or self-hosted relay support.",
5
5
  "type": "module",
6
6
  "bin": {