@slopus/happy-agent-client 0.0.0

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 (90) hide show
  1. package/README.md +17 -0
  2. package/dist/HappyAgentApiError.d.ts +41 -0
  3. package/dist/HappyAgentApiError.d.ts.map +1 -0
  4. package/dist/HappyAgentApiError.js +57 -0
  5. package/dist/HappyAgentApiError.js.map +1 -0
  6. package/dist/HappyAgentClient.d.ts +256 -0
  7. package/dist/HappyAgentClient.d.ts.map +1 -0
  8. package/dist/HappyAgentClient.js +739 -0
  9. package/dist/HappyAgentClient.js.map +1 -0
  10. package/dist/endpointUrl.d.ts +14 -0
  11. package/dist/endpointUrl.d.ts.map +1 -0
  12. package/dist/endpointUrl.js +27 -0
  13. package/dist/endpointUrl.js.map +1 -0
  14. package/dist/index.d.ts +26 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +22 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/protocol/agents.d.ts +116 -0
  19. package/dist/protocol/agents.d.ts.map +1 -0
  20. package/dist/protocol/agents.js +3 -0
  21. package/dist/protocol/agents.js.map +1 -0
  22. package/dist/protocol/bootstrap.d.ts +28 -0
  23. package/dist/protocol/bootstrap.d.ts.map +1 -0
  24. package/dist/protocol/bootstrap.js +3 -0
  25. package/dist/protocol/bootstrap.js.map +1 -0
  26. package/dist/protocol/common.d.ts +104 -0
  27. package/dist/protocol/common.d.ts.map +1 -0
  28. package/dist/protocol/common.js +92 -0
  29. package/dist/protocol/common.js.map +1 -0
  30. package/dist/protocol/daemon.d.ts +486 -0
  31. package/dist/protocol/daemon.d.ts.map +1 -0
  32. package/dist/protocol/daemon.js +210 -0
  33. package/dist/protocol/daemon.js.map +1 -0
  34. package/dist/protocol/events.d.ts +208 -0
  35. package/dist/protocol/events.d.ts.map +1 -0
  36. package/dist/protocol/events.js +9 -0
  37. package/dist/protocol/events.js.map +1 -0
  38. package/dist/protocol/files.d.ts +74 -0
  39. package/dist/protocol/files.d.ts.map +1 -0
  40. package/dist/protocol/files.js +8 -0
  41. package/dist/protocol/files.js.map +1 -0
  42. package/dist/protocol/git.d.ts +55 -0
  43. package/dist/protocol/git.d.ts.map +1 -0
  44. package/dist/protocol/git.js +3 -0
  45. package/dist/protocol/git.js.map +1 -0
  46. package/dist/protocol/messages.d.ts +210 -0
  47. package/dist/protocol/messages.d.ts.map +1 -0
  48. package/dist/protocol/messages.js +8 -0
  49. package/dist/protocol/messages.js.map +1 -0
  50. package/dist/protocol/processes.d.ts +26 -0
  51. package/dist/protocol/processes.d.ts.map +1 -0
  52. package/dist/protocol/processes.js +3 -0
  53. package/dist/protocol/processes.js.map +1 -0
  54. package/dist/protocol/profile.d.ts +40 -0
  55. package/dist/protocol/profile.d.ts.map +1 -0
  56. package/dist/protocol/profile.js +23 -0
  57. package/dist/protocol/profile.js.map +1 -0
  58. package/dist/protocol/projects.d.ts +377 -0
  59. package/dist/protocol/projects.d.ts.map +1 -0
  60. package/dist/protocol/projects.js +107 -0
  61. package/dist/protocol/projects.js.map +1 -0
  62. package/dist/protocol/questions.d.ts +54 -0
  63. package/dist/protocol/questions.d.ts.map +1 -0
  64. package/dist/protocol/questions.js +3 -0
  65. package/dist/protocol/questions.js.map +1 -0
  66. package/dist/protocol/terminals.d.ts +50 -0
  67. package/dist/protocol/terminals.d.ts.map +1 -0
  68. package/dist/protocol/terminals.js +3 -0
  69. package/dist/protocol/terminals.js.map +1 -0
  70. package/dist/protocol/usage.d.ts +27 -0
  71. package/dist/protocol/usage.d.ts.map +1 -0
  72. package/dist/protocol/usage.js +9 -0
  73. package/dist/protocol/usage.js.map +1 -0
  74. package/dist/protocol/workspaces.d.ts +216 -0
  75. package/dist/protocol/workspaces.d.ts.map +1 -0
  76. package/dist/protocol/workspaces.js +87 -0
  77. package/dist/protocol/workspaces.js.map +1 -0
  78. package/dist/readEventStream.d.ts +19 -0
  79. package/dist/readEventStream.d.ts.map +1 -0
  80. package/dist/readEventStream.js +46 -0
  81. package/dist/readEventStream.js.map +1 -0
  82. package/dist/readSseFrames.d.ts +20 -0
  83. package/dist/readSseFrames.d.ts.map +1 -0
  84. package/dist/readSseFrames.js +77 -0
  85. package/dist/readSseFrames.js.map +1 -0
  86. package/dist/requestOptions.d.ts +44 -0
  87. package/dist/requestOptions.d.ts.map +1 -0
  88. package/dist/requestOptions.js +9 -0
  89. package/dist/requestOptions.js.map +1 -0
  90. package/package.json +42 -0
@@ -0,0 +1,210 @@
1
+ /**
2
+ * Messages and runs: what the user sends, and the work the agent does in response.
3
+ *
4
+ * One message shape carries the whole conversation — history, send acceptances,
5
+ * and events all speak it.
6
+ */
7
+ import type { Cuid2, EventCursor, MessageMode, Timestamp } from "./common.js";
8
+ import type { UsageBreakdown } from "./usage.js";
9
+ /** A tool call rendered for display, from a closed set every client implements once. */
10
+ export type ToolPresentation = ExplorationPresentation | ExecCommandPresentation | BackgroundTerminalInteractionPresentation | FileDiffPresentation | SearchPresentation;
11
+ /** Reading around the codebase: listings, file reads, and searches. */
12
+ export interface ExplorationPresentation {
13
+ type: "exploration";
14
+ operations: ExplorationOperation[];
15
+ }
16
+ export type ExplorationOperation = {
17
+ kind: "list";
18
+ target: string;
19
+ } | {
20
+ kind: "read";
21
+ name: string;
22
+ } | {
23
+ kind: "search";
24
+ command: string;
25
+ query?: string;
26
+ path?: string;
27
+ };
28
+ /** A shell command; `output` arrives on completion. */
29
+ export interface ExecCommandPresentation {
30
+ type: "exec_command";
31
+ command: string;
32
+ output?: string | null;
33
+ /** Set when the command kept running and became a background terminal. */
34
+ terminalId?: Cuid2 | null;
35
+ }
36
+ /** Input typed into an existing background terminal. */
37
+ export interface BackgroundTerminalInteractionPresentation {
38
+ type: "background_terminal_interaction";
39
+ terminalId: Cuid2;
40
+ /** What the terminal is running. */
41
+ command: string;
42
+ /** What was typed into it. */
43
+ input: string;
44
+ }
45
+ /** File changes, one or many files per call. */
46
+ export interface FileDiffPresentation {
47
+ type: "file_diff";
48
+ files: FileDiff[];
49
+ /** How many files the call changed but the presentation left out. */
50
+ omittedFiles?: number;
51
+ }
52
+ export interface FileDiff {
53
+ path: string;
54
+ kind: "add" | "delete" | "update";
55
+ /** For syntax highlighting, when the daemon could name the language. */
56
+ language?: string;
57
+ added: number;
58
+ deleted: number;
59
+ /** How many lines this file's hunks left out. */
60
+ omittedLines?: number;
61
+ hunks: FileDiffHunk[];
62
+ }
63
+ export interface FileDiffHunk {
64
+ oldStart: number;
65
+ newStart: number;
66
+ lines: FileDiffLine[];
67
+ }
68
+ export interface FileDiffLine {
69
+ kind: "context" | "add" | "delete";
70
+ text: string;
71
+ }
72
+ /** A web or X search; `sources` arrives on completion. */
73
+ export interface SearchPresentation {
74
+ type: "search";
75
+ target: "web" | "x";
76
+ query: string;
77
+ sources?: SearchSource[];
78
+ }
79
+ export interface SearchSource {
80
+ url: string;
81
+ title: string;
82
+ }
83
+ /** What is in a message, in order. */
84
+ export type MessageBlock = TextBlock | ImageBlock | ReasoningBlock | ToolCallBlock;
85
+ export interface TextBlock {
86
+ type: "text";
87
+ text: string;
88
+ }
89
+ export interface ImageBlock {
90
+ type: "image";
91
+ mimeType: string;
92
+ /** Base64 image bytes, travelling inline. */
93
+ data: string;
94
+ }
95
+ /** The model's thinking summary, when the provider surfaces one. */
96
+ export interface ReasoningBlock {
97
+ type: "reasoning";
98
+ text: string;
99
+ }
100
+ /** One tool invocation. */
101
+ export interface ToolCallBlock {
102
+ type: "tool_call";
103
+ name: string;
104
+ status: "running" | "completed" | "failed";
105
+ /** Raw tool arguments; absent under `omitToolData`. */
106
+ arguments?: Record<string, unknown>;
107
+ /** Raw tool result; absent under `omitToolData` and until the call finishes. */
108
+ result?: Record<string, unknown>;
109
+ /** A typed rendering of what the call did, when the daemon produced one. */
110
+ presentation?: ToolPresentation;
111
+ }
112
+ /** Whether a message waits behind the current run or interrupts it. */
113
+ export type MessageDelivery = "queue" | "steer";
114
+ /** A message, whoever produced it. */
115
+ export type Message = UserMessage | AgentMessage | SystemMessage | ServiceMessage;
116
+ /** Sent by a person. */
117
+ export interface UserMessage {
118
+ id: Cuid2;
119
+ role: "user";
120
+ createdAt: Timestamp;
121
+ content: MessageBlock[];
122
+ /** `"pending"` until inference takes the message up. */
123
+ status: "pending" | "accepted";
124
+ delivery: MessageDelivery;
125
+ mode: MessageMode;
126
+ /** `null` while pending; assigned at acceptance and the handle for abort. */
127
+ runId: Cuid2 | null;
128
+ }
129
+ /** Produced by the model: its text, reasoning, and tool calls. */
130
+ export interface AgentMessage {
131
+ id: Cuid2;
132
+ role: "agent";
133
+ createdAt: Timestamp;
134
+ content: MessageBlock[];
135
+ }
136
+ /** Content the daemon injected into the model's context, when worth showing. */
137
+ export interface SystemMessage {
138
+ id: Cuid2;
139
+ role: "system";
140
+ createdAt: Timestamp;
141
+ content: MessageBlock[];
142
+ }
143
+ /** Operational records the model never saw: compaction, aborts, housekeeping. */
144
+ export interface ServiceMessage {
145
+ id: Cuid2;
146
+ role: "service";
147
+ createdAt: Timestamp;
148
+ content: MessageBlock[];
149
+ }
150
+ export type RunStatus = "running" | "completed" | "aborted" | "failed";
151
+ export type RunReason = "completed" | "steering" | "abort" | "error";
152
+ /** The work an agent did in response to a message. */
153
+ export interface Run {
154
+ id: Cuid2;
155
+ status: RunStatus;
156
+ reason: RunReason | null;
157
+ startedAt: Timestamp;
158
+ endedAt: Timestamp | null;
159
+ usage: UsageBreakdown;
160
+ costUsd: number | null;
161
+ }
162
+ /** One whole history group, with its messages oldest first. */
163
+ export interface HistoryRun extends Run {
164
+ /** Oldest first. */
165
+ messages: Message[];
166
+ }
167
+ /** `POST /v0/agents/:agentId/send` */
168
+ export interface SendMessageRequest {
169
+ /** The message text. Required. */
170
+ text: string;
171
+ /** Optional rich blocks accompanying the text; image bytes travel inline. */
172
+ content?: MessageBlock[];
173
+ /** Defaults to `"queue"`. On an idle agent the two are identical. */
174
+ delivery?: MessageDelivery;
175
+ /** The model selection and permission mode this message runs with. */
176
+ mode: MessageMode;
177
+ mutationId?: string;
178
+ }
179
+ /** `POST /v0/agents/:agentId/send` */
180
+ export interface SendMessageResponse {
181
+ message: UserMessage;
182
+ /** The event cursor at send; streaming from it replays everything this causes. */
183
+ cursor: EventCursor;
184
+ }
185
+ /** `GET /v0/agents/:agentId/messages` query parameters. */
186
+ export interface MessageHistoryQuery {
187
+ /** A run ID; return runs older than it. Cannot be combined with `after`. */
188
+ before?: Cuid2;
189
+ /** A message ID; return the messages that came after it. */
190
+ after?: Cuid2;
191
+ /**
192
+ * A lower bound counted in messages, not an upper one: a page always
193
+ * contains whole runs and may overflow well past it.
194
+ */
195
+ limit?: number;
196
+ /** Drop `arguments` and `result` from tool calls that carry a presentation. */
197
+ omitToolData?: boolean;
198
+ }
199
+ /** `GET /v0/agents/:agentId/messages` */
200
+ export interface MessageHistoryResponse {
201
+ /** Oldest first, whole runs only. */
202
+ runs: HistoryRun[];
203
+ /**
204
+ * Messages sent but not yet accepted by inference. Every history load
205
+ * returns the complete list regardless of cursors.
206
+ */
207
+ pending: UserMessage[];
208
+ hasMore: boolean;
209
+ }
210
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../sources/protocol/messages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,wFAAwF;AACxF,MAAM,MAAM,gBAAgB,GACtB,uBAAuB,GACvB,uBAAuB,GACvB,yCAAyC,GACzC,oBAAoB,GACpB,kBAAkB,CAAC;AAEzB,uEAAuE;AACvE,MAAM,WAAW,uBAAuB;IACpC,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,oBAAoB,EAAE,CAAC;CACtC;AAED,MAAM,MAAM,oBAAoB,GAC1B;IAAE,IA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 /**
2
+ * Messages and runs: what the user sends, and the work the agent does in response.
3
+ *
4
+ * One message shape carries the whole conversation — history, send acceptances,
5
+ * and events all speak it.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../sources/protocol/messages.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,26 @@
1
+ /** Background processes: an agent's work that outlived the tool call that started it. */
2
+ import type { Cuid2, ResourceVersion, Timestamp } from "./common.js";
3
+ /**
4
+ * The process object.
5
+ *
6
+ * Process output does not travel through this API at all: what it announces is
7
+ * existence and state, so a client can show what is running and its command.
8
+ */
9
+ export interface BackgroundProcess {
10
+ id: Cuid2;
11
+ /** The agent that started it. */
12
+ agentId: Cuid2;
13
+ /** The command line the process was started with. */
14
+ command: string;
15
+ status: "running" | "exited";
16
+ /** `null` while running, and after a kill that produced no code. */
17
+ exitCode: number | null;
18
+ version: ResourceVersion;
19
+ startedAt: Timestamp;
20
+ endedAt: Timestamp | null;
21
+ }
22
+ /** `DELETE /v0/agents/:agentId/processes/:processId` */
23
+ export interface BackgroundProcessResponse {
24
+ process: BackgroundProcess;
25
+ }
26
+ //# sourceMappingURL=processes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processes.d.ts","sourceRoot":"","sources":["../../sources/protocol/processes.ts"],"names":[],"mappings":"AAAA,yFAAyF;AAEzF,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAErE;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAC9B,EAAE,EAAE,KAAK,CAAC;IACV,iCAAiC;IACjC,OAAO,EAAE,KAAK,CAAC;IACf,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC7B,oEAAoE;IACpE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,eAAe,CAAC;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,SAAS,GAAG,IAAI,CAAC;CAC7B;AAED,wDAAwD;AACxD,MAAM,WAAW,yBAAyB;IACtC,OAAO,EAAE,iBAAiB,CAAC;CAC9B"}
@@ -0,0 +1,3 @@
1
+ /** Background processes: an agent's work that outlived the tool call that started it. */
2
+ export {};
3
+ //# sourceMappingURL=processes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processes.js","sourceRoot":"","sources":["../../sources/protocol/processes.ts"],"names":[],"mappings":"AAAA,yFAAyF"}
@@ -0,0 +1,40 @@
1
+ /** The profile: one installation is one person, and this is what they said about themselves. */
2
+ import { type Static } from "@sinclair/typebox";
3
+ /** The photo's ThumbHash placeholder; the bytes come from `GET /v0/profile/photo`. */
4
+ export declare const profilePhotoSchema: import("@sinclair/typebox").TObject<{
5
+ thumbhash: import("@sinclair/typebox").TString;
6
+ }>;
7
+ export type ProfilePhoto = Static<typeof profilePhotoSchema>;
8
+ /** The profile object. Every field is optional and starts out `null`. */
9
+ export declare const profileSchema: import("@sinclair/typebox").TObject<{
10
+ email: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
11
+ name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
12
+ photo: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
13
+ thumbhash: import("@sinclair/typebox").TString;
14
+ }>, import("@sinclair/typebox").TNull]>;
15
+ updatedAt: import("@sinclair/typebox").TInteger;
16
+ version: import("@sinclair/typebox").TString;
17
+ }>;
18
+ export type Profile = Static<typeof profileSchema>;
19
+ /** `GET`, `PATCH /v0/profile`, and the photo routes all answer with this. */
20
+ export declare const profileResponseSchema: import("@sinclair/typebox").TObject<{
21
+ profile: import("@sinclair/typebox").TObject<{
22
+ email: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
23
+ name: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
24
+ photo: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
25
+ thumbhash: import("@sinclair/typebox").TString;
26
+ }>, import("@sinclair/typebox").TNull]>;
27
+ updatedAt: import("@sinclair/typebox").TInteger;
28
+ version: import("@sinclair/typebox").TString;
29
+ }>;
30
+ }>;
31
+ export type ProfileResponse = Static<typeof profileResponseSchema>;
32
+ /** `PATCH /v0/profile` — any subset; a field set to `null` is cleared. */
33
+ export declare const profileUpdateRequestSchema: import("@sinclair/typebox").TObject<{
34
+ email: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
35
+ /** Echoed verbatim in the events this mutation produces. */
36
+ mutationId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
37
+ name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>>;
38
+ }>;
39
+ export type ProfileUpdateRequest = Static<typeof profileUpdateRequestSchema>;
40
+ //# sourceMappingURL=profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../sources/protocol/profile.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAEhG,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAItD,sFAAsF;AACtF,eAAO,MAAM,kBAAkB;;EAA4C,CAAC;AAC5E,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE7D,yEAAyE;AACzE,eAAO,MAAM,aAAa;;;;;;;;EAMxB,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AAEnD,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB;;;;;;;;;;EAA0C,CAAC;AAC7E,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEnE,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B;;IAEnC,4DAA4D;;;EAG9D,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ /** The profile: one installation is one person, and this is what they said about themselves. */
2
+ import { Type } from "@sinclair/typebox";
3
+ import { mutationIdSchema, Nullable, resourceVersionSchema, timestampSchema } from "./common.js";
4
+ /** The photo's ThumbHash placeholder; the bytes come from `GET /v0/profile/photo`. */
5
+ export const profilePhotoSchema = Type.Object({ thumbhash: Type.String() });
6
+ /** The profile object. Every field is optional and starts out `null`. */
7
+ export const profileSchema = Type.Object({
8
+ email: Nullable(Type.String()),
9
+ name: Nullable(Type.String()),
10
+ photo: Nullable(profilePhotoSchema),
11
+ updatedAt: timestampSchema,
12
+ version: resourceVersionSchema,
13
+ });
14
+ /** `GET`, `PATCH /v0/profile`, and the photo routes all answer with this. */
15
+ export const profileResponseSchema = Type.Object({ profile: profileSchema });
16
+ /** `PATCH /v0/profile` — any subset; a field set to `null` is cleared. */
17
+ export const profileUpdateRequestSchema = Type.Object({
18
+ email: Type.Optional(Nullable(Type.String())),
19
+ /** Echoed verbatim in the events this mutation produces. */
20
+ mutationId: Type.Optional(mutationIdSchema),
21
+ name: Type.Optional(Nullable(Type.String())),
22
+ });
23
+ //# sourceMappingURL=profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.js","sourceRoot":"","sources":["../../sources/protocol/profile.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAEhG,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEjG,sFAAsF;AACtF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