@hachej/boring-agent 0.1.105 → 0.1.108
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/{chunk-K25PK5EC.js → chunk-3JFPS2O6.js} +1 -0
- package/dist/{chunk-JNEKOVMJ.js → chunk-6OANSUEI.js} +1 -1
- package/dist/{chunk-4IQ4HHBG.js → chunk-7XAOVFSN.js} +7 -0
- package/dist/{chunk-F2OJI2LX.js → chunk-GS4ADE34.js} +863 -358
- package/dist/{chunk-LFN45QDZ.js → chunk-KDXIXVF6.js} +5076 -3640
- package/dist/{chunk-6DRHERVK.js → chunk-MVKXLMH3.js} +44 -2
- package/dist/chunk-YTUZFKB3.js +78 -0
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +2 -2
- package/dist/{createHarness-GMBZZPTN.js → createHarness-AHWSC36D.js} +3 -3
- package/dist/{errors-DH7C01Pm.d.ts → errors-CEU4iujR.d.ts} +59 -4
- package/dist/{file-search-qcD5zItr.d.ts → file-search-BGUHnW9o.d.ts} +3 -3
- package/dist/front/index.d.ts +36 -7
- package/dist/front/index.js +1491 -727
- package/dist/front/styles.css +57 -0
- package/dist/{harness-Dcd08yKr.d.ts → harness-Ct0e4RWc.d.ts} +6 -3
- package/dist/{lease-DffrPrQn.d.ts → lease-nASWv2tU.d.ts} +1 -1
- package/dist/{piChatEvent-iNSXiFQq.d.ts → piChatEvent-BUWIzw5l.d.ts} +67 -36
- package/dist/{piChatSessionService-DQSQ_kWZ.d.ts → piChatSessionService-nvroRAVk.d.ts} +13 -11
- package/dist/server/agent-host/testing/gatewayConformance.d.ts +6 -5
- package/dist/server/agent-host/testing/gatewayConformance.js +57 -8
- package/dist/server/index.d.ts +167 -212
- package/dist/server/index.js +13 -9
- package/dist/server/worker/index.js +7 -7
- package/dist/shared/index.d.ts +34 -28
- package/dist/shared/index.js +8 -8
- package/dist/{types-BTsdaAQ2.d.ts → types-B7-PN5jV.d.ts} +47 -14
- package/docs/AGENT_GATEWAY_V0.md +40 -2
- package/docs/ERROR_CODES.md +1 -0
- package/docs/README.md +1 -0
- package/docs/SESSION_IDENTITY.md +91 -0
- package/docs/tools.md +4 -0
- package/package.json +11 -10
- package/dist/chunk-WSQ5QNIY.js +0 -18
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import "../../../chunk-
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import "../../../chunk-6OANSUEI.js";
|
|
2
|
+
import {
|
|
3
|
+
compareSessionOrder
|
|
4
|
+
} from "../../../chunk-7XAOVFSN.js";
|
|
5
|
+
import "../../../chunk-YTUZFKB3.js";
|
|
4
6
|
import {
|
|
5
7
|
AGENT_GATEWAY_ERROR_CODES,
|
|
6
8
|
AgentGatewayError,
|
|
7
9
|
AgentGatewayErrorCode
|
|
8
|
-
} from "../../../chunk-
|
|
10
|
+
} from "../../../chunk-MVKXLMH3.js";
|
|
9
11
|
import "../../../chunk-YGRQ4Q5P.js";
|
|
10
|
-
import "../../../chunk-
|
|
12
|
+
import "../../../chunk-3JFPS2O6.js";
|
|
11
13
|
|
|
12
14
|
// src/server/agent-host/testing/gatewayConformance.ts
|
|
13
15
|
import { describe, expect, it } from "vitest";
|
|
@@ -43,6 +45,7 @@ function gatewayConformance(options) {
|
|
|
43
45
|
await expectCode(fixture.gateway.connectSession({ scope: denied, ref }), "AGENT_SCOPE_DENIED");
|
|
44
46
|
await expectCode(fixture.gateway.readSessionState({ scope: denied, ref }), "AGENT_SCOPE_DENIED");
|
|
45
47
|
await expectCode(fixture.gateway.renameSession({ scope: denied, ref, requestId: `denied-rename-${index}`, title: "x" }), "AGENT_SCOPE_DENIED");
|
|
48
|
+
await expectCode(fixture.gateway.setSessionArchived({ scope: denied, ref, requestId: `denied-archive-${index}`, archived: true }), "AGENT_SCOPE_DENIED");
|
|
46
49
|
await expectCode(fixture.gateway.deleteSession({ scope: denied, ref, requestId: `denied-delete-${index}` }), "AGENT_SCOPE_DENIED");
|
|
47
50
|
}
|
|
48
51
|
});
|
|
@@ -63,6 +66,9 @@ function gatewayConformance(options) {
|
|
|
63
66
|
"AGENT_TYPE_UNKNOWN",
|
|
64
67
|
"AGENT_SESSION_NOT_FOUND",
|
|
65
68
|
"AGENT_SCOPE_DENIED",
|
|
69
|
+
"AGENT_ENTITLEMENT_REQUIRED",
|
|
70
|
+
"AGENT_ACCESS_FORBIDDEN",
|
|
71
|
+
"AGENT_ACCESS_POLICY_UNAVAILABLE",
|
|
66
72
|
"AGENT_SESSION_REPLAY_GAP",
|
|
67
73
|
"AGENT_SESSION_CURSOR_AHEAD",
|
|
68
74
|
"AGENT_SESSION_CURSOR_EXPIRED",
|
|
@@ -97,6 +103,14 @@ function gatewayConformance(options) {
|
|
|
97
103
|
expect((await fixture.gateway.readSessionState({ scope, ref })).summary.title).toBe(`${requestId}-session`);
|
|
98
104
|
}
|
|
99
105
|
},
|
|
106
|
+
{
|
|
107
|
+
effect: "session.archive",
|
|
108
|
+
run: async (fixture, scope, requestId) => {
|
|
109
|
+
const ref = await createSession(fixture, scope, `${requestId}-session`);
|
|
110
|
+
await expectCode(fixture.gateway.setSessionArchived({ scope, ref, requestId, archived: true }), "AGENT_SCOPE_DENIED");
|
|
111
|
+
expect((await fixture.gateway.listSessions({ scope, archived: "active" })).sessions).toContainEqual(expect.objectContaining({ ref }));
|
|
112
|
+
}
|
|
113
|
+
},
|
|
100
114
|
{
|
|
101
115
|
effect: "session.delete",
|
|
102
116
|
run: async (fixture, scope, requestId) => {
|
|
@@ -253,9 +267,42 @@ function gatewayConformance(options) {
|
|
|
253
267
|
"AGENT_REQUEST_CONFLICT"
|
|
254
268
|
);
|
|
255
269
|
await expect(fixture.gateway.renameSession({ scope: scopeA, ref: second, requestId: "shared-target-id", title: "two" })).resolves.toMatchObject({ title: "two" });
|
|
270
|
+
const archived = await fixture.gateway.setSessionArchived({
|
|
271
|
+
scope: scopeA,
|
|
272
|
+
ref: first,
|
|
273
|
+
requestId: "archive-id",
|
|
274
|
+
archived: true
|
|
275
|
+
});
|
|
276
|
+
expect(archived.archived).toBe(true);
|
|
277
|
+
await expect(fixture.gateway.setSessionArchived({
|
|
278
|
+
scope: scopeA,
|
|
279
|
+
ref: first,
|
|
280
|
+
requestId: "archive-id",
|
|
281
|
+
archived: true
|
|
282
|
+
})).resolves.toEqual(archived);
|
|
283
|
+
await expectCode(fixture.gateway.setSessionArchived({
|
|
284
|
+
scope: scopeA,
|
|
285
|
+
ref: first,
|
|
286
|
+
requestId: "archive-id",
|
|
287
|
+
archived: false
|
|
288
|
+
}), "AGENT_REQUEST_CONFLICT");
|
|
256
289
|
await fixture.gateway.deleteSession({ scope: scopeA, ref: second, requestId: "delete-id" });
|
|
257
290
|
await expect(fixture.gateway.deleteSession({ scope: scopeA, ref: second, requestId: "delete-id" })).resolves.toBeUndefined();
|
|
258
291
|
});
|
|
292
|
+
it("replays a completed archive receipt after the session is deleted", async () => {
|
|
293
|
+
const fixture = await options.createFixture();
|
|
294
|
+
const scope = fixture.issueScope();
|
|
295
|
+
const ref = await createSession(fixture, scope, "archive-then-delete");
|
|
296
|
+
const archiveRequest = {
|
|
297
|
+
scope,
|
|
298
|
+
ref,
|
|
299
|
+
requestId: "archive-before-delete",
|
|
300
|
+
archived: true
|
|
301
|
+
};
|
|
302
|
+
const archived = await fixture.gateway.setSessionArchived(archiveRequest);
|
|
303
|
+
await fixture.gateway.deleteSession({ scope, ref, requestId: "delete-after-archive" });
|
|
304
|
+
await expect(fixture.gateway.setSessionArchived(archiveRequest)).resolves.toEqual(archived);
|
|
305
|
+
});
|
|
259
306
|
it("enforces command states, queue controls, typed receipts, and command idempotency", async () => {
|
|
260
307
|
const fixture = await options.createFixture();
|
|
261
308
|
const scope = fixture.issueScope();
|
|
@@ -492,10 +539,12 @@ function gatewayConformance(options) {
|
|
|
492
539
|
await expectCode(fixture.gateway.listSessions({ scope: scopeB, cursor, limit: 1 }), "AGENT_SESSION_CURSOR_INVALID");
|
|
493
540
|
await expectCode(fixture.gateway.listSessions({ scope: scopeA, cursor, limit: 2 }), "AGENT_SESSION_CURSOR_INVALID");
|
|
494
541
|
await expectCode(fixture.gateway.listSessions({ scope: scopeA, cursor, agentTypeId: "alpha", limit: 1 }), "AGENT_SESSION_CURSOR_INVALID");
|
|
542
|
+
await expectCode(fixture.gateway.listSessions({ scope: scopeA, cursor, archived: "active", limit: 1 }), "AGENT_SESSION_CURSOR_INVALID");
|
|
495
543
|
const all = await fixture.gateway.listSessions({ scope: scopeA, limit: 20 });
|
|
496
|
-
expect(all.sessions).toEqual([...all.sessions].sort(
|
|
497
|
-
|
|
498
|
-
|
|
544
|
+
expect(all.sessions).toEqual([...all.sessions].sort((left, right) => compareSessionOrder(
|
|
545
|
+
[left.updatedAt, left.ref.agentTypeId, left.ref.sessionId],
|
|
546
|
+
[right.updatedAt, right.ref.agentTypeId, right.ref.sessionId]
|
|
547
|
+
)));
|
|
499
548
|
expect(all.sessions.map((session) => session.ref)).toEqual([alphaA, alphaC, beta]);
|
|
500
549
|
});
|
|
501
550
|
it("documents keyset mutation behavior: moved rows may shift and deleted rows disappear", async () => {
|