mirror of
https://github.com/block/buzz.git
synced 2026-11-01 23:11:58 +00:00
Polish agent and team sharing and snapshots (#1852)
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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}"`);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user