@biunow/agent-biuart 0.1.2 → 0.1.3

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/manifest.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 1,
3
3
  "id": "biuart",
4
4
  "name": "BiuArt",
5
- "version": "0.1.2",
5
+ "version": "0.1.3",
6
6
  "publisher": "Biunow",
7
7
  "description": "BiuArt 艺术动画:锁定一种画风,用代码画出会动的画面,一镜一镜渲成片。",
8
8
  "entry": {
@@ -45,8 +45,8 @@
45
45
  "requiresEntitlement": "export"
46
46
  },
47
47
  "integrity": {
48
- "sha256": "f6fca5f754b9d3c4fb1df85456d1b83232b58c3c14578a547816bfde8a1f88e1",
49
- "signature": "mxu0dAVRKJFWK4dOJRH7rn5rkd3Phe/uX6xnGKl+08yQMLZY7m0U+b48JK7JISI2VhPDc31oRhUqLTdz2f50Bw==",
48
+ "sha256": "abffc8170429a312a02a0275b661336f2c30e652d83e553140eba0e395d501bb",
49
+ "signature": "mf5AuMQ3vXjnbUpfdpt0Lqi/BxYGeCllJo6W6W2xFuGG0ASAAOEtXwHnpeZkKML+Q6jUacjyyABaR5+ewsbUDA==",
50
50
  "signedBy": "publisher-key"
51
51
  }
52
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biunow/agent-biuart",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "BiuArt",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
package/studio/app.js CHANGED
@@ -79,14 +79,14 @@
79
79
  state.style = item?.id || state.style;
80
80
  if (!item) return;
81
81
  $('style-group').textContent = item.group || '—';
82
- const parts = [item.summary || '', item.previewable ? '可试渲染 2 秒。' : '参数化片段,由代码按 spec 渲染。'];
82
+ const parts = [item.summary || '', item.previewable ? '可试渲染 2 秒。' : '这一种直接出片,不做试渲染。'];
83
83
  $('style-summary').textContent = parts.filter(Boolean).join(' ');
84
84
  const canPreview = !!item.previewable && state.meta.enginePresent;
85
85
  $('preview').disabled = !canPreview;
86
- $('preview').title = canPreview ? '渲一段示例看画风' : (item.previewable ? '引擎未安装' : '这个语法没有内置示例场景');
86
+ $('preview').title = canPreview ? '渲一段示例看画风' : (item.previewable ? '画风样本准备中' : '这一种没有试渲染');
87
87
  $('preview-status').textContent = item.previewable
88
- ? (state.meta.enginePresent ? '示例场景可用。' : '引擎未安装。')
89
- : '解说语法走 spec,不提供内置预览。';
88
+ ? (state.meta.enginePresent ? '示例场景可用。' : '样本准备中。')
89
+ : '';
90
90
  }
91
91
 
92
92
  /* ---------- 小选择器:时长 / 画幅 ---------- */
@@ -216,6 +216,7 @@
216
216
  host.prepend(el);
217
217
  }
218
218
  const mp4 = job.outputMp4 && /\.mp4$/i.test(job.outputMp4);
219
+ el.className = `job${mp4 ? ' playable' : ''}`;
219
220
  el.innerHTML = `
220
221
  <div class="job-top">
221
222
  <div class="job-title">${escapeHtml(job.title || job.styleName || '任务')}</div>
@@ -223,13 +224,45 @@
223
224
  </div>
224
225
  <div class="job-msg">${escapeHtml(job.message || '')}</div>
225
226
  <div class="job-bar"><span style="width:${Math.max(0, Math.min(100, Number(job.progress) || 0))}%"></span></div>
226
- ${mp4 ? `<video class="job-video" controls playsinline preload="metadata" src="/api/file?path=${encodeURIComponent(job.outputMp4)}"></video>` : ''}
227
- <div class="job-actions">
228
- ${job.projectPath ? `<span class="job-msg">${escapeHtml(job.projectPath)}</span>` : ''}
229
- ${job.error ? `<span class="job-msg">${escapeHtml(job.error)}</span>` : ''}
230
- </div>
227
+ ${mp4 ? '<div class="job-play">▷ 点击播放成片</div>' : ''}
228
+ ${job.error ? `<div class="job-msg">${escapeHtml(job.error)}</div>` : ''}
231
229
  `;
230
+ el.onclick = mp4 ? () => openFilm(job) : null;
231
+ }
232
+ }
233
+
234
+ /* ---------- 成片弹窗 ---------- */
235
+ function openFilm(job) {
236
+ let back = document.querySelector('.film-modal');
237
+ if (!back) {
238
+ back = document.createElement('div');
239
+ back.className = 'film-modal';
240
+ back.innerHTML = `
241
+ <div class="film-modal-card" role="dialog" aria-modal="true">
242
+ <div class="film-modal-bar">
243
+ <strong></strong>
244
+ <button type="button" class="film-modal-x" aria-label="关闭">×</button>
245
+ </div>
246
+ <video controls playsinline></video>
247
+ </div>`;
248
+ document.body.appendChild(back);
249
+ const close = () => {
250
+ const video = back.querySelector('video');
251
+ video.pause();
252
+ video.removeAttribute('src');
253
+ video.load();
254
+ back.hidden = true;
255
+ };
256
+ back.querySelector('.film-modal-x').addEventListener('click', close);
257
+ back.addEventListener('click', (e) => { if (e.target === back) close(); });
258
+ document.addEventListener('keydown', (e) => { if (e.key === 'Escape') close(); });
232
259
  }
260
+ back.querySelector('strong').textContent = job.title || job.styleName || '成片';
261
+ const src = `/api/jobs/${encodeURIComponent(job.id)}/film`;
262
+ const video = back.querySelector('video');
263
+ video.src = src;
264
+ back.hidden = false;
265
+ video.play().catch(() => {});
233
266
  }
234
267
 
235
268
  function stateLabel(status) {
@@ -341,15 +374,14 @@
341
374
  updateCharHint();
342
375
  updateStoryboardHint();
343
376
  const chips = [];
344
- chips.push(`<span class="chip ${state.meta.enginePresent ? '' : 'bad'}">${state.meta.enginePresent ? '引擎已就绪' : '引擎未安装'}</span>`);
345
- if (!state.meta.canExport) chips.push('<span class="chip warn">未激活</span>');
377
+ chips.push(`<span class="chip ${state.meta.enginePresent ? '' : 'warn'}">${state.meta.enginePresent ? '画风已就绪' : '画风准备中'}</span>`);
378
+ if (!state.meta.canExport) chips.push('<span class="chip bad">未授权</span>');
379
+ chips.push(`<span class="chip">${state.meta.styles.length} 种画风</span>`);
346
380
  $('health-chips').innerHTML = chips.join('');
347
- $('engine-line').textContent = state.meta.enginePresent
348
- ? `Engine: ${state.meta.engineRoot}`
349
- : 'ENGINE_ROOT 未设置:把面板 settings.engineRoots["biuart"] 指向 huashu-art-motion/scripts/engine。';
350
381
  if (!state.meta.enginePresent) {
351
382
  $('preview').disabled = true;
352
383
  $('submit').disabled = true;
384
+ showError('BiuArt 暂时还没准备好,请稍后再试;一直不行请联系客服。');
353
385
  }
354
386
  await refreshJobs();
355
387
  setInterval(refreshJobs, 3000);
package/studio/index.html CHANGED
@@ -14,7 +14,6 @@
14
14
  <div class="eyebrow">BIUART · ART MOTION</div>
15
15
  <h1>把画风写成会动的代码</h1>
16
16
  <p class="hero-desc">选一种画风,写下要讲的事。BiuArt 先出镜头表,再逐帧渲成片;画面由代码绘制,不靠拼图转场。</p>
17
- <div class="sub" id="engine-line">正在检查引擎…</div>
18
17
  </div>
19
18
  <div class="hero-aside">
20
19
  <div class="hero-badge">
package/studio/styles.css CHANGED
@@ -59,6 +59,12 @@
59
59
  .job-bar { height: 4px; border-radius: 99px; background: #ededE7; margin-top: 8px; overflow: hidden; }
60
60
  .job-bar > span { display: block; height: 100%; background: var(--accent-deep); transition: width .3s ease; }
61
61
  .job-video { width: 100%; border-radius: 8px; margin-top: 8px; background: #111; }
62
+ .job.playable { cursor: pointer; }
63
+ .job.playable:hover { border-color: var(--accent-deep); background: #fbfdf2; }
64
+ .job-play {
65
+ margin-top: 8px; font-size: 11px; font-weight: 650; color: #4d5c16;
66
+ background: var(--accent-soft); border-radius: 99px; padding: 4px 10px; display: inline-block;
67
+ }
62
68
  .job-actions { display: flex; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
63
69
  .job-actions a { font-size: 11px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
64
70
  .empty { color: var(--muted-2); font-size: 12px; padding: 8px 0; }