@cheemsup/dsh-plugin-console 0.0.0-stage → 0.2.0
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/LICENSE +23 -0
- package/README.md +95 -3
- package/cordis.patch.yml +5 -0
- package/icon.svg +203 -0
- package/lib/client.activity.js +222 -0
- package/lib/client.apply.js +171 -0
- package/lib/client.changes.js +206 -0
- package/lib/client.cleanup.js +270 -0
- package/lib/client.control.js +247 -0
- package/lib/client.dialog.js +77 -0
- package/lib/client.disable-preview.js +904 -0
- package/lib/client.draft.js +280 -0
- package/lib/client.editor-messages.js +421 -0
- package/lib/client.editor-store.js +266 -0
- package/lib/client.editor.js +433 -0
- package/lib/client.effects.js +115 -0
- package/lib/client.impact-tree.js +487 -0
- package/lib/client.influence.js +361 -0
- package/lib/client.js +246 -0
- package/lib/client.page.js +646 -0
- package/lib/client.plugin-filters.js +62 -0
- package/lib/client.plugins.js +506 -0
- package/lib/client.preview-messages.js +506 -0
- package/lib/client.preview-raw.js +132 -0
- package/lib/client.preview-store.js +128 -0
- package/lib/client.preview-tools.js +194 -0
- package/lib/client.preview.js +448 -0
- package/lib/client.relation-graph.js +364 -0
- package/lib/client.schema.js +327 -0
- package/lib/client.search.js +409 -0
- package/lib/client.session-detail.js +503 -0
- package/lib/client.sessions.js +495 -0
- package/lib/client.shared.js +562 -0
- package/lib/client.store.js +452 -0
- package/lib/client.styles.js +589 -0
- package/lib/client.template-card.js +240 -0
- package/lib/client.tools.js +366 -0
- package/lib/client.workspace-picker.js +204 -0
- package/lib/host/activity.js +252 -0
- package/lib/host/assembly-preview.js +244 -0
- package/lib/host/attribution.js +341 -0
- package/lib/host/catalog.js +133 -0
- package/lib/host/categorize.js +40 -0
- package/lib/host/config-layers.js +589 -0
- package/lib/host/constants.js +69 -0
- package/lib/host/control.js +159 -0
- package/lib/host/disable-preview.js +651 -0
- package/lib/host/entries.js +289 -0
- package/lib/host/fiber.js +86 -0
- package/lib/host/fs.js +99 -0
- package/lib/host/health.js +178 -0
- package/lib/host/http.js +65 -0
- package/lib/host/impact.js +138 -0
- package/lib/host/injection-owners.js +60 -0
- package/lib/host/layers.js +132 -0
- package/lib/host/masks.js +145 -0
- package/lib/host/modes.js +96 -0
- package/lib/host/names.js +44 -0
- package/lib/host/patch-config.js +554 -0
- package/lib/host/patch-scan.js +103 -0
- package/lib/host/preview-conditions.js +281 -0
- package/lib/host/preview-contexts.js +174 -0
- package/lib/host/preview-envelope.js +31 -0
- package/lib/host/preview-instructions.js +450 -0
- package/lib/host/preview-messages.js +284 -0
- package/lib/host/preview-modules.js +233 -0
- package/lib/host/preview-skills.js +200 -0
- package/lib/host/prompt.js +213 -0
- package/lib/host/recipe-overlay.js +209 -0
- package/lib/host/request-preview.js +114 -0
- package/lib/host/routes/activation.js +96 -0
- package/lib/host/routes/activity.js +22 -0
- package/lib/host/routes/apply.js +93 -0
- package/lib/host/routes/cleanup.js +62 -0
- package/lib/host/routes/control.js +22 -0
- package/lib/host/routes/disable-preview.js +19 -0
- package/lib/host/routes/impact.js +19 -0
- package/lib/host/routes/operations.js +22 -0
- package/lib/host/routes/preview.js +58 -0
- package/lib/host/routes/session-influence.js +23 -0
- package/lib/host/routes/snapshot.js +21 -0
- package/lib/host/routes/template.js +54 -0
- package/lib/host/routes/templates.js +28 -0
- package/lib/host/scope-impact.js +125 -0
- package/lib/host/session-events.js +39 -0
- package/lib/host/session-influence.js +467 -0
- package/lib/host/sessions.js +293 -0
- package/lib/host/snapshot.js +218 -0
- package/lib/host/source-scan.js +225 -0
- package/lib/host/templates/cleanup.js +219 -0
- package/lib/host/templates/inheritance.js +144 -0
- package/lib/host/templates/materialize.js +317 -0
- package/lib/host/templates/message-overlay.js +184 -0
- package/lib/host/templates/repository.js +323 -0
- package/lib/host/templates/store.js +131 -0
- package/lib/host/tool-set.js +150 -0
- package/lib/host/tools.js +129 -0
- package/lib/index.js +106 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +124 -6
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工具参数 schema 的阅读视图。
|
|
3
|
+
*
|
|
4
|
+
* 模型收到的 `parameters` 是 JSON Schema。照原文读,决定「怎么调用」的只有
|
|
5
|
+
* properties / required / description 三项,其余大多是 `type: object` 这类骨架;
|
|
6
|
+
* 所以默认视图只留这三项,把默认值、枚举、范围收进一张「标签 + 值」的小表,
|
|
7
|
+
* 原文按工具单独切回。三处调用方(工具页、预演工具、会话首次请求)共用这一份。
|
|
8
|
+
*
|
|
9
|
+
* 版式约束:名字、类型、必填标记在头行,说明必须另起一行。早先把说明放在同一
|
|
10
|
+
* 个 grid 行里,长名字会被挤到每个字占一行;现在类型和标记紧跟名字,整行放不下
|
|
11
|
+
* 时它们折到下一行,不会反过来压缩名字列。
|
|
12
|
+
*
|
|
13
|
+
* 切回原文的状态由页面持有:`vc.schemaRaw` 是 `source:name` 的集合。同一工具
|
|
14
|
+
* 在不同视图里各切各的——会话日志里的 schema 是发送时的定义,可能与当前注册表
|
|
15
|
+
* 不同,不能按名字共用。
|
|
16
|
+
*
|
|
17
|
+
* 本文件是一个包内 chunk:入口用 `require.async('./client.schema.js')` 取它。
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
window.__ModuleLoader__.load({
|
|
21
|
+
id: '@cheemsup/dsh-plugin-console',
|
|
22
|
+
chunk: 'client.schema.js',
|
|
23
|
+
factory: (require) => {
|
|
24
|
+
const React = require('react')
|
|
25
|
+
const { createElement: h } = React
|
|
26
|
+
|
|
27
|
+
return function create(deps) {
|
|
28
|
+
const { textButton, toggleIn } = deps
|
|
29
|
+
|
|
30
|
+
/** 嵌套最多展开三层:再深就只留一句提示,避免一个参数撑满一页。 */
|
|
31
|
+
const MAX_DEPTH = 3
|
|
32
|
+
/** 枚举最多平铺 12 个值;再多就收进原文,避免取值表本身变成一面墙。 */
|
|
33
|
+
const MAX_ENUM = 12
|
|
34
|
+
|
|
35
|
+
/** 一个普通对象(schema 节点);数组与 null 都不算。 */
|
|
36
|
+
function isRecord(value) {
|
|
37
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** 把默认值、枚举这类字面量变成一行可读文本;对象最多截 80 字。 */
|
|
41
|
+
function valueText(value) {
|
|
42
|
+
if (typeof value === 'string') return value
|
|
43
|
+
if (value === null) return 'null'
|
|
44
|
+
if (typeof value === 'number' || typeof value === 'boolean') return String(value)
|
|
45
|
+
try {
|
|
46
|
+
const text = JSON.stringify(value)
|
|
47
|
+
if (typeof text !== 'string') return String(value)
|
|
48
|
+
return text.length > 80 ? text.slice(0, 77) + '…' : text
|
|
49
|
+
} catch {
|
|
50
|
+
return String(value)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 类型列:优先 `type`,其次 oneOf / anyOf 的分支类型,再退回 enum / const。
|
|
56
|
+
* 读不到就留空,不用「未知」占位——空列比一句废话更容易扫。
|
|
57
|
+
*/
|
|
58
|
+
function typeLabel(schema) {
|
|
59
|
+
if (!isRecord(schema)) return ''
|
|
60
|
+
if (typeof schema.type === 'string') return schema.type
|
|
61
|
+
if (Array.isArray(schema.type)) {
|
|
62
|
+
const names = schema.type.filter((name) => typeof name === 'string')
|
|
63
|
+
if (names.length > 0) return names.join(' | ')
|
|
64
|
+
}
|
|
65
|
+
for (const key of ['oneOf', 'anyOf']) {
|
|
66
|
+
const variants = schema[key]
|
|
67
|
+
if (!Array.isArray(variants)) continue
|
|
68
|
+
const names = [...new Set(variants.map((variant) => typeLabel(variant)).filter(Boolean))]
|
|
69
|
+
if (names.length > 0) return names.join(' | ')
|
|
70
|
+
}
|
|
71
|
+
if (Array.isArray(schema.enum)) return 'enum'
|
|
72
|
+
if (schema.const !== undefined) {
|
|
73
|
+
if (schema.const === null) return 'null'
|
|
74
|
+
return typeof schema.const === 'string' ? 'string' : typeof schema.const
|
|
75
|
+
}
|
|
76
|
+
return ''
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** 数值范围;只认数字形态的 minimum / exclusiveMinimum。 */
|
|
80
|
+
function rangeText(schema) {
|
|
81
|
+
const min = typeof schema.minimum === 'number'
|
|
82
|
+
? schema.minimum
|
|
83
|
+
: (typeof schema.exclusiveMinimum === 'number' ? schema.exclusiveMinimum : undefined)
|
|
84
|
+
const max = typeof schema.maximum === 'number'
|
|
85
|
+
? schema.maximum
|
|
86
|
+
: (typeof schema.exclusiveMaximum === 'number' ? schema.exclusiveMaximum : undefined)
|
|
87
|
+
if (min === undefined && max === undefined) return ''
|
|
88
|
+
return (min === undefined ? '−∞' : String(min)) + '–' + (max === undefined ? '∞' : String(max))
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** 长度约束:字符串与数组共用一套写法。 */
|
|
92
|
+
function lengthText(schema) {
|
|
93
|
+
const min = typeof schema.minLength === 'number' ? schema.minLength : schema.minItems
|
|
94
|
+
const max = typeof schema.maxLength === 'number' ? schema.maxLength : schema.maxItems
|
|
95
|
+
if (min === undefined && max === undefined) return ''
|
|
96
|
+
return (min === undefined ? '0' : String(min)) + '–' + (max === undefined ? '∞' : String(max))
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* 约束项,渲染成「标签 + 值」的两列表。
|
|
101
|
+
*
|
|
102
|
+
* 每一项独占一行:几个约束挤在同一行时,长的枚举会把范围、格式推到看不见
|
|
103
|
+
* 的地方;分行的代价只是两三个像素的行高。
|
|
104
|
+
* @param {object} schema - 一个属性节点。
|
|
105
|
+
* @returns {Array<object>} `{ label, text }` 或 `{ label, values, more }`。
|
|
106
|
+
*/
|
|
107
|
+
function factsOf(schema) {
|
|
108
|
+
const facts = []
|
|
109
|
+
if (schema.default !== undefined) facts.push({ label: '默认', text: valueText(schema.default) })
|
|
110
|
+
if (Array.isArray(schema.enum)) {
|
|
111
|
+
const values = schema.enum.map((value) => valueText(value))
|
|
112
|
+
facts.push({
|
|
113
|
+
label: '可选值',
|
|
114
|
+
values: values.slice(0, MAX_ENUM),
|
|
115
|
+
more: Math.max(0, values.length - MAX_ENUM),
|
|
116
|
+
total: values.length,
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
if (typeof schema.format === 'string') facts.push({ label: '格式', text: schema.format })
|
|
120
|
+
const range = rangeText(schema)
|
|
121
|
+
if (range !== '') facts.push({ label: '范围', text: range })
|
|
122
|
+
const length = lengthText(schema)
|
|
123
|
+
if (length !== '') facts.push({ label: '长度', text: length })
|
|
124
|
+
if (typeof schema.pattern === 'string') facts.push({ label: '匹配', text: schema.pattern })
|
|
125
|
+
if (typeof schema.$ref === 'string') facts.push({ label: '引用', text: schema.$ref })
|
|
126
|
+
return facts
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* 把一层 properties 解析成参数项;对象属性与数组元素各自成一棵子树。
|
|
131
|
+
*
|
|
132
|
+
* 路径只用于 React key 与悬停:界面上靠缩进表达层级,不把完整路径写进
|
|
133
|
+
* 头行——那会让名字列变成最长的那一项。
|
|
134
|
+
* @param {object} schema - 当前层 schema。
|
|
135
|
+
* @param {number} depth - 当前层级。
|
|
136
|
+
* @param {string} path - 父级路径,空串表示顶层。
|
|
137
|
+
* @returns {Array<object>} 参数项。
|
|
138
|
+
*/
|
|
139
|
+
function rowsOf(schema, depth, path) {
|
|
140
|
+
const properties = schema?.properties
|
|
141
|
+
if (!isRecord(properties)) return []
|
|
142
|
+
const required = new Set(
|
|
143
|
+
Array.isArray(schema.required) ? schema.required.filter((name) => typeof name === 'string') : [],
|
|
144
|
+
)
|
|
145
|
+
const rows = []
|
|
146
|
+
for (const [name, child] of Object.entries(properties)) {
|
|
147
|
+
if (!isRecord(child)) continue
|
|
148
|
+
const rowPath = path === '' ? name : path + '.' + name
|
|
149
|
+
const row = {
|
|
150
|
+
path: rowPath,
|
|
151
|
+
name,
|
|
152
|
+
type: typeLabel(child),
|
|
153
|
+
required: required.has(name),
|
|
154
|
+
description: typeof child.description === 'string' ? child.description.trim() : '',
|
|
155
|
+
facts: factsOf(child),
|
|
156
|
+
childGroups: [],
|
|
157
|
+
truncated: false,
|
|
158
|
+
}
|
|
159
|
+
rows.push(row)
|
|
160
|
+
if (depth >= MAX_DEPTH) {
|
|
161
|
+
if (isRecord(child.properties) || isRecord(child.items)) row.truncated = true
|
|
162
|
+
continue
|
|
163
|
+
}
|
|
164
|
+
const childRows = rowsOf(child, depth + 1, rowPath)
|
|
165
|
+
if (childRows.length > 0) row.childGroups.push({ kind: 'object', rows: childRows })
|
|
166
|
+
if (isRecord(child.items)) {
|
|
167
|
+
const itemRows = rowsOf(child.items, depth + 1, rowPath + '[]')
|
|
168
|
+
if (itemRows.length > 0) row.childGroups.push({ kind: 'items', rows: itemRows })
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return rows
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* 一份 parameters 的可展示摘要。
|
|
176
|
+
*
|
|
177
|
+
* 只有「具名 object 属性」才值得结构化;`{ type: 'object' }`、`$ref`、
|
|
178
|
+
* 顶层 oneOf 这类读不出字段的 schema 返回 opaque,由调用方原样显示,
|
|
179
|
+
* 不猜、也不把空结果说成「没有参数」。
|
|
180
|
+
* @param {object | undefined} parameters - 工具 schema 的 parameters。
|
|
181
|
+
* @returns {{kind: 'object', rows: Array<object>, count: number, requiredCount: number} | {kind: 'opaque'} | {kind: 'none'}} 摘要。
|
|
182
|
+
*/
|
|
183
|
+
function parseSchema(parameters) {
|
|
184
|
+
if (!isRecord(parameters)) return { kind: 'none' }
|
|
185
|
+
const properties = parameters.properties
|
|
186
|
+
if (!isRecord(properties) || Object.keys(properties).length === 0) return { kind: 'opaque' }
|
|
187
|
+
const rows = rowsOf(parameters, 0, '')
|
|
188
|
+
return {
|
|
189
|
+
kind: 'object',
|
|
190
|
+
rows,
|
|
191
|
+
count: Object.keys(properties).length,
|
|
192
|
+
requiredCount: rows.filter((row) => row.required).length,
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** 切换状态的 key:视图来源 + 工具名。 */
|
|
197
|
+
function schemaKey(source, name) {
|
|
198
|
+
return source + ':' + name
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** 这个工具当前是否显示原文;状态缺席时按结构化处理。 */
|
|
202
|
+
function isRaw(vc, key) {
|
|
203
|
+
const raw = vc?.schemaRaw
|
|
204
|
+
return typeof raw?.has === 'function' && raw.has(key)
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** 结构化 / 原文的切换按钮;标签写下一步会切到哪一边。 */
|
|
208
|
+
function schemaToggle(vc, key) {
|
|
209
|
+
const raw = isRaw(vc, key)
|
|
210
|
+
return textButton(raw ? '点击查看结构化结果' : '点击查看原文', () => {
|
|
211
|
+
if (typeof vc?.setSchemaRaw === 'function') toggleIn(vc.setSchemaRaw, key)
|
|
212
|
+
}, {
|
|
213
|
+
title: raw ? '换回提炼后的参数视图' : '查看模型收到的原始 JSON schema',
|
|
214
|
+
})
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** 约束的两列表:左列标签按内容宽,右列吃满剩余宽度并自行折行。 */
|
|
218
|
+
function factsTable(facts) {
|
|
219
|
+
return h(
|
|
220
|
+
'dl',
|
|
221
|
+
{ className: 'ptSchemaFacts' },
|
|
222
|
+
facts.flatMap((fact) => [
|
|
223
|
+
h('dt', { key: fact.label }, fact.label),
|
|
224
|
+
h(
|
|
225
|
+
'dd',
|
|
226
|
+
{ key: fact.label + ':value' },
|
|
227
|
+
fact.values === undefined
|
|
228
|
+
? fact.text
|
|
229
|
+
: h(
|
|
230
|
+
React.Fragment,
|
|
231
|
+
null,
|
|
232
|
+
h(
|
|
233
|
+
'div',
|
|
234
|
+
{ className: 'ptSchemaEnumList' },
|
|
235
|
+
fact.values.map((value, index) => h('span', { key: index, className: 'ptSchemaEnum' }, value)),
|
|
236
|
+
),
|
|
237
|
+
fact.more > 0
|
|
238
|
+
? h('span', { className: 'ptSchemaMore' }, `另有 ${fact.more} 个(共 ${fact.total} 个),见原文`)
|
|
239
|
+
: null,
|
|
240
|
+
),
|
|
241
|
+
),
|
|
242
|
+
]),
|
|
243
|
+
)
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/** 子参数块:缩进 + 左侧竖线,层级由容器表达而不是每行加 padding。 */
|
|
247
|
+
function childGroup(group, key) {
|
|
248
|
+
return h(
|
|
249
|
+
'div',
|
|
250
|
+
{ key, className: 'ptSchemaChildren' },
|
|
251
|
+
group.kind === 'items' ? h('p', { className: 'ptSchemaGroupLabel' }, '数组元素') : null,
|
|
252
|
+
h('ul', { className: 'ptSchemaRows' }, group.rows.map((row) => schemaRow(row))),
|
|
253
|
+
)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* 一个参数项:头行(名字 / 类型 / 必填)与正文(说明、约束、子参数)分开。
|
|
258
|
+
*
|
|
259
|
+
* 头行 `flex-wrap`:类型与标记紧跟名字;整行放不下时它们折到下一行,
|
|
260
|
+
* 而不是把名字挤成一列单字。
|
|
261
|
+
*/
|
|
262
|
+
function schemaRow(row) {
|
|
263
|
+
return h(
|
|
264
|
+
'li',
|
|
265
|
+
{ key: row.path, className: 'ptSchemaItem' },
|
|
266
|
+
h(
|
|
267
|
+
'div',
|
|
268
|
+
{ className: 'ptSchemaLine' },
|
|
269
|
+
h('span', { className: 'ptSchemaName', title: row.path }, row.name),
|
|
270
|
+
row.type !== '' ? h('span', { className: 'ptSchemaType' }, row.type) : null,
|
|
271
|
+
row.required ? h('span', { className: 'ptSchemaReq', title: '必填参数' }, '必填') : null,
|
|
272
|
+
row.truncated
|
|
273
|
+
? h('span', { className: 'ptSchemaMore', title: '更深的层级请查看原文' }, '更深层级')
|
|
274
|
+
: null,
|
|
275
|
+
),
|
|
276
|
+
row.description !== '' ? h('p', { className: 'ptSchemaDesc' }, row.description) : null,
|
|
277
|
+
row.facts.length > 0 ? factsTable(row.facts) : null,
|
|
278
|
+
row.childGroups.map((group, index) => childGroup(group, group.kind + ':' + index)),
|
|
279
|
+
)
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* 一个工具的参数区:默认结构化,按工具切回原文。
|
|
284
|
+
*
|
|
285
|
+
* `parameters === undefined` 时返回 null,由各视图保留自己的「无参数 schema」
|
|
286
|
+
* 文案:三处原本就不一致(会话页不显示),统一反而会多出一行。
|
|
287
|
+
* @param {object} tool - 至少含 `name`,通常含 `parameters`。
|
|
288
|
+
* @param {object} ctx - `{ vc, source }`;`source` 区分工具页 / 预演 / 会话日志。
|
|
289
|
+
* @returns {object | null} React 节点。
|
|
290
|
+
*/
|
|
291
|
+
function renderParameters(tool, ctx) {
|
|
292
|
+
const parameters = tool?.parameters
|
|
293
|
+
if (parameters === undefined) return null
|
|
294
|
+
const { vc, source } = ctx
|
|
295
|
+
const key = schemaKey(source, tool.name)
|
|
296
|
+
const raw = isRaw(vc, key)
|
|
297
|
+
const parsed = parseSchema(parameters)
|
|
298
|
+
|
|
299
|
+
if (parsed.kind === 'opaque') {
|
|
300
|
+
return h(
|
|
301
|
+
'div',
|
|
302
|
+
{ className: 'ptSchema' },
|
|
303
|
+
h('p', { className: 'ptSchemaNote' }, '这份 schema 没有声明具名参数,按原文显示。'),
|
|
304
|
+
h('pre', { className: 'ptPromptText', style: { marginTop: '6px' } }, JSON.stringify(parameters, null, 2)),
|
|
305
|
+
)
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
return h(
|
|
309
|
+
'div',
|
|
310
|
+
{ className: 'ptSchema' },
|
|
311
|
+
h(
|
|
312
|
+
'div',
|
|
313
|
+
{ className: 'ptSchemaHead' },
|
|
314
|
+
h('span', { className: 'ptSchemaSummary' }, `参数 ${parsed.count} · 必填 ${parsed.requiredCount}`),
|
|
315
|
+
h('span', { className: 'ptSchemaSpacer' }),
|
|
316
|
+
schemaToggle(vc, key),
|
|
317
|
+
),
|
|
318
|
+
raw
|
|
319
|
+
? h('pre', { className: 'ptPromptText', style: { marginTop: '6px' } }, JSON.stringify(parameters, null, 2))
|
|
320
|
+
: h('ul', { className: 'ptSchemaRows' }, parsed.rows.map((row) => schemaRow(row))),
|
|
321
|
+
)
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return { parseSchema, renderParameters, schemaKey }
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
})
|