dsh-requirement-dev-workbench 4.5.5 → 4.5.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/CHANGELOG.md +25 -0
- package/dsh/index.js +3475 -3018
- package/lib/client.js +261 -17
- package/package.json +65 -65
package/lib/client.js
CHANGED
|
@@ -13,7 +13,7 @@ window.__ModuleLoader__.load({
|
|
|
13
13
|
const { useCallback, useEffect, useMemo, useRef, useState } = React
|
|
14
14
|
|
|
15
15
|
const API = '/api/requirement-dev-workbench'
|
|
16
|
-
const WORKBENCH_VERSION = '4.5.
|
|
16
|
+
const WORKBENCH_VERSION = '4.5.8'
|
|
17
17
|
const STYLE_ID = 'rdw-business-panel-styles'
|
|
18
18
|
|
|
19
19
|
const CSS = `
|
|
@@ -1039,7 +1039,7 @@ window.__ModuleLoader__.load({
|
|
|
1039
1039
|
return `这张表当前 0 条${noun}(已成功读取,表内暂无记录)`
|
|
1040
1040
|
}
|
|
1041
1041
|
|
|
1042
|
-
function TableModule({ state, reloadState, uiWorkspace, table, view, saveView, runs, handOff, onUpdateRun, onOpenTable, onAddModule, expertData, reloadExperts }) {
|
|
1042
|
+
function TableModule({ state, reloadState, uiWorkspace, table, view, saveView, runs, handOff, onUpdateRun, onOpenTable, onAddModule, expertData, reloadExperts, settingsOnly = false, onCloseSettings, onSavedSettings }) {
|
|
1043
1043
|
const [data, setData] = useState({ configured: false, items: [] })
|
|
1044
1044
|
const [schema, setSchema] = useState(null)
|
|
1045
1045
|
const [loading, setLoading] = useState(false)
|
|
@@ -1409,6 +1409,7 @@ window.__ModuleLoader__.load({
|
|
|
1409
1409
|
await api('/settings', { method: 'POST', body: JSON.stringify(patch) })
|
|
1410
1410
|
notifySettingsChanged(patch)
|
|
1411
1411
|
await reloadState()
|
|
1412
|
+
await onSavedSettings?.(patch)
|
|
1412
1413
|
setToast('已保存')
|
|
1413
1414
|
setShowSettings(false)
|
|
1414
1415
|
load()
|
|
@@ -1443,6 +1444,7 @@ window.__ModuleLoader__.load({
|
|
|
1443
1444
|
|
|
1444
1445
|
/** 回写飞书一律先弹页面确认,确认后才真的写。 */
|
|
1445
1446
|
const askWriteBack = (recordId, status, field, title) => {
|
|
1447
|
+
if (table?.readOnly) return
|
|
1446
1448
|
const type = (schemaFields ?? []).find((entry) => entry.name === field)?.type ?? ''
|
|
1447
1449
|
setPendingWrite({ recordId, status, field: field || groupField, fieldType: type, title: title || '', kind: 'status' })
|
|
1448
1450
|
setFailure(null)
|
|
@@ -1455,7 +1457,7 @@ window.__ModuleLoader__.load({
|
|
|
1455
1457
|
try {
|
|
1456
1458
|
await api('/requirement/status', {
|
|
1457
1459
|
method: 'POST',
|
|
1458
|
-
body: JSON.stringify({ recordId: pending.recordId, status: pending.status, field: pending.field, fieldType: pending.fieldType }),
|
|
1460
|
+
body: JSON.stringify({ tableKey, recordId: pending.recordId, status: pending.status, field: pending.field, fieldType: pending.fieldType }),
|
|
1459
1461
|
})
|
|
1460
1462
|
setToast(`已把「${pending.field}」回写为「${pending.status}」`)
|
|
1461
1463
|
} catch (error) {
|
|
@@ -1520,10 +1522,11 @@ window.__ModuleLoader__.load({
|
|
|
1520
1522
|
const settingsView = h(SettingsView, {
|
|
1521
1523
|
settings,
|
|
1522
1524
|
sources,
|
|
1525
|
+
failure: failure?.message,
|
|
1523
1526
|
larkCli: state?.larkCli,
|
|
1524
1527
|
chooseDirectory,
|
|
1525
1528
|
onReloadSources: loadSources,
|
|
1526
|
-
onCancel: () => setShowSettings(false),
|
|
1529
|
+
onCancel: onCloseSettings ?? (() => setShowSettings(false)),
|
|
1527
1530
|
onSave: saveSettings,
|
|
1528
1531
|
})
|
|
1529
1532
|
// 设置页是「提前 return」的独立分支:目录选择弹窗必须挂在这一层,
|
|
@@ -1891,7 +1894,7 @@ window.__ModuleLoader__.load({
|
|
|
1891
1894
|
instruction,
|
|
1892
1895
|
setInstruction,
|
|
1893
1896
|
copyInstruction,
|
|
1894
|
-
writeBack,
|
|
1897
|
+
writeBack: table?.readOnly ? null : writeBack,
|
|
1895
1898
|
chooseDirectory,
|
|
1896
1899
|
runs: itemRuns,
|
|
1897
1900
|
onUpdateRun,
|
|
@@ -2107,7 +2110,15 @@ window.__ModuleLoader__.load({
|
|
|
2107
2110
|
)
|
|
2108
2111
|
}
|
|
2109
2112
|
|
|
2110
|
-
function SettingsView({ settings, sources, onCancel, onSave, larkCli, chooseDirectory, onReloadSources }) {
|
|
2113
|
+
function SettingsView({ settings, sources, failure, onCancel, onSave, larkCli, chooseDirectory, onReloadSources }) {
|
|
2114
|
+
const [remoteSource, setRemoteSource] = useState(null)
|
|
2115
|
+
useEffect(() => {
|
|
2116
|
+
let live = true
|
|
2117
|
+
api('/project-source')
|
|
2118
|
+
.then((result) => { if (live) setRemoteSource(result) })
|
|
2119
|
+
.catch(() => { if (live) setRemoteSource(null) })
|
|
2120
|
+
return () => { live = false }
|
|
2121
|
+
}, [])
|
|
2111
2122
|
const [link, setLink] = useState(settings.baseToken ? `${settings.baseToken} ${settings.tableId}` : '')
|
|
2112
2123
|
const [tableId, setTableId] = useState(settings.tableId ?? '')
|
|
2113
2124
|
const [projectDir, setProjectDir] = useState(settings.projectDir ?? '')
|
|
@@ -2136,14 +2147,14 @@ window.__ModuleLoader__.load({
|
|
|
2136
2147
|
h(Field, { label: '项目目录(绝对路径)', value: projectDir, placeholder: 'D:\\workspace\\your-project', onChange: setProjectDir }),
|
|
2137
2148
|
h('div', { className: 'rdw-toolbar', style: { marginTop: 6 } }, h('button', { className: 'rdw-btn', onClick: chooseRoot, disabled: !chooseDirectory }, '用系统目录选择器挑选')),
|
|
2138
2149
|
h('div', { className: 'rdw-note' }, '选好项目后,「技能与规范」会扫描它的 skill;如果项目里已经有需求源配置,会自动认出来。'),
|
|
2139
|
-
h('div', { className: 'rdw-note' }, '
|
|
2150
|
+
h('div', { className: 'rdw-note' }, '优先读取项目根目录的 sino-skill-config.json,未配置的类别仍可使用旧的独立配置文件。'),
|
|
2140
2151
|
// v4.5.3:选到「没有需求源配置」的目录时(比如换成了另一个工程),以前只会在原地打转,
|
|
2141
2152
|
// 看起来像「保存后没返回」。现在明确说清楚为什么看板读不到表,并给两条出路。
|
|
2142
2153
|
sources && !detected.length
|
|
2143
2154
|
? h(
|
|
2144
2155
|
'div',
|
|
2145
2156
|
{ className: 'rdw-note', style: { marginTop: 6, color: 'var(--dsw-alias-label-danger,#ff6b6b)' } },
|
|
2146
|
-
'
|
|
2157
|
+
'没有检测到项目需求源(sino-skill-config.json 或 .requirement-sources.json)。要读取需求表,可配置项目需求源,或在下面手动填写表格链接。',
|
|
2147
2158
|
)
|
|
2148
2159
|
: null,
|
|
2149
2160
|
),
|
|
@@ -2151,6 +2162,7 @@ window.__ModuleLoader__.load({
|
|
|
2151
2162
|
'div',
|
|
2152
2163
|
{ className: 'rdw-card', style: { marginTop: 12 } },
|
|
2153
2164
|
h('h3', null, '2. 需求来源'),
|
|
2165
|
+
failure ? h('div', { className: 'rdw-error', role: 'alert' }, failure) : null,
|
|
2154
2166
|
detected.length
|
|
2155
2167
|
? h(
|
|
2156
2168
|
'div',
|
|
@@ -2170,14 +2182,32 @@ window.__ModuleLoader__.load({
|
|
|
2170
2182
|
),
|
|
2171
2183
|
),
|
|
2172
2184
|
)
|
|
2173
|
-
: h('div', { className: 'rdw-note' }, '
|
|
2185
|
+
: h('div', { className: 'rdw-note' }, '项目没有可选的需求源。'),
|
|
2174
2186
|
h(Field, {
|
|
2175
|
-
label: '多维表格链接或 base_token
|
|
2187
|
+
label: '多维表格链接或 base_token(手动填写,选项目配置时也可留空)',
|
|
2176
2188
|
value: link,
|
|
2177
2189
|
placeholder: 'https://xxx.feishu.cn/base/xxxx?table=tblxxxx',
|
|
2178
2190
|
onChange: setLink,
|
|
2179
2191
|
}),
|
|
2180
|
-
h(
|
|
2192
|
+
remoteSource ? h(
|
|
2193
|
+
'div',
|
|
2194
|
+
{ style: { marginBottom: 8 } },
|
|
2195
|
+
h('div', { className: 'rdw-note' }, remoteSource.baseUrl ? `项目已保存的链接:${remoteSource.baseUrl}` : '还没有为这个项目单独保存链接。填好后点「保存并拉取需求」会写入本项目的 sino-skill-config.json。'),
|
|
2196
|
+
remoteSource.baseUrl
|
|
2197
|
+
? h('button', {
|
|
2198
|
+
className: 'rdw-btn',
|
|
2199
|
+
onClick: async () => {
|
|
2200
|
+
try {
|
|
2201
|
+
await api('/project-source', { method: 'POST', body: JSON.stringify({ baseUrl: '', projectDir }) })
|
|
2202
|
+
await onSave({ projectDir: remoteSource.projectDir ?? projectDir })
|
|
2203
|
+
} catch (error) {
|
|
2204
|
+
setFailure(error.message)
|
|
2205
|
+
}
|
|
2206
|
+
},
|
|
2207
|
+
}, '清除本项目链接')
|
|
2208
|
+
: null,
|
|
2209
|
+
) : null,
|
|
2210
|
+
h(Field, { label: '表名或 table_id(链接里已含 table 时可留空)', value: tableId, placeholder: 'tblxxxx', onChange: setTableId }),
|
|
2181
2211
|
h('div', { className: 'rdw-note' }, `读取身份:${larkCli ? `lark-cli 就绪(${larkCli})` : 'lark-cli 未找到'} · 本工作台不保存飞书凭证。`),
|
|
2182
2212
|
),
|
|
2183
2213
|
h(
|
|
@@ -2246,7 +2276,157 @@ window.__ModuleLoader__.load({
|
|
|
2246
2276
|
}
|
|
2247
2277
|
|
|
2248
2278
|
/**
|
|
2279
|
+
* 模块数据来源:每个模块自己一份飞书表链接。
|
|
2280
|
+
*
|
|
2281
|
+
* 以前只有一个「表格设置」,改一次链接所有模块都跟着变;现在链接挂在模块上(存 view.json),
|
|
2282
|
+
* 改这个模块只影响这个模块。留空即回到「跟着项目配置走」。
|
|
2283
|
+
*/
|
|
2284
|
+
function ModuleSourceDialog({ moduleKey, moduleTitle, data, onClose, onSaved }) {
|
|
2285
|
+
const [link, setLink] = useState('')
|
|
2286
|
+
const [failure, setFailure] = useState('')
|
|
2287
|
+
const [busy, setBusy] = useState(false)
|
|
2288
|
+
const [notice, setNotice] = useState('')
|
|
2289
|
+
const [test, setTest] = useState(null)
|
|
2290
|
+
const [testing, setTesting] = useState(false)
|
|
2291
|
+
const [moduleDir, setModuleDir] = useState('')
|
|
2292
|
+
const [titleField, setTitleField] = useState('')
|
|
2293
|
+
const [rawField, setRawField] = useState('')
|
|
2294
|
+
const [optionNames, setOptionNames] = useState([])
|
|
2295
|
+
const loaded = data !== null
|
|
2296
|
+
useEffect(() => {
|
|
2297
|
+
if (!loaded) return
|
|
2298
|
+
setLink(String(data?.baseUrl ?? ''))
|
|
2299
|
+
setModuleDir(String(data?.ownProjectDir ?? ''))
|
|
2300
|
+
setTitleField(String(data?.fields?.title ?? ''))
|
|
2301
|
+
setRawField(String(data?.fields?.rawRequirement ?? ''))
|
|
2302
|
+
setTest(null)
|
|
2303
|
+
setFailure('')
|
|
2304
|
+
}, [loaded, data?.baseUrl, data?.moduleKey])
|
|
2305
|
+
useEffect(() => {
|
|
2306
|
+
if (!moduleKey) return
|
|
2307
|
+
let live = true
|
|
2308
|
+
api(`/fields?t=${encodeURIComponent(moduleKey)}`)
|
|
2309
|
+
.then((result) => { if (live) setOptionNames(Array.isArray(result?.names) ? result.names : []) })
|
|
2310
|
+
.catch(() => { if (live) setOptionNames([]) })
|
|
2311
|
+
return () => { live = false }
|
|
2312
|
+
}, [moduleKey, loaded])
|
|
2313
|
+
const save = async (baseUrl) => {
|
|
2314
|
+
setBusy(true)
|
|
2315
|
+
setFailure('')
|
|
2316
|
+
try {
|
|
2317
|
+
const fields = {}
|
|
2318
|
+
if (titleField.trim()) fields.title = titleField.trim()
|
|
2319
|
+
if (rawField.trim()) fields.rawRequirement = rawField.trim()
|
|
2320
|
+
await api('/module-source', { method: 'POST', body: JSON.stringify({ moduleKey, baseUrl, projectDir: moduleDir.trim(), fields: Object.keys(fields).length ? fields : null }) })
|
|
2321
|
+
setNotice(baseUrl ? '已保存到这个模块' : '已恢复为跟随项目配置')
|
|
2322
|
+
if (typeof onSaved === 'function') await onSaved()
|
|
2323
|
+
onClose()
|
|
2324
|
+
} catch (error) {
|
|
2325
|
+
setFailure(error.message)
|
|
2326
|
+
} finally {
|
|
2327
|
+
setBusy(false)
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
const probe = async () => {
|
|
2331
|
+
setTesting(true)
|
|
2332
|
+
setTest(null)
|
|
2333
|
+
try {
|
|
2334
|
+
const result = await api(`/records?table=${encodeURIComponent(`module:${moduleKey}`)}&fresh=1`)
|
|
2335
|
+
setTest(
|
|
2336
|
+
result?.error
|
|
2337
|
+
? { ok: false, text: `${result.error}${result.detail ? `:${String(result.detail).slice(0, 200)}` : ''}` }
|
|
2338
|
+
: { ok: true, text: `读到 ${result?.count ?? result?.items?.length ?? 0} 条记录(${result?.table?.tableId ?? ''})` },
|
|
2339
|
+
)
|
|
2340
|
+
} catch (error) {
|
|
2341
|
+
setTest({ ok: false, text: error.message })
|
|
2342
|
+
} finally {
|
|
2343
|
+
setTesting(false)
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
return h(
|
|
2347
|
+
'div',
|
|
2348
|
+
{ className: 'rdw-mask', role: 'presentation', onClick: onClose },
|
|
2349
|
+
h(
|
|
2350
|
+
'div',
|
|
2351
|
+
{
|
|
2352
|
+
className: 'rdw-modal',
|
|
2353
|
+
role: 'dialog',
|
|
2354
|
+
'aria-modal': 'true',
|
|
2355
|
+
'aria-label': `模块数据来源:${moduleTitle}`,
|
|
2356
|
+
style: { width: 'min(560px,94vw)' },
|
|
2357
|
+
onClick: (event) => event.stopPropagation(),
|
|
2358
|
+
},
|
|
2359
|
+
h(
|
|
2360
|
+
'div',
|
|
2361
|
+
{ className: 'rdw-modal-head' },
|
|
2362
|
+
h('strong', null, `数据来源 · ${moduleTitle}`),
|
|
2363
|
+
h('span', { className: 'rdw-grow' }),
|
|
2364
|
+
h('button', { className: 'rdw-btn', onClick: onClose }, '关闭'),
|
|
2365
|
+
),
|
|
2366
|
+
!loaded
|
|
2367
|
+
? h('div', { className: 'rdw-note' }, data?.error ? `读取失败:${data.error}` : '读取中…')
|
|
2368
|
+
: h(
|
|
2369
|
+
'div',
|
|
2370
|
+
null,
|
|
2371
|
+
h('div', { className: 'rdw-note', style: { marginBottom: 8 } },
|
|
2372
|
+
'这个链接只属于当前模块:别的模块、别的项目都不会跟着变。留空则跟随「项目配置」(sino-skill-config.json)。'),
|
|
2373
|
+
h(Field, {
|
|
2374
|
+
label: '这个模块的多维表格链接',
|
|
2375
|
+
value: link,
|
|
2376
|
+
placeholder: 'https://xxx.feishu.cn/base/xxxx?table=tblxxxx',
|
|
2377
|
+
onChange: (value) => {
|
|
2378
|
+
setLink(value)
|
|
2379
|
+
setTest(null)
|
|
2380
|
+
},
|
|
2381
|
+
}),
|
|
2382
|
+
h(Field, {
|
|
2383
|
+
label: '这个模块的项目目录(留空 = 跟随当前项目)',
|
|
2384
|
+
value: moduleDir,
|
|
2385
|
+
placeholder: data.projectDir || 'D:\\workspace\\your-project',
|
|
2386
|
+
onChange: setModuleDir,
|
|
2387
|
+
}),
|
|
2388
|
+
h('div', { className: 'rdw-note' },
|
|
2389
|
+
`读取身份:${data.identity || 'bot'}${data.readOnly ? ' · 只读' : ''} · 同一个工作台里每个模块各存各的链接与目录,互不牵动。`),
|
|
2390
|
+
loaded && data?.resolved
|
|
2391
|
+
? h('div', { className: 'rdw-note' }, `当前实际读取:${data.resolved.tableId}${data.resolved.label ? `(${data.resolved.label})` : ''}`)
|
|
2392
|
+
: h('div', { className: 'rdw-note' }, '当前跟随项目配置。'),
|
|
2393
|
+
h('div', { className: 'rdw-note', style: { marginTop: 10 } },
|
|
2394
|
+
'字段映射(可选):手填「标题」与「原始需求」的真实列名,模块就按这两列显示。'),
|
|
2395
|
+
h(Field, {
|
|
2396
|
+
label: '标题字段(默认按 页面/标题 自动认)',
|
|
2397
|
+
value: titleField,
|
|
2398
|
+
placeholder: '页面',
|
|
2399
|
+
onChange: setTitleField,
|
|
2400
|
+
}),
|
|
2401
|
+
h(Field, {
|
|
2402
|
+
label: '原始需求字段(详情里展示的那一列)',
|
|
2403
|
+
value: rawField,
|
|
2404
|
+
placeholder: '需求|方案|问题',
|
|
2405
|
+
onChange: setRawField,
|
|
2406
|
+
}),
|
|
2407
|
+
optionNames.length
|
|
2408
|
+
? h('div', { className: 'rdw-note' }, `这张表已有的列:${optionNames.slice(0, 24).join('、')}`)
|
|
2409
|
+
: null,
|
|
2410
|
+
failure ? h('div', { className: 'rdw-error', role: 'alert', style: { marginTop: 8 } }, failure) : null,
|
|
2411
|
+
notice ? h('div', { className: 'rdw-note', style: { marginTop: 8 } }, notice) : null,
|
|
2412
|
+
test ? h('div', { className: 'rdw-note', style: { marginTop: 8, color: test.ok ? undefined : 'var(--dsw-alias-label-danger,#ff6b6b)' } }, test.text) : null,
|
|
2413
|
+
h(
|
|
2414
|
+
'div',
|
|
2415
|
+
{ className: 'rdw-toolbar', style: { marginTop: 12 } },
|
|
2416
|
+
h('button', { className: 'rdw-btn primary', disabled: busy, onClick: () => save(link.trim()) }, busy ? '保存中…' : '保存到这个模块'),
|
|
2417
|
+
h('button', { className: 'rdw-btn', disabled: busy || !link.trim(), onClick: () => save('') }, '改为跟随项目'),
|
|
2418
|
+
h('span', { className: 'rdw-grow' }),
|
|
2419
|
+
h('button', { className: 'rdw-btn', disabled: testing || !link.trim(), onClick: probe }, testing ? '读取中…' : '先试着读一次'),
|
|
2420
|
+
),
|
|
2421
|
+
),
|
|
2422
|
+
),
|
|
2423
|
+
)
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
/**
|
|
2427
|
+
/**
|
|
2249
2428
|
* 更新日志弹窗:左栏底部「vX.Y.Z · 更新日志」点开。
|
|
2429
|
+
*
|
|
2250
2430
|
* 内容来自包内 CHANGELOG.md(走 /changelog 接口解析成 sections),
|
|
2251
2431
|
* 只读不写;当前版本那一段标「当前版本」并默认展开在顶部。
|
|
2252
2432
|
*/
|
|
@@ -2406,12 +2586,12 @@ window.__ModuleLoader__.load({
|
|
|
2406
2586
|
h(
|
|
2407
2587
|
'div',
|
|
2408
2588
|
{ style: { marginTop: 14 } },
|
|
2409
|
-
h('div', { className: 'rdw-note' }, '回写飞书状态(可选)'),
|
|
2410
|
-
h(
|
|
2589
|
+
h('div', { className: 'rdw-note' }, writeBack ? '回写飞书状态(可选)' : '飞书来源:只读'),
|
|
2590
|
+
writeBack ? h(
|
|
2411
2591
|
'div',
|
|
2412
2592
|
{ className: 'rdw-toolbar', style: { marginTop: 6 } },
|
|
2413
2593
|
...statuses.map((status) => h('button', { key: status, className: 'rdw-btn', onClick: () => writeBack(status) }, status)),
|
|
2414
|
-
),
|
|
2594
|
+
) : null,
|
|
2415
2595
|
),
|
|
2416
2596
|
h(
|
|
2417
2597
|
'div',
|
|
@@ -4787,6 +4967,21 @@ window.__ModuleLoader__.load({
|
|
|
4787
4967
|
setChangelog({ found: false, sections: [], error: error.message })
|
|
4788
4968
|
}
|
|
4789
4969
|
}, [changelog])
|
|
4970
|
+
// 「模块数据来源」对话框:每个模块各自一份,openSource 时读该模块当前绑定的表。
|
|
4971
|
+
const [sourceFor, setSourceFor] = useState('')
|
|
4972
|
+
const [sourceDialog, setSourceDialog] = useState(null)
|
|
4973
|
+
const reloadSources = useCallback(async (moduleKey) => {
|
|
4974
|
+
try {
|
|
4975
|
+
setSourceDialog(await api(`/module-source?module=${encodeURIComponent(moduleKey)}`))
|
|
4976
|
+
} catch (error) {
|
|
4977
|
+
setSourceDialog({ error: error.message, moduleKey })
|
|
4978
|
+
}
|
|
4979
|
+
}, [])
|
|
4980
|
+
useEffect(() => {
|
|
4981
|
+
if (!sourceFor) return
|
|
4982
|
+
setSourceDialog(null)
|
|
4983
|
+
void reloadSources(sourceFor)
|
|
4984
|
+
}, [sourceFor, reloadSources])
|
|
4790
4985
|
const renameModule = useCallback(
|
|
4791
4986
|
async (key, title) => {
|
|
4792
4987
|
const trimmed = String(title ?? '').trim()
|
|
@@ -4870,7 +5065,12 @@ window.__ModuleLoader__.load({
|
|
|
4870
5065
|
{ kind: 'experts', id: 'experts', glyph: '🎓', label: '专家与专家团' },
|
|
4871
5066
|
]
|
|
4872
5067
|
for (const module of view?.modules?.length ? view.modules : defaultModules(tables)) {
|
|
4873
|
-
|
|
5068
|
+
// 模块自带的表用模块 key 当表 key(服务端 /fields、/records 都按它精确取),
|
|
5069
|
+
// 否则原来配的那张项目表被换掉后,模块会去借别的表甚至找不到表。
|
|
5070
|
+
const ownSource = module.source ? module.sourceResolved ?? module.source : null
|
|
5071
|
+
const table = (ownSource
|
|
5072
|
+
? { key: module.key, label: ownSource.label || ownSource.tableName || module.title, kind: ownSource.readOnly ? 'task' : 'requirement', own: true }
|
|
5073
|
+
: null) ?? tables.find((entry) => entry.key === module.tableKey)
|
|
4874
5074
|
list.push({
|
|
4875
5075
|
kind: 'table',
|
|
4876
5076
|
id: module.key,
|
|
@@ -5085,6 +5285,22 @@ window.__ModuleLoader__.load({
|
|
|
5085
5285
|
'✎',
|
|
5086
5286
|
)
|
|
5087
5287
|
: null,
|
|
5288
|
+
entry.kind === 'table' && renamingId !== entry.id
|
|
5289
|
+
? h(
|
|
5290
|
+
'button',
|
|
5291
|
+
{
|
|
5292
|
+
className: 'rdw-mod-edit',
|
|
5293
|
+
title: `设置这个模块的飞书表格:${entry.label}`,
|
|
5294
|
+
'aria-label': `设置数据来源:${entry.label}`,
|
|
5295
|
+
onClick: (event) => {
|
|
5296
|
+
event.stopPropagation()
|
|
5297
|
+
setSourceFor(entry.id)
|
|
5298
|
+
setActive(entry.id)
|
|
5299
|
+
},
|
|
5300
|
+
},
|
|
5301
|
+
'🔗',
|
|
5302
|
+
)
|
|
5303
|
+
: null,
|
|
5088
5304
|
),
|
|
5089
5305
|
),
|
|
5090
5306
|
h(
|
|
@@ -5159,9 +5375,18 @@ window.__ModuleLoader__.load({
|
|
|
5159
5375
|
: h(TableModule, {
|
|
5160
5376
|
// key 里带上「配置好了没」:从设置页回到内容区时重建一次,
|
|
5161
5377
|
// 宽度测量才挂得到新出现的容器上(否则窄内容区的详情让位不会生效)。
|
|
5162
|
-
key: `${activeEntry?.id}:${state?.configured ? 'ready' : 'setup'}`,
|
|
5378
|
+
key: `${activeEntry?.id}:${state?.configured ? 'ready' : 'setup'}:${state?.settings?.projectDir ?? ''}`,
|
|
5163
5379
|
state,
|
|
5164
5380
|
reloadState,
|
|
5381
|
+
settingsOnly: activeEntry?.kind === 'settings',
|
|
5382
|
+
onCloseSettings: activeEntry?.kind === 'settings' ? () => setActive('overview') : undefined,
|
|
5383
|
+
onSavedSettings: async (patch) => {
|
|
5384
|
+
await reloadTables()
|
|
5385
|
+
if (Object.hasOwn(patch, 'baseInput')) {
|
|
5386
|
+
if (activeEntry?.kind === 'settings') setActive('overview')
|
|
5387
|
+
await loadOverview(true)
|
|
5388
|
+
}
|
|
5389
|
+
},
|
|
5165
5390
|
uiWorkspace,
|
|
5166
5391
|
table: activeEntry?.table,
|
|
5167
5392
|
view: sliceForTable(view, activeEntry?.module?.tableKey ?? ''),
|
|
@@ -5189,6 +5414,23 @@ window.__ModuleLoader__.load({
|
|
|
5189
5414
|
showConversation ? (frameActive && conversation ? conversation : h('div', { className: 'rdw-note', style: { padding: 12 } }, '宿主没有提供对话区;可以改成用左侧原来的对话窗口。')) : null,
|
|
5190
5415
|
),
|
|
5191
5416
|
changelogOpen ? h(ChangelogDialog, { data: changelog, current: WORKBENCH_VERSION, onClose: () => setChangelogOpen(false) }) : null,
|
|
5417
|
+
sourceFor
|
|
5418
|
+
? h(ModuleSourceDialog, {
|
|
5419
|
+
key: sourceFor,
|
|
5420
|
+
moduleKey: sourceFor,
|
|
5421
|
+
moduleTitle: railModules.find((entry) => entry.id === sourceFor)?.label ?? sourceFor,
|
|
5422
|
+
data: sourceDialog,
|
|
5423
|
+
onClose: () => {
|
|
5424
|
+
setSourceFor('')
|
|
5425
|
+
setSourceDialog(null)
|
|
5426
|
+
},
|
|
5427
|
+
onSaved: async () => {
|
|
5428
|
+
await reloadTables()
|
|
5429
|
+
await reloadView()
|
|
5430
|
+
await loadOverview(true)
|
|
5431
|
+
},
|
|
5432
|
+
})
|
|
5433
|
+
: null,
|
|
5192
5434
|
])
|
|
5193
5435
|
}
|
|
5194
5436
|
|
|
@@ -5205,6 +5447,8 @@ window.__ModuleLoader__.load({
|
|
|
5205
5447
|
* 这里的 ctx.slots 用嵌套 inject + try/catch 拿:宿主没提供 slots 时工作台本体照常可用。
|
|
5206
5448
|
*/
|
|
5207
5449
|
function ExpertComposerEntry(props) {
|
|
5450
|
+
// 输入框入口可独立挂载,不能依赖用户先打开 BusinessPanel 才加载样式。
|
|
5451
|
+
ensureStyles()
|
|
5208
5452
|
const [open, setOpen] = useState(false)
|
|
5209
5453
|
const [data, setData] = useState(null)
|
|
5210
5454
|
const [failure, setFailure] = useState('')
|
|
@@ -5617,7 +5861,7 @@ window.__ModuleLoader__.load({
|
|
|
5617
5861
|
// Desktop 上有它就优先用(apply 里按需检测),没有就走原生 main 面板。
|
|
5618
5862
|
inject: [],
|
|
5619
5863
|
// 自测钩子:给 test/smoke.mjs 直接跑组件函数体与纯函数用;宿主只读 apply/inject,多余的键会被忽略。
|
|
5620
|
-
__components: { BusinessPanel, TableModule, OverviewModule, ModuleDialog, DetailView, ChangelogDialog, ViewConfigPanel, SettingsView, SkillsModule, DevModule, ExpertsModule, ExpertComposerEntry, FlowModule, DocsModule, DirectoryPickerDialog },
|
|
5864
|
+
__components: { BusinessPanel, TableModule, OverviewModule, ModuleDialog, ModuleSourceDialog, DetailView, ChangelogDialog, ViewConfigPanel, SettingsView, SkillsModule, DevModule, ExpertsModule, ExpertComposerEntry, FlowModule, DocsModule, DirectoryPickerDialog },
|
|
5621
5865
|
__pure: {
|
|
5622
5866
|
summarizeBuckets,
|
|
5623
5867
|
runBadge,
|
package/package.json
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-requirement-dev-workbench",
|
|
3
|
-
"version": "4.5.
|
|
4
|
-
"private": false,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"description": "AI Native 工作台:把「拿任务 → 开发 → 验收」串成一条流水线。跨多张飞书多维表格看开发任务与进度,拉取飞书文档信息,用专家/专家团跑完整流程(需求分析 → 代码开发 → 代码评审 → QA 测试),选中本地项目后一键生成开发指令,并可浏览项目/全局 skill 与开发规范。模块可扩展。",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"author": "EDY",
|
|
9
|
-
"main": "dsh/index.js",
|
|
10
|
-
"homepage": "https://github.com/chdepanghu/dsh-worker-plug#readme",
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/chdepanghu/dsh-worker-plug.git"
|
|
14
|
-
},
|
|
15
|
-
"bugs": {
|
|
16
|
-
"url": "https://github.com/chdepanghu/dsh-worker-plug/issues"
|
|
17
|
-
},
|
|
18
|
-
"scripts": {
|
|
19
|
-
"test": "node test/smoke.mjs"
|
|
20
|
-
},
|
|
21
|
-
"exports": {
|
|
22
|
-
".": "./dsh/index.js",
|
|
23
|
-
"./client": "./lib/client.js",
|
|
24
|
-
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
25
|
-
"./package.json": "./package.json"
|
|
26
|
-
},
|
|
27
|
-
"dsh": {
|
|
28
|
-
"bundle": {
|
|
29
|
-
"patch": "./cordis.patch.yml"
|
|
30
|
-
},
|
|
31
|
-
"client": {
|
|
32
|
-
"platform": "web"
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"peerDependencies": {
|
|
36
|
-
"@deepseek-ai/cordis": ">=4.0.0",
|
|
37
|
-
"@deepseek-ai/schemastery": ">=3.0.0"
|
|
38
|
-
},
|
|
39
|
-
"peerDependenciesMeta": {
|
|
40
|
-
"@deepseek-ai/cordis": {
|
|
41
|
-
"optional": true
|
|
42
|
-
},
|
|
43
|
-
"@deepseek-ai/schemastery": {
|
|
44
|
-
"optional": true
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"files": [
|
|
48
|
-
"dsh",
|
|
49
|
-
"lib",
|
|
50
|
-
"cordis.patch.yml",
|
|
51
|
-
"README.md",
|
|
52
|
-
"CHANGELOG.md",
|
|
53
|
-
"LICENSE"
|
|
54
|
-
],
|
|
55
|
-
"keywords": [
|
|
56
|
-
"dsh",
|
|
57
|
-
"dsh-plugin",
|
|
58
|
-
"dsh-workbench",
|
|
59
|
-
"ai-native",
|
|
60
|
-
"workbench",
|
|
61
|
-
"requirement",
|
|
62
|
-
"feishu",
|
|
63
|
-
"lark"
|
|
64
|
-
]
|
|
65
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-requirement-dev-workbench",
|
|
3
|
+
"version": "4.5.8",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "AI Native 工作台:把「拿任务 → 开发 → 验收」串成一条流水线。跨多张飞书多维表格看开发任务与进度,拉取飞书文档信息,用专家/专家团跑完整流程(需求分析 → 代码开发 → 代码评审 → QA 测试),选中本地项目后一键生成开发指令,并可浏览项目/全局 skill 与开发规范。模块可扩展。",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "EDY",
|
|
9
|
+
"main": "dsh/index.js",
|
|
10
|
+
"homepage": "https://github.com/chdepanghu/dsh-worker-plug#readme",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/chdepanghu/dsh-worker-plug.git"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/chdepanghu/dsh-worker-plug/issues"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "node test/smoke.mjs"
|
|
20
|
+
},
|
|
21
|
+
"exports": {
|
|
22
|
+
".": "./dsh/index.js",
|
|
23
|
+
"./client": "./lib/client.js",
|
|
24
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"dsh": {
|
|
28
|
+
"bundle": {
|
|
29
|
+
"patch": "./cordis.patch.yml"
|
|
30
|
+
},
|
|
31
|
+
"client": {
|
|
32
|
+
"platform": "web"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@deepseek-ai/cordis": ">=4.0.0",
|
|
37
|
+
"@deepseek-ai/schemastery": ">=3.0.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependenciesMeta": {
|
|
40
|
+
"@deepseek-ai/cordis": {
|
|
41
|
+
"optional": true
|
|
42
|
+
},
|
|
43
|
+
"@deepseek-ai/schemastery": {
|
|
44
|
+
"optional": true
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"files": [
|
|
48
|
+
"dsh",
|
|
49
|
+
"lib",
|
|
50
|
+
"cordis.patch.yml",
|
|
51
|
+
"README.md",
|
|
52
|
+
"CHANGELOG.md",
|
|
53
|
+
"LICENSE"
|
|
54
|
+
],
|
|
55
|
+
"keywords": [
|
|
56
|
+
"dsh",
|
|
57
|
+
"dsh-plugin",
|
|
58
|
+
"dsh-workbench",
|
|
59
|
+
"ai-native",
|
|
60
|
+
"workbench",
|
|
61
|
+
"requirement",
|
|
62
|
+
"feishu",
|
|
63
|
+
"lark"
|
|
64
|
+
]
|
|
65
|
+
}
|