MCPcopy Create free account
hub / github.com/astercloud/aster / copy

Function copy

ui/src/composables/useClipboard.ts:13–35  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

11 const error = ref<Error | null>(null);
12
13 async function copy(text: string): Promise<boolean> {
14 if (!isSupported.value) {
15 error.value = new Error("Clipboard API not supported");
16 return false;
17 }
18
19 try {
20 await navigator.clipboard.writeText(text);
21 copied.value = true;
22 error.value = null;
23
24 // 2秒后重置状态
25 setTimeout(() => {
26 copied.value = false;
27 }, 2000);
28
29 return true;
30 } catch (err) {
31 error.value = err as Error;
32 copied.value = false;
33 return false;
34 }
35 }
36
37 async function read(): Promise<string | null> {
38 if (!isSupported.value) {

Callers 15

ListToolsMethod · 0.85
GetAuditLogMethod · 0.85
removeToolResponsesMethod · 0.85
NewStackFunction · 0.85
RankByQualityFunction · 0.85
GetTopPreferencesMethod · 0.85
calculateP99DurationMethod · 0.85
NotifyStepMethod · 0.85
GetHistoryMethod · 0.85
RunPreHooksMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected