@arcforge/err 2.0.162 → 2.0.164
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/README.md +25 -0
- package/package.json +22 -3
- package/src/map.ts +220 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @arcforge/err
|
|
2
|
+
|
|
3
|
+
Structured errors for the [Axon](https://axon.arclabs.it) agent runtime.
|
|
4
|
+
|
|
5
|
+
Every user-facing failure in Axon is rendered from a single code map. An error is a
|
|
6
|
+
structured code with a known cause and a known remedy — never a bare string thrown
|
|
7
|
+
from wherever it happened to occur.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @arcforge/err
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Most people never install this directly. It arrives as a dependency of the Axon
|
|
14
|
+
framework when you scaffold an agent with `axon init`.
|
|
15
|
+
|
|
16
|
+
## Documentation
|
|
17
|
+
|
|
18
|
+
Full documentation is at **[axon.arclabs.it/docs/v2](https://axon.arclabs.it/docs/v2)**.
|
|
19
|
+
|
|
20
|
+
- [What is Axon?](https://axon.arclabs.it/docs/v2)
|
|
21
|
+
- [The axon API](https://axon.arclabs.it/docs/v2/api)
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
Proprietary. © ArcLabs
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcforge/err",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.164",
|
|
4
4
|
"description": "Structured Axon errors — the code map every user-facing failure is rendered from.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -15,10 +15,29 @@
|
|
|
15
15
|
"deploy": "echo \"This package is published ONLY by apps/tui/scripts/release.ts, which pins workspace:* deps to concrete versions first. Publishing it directly ships an unresolvable dependency.\" && exit 1"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@arcforge/types": "2.0.
|
|
18
|
+
"@arcforge/types": "2.0.164"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/bun": "latest",
|
|
22
22
|
"typescript": "^5"
|
|
23
|
-
}
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://axon.arclabs.it/docs/v2",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/artificial-cognition-laboratories/axon.git",
|
|
28
|
+
"directory": "libs/axon/packages/err"
|
|
29
|
+
},
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/artificial-cognition-laboratories/axon/issues"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"axon",
|
|
35
|
+
"ai",
|
|
36
|
+
"agent",
|
|
37
|
+
"agents",
|
|
38
|
+
"llm",
|
|
39
|
+
"ai-agent",
|
|
40
|
+
"agent-runtime",
|
|
41
|
+
"typescript"
|
|
42
|
+
]
|
|
24
43
|
}
|
package/src/map.ts
CHANGED
|
@@ -508,6 +508,80 @@ export const errorMap = {
|
|
|
508
508
|
severity: "fatal",
|
|
509
509
|
},
|
|
510
510
|
|
|
511
|
+
/**
|
|
512
|
+
* A flattened tool export would have replaced a host global. Refused at
|
|
513
|
+
* install rather than silently skipped: skipping made the generated
|
|
514
|
+
* tool-globals.d.ts assert a binding the runtime never made, so the
|
|
515
|
+
* editor typechecked a call that threw (or worse, silently read the
|
|
516
|
+
* builtin) at run time.
|
|
517
|
+
*/
|
|
518
|
+
TOOL_GLOBAL_COLLISION: {
|
|
519
|
+
code: "AX-TOOL-409",
|
|
520
|
+
title: "Tool Global Collides With A Builtin",
|
|
521
|
+
description: "A flattened tool export has the same name as something that already exists in the agent's global scope, and replacing it would break the code around it. Reach this member through `axon.tools.<namespace>.<member>`, rename the export, or drop `flat` so the module lands under its own namespace instead.",
|
|
522
|
+
source: "manifest",
|
|
523
|
+
severity: "fatal",
|
|
524
|
+
expected: true,
|
|
525
|
+
},
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* A script the agent declares ran and failed. The agent's own error is
|
|
529
|
+
* carried in `detail` — this code says WHERE it failed, not what went
|
|
530
|
+
* wrong, which is the script's own business.
|
|
531
|
+
*/
|
|
532
|
+
SCRIPT_FAILED: {
|
|
533
|
+
code: "AX-SCRIPT-500",
|
|
534
|
+
title: "Script Failed",
|
|
535
|
+
description: "A script declared by this agent was invoked and threw. The agent's own error follows — this is the script's failure, not the runtime's.",
|
|
536
|
+
source: "runtime",
|
|
537
|
+
severity: "fatal",
|
|
538
|
+
expected: true,
|
|
539
|
+
},
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* The agent could not bind an HTTP port. Walking forward from the
|
|
543
|
+
* requested one is deliberate (a second agent should come up beside the
|
|
544
|
+
* first), so reaching the end of the range means the whole span is taken
|
|
545
|
+
* — a real environment problem rather than a retry.
|
|
546
|
+
*/
|
|
547
|
+
AGENT_SERVE_NO_PORT: {
|
|
548
|
+
code: "AX-AGENT-503",
|
|
549
|
+
title: "No Free Port",
|
|
550
|
+
description: "The agent tried to bind its HTTP surface and every port in the range it walked was already in use. Free one, or pass a different port with --port.",
|
|
551
|
+
source: "runtime",
|
|
552
|
+
severity: "fatal",
|
|
553
|
+
expected: true,
|
|
554
|
+
},
|
|
555
|
+
|
|
556
|
+
// ── Agent resolution (build/runtime/resolve.ts) ─────────────────────────
|
|
557
|
+
/**
|
|
558
|
+
* A named reference matched no agent in any local pool. Distinct from
|
|
559
|
+
* PROJECT_NOT_FOUND, which means "this path is not a project": here the
|
|
560
|
+
* caller named an agent and the answer is that it is not installed
|
|
561
|
+
* anywhere, which has a different fix (`axon install`).
|
|
562
|
+
*/
|
|
563
|
+
AGENT_NOT_FOUND: {
|
|
564
|
+
code: "AX-AGENT-404",
|
|
565
|
+
title: "Agent Not Found",
|
|
566
|
+
description: "No local agent goes by this name. Agent references resolve against your local pools only — watched paths first, then installed agents — and never fetch from the registry. Install it first with `axon install`.",
|
|
567
|
+
source: "manifest",
|
|
568
|
+
severity: "fatal",
|
|
569
|
+
expected: true,
|
|
570
|
+
},
|
|
571
|
+
/**
|
|
572
|
+
* Two pools both hold an agent with this identity. Never resolved by
|
|
573
|
+
* picking one: running the wrong agent silently is the failure this
|
|
574
|
+
* exists to prevent.
|
|
575
|
+
*/
|
|
576
|
+
AGENT_AMBIGUOUS: {
|
|
577
|
+
code: "AX-AGENT-409",
|
|
578
|
+
title: "Ambiguous Agent Name",
|
|
579
|
+
description: "More than one local pool holds an agent with this name, and there is no correct way to guess which was meant — pass an explicit path, or unwatch one of the roots.",
|
|
580
|
+
source: "manifest",
|
|
581
|
+
severity: "fatal",
|
|
582
|
+
expected: true,
|
|
583
|
+
},
|
|
584
|
+
|
|
511
585
|
// ── Project (build/project/*.ts) ────────────────────────────────────────
|
|
512
586
|
PROJECT_NOT_FOUND: {
|
|
513
587
|
code: "AX-PROJECT-017",
|
|
@@ -1319,6 +1393,30 @@ export const errorMap = {
|
|
|
1319
1393
|
source: "capsule",
|
|
1320
1394
|
severity: "fatal",
|
|
1321
1395
|
},
|
|
1396
|
+
AGENT_ENV_RESERVED: {
|
|
1397
|
+
code: "AX-CAPSULE-012",
|
|
1398
|
+
title: "Reserved Environment Variable",
|
|
1399
|
+
description: "An agent's .env sets a framework-owned variable the runtime controls (AGENT_ID, AXON_API_BASE and similar). These identify the agent to the platform, so overriding one locally would make the agent report itself as something it is not. The deploy path has always refused this; the local path now refuses it identically.",
|
|
1400
|
+
source: "capsule",
|
|
1401
|
+
severity: "fatal",
|
|
1402
|
+
},
|
|
1403
|
+
|
|
1404
|
+
CAPSULE_NET_UNRESOLVED: {
|
|
1405
|
+
code: "AX-CAPSULE-010",
|
|
1406
|
+
title: "Network Policy Did Not Resolve",
|
|
1407
|
+
description: "A `net.allow` entry names a hostname that did not resolve to any address. Egress rules are installed as addresses, so an unresolvable name becomes no rule at all — a grant you believe you made and did not. The box refuses to boot rather than run with an allowlist quietly smaller than the one you wrote. Check the hostname, or use a literal address if the name is resolvable only from inside the box.",
|
|
1408
|
+
source: "capsule",
|
|
1409
|
+
severity: "fatal",
|
|
1410
|
+
},
|
|
1411
|
+
|
|
1412
|
+
CAPSULE_NET_UNAVAILABLE: {
|
|
1413
|
+
code: "AX-CAPSULE-011",
|
|
1414
|
+
title: "Network Confinement Unavailable",
|
|
1415
|
+
description: "The policy declares a `net` allowlist, which needs a userspace network stack (slirp4netns) and nftables inside the box's namespace. One of them is missing on this host. Install slirp4netns and nftables, or drop the `net` block to run with no network at all — the box will not fall back to unfiltered egress.",
|
|
1416
|
+
source: "capsule",
|
|
1417
|
+
severity: "fatal",
|
|
1418
|
+
},
|
|
1419
|
+
|
|
1322
1420
|
CAPSULE_CONFINE_UNAVAILABLE: {
|
|
1323
1421
|
code: "AX-CAPSULE-004",
|
|
1324
1422
|
title: "OS Confinement Unavailable",
|
|
@@ -1619,6 +1717,14 @@ export const errorMap = {
|
|
|
1619
1717
|
severity: "fatal",
|
|
1620
1718
|
expected: true,
|
|
1621
1719
|
},
|
|
1720
|
+
FLAG_VALUE_REQUIRED: {
|
|
1721
|
+
code: "AX-CLI-007",
|
|
1722
|
+
title: "A Flag Is Missing Its Value",
|
|
1723
|
+
description: "The flag takes a value and none followed it. Quote the value if it contains spaces, and check it was not consumed as another flag.",
|
|
1724
|
+
source: "cli",
|
|
1725
|
+
severity: "fatal",
|
|
1726
|
+
expected: true,
|
|
1727
|
+
},
|
|
1622
1728
|
RUN_INSTRUCTION_REQUIRED: {
|
|
1623
1729
|
code: "AX-CLI-006",
|
|
1624
1730
|
title: "Nothing To Run",
|
|
@@ -2201,6 +2307,120 @@ export const errorMap = {
|
|
|
2201
2307
|
severity: "degraded",
|
|
2202
2308
|
expected: true,
|
|
2203
2309
|
},
|
|
2310
|
+
// ── Daemon (axond) ──────────────────────────────────────────────────────
|
|
2311
|
+
//
|
|
2312
|
+
// The daemon owns machine-wide state, so its failures are about REACHING
|
|
2313
|
+
// it or about it refusing something — never about the work itself, which
|
|
2314
|
+
// reports through the domain's own codes.
|
|
2315
|
+
AGENT_NO_SUPERVISOR: {
|
|
2316
|
+
code: "AX-AGENT-030",
|
|
2317
|
+
title: "No Supervisor to Boot This Agent",
|
|
2318
|
+
description: "Something asked a platform to spawn an agent, but that platform was built without a supervisor. Supervision holds the provider credential and the session log, so it lives in the daemon rather than in whichever process happened to ask — a platform used only to read the store or publish a project does not need one, and this is where the difference surfaces.",
|
|
2319
|
+
source: "runtime",
|
|
2320
|
+
severity: "fatal",
|
|
2321
|
+
expected: true,
|
|
2322
|
+
},
|
|
2323
|
+
MODEL_RUNTIME_MISSING: {
|
|
2324
|
+
code: "AX-MODEL-031",
|
|
2325
|
+
title: "That Runtime Is Not Installed",
|
|
2326
|
+
description: "An adapter recognised the model and the library that executes it is not on this machine. Local inference runtimes are optional because they are large — ONNX Runtime alone is around 300MB of native binaries — so they are installed when first wanted rather than shipped with the CLI.",
|
|
2327
|
+
source: "daemon",
|
|
2328
|
+
severity: "fatal",
|
|
2329
|
+
expected: true,
|
|
2330
|
+
},
|
|
2331
|
+
MODEL_LOAD_FAILED: {
|
|
2332
|
+
code: "AX-MODEL-032",
|
|
2333
|
+
title: "The Model Could Not Be Loaded",
|
|
2334
|
+
description: "A runtime recognised the file and failed to read it. Distinct from an unsupported format: this weight is one this machine can execute in principle, so the file itself is the problem — truncated, corrupt, or not the model its name claims.",
|
|
2335
|
+
source: "daemon",
|
|
2336
|
+
severity: "fatal",
|
|
2337
|
+
},
|
|
2338
|
+
MODEL_WILL_NOT_FIT: {
|
|
2339
|
+
code: "AX-MODEL-033",
|
|
2340
|
+
title: "Not Enough Memory for This Model",
|
|
2341
|
+
description: "The weight loaded and did not fit within this machine's ceiling, so it was unloaded again. The refusal names what is holding the memory — a model already resident, or another process entirely, since the check measures the whole card rather than Axon's share. Nothing is evicted automatically: a silent eviction is another agent mysteriously slowing down.",
|
|
2342
|
+
source: "daemon",
|
|
2343
|
+
severity: "degraded",
|
|
2344
|
+
expected: true,
|
|
2345
|
+
},
|
|
2346
|
+
MODEL_NOT_RESIDENT: {
|
|
2347
|
+
code: "AX-MODEL-034",
|
|
2348
|
+
title: "That Model Is Not Loaded",
|
|
2349
|
+
description: "Inference was asked of a weight that is not in memory. Loading is never implicit: it is a claim on the machine's memory, and taking one a caller did not ask for would make admission invisible at the moment it matters.",
|
|
2350
|
+
source: "daemon",
|
|
2351
|
+
severity: "degraded",
|
|
2352
|
+
expected: true,
|
|
2353
|
+
},
|
|
2354
|
+
MODEL_NOT_CACHED: {
|
|
2355
|
+
code: "AX-MODEL-035",
|
|
2356
|
+
title: "That Model Is Not On This Machine",
|
|
2357
|
+
description: "A weight was asked for that has not been fetched. The daemon caches models content-addressed and machine-wide, so one download serves every agent — but it only serves what has actually been downloaded.",
|
|
2358
|
+
source: "daemon",
|
|
2359
|
+
severity: "degraded",
|
|
2360
|
+
expected: true,
|
|
2361
|
+
},
|
|
2362
|
+
MODEL_NO_SINGLE_WEIGHT: {
|
|
2363
|
+
code: "AX-MODEL-036",
|
|
2364
|
+
title: "That Repository Has No Single Weight",
|
|
2365
|
+
description: "A repository was asked for by name and publishes several weights with no obvious one to take — an encoder-decoder export ships both halves and needs both, and a quantised set is a choice about quality rather than a default. Name the file to fetch. Guessing would download half a model that fails at load with something obscure.",
|
|
2366
|
+
source: "daemon",
|
|
2367
|
+
severity: "degraded",
|
|
2368
|
+
expected: true,
|
|
2369
|
+
},
|
|
2370
|
+
MODEL_NO_RUNTIME: {
|
|
2371
|
+
code: "AX-MODEL-030",
|
|
2372
|
+
title: "No Runtime Can Execute This Model",
|
|
2373
|
+
description: "The weight is on this machine and no adapter claims it. Runtimes are registered per format — ONNX, llama.cpp — and a file none of them recognises can be fetched and cached but not loaded. Either the format needs an adapter, or the file is not the model it appears to be.",
|
|
2374
|
+
source: "daemon",
|
|
2375
|
+
severity: "fatal",
|
|
2376
|
+
expected: true,
|
|
2377
|
+
},
|
|
2378
|
+
DAEMON_NOT_RUNNING: {
|
|
2379
|
+
code: "AX-DAEMON-001",
|
|
2380
|
+
title: "The Axon Daemon Is Not Running",
|
|
2381
|
+
description: "Something asked axond for machine-wide state — what is loaded on the GPU, which agents are running — and no daemon is listening. Start it with `axon daemon up`. Local work that does not need shared state is unaffected.",
|
|
2382
|
+
source: "daemon",
|
|
2383
|
+
severity: "degraded",
|
|
2384
|
+
expected: true,
|
|
2385
|
+
},
|
|
2386
|
+
DAEMON_ALREADY_RUNNING: {
|
|
2387
|
+
code: "AX-DAEMON-002",
|
|
2388
|
+
title: "A Daemon Is Already Running",
|
|
2389
|
+
description: "A second axond was asked to start while one is already listening on this socket. One daemon per user per machine is the whole point — two would each believe they owned the GPU. Nothing was started; the existing one is untouched.",
|
|
2390
|
+
source: "daemon",
|
|
2391
|
+
severity: "degraded",
|
|
2392
|
+
expected: true,
|
|
2393
|
+
},
|
|
2394
|
+
DAEMON_SOCKET_UNAVAILABLE: {
|
|
2395
|
+
code: "AX-DAEMON-003",
|
|
2396
|
+
title: "Could Not Bind the Daemon Socket",
|
|
2397
|
+
description: "axond could not listen on its unix socket. Usually a stale socket file left by a process killed with -9, which the daemon removes on start; if it persists, the path may be unwritable or on a filesystem that does not support unix sockets.",
|
|
2398
|
+
source: "daemon",
|
|
2399
|
+
severity: "fatal",
|
|
2400
|
+
},
|
|
2401
|
+
DAEMON_START_FAILED: {
|
|
2402
|
+
code: "AX-DAEMON-004",
|
|
2403
|
+
title: "The Daemon Failed to Start",
|
|
2404
|
+
description: "axond was spawned but never reported itself ready. Its output is in the daemon log named by the detail; the usual causes are a port or socket conflict and a broken profile config.",
|
|
2405
|
+
source: "daemon",
|
|
2406
|
+
severity: "fatal",
|
|
2407
|
+
},
|
|
2408
|
+
DAEMON_NOT_WIRED: {
|
|
2409
|
+
code: "AX-DAEMON-005",
|
|
2410
|
+
title: "That Part of the Daemon Is Not Built Yet",
|
|
2411
|
+
description: "A domain the daemon declares exists but is not implemented. It throws rather than answering, because a stub returning an empty list is indistinguishable from a real answer and gets built on top of.",
|
|
2412
|
+
source: "daemon",
|
|
2413
|
+
severity: "degraded",
|
|
2414
|
+
expected: true,
|
|
2415
|
+
},
|
|
2416
|
+
EXTENSION_LOAD_TIMEOUT: {
|
|
2417
|
+
code: "AX-EXT-034",
|
|
2418
|
+
title: "Extension Took Too Long to Load",
|
|
2419
|
+
description: "A config file did not finish evaluating within the load budget — usually a blocking loop or a synchronous wait at module scope. Loading continued without it, so its commands, keys and palettes are missing; everything else in your config still loaded. The file itself keeps running until it finishes, because there is no safe way to interrupt code mid-execution.",
|
|
2420
|
+
source: "tui",
|
|
2421
|
+
severity: "degraded",
|
|
2422
|
+
expected: true,
|
|
2423
|
+
},
|
|
2204
2424
|
PLUGIN_FAILED: {
|
|
2205
2425
|
code: "AX-EXT-009",
|
|
2206
2426
|
title: "Plugin Failed to Load",
|