rpi-tools 0.35.0

Built-in agent tools (read/write/edit/bash/powershell) + ExecutionEnv, Rust port of pi harness tools
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
//! Mirrors `packages/agent/src/harness/types.ts::ExecutionEnv` โ€” the trait every
//! tool and test-double implements. `ExecutionEnv = FileSystem + Shell`.
//!
//! Contract (plan ยง5.13): **every method must never panic.** All failures are
//! encoded in `Result<_, FileError>` / `Result<_, ExecutionError>`. Paths may be
//! absolute or relative to [`FileSystem::cwd`]; returned paths are "addressed"
//! (symlink-canonicalized only by [`FileSystem::canonical_path`]).
//!
//! The TS `AbortSignal` becomes `&tokio_util::sync::CancellationToken` on every
//! method. Backends SHOULD check `is_cancelled()` at entry and honor cooperative
//! cancellation during blocking ops via `tokio::select!`.

use std::collections::HashMap;
use std::fs::Metadata;
use std::path::{Path, PathBuf};
use std::sync::Arc;

use async_trait::async_trait;
use tokio_util::sync::CancellationToken;

use crate::error::{ExecutionError, FileError, FileErrorCode};

/// `file` | `directory` | `symlink`. Mirrors TS `FileKind`.
///
/// File information describes the addressed entry. Native content reads and
/// writes follow symlinks, and `canonical_path` resolves their targets.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum FileKind {
    File,
    Directory,
    Symlink,
}

/// Mirrors TS `FileInfo`. `path` is the absolute addressed (resolved) path โ€”
/// NOT symlink-canonicalized. `mtime_ms` is ms since Unix epoch.
#[derive(Debug, Clone)]
pub struct FileInfo {
    pub name: String,
    pub path: PathBuf,
    pub kind: FileKind,
    pub size: u64,
    pub mtime_ms: i64,
}

/// Write/append payload. Mirrors the TS `string | Uint8Array` union.
#[derive(Debug, Clone)]
pub enum FileContent {
    Text(String),
    Bytes(Vec<u8>),
}

impl FileContent {
    pub fn as_bytes(&self) -> &[u8] {
        match self {
            FileContent::Text(s) => s.as_bytes(),
            FileContent::Bytes(b) => b,
        }
    }
}

impl From<String> for FileContent {
    fn from(s: String) -> Self {
        FileContent::Text(s)
    }
}

impl From<&str> for FileContent {
    fn from(s: &str) -> Self {
        FileContent::Text(s.to_string())
    }
}

impl From<Vec<u8>> for FileContent {
    fn from(b: Vec<u8>) -> Self {
        FileContent::Bytes(b)
    }
}

/// Result of `Shell::exec`. Mirrors the TS inline return type
/// `{ stdout, stderr, exitCode }`. Signal kills collapse to `exit_code: 0`
/// (matching the TS `code ?? 0` rule).
#[derive(Debug, Clone)]
pub struct ShellOutput {
    pub stdout: String,
    pub stderr: String,
    pub exit_code: i32,
}

/// Mirrors TS `ShellExecOptions` (note: `timeout` is in **seconds**, matching
/// the TS contract). `on_stdout` / `on_stderr` fire per chunk, interleaved in
/// arrival order; the bash-tool wraps these with throttling + capture.
#[derive(Clone, Debug)]
pub struct ShellOverride {
    pub program: PathBuf,
    pub args: Vec<String>,
}

pub struct ShellExecOptions<'a> {
    /// Optional executable and fixed arguments. `None` keeps the environment's
    /// default shell (Bash on POSIX/Windows), while tools such as PowerShell
    /// can select their native interpreter without going through Bash.
    pub shell: Option<ShellOverride>,
    pub cwd: Option<PathBuf>,
    pub env: Option<HashMap<String, String>>,
    /// Default `true`. When `false`, ONLY `env` is used (no process env, no
    /// shell base env).
    pub inherit_env: bool,
    /// Seconds. `None` = no timeout.
    pub timeout: Option<f64>,
    pub cancel: Option<&'a CancellationToken>,
    pub on_stdout: Option<Box<dyn FnMut(&str) + Send + 'a>>,
    pub on_stderr: Option<Box<dyn FnMut(&str) + Send + 'a>>,
}

impl<'a> Default for ShellExecOptions<'a> {
    fn default() -> Self {
        Self {
            shell: None,
            cwd: None,
            env: None,
            inherit_env: true,
            timeout: None,
            cancel: None,
            on_stdout: None,
            on_stderr: None,
        }
    }
}

impl<'a> ShellExecOptions<'a> {
    pub fn new() -> Self {
        Self::default()
    }
}

/// A process-local capability proving exclusive ownership of a file-backed
/// writer. Backends that cannot provide an OS/process boundary return `None`
/// from [`FileSystem::try_acquire_writer_lease`]; those backends retain their
/// existing in-process semantics and must not be described as cross-process
/// fenced.
///
/// A backend may also persist a monotonic fence value in the lease record and
/// verify it before a mutation. This is an additional stale-binding check, not
/// by itself a complete crash/fencing proof.
pub trait WriterLease: Send + Sync {
    fn verify_fence(&self) -> Result<(), FileError> {
        Ok(())
    }
}

/// A completed append range bound to the file generation actually written.
/// The reader remains valid if the journal path is subsequently replaced.
#[derive(Clone)]
pub struct AppendReceipt {
    pub reader: Arc<dyn ReadFile>,
    pub offset: u64,
    pub length: usize,
}

/// Physical file metadata captured on the same native handle immediately
/// before and after a successful append.
pub struct NativeAppendMetadata {
    pub before: Metadata,
    pub after: Metadata,
}

/// An optional, single-owner append capability for a journal.
#[async_trait]
pub trait AppendFile: Send + Sync {
    /// Append and finish the write before acknowledging it. This is the same
    /// visibility boundary as `FileSystem::append_file`, not a power-loss fsync.
    async fn append(&mut self, bytes: &[u8]) -> Result<(), FileError>;

    /// Append with an optional stable-generation range. Missing read permission
    /// or receipt support must not turn a successful append into a failure.
    async fn append_with_receipt(
        &mut self,
        bytes: &[u8],
    ) -> Result<Option<AppendReceipt>, FileError> {
        self.append(bytes).await?;
        Ok(None)
    }

    /// Append with optional native handle metadata for a derived index.
    async fn append_with_native_metadata(
        &mut self,
        bytes: &[u8],
    ) -> Result<(Option<AppendReceipt>, Option<NativeAppendMetadata>), FileError> {
        Ok((self.append_with_receipt(bytes).await?, None))
    }
}

/// Read capability bound to one opened file, even if its path is replaced.
/// Implementations serialize cursor access and return errors on short ranges.
#[async_trait]
pub trait ReadFile: Send + Sync {
    async fn read_all(&self) -> Result<Vec<u8>, FileError>;
    async fn read_range(&self, offset: u64, length: usize) -> Result<Vec<u8>, FileError>;

    /// Metadata of the opened native handle, when available.
    fn native_metadata(&self) -> Option<Metadata> {
        None
    }

    /// Current byte length of this opened generation, when supported. This is
    /// not a snapshot: later appends or truncation may change the length.
    async fn byte_len(&self) -> Result<Option<u64>, FileError> {
        Ok(None)
    }
}

/// Mirrors TS `FileSystem`. All methods async, never panic.
/// Backends should check cancellation at entry and during long operations.
#[async_trait]
pub trait FileSystem: Send + Sync {
    /// The environment's working directory (absolute).
    fn cwd(&self) -> &Path;

    /// Resolve a host path when this backend explicitly permits native I/O.
    /// Abstract and restricted backends do not grant this capability.
    fn native_file_path(&self, _path: &str) -> Option<PathBuf> {
        None
    }

    /// Resolve `path` (relative-to-cwd, `~`, `file://`, absolute) to an absolute
    /// addressed path. Pure โ€” no FS access, no abort. Mirrors TS `absolutePath`.
    async fn absolute_path(
        &self,
        path: &str,
        cancel: Option<&CancellationToken>,
    ) -> Result<PathBuf, FileError>;

    /// Join path components. Pure. Mirrors TS `joinPath`.
    async fn join_path(
        &self,
        parts: &[&str],
        cancel: Option<&CancellationToken>,
    ) -> Result<PathBuf, FileError>;

    async fn read_text_file(
        &self,
        path: &str,
        cancel: Option<&CancellationToken>,
    ) -> Result<String, FileError>;

    /// Read complete UTF-8 text if it fits in `max_bytes`. A larger file
    /// yields `None`. The compatibility default checks the reported size and
    /// then the returned text. Native backends can cap the underlying read.
    async fn read_text_file_bounded(
        &self,
        path: &str,
        max_bytes: usize,
        cancel: Option<&CancellationToken>,
    ) -> Result<Option<String>, FileError> {
        check_cancel_file(cancel, Some(path))?;
        if self.file_info(path, cancel).await?.size > max_bytes as u64 {
            return Ok(None);
        }
        let text = self.read_text_file(path, cancel).await?;
        Ok((text.len() <= max_bytes).then_some(text))
    }

    /// Stream-read up to `max_lines` lines (split on `\n`; `max_lines <= 0`
    /// โ†’ empty). Mirrors TS `readTextLines{maxLines}`.
    async fn read_text_lines(
        &self,
        path: &str,
        max_lines: Option<usize>,
        cancel: Option<&CancellationToken>,
    ) -> Result<Vec<String>, FileError>;

    async fn read_binary_file(
        &self,
        path: &str,
        cancel: Option<&CancellationToken>,
    ) -> Result<Vec<u8>, FileError>;

    /// Creates parent directories (recursive) automatically. Mirrors TS
    /// `writeFile`.
    async fn write_file(
        &self,
        path: &str,
        content: FileContent,
        cancel: Option<&CancellationToken>,
    ) -> Result<(), FileError>;

    /// Atomically create an absent file and write its initial contents, never
    /// following or replacing an existing final path. The parent must already
    /// exist; this capability does not create directories or prove durability.
    ///
    /// Unsupported backends fail closed rather than emulating this with an
    /// existence check plus truncating write. Cancellation/error after creation
    /// may leave a partial new file; never unlink or overwrite it on retry.
    async fn write_new_file(
        &self,
        path: &str,
        _content: FileContent,
        _cancel: Option<&CancellationToken>,
    ) -> Result<(), FileError> {
        Err(FileError::new(
            FileErrorCode::NotSupported,
            "exclusive file creation is unsupported",
        )
        .with_path(path))
    }

    async fn append_file(
        &self,
        path: &str,
        content: FileContent,
        cancel: Option<&CancellationToken>,
    ) -> Result<(), FileError>;

    /// Optional reusable append handle for a single-owner journal. Backends
    /// without this capability keep the existing per-call append path.
    async fn open_append_file(
        &self,
        _path: &str,
    ) -> Result<Option<Box<dyn AppendFile>>, FileError> {
        Ok(None)
    }

    /// Try to acquire an exclusive writer lease for one addressed journal.
    ///
    /// `Some` is a held capability whose lifetime owns the backend lock;
    /// `None` means this backend has no process-level lease primitive (for
    /// example the in-memory test backend). Contention is an error, not a
    /// successful `None`, so callers fail closed when a real backend refuses
    /// ownership.
    async fn try_acquire_writer_lease(
        &self,
        _path: &str,
    ) -> Result<Option<Box<dyn WriterLease>>, FileError> {
        Ok(None)
    }

    /// Flush a staged file's contents through the backend's durability boundary.
    /// The default is a deliberate no-op for memory/Faux backends; callers must
    /// not treat it as evidence of physical persistence.
    async fn sync_file(
        &self,
        _path: &str,
        _data_only: bool,
        _cancel: Option<&CancellationToken>,
    ) -> Result<(), FileError> {
        Ok(())
    }

    /// Flush the directory metadata needed to make a completed rename durable.
    /// The default is a deliberate no-op for backends without physical files.
    async fn sync_directory(
        &self,
        _path: &str,
        _cancel: Option<&CancellationToken>,
    ) -> Result<(), FileError> {
        Ok(())
    }

    /// Sync a regular journal file and its containing directory through an
    /// explicitly supported physical persistence boundary. Unlike `sync_file`
    /// and `sync_directory`, the compatibility default fails closed: their
    /// no-op defaults are not evidence that a journal survived a crash.
    ///
    /// The caller must own the journal writer and keep the addressed file and
    /// parent stable. This does not sync newly-created ancestor directories,
    /// progress companions, or protect against writers bypassing ownership.
    async fn sync_file_and_parent(
        &self,
        path: &str,
        _cancel: Option<&CancellationToken>,
    ) -> Result<(), FileError> {
        Err(FileError::new(
            FileErrorCode::NotSupported,
            "physical journal synchronization is unsupported",
        )
        .with_path(path))
    }

    /// Optional stable-generation reader. Unsupported backends retain eager
    /// history loading; an actual open failure must be returned, not hidden.
    async fn open_read_file(
        &self,
        _path: &str,
    ) -> Result<Option<std::sync::Arc<dyn ReadFile>>, FileError> {
        Ok(None)
    }

    /// Cut the file at `path` back to `len` bytes, discarding a tail that a
    /// failed append left behind. It never grows a file. Backends without it
    /// fail, so a caller cannot take a tail for clean when it was not cut.
    async fn truncate_file(
        &self,
        path: &str,
        len: u64,
        cancel: Option<&CancellationToken>,
    ) -> Result<(), FileError> {
        let _ = (len, cancel);
        Err(FileError::new(
            FileErrorCode::NotSupported,
            "file truncation is unavailable",
        )
        .with_path(path))
    }

    async fn rename_file(
        &self,
        source: &str,
        dest: &str,
        cancel: Option<&CancellationToken>,
    ) -> Result<(), FileError>;

    /// Uses `symlink_metadata` (lstat โ€” symlinks not followed). Mirrors TS
    /// `fileInfo`.
    async fn file_info(
        &self,
        path: &str,
        cancel: Option<&CancellationToken>,
    ) -> Result<FileInfo, FileError>;

    async fn list_dir(
        &self,
        path: &str,
        cancel: Option<&CancellationToken>,
    ) -> Result<Vec<FileInfo>, FileError>;

    /// Whether a directory contains a file or symlink whose name ends with
    /// `suffix`. Does not follow symlinks and does not cache negative results.
    /// Backends may avoid collecting unrelated entries' sizes/timestamps.
    /// The default preserves compatibility with existing filesystem adapters.
    async fn has_file_with_suffix(
        &self,
        path: &str,
        suffix: &str,
        cancel: Option<&CancellationToken>,
    ) -> Result<bool, FileError> {
        check_cancel_file(cancel, Some(path))?;
        let entries = self.list_dir(path, cancel).await?;
        check_cancel_file(cancel, Some(path))?;
        Ok(entries
            .iter()
            .any(|entry| entry.kind != FileKind::Directory && entry.name.ends_with(suffix)))
    }

    /// Follows symlinks (`canonicalize`). Mirrors TS `canonicalPath`. Backends
    /// may return `not_found` for a missing path or `not_supported` if they
    /// cannot resolve canonical paths.
    async fn canonical_path(
        &self,
        path: &str,
        cancel: Option<&CancellationToken>,
    ) -> Result<PathBuf, FileError>;

    /// `false` ONLY for `not_found`; other errors propagate. Mirrors TS
    /// `exists` (which delegates to `fileInfo`, NOT `access(F_OK)`).
    async fn exists(
        &self,
        path: &str,
        cancel: Option<&CancellationToken>,
    ) -> Result<bool, FileError>;

    /// Default `recursive=true`. Mirrors TS `createDir{recursive}`.
    async fn create_dir(
        &self,
        path: &str,
        recursive: bool,
        cancel: Option<&CancellationToken>,
    ) -> Result<(), FileError>;

    /// Defaults `recursive=false`, `force=false`. Mirrors TS `remove`.
    async fn remove(
        &self,
        path: &str,
        recursive: bool,
        force: bool,
        cancel: Option<&CancellationToken>,
    ) -> Result<(), FileError>;

    /// Default prefix `"tmp-"`. Mirrors TS `createTempDir{prefix}`.
    async fn create_temp_dir(
        &self,
        prefix: Option<&str>,
        cancel: Option<&CancellationToken>,
    ) -> Result<PathBuf, FileError>;

    /// Mirrors TS `createTempFile{prefix,suffix}` (defaults empty). Note: the
    /// TS impl creates an isolated temp **dir** per file; backends may simplify
    /// to a single file in the OS temp dir (document any divergence).
    async fn create_temp_file(
        &self,
        prefix: &str,
        suffix: &str,
        cancel: Option<&CancellationToken>,
    ) -> Result<PathBuf, FileError>;

    /// Best-effort, never returns `Err`. Mirrors TS `cleanup` (kills tracked
    /// child processes, etc.).
    async fn cleanup(&self);
}

/// Mirrors TS `Shell`.
#[async_trait]
pub trait Shell: Send + Sync {
    /// Execute `command` in a bash shell. The TS env resolves a bash binary
    /// (git-bash on Windows, `/bin/bash` on POSIX, `/bin/sh` fallback on POSIX).
    /// There is NO cmd.exe fallback on Windows โ€” failure to find bash is
    /// `ExecutionError::ShellUnavailable`.
    async fn exec<'a>(
        &'a self,
        command: &str,
        options: ShellExecOptions<'a>,
    ) -> Result<ShellOutput, ExecutionError>;

    /// Stream merged stdout and stderr in delivery order and return the exit
    /// code. Native backends can feed the bounded channel directly without
    /// accumulating the output in `ShellOutput`. The default adapts existing
    /// synchronous callbacks so custom backends can keep implementing `exec`.
    async fn exec_streamed<'a>(
        &'a self,
        command: &str,
        mut options: ShellExecOptions<'a>,
        output: tokio::sync::mpsc::Sender<String>,
    ) -> Result<i32, ExecutionError> {
        let (sender, mut receiver) = tokio::sync::mpsc::unbounded_channel();
        for callback in [&mut options.on_stdout, &mut options.on_stderr] {
            let sender = sender.clone();
            let mut previous = callback.take();
            *callback = Some(Box::new(move |text| {
                if let Some(callback) = previous.as_mut() {
                    callback(text);
                }
                let _ = sender.send(text.to_owned());
            }));
        }
        drop(sender);

        let forward = async move {
            while let Some(text) = receiver.recv().await {
                if output.send(text).await.is_err() {
                    break;
                }
            }
        };
        let (result, ()) = tokio::join!(self.exec(command, options), forward);
        result.map(|output| output.exit_code)
    }

    /// Best-effort, never returns `Err`. Mirrors TS `Shell.cleanup`.
    async fn cleanup(&self);
}

/// Mirrors TS `ExecutionEnv extends FileSystem, Shell`. A marker combining both
/// capabilities โ€” tools receive `Arc<dyn ExecutionEnv>` (or a concrete env) and
/// use `FileSystem` + `Shell` methods interchangeably.
#[async_trait]
pub trait ExecutionEnv: FileSystem + Shell {}

/// Check `cancel` at a method entry point, returning `FileError::aborted()`
/// when set. Mirrors the TS `abortResult<T>(signal, path?)` helper used at the
/// top of every `FileSystem` method.
pub fn check_cancel_file(
    cancel: Option<&CancellationToken>,
    path: Option<&str>,
) -> Result<(), FileError> {
    if let Some(t) = cancel {
        if t.is_cancelled() {
            let mut err = FileError::aborted();
            if let Some(p) = path {
                err = err.with_path(p);
            }
            return Err(err);
        }
    }
    Ok(())
}

/// Same as [`check_cancel_file`] but for `Shell`-side (returns
/// `ExecutionError::aborted()`).
pub fn check_cancel_exec(cancel: Option<&CancellationToken>) -> Result<(), ExecutionError> {
    if let Some(t) = cancel {
        if t.is_cancelled() {
            return Err(ExecutionError::aborted());
        }
    }
    Ok(())
}

#[cfg(test)]
mod capability_tests {
    use super::*;

    // Deliberately implement only the original required methods. These doubles
    // guard source compatibility as well as dispatch through the trait object.
    #[derive(Default)]
    struct LegacyAppender(Vec<u8>);

    #[async_trait]
    impl AppendFile for LegacyAppender {
        async fn append(&mut self, bytes: &[u8]) -> Result<(), FileError> {
            self.0.extend_from_slice(bytes);
            Ok(())
        }
    }

    struct LegacyReader;

    #[async_trait]
    impl ReadFile for LegacyReader {
        async fn read_all(&self) -> Result<Vec<u8>, FileError> {
            Ok(b"legacy".to_vec())
        }

        async fn read_range(&self, _offset: u64, _length: usize) -> Result<Vec<u8>, FileError> {
            Err(FileError::new(FileErrorCode::NotSupported, "legacy reader"))
        }
    }

    #[tokio::test]
    async fn legacy_capabilities_keep_their_default_behavior() {
        let mut writer = LegacyAppender::default();
        let appender: &mut dyn AppendFile = &mut writer;
        assert!(appender
            .append_with_receipt(b"frame\n")
            .await
            .unwrap()
            .is_none());
        assert_eq!(writer.0, b"frame\n");
        let reader: Arc<dyn ReadFile> = Arc::new(LegacyReader);
        assert_eq!(reader.byte_len().await.unwrap(), None);
        assert_eq!(reader.read_all().await.unwrap(), b"legacy");
    }

    #[tokio::test]
    async fn default_receipt_method_preserves_append_errors() {
        struct FailingAppender;
        #[async_trait]
        impl AppendFile for FailingAppender {
            async fn append(&mut self, _bytes: &[u8]) -> Result<(), FileError> {
                Err(FileError::new(FileErrorCode::Unknown, "append failed"))
            }
        }
        assert!(FailingAppender.append_with_receipt(b"frame").await.is_err());
    }
}