@relkit/runtime-hono 0.7.2 → 0.7.4

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 (59) hide show
  1. package/dist/agent-observation-pages.d.ts +15 -0
  2. package/dist/agent-observation-pages.d.ts.map +1 -0
  3. package/dist/agent-observation-pages.js +69 -0
  4. package/dist/agent-observation-pages.js.map +1 -0
  5. package/dist/agent-observation.d.ts +18 -21
  6. package/dist/agent-observation.d.ts.map +1 -1
  7. package/dist/agent-observation.js +39 -73
  8. package/dist/agent-observation.js.map +1 -1
  9. package/dist/agent-observation.schemas.d.ts +16 -0
  10. package/dist/agent-observation.schemas.d.ts.map +1 -0
  11. package/dist/agent-observation.schemas.js +18 -0
  12. package/dist/agent-observation.schemas.js.map +1 -0
  13. package/dist/agent-observation.types.d.ts +25 -1
  14. package/dist/agent-observation.types.d.ts.map +1 -1
  15. package/dist/agent-rpc-resume-admission.d.ts +80 -0
  16. package/dist/agent-rpc-resume-admission.d.ts.map +1 -0
  17. package/dist/agent-rpc-resume-admission.js +95 -0
  18. package/dist/agent-rpc-resume-admission.js.map +1 -0
  19. package/dist/agent-rpc-resume.d.ts +22 -52
  20. package/dist/agent-rpc-resume.d.ts.map +1 -1
  21. package/dist/agent-rpc-resume.js +38 -86
  22. package/dist/agent-rpc-resume.js.map +1 -1
  23. package/dist/agent-rpc-resume.types.d.ts +17 -1
  24. package/dist/agent-rpc-resume.types.d.ts.map +1 -1
  25. package/dist/create-app.d.ts +8 -8
  26. package/dist/create-app.d.ts.map +1 -1
  27. package/dist/create-app.js +6 -91
  28. package/dist/create-app.js.map +1 -1
  29. package/dist/create-rest-app.d.ts +36 -0
  30. package/dist/create-rest-app.d.ts.map +1 -0
  31. package/dist/create-rest-app.js +128 -0
  32. package/dist/create-rest-app.js.map +1 -0
  33. package/dist/materialize-rest-routes.d.ts +9 -0
  34. package/dist/materialize-rest-routes.d.ts.map +1 -0
  35. package/dist/materialize-rest-routes.js +62 -0
  36. package/dist/materialize-rest-routes.js.map +1 -0
  37. package/dist/materialize-routes-utils.d.ts +1 -1
  38. package/dist/materialize-routes-utils.d.ts.map +1 -1
  39. package/dist/materialize-routes-utils.js +10 -3
  40. package/dist/materialize-routes-utils.js.map +1 -1
  41. package/dist/materialize-routes.d.ts +5 -0
  42. package/dist/materialize-routes.d.ts.map +1 -1
  43. package/dist/materialize-routes.js +2 -49
  44. package/dist/materialize-routes.js.map +1 -1
  45. package/dist/materialize-routes.types.d.ts +3 -0
  46. package/dist/materialize-routes.types.d.ts.map +1 -1
  47. package/dist/prepared-app.d.ts +17 -0
  48. package/dist/prepared-app.d.ts.map +1 -0
  49. package/dist/prepared-app.js +56 -0
  50. package/dist/prepared-app.js.map +1 -0
  51. package/dist/prepared-transports.service.d.ts +30 -0
  52. package/dist/prepared-transports.service.d.ts.map +1 -0
  53. package/dist/prepared-transports.service.js +45 -0
  54. package/dist/prepared-transports.service.js.map +1 -0
  55. package/dist/prepared-transports.types.d.ts +33 -0
  56. package/dist/prepared-transports.types.d.ts.map +1 -0
  57. package/dist/prepared-transports.types.js +2 -0
  58. package/dist/prepared-transports.types.js.map +1 -0
  59. package/package.json +19 -15
@@ -1,60 +1,30 @@
1
- import type { ResolvedAgent } from "./agent-rpc-resume.types.js";
1
+ /**
2
+ * Owns request-level continuation admission through a replaceable Effect service.
3
+ * Authorization remains supplied by the request; durable lookup, validation and
4
+ * generation-owned execution use the narrow admission helpers without agent runtime imports.
5
+ */
2
6
  import { type OperationId } from "@relkit/contracts";
3
- import type { RouteMaterializationOptions } from "./materialize-routes.js";
4
- import { type AgentInput } from "./agent-rpc-support.js";
5
7
  import { Context, Effect, Layer } from "effect";
6
- import { HttpBoundaryError } from "./http-effect.js";
7
- /** Admits a resume only after revision validation and joining the interrupted run.
8
- * @param input - Public resume payload and observed revision.
9
- * @param threadId - Authorized durable thread identifier.
10
- * @param operationId - Idempotency identifier for continuation admission.
11
- * @param resolved - Authorized descriptor, provider and scope.
12
- * @param options - Generation and runtime dependencies.
13
- * @returns The accepted continuation receipt, including whether admission was a duplicate.
14
- */
15
- declare const resume: (input: AgentInput, threadId: string, operationId: OperationId, resolved: {
16
- descriptor: {
17
- readonly input: import("@relkit/schema").StandardSchemaV1;
18
- readonly output: import("@relkit/schema").StandardSchemaV1;
19
- readonly client?: unknown;
20
- readonly chat?: {
21
- readonly input?: unknown;
22
- readonly output?: unknown;
23
- };
24
- };
25
- node: import("@relkit/graph").AgentRegistration;
26
- provider: import("@relkit/agents").AgentStateProvider;
27
- scope: import("@relkit/contracts").AgentRequestScope;
28
- trusted: unknown;
29
- }, options: RouteMaterializationOptions) => Effect.Effect<{
30
- operationId: OperationId;
31
- threadId: string;
32
- runId: string;
33
- status: "accepted";
34
- duplicate: boolean;
35
- }, HttpBoundaryError, never>;
36
- declare const AgentContinuations_base: Context.ServiceClass<AgentContinuations, "@relkit/runtime-hono/AgentContinuations", {
37
- readonly resume: typeof resume;
38
- }>;
39
- /** Admits resumptions only after the prior run and its durable waiting revision settle. */
8
+ import { type AgentInput } from "./agent-rpc-support.js";
9
+ import type { RouteMaterializationOptions } from "./materialize-routes.js";
10
+ import type { AgentContinuationOperations, ResolvedAgent } from "./agent-rpc-resume.types.js";
11
+ declare const AgentContinuations_base: Context.ServiceClass<AgentContinuations, "@relkit/runtime-hono/AgentContinuations", AgentContinuationOperations> & {
12
+ readonly make: Effect.Effect<AgentContinuationOperations, never, never>;
13
+ };
14
+ /** Continuation admission authority captures no per-request authorization during acquisition. */
40
15
  export declare class AgentContinuations extends AgentContinuations_base {
41
16
  }
42
- /** Live continuation admission preserves receipt idempotency and revision fencing. */
17
+ /** Builds the concrete continuation service; tests replace the same contract through a Layer. */
43
18
  export declare const AgentContinuationsLive: Layer.Layer<AgentContinuations, never, never>;
44
- /** Executes durable resume admission at the native oRPC boundary.
45
- * @param input - Submitted operation input; validation and authorization occur before effects are admitted.
46
- * @param threadId - Stable thread identifier within the authorized agent scope.
47
- * @param operationId - Idempotency identifier for durable admission or lookup.
48
- * @param resolved - Authorized agent descriptor, provider and durable request scope.
49
- * @param options - Application dependencies and configuration for this domain.
50
- * @returns The accepted continuation receipt, including whether admission was a duplicate.
19
+ /**
20
+ * Runs durable continuation admission at the native oRPC edge.
21
+ * @param input - Submitted operation input; caller already owns request authorization.
22
+ * @param threadId - Authorized durable thread identity.
23
+ * @param operationId - Stable admission/duplicate lookup identity.
24
+ * @param resolved - Fresh descriptor/provider authority.
25
+ * @param options - Owning generation dependencies.
26
+ * @returns Accepted durable receipt, including duplicate status, or original public failure.
51
27
  */
52
- export declare function acceptAgentResume(input: AgentInput, threadId: string, operationId: OperationId, resolved: ResolvedAgent, options: RouteMaterializationOptions): Promise<{
53
- operationId: OperationId;
54
- threadId: string;
55
- runId: string;
56
- status: "accepted";
57
- duplicate: boolean;
58
- }>;
28
+ export declare function acceptAgentResume(input: AgentInput, threadId: string, operationId: OperationId, resolved: ResolvedAgent, options: RouteMaterializationOptions): Promise<import("@relkit/agents").AcceptRunReceipt>;
59
29
  export {};
60
30
  //# sourceMappingURL=agent-rpc-resume.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-rpc-resume.d.ts","sourceRoot":"","sources":["../src/agent-rpc-resume.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAMjE,OAAO,EAA2B,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAU,KAAK,UAAU,EAA8B,MAAM,wBAAwB,CAAC;AAI7F,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAgB,iBAAiB,EAAwB,MAAM,kBAAkB,CAAC;AAEzF;;;;;;;GAOG;AACH,QAAA,MAAM,MAAM;;;;;;0BA0EG,CAAC;2BAA0B,CAAC;;;;;;;;;;;;;4BATzC,CAAC;;qBAKkB,OAAO,MAAM;;AAHlC,2FAA2F;AAC3F,qBAAa,kBAAmB,SAAQ,uBAGM;CAAG;AAEjD,sFAAsF;AACtF,eAAO,MAAM,sBAAsB,+CAEjC,CAAC;AAEH;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,2BAA2B;;;;;;GAOrC"}
1
+ {"version":3,"file":"agent-rpc-resume.d.ts","sourceRoot":"","sources":["../src/agent-rpc-resume.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAA2B,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAIhD,OAAO,EAA8B,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAMrF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,KAAK,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;;;;AAoD9F,iGAAiG;AACjG,qBAAa,kBAAmB,SAAQ,uBAWtC;CAAG;AAEL,iGAAiG;AACjG,eAAO,MAAM,sBAAsB,+CAA4D,CAAC;AAEhG;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,2BAA2B,sDAOrC"}
@@ -1,24 +1,27 @@
1
- import { httpValidation } from "./http-validation.js";
2
- import { isGraphDescriptor, validateGraphResumeInput, validateNativeAgentResumeInput, } from "@relkit/agents";
1
+ /**
2
+ * Owns request-level continuation admission through a replaceable Effect service.
3
+ * Authorization remains supplied by the request; durable lookup, validation and
4
+ * generation-owned execution use the narrow admission helpers without agent runtime imports.
5
+ */
3
6
  import { REALTIME_RUNTIME_LIMITS } from "@relkit/contracts";
4
- import { digest, verifiedAgentRequestDigest } from "./agent-rpc-support.js";
5
- import { startAgentRun } from "./agent-rpc-worker.js";
6
- import { waitForAgentRun } from "./agent-run-tasks.js";
7
- import { assertAgentRunWritable } from "./agent-compatibility.js";
8
7
  import { Context, Effect, Layer } from "effect";
9
- import { httpBoundary, HttpBoundaryError, observeHttp, runHttp } from "./http-effect.js";
10
- /** Admits a resume only after revision validation and joining the interrupted run.
11
- * @param input - Public resume payload and observed revision.
12
- * @param threadId - Authorized durable thread identifier.
13
- * @param operationId - Idempotency identifier for continuation admission.
14
- * @param resolved - Authorized descriptor, provider and scope.
8
+ import { httpValidation } from "./http-validation.js";
9
+ import { httpBoundary, observeHttp, runHttp } from "./http-effect.js";
10
+ import { assertAgentRunWritable } from "./agent-compatibility.js";
11
+ import { verifiedAgentRequestDigest } from "./agent-rpc-support.js";
12
+ import { admitAgentContinuation, lookupAgentContinuation, resumeError, } from "./agent-rpc-resume-admission.js";
13
+ /**
14
+ * Admits a resume after provider snapshot validation and interrupted-run joining.
15
+ * @param input - Submitted payload and observed revision.
16
+ * @param threadId - Authorized durable thread identity.
17
+ * @param operationId - Stable continuation idempotency identity.
18
+ * @param resolved - Fresh request descriptor/provider authority.
15
19
  * @param options - Generation and runtime dependencies.
16
- * @returns The accepted continuation receipt, including whether admission was a duplicate.
20
+ * @returns Lazy accepted receipt or typed public transport failure.
17
21
  */
18
22
  const resume = Effect.fn("AgentContinuations.resume")(function* (input, threadId, operationId, resolved, options) {
19
- if (typeof input.waitingRevision !== "string" || input.waitingRevision.length === 0) {
20
- return yield* Effect.fail(resumeError("Agent resume requires the observed waiting revision."));
21
- }
23
+ if (typeof input.waitingRevision !== "string" || input.waitingRevision.length === 0)
24
+ return yield* resumeError("Agent resume requires the observed waiting revision.");
22
25
  const requestDigest = yield* httpValidation("agent.validate", () => verifiedAgentRequestDigest(input));
23
26
  const snapshot = yield* httpBoundary("agent.resume.snapshot", () => resolved.provider.loadThread({
24
27
  ...resolved.scope,
@@ -27,80 +30,29 @@ const resume = Effect.fn("AgentContinuations.resume")(function* (input, threadId
27
30
  }));
28
31
  const waiting = snapshot.waiting;
29
32
  yield* httpValidation("agent.validate", () => assertAgentRunWritable(snapshot, waiting?.runId));
30
- if (waiting === undefined) {
31
- const prior = yield* httpBoundary("agent.resume.receipt", () => resolved.provider.lookupContinuationReceipt({
32
- ...resolved.scope,
33
- operationId,
34
- threadId,
35
- semanticDigest: requestDigest,
36
- now: new Date().toISOString(),
37
- }));
38
- if (prior.status === "found") {
39
- const accepted = asAcceptedRun({ ...prior.receipt, duplicate: true });
40
- startAgentRun(resolved, accepted, input.payload, options, true);
41
- return accepted;
42
- }
43
- return yield* Effect.fail(resumeError("Agent has no waiting continuation."));
44
- }
45
- if (input.waitingRevision !== waiting.revision) {
46
- return yield* Effect.fail(resumeError("Agent waiting revision is stale."));
47
- }
48
- const reply = yield* httpBoundary("agent.resume.validate", async () => isGraphDescriptor(resolved.descriptor)
49
- ? validateGraphResumeInput(resolved.descriptor, waiting.requests, input.payload)
50
- : validateNativeAgentResumeInput(waiting.requests, input.payload)).pipe(Effect.mapError(() => resumeError("Agent resume input validation failed.")));
51
- yield* httpBoundary("agent.resume.join", () => waitForAgentRun(waiting.runId));
52
- const continuation = yield* httpBoundary("agent.resume.admit", () => resolved.provider.admitContinuation({
53
- ...resolved.scope,
54
- kind: "resume",
55
- operationId,
56
- semanticDigest: requestDigest,
57
- threadId,
58
- interruptedRunId: waiting.runId,
59
- interruptSetDigest: digest(waiting),
60
- waitingRevision: waiting.revision,
61
- admittedAt: new Date().toISOString(),
62
- receiptExpiresAt: new Date(Date.now() + REALTIME_RUNTIME_LIMITS.agentReceiptMs).toISOString(),
63
- }));
64
- const accepted = asAcceptedRun(continuation);
65
- startAgentRun(resolved, accepted, reply, options, true);
66
- return accepted;
33
+ if (waiting === undefined)
34
+ return yield* lookupAgentContinuation(input, threadId, operationId, resolved, options, requestDigest);
35
+ return yield* admitAgentContinuation(input, threadId, operationId, resolved, options, requestDigest, waiting);
67
36
  });
68
- /** Admits resumptions only after the prior run and its durable waiting revision settle. */
69
- export class AgentContinuations extends Context.Service()("@relkit/runtime-hono/AgentContinuations") {
37
+ /** Continuation admission authority captures no per-request authorization during acquisition. */
38
+ export class AgentContinuations extends Context.Service()("@relkit/runtime-hono/AgentContinuations", {
39
+ make: Effect.sync(() => ({
40
+ resume: (...args) => observeHttp("agent.resume", resume(...args)),
41
+ })),
42
+ }) {
70
43
  }
71
- /** Live continuation admission preserves receipt idempotency and revision fencing. */
72
- export const AgentContinuationsLive = Layer.succeed(AgentContinuations, {
73
- resume: (...args) => observeHttp("agent.resume", resume(...args)),
74
- });
75
- /** Executes durable resume admission at the native oRPC boundary.
76
- * @param input - Submitted operation input; validation and authorization occur before effects are admitted.
77
- * @param threadId - Stable thread identifier within the authorized agent scope.
78
- * @param operationId - Idempotency identifier for durable admission or lookup.
79
- * @param resolved - Authorized agent descriptor, provider and durable request scope.
80
- * @param options - Application dependencies and configuration for this domain.
81
- * @returns The accepted continuation receipt, including whether admission was a duplicate.
44
+ /** Builds the concrete continuation service; tests replace the same contract through a Layer. */
45
+ export const AgentContinuationsLive = Layer.effect(AgentContinuations, AgentContinuations.make);
46
+ /**
47
+ * Runs durable continuation admission at the native oRPC edge.
48
+ * @param input - Submitted operation input; caller already owns request authorization.
49
+ * @param threadId - Authorized durable thread identity.
50
+ * @param operationId - Stable admission/duplicate lookup identity.
51
+ * @param resolved - Fresh descriptor/provider authority.
52
+ * @param options - Owning generation dependencies.
53
+ * @returns Accepted durable receipt, including duplicate status, or original public failure.
82
54
  */
83
55
  export function acceptAgentResume(input, threadId, operationId, resolved, options) {
84
56
  return runHttp(Effect.flatMap(AgentContinuations, (service) => service.resume(input, threadId, operationId, resolved, options)).pipe(Effect.provide(AgentContinuationsLive)));
85
57
  }
86
- /** Retains the original validation exception at the public Promise boundary.
87
- * @param message - Public message included in the resulting value or failure.
88
- * @returns A typed boundary failure retaining the original public TypeError.
89
- */
90
- function resumeError(message) {
91
- return new HttpBoundaryError({ operation: "agent.resume", cause: new TypeError(message) });
92
- }
93
- /** Projects a continuation receipt into the existing accepted-run response.
94
- * @param continuation - Durable continuation receipt projected into accepted-run form.
95
- * @returns An accepted run response retaining operation, thread, run and duplicate fields.
96
- */
97
- function asAcceptedRun(continuation) {
98
- return {
99
- operationId: continuation.operationId,
100
- threadId: continuation.threadId,
101
- runId: continuation.runId,
102
- status: "accepted",
103
- duplicate: continuation.duplicate,
104
- };
105
- }
106
58
  //# sourceMappingURL=agent-rpc-resume.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-rpc-resume.js","sourceRoot":"","sources":["../src/agent-rpc-resume.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAoB,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAE,MAAM,EAAmB,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEzF;;;;;;;GAOG;AACH,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,2BAA2B,CAAC,CAAC,QAAQ,CAAC,EAC7D,KAAi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;CAAG;AAEL,iGAAiG;AACjG,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,MAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAEhG;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAiB,EACjB,QAAgB,EAChB,WAAwB,EACxB,QAAuB,EACvB,OAAoC;IAEpC,OAAO,OAAO,CACZ,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE,CAC7C,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,CAChE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAC/C,CAAC;AACJ,CAAC"}
@@ -1,4 +1,20 @@
1
- import type { agentContext } from "./agent-rpc-support.js";
1
+ /**
2
+ * Defines request-owned continuation admission contracts. Provider and descriptor
3
+ * authority come from authorization; service methods return durable accepted
4
+ * receipts and preserve typed transport failures without retaining request scope.
5
+ */
6
+ import type { Effect } from "effect";
7
+ import type { OperationId } from "@relkit/contracts";
8
+ import type { AcceptRunReceipt } from "@relkit/agents";
9
+ import type { HttpBoundaryError } from "./http-effect.js";
10
+ import type { RouteMaterializationOptions } from "./materialize-routes.js";
11
+ import type { AgentInput, agentContext } from "./agent-rpc-support.js";
2
12
  /** Authorized agent descriptor, provider and immutable durable request scope. */
3
13
  export type ResolvedAgent = Awaited<ReturnType<typeof agentContext>>;
14
+ /** Waiting revision is accepted only from the authorized provider snapshot. */
15
+ export type WaitingAgentContinuation = NonNullable<Awaited<ReturnType<ResolvedAgent["provider"]["loadThread"]>>["waiting"]>;
16
+ /** Replaceable continuation service; each call supplies fresh request authority. */
17
+ export interface AgentContinuationOperations {
18
+ readonly resume: (input: AgentInput, threadId: string, operationId: OperationId, resolved: ResolvedAgent, options: RouteMaterializationOptions) => Effect.Effect<AcceptRunReceipt, HttpBoundaryError>;
19
+ }
4
20
  //# sourceMappingURL=agent-rpc-resume.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-rpc-resume.types.d.ts","sourceRoot":"","sources":["../src/agent-rpc-resume.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,iFAAiF;AACjF,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"agent-rpc-resume.types.d.ts","sourceRoot":"","sources":["../src/agent-rpc-resume.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEvE,iFAAiF;AACjF,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;AAErE,+EAA+E;AAC/E,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAChD,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CACxE,CAAC;AAEF,oFAAoF;AACpF,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,MAAM,EAAE,CACf,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,2BAA2B,KACjC,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;CACzD"}
@@ -1,15 +1,15 @@
1
- import { Hono } from "hono";
2
- import type { CreateAppOptions, FrameworkMiddlewareInput } from "./create-app.types.js";
1
+ /**
2
+ * Constructs the canonical eager HTTP application. Shared REST setup lives in
3
+ * create-rest-app; this public factory adds the agent and RPC/MCP transports in
4
+ * their existing order and preserves synchronous configuration rejection.
5
+ */
6
+ import type { Hono } from "hono";
7
+ import type { CreateAppOptions } from "./create-app.types.js";
3
8
  export type { CreateAppOptions, FrameworkMiddlewareInput } from "./create-app.types.js";
9
+ export { installFrameworkMiddleware } from "./create-rest-app.js";
4
10
  /** Creates the HTTP application from the already verified registration plan.
5
11
  * @param options - Application dependencies and configuration for this domain.
6
12
  * @returns The synchronously constructed Hono application; request work remains lazy.
7
13
  */
8
14
  export declare function createApp(options: CreateAppOptions): Hono;
9
- /** Installs supplied framework middleware in the fixed v3 order.
10
- * @param app - Hono application receiving the configured endpoints or middleware.
11
- * @param input - Submitted operation input; validation and authorization occur before effects are admitted.
12
- * @returns Nothing; the requested update is applied to the owned state.
13
- */
14
- export declare function installFrameworkMiddleware(app: Hono, input: FrameworkMiddlewareInput | undefined): void;
15
15
  //# sourceMappingURL=create-app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../src/create-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAM5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAMxF,YAAY,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAExF;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAmCzD;AAyBD;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,wBAAwB,GAAG,SAAS,GAC1C,IAAI,CAON"}
1
+ {"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../src/create-app.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAGjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAO9D,YAAY,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAOzD"}
@@ -1,103 +1,18 @@
1
- import { Hono } from "hono";
2
1
  import { installAgentInspectorEndpoints } from "./agent-inspector.js";
3
2
  import { installAgentProtocolEndpoints } from "./agent-protocol.js";
4
- import { installApiDocs } from "./api-docs.js";
5
- import { installClientContractEndpoint } from "./client-contract.js";
6
- import { installClientIdentityEndpoint } from "./client-identity.js";
7
- import { installHttpLogging } from "./http-logging.js";
8
- import { graphSnapshot, installInternalEndpoints } from "./internal-endpoints.js";
9
- import { assertHttpManifest, materializeRoutes } from "./materialize-routes.js";
10
- import { createFrameworkMiddleware, FRAMEWORK_MIDDLEWARE_ORDER } from "./middleware.js";
11
- import { installTransportSecurity } from "./transport-security.js";
3
+ import { createApplicationShell, installApplicationDocuments, routeOptions, } from "./create-rest-app.js";
4
+ import { materializeRoutes } from "./materialize-routes.js";
5
+ export { installFrameworkMiddleware } from "./create-rest-app.js";
12
6
  /** Creates the HTTP application from the already verified registration plan.
13
7
  * @param options - Application dependencies and configuration for this domain.
14
8
  * @returns The synchronously constructed Hono application; request work remains lazy.
15
9
  */
16
10
  export function createApp(options) {
17
- assertHttpManifest(options);
18
- const app = new Hono();
19
- installHttpLogging(app, options);
20
- const middlewareOptions = {
21
- ...(options.middleware ?? {}),
22
- graphHash: options.plan.graphHash,
23
- ...(options.generationId === undefined ? {} : { generationId: options.generationId }),
24
- ...(options.observability === undefined ? {} : { observability: options.observability }),
25
- };
26
- installFrameworkMiddleware(app, options.frameworkMiddleware ?? createFrameworkMiddleware(middlewareOptions));
27
- installTransportSecurity(app, options.transportSecurity);
28
- installInternalEndpoints(app, {
29
- graph: graphSnapshot(options.plan),
30
- ...(options.internalEndpoints ?? {}),
31
- });
11
+ const app = createApplicationShell(options);
32
12
  installAgentInspectorEndpoints(app, options, options.internalEndpoints ?? {});
33
- installApiDocs(app, options.plan, apiDocsOptions(options));
34
- installClientContractEndpoint(app, options.clientContract);
35
- if (options.clientIdentity !== undefined) {
36
- installClientIdentityEndpoint(app, options.clientIdentity, options.auth);
37
- }
13
+ installApplicationDocuments(app, options);
38
14
  installAgentProtocolEndpoints(app, options);
39
- const requestMapping = options.middleware?.maxBodyBytes === undefined
40
- ? options.requestMapping
41
- : { maxBodyBytes: options.middleware.maxBodyBytes, ...(options.requestMapping ?? {}) };
42
- materializeRoutes(app, {
43
- ...options,
44
- ...(requestMapping === undefined ? {} : { requestMapping }),
45
- });
15
+ materializeRoutes(app, routeOptions(options));
46
16
  return app;
47
17
  }
48
- /** Resolves API-document options from the application configuration.
49
- * @param options - Application dependencies and configuration for this domain.
50
- * @returns API-doc settings with explicit options overriding internal-endpoint defaults.
51
- */
52
- function apiDocsOptions(options) {
53
- const docs = options.apiDocs ?? {};
54
- const internal = options.internalEndpoints ?? {};
55
- return {
56
- ...docs,
57
- mode: docs.mode ?? internal.environment ?? internal.mode ?? "development",
58
- ...(docs.bearerToken !== undefined
59
- ? { bearerToken: docs.bearerToken }
60
- : internal.bearerToken === undefined
61
- ? {}
62
- : { bearerToken: internal.bearerToken }),
63
- ...(docs.authorize !== undefined
64
- ? { authorize: docs.authorize }
65
- : internal.authorize === undefined
66
- ? {}
67
- : { authorize: internal.authorize }),
68
- };
69
- }
70
- /** Installs supplied framework middleware in the fixed v3 order.
71
- * @param app - Hono application receiving the configured endpoints or middleware.
72
- * @param input - Submitted operation input; validation and authorization occur before effects are admitted.
73
- * @returns Nothing; the requested update is applied to the owned state.
74
- */
75
- export function installFrameworkMiddleware(app, input) {
76
- if (input === undefined)
77
- return;
78
- const middleware = normalizeFrameworkMiddleware(input);
79
- for (const name of FRAMEWORK_MIDDLEWARE_ORDER) {
80
- const handler = middleware.get(name);
81
- if (handler !== undefined)
82
- app.use("*", handler);
83
- }
84
- }
85
- /** Normalizes optional middleware configuration into an ordered list.
86
- * @param input - Submitted operation input; validation and authorization occur before effects are admitted.
87
- * @returns A map of unique, recognized framework middleware names to their handlers.
88
- */
89
- function normalizeFrameworkMiddleware(input) {
90
- const result = new Map();
91
- const entries = Array.isArray(input)
92
- ? input.map((item) => [item.name, item.handler])
93
- : Object.entries(input);
94
- for (const [name, handler] of entries) {
95
- if (!FRAMEWORK_MIDDLEWARE_ORDER.includes(name))
96
- throw new TypeError(`Unknown framework middleware "${String(name)}".`);
97
- if (result.has(name))
98
- throw new TypeError(`Duplicate framework middleware "${name}".`);
99
- result.set(name, handler);
100
- }
101
- return result;
102
- }
103
18
  //# sourceMappingURL=create-app.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-app.js","sourceRoot":"","sources":["../src/create-app.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAuB,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,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,CAAC,IAAI,CAAC;YACnE,MAAM,IAAI,SAAS,CAAC,iCAAiC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzE,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,SAAS,CAAC,mCAAmC,IAAI,IAAI,CAAC,CAAC;QACvF,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"create-app.js","sourceRoot":"","sources":["../src/create-app.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,OAAyB;IACjD,MAAM,GAAG,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAC5C,8BAA8B,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC9E,2BAA2B,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1C,6BAA6B,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC5C,iBAAiB,CAAC,GAAG,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Shares eager HTTP policy between canonical and prepared applications. The shell
3
+ * validates the complete manifest and installs framework/security/control routes;
4
+ * REST construction adds documentation, client identity and declared routes without
5
+ * importing agent, RPC or MCP transport implementations. No resources are acquired.
6
+ */
7
+ import { Hono } from "hono";
8
+ import type { CreateAppOptions, FrameworkMiddlewareInput } from "./create-app.types.js";
9
+ /** Constructs only eagerly required HTTP behavior.
10
+ * @param options - Complete checked cohort and runtime dependencies.
11
+ * @returns A REST application with canonical policy and no deferred transports.
12
+ */
13
+ export declare function createRestApp(options: CreateAppOptions): Hono;
14
+ /** Validates the cohort and installs policy in canonical order.
15
+ * @param options - Complete checked cohort and runtime dependencies.
16
+ * @returns A shell awaiting transport registration; malformed configuration throws.
17
+ */
18
+ export declare function createApplicationShell(options: CreateAppOptions): Hono;
19
+ /** Adds the canonical documentation and client endpoints.
20
+ * @param app - Shell whose policy is already installed.
21
+ * @param options - Validated runtime configuration.
22
+ * @returns Nothing; registers protected documents and client identity.
23
+ */
24
+ export declare function installApplicationDocuments(app: Hono, options: CreateAppOptions): void;
25
+ /** Merges the framework body limit into route mapping.
26
+ * @param options - Complete application configuration.
27
+ * @returns Route options preserving an explicit mapping override.
28
+ */
29
+ export declare function routeOptions(options: CreateAppOptions): CreateAppOptions;
30
+ /** Installs validated middleware in the fixed framework order.
31
+ * @param app - Shell receiving middleware before endpoint registration.
32
+ * @param input - User supplied overrides; missing input installs nothing.
33
+ * @returns Nothing; duplicate or unrecognized names throw before activation.
34
+ */
35
+ export declare function installFrameworkMiddleware(app: Hono, input: FrameworkMiddlewareInput | undefined): void;
36
+ //# sourceMappingURL=create-rest-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-rest-app.d.ts","sourceRoot":"","sources":["../src/create-rest-app.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAA0B,MAAM,MAAM,CAAC;AAIpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AASxF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAM7D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAoBtE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAMtF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB,CASxE;AAmBD;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,wBAAwB,GAAG,SAAS,GAC1C,IAAI,CAON"}
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Shares eager HTTP policy between canonical and prepared applications. The shell
3
+ * validates the complete manifest and installs framework/security/control routes;
4
+ * REST construction adds documentation, client identity and declared routes without
5
+ * importing agent, RPC or MCP transport implementations. No resources are acquired.
6
+ */
7
+ import { Hono } from "hono";
8
+ import { installApiDocs } from "./api-docs.js";
9
+ import { installClientContractEndpoint } from "./client-contract.js";
10
+ import { installClientIdentityEndpoint } from "./client-identity.js";
11
+ import { installHttpLogging } from "./http-logging.js";
12
+ import { graphSnapshot, installInternalEndpoints } from "./internal-endpoints.js";
13
+ import { assertHttpManifest } from "./materialize-routes-validation.js";
14
+ import { materializeRestRoutes } from "./materialize-rest-routes.js";
15
+ import { createFrameworkMiddleware, FRAMEWORK_MIDDLEWARE_ORDER } from "./middleware.js";
16
+ import { installStaticFiles } from "./static-files.js";
17
+ import { installTransportSecurity } from "./transport-security.js";
18
+ /** Constructs only eagerly required HTTP behavior.
19
+ * @param options - Complete checked cohort and runtime dependencies.
20
+ * @returns A REST application with canonical policy and no deferred transports.
21
+ */
22
+ export function createRestApp(options) {
23
+ const app = createApplicationShell(options);
24
+ installApplicationDocuments(app, options);
25
+ materializeRestRoutes(app, routeOptions(options));
26
+ installStaticFiles(app, options.staticFiles);
27
+ return app;
28
+ }
29
+ /** Validates the cohort and installs policy in canonical order.
30
+ * @param options - Complete checked cohort and runtime dependencies.
31
+ * @returns A shell awaiting transport registration; malformed configuration throws.
32
+ */
33
+ export function createApplicationShell(options) {
34
+ assertHttpManifest(options);
35
+ const app = new Hono();
36
+ installHttpLogging(app, options);
37
+ const middlewareOptions = {
38
+ ...(options.middleware ?? {}),
39
+ graphHash: options.plan.graphHash,
40
+ ...(options.generationId === undefined ? {} : { generationId: options.generationId }),
41
+ ...(options.observability === undefined ? {} : { observability: options.observability }),
42
+ };
43
+ installFrameworkMiddleware(app, options.frameworkMiddleware ?? createFrameworkMiddleware(middlewareOptions));
44
+ installTransportSecurity(app, options.transportSecurity);
45
+ installInternalEndpoints(app, {
46
+ graph: graphSnapshot(options.plan),
47
+ ...(options.internalEndpoints ?? {}),
48
+ });
49
+ return app;
50
+ }
51
+ /** Adds the canonical documentation and client endpoints.
52
+ * @param app - Shell whose policy is already installed.
53
+ * @param options - Validated runtime configuration.
54
+ * @returns Nothing; registers protected documents and client identity.
55
+ */
56
+ export function installApplicationDocuments(app, options) {
57
+ installApiDocs(app, options.plan, apiDocsOptions(options));
58
+ installClientContractEndpoint(app, options.clientContract);
59
+ if (options.clientIdentity !== undefined) {
60
+ installClientIdentityEndpoint(app, options.clientIdentity, options.auth);
61
+ }
62
+ }
63
+ /** Merges the framework body limit into route mapping.
64
+ * @param options - Complete application configuration.
65
+ * @returns Route options preserving an explicit mapping override.
66
+ */
67
+ export function routeOptions(options) {
68
+ if (options.middleware?.maxBodyBytes === undefined)
69
+ return options;
70
+ return {
71
+ ...options,
72
+ requestMapping: {
73
+ maxBodyBytes: options.middleware.maxBodyBytes,
74
+ ...(options.requestMapping ?? {}),
75
+ },
76
+ };
77
+ }
78
+ /** Resolves document protection from existing internal endpoint policy.
79
+ * @param options - Complete application configuration.
80
+ * @returns Document settings with explicit overrides taking precedence.
81
+ */
82
+ function apiDocsOptions(options) {
83
+ const docs = options.apiDocs ?? {};
84
+ const internal = options.internalEndpoints ?? {};
85
+ const bearerToken = docs.bearerToken ?? internal.bearerToken;
86
+ const authorize = docs.authorize ?? internal.authorize;
87
+ return {
88
+ ...docs,
89
+ mode: docs.mode ?? internal.environment ?? internal.mode ?? "development",
90
+ ...(bearerToken === undefined ? {} : { bearerToken }),
91
+ ...(authorize === undefined ? {} : { authorize }),
92
+ };
93
+ }
94
+ /** Installs validated middleware in the fixed framework order.
95
+ * @param app - Shell receiving middleware before endpoint registration.
96
+ * @param input - User supplied overrides; missing input installs nothing.
97
+ * @returns Nothing; duplicate or unrecognized names throw before activation.
98
+ */
99
+ export function installFrameworkMiddleware(app, input) {
100
+ if (input === undefined)
101
+ return;
102
+ const middleware = normalizeFrameworkMiddleware(input);
103
+ for (const name of FRAMEWORK_MIDDLEWARE_ORDER) {
104
+ const handler = middleware.get(name);
105
+ if (handler !== undefined)
106
+ app.use("*", handler);
107
+ }
108
+ }
109
+ /** Validates names and preserves a single handler for each framework step.
110
+ * @param input - Array or keyed middleware declarations.
111
+ * @returns A validated lookup consumed in framework order.
112
+ */
113
+ function normalizeFrameworkMiddleware(input) {
114
+ const result = new Map();
115
+ const entries = Array.isArray(input)
116
+ ? input.map((item) => [item.name, item.handler])
117
+ : Object.entries(input);
118
+ for (const [name, handler] of entries) {
119
+ if (!FRAMEWORK_MIDDLEWARE_ORDER.some((expected) => expected === name)) {
120
+ throw new TypeError(`Unknown framework middleware "${name}".`);
121
+ }
122
+ if (result.has(name))
123
+ throw new TypeError(`Duplicate framework middleware "${name}".`);
124
+ result.set(name, handler);
125
+ }
126
+ return result;
127
+ }
128
+ //# sourceMappingURL=create-rest-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-rest-app.js","sourceRoot":"","sources":["../src/create-rest-app.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAA0B,MAAM,MAAM,CAAC;AACpD,OAAO,EAAE,cAAc,EAAuB,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,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