cli-blueprint 7.0.30 → 7.0.32
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/broker.mjs +19 -2
- package/package.json +1 -1
- package/skill/SKILL.md +2 -2
- package/skill/skill.json +1 -1
package/broker.mjs
CHANGED
|
@@ -24,6 +24,7 @@ const VALIDATION_STATES = new Set(['passed', 'failed', 'incomplete'])
|
|
|
24
24
|
const EVALUATION_SCHEMA = 'skill-automatic-evaluation/1.0'
|
|
25
25
|
const IDENTIFIER_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/
|
|
26
26
|
const REQUEST_SCHEMA_PATTERN = /^([A-Za-z0-9.-]+\.skill)\.request\/([0-9]+\.[0-9]+)$/
|
|
27
|
+
const TRANSPORT_ERROR_CODE_PATTERN = /^[A-Z][A-Z0-9_]{1,63}$/
|
|
27
28
|
|
|
28
29
|
function asObject(value, label) {
|
|
29
30
|
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
@@ -222,6 +223,20 @@ function invocationRequest(context, operation, input) {
|
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
225
|
|
|
226
|
+
export function transportFailureCode(error) {
|
|
227
|
+
const inspected = new Set()
|
|
228
|
+
let candidate = error
|
|
229
|
+
while (candidate && typeof candidate === 'object' && !inspected.has(candidate)) {
|
|
230
|
+
inspected.add(candidate)
|
|
231
|
+
const code = typeof candidate.code === 'string' ? candidate.code.trim() : ''
|
|
232
|
+
if (TRANSPORT_ERROR_CODE_PATTERN.test(code)) return code
|
|
233
|
+
const name = typeof candidate.name === 'string' ? candidate.name.trim() : ''
|
|
234
|
+
if (name === 'AbortError' || name === 'TimeoutError') return name
|
|
235
|
+
candidate = candidate.cause
|
|
236
|
+
}
|
|
237
|
+
return 'UNKNOWN_TRANSPORT_ERROR'
|
|
238
|
+
}
|
|
239
|
+
|
|
225
240
|
export async function invokeOfficialSkill(context, operation, input, dependencies) {
|
|
226
241
|
const environment = asObject(dependencies.environment, 'broker environment')
|
|
227
242
|
if (typeof dependencies.request !== 'function') {
|
|
@@ -237,8 +252,10 @@ export async function invokeOfficialSkill(context, operation, input, dependencie
|
|
|
237
252
|
body: JSON.stringify({ input: requestEnvelope }),
|
|
238
253
|
signal: AbortSignal.timeout(CALL_TIMEOUT_MS),
|
|
239
254
|
})
|
|
240
|
-
} catch {
|
|
241
|
-
throw new Error(
|
|
255
|
+
} catch (error) {
|
|
256
|
+
throw new Error(
|
|
257
|
+
`${context.displayName} ${operation} invocation failed: network transport ${transportFailureCode(error)}`,
|
|
258
|
+
)
|
|
242
259
|
}
|
|
243
260
|
const payload = await responsePayload(response, `${context.displayName} ${operation} response`)
|
|
244
261
|
if (!response.ok || payload.ok !== true) {
|
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: '把一个目标编译为可执行、可验证、可追溯的工程
|
|
|
5
5
|
|
|
6
6
|
# Blueprint Skill
|
|
7
7
|
|
|
8
|
-
Package version: v7.0.
|
|
8
|
+
Package version: v7.0.32
|
|
9
9
|
|
|
10
10
|
远端 Hermes 编译器版本:0.4.0(独立于 npm 包版本)
|
|
11
11
|
|
|
@@ -250,7 +250,7 @@ After `capabilities`, read `officialCatalog`. Default allowlist is official skil
|
|
|
250
250
|
| B3 | 业务模板库与粗粒度模式 | 规划中 | 当前没有模板操作,`template` 与 `coarseMode` 均不是受支持输入。 |
|
|
251
251
|
| B4 | 验收回传、开放问题闭环、Validator 桥接 | 规划中 | 当前没有 `acceptance-report`、`answer-questions` 或 Validator 桥接操作。 |
|
|
252
252
|
|
|
253
|
-
只调用 `capabilities` 返回的五个操作。不要根据规划中条目构造请求,也不要把 npm 包版本 `v7.0.
|
|
253
|
+
只调用 `capabilities` 返回的五个操作。不要根据规划中条目构造请求,也不要把 npm 包版本 `v7.0.32` 与远端 Hermes 编译器版本 `0.4.0` 混为一谈。
|
|
254
254
|
|
|
255
255
|
## 受限调用与自动评价闭环
|
|
256
256
|
|
package/skill/skill.json
CHANGED