@arcforge/err 2.0.149 → 2.0.151

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/map.ts +100 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcforge/err",
3
- "version": "2.0.149",
3
+ "version": "2.0.151",
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,7 +15,7 @@
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.149"
18
+ "@arcforge/types": "2.0.151"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/bun": "latest",
package/src/map.ts CHANGED
@@ -838,6 +838,84 @@ export const errorMap = {
838
838
  source: "kernel",
839
839
  severity: "fatal",
840
840
  },
841
+ /**
842
+ * ── Engine failures the USER can act on ─────────────────────────────────
843
+ *
844
+ * Every one of these was previously a single `ENGINE_STREAM_FAILED`, which
845
+ * put an internal code and a stack trace in front of someone whose real
846
+ * problem was an expired key or a spent subscription. The drivers already
847
+ * classify the fault precisely (AxonEngineFaultCode) and already write a
848
+ * provider-specific sentence about it — that work was being thrown away one
849
+ * layer up.
850
+ *
851
+ * These are `expected: true`, so they render as headline + description with
852
+ * no frames: the user did not write the code that failed, and eighty lines
853
+ * of our stack tells them to debug software they do not own. The driver's
854
+ * own message rides in as `detail` and is the most specific thing on
855
+ * screen ("Codex: usage limit reached. Check your ChatGPT subscription.").
856
+ *
857
+ * The split is one question: CAN THE USER FIX IT? If yes it belongs here.
858
+ * If the model or the driver misbehaved, it stays ENGINE_STREAM_FAILED and
859
+ * keeps the full report, because that one is ours to debug.
860
+ */
861
+ ENGINE_NOT_CONNECTED: {
862
+ code: "AX-KERNEL-015",
863
+ title: "Provider Not Connected",
864
+ description: "This model's route is not connected to your account yet — run `:provider <name> connect` for the provider named below, or pick a model on a route you are already signed in to.",
865
+ source: "kernel",
866
+ severity: "fatal",
867
+ expected: true,
868
+ },
869
+ ENGINE_AUTH_FAILED: {
870
+ code: "AX-KERNEL-016",
871
+ title: "Provider Rejected Your Credentials",
872
+ description: "The provider refused the credential this agent is using — it has expired, been revoked, or is for a different account. Reconnect the provider, or pick a model on a route you are signed in to.",
873
+ source: "kernel",
874
+ severity: "fatal",
875
+ expected: true,
876
+ },
877
+ ENGINE_RATE_LIMITED: {
878
+ code: "AX-KERNEL-017",
879
+ title: "Provider Rate Limit Reached",
880
+ description: "The provider is refusing further calls right now — either too many requests in a short window, or a subscription whose allowance is spent. Waiting usually clears the first; the second needs a plan change or a different model.",
881
+ source: "kernel",
882
+ severity: "fatal",
883
+ expected: true,
884
+ },
885
+ ENGINE_QUOTA_EXHAUSTED: {
886
+ code: "AX-KERNEL-018",
887
+ title: "Provider Credits Exhausted",
888
+ description: "This route has no credit left to spend. Top it up, or switch to a model on a route that does — the conversation is intact either way.",
889
+ source: "kernel",
890
+ severity: "fatal",
891
+ expected: true,
892
+ },
893
+ ENGINE_REQUEST_REJECTED: {
894
+ code: "AX-KERNEL-019",
895
+ title: "Provider Rejected The Request",
896
+ description: "The provider refused this call as malformed or unsupported — commonly a model id it does not serve, a context window this conversation has outgrown, or a parameter that route does not accept.",
897
+ source: "kernel",
898
+ severity: "fatal",
899
+ expected: true,
900
+ },
901
+ ENGINE_UNREACHABLE: {
902
+ code: "AX-KERNEL-020",
903
+ title: "Could Not Reach The Provider",
904
+ description: "The provider could not be reached, or kept failing, across every retry — usually a network problem on this machine or an outage on their side. Nothing about this agent needs changing; try again.",
905
+ source: "kernel",
906
+ severity: "fatal",
907
+ expected: true,
908
+ },
909
+
910
+ /**
911
+ * The engine failure that is OURS.
912
+ *
913
+ * Deliberately NOT `expected`: what is left here after the classified
914
+ * failures above is a model that returned nothing, a driver that broke the
915
+ * wire protocol, or a fault nothing recognised. The user cannot act on any
916
+ * of those, and the full report — frames, snippets, cause chain — is what
917
+ * makes it debuggable from a pasted log.
918
+ */
841
919
  ENGINE_STREAM_FAILED: {
842
920
  code: "AX-KERNEL-008",
843
921
  title: "Engine Stream Failed",
@@ -845,6 +923,20 @@ export const errorMap = {
845
923
  source: "kernel",
846
924
  severity: "fatal",
847
925
  },
926
+ /**
927
+ * RETIRED — superseded by ENGINE_NOT_CONNECTED (AX-KERNEL-015).
928
+ *
929
+ * This was the one hand-written special case in the kernel's failure path:
930
+ * `AUTH_NOT_CONNECTED` AND `provider === "codex"`. Every other provider hit
931
+ * the generic internal error for the identical condition, and each new
932
+ * route would have needed its own branch and its own code.
933
+ *
934
+ * ENGINE_NOT_CONNECTED says the same thing for any provider, with the
935
+ * driver's own message naming which one. Kept as a definition rather than
936
+ * deleted so AX-KERNEL-012 is never handed to a different failure — a code
937
+ * that appears in an old session log, a support thread or a screenshot must
938
+ * keep meaning what it meant when it was written.
939
+ */
848
940
  CODEX_NOT_CONNECTED: {
849
941
  code: "AX-KERNEL-012",
850
942
  title: "Codex Subscription Not Connected",
@@ -1289,6 +1381,14 @@ export const errorMap = {
1289
1381
  severity: "fatal",
1290
1382
  expected: true,
1291
1383
  },
1384
+ MODEL_UNAVAILABLE: {
1385
+ code: "AX-TUI-051",
1386
+ title: "Model Not Available From Any Declared Provider",
1387
+ description: "The picked model was saved to the agent's config, but no provider this profile declares can supply it — so the running agent still uses its previous model. Connect the provider that serves it, or pick a model from the offered list.",
1388
+ source: "tui",
1389
+ severity: "fatal",
1390
+ expected: true,
1391
+ },
1292
1392
  MODEL_IMMUTABLE_DEPLOYED: {
1293
1393
  code: "AX-TUI-006",
1294
1394
  title: "Cannot Change A Deployment's Model",