@oisin-ee/oisinpi 0.9.1 → 0.9.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @oisin-ee/oisinpi
2
2
 
3
+ ## 0.9.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`6f6e309`](https://github.com/oisin-ee/oisinpi/commit/6f6e3092eaec85e4f47c52ec652db359d7ddd78f)]:
8
+ - @oisin-ee/pi-tiers@0.9.3
9
+ - @oisin-ee/pi-guardrails@0.9.3
10
+ - @oisin-ee/pi-prewalk@0.9.3
11
+ - @oisin-ee/pi-todo@0.9.3
12
+
13
+ ## 0.9.2
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [[`3e750ac`](https://github.com/oisin-ee/oisinpi/commit/3e750ace481cfcf55296da1df034473d86d74347)]:
18
+ - @oisin-ee/pi-tiers@0.9.2
19
+ - @oisin-ee/pi-guardrails@0.9.2
20
+ - @oisin-ee/pi-prewalk@0.9.2
21
+ - @oisin-ee/pi-todo@0.9.2
22
+
3
23
  ## 0.9.1
4
24
 
5
25
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oisin-ee/pi-guardrails",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "Agent guardrails for pi, Claude Code, and Codex: Git safety, no waiting, no typing into other agents, GitOps-only clusters.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oisin-ee/pi-prewalk",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "A one-shot planner-to-executor handoff for pi, with branch-backed Rust rules.",
5
5
  "keywords": [
6
6
  "pi-extension",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oisin-ee/pi-tiers",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "Sticky virtual model tiers with quota-aware recovery for pi.",
5
5
  "keywords": [
6
6
  "pi-extension",
@@ -15,7 +15,9 @@ interface Target {
15
15
 
16
16
  const ZERO = 0,
17
17
  ONE = 1,
18
+ INTERNAL = 500,
18
19
  BAD_GATEWAY = 502,
20
+ GATEWAY_TIMEOUT = 504,
19
21
  UNAVAILABLE = 503,
20
22
  BAD_REQUEST = 400,
21
23
  UNAUTHORIZED = 401,
@@ -55,6 +57,17 @@ const ZERO = 0,
55
57
  ) {
56
58
  return "quota";
57
59
  }
60
+ // A provider-side failure of one target (HTTP 500/504, an empty upstream stream) is not
61
+ // It is not the request's fault, so the next target in the tier may succeed.
62
+ if (
63
+ status === INTERNAL ||
64
+ status === GATEWAY_TIMEOUT ||
65
+ /\b(?:status|code|HTTP)\s*:?\s*(?:500|504)\b|internal_server_error|server_error|empty_stream/iu.test(
66
+ message,
67
+ )
68
+ ) {
69
+ return "transient";
70
+ }
58
71
  return /overloaded|timeout|timed out|websocket.*1006|server_busy|retry after/iu.test(message)
59
72
  ? "transient"
60
73
  : "request";
@@ -77,7 +90,9 @@ const ZERO = 0,
77
90
  ["minimax-", "minimax"],
78
91
  ],
79
92
  pool =
80
- pools.find(([prefix]: readonly string[]) => id.startsWith(prefix ?? ""))?.[ONE] ?? provider;
93
+ pools.find(([prefix]: readonly string[]) => id.toLowerCase().startsWith(prefix ?? ""))?.[
94
+ ONE
95
+ ] ?? provider;
81
96
  return { id, pool, provider };
82
97
  };
83
98
 
@@ -12,19 +12,25 @@ const ZERO = 0,
12
12
  ONE = 1,
13
13
  CACHE_MS = 60_000,
14
14
  /**
15
- * Keeps only targets the model registry lists, so a provider model that is not
16
- * configured yet behaves like an unavailable target instead of a terminal error.
15
+ * Resolves tier targets to the references the model registry lists. Provider model
16
+ * ids differ in case from the tier file (`MiniMax-M3.1-Flash`), so matching ignores
17
+ * case and returns the registry's exact reference. A target that is not listed yet
18
+ * behaves like an unavailable target instead of a terminal error.
17
19
  * @param {readonly string[]} targets Ordered tier.
18
20
  * @param {Context} ctx Pi authority.
19
- * @returns {readonly string[]} Listed targets, in tier order.
21
+ * @returns {readonly string[]} Listed registry references, in tier order.
20
22
  */
21
23
  listed = (targets: readonly string[], ctx: Context): readonly string[] => {
22
- const available = new Set(
23
- ctx.modelRegistry.getAvailable().map((candidate) => `${candidate.provider}/${candidate.id}`),
24
+ const available = new Map(
25
+ ctx.modelRegistry.getAvailable().map((candidate) => {
26
+ const reference = `${candidate.provider}/${candidate.id}`;
27
+ return [reference.toLowerCase(), reference];
28
+ }),
24
29
  );
25
- return targets.filter((reference) => {
26
- const parsed = target(reference);
27
- return available.has(`${parsed.provider}/${parsed.id}`);
30
+ return targets.flatMap((reference) => {
31
+ const parsed = target(reference),
32
+ found = available.get(`${parsed.provider}/${parsed.id}`.toLowerCase());
33
+ return found === undefined ? [] : [found];
28
34
  });
29
35
  };
30
36
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oisin-ee/pi-todo",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "A todo tool for pi with a Rust core: one active task, state on the session branch.",
5
5
  "keywords": [
6
6
  "pi-extension",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oisin-ee/oisinpi",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "Oisin's pi packages in one install: prewalk, todo, tiers, and guardrails.",
5
5
  "keywords": [
6
6
  "guardrails",
@@ -17,10 +17,10 @@
17
17
  },
18
18
  "type": "module",
19
19
  "dependencies": {
20
- "@oisin-ee/pi-guardrails": "0.9.1",
21
- "@oisin-ee/pi-prewalk": "0.9.1",
22
- "@oisin-ee/pi-tiers": "0.9.1",
23
- "@oisin-ee/pi-todo": "0.9.1"
20
+ "@oisin-ee/pi-guardrails": "0.9.3",
21
+ "@oisin-ee/pi-prewalk": "0.9.3",
22
+ "@oisin-ee/pi-tiers": "0.9.3",
23
+ "@oisin-ee/pi-todo": "0.9.3"
24
24
  },
25
25
  "bundleDependencies": [
26
26
  "@oisin-ee/pi-guardrails",