Complete three overdue cleanups discovered during macOS health check: D-56 daemon dissolution: delete bin/clide.dart, DaemonServer, and orphaned tests (test/cli/, subprocess_test, in_process_test). Update stale "clide --daemon" references in i18n catalogs, error messages, editor_commands, CI scripts, and decision records. ptyc retirement: delete ptyc/ source tree, PtySession, scm_rights. Remove from Toolchain resolution, ToolCheck gate, backend serialization, testmode harness, Makefile, CI, and sandbox entitlements. PTY spawning uses NativePty (Dart FFI forkpty) since the terminal was absorbed in-tree. D-5 amended. Golden tests: wire the existing but never-applied clideGoldenConfig via flutter_test_config.dart. Disable CI goldens (Skia anti-aliasing differs between macOS/Linux even with Ahem). Keep platform-keyed goldens only — goldens/linux/ and goldens/macos/ each run on their own OS. Test suite: 826 pass, 0 fail on macOS (was 829 pass, 11 fail). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
59 lines
1.5 KiB
Dart
59 lines
1.5 KiB
Dart
/// A single active pane. Pure data — no PTY coupling so this type
|
|
/// travels cleanly into the Flutter app (which can't depend on
|
|
/// `dart:ffi`-using code for the web build).
|
|
///
|
|
/// [PaneRegistry] keeps a parallel [NativePty] keyed on [id] and
|
|
/// mutates [isClosed] when the session exits.
|
|
library;
|
|
|
|
/// Kind of a pane. Keep this enum small and explicit — each kind
|
|
/// typically pairs with a bundled extension that manages its
|
|
/// lifecycle (`builtin.terminal`, `builtin.claude`).
|
|
enum PaneKind {
|
|
terminal,
|
|
claude;
|
|
|
|
String get wire => name;
|
|
|
|
static PaneKind parse(String s) {
|
|
return PaneKind.values.firstWhere(
|
|
(v) => v.wire == s,
|
|
orElse: () => throw ArgumentError.value(s, 'kind', 'unknown pane kind'),
|
|
);
|
|
}
|
|
}
|
|
|
|
class Pane {
|
|
Pane({
|
|
required this.id,
|
|
required this.kind,
|
|
required this.pid,
|
|
required this.argv,
|
|
this.cwd,
|
|
this.title,
|
|
this.isClosed = false,
|
|
});
|
|
|
|
final String id;
|
|
final PaneKind kind;
|
|
final int pid;
|
|
final List<String> argv;
|
|
final String? cwd;
|
|
final String? title;
|
|
|
|
/// Mutated by the registry when the child exits or the session
|
|
/// closes. Kept mutable so registry state doesn't need to replace
|
|
/// [Pane] instances on transition.
|
|
bool isClosed;
|
|
|
|
Map<String, Object?> toJson() => {
|
|
'id': id,
|
|
'kind': kind.wire,
|
|
'pid': pid,
|
|
'argv': argv,
|
|
if (cwd != null) 'cwd': cwd,
|
|
if (title != null) 'title': title,
|
|
'closed': isClosed,
|
|
};
|
|
}
|