Polish agent and team sharing and snapshots (#1852)

This commit is contained in:
klopez4212
2026-07-15 18:19:03 +01:00
committed by GitHub
parent c5996e13a4
commit 2f3fa586f3
54 changed files with 4212 additions and 3402 deletions

View File

@@ -27,6 +27,14 @@ export async function fetchMediaBytes(
return new Uint8Array(bytes);
}
/** Write text through the native clipboard after an asynchronous workflow. */
export async function copyTextToSystemClipboard(
text: string,
html?: string,
): Promise<void> {
await invokeTauri("copy_text_to_clipboard", { html, text });
}
/**
* Fetch an agent snapshot attachment in memory, verifying size, SHA-256, and
* snapshot decode before returning the bytes.

View File

@@ -5,12 +5,11 @@ import {
deriveImportPhase,
getProfileSyncFailures,
deriveImportToast,
buildTeamSnapshotSendArgs,
} from "../../features/agents/ui/teamSnapshotImport.lib.ts";
// Behavior tests for the team snapshot import dialog flow and the send-encode
// contract. These import and exercise the actual production functions used by
// TeamSnapshotImportDialog, useTeamActions, and TeamSnapshotSendDialog.
// Behavior tests for the team snapshot import dialog flow. These import and
// exercise the actual production functions used by TeamSnapshotImportDialog
// and useTeamActions.
// ── Factories ────────────────────────────────────────────────────────────────
@@ -236,20 +235,3 @@ test("mixed_member_outcomes_memory_errors_and_profile_sync", () => {
assert.match(toast.message, /2 memory entr/);
assert.match(toast.message, /1 member failed to sync profile/);
});
// ── buildTeamSnapshotSendArgs ────────────────────────────────────────────────
test("buildTeamSnapshotSendArgs_always_uses_png_format", () => {
const args = buildTeamSnapshotSendArgs("team-123", "core");
assert.equal(args.id, "team-123");
assert.equal(args.memoryLevel, "core");
assert.equal(args.format, "png");
});
test("buildTeamSnapshotSendArgs_passes_through_memory_level", () => {
for (const level of ["none", "core", "everything"]) {
const args = buildTeamSnapshotSendArgs("t", level);
assert.equal(args.memoryLevel, level);
assert.equal(args.format, "png", `format must be png for level "${level}"`);
}
});