cli-aimlock 7.0.31 → 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.
@@ -209,7 +209,7 @@ const RESPONSE_SCHEMA = "aimlock.skill.response/1.1";
209
209
  const ERROR_SCHEMA = "aimlock.skill.error/1.0";
210
210
  const CONTRACT_SCHEMA = "aimlock.scope-contract/1.0";
211
211
  const COMPILER_NAME = "aimlock";
212
- const COMPILER_VERSION = "v7.0.31";
212
+ const COMPILER_VERSION = "v7.0.32";
213
213
  const KEEP_ALIVE_SECONDS = 90;
214
214
  const KEEP_ALIVE_MESSAGE = "智能目标持续执行中,请勿关闭!";
215
215
  const BYPASS_LINE_BUDGET = 500;
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
@@ -3,7 +3,7 @@
3
3
  "cli-aimlock": "./cli.mjs"
4
4
  },
5
5
  "dependencies": {
6
- "cli-swarm": "7.0.31"
6
+ "cli-swarm": "7.0.32"
7
7
  },
8
8
  "description": "Aimlock skill installer for CLI.Tax: lock a user request into an executable aim and route Blueprint, Swarm, and Calctool.",
9
9
  "exports": {
@@ -32,5 +32,5 @@
32
32
  "url": "https://github.com/88208555/aimlock-clitax.git"
33
33
  },
34
34
  "type": "module",
35
- "version": "7.0.31"
35
+ "version": "7.0.32"
36
36
  }
package/skill/SKILL.md CHANGED
@@ -5,7 +5,7 @@ description: "Aimlock 仅用于大型、深度、跨模块、高风险、需要
5
5
 
6
6
  # Aimlock Skill
7
7
 
8
- Package version: v7.0.31
8
+ Package version: v7.0.32
9
9
 
10
10
  Endpoint: https://cli.tax/R3mQ8kWpXn
11
11
 
package/skill/skill.json CHANGED
@@ -6,5 +6,5 @@
6
6
  "name": "aimlock",
7
7
  "schemaVersion": "aimlock.skill.request/1.1",
8
8
  "type": "Skill",
9
- "version": "v7.0.31"
9
+ "version": "v7.0.32"
10
10
  }