@agent-link/server 0.1.186 → 0.1.187

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-link/server",
3
- "version": "0.1.186",
3
+ "version": "0.1.187",
4
4
  "description": "AgentLink relay server",
5
5
  "license": "MIT",
6
6
  "repository": {
package/web/app.js CHANGED
@@ -854,7 +854,7 @@ const App = {
854
854
  },
855
855
  workdirMenuCopyPath() {
856
856
  workdirMenuOpen.value = false;
857
- navigator.clipboard.writeText(workDir.value);
857
+ fileBrowser.copyToClipboard(workDir.value);
858
858
  },
859
859
  // Memory management
860
860
  memoryPanelOpen, memoryFiles, memoryDir, memoryLoading,
@@ -256,13 +256,31 @@ export function createFileBrowser(deps) {
256
256
  });
257
257
  }
258
258
 
259
+ function copyToClipboard(text) {
260
+ // Use ClipboardItem with explicit text/plain to prevent Chrome (especially
261
+ // mobile) from URL-encoding paths that look like URL schemes (e.g. Q:\...)
262
+ if (navigator.clipboard && window.ClipboardItem) {
263
+ const blob = new Blob([text], { type: 'text/plain' });
264
+ const item = new ClipboardItem({ 'text/plain': blob });
265
+ return navigator.clipboard.write([item]);
266
+ }
267
+ // Fallback for older browsers
268
+ const textarea = document.createElement('textarea');
269
+ textarea.value = text;
270
+ textarea.style.position = 'fixed';
271
+ textarea.style.opacity = '0';
272
+ document.body.appendChild(textarea);
273
+ textarea.select();
274
+ document.execCommand('copy');
275
+ document.body.removeChild(textarea);
276
+ return Promise.resolve();
277
+ }
278
+
259
279
  function copyPath() {
260
280
  const menu = fileContextMenu.value;
261
281
  if (!menu) return;
262
282
  const path = menu.path;
263
- navigator.clipboard.writeText(path).catch(() => {
264
- // Fallback: some browsers block clipboard in non-secure contexts
265
- });
283
+ copyToClipboard(path).catch(() => {});
266
284
  // Brief "Copied!" feedback — store temporarily in menu state
267
285
  fileContextMenu.value = { ...menu, copied: true };
268
286
  setTimeout(() => {
@@ -369,6 +387,7 @@ export function createFileBrowser(deps) {
369
387
  closeContextMenu,
370
388
  askClaudeRead,
371
389
  copyPath,
390
+ copyToClipboard,
372
391
  insertPath,
373
392
  refreshTree,
374
393
  handleDirectoryListing,