cli-archguard 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.
@@ -2,7 +2,7 @@ import { createHash } from 'node:crypto'
2
2
 
3
3
  const REQUEST_VERSION = 'archguard.skill.request/1.0'
4
4
  const RESPONSE_VERSION = 'archguard.skill.response/1.0'
5
- const COMPILER_VERSION = 'v7.0.30'
5
+ const COMPILER_VERSION = 'v7.0.32'
6
6
  const CONTRACT_VERSION = 'archguard.contract/1.0'
7
7
  const LEDGER_VERSION = 'archguard.checkpoint-ledger/1.0'
8
8
  const SHA256 = /^[0-9a-f]{64}$/
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(`${context.displayName} ${operation} invocation failed`)
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
@@ -4,7 +4,7 @@
4
4
  },
5
5
  "dependencies": {
6
6
  "@babel/parser": "^8.0.4",
7
- "cli-aimlock": "7.0.30",
7
+ "cli-aimlock": "7.0.32",
8
8
  "yaml": "^2.8.1"
9
9
  },
10
10
  "description": "ArchGuard skill installer for CLI.Tax: architecture contracts, chunk checkpoints, drift control, and auditable rollback.",
@@ -26,5 +26,5 @@
26
26
  "url": "https://github.com/88208555/archguard-clitax.git"
27
27
  },
28
28
  "type": "module",
29
- "version": "7.0.30"
29
+ "version": "7.0.32"
30
30
  }
package/skill/SKILL.md CHANGED
@@ -5,7 +5,7 @@ description: '在代码写入期间锁定项目架构合同,并逐块检查技
5
5
 
6
6
  # 架构守卫 / ArchGuard / Архитектурный страж
7
7
 
8
- Package version: v7.0.30
8
+ Package version: v7.0.32
9
9
 
10
10
  Endpoint: https://cli.tax/Ag4Ch8Rd2K
11
11
  Request schema: `archguard.skill.request/1.0`
package/skill/skill.json CHANGED
@@ -5,6 +5,6 @@
5
5
  "method": "POST",
6
6
  "name": "archguard",
7
7
  "type": "Skill",
8
- "version": "v7.0.30",
8
+ "version": "v7.0.32",
9
9
  "schemaVersion": "archguard.skill.request/1.0"
10
10
  }