@aiyiran/myclaw 1.0.216 → 1.0.217

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.
@@ -312,8 +312,6 @@
312
312
  var nameSpan = document.createElement('span');
313
313
  nameSpan.textContent = pathParts[pathParts.length - 1] || asset.name || '未命名';
314
314
  nameSpan.title = asset.path || '';
315
- fname.appendChild(nameSpan);
316
-
317
315
  // [最新] 优先于 [有更新]
318
316
  if (isLatest && !isLatestSeen) {
319
317
  var badge = document.createElement('span');
@@ -327,6 +325,8 @@
327
325
  fname.appendChild(badge);
328
326
  }
329
327
 
328
+ fname.appendChild(nameSpan);
329
+
330
330
  row.appendChild(time);
331
331
  row.appendChild(fname);
332
332
  container.appendChild(row);
@@ -566,14 +566,33 @@
566
566
  titleInput.style.borderColor = '#ff4444';
567
567
  return;
568
568
  }
569
- var publishData = {
569
+ var agentName = getAgentName() || 'main';
570
+ var wsField = agentName === 'main' ? 'workspace' : 'workspace-' + agentName;
571
+ var clawVal = window.location.hostname.split('.')[0];
572
+ var payload = {
570
573
  title: titleVal,
574
+ workspace: wsField,
571
575
  cover_path: coverSelect.value || '',
572
576
  entry_path: entrySelect.value || '',
573
- published_at: new Date().toISOString(),
577
+ claw: clawVal,
574
578
  };
575
- console.log('[myclaw-artifacts-publish]', JSON.stringify(publishData));
576
- closePublishModal();
579
+ submitBtn.disabled = true;
580
+ submitBtn.textContent = '\u53D1\u5E03\u4E2D...';
581
+ fetch('https://www.yiranlaoshi.com/api/student_workspace_create', {
582
+ method: 'POST',
583
+ headers: { 'Content-Type': 'application/json' },
584
+ body: JSON.stringify(payload),
585
+ })
586
+ .then(function (res) { return res.json(); })
587
+ .then(function (data) {
588
+ console.log('[myclaw-artifacts-publish]', payload, data);
589
+ closePublishModal();
590
+ })
591
+ .catch(function (err) {
592
+ console.error('[myclaw-artifacts-publish] \u53D1\u5E03\u5931\u8D25:', err);
593
+ submitBtn.disabled = false;
594
+ submitBtn.textContent = '\u786E\u8BA4\u53D1\u5E03';
595
+ });
577
596
  };
578
597
 
579
598
  box.appendChild(header);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiyiran/myclaw",
3
- "version": "1.0.216",
3
+ "version": "1.0.217",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {