Repository navigation
Expand file tree
/
Copy pathglobal.d.ts
More file actions
733 lines (686 loc) · 26.1 KB
/
Copy pathglobal.d.ts
File metadata and controls
733 lines (686 loc) · 26.1 KB
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
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
/// <reference path="./types/global/netcatty-bridge-session.d.ts" />
/// <reference path="./types/global/netcatty-bridge-sftp.d.ts" />
/// <reference path="./types/global/netcatty-bridge-sync.d.ts" />
/// <reference path="./types/global/netcatty-bridge-files.d.ts" />
/// <reference path="./types/global/netcatty-bridge-ai.d.ts" />
/// <reference path="./types/global/netcatty-bridge-app.d.ts" />
/// <reference path="./types/global/netcatty-bridge-system.d.ts" />
/// <reference path="./types/global/netcatty-bridge-script.d.ts" />
declare module "*.cjs" {
const value: Record<string, unknown>;
export = value;
}
declare module 'react' {
interface InputHTMLAttributes<T> extends HTMLAttributes<T> {
webkitdirectory?: string | boolean;
}
}
declare global {
// Proxy configuration for SSH connections
interface NetcattyProxyConfig {
type: 'http' | 'socks5' | 'command';
host: string;
port: number;
command?: string;
username?: string;
password?: string;
}
// Discovered local shell (e.g. CMD, PowerShell, WSL, Git Bash)
interface DiscoveredShell {
id: string;
name: string;
command: string;
args?: string[];
icon: string;
isDefault?: boolean;
}
// Jump host configuration for SSH tunneling
interface NetcattyJumpHost {
hostname: string;
hostId?: string;
port: number;
username: string;
authMethod?: import("./domain/models").HostAuthMethod;
requiresMfa?: boolean;
password?: string;
privateKey?: string;
certificate?: string;
passphrase?: string;
publicKey?: string;
keyId?: string;
keySource?: 'generated' | 'imported' | 'reference';
label?: string; // Display label for UI
proxy?: NetcattyProxyConfig;
identityFilePaths?: string[];
useSshAgent?: boolean;
agentPublicKeys?: string[];
identityAgent?: string;
identitiesOnly?: boolean;
addKeysToAgent?: string;
useKeychain?: boolean;
// ET server port on this hop, used only when ET tunnels through it as a
// jump host (--jport). Defaults to 2022 in the bridge when omitted.
etPort?: number;
// Resolved keepalive for THIS hop (caller has already applied host
// override / global fallback). interval in seconds, 0 = disabled.
keepaliveInterval?: number;
keepaliveCountMax?: number;
// Per-hop SSH connection timeouts, resolved from the saved host.
sshTcpConnectTimeoutMs?: number;
sshAuthReadyTimeoutMs?: number;
verifyHostKeys?: boolean;
// Per-hop algorithm settings, mirroring the target-host fields. When
// omitted the bridge falls back to the target host's settings so a
// single setting on the leaf still covers the chain (matches the
// pre-existing behavior of `legacyAlgorithms`).
legacyAlgorithms?: boolean;
skipEcdsaHostKey?: boolean;
algorithmOverrides?: import("./domain/models").HostAlgorithmOverrides;
}
// Host key information for verification
// Reserved for future host key verification UI feature
interface _NetcattyHostKeyInfo {
hostname: string;
port: number;
keyType: string;
fingerprint: string;
publicKey?: string;
}
interface NetcattySSHOptions {
sessionId?: string;
hostId?: string;
hostLabel?: string;
hostname: string;
username: string;
authMethod?: import("./domain/models").HostAuthMethod;
requiresMfa?: boolean;
port?: number;
password?: string;
privateKey?: string;
// Optional OpenSSH user certificate
certificate?: string;
publicKey?: string; // OpenSSH public key line
keyId?: string;
keySource?: 'generated' | 'imported' | 'reference';
agentForwarding?: boolean;
x11Forwarding?: boolean;
x11Display?: string;
cols?: number;
rows?: number;
charset?: string;
extraArgs?: string[];
startupCommand?: string;
passphrase?: string;
knownHosts?: import("./domain/models").KnownHost[];
verifyHostKeys?: boolean;
// Environment variables to set in the remote shell
env?: Record<string, string>;
// Proxy configuration
proxy?: NetcattyProxyConfig;
// Jump hosts (bastion chain)
jumpHosts?: NetcattyJumpHost[];
// SSH-level keepalive interval in seconds (0 = disabled)
keepaliveInterval?: number;
// Unanswered keepalives before ssh2 declares the connection dead
keepaliveCountMax?: number;
// Maximum time to establish the TCP connection
sshTcpConnectTimeoutMs?: number;
// Maximum time for SSH handshake and authentication
sshAuthReadyTimeoutMs?: number;
// Enable legacy SSH algorithms for older network equipment
legacyAlgorithms?: boolean;
// Drop ecdsa-sha2-* from offered host-key algorithms (#1027)
skipEcdsaHostKey?: boolean;
// Per-category algorithm override lists (advanced, see HostAlgorithmOverrides)
algorithmOverrides?: import("./domain/models").HostAlgorithmOverrides;
// Use sudo for SFTP server
sudo?: boolean;
// Remote file protocol: auto (SFTP then SCP fallback) | sftp | scp
fileProtocol?: 'auto' | 'sftp' | 'scp';
// Saved host password used by background system tools when they need sudo.
sudoAutofillPassword?: string;
// Session log configuration for real-time streaming
sessionLog?: { enabled: boolean; directory: string; format: string; timestampsEnabled?: boolean };
// SSH connection diagnostics. Does not capture terminal output.
sshDebugLogEnabled?: boolean;
// Boot generation for correlating host-key prompts with a terminal start.
bootEpoch?: number;
// Local SSH key file paths (from SSH config IdentityFile)
identityFilePaths?: string[];
useSshAgent?: boolean;
agentPublicKeys?: string[];
identityAgent?: string;
identitiesOnly?: boolean;
addKeysToAgent?: string;
useKeychain?: boolean;
// When set, reuse the already-authenticated SSH connection of this existing
// session by opening a new shell channel on it, instead of dialing a fresh
// connection. Lets a duplicated tab skip a second MFA prompt (issue #1204).
// The bridge falls back to a fresh connection if the source is gone.
sourceSessionId?: string;
/** Require openSftpForSession to use exactly the requested live session. */
requireExactSourceSession?: boolean;
// Skip POSIX process discovery when copying a network-device session.
skipShellPidDiscovery?: boolean;
/**
* When false, terminal/SFTP opens must dial a fresh SSH connection and
* must not borrow a live, parked, or in-flight registry transport. Used by
* connect-time terminal automation and dedicated bulk transfers.
* Default true (normal terminal, browse, and MFA-skip reuse).
*/
reuseTransport?: boolean;
/** Runtime stamp for one session channel on this TCP. Set after a recognized bastion banner, not from saved host settings. */
singleChannelSsh?: boolean;
/** Original unsaved-password profile; main retains only its digest for live SFTP borrowing. */
sftpReuseOptions?: NetcattySSHOptions;
}
interface SftpStatResult {
name: string;
type: 'file' | 'directory' | 'symlink';
size: number;
/** False when the endpoint cannot report a size (stat-less SCP); size is a placeholder 0. */
sizeKnown?: boolean;
lastModified: number; // timestamp
permissions?: string; // e.g., "rwxr-xr-x"
owner?: string;
group?: string;
/** Local-only filesystem identity; undefined for remote SFTP stats. */
dev?: number;
ino?: number;
}
interface SftpTransferProgress {
transferId: string;
bytesTransferred: number;
totalBytes: number;
speed: number; // bytes per second
}
// Port Forwarding Types
interface PortForwardOptions {
ruleId?: string;
tunnelId: string;
type: 'local' | 'remote' | 'dynamic';
localPort: number;
bindAddress?: string;
remoteHost?: string;
remotePort?: number;
// SSH connection details
hostname: string;
hostId?: string;
port?: number;
username: string;
authMethod?: import("./domain/models").HostAuthMethod;
requiresMfa?: boolean;
password?: string;
privateKey?: string;
certificate?: string;
keyId?: string;
passphrase?: string;
knownHosts?: import("./domain/models").KnownHost[];
verifyHostKeys?: boolean;
proxy?: NetcattyProxyConfig;
jumpHosts?: NetcattyJumpHost[];
identityFilePaths?: string[];
useSshAgent?: boolean;
agentPublicKeys?: string[];
identityAgent?: string;
identitiesOnly?: boolean;
addKeysToAgent?: string;
useKeychain?: boolean;
legacyAlgorithms?: boolean;
skipEcdsaHostKey?: boolean;
algorithmOverrides?: import("./domain/models").HostAlgorithmOverrides;
// Resolved keepalive for the target connection (caller has already
// applied host override / global fallback). interval in seconds.
keepaliveInterval?: number;
keepaliveCountMax?: number;
sshTcpConnectTimeoutMs?: number;
sshAuthReadyTimeoutMs?: number;
}
interface PortForwardResult {
tunnelId: string;
success: boolean;
cancelled?: boolean;
blockedByCleanup?: boolean;
reused?: boolean;
status?: 'inactive' | 'connecting' | 'active' | 'error';
error?: string;
}
interface PortForwardStatusResult {
tunnelId: string;
status: 'inactive' | 'connecting' | 'active' | 'error';
type?: 'local' | 'remote' | 'dynamic';
error?: string;
}
type PortForwardRuntimePhase =
| 'connecting'
| 'active'
| 'stopping'
| 'error'
| 'inactive';
interface PortForwardRuntimeRecord {
ruleId?: string;
tunnelId: string;
phase: PortForwardRuntimePhase | string;
error?: string;
cleanupRequired?: boolean;
revision: number;
updatedAt: number;
}
interface PortForwardRuntimeSnapshot {
epoch: string;
revision: number;
records: PortForwardRuntimeRecord[];
}
type PortForwardRuntimeEvent =
| {
epoch: string;
revision: number;
kind: 'upsert';
record: PortForwardRuntimeRecord;
}
| {
epoch: string;
revision: number;
kind: 'remove';
tunnelId: string;
ruleId?: string;
};
interface NetcattyWindowsPtyInfo {
backend: 'conpty' | 'winpty';
buildNumber?: number;
}
type PortForwardStatusCallback = (status: 'inactive' | 'connecting' | 'active' | 'error', error?: string) => void;
type PortForwardRuntimeEventCallback = (event: PortForwardRuntimeEvent) => void;
interface NetcattyPluginRuntimeStatus {
available: boolean;
experimental: true;
}
interface NetcattyInstalledPlugin {
id: string;
enabled: boolean;
activeVersion: string | null;
manifest: unknown;
runtime: {
status: string;
kind: 'browser' | 'utility' | null;
lastError: string | null;
quarantinedAt: number | null;
};
}
interface NetcattyExtensionProviderContribution {
pluginId: string;
pluginVersion: string;
pluginDisplayName?: string;
provider: import("@netcatty/plugin-contract").ProviderContribution;
}
interface NetcattyExtensionProviderRequest {
providerId: string;
kind: 'connection' | 'authentication' | 'importer';
operation: string;
requestId?: string;
payload?: import("@netcatty/plugin-contract").JsonValue;
deadlineMs?: number;
}
interface NetcattyPluginConnectionStartRequest {
requestId?: string;
sessionId: string;
protocol?: string;
hostLabel?: string;
hostname?: string;
providerId: string;
configuration: import("@netcatty/plugin-contract").JsonValue;
columns: number;
rows: number;
credential?: import("@netcatty/plugin-contract").CredentialRef | import("@netcatty/plugin-contract").SecretRef;
authenticationProviderId?: string;
sessionLog?: { enabled: boolean; directory: string; format: string; timestampsEnabled?: boolean };
deadlineMs?: number;
}
interface NetcattyPluginImporterPreview {
providerId: string;
result: import("@netcatty/plugin-contract").ImporterParseResult;
records: ReadonlyArray<import("@netcatty/plugin-contract").ImporterRecord>;
}
interface NetcattyPluginImporterProgressEvent {
requestId: string;
providerId: string;
progress: Extract<import("@netcatty/plugin-contract").ImporterRecord, { type: "progress" }>;
}
interface NetcattyPluginAuthenticationChallengeOpenEvent {
requestId: string;
challengeRequestId: string;
challenge: import("@netcatty/plugin-contract").AuthenticationChallenge;
}
interface NetcattyPluginAuthenticationChallengeCancelEvent {
requestId: string;
challengeRequestId: string;
challengeId?: string;
cancelled: true;
}
type NetcattyPluginAuthenticationChallengeEvent =
| NetcattyPluginAuthenticationChallengeOpenEvent
| NetcattyPluginAuthenticationChallengeCancelEvent;
interface NetcattyBridge {
getPluginRuntimeStatus?(): Promise<NetcattyPluginRuntimeStatus>;
listPlugins?(): Promise<NetcattyInstalledPlugin[]>;
installPluginPackage?(archivePath: string, options?: { enable?: boolean }): Promise<NetcattyInstalledPlugin>;
setPluginEnabled?(pluginId: string, enabled: boolean): Promise<NetcattyInstalledPlugin>;
restartPlugin?(pluginId: string): Promise<NetcattyInstalledPlugin>;
uninstallPlugin?(pluginId: string): Promise<boolean>;
getPluginContributions?(options?: NetcattyPluginContributionQuery): Promise<NetcattyPluginContributionSnapshot>;
getPluginContributionIcon?(pluginId: string, icon: Extract<NetcattyPluginIconReference, { kind: 'package' }>): Promise<{ light: string; dark?: string }>;
executePluginCommand?(command: string, args?: unknown, context?: Record<string, unknown>): Promise<unknown>;
updatePluginSetting?(pluginId: string, settingId: string, value: unknown, scopeId?: string): Promise<{ restartRequired: boolean }>;
resetPluginSetting?(pluginId: string, settingId: string, scopeId?: string): Promise<{ restartRequired: boolean }>;
setPluginEnvironment?(environment: NetcattyPluginEnvironment): Promise<void>;
listPluginTerminalProviders?(options: NetcattyTerminalProviderQuery): Promise<ReadonlyArray<NetcattyTerminalProviderContribution>>;
providePluginTerminal?(request: NetcattyTerminalProviderRequest): Promise<ReadonlyArray<NetcattyTerminalProviderResult>>;
cancelPluginTerminalRequest?(requestId: string): Promise<boolean>;
publishPluginTerminalSessionEvent?(event: NetcattyTerminalSessionEvent): Promise<ReadonlyArray<{ pluginId: string; delivered: boolean }>>;
listPluginExtensionProviders?(options: { kind: 'connection' | 'authentication' | 'importer' | 'sync'; locale?: string }): Promise<ReadonlyArray<NetcattyExtensionProviderContribution>>;
updatePluginCredentialCatalog?(entries: ReadonlyArray<{ id: string; ciphertext: string }>): Promise<number>;
invokePluginExtensionProvider?(request: NetcattyExtensionProviderRequest): Promise<import("@netcatty/plugin-contract").JsonValue>;
cancelPluginExtensionRequest?(requestId: string): Promise<boolean>;
pluginSyncConnect?(request: {
requestId?: string;
providerId: string;
configuration?: unknown;
credential?: unknown;
deadlineMs?: number;
}): Promise<{ account: { id: string; email?: string; name?: string; avatarUrl?: string } }>;
pluginSyncDisconnect?(request: { requestId?: string; providerId: string; deadlineMs?: number }): Promise<null>;
pluginSyncGetAccount?(request: { requestId?: string; providerId: string; deadlineMs?: number }): Promise<{
account: { id: string; email?: string; name?: string; avatarUrl?: string } | null;
}>;
pluginSyncGetCapabilities?(request: { requestId?: string; providerId: string; deadlineMs?: number }): Promise<{
revisions: boolean;
conditionalWrites: boolean;
atomicReplacement: boolean;
maxObjectBytes?: number;
maxObjects?: number;
}>;
pluginSyncReadObject?(request: {
requestId?: string;
providerId: string;
key: string;
preferStream?: boolean;
deadlineMs?: number;
}): Promise<{
found: boolean;
key: string;
data?: Uint8Array | null;
streamed?: boolean;
transferId?: string;
byteLength?: number;
revision?: string;
contentType?: string;
}>;
pluginSyncReadChunk?(request: {
requestId: string;
transferId: string;
maxBytes?: number;
}): Promise<{ chunk: Uint8Array; done: boolean }>;
pluginSyncWriteObject?(request: {
requestId?: string;
providerId: string;
key: string;
data: Uint8Array;
expectedRevision?: string | null;
preferStream?: boolean;
deadlineMs?: number;
}): Promise<{ created: boolean; revision?: string }>;
pluginSyncWriteBegin?(request: {
requestId?: string;
providerId: string;
key: string;
byteLength: number;
expectedRevision?: string | null;
deadlineMs?: number;
}): Promise<{ transferId: string; windowBytes: number }>;
pluginSyncWriteChunk?(request: {
requestId: string;
transferId: string;
sequence: number;
chunk: Uint8Array;
}): Promise<{ accepted: number }>;
pluginSyncWriteCommit?(request: {
requestId: string;
transferId: string;
}): Promise<{ created: boolean; revision?: string }>;
pluginSyncDeleteObject?(request: {
requestId?: string;
providerId: string;
key: string;
expectedRevision?: string;
deadlineMs?: number;
}): Promise<{ deleted: boolean }>;
pluginSyncPutSecret?(request: {
providerId: string;
key: string;
value: string;
}): Promise<{ kind: 'secret'; id: string; key: string; created?: boolean }>;
pluginSyncDeleteSecrets?(request: {
providerId: string;
keys?: string[];
}): Promise<{ deleted: number }>;
pluginSyncRestoreSecrets?(request: {
providerId: string;
keys: string[];
discard?: boolean;
}): Promise<{ restored: number; discarded?: number }>;
collectPluginSyncSidecars?(): Promise<unknown>;
applyPluginSyncSidecars?(bundle: unknown): Promise<{ applied: boolean; count?: number; entries?: unknown }>;
pluginHostReady?(): boolean;
startPluginConnection?(request: NetcattyPluginConnectionStartRequest): Promise<{ sessionId: string; providerId: string; status: 'connecting' | 'connected'; diagnostics: ReadonlyArray<import("@netcatty/plugin-contract").ProviderValidationIssue> }>;
writePluginConnection?(sessionId: string, data: Uint8Array): Promise<void>;
controlPluginConnection?(sessionId: string, operation: 'resize' | 'signal' | 'reconnect' | 'close' | 'getStatus', payload?: Record<string, unknown>): Promise<unknown>;
detectPluginImporter?(request: { providerId: string; sample: Uint8Array; fileName?: string; mediaType?: string; deadlineMs?: number }): Promise<import("@netcatty/plugin-contract").ImporterDetectResult>;
selectPluginImporterFile?(): Promise<{ selectionToken: string; fileName: string; sample: Uint8Array } | null>;
releasePluginImporterFile?(selectionToken: string): Promise<boolean>;
parsePluginImporterFile?(request: { requestId?: string; providerId: string; selectionToken: string; mediaType?: string; options?: import("@netcatty/plugin-contract").JsonValue; deadlineMs?: number }): Promise<NetcattyPluginImporterPreview>;
onPluginImporterProgress?(callback: (event: NetcattyPluginImporterProgressEvent) => void): () => void;
respondPluginAuthenticationChallenge?(response: {
requestId: string;
challengeRequestId: string;
challengeId: string;
response?: string | boolean | ReadonlyArray<string>;
cancelled?: boolean;
}): Promise<void>;
onPluginAuthenticationChallenge?(callback: (event: NetcattyPluginAuthenticationChallengeEvent) => void): () => void;
onPluginConnectionData?(callback: (event: { sessionId: string; data: Uint8Array }) => void): () => void;
onPluginConnectionClosed?(callback: (event: { sessionId: string; reason: string }) => void): () => void;
openPluginView?(payload: NetcattyPluginViewOpenRequest): Promise<{ instanceId: string }>;
closePluginView?(instanceId: string): Promise<void>;
setPluginViewBounds?(instanceId: string, bounds: { x: number; y: number; width: number; height: number }): Promise<void>;
setPluginViewVisibility?(instanceId: string, visible: boolean): Promise<void>;
postPluginViewMessage?(instanceId: string, message: unknown): Promise<void>;
onPluginContributionsChanged?(callback: (event: { reason: string; pluginId: string | null; revision: number }) => void): () => void;
onPluginViewMessage?(callback: (event: { pluginId: string; viewId: string; message: unknown }) => void): () => void;
onPluginViewClosed?(callback: (event: NetcattyPluginViewClosedEvent) => void): () => void;
getPluginScopeCatalog?(): Promise<NetcattyPluginScopeCatalog>;
setPluginScopeCatalog?(catalog: NetcattyPluginScopeCatalog): Promise<void>;
onPluginScopeCatalogChanged?(callback: (catalog: NetcattyPluginScopeCatalog) => void): () => void;
}
interface NetcattyPluginContributionQuery {
locale?: string;
context?: Record<string, unknown>;
menuContexts?: Partial<Record<string, Record<string, unknown>>>;
scopeIds?: Partial<Record<'workspace' | 'host' | 'session' | 'device', string>>;
}
interface NetcattyPluginSettingContribution {
id: string;
label: string;
description?: string;
placeholder?: string;
control: string;
scope: string;
scopeId: string | null;
value?: unknown;
secret?: boolean;
configured: boolean;
visible: boolean;
restartRequired?: boolean;
required?: boolean;
options?: ReadonlyArray<{ value: string; label: string; description?: string }>;
minimum?: number;
maximum?: number;
step?: number;
sortable?: boolean;
valueSchema?: unknown;
}
type NetcattyPluginIconReference =
| { kind: 'theme'; name: string }
| { kind: 'package'; light: string; dark?: string };
interface NetcattyPluginContributionSnapshot {
locale: string;
plugins: ReadonlyArray<{
id: string;
version: string;
displayName: string;
description: string;
commands: ReadonlyArray<{ id: string; title: string; category?: string; description?: string; icon?: NetcattyPluginIconReference; enabled: boolean }>;
keybindings: ReadonlyArray<{ command: string; key: string; mac?: string; linux?: string; windows?: string; args?: unknown; enabled: boolean }>;
menus: ReadonlyArray<{
id: string;
command: string;
alt?: string;
location: string;
title: string;
visible: boolean;
enabled: boolean;
checked?: boolean;
order?: number;
group?: string;
shortcut?: string;
showKeybinding?: boolean;
icon?: NetcattyPluginIconReference;
}>;
settings: ReadonlyArray<NetcattyPluginSettingContribution>;
views: ReadonlyArray<{ id: string; title: string; location: string; entry: string; icon?: NetcattyPluginIconReference; order?: number; visible: boolean; retainContextWhenHidden?: boolean }>;
}>;
}
interface NetcattyPluginEnvironment {
locale: string;
theme: string;
reducedMotion: boolean;
highContrast: boolean;
themeTokens?: Record<string, string>;
}
type NetcattyTerminalProviderKind =
| 'terminal.completion'
| 'terminal.decoration'
| 'terminal.link'
| 'terminal.hover'
| 'terminal.matcher'
| 'terminal.semantic'
| 'terminal.prompt'
| 'terminal.background'
| 'terminal.theme';
interface NetcattyTerminalProviderContribution {
pluginId: string;
pluginVersion: string;
runtimeId?: string;
pluginDisplayName: string;
provider: {
id: string;
label: string;
description?: string;
kind: NetcattyTerminalProviderKind;
capabilities?: ReadonlyArray<string>;
configurationSchema?: unknown;
};
}
interface NetcattyTerminalProviderQuery {
kind: NetcattyTerminalProviderKind;
locale?: string;
preferredProviderIds?: ReadonlyArray<string>;
}
interface NetcattyTerminalSessionSnapshot {
sessionId: string;
hostId?: string;
workspaceId?: string;
protocol: string;
status: 'connecting' | 'connected' | 'disconnected';
cwd?: string;
title?: string;
shellType?: 'posix' | 'fish' | 'powershell' | 'cmd' | 'unknown';
cols?: number;
rows?: number;
alternateScreen?: boolean;
}
interface NetcattyTerminalSessionEvent {
type:
| 'snapshot'
| 'created'
| 'connected'
| 'reconnected'
| 'cwdChanged'
| 'titleChanged'
| 'resized'
| 'alternateScreenChanged'
| 'commandSubmitted'
| 'commandCompleted'
| 'disconnected'
| 'disposed';
session: NetcattyTerminalSessionSnapshot;
exitCode?: number;
}
interface NetcattyTerminalProviderRequest {
requestId: string;
kind: NetcattyTerminalProviderKind;
operation: string;
session: NetcattyTerminalSessionSnapshot;
payload?: unknown;
locale?: string;
preferredProviderIds?: ReadonlyArray<string>;
deadlineMs?: number;
}
type NetcattyTerminalProviderResult = {
pluginId: string;
pluginVersion: string;
runtimeId?: string;
providerId: string;
kind: NetcattyTerminalProviderKind;
requestId: string;
status: 'ok';
result: unknown;
} | {
pluginId: string;
pluginVersion: string;
runtimeId?: string;
providerId: string;
kind: NetcattyTerminalProviderKind;
requestId: string;
status: 'cancelled';
} | {
pluginId: string;
pluginVersion: string;
providerId: string;
kind: NetcattyTerminalProviderKind;
requestId: string;
status: 'failed';
error: { code: number; message: string; data?: unknown };
};
interface NetcattyPluginViewOpenRequest {
viewId: string;
instanceId?: string;
scopeId: string;
bounds?: { x: number; y: number; width: number; height: number };
context?: Record<string, unknown>;
}
interface NetcattyPluginViewClosedEvent {
instanceId: string;
pluginId: string;
viewId: string;
reason: string;
}
type NetcattyPluginSettingScopeKind = 'workspace' | 'host' | 'session' | 'device';
type NetcattyPluginScopeCatalog = Record<
NetcattyPluginSettingScopeKind,
ReadonlyArray<{ id: string; label: string }>
>;
interface Window {
netcatty?: NetcattyBridge;
}
}
export { };