@yaag/runtime 0.26.0 → 0.28.1

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 (66) hide show
  1. package/package.json +1 -1
  2. package/src/agent/agent-name.ts +22 -0
  3. package/src/agent/agent-names.ts +5 -1
  4. package/src/agent/agent.ts +34 -17
  5. package/src/agent/define-agent.ts +4 -0
  6. package/src/agent/fork.ts +50 -12
  7. package/src/agent/host-fork.ts +85 -0
  8. package/src/agent/index.ts +1 -0
  9. package/src/agent/spawn-definition-request.ts +41 -6
  10. package/src/agent/spawn-open.ts +54 -107
  11. package/src/agent/spawn-parent.ts +64 -0
  12. package/src/agent/spawn-plan.ts +120 -0
  13. package/src/agent/spawn-request.ts +26 -6
  14. package/src/agent/spawn.ts +47 -6
  15. package/src/ask/ask-exchange-options.ts +3 -6
  16. package/src/ask/ask-exchange.ts +48 -108
  17. package/src/ask/ask-guard.ts +207 -0
  18. package/src/ask/ask-timing.ts +12 -0
  19. package/src/ask/index.ts +1 -0
  20. package/src/cassette/cassette-loader.ts +9 -20
  21. package/src/cassette/cassette-schema.ts +11 -1
  22. package/src/cassette/cassette.ts +16 -34
  23. package/src/cassette/checkpoint.ts +306 -0
  24. package/src/cassette/index.ts +16 -7
  25. package/src/cassette/parked-asks.ts +38 -0
  26. package/src/cassette/replay-divergence.ts +7 -102
  27. package/src/cassette/resume-identity.ts +5 -1
  28. package/src/cassette/resume-preconditions.ts +14 -0
  29. package/src/cassette/resume-transport.ts +26 -32
  30. package/src/cassette/run-identity.ts +109 -0
  31. package/src/cassette/session-answer.ts +51 -114
  32. package/src/cassette/spawn-identity.ts +328 -0
  33. package/src/contract/error-codes.ts +4 -0
  34. package/src/contract/group.ts +38 -0
  35. package/src/contract/index.ts +2 -0
  36. package/src/contract/spawn-options.ts +48 -7
  37. package/src/error-factories.ts +8 -0
  38. package/src/events.ts +22 -2
  39. package/src/index.ts +7 -0
  40. package/src/pi-session/append-tool-result.ts +165 -0
  41. package/src/pi-session/index.ts +30 -0
  42. package/src/pi-session/pi-session-error.ts +34 -0
  43. package/src/pi-session/session-copy.ts +113 -0
  44. package/src/pi-session/session-entries.ts +130 -0
  45. package/src/public-api.ts +2 -0
  46. package/src/question-summary/index.ts +4 -8
  47. package/src/question-summary/summarize-question.ts +1 -1
  48. package/src/question-summary/summary-policy.ts +5 -2
  49. package/src/run/agent-questions.ts +82 -0
  50. package/src/run/answers.ts +22 -1
  51. package/src/run/groups.ts +111 -0
  52. package/src/run/host-session.ts +233 -0
  53. package/src/run/index.ts +8 -0
  54. package/src/run/run-context.ts +15 -0
  55. package/src/run/run.ts +208 -182
  56. package/src/summary/index.ts +1 -0
  57. package/src/summary/summary-agent.ts +6 -0
  58. package/src/summary/summary-group.ts +31 -0
  59. package/src/summary/summary.ts +12 -0
  60. package/src/transport/live-transport.ts +19 -0
  61. package/src/transport/pi-state.ts +10 -1
  62. package/src/transport/transport.ts +20 -9
  63. package/src/types.ts +3 -0
  64. package/src/cassette/checkpoint-flush.ts +0 -101
  65. package/src/cassette/run-checkpoint.ts +0 -272
  66. package/src/question-summary/session-copy.ts +0 -169
@@ -5,8 +5,9 @@
5
5
  * what an earlier resume already resolved. Every refusal happens here, at
6
6
  * construction, before the first Agent starts.
7
7
  */
8
- import type { CassetteAnswer, CassetteQuestion } from "../cassette/index.ts";
8
+ import type { CassetteAnswer, CassetteQuestion, ParkedAsk } from "../cassette/index.ts";
9
9
  import { YaagError } from "../errors.ts";
10
+ import type { Question } from "./questions.ts";
10
11
 
11
12
  /** What one resume knows about its answers. */
12
13
  export interface AnswerLedger {
@@ -14,6 +15,12 @@ export interface AnswerLedger {
14
15
  take(id: string): string | undefined;
15
16
  /** Every resolved step the successor Cassette must carry. */
16
17
  resolved(): readonly CassetteAnswer[];
18
+ /**
19
+ * The Questions of the resume source that no answer resolves. They are the
20
+ * Questions of this resume: id, text, context and Question Summary come from
21
+ * the run block, not from the recorded frames (ADR-0022).
22
+ */
23
+ open(): readonly Question[];
17
24
  }
18
25
 
19
26
  export interface AnswerLedgerOptions {
@@ -23,6 +30,8 @@ export interface AnswerLedgerOptions {
23
30
  readonly questions: readonly CassetteQuestion[];
24
31
  /** The answers the resume source already resolved. */
25
32
  readonly inherited: readonly CassetteAnswer[];
33
+ /** The incomplete-Ask markers of the resume source (ADR-0023). */
34
+ readonly parked?: readonly ParkedAsk[];
26
35
  }
27
36
 
28
37
  /**
@@ -54,6 +63,15 @@ export function createAnswerLedger(options: AnswerLedgerOptions): AnswerLedger {
54
63
  }
55
64
  resolved.set(id, answer);
56
65
  }
66
+ for (const mark of options.parked ?? []) {
67
+ if (open.has(mark.questionId) || resolved.has(mark.questionId)) continue;
68
+ throw new YaagError(
69
+ "RESUME_REFUSED",
70
+ `the checkpoint records agent "${mark.agent}" parked on question ` +
71
+ `"${mark.questionId}", and its run block holds no such question — ` +
72
+ "the checkpoint is incomplete",
73
+ );
74
+ }
57
75
  return {
58
76
  take(id: string): string | undefined {
59
77
  return resolved.get(id);
@@ -61,6 +79,9 @@ export function createAnswerLedger(options: AnswerLedgerOptions): AnswerLedger {
61
79
  resolved(): readonly CassetteAnswer[] {
62
80
  return [...resolved].map(([id, answer]) => ({ id, answer }));
63
81
  },
82
+ open(): readonly Question[] {
83
+ return options.questions.filter((question) => !resolved.has(question.id));
84
+ },
64
85
  };
65
86
  }
66
87
 
@@ -0,0 +1,111 @@
1
+ /**
2
+ * The Groups one Run opened (ADR-0070).
3
+ *
4
+ * A Group is a tree position with no process: it opens, it never closes, and it
5
+ * emits one `group_open` event. The registry keeps the sibling names, so a
6
+ * repeat name under one parent is refused, and a root Group's name is reserved
7
+ * in the Run-unique Agent-name set, so a root Group path can never collide with
8
+ * a Group under an Agent of the same name.
9
+ *
10
+ * Its dependencies are injected rather than imported, so this file stays pure
11
+ * and it adds no `run/` to `agent/` import.
12
+ */
13
+
14
+ import type { Group, GroupOptions } from "../contract/index.ts";
15
+ import { YaagError } from "../errors.ts";
16
+ import type { EventSink } from "../events.ts";
17
+
18
+ /** The parent key of a root Group. A symbol, so no name can collide with it. */
19
+ const ROOT = Symbol("root");
20
+
21
+ export interface GroupRegistry {
22
+ /** The `ctx.group` implementation; synchronous by contract. */
23
+ readonly group: (options: GroupOptions) => Group;
24
+ /** True for a Group this registry made. */
25
+ readonly holds: (value: unknown) => value is Group;
26
+ }
27
+
28
+ export interface GroupDependencies {
29
+ readonly emit: EventSink;
30
+ /** Throws RUN_CLOSED once the spawn gate closed; the same gate a spawn reads. */
31
+ readonly assertOpen: () => void;
32
+ /** The shared Handle lookup: an Agent name, or the frozen TypeError. */
33
+ readonly resolveAgentParent: (parent: unknown) => string | undefined;
34
+ /** True when an Agent or a root Group of this Run already holds the name. */
35
+ readonly hasName: (name: string) => boolean;
36
+ /** Reserves a root Group name in the Run-unique Agent-name set. */
37
+ readonly reserveName: (name: string) => void;
38
+ }
39
+
40
+ /** Builds the Run-scoped Group registry behind `ctx.group`. */
41
+ export function createGroups(deps: GroupDependencies): GroupRegistry {
42
+ const mine = new Set<Group>();
43
+ const siblings = new Map<object | typeof ROOT, Set<string>>();
44
+ const holds = (value: unknown): value is Group => mine.has(value as Group);
45
+
46
+ const group = (options: GroupOptions): Group => {
47
+ deps.assertOpen();
48
+ const name = options.name;
49
+ if (name === "" || name.includes("/") || name.includes(":")) {
50
+ throw new YaagError(
51
+ "GROUP_NAME_INVALID",
52
+ `group name "${name}" is invalid: a name must not be empty and must not contain "/" or ":"`,
53
+ );
54
+ }
55
+ const parent = options.parent;
56
+ // A Group of this Run is a position. Everything else goes to the Handle
57
+ // lookup, which refuses a foreign value the same way a spawn refuses it.
58
+ const parentGroup = holds(parent) ? parent : undefined;
59
+ const agent = parentGroup === undefined ? deps.resolveAgentParent(parent) : undefined;
60
+
61
+ const key: object | typeof ROOT = parentGroup ?? parent ?? ROOT;
62
+ const taken = siblings.get(key) ?? new Set<string>();
63
+ if (taken.has(name)) {
64
+ throw new YaagError(
65
+ "GROUP_EXISTS",
66
+ `group "${name}" is already open under ${parentLabel(parentGroup, agent)}`,
67
+ );
68
+ }
69
+ const isRoot = parentGroup === undefined && agent === undefined;
70
+ if (isRoot && deps.hasName(name)) {
71
+ throw new YaagError(
72
+ "GROUP_EXISTS",
73
+ `group "${name}" is already open: agent "${name}" holds that name`,
74
+ );
75
+ }
76
+ // A root name lands in both sets on purpose: the sibling set alone answers a
77
+ // repeat root Group with its own message, so the two GROUP_EXISTS messages
78
+ // stay distinct, and the Agent-name set makes a later spawn take a suffix.
79
+ taken.add(name);
80
+ siblings.set(key, taken);
81
+ if (isRoot) deps.reserveName(name);
82
+
83
+ // A Group under an Agent starts its chain with the Agent name, so no two
84
+ // Groups of one Run share a path. `group_open.parent` still names the Agent,
85
+ // so a reader never parses the path (ADR-0070, amended 2026-09-11).
86
+ const path =
87
+ parentGroup !== undefined
88
+ ? `${parentGroup.path}/${name}`
89
+ : agent === undefined
90
+ ? name
91
+ : `${agent}/${name}`;
92
+ // The one documented cast, as `host-session.ts` brands a HostSource.
93
+ const value = { kind: "group", name, path } as Group;
94
+ mine.add(value);
95
+ deps.emit({
96
+ type: "group_open",
97
+ path,
98
+ name,
99
+ ...(agent === undefined ? {} : { parent: agent }),
100
+ });
101
+ return value;
102
+ };
103
+
104
+ return { group, holds };
105
+ }
106
+
107
+ function parentLabel(parentGroup: Group | undefined, agent: string | undefined): string {
108
+ if (parentGroup !== undefined) return `group "${parentGroup.path}"`;
109
+ if (agent !== undefined) return `agent "${agent}"`;
110
+ return "the run";
111
+ }
@@ -0,0 +1,233 @@
1
+ /**
2
+ * The Host Session file this Run was given: the pre-flight, the hash, and the
3
+ * one copy a Host Fork is spawned from.
4
+ *
5
+ * The pre-flight exists to pre-empt pi's own `SessionManager.forkFrom`, which
6
+ * throws inside the child — a `SPAWN_FAILED` far away from the cause. So a Run
7
+ * refuses a missing, unreadable, empty, header-less or ill-formed Host Session
8
+ * before it starts, and before it emits any Lifecycle Event.
9
+ *
10
+ * The hash is taken over the source bytes as read, before any append, so a
11
+ * replay can hash without copying and two Runs over one unchanged file agree.
12
+ */
13
+ import { sha256Hex } from "../cassette/index.ts";
14
+ import type { HostSource } from "../contract/index.ts";
15
+ import { hostSessionUnusableError } from "../error-factories.ts";
16
+ import type { YaagError } from "../errors.ts";
17
+ import {
18
+ findToolCall,
19
+ isPiSessionError,
20
+ isRecord,
21
+ parseSession,
22
+ prepareSessionCopy,
23
+ type SessionCopy,
24
+ } from "../pi-session/index.ts";
25
+
26
+ /** The Host Fork orientation text, written into the copy in place of the human's result. */
27
+ export const HOST_FORK_TOOL_RESULT_TEXT =
28
+ "yaag started a Run from this point. This session is a copy of the human's session. " +
29
+ "You are an Agent of that Run. Wait for the next message.";
30
+
31
+ /** What the launcher gives the Run: the Host Session file and the call that started it. */
32
+ export interface HostSessionOptions {
33
+ readonly sessionFile: string;
34
+ /** Required on a live Run, which must close that call in the copy. */
35
+ readonly toolCallId?: string;
36
+ }
37
+
38
+ /**
39
+ * The Host Source this Run resolved: the runtime shape behind the branded
40
+ * `HostSource`. The brand key is private to `contract/spawn-options.ts`, so the
41
+ * object is built here and branded with one documented cast; the spawn side
42
+ * reads these two fields to spawn the Host Fork.
43
+ */
44
+ export interface ResolvedHostSource extends HostSource {
45
+ /**
46
+ * The copy a Host Fork is spawned from. It is present only when a copy was
47
+ * made.
48
+ *
49
+ * Absent means this Run holds no copy: a strict replay, a resume with no
50
+ * tool call id, and a Host Source rebuilt from the Cassette alone. The source
51
+ * path is never put here — a spawn must never fork from it, because it would
52
+ * append to the human's live session. With no path, the spawn side refuses to
53
+ * fork instead (ADR-0068 decision 2).
54
+ */
55
+ readonly sessionFile?: string;
56
+ /** SHA-256 hex of the source bytes as read. */
57
+ readonly hostHash: string;
58
+ }
59
+
60
+ /** The prepared Host Source, plus the removal of its copy. */
61
+ export interface PreparedHostSource {
62
+ readonly source: ResolvedHostSource;
63
+ /** Removes the copy. Best effort: it never throws. */
64
+ remove(): Promise<void>;
65
+ }
66
+
67
+ /**
68
+ * What one pre-flight needs: the option, and the two Run facts that decide how
69
+ * strict it is. `live` means a `toolCallId` is required; `copies` means the copy
70
+ * is made. A strict replay does neither, so it only hashes.
71
+ */
72
+ export interface PrepareHostSourceRequest {
73
+ readonly host: HostSessionOptions;
74
+ readonly live: boolean;
75
+ readonly copies: boolean;
76
+ }
77
+
78
+ /**
79
+ * Pre-flights the Host Session, hashes it, and prepares its copy.
80
+ *
81
+ * Throws `HOST_SESSION_UNUSABLE` — and nothing else — when the file is missing,
82
+ * unreadable, empty, header-less, ill-formed, holds no such tool call, or when
83
+ * a live Run was given no `toolCallId`. It never writes to the source file.
84
+ */
85
+ export async function prepareHostSource(
86
+ request: PrepareHostSourceRequest,
87
+ ): Promise<PreparedHostSource> {
88
+ const sessionFile = request.host.sessionFile;
89
+ const bytes = await readBytes(sessionFile);
90
+ // Before the copy, so the hash names the human's file and not yaag's append.
91
+ const hostHash = sha256Hex(bytes);
92
+ const toolName = checkedToolName(sessionFile, bytes, request.host.toolCallId);
93
+ // A live Run must close that call in the copy, and it cannot find the call
94
+ // itself: a session may hold several `yaag_run` calls (ADR-0068).
95
+ if (request.live && request.host.toolCallId === undefined) {
96
+ throw hostSessionUnusableError(
97
+ sessionFile,
98
+ "no tool call id was given, and a live run must close that call in the copy",
99
+ );
100
+ }
101
+ const copy =
102
+ request.copies && request.host.toolCallId !== undefined
103
+ ? await copySession(sessionFile, request.host.toolCallId, toolName)
104
+ : undefined;
105
+ // The brand key is private to the contract, which is type-only and exports no
106
+ // factory (ADR-0045), so the one cast that builds a HostSource lives here.
107
+ const source = {
108
+ kind: "host",
109
+ ...(copy === undefined ? {} : { sessionFile: copy.path }),
110
+ hostHash,
111
+ } as ResolvedHostSource;
112
+ return { source, remove: async (): Promise<void> => await copy?.remove() };
113
+ }
114
+
115
+ /**
116
+ * The Host Source of a replay or a resume that was given no `--host-session`:
117
+ * the recorded hash, and no copy. A replay never spawns pi, and a resume
118
+ * re-opens each Host Fork from its recorded session file, so neither needs one.
119
+ */
120
+ export function adoptedHostSource(hostHash: string): ResolvedHostSource {
121
+ // The same single documented cast as above: the brand key is private to the
122
+ // contract, which exports no factory (ADR-0045).
123
+ return { kind: "host", hostHash } as ResolvedHostSource;
124
+ }
125
+
126
+ async function readBytes(sessionFile: string): Promise<ArrayBuffer> {
127
+ try {
128
+ return await Bun.file(sessionFile).arrayBuffer();
129
+ } catch (error) {
130
+ // Node reports a missing file by code; a directory or a permission failure
131
+ // arrives here too, and says so with its own message.
132
+ if (isRecord(error) && error.code === "ENOENT") {
133
+ throw hostSessionUnusableError(sessionFile, "the file does not exist");
134
+ }
135
+ throw hostSessionUnusableError(
136
+ sessionFile,
137
+ `the file cannot be read: ${error instanceof Error ? error.message : String(error)}`,
138
+ );
139
+ }
140
+ }
141
+
142
+ /**
143
+ * The tool name of the named call, which the copy records the result under.
144
+ * Checks the file-level rules the copy module does not own on the way, and
145
+ * throws the refusal of the first one that fails.
146
+ */
147
+ function checkedToolName(
148
+ sessionFile: string,
149
+ bytes: ArrayBuffer,
150
+ toolCallId: string | undefined,
151
+ ): string | undefined {
152
+ const text = new TextDecoder().decode(bytes);
153
+ if (text.trim().length === 0) throw hostSessionUnusableError(sessionFile, "the file is empty");
154
+ // The pre-flight must not be stricter than the copy it guards: it reuses the
155
+ // writer's parse policy, which tolerates one half-written last line.
156
+ assertHeader(sessionFile, text);
157
+ const entries = parse(sessionFile, text);
158
+ if (toolCallId === undefined) return undefined;
159
+ const holder = findToolCall(entries.entries, toolCallId);
160
+ if (holder === undefined) {
161
+ throw hostSessionUnusableError(sessionFile, `no entry holds the tool call ${toolCallId}`);
162
+ }
163
+ return holder.toolName;
164
+ }
165
+
166
+ function parse(sessionFile: string, text: string): ReturnType<typeof parseSession> {
167
+ try {
168
+ return parseSession(text, sessionFile);
169
+ } catch (error) {
170
+ throw refusalOf(sessionFile, error);
171
+ }
172
+ }
173
+
174
+ function assertHeader(sessionFile: string, text: string): void {
175
+ const first = text.split("\n").find((line) => line.trim().length > 0) ?? "";
176
+ let parsed: unknown;
177
+ try {
178
+ parsed = JSON.parse(first);
179
+ } catch {
180
+ throw hostSessionUnusableError(sessionFile, "the first line is no session header");
181
+ }
182
+ if (!isRecord(parsed) || parsed.type !== "session") {
183
+ throw hostSessionUnusableError(sessionFile, "the first line is no session header");
184
+ }
185
+ }
186
+
187
+ async function copySession(
188
+ sessionFile: string,
189
+ toolCallId: string,
190
+ toolName: string | undefined,
191
+ ): Promise<SessionCopy> {
192
+ try {
193
+ return await prepareSessionCopy({
194
+ sessionFile,
195
+ toolCallId,
196
+ text: HOST_FORK_TOOL_RESULT_TEXT,
197
+ ...(toolName === undefined ? {} : { toolName }),
198
+ // The `background: true` race: the human's client may answer the call
199
+ // while yaag copies, so an answered call is used as it is and never a
200
+ // refusal on this path.
201
+ toleratesAnsweredCall: true,
202
+ });
203
+ } catch (error) {
204
+ throw refusalOf(sessionFile, error);
205
+ }
206
+ }
207
+
208
+ /** Every refusal of the copy module, said in this module's one message shape. */
209
+ function refusalOf(sessionFile: string, error: unknown): YaagError {
210
+ if (!isPiSessionError(error)) {
211
+ return hostSessionUnusableError(
212
+ sessionFile,
213
+ error instanceof Error ? error.message : String(error),
214
+ );
215
+ }
216
+ switch (error.reason) {
217
+ case "unreadable":
218
+ return hostSessionUnusableError(sessionFile, "the file cannot be read");
219
+ case "bad-line":
220
+ return hostSessionUnusableError(sessionFile, badLineReason(error.message));
221
+ case "no-such-call":
222
+ return hostSessionUnusableError(sessionFile, "no entry holds the tool call");
223
+ case "different-result":
224
+ // Unreachable: this module always tolerates an answered call.
225
+ return hostSessionUnusableError(sessionFile, "the tool call is already answered");
226
+ }
227
+ }
228
+
229
+ /** The writer says which line failed; the refusal keeps that number. */
230
+ function badLineReason(message: string): string {
231
+ const line = /line (\d+)/.exec(message)?.[1];
232
+ return line === undefined ? "a line is no session entry" : `line ${line} is no session entry`;
233
+ }
package/src/run/index.ts CHANGED
@@ -11,6 +11,14 @@ export {
11
11
  type ProgramDefinition,
12
12
  programDefinition,
13
13
  } from "./define-run.ts";
14
+ export { createGroups, type GroupDependencies, type GroupRegistry } from "./groups.ts";
15
+ export {
16
+ adoptedHostSource,
17
+ HOST_FORK_TOOL_RESULT_TEXT,
18
+ type HostSessionOptions,
19
+ prepareHostSource,
20
+ type ResolvedHostSource,
21
+ } from "./host-session.ts";
14
22
  export { isPauseSignal, RunPauseSignal } from "./pause-signal.ts";
15
23
  export type { AskUserOptions, Question } from "./questions.ts";
16
24
  export { executeRun, type RunOptions } from "./run.ts";
@@ -2,7 +2,10 @@
2
2
  // declaration tree must not pull the `agent/` barrel (ADR-0045).
3
3
  import type { AgentDefinition } from "../agent/define-agent.ts";
4
4
  import type {
5
+ Group,
6
+ GroupOptions,
5
7
  Handle,
8
+ HostSource,
6
9
  SpawnableDefinition,
7
10
  SpawnOptions,
8
11
  SpawnOverrides,
@@ -28,6 +31,16 @@ export interface RunContext<Args = unknown> {
28
31
  spawn(profiled: ProfiledDefinition, overrides?: SpawnOverrides): Promise<Handle>;
29
32
  /** Last on purpose: a union-typed value, e.g. what a Catalog Resolve gave back (ADR-0053). */
30
33
  spawn(definition: SpawnableDefinition, overrides?: SpawnOverrides): Promise<Handle>;
34
+ /**
35
+ * Opens one Group of the Run tree (ADR-0070).
36
+ *
37
+ * The call is synchronous, it emits one `group_open` event, and it gives back
38
+ * a tree position, not a Handle: a Group owns no process and it never closes.
39
+ * `parent` is a Group or a Handle of this Run; absent opens a root Group. An
40
+ * empty name, or a name with `/` or `:`, fails with `GROUP_NAME_INVALID`; a
41
+ * repeat name under one parent fails with `GROUP_EXISTS`.
42
+ */
43
+ group(options: GroupOptions): Group;
31
44
  /**
32
45
  * Asks the user one question and pauses the Run (ADR-0022).
33
46
  *
@@ -50,4 +63,6 @@ export interface RunContext<Args = unknown> {
50
63
  * declares Profiles, undefined otherwise.
51
64
  */
52
65
  readonly profile?: { readonly id: string };
66
+ /** The Host Session's conversation as a fork source. Absent when the Run has none. */
67
+ readonly host?: HostSource;
53
68
  }