Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/selectors/src/internal/build.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { uniqueStrings } from '@agent-device/kernel/collections';
import type { Platform, PublicPlatform } from '@agent-device/kernel/device';
import type { SnapshotNode } from '@agent-device/kernel/snapshot';
import { isNodeVisible } from './node.ts';
Expand Down Expand Up @@ -101,10 +102,6 @@ function selectableId(
return idMatchCountInTree(nodes, canonicalId) > 1 ? null : id;
}

function uniqueStrings(values: readonly string[]): string[] {
return Array.from(new Set(values));
}

function quoteSelectorValue(value: string): string {
return JSON.stringify(value);
}
Expand Down
5 changes: 1 addition & 4 deletions src/platforms/apple/core/perf-frame.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { uniqueStrings } from '@agent-device/kernel/collections';
import { roundOneDecimal, roundPercent } from '../../perf-utils.ts';
import { parseXmlDocumentSync, type XmlNode } from '@agent-device/xml';
import {
Expand Down Expand Up @@ -275,7 +276,3 @@ function readDirectProcess(element: XmlNode | undefined): { pid?: number; name?:
name: name.length > 0 ? name : undefined,
};
}

function uniqueStrings(values: string[]): string[] {
return [...new Set(values)];
}
9 changes: 4 additions & 5 deletions src/platforms/web/agent-browser-lifecycle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import crypto from 'node:crypto';
import fs from 'node:fs';
import path from 'node:path';
import { uniqueStrings } from '@agent-device/kernel/collections';
import { emitDiagnostic } from '../../utils/diagnostics.ts';
import {
expandProcessTree,
Expand Down Expand Up @@ -116,7 +117,9 @@ export async function cleanupManagedAgentBrowserOrphans(
reason: 'daemon-startup' | 'provider-startup',
options: AgentBrowserCleanupOptions = {},
): Promise<AgentBrowserCleanupResult> {
const openWebSessionNames = uniqueStrings([...(options.openWebSessionNames ?? [])]);
const openWebSessionNames = uniqueStrings(
(options.openWebSessionNames ?? []).filter((value) => value.length > 0),
);
if (openWebSessionNames.length > 0) {
return skippedCleanupResult('open-web-session', { openWebSessionNames });
}
Expand Down Expand Up @@ -202,10 +205,6 @@ function managedBrowserHomeMarkers(status: AgentBrowserToolStatus): string[] {
]);
}

function uniqueStrings(values: string[]): string[] {
return [...new Set(values.filter((value) => value.length > 0))];
}

function skippedCleanupResult(
reason: AgentBrowserCleanupSkipReason,
details: Omit<NonNullable<AgentBrowserCleanupResult['skipped']>, 'reason'>,
Expand Down
Loading