pi-harness-runtime 1.1.382 → 1.1.384

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 (156) hide show
  1. package/harness/job-state-machine.ts +97 -10
  2. package/harness/langchain/surge.test.ts +57 -25
  3. package/index.ts +124 -4
  4. package/package.json +8 -4
  5. package/packages/a2a-adapter/package.json +1 -1
  6. package/packages/agent-policy/package.json +1 -1
  7. package/packages/architecture-generator/package.json +1 -1
  8. package/packages/auth/dist/minimax-browser-auth.d.ts +1 -0
  9. package/packages/auth/dist/minimax-browser-auth.d.ts.map +1 -1
  10. package/packages/auth/dist/minimax-browser-auth.js +2 -2
  11. package/packages/auth/dist/minimax-browser-auth.js.map +1 -1
  12. package/packages/auth/package.json +1 -1
  13. package/packages/auth/src/minimax-browser-auth.ts +15 -3
  14. package/packages/autonomous-refactor/package.json +1 -1
  15. package/packages/autonomous-runtime/package.json +1 -1
  16. package/packages/cache-strategy/package.json +1 -1
  17. package/packages/capability-registry/package.json +1 -1
  18. package/packages/checkpoint/dist/checkpoint-manager.d.ts.map +1 -1
  19. package/packages/checkpoint/dist/checkpoint-manager.js +3 -0
  20. package/packages/checkpoint/dist/checkpoint-manager.js.map +1 -1
  21. package/packages/checkpoint/package.json +1 -1
  22. package/packages/checkpoint/src/checkpoint-manager.ts +8 -1
  23. package/packages/cli-plugin-sdk/package.json +1 -1
  24. package/packages/clipboard/package.json +1 -1
  25. package/packages/clipboard-plugin/package.json +1 -1
  26. package/packages/code-generation/package.json +1 -1
  27. package/packages/code-review/package.json +1 -1
  28. package/packages/codex-adapter/package.json +1 -1
  29. package/packages/codex-watcher/package.json +1 -1
  30. package/packages/config-capture/package.json +1 -1
  31. package/packages/connection-runtime/package.json +1 -1
  32. package/packages/context-compiler/package.json +1 -1
  33. package/packages/context-discovery/package.json +1 -1
  34. package/packages/context-manager/package.json +1 -1
  35. package/packages/contracts/package.json +1 -1
  36. package/packages/cookie-sanitizer/package.json +1 -1
  37. package/packages/cost-optimizer/package.json +1 -1
  38. package/packages/dependency-analyzer/package.json +1 -1
  39. package/packages/django-plugin/package.json +1 -1
  40. package/packages/doc-generator/package.json +1 -1
  41. package/packages/durable-review/package.json +1 -1
  42. package/packages/e2e-tester/package.json +1 -1
  43. package/packages/evaluation-engine/package.json +1 -1
  44. package/packages/evaluation-runner/package.json +1 -1
  45. package/packages/event-bus/package.json +1 -1
  46. package/packages/event-sink/package.json +1 -1
  47. package/packages/event-store/package.json +1 -1
  48. package/packages/experience-replay/package.json +1 -1
  49. package/packages/feedback-collector/package.json +1 -1
  50. package/packages/file-copy-helper/package.json +1 -1
  51. package/packages/framework-detector/package.json +1 -1
  52. package/packages/framework-plugin-sdk/package.json +1 -1
  53. package/packages/frappe-plugin/package.json +1 -1
  54. package/packages/generic-web-plugin/package.json +1 -1
  55. package/packages/health-monitor/package.json +1 -1
  56. package/packages/intent-analyzer/package.json +1 -1
  57. package/packages/jev-judge/dist/continuation-controller.d.ts +174 -9
  58. package/packages/jev-judge/dist/continuation-controller.d.ts.map +1 -1
  59. package/packages/jev-judge/dist/continuation-controller.js +530 -77
  60. package/packages/jev-judge/dist/continuation-controller.js.map +1 -1
  61. package/packages/jev-judge/dist/typesafe-provider.d.ts.map +1 -1
  62. package/packages/jev-judge/dist/typesafe-provider.js +29 -2
  63. package/packages/jev-judge/dist/typesafe-provider.js.map +1 -1
  64. package/packages/jev-judge/package.json +1 -1
  65. package/packages/jev-judge/src/continuation-controller.ts +636 -83
  66. package/packages/jev-judge/src/typesafe-provider.ts +31 -2
  67. package/packages/jev-judge/tests/continuation-controller.test.ts +1229 -0
  68. package/packages/jev-judge/tests/typesafe-provider.test.ts +180 -0
  69. package/packages/knowledge-graph/package.json +1 -1
  70. package/packages/knowledge-retrieval/package.json +1 -1
  71. package/packages/laravel-plugin/package.json +1 -1
  72. package/packages/learning-engine/package.json +1 -1
  73. package/packages/mcp-adapter/package.json +1 -1
  74. package/packages/memory-engine/package.json +1 -1
  75. package/packages/milestone-manager/package.json +1 -1
  76. package/packages/model-registry/package.json +1 -1
  77. package/packages/nextjs-plugin/package.json +1 -1
  78. package/packages/notification/package.json +1 -1
  79. package/packages/observability/package.json +1 -1
  80. package/packages/okf-indexer/package.json +1 -1
  81. package/packages/paperclip-integration/package.json +1 -1
  82. package/packages/performance-optimizer/package.json +1 -1
  83. package/packages/permission-mode/package.json +1 -1
  84. package/packages/privilege-broker/package.json +1 -1
  85. package/packages/project-analyzer/package.json +1 -1
  86. package/packages/project-bootstrap/package.json +1 -1
  87. package/packages/projection-engine/package.json +1 -1
  88. package/packages/prompt-compiler/package.json +1 -1
  89. package/packages/prompt-versioning/package.json +1 -1
  90. package/packages/provider-adapter-sdk/package.json +1 -1
  91. package/packages/provider-router/package.json +1 -1
  92. package/packages/provider-selector/package.json +1 -1
  93. package/packages/providers/package.json +1 -1
  94. package/packages/qdrant-skills/package.json +1 -1
  95. package/packages/quota-manager/package.json +1 -1
  96. package/packages/rate-limiter/package.json +1 -1
  97. package/packages/react-vite-plugin/package.json +1 -1
  98. package/packages/relay/dist/client.d.ts +36 -1
  99. package/packages/relay/dist/client.js +195 -25
  100. package/packages/relay/dist/server.d.ts +5 -1
  101. package/packages/relay/dist/server.js +74 -7
  102. package/packages/relay/dist/types.d.ts +7 -0
  103. package/packages/relay/package.json +1 -1
  104. package/packages/relay/src/client.ts +206 -42
  105. package/packages/relay/src/server.ts +78 -10
  106. package/packages/relay/src/types.ts +7 -0
  107. package/packages/relay/test/client.test.ts +312 -0
  108. package/packages/relay/test/relay-e2e.test.ts +263 -0
  109. package/packages/release-manager/package.json +1 -1
  110. package/packages/requirement-compiler/package.json +1 -1
  111. package/packages/runtime/package.json +1 -1
  112. package/packages/scheduler/package.json +1 -1
  113. package/packages/scheduler-adapter/package.json +1 -1
  114. package/packages/session/package.json +1 -1
  115. package/packages/session-api/package.json +1 -1
  116. package/packages/session-export/package.json +1 -1
  117. package/packages/shared-context/package.json +1 -1
  118. package/packages/skill-mcp-client/package.json +1 -1
  119. package/packages/skill-registry/package.json +1 -1
  120. package/packages/skills/package.json +1 -1
  121. package/packages/sprint-planner/package.json +1 -1
  122. package/packages/subscription-engine/package.json +1 -1
  123. package/packages/task-compiler/package.json +1 -1
  124. package/packages/telegram/package.json +1 -1
  125. package/packages/tencentdb-memory/package.json +1 -1
  126. package/packages/tencentdb-sync/package.json +1 -1
  127. package/packages/test-data-generator/package.json +1 -1
  128. package/packages/test-generator/package.json +1 -1
  129. package/packages/todo-bd-sync/package.json +1 -1
  130. package/packages/token-estimation/package.json +1 -1
  131. package/packages/token-optimizer/package.json +1 -1
  132. package/packages/trajectory/package.json +1 -1
  133. package/packages/tui/dist/harness-footer.d.ts +131 -0
  134. package/packages/tui/dist/harness-footer.d.ts.map +1 -0
  135. package/packages/tui/dist/harness-footer.js +463 -0
  136. package/packages/tui/dist/harness-footer.js.map +1 -0
  137. package/packages/tui/dist/index.d.ts +1 -0
  138. package/packages/tui/dist/index.d.ts.map +1 -1
  139. package/packages/tui/dist/index.js +1 -0
  140. package/packages/tui/dist/index.js.map +1 -1
  141. package/packages/tui/package.json +1 -1
  142. package/packages/tui/src/harness-footer.ts +580 -0
  143. package/packages/tui/src/index.ts +17 -0
  144. package/packages/tui/test/harness-footer.test.ts +440 -0
  145. package/packages/types/package.json +1 -1
  146. package/packages/voice-api/package.json +1 -1
  147. package/packages/webmcp-tester/package.json +1 -1
  148. package/packages/wiki/package.json +1 -1
  149. package/packages/workflow-events/package.json +1 -1
  150. package/packages/workspace-scanner/package.json +1 -1
  151. package/packages/worktree/package.json +1 -1
  152. package/packages/write-review/package.json +1 -1
  153. package/scripts/run-e2e-scripts.mjs +74 -0
  154. package/scripts/run-langchain-tests.mjs +169 -0
  155. package/scripts/typecheck-packages.mjs +167 -0
  156. package/scripts/unified-webhook-server.ts +70 -13
@@ -0,0 +1,180 @@
1
+ /**
2
+ * Unit tests for the TypeSafe Jev provider.
3
+ *
4
+ * The TypeSafe API is stubbed at the `fetch` boundary, so no network calls and
5
+ * no credentials are involved.
6
+ *
7
+ * Regression coverage: `buildDecision()` used to evaluate the choice answer as
8
+ *
9
+ * answer.choice ?? question.type === "choice" ? options[0] : ""
10
+ *
11
+ * which JS parses as `(answer.choice ?? (question.type === "choice")) ? options[0] : ""`.
12
+ * A non-empty choice returned by the model was therefore discarded and the
13
+ * FIRST option was always selected.
14
+ *
15
+ * Run with: bun test packages/jev-judge/tests/typesafe-provider.test.ts
16
+ */
17
+
18
+ import { afterEach, describe, expect, it } from "bun:test";
19
+ import { TypeSafeJudge } from "../src/typesafe-provider.js";
20
+ import type { JevChoiceResponse, JevNoulResponse, JevScoreResponse } from "../src/types.js";
21
+
22
+ const originalFetch = globalThis.fetch;
23
+
24
+ interface StubAnswer {
25
+ type: "noul" | "choice" | "score";
26
+ noul?: number;
27
+ choice?: string;
28
+ score?: number;
29
+ confidence?: number;
30
+ }
31
+
32
+ function stubTypeSafe(answers: Record<string, StubAnswer>): void {
33
+ globalThis.fetch = (async () => ({
34
+ ok: true,
35
+ status: 200,
36
+ json: async () => ({ answers, model: "test-model", latency_ms: 1 }),
37
+ text: async () => JSON.stringify({ answers }),
38
+ })) as unknown as typeof fetch;
39
+ }
40
+
41
+ function makeJudge(): TypeSafeJudge {
42
+ return new TypeSafeJudge({
43
+ apiKey: "test-key",
44
+ baseUrl: "https://typesafe.invalid",
45
+ model: "test-model",
46
+ });
47
+ }
48
+
49
+ afterEach(() => {
50
+ globalThis.fetch = originalFetch;
51
+ });
52
+
53
+ describe("TypeSafeJudge - choice answers", () => {
54
+ it("uses the choice returned by the model", async () => {
55
+ stubTypeSafe({
56
+ answer: { type: "choice", choice: "gamma", confidence: 0.8 },
57
+ });
58
+
59
+ const result = await makeJudge().evaluate("state", {
60
+ answer: {
61
+ type: "choice",
62
+ instructions: "Pick one",
63
+ options: ["alpha", "beta", "gamma"],
64
+ },
65
+ });
66
+
67
+ const response = result.decisions.answer.response as JevChoiceResponse;
68
+ expect(response.choice).toBe("gamma");
69
+ expect(response.confidence).toBe(0.8);
70
+ });
71
+
72
+ it("uses the choice returned by the model through the choice() helper", async () => {
73
+ stubTypeSafe({
74
+ answer: { type: "choice", choice: "beta", confidence: 0.6 },
75
+ });
76
+
77
+ const result = await makeJudge().choice("state", "Pick one", [
78
+ "alpha",
79
+ "beta",
80
+ ]);
81
+
82
+ expect(result.choice).toBe("beta");
83
+ expect(result.confidence).toBe(0.6);
84
+ });
85
+
86
+ it("falls back to the first option when the model returns no choice", async () => {
87
+ stubTypeSafe({ answer: { type: "choice", confidence: 0.5 } });
88
+
89
+ const result = await makeJudge().evaluate("state", {
90
+ answer: {
91
+ type: "choice",
92
+ instructions: "Pick one",
93
+ options: ["alpha", "beta"],
94
+ },
95
+ });
96
+
97
+ const response = result.decisions.answer.response as JevChoiceResponse;
98
+ expect(response.choice).toBe("alpha");
99
+ });
100
+
101
+ it("treats an empty choice as no choice", async () => {
102
+ stubTypeSafe({ answer: { type: "choice", choice: " ", confidence: 0.5 } });
103
+
104
+ const result = await makeJudge().evaluate("state", {
105
+ answer: {
106
+ type: "choice",
107
+ instructions: "Pick one",
108
+ options: ["alpha", "beta"],
109
+ },
110
+ });
111
+
112
+ const response = result.decisions.answer.response as JevChoiceResponse;
113
+ expect(response.choice).toBe("alpha");
114
+ });
115
+
116
+ it("normalizes a case-insensitive match to the canonical option", async () => {
117
+ stubTypeSafe({
118
+ answer: { type: "choice", choice: "GAMMA", confidence: 0.7 },
119
+ });
120
+
121
+ const result = await makeJudge().evaluate("state", {
122
+ answer: {
123
+ type: "choice",
124
+ instructions: "Pick one",
125
+ options: ["alpha", "beta", "gamma"],
126
+ },
127
+ });
128
+
129
+ const response = result.decisions.answer.response as JevChoiceResponse;
130
+ expect(response.choice).toBe("gamma");
131
+ });
132
+
133
+ it("passes a choice that is not in the options through unchanged", async () => {
134
+ stubTypeSafe({
135
+ answer: { type: "choice", choice: "delta", confidence: 0.4 },
136
+ });
137
+
138
+ const result = await makeJudge().evaluate("state", {
139
+ answer: {
140
+ type: "choice",
141
+ instructions: "Pick one",
142
+ options: ["alpha", "beta"],
143
+ },
144
+ });
145
+
146
+ const response = result.decisions.answer.response as JevChoiceResponse;
147
+ expect(response.choice).toBe("delta");
148
+ });
149
+ });
150
+
151
+ describe("TypeSafeJudge - noul and score answers", () => {
152
+ it("keeps noul answers intact", async () => {
153
+ stubTypeSafe({ answer: { type: "noul", noul: 0.75 } });
154
+
155
+ const result = await makeJudge().evaluate("state", {
156
+ answer: { type: "noul", instructions: "Is it true?" },
157
+ });
158
+
159
+ const response = result.decisions.answer.response as JevNoulResponse;
160
+ expect(response.noul).toBe(0.75);
161
+ expect(result.decisions.answer.probability).toBe(0.75);
162
+ });
163
+
164
+ it("normalizes score answers to a probability", async () => {
165
+ stubTypeSafe({ answer: { type: "score", score: 75, confidence: 0.75 } });
166
+
167
+ const result = await makeJudge().evaluate("state", {
168
+ answer: {
169
+ type: "score",
170
+ instructions: "How good?",
171
+ min: 0,
172
+ max: 100,
173
+ },
174
+ });
175
+
176
+ const response = result.decisions.answer.response as JevScoreResponse;
177
+ expect(response.score).toBe(75);
178
+ expect(result.decisions.answer.probability).toBe(0.75);
179
+ });
180
+ });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/knowledge-graph",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Knowledge Graph extraction and provenance linking for SKILL.md files",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/knowledge-retrieval",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Knowledge retrieval via TencentDB-Agent-Memory MCP (RFC-0105)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/laravel-plugin",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Laravel framework analysis — artisan commands, Eloquent models, Blade",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/learning-engine",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Learning engine for extracting lessons from runtime execution (RFC-0058)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/mcp-adapter",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "type": "module",
5
5
  "description": "MCP server adapter for pi-harness — exposes harness capabilities as MCP tools/resources/prompts (RFC-0068)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/memory-engine",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Memory engine with OKF integration for durable knowledge management (RFC-0060)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/milestone-manager",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Track milestones and alerts when items are at risk",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/model-registry",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Model Registry for pi-harness-runtime — centralized model metadata with pricing",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/nextjs-plugin",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Next.js framework detection and analysis for pi-harness-runtime (RFC-0062)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/notification",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "pi-harness-runtime — notification",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/observability",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Comprehensive observability system with structured logging, tracing, metrics, and alerting",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/okf-indexer",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "OKF document indexer for SKILL.md files (RFC-0106)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/paperclip-integration",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Paperclip API integration: poll agent inbox, route tasks to pi.dev, Telegram alerts",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/performance-optimizer",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Performance optimization analyzer for pi-harness runtime (RFC-0056)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/permission-mode",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "type": "module",
5
5
  "description": "Runtime permission modes for pi-harness - Supervised/Auto/Full-access",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/privilege-broker",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Privilege Broker — capability registry and command executor for autonomous runtime (RFC-0101 §7)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/project-analyzer",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Project analysis system for pi-harness-runtime - detects frameworks, rules, and project structure",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/project-bootstrap",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Project scaffolding from typed ProjectSpec",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/projection-engine",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/prompt-compiler",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Deterministic prompt compiler for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/prompt-versioning",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "type": "module",
5
5
  "description": "Version control for prompts with rollback support (RFC-0019)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/provider-adapter-sdk",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "SDK for building, testing, and registering AI provider adapters",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/provider-router",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Enhanced Provider Router for pi-harness-runtime — intelligent routing with capabilities, costs, and quotas",
5
5
  "type": "module",
6
6
  "main": "./dist/provider-router.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/provider-selector",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Multi-Provider Selector — route requests by cost, quality, and latency (RFC-0012)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/providers",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "pi-harness-runtime — providers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/qdrant-skills",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "Qdrant vector search integration for Hermes-style skill system",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/quota-manager",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "pi-harness-runtime — quota-manager",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/rate-limiter",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "type": "module",
5
5
  "description": "Rate limiting with token bucket algorithm (RFC-0023)",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/react-vite-plugin",
3
- "version": "1.1.382",
3
+ "version": "1.1.384",
4
4
  "description": "React/Vite framework analysis — components, config, TypeScript setup",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -37,6 +37,11 @@ export declare class RelayClient {
37
37
  private reconnectDelay;
38
38
  private reconnectTimer;
39
39
  private connectTimeoutTimer;
40
+ private pendingConnect;
41
+ private connectPromise;
42
+ private connectAttempt;
43
+ private connectPromiseAttempt;
44
+ private shuttingDown;
40
45
  private heartbeatTimer;
41
46
  private snapshotReceived;
42
47
  private synchronizedReceived;
@@ -44,9 +49,24 @@ export declare class RelayClient {
44
49
  private setState;
45
50
  private isConnected;
46
51
  /**
47
- * Connect to relay server with automatic authentication
52
+ * Connect to relay server with automatic authentication.
53
+ *
54
+ * The returned Promise settles exactly once:
55
+ * - resolves when the server confirms authentication (the readiness milestone)
56
+ * - rejects on websocket error, authentication failure, close-before-ready,
57
+ * an explicit disconnect(), or the connect deadline
48
58
  */
49
59
  connect(): Promise<void>;
60
+ /**
61
+ * Open the socket and drive the connect/auth handshake.
62
+ * The promise settles via settleConnect() from the handshake handlers.
63
+ */
64
+ private startConnect;
65
+ /**
66
+ * Settle the pending connect() promise exactly once.
67
+ * Passing an error rejects; calling without an error resolves.
68
+ */
69
+ private settleConnect;
50
70
  /**
51
71
  * Disconnect from relay server
52
72
  */
@@ -64,12 +84,27 @@ export declare class RelayClient {
64
84
  private handleCallback;
65
85
  private handleStatus;
66
86
  private handleDisconnect;
87
+ /**
88
+ * Schedule a reconnect after a FAILED connect attempt.
89
+ *
90
+ * The backoff loop only survives the loss of an established connection, so a
91
+ * refused server or a failed handshake would otherwise leave the client
92
+ * permanently disconnected. Opt-in via `config.retryOnConnectFailure`:
93
+ * an endless background retry loop is not always what the caller wants.
94
+ */
95
+ private scheduleReconnectAfterFailure;
67
96
  private scheduleReconnect;
68
97
  private startHeartbeat;
69
98
  private stopHeartbeat;
70
99
  private cleanup;
100
+ /**
101
+ * Close the active socket without firing our own close/error handlers.
102
+ */
103
+ private closeSocket;
71
104
  getState(): ConnectionState;
72
105
  isReady(): boolean;
106
+ /** True once the server has sent the callback snapshot for this session. */
107
+ hasSnapshot(): boolean;
73
108
  getSessionId(): string | null;
74
109
  getClientId(): string | null;
75
110
  }