@hachej/boring-agent 0.1.94 → 0.1.96
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/dist/DebugDrawer-2TO5SE2D.js +7 -0
- package/dist/{chunk-NITBKFG6.js → chunk-3OEDBRKY.js} +93 -58
- package/dist/{chunk-BOIV2I3N.js → chunk-46HJK2ES.js} +31 -16
- package/dist/{chunk-AQBXNPMD.js → chunk-4IQ4HHBG.js} +4 -0
- package/dist/{chunk-OFQ7J6SI.js → chunk-LSO2AO6Q.js} +57 -1
- package/dist/{chunk-N4AATPH7.js → chunk-NSE2RHU3.js} +8973 -7731
- package/dist/{chunk-2GBHYJVC.js → chunk-VXF5DWS6.js} +34 -0
- package/dist/{chunk-2TMS2RU2.js → chunk-WC5KBGP2.js} +518 -165
- package/dist/chunk-YGRQ4Q5P.js +20 -0
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +604 -7
- package/dist/{createHarness-UCD74XXK.js → createHarness-PW3A2MRB.js} +3 -3
- package/dist/{errors-G6T6S7PQ.d.ts → errors-cNC4HMpV.d.ts} +14 -7
- package/dist/eval/index.d.ts +5 -3
- package/dist/eval/index.js +31 -23
- package/dist/file-search-QxnanNjO.d.ts +87 -0
- package/dist/front/index.d.ts +87 -17
- package/dist/front/index.js +1232 -690
- package/dist/front/styles.css +1228 -2167
- package/dist/{harness-Cc48o6uS.d.ts → harness-DS8jLKIx.d.ts} +4 -2
- package/dist/{lease-CusB-uLg.d.ts → lease-D8WC6pQl.d.ts} +10 -89
- package/dist/{middleware-CzW8n7B7.d.ts → middleware-Cq_cYHjJ.d.ts} +1 -1
- package/dist/piChatEvent-B3ehh9V0.d.ts +384 -0
- package/dist/{piChatSessionService-C0KbcGw9.d.ts → piChatSessionService-xnv8rcdh.d.ts} +1 -1
- package/dist/{sandbox-DAD8cWQR.d.ts → sandbox-KQiEdz4W.d.ts} +12 -1
- package/dist/server/agent-host/testing/compositionRouteProof.d.ts +8 -0
- package/dist/server/agent-host/testing/compositionRouteProof.js +78 -0
- package/dist/server/agent-host/testing/gatewayConformance.d.ts +6 -6
- package/dist/server/agent-host/testing/gatewayConformance.js +17 -9
- package/dist/server/index.d.ts +570 -370
- package/dist/server/index.js +69 -17
- package/dist/server/worker/index.d.ts +2 -2
- package/dist/server/worker/index.js +9 -9
- package/dist/shared/index.d.ts +212 -56
- package/dist/shared/index.js +43 -7
- package/dist/{types-C-Eroi__.d.ts → types-D_SD-7_l.d.ts} +304 -87
- package/docs/AGENT_GATEWAY_V0.md +6 -3
- package/docs/AGENT_PACKAGES.md +80 -0
- package/docs/ERROR_CODES.md +58 -0
- package/docs/README.md +1 -0
- package/docs/runtime.md +19 -2
- package/package.json +34 -29
- package/dist/DebugDrawer-RYEBQ6CO.js +0 -6
- package/dist/chunk-EOMY2HDT.js +0 -619
- package/dist/piChatEvent-BsMp3MSo.d.ts +0 -368
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as AgentGatewayEffect } from '../../../types-
|
|
3
|
-
import '../../../piChatEvent-
|
|
1
|
+
import { b as AgentGateway, c as AuthorizedAgentScope, d as AgentSessionRef, e as AgentSessionActivity } from '../../../errors-cNC4HMpV.js';
|
|
2
|
+
import { A as AgentGatewayEffect } from '../../../types-D_SD-7_l.js';
|
|
3
|
+
import '../../../piChatEvent-B3ehh9V0.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'fastify';
|
|
6
|
-
import '../../../harness-
|
|
6
|
+
import '../../../harness-DS8jLKIx.js';
|
|
7
7
|
import '@mariozechner/pi-coding-agent';
|
|
8
|
-
import '../../../
|
|
8
|
+
import '../../../file-search-QxnanNjO.js';
|
|
9
|
+
import '../../../sandbox-KQiEdz4W.js';
|
|
9
10
|
import '@hachej/boring-bash/agent';
|
|
10
11
|
import '@hachej/boring-sandbox/providers/node-workspace';
|
|
11
|
-
import '../../../piChatSessionService-C0KbcGw9.js';
|
|
12
12
|
|
|
13
13
|
/** G1 ships only the embedded bounded-replay contract. */
|
|
14
14
|
type GatewayReplayConformanceLevel = 'B';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import "../../../chunk-3OEDBRKY.js";
|
|
2
|
+
import "../../../chunk-4IQ4HHBG.js";
|
|
3
|
+
import "../../../chunk-WSQ5QNIY.js";
|
|
1
4
|
import {
|
|
2
5
|
AGENT_GATEWAY_ERROR_CODES,
|
|
3
6
|
AgentGatewayError,
|
|
4
7
|
AgentGatewayErrorCode
|
|
5
|
-
} from "../../../chunk-
|
|
6
|
-
import "../../../chunk-
|
|
7
|
-
import "../../../chunk-
|
|
8
|
-
import "../../../chunk-OFQ7J6SI.js";
|
|
9
|
-
import "../../../chunk-2GBHYJVC.js";
|
|
8
|
+
} from "../../../chunk-LSO2AO6Q.js";
|
|
9
|
+
import "../../../chunk-YGRQ4Q5P.js";
|
|
10
|
+
import "../../../chunk-VXF5DWS6.js";
|
|
10
11
|
|
|
11
12
|
// src/server/agent-host/testing/gatewayConformance.ts
|
|
12
13
|
import { describe, expect, it } from "vitest";
|
|
@@ -67,7 +68,9 @@ function gatewayConformance(options) {
|
|
|
67
68
|
"AGENT_SESSION_CURSOR_EXPIRED",
|
|
68
69
|
"AGENT_SESSION_CURSOR_INVALID",
|
|
69
70
|
"AGENT_REQUEST_CONFLICT",
|
|
71
|
+
"AGENT_REQUEST_IN_PROGRESS",
|
|
70
72
|
"AGENT_REQUEST_OUTCOME_UNKNOWN",
|
|
73
|
+
"AGENT_RUNTIME_RESTART_REQUIRED",
|
|
71
74
|
"AGENT_COMMAND_INVALID_STATE",
|
|
72
75
|
"AGENT_SESSION_RUNTIME_SCOPE_MISMATCH",
|
|
73
76
|
"AGENT_SHARED_ENVIRONMENT_UNAVAILABLE",
|
|
@@ -205,11 +208,11 @@ function gatewayConformance(options) {
|
|
|
205
208
|
requestId: "retryable"
|
|
206
209
|
}), "AGENT_GATEWAY_CLOSED");
|
|
207
210
|
await expect(fixture.gateway.listSessions({ scope })).resolves.toEqual({ sessions: [] });
|
|
208
|
-
await
|
|
211
|
+
await expectCode(fixture.gateway.createSession({
|
|
209
212
|
scope,
|
|
210
213
|
agentTypeId: "alpha",
|
|
211
214
|
requestId: "retryable"
|
|
212
|
-
})
|
|
215
|
+
}), "AGENT_REQUEST_IN_PROGRESS");
|
|
213
216
|
});
|
|
214
217
|
it("fails unknown agents and hidden cross-scope sessions with stable errors", async () => {
|
|
215
218
|
const fixture = await options.createFixture();
|
|
@@ -224,11 +227,16 @@ function gatewayConformance(options) {
|
|
|
224
227
|
const fixture = await options.createFixture();
|
|
225
228
|
const scopeA = fixture.issueScope({ workspaceScopeId: "workspace-a" });
|
|
226
229
|
const scopeB = fixture.issueScope({ workspaceScopeId: "workspace-b" });
|
|
227
|
-
const
|
|
230
|
+
const concurrent = await Promise.allSettled([
|
|
228
231
|
createSession(fixture, scopeA, "same-id"),
|
|
229
232
|
createSession(fixture, scopeA, "same-id")
|
|
230
233
|
]);
|
|
231
|
-
|
|
234
|
+
const fulfilled = concurrent.filter((result) => result.status === "fulfilled");
|
|
235
|
+
const first = fulfilled[0]?.value;
|
|
236
|
+
expect(first).toBeDefined();
|
|
237
|
+
expect(fulfilled.every((result) => JSON.stringify(result.value) === JSON.stringify(first))).toBe(true);
|
|
238
|
+
const rejected = concurrent.find((result) => result.status === "rejected");
|
|
239
|
+
if (rejected) expect(rejected).toMatchObject({ reason: { code: AgentGatewayErrorCode.AGENT_REQUEST_IN_PROGRESS } });
|
|
232
240
|
expect(await createSession(fixture, scopeA, "same-id")).toEqual(first);
|
|
233
241
|
await expectCode(
|
|
234
242
|
fixture.gateway.createSession({ scope: scopeA, agentTypeId: "alpha", requestId: "same-id", title: "different" }),
|