@windypro-rourou/dsh-eda 0.1.6 → 0.1.8
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/lib/capabilities.js +1 -1
- package/lib/index.js +17 -9
- package/package.json +1 -1
package/lib/capabilities.js
CHANGED
|
@@ -98,7 +98,7 @@ export const CAPABILITIES = [
|
|
|
98
98
|
domain: '已知边界',
|
|
99
99
|
note: '官方 API 缺陷清单(实测)',
|
|
100
100
|
methods: [
|
|
101
|
-
{ name: 'PCB
|
|
101
|
+
{ name: 'PCB 层能力矩阵(真机实测)', desc: 'Polyline 覆盖 14/16 层(丝印/阻焊/锡膏/装配/板框/文档/机械/钻孔;缺 12 多层、57 飞线);Fill 13/16;PCB 文本 11/16(锡膏 7/8、板框 11、多层 12、飞线 57 不可);Line/Arc/Region 基本仅铜层(Region 另支持 12 多层);Polyline.modify({layer}) 可跨层移动、String.modify({text}) 可改文本;57 飞线层全图元不可写' },
|
|
102
102
|
{ name: '桥异步任务 /tasks', desc: '长操作(自动布线/大导出/批量写回)用 eda_task 提交;/execute 超时返回 HTTP 504 + taskId 且任务不取消(迟到结果保留)——桥已打社区补丁 #16' },
|
|
103
103
|
{ name: 'PCB 写回顺序', desc: '必须先建过孔、后建走线(反序产生大量 Connection Error);改铜皮后跑 DRC 前先 rebuildCopperRegion()+save(Issues #23)' },
|
|
104
104
|
{ name: 'DRC 条目', desc: 'obj1.suffix 不是图元 ID(真 ID 在 objs 数组);DRC 不幂等——一轮验证只跑一次(Issues #23/#6)' },
|
package/lib/index.js
CHANGED
|
@@ -1824,7 +1824,9 @@ function edaTaskTool(backend) {
|
|
|
1824
1824
|
action: '提交后台任务', result: r.ok ? `taskId=${r.taskId}` : '', error: r.ok ? '' : r.error,
|
|
1825
1825
|
durationMs: Date.now() - t0,
|
|
1826
1826
|
})
|
|
1827
|
-
return r.ok
|
|
1827
|
+
return r.ok
|
|
1828
|
+
? { ok: true, taskId: r.taskId, statusUrl: r.statusUrl ?? `/tasks/${r.taskId}` }
|
|
1829
|
+
: { ok: false, error: r.error }
|
|
1828
1830
|
}
|
|
1829
1831
|
|
|
1830
1832
|
if (action === 'get') {
|
|
@@ -1836,24 +1838,30 @@ function edaTaskTool(backend) {
|
|
|
1836
1838
|
const events = Array.isArray(t.events)
|
|
1837
1839
|
? t.events.slice(-20).map((e) => (typeof e === 'string' ? e : JSON.stringify(e)))
|
|
1838
1840
|
: []
|
|
1839
|
-
|
|
1841
|
+
// DSH 的 value 快照要求 lossless JSON:绝不能带 undefined 属性(逐一条件赋值)。
|
|
1842
|
+
const out = {
|
|
1840
1843
|
ok: true,
|
|
1841
1844
|
taskId: String(t.id ?? taskId),
|
|
1842
1845
|
status: typeof t.status === 'string' ? t.status : '',
|
|
1843
1846
|
phase: typeof t.phase === 'string' ? t.phase : '',
|
|
1844
|
-
elapsedMs: Number.isFinite(t.elapsedMs) ? Math.round(t.elapsedMs) : undefined,
|
|
1845
|
-
outcome: typeof t.result?.outcome === 'string' ? t.result.outcome : undefined,
|
|
1846
|
-
result: t.result !== undefined ? JSON.stringify(t.result).slice(0, 4000) : undefined,
|
|
1847
|
-
errorText: t.errorDetails ? JSON.stringify(t.errorDetails).slice(0, 2000) : undefined,
|
|
1848
1847
|
events,
|
|
1849
1848
|
}
|
|
1849
|
+
if (Number.isFinite(t.elapsedMs)) out.elapsedMs = Math.round(t.elapsedMs)
|
|
1850
|
+
if (typeof t.result?.outcome === 'string') out.outcome = t.result.outcome
|
|
1851
|
+
if (t.result !== undefined) { try { out.result = JSON.stringify(t.result).slice(0, 4000) } catch (e) {} }
|
|
1852
|
+
if (t.errorDetails) { try { out.errorText = JSON.stringify(t.errorDetails).slice(0, 2000) } catch (e) {} }
|
|
1853
|
+
return out
|
|
1850
1854
|
}
|
|
1851
1855
|
|
|
1852
1856
|
const r = await backend.listTasks()
|
|
1853
1857
|
if (!r.ok) return { ok: false, error: r.error }
|
|
1854
|
-
return { ok: true, tasks: r.tasks.map((t) =>
|
|
1855
|
-
id: t.id, status: t.status
|
|
1856
|
-
|
|
1858
|
+
return { ok: true, tasks: r.tasks.map((t) => {
|
|
1859
|
+
const row = { id: String(t.id ?? ''), status: typeof t.status === 'string' ? t.status : '' }
|
|
1860
|
+
if (typeof t.phase === 'string') row.phase = t.phase
|
|
1861
|
+
if (Number.isFinite(t.elapsedMs)) row.elapsedMs = Math.round(t.elapsedMs)
|
|
1862
|
+
if (typeof t.outcome === 'string') row.outcome = t.outcome
|
|
1863
|
+
return row
|
|
1864
|
+
}) }
|
|
1857
1865
|
},
|
|
1858
1866
|
})
|
|
1859
1867
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@windypro-rourou/dsh-eda",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "dsh-lichuang-eda (JCL-EDA): 嘉立创 EDA 助手 DSH 插件 —— 官方 eda.* API 云端实时生成(原理图/PCB)+ 离线标准版 JSON 兜底 + 面板记录式时间线(撤回/清空/紧急保存)。开箱即用:npm i 后 cordis.patch.yml insert 一行即挂载。",
|
|
6
6
|
"packageManager": "pnpm@11.22.0",
|