@comput/pi-intercom 0.6.1 → 0.9.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.
- package/README.md +113 -8
- package/dist/config.d.ts +12 -0
- package/dist/config.js +94 -22
- package/dist/config.js.map +1 -1
- package/dist/core-monitor.d.ts +30 -0
- package/dist/core-monitor.js +528 -0
- package/dist/core-monitor.js.map +1 -0
- package/dist/core-pane-close.d.ts +34 -0
- package/dist/core-pane-close.js +335 -0
- package/dist/core-pane-close.js.map +1 -0
- package/dist/core-worker-layout.d.ts +50 -0
- package/dist/core-worker-layout.js +236 -0
- package/dist/core-worker-layout.js.map +1 -0
- package/dist/herdr-core.d.ts +53 -0
- package/dist/herdr-core.js +380 -0
- package/dist/herdr-core.js.map +1 -0
- package/dist/index.js +60 -14
- package/dist/index.js.map +1 -1
- package/dist/launcher.d.ts +2 -0
- package/dist/launcher.js +59 -3
- package/dist/launcher.js.map +1 -1
- package/dist/monitor-launcher.d.ts +8 -0
- package/dist/monitor-launcher.js +111 -25
- package/dist/monitor-launcher.js.map +1 -1
- package/dist/pane-close.js +3 -0
- package/dist/pane-close.js.map +1 -1
- package/dist/reminders.d.ts +28 -0
- package/dist/reminders.js +81 -0
- package/dist/reminders.js.map +1 -0
- package/dist/runtime.d.ts +28 -2
- package/dist/runtime.js +139 -11
- package/dist/runtime.js.map +1 -1
- package/package.json +14 -6
- package/references/herdr-core-migration.md +44 -0
- package/references/releasing.md +90 -0
- package/references/v1-specification.md +11 -8
- package/src/config.ts +69 -17
- package/src/core-monitor.ts +410 -0
- package/src/core-pane-close.ts +328 -0
- package/src/core-worker-layout.ts +240 -0
- package/src/herdr-core.ts +287 -0
- package/src/index.ts +55 -15
- package/src/launcher.ts +55 -3
- package/src/monitor-launcher.ts +95 -21
- package/src/pane-close.ts +2 -0
- package/src/reminders.ts +69 -0
- package/src/runtime.ts +122 -12
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
4
|
+
import { coreCall, locateTerminalTab, terminalAddress } from './herdr-core.js';
|
|
5
|
+
/** Source-pinned adapter, NOT a public app-layout schema or a UI readiness probe.
|
|
6
|
+
* hc 0.1.18's public doc API treats values as opaque JSON. The layout below is
|
|
7
|
+
* backed by herdr-app 0.1.13 src/{mirror,mirror_sync,model,window}.rs:
|
|
8
|
+
* - Document::capture/replace uses machine-local IDs; View owns private focus.
|
|
9
|
+
* - Tab::new uses a row whose ID is the tab ID and one terminal block.
|
|
10
|
+
* - Model::fresh_id uses a prefix and 32 random hexadecimal digits.
|
|
11
|
+
* - window::reconcile/start_adoption consumes placement labels. Therefore write
|
|
12
|
+
* and verify the document BEFORE labeling, never copy the caller's labels.
|
|
13
|
+
* Unknown metadata is retained. Unsupported/ambiguous trees fail closed.
|
|
14
|
+
*/
|
|
15
|
+
const DOCUMENT = 'herdr-app';
|
|
16
|
+
const error = (message) => new Error(`PiIntercom HC worker layout: ${message}`);
|
|
17
|
+
const positiveInteger = (n) => Number.isSafeInteger(n) && n > 0;
|
|
18
|
+
/** All attach failures are post-creation uncertainty, including validation and
|
|
19
|
+
* CAS conflicts. No cleanup, retry, replacement, fallback, or terminal killing.
|
|
20
|
+
* The launcher must propagate this to its existing uncertain-launch fence. */
|
|
21
|
+
export class CoreWorkerLayoutUncertainError extends Error {
|
|
22
|
+
outcomeUncertain = true;
|
|
23
|
+
constructor() {
|
|
24
|
+
super('PiIntercom HC worker layout attachment failed; outcome unknown, terminal/process and app tab may remain; no automatic cleanup/retry/replacement or fallback');
|
|
25
|
+
this.name = 'CoreWorkerLayoutUncertainError';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
// A ticket is one attempt in this process, not persisted launch authorization.
|
|
29
|
+
const tickets = new WeakSet();
|
|
30
|
+
function normalizeCwd(value, platform) {
|
|
31
|
+
const paths = platform === 'win32' ? path.win32 : path.posix;
|
|
32
|
+
if (typeof value !== 'string' || !value.trim() || value.includes('\0') || !paths.isAbsolute(value))
|
|
33
|
+
throw error('absolute root cwd required');
|
|
34
|
+
return platform === 'win32' ? paths.resolve(value).toLowerCase() : paths.resolve(value);
|
|
35
|
+
}
|
|
36
|
+
function live(record, address, createdMs) {
|
|
37
|
+
if (record?.address !== address || record.state !== 'live' || !positiveInteger(record.created_ms) ||
|
|
38
|
+
(createdMs !== undefined && record.created_ms !== createdMs))
|
|
39
|
+
throw error('terminal identity is not live or changed');
|
|
40
|
+
}
|
|
41
|
+
async function identity(call, expected) {
|
|
42
|
+
// CoreInfo.id is available in the verified hc 0.1.18 schema. Do not silently
|
|
43
|
+
// degrade an unavailable identity check into address-only ownership.
|
|
44
|
+
const status = await call('server.status', {});
|
|
45
|
+
const id = status?.core?.id;
|
|
46
|
+
if (typeof id !== 'string' || !id.trim() || (expected !== undefined && id !== expected))
|
|
47
|
+
throw error('current core identity unavailable or changed');
|
|
48
|
+
return id;
|
|
49
|
+
}
|
|
50
|
+
function snapshot(value) {
|
|
51
|
+
if (!Number.isSafeInteger(value?.version) || value.version < 0 || !value.value || typeof value.value !== 'object')
|
|
52
|
+
throw error('app document unavailable');
|
|
53
|
+
if (Buffer.byteLength(JSON.stringify(value.value), 'utf8') > 1024 * 1024)
|
|
54
|
+
throw error('app document exceeds core limit');
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
/** locateTerminalTab supplies bounded tree/ID checks. Additionally reject
|
|
58
|
+
* qualified IDs and inspect floating blocks so they cannot conceal a duplicate
|
|
59
|
+
* terminal or collide with a generated ID. Stack layouts are not supported by
|
|
60
|
+
* the shared locator and are deliberately rejected, not rewritten. */
|
|
61
|
+
function inspect(value, caller) {
|
|
62
|
+
const location = locateTerminalTab(value, caller);
|
|
63
|
+
const ids = new Set(), terminals = new Set();
|
|
64
|
+
const localId = (id) => {
|
|
65
|
+
if (!id || id.length > 256 || /[\/\x00-\x20\x7f]/.test(id))
|
|
66
|
+
throw error('nonlocal app identity');
|
|
67
|
+
ids.add(id);
|
|
68
|
+
};
|
|
69
|
+
const content = (v) => {
|
|
70
|
+
if (v?.terminal !== undefined) {
|
|
71
|
+
terminalAddress(v.terminal);
|
|
72
|
+
if (terminals.has(v.terminal))
|
|
73
|
+
throw error('duplicate terminal placement');
|
|
74
|
+
terminals.add(v.terminal);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
let floats = 0;
|
|
78
|
+
const node = (v) => {
|
|
79
|
+
localId(v.id);
|
|
80
|
+
if (v.type === 'block')
|
|
81
|
+
content(v.content);
|
|
82
|
+
if (v.floating !== undefined) {
|
|
83
|
+
if (!Array.isArray(v.floating))
|
|
84
|
+
throw error('invalid floating blocks');
|
|
85
|
+
for (const f of v.floating) {
|
|
86
|
+
if (++floats > 4096 || typeof f?.id !== 'string' || ids.has(f.id))
|
|
87
|
+
throw error('ambiguous floating identity');
|
|
88
|
+
localId(f.id);
|
|
89
|
+
content(f.content);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (v.type !== 'block')
|
|
93
|
+
for (const c of v.children)
|
|
94
|
+
node(c);
|
|
95
|
+
};
|
|
96
|
+
// Reserve all regular IDs before inspecting floats for cross-tree collisions.
|
|
97
|
+
const reserve = (v) => { localId(v.id); if (v.type !== 'block')
|
|
98
|
+
for (const c of v.children)
|
|
99
|
+
reserve(c); };
|
|
100
|
+
for (const s of value.spaces) {
|
|
101
|
+
localId(s.id);
|
|
102
|
+
for (const t of s.tabs) {
|
|
103
|
+
localId(t.id);
|
|
104
|
+
reserve(t.root);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
for (const s of value.spaces)
|
|
108
|
+
for (const t of s.tabs)
|
|
109
|
+
node(t.root);
|
|
110
|
+
return { location, ids, terminals };
|
|
111
|
+
}
|
|
112
|
+
/** Call BEFORE hc run. Read-only: missing app document/mapping refuses launch.
|
|
113
|
+
* Labels are not authority: the current document must contain the caller once.
|
|
114
|
+
* This proves shared state, not that a remote window is connected/rendering. */
|
|
115
|
+
export async function preflightCoreWorkerLayout(request, call = coreCall) {
|
|
116
|
+
const startedAtMs = Date.now();
|
|
117
|
+
terminalAddress(request.caller);
|
|
118
|
+
const platform = request.platform ?? process.platform;
|
|
119
|
+
if (platform !== 'linux' && platform !== 'win32')
|
|
120
|
+
throw error('unsupported platform');
|
|
121
|
+
const cwd = normalizeCwd(request.cwd, platform);
|
|
122
|
+
if (normalizeCwd(request.workspaceRoot, platform) !== cwd)
|
|
123
|
+
throw error('worker cwd must equal workspace root');
|
|
124
|
+
const name = request.name ?? 'Intercom (anonymous)';
|
|
125
|
+
if (typeof name !== 'string' || !name.trim() || name.length > 128 || /[\x00-\x1f\x7f]/.test(name))
|
|
126
|
+
throw error('invalid tab name');
|
|
127
|
+
const coreId = await identity(call);
|
|
128
|
+
const caller = await call('terminal.get', { terminal: request.caller });
|
|
129
|
+
live(caller, request.caller);
|
|
130
|
+
const doc = snapshot(await call('doc.get', { name: DOCUMENT }));
|
|
131
|
+
const { location } = inspect(doc.value, request.caller);
|
|
132
|
+
if (location.space.tabs.length >= 512)
|
|
133
|
+
throw error('app tab limit reached');
|
|
134
|
+
await identity(call, coreId);
|
|
135
|
+
live(await call('terminal.get', { terminal: request.caller }), request.caller, caller.created_ms);
|
|
136
|
+
const ticket = Object.freeze({ caller: request.caller, callerCreatedMs: caller.created_ms, coreId,
|
|
137
|
+
space: location.space.id, tab: location.tab.id, pane: location.pane.id,
|
|
138
|
+
version: doc.version, startedAtMs, cwd, platform, name });
|
|
139
|
+
tickets.add(ticket);
|
|
140
|
+
return ticket;
|
|
141
|
+
}
|
|
142
|
+
function worker(record, ticket, address, createdMs) {
|
|
143
|
+
live(record, address, createdMs);
|
|
144
|
+
if (record.parent !== ticket.caller || record.first_message != null ||
|
|
145
|
+
normalizeCwd(record.cwd, ticket.platform) !== ticket.cwd ||
|
|
146
|
+
(record.foreground != null && normalizeCwd(record.foreground.cwd, ticket.platform) !== ticket.cwd))
|
|
147
|
+
throw error('worker root cwd/parent differs from launch');
|
|
148
|
+
}
|
|
149
|
+
/** Call once AFTER hc run, with its full parsed RunResult (created_ms required).
|
|
150
|
+
* Appends exactly one dedicated tab in the caller's AUTHORITATIVE CURRENT space,
|
|
151
|
+
* using the current doc version, not the preflight version. No focus mutations.
|
|
152
|
+
* Returns shared-state confirmation only, never UI/Pi readiness. */
|
|
153
|
+
export async function attachCoreWorkerLayout(ticket, created, call = coreCall) {
|
|
154
|
+
try {
|
|
155
|
+
if (!tickets.delete(ticket))
|
|
156
|
+
throw error('preflight ticket absent or already consumed');
|
|
157
|
+
const result = created;
|
|
158
|
+
terminalAddress(result?.address);
|
|
159
|
+
if (result.address === ticket.caller || !positiveInteger(result.created_ms) || result.created_ms < ticket.startedAtMs)
|
|
160
|
+
throw error('worker is not a fresh launch identity');
|
|
161
|
+
const address = result.address, createdMs = result.created_ms;
|
|
162
|
+
worker(result, ticket, address, createdMs);
|
|
163
|
+
await identity(call, ticket.coreId);
|
|
164
|
+
live(await call('terminal.get', { terminal: ticket.caller }), ticket.caller, ticket.callerCreatedMs);
|
|
165
|
+
const record = await call('terminal.get', { terminal: address });
|
|
166
|
+
worker(record, ticket, address, createdMs);
|
|
167
|
+
// A pre-labeled worker may already have triggered app adoption. Do not
|
|
168
|
+
// race it, move it, borrow its tab, or attempt to undo that operation.
|
|
169
|
+
const unplaced = (r) => {
|
|
170
|
+
if (r.labels?.['herdr.space'] || r.labels?.['herdr.tab'])
|
|
171
|
+
throw error('worker already has placement labels');
|
|
172
|
+
};
|
|
173
|
+
unplaced(record);
|
|
174
|
+
const doc = snapshot(await call('doc.get', { name: DOCUMENT }));
|
|
175
|
+
if (doc.version < ticket.version)
|
|
176
|
+
throw error('app document version regressed since preflight');
|
|
177
|
+
const value = structuredClone(doc.value);
|
|
178
|
+
const { location, ids, terminals } = inspect(value, ticket.caller);
|
|
179
|
+
if (terminals.has(address) || location.space.tabs.length >= 512)
|
|
180
|
+
throw error('worker already placed or app tab limit reached');
|
|
181
|
+
const tab = `tb${randomUUID().replaceAll('-', '')}`, pane = `p${randomUUID().replaceAll('-', '')}`;
|
|
182
|
+
if (ids.has(tab) || ids.has(pane) || tab === pane)
|
|
183
|
+
throw error('generated app identity collision');
|
|
184
|
+
const added = { id: tab, name: ticket.name, root: { id: tab, type: 'row', children: [{ id: pane, type: 'block', content: { terminal: address } }] } };
|
|
185
|
+
location.space.tabs.push(added);
|
|
186
|
+
inspect(value, ticket.caller); // Also enforce post-append tree bounds.
|
|
187
|
+
snapshot({ version: doc.version, value });
|
|
188
|
+
await identity(call, ticket.coreId);
|
|
189
|
+
live(await call('terminal.get', { terminal: ticket.caller }), ticket.caller, ticket.callerCreatedMs);
|
|
190
|
+
const fresh = await call('terminal.get', { terminal: address });
|
|
191
|
+
worker(fresh, ticket, address, createdMs);
|
|
192
|
+
unplaced(fresh);
|
|
193
|
+
const written = await call('doc.set', { name: DOCUMENT, version: doc.version, value });
|
|
194
|
+
if (!Number.isSafeInteger(written?.version) || written.version !== doc.version + 1)
|
|
195
|
+
throw error('unconfirmed document write');
|
|
196
|
+
const confirm = async () => {
|
|
197
|
+
const observed = snapshot(await call('doc.get', { name: DOCUMENT }));
|
|
198
|
+
if (observed.version < written.version)
|
|
199
|
+
throw error('stale document readback');
|
|
200
|
+
const current = inspect(observed.value, ticket.caller).location;
|
|
201
|
+
const target = locateTerminalTab(observed.value, address);
|
|
202
|
+
if (current.space.id !== location.space.id || target.space.id !== current.space.id ||
|
|
203
|
+
target.tab.id !== tab || target.pane.id !== pane || !isDeepStrictEqual(target.tab, added))
|
|
204
|
+
throw error('placement readback differs');
|
|
205
|
+
// At the written version, every field must roundtrip, including metadata.
|
|
206
|
+
if (observed.version === written.version && !isDeepStrictEqual(observed.value, value))
|
|
207
|
+
throw error('document write differs');
|
|
208
|
+
return observed.version;
|
|
209
|
+
};
|
|
210
|
+
await confirm();
|
|
211
|
+
await identity(call, ticket.coreId);
|
|
212
|
+
live(await call('terminal.get', { terminal: ticket.caller }), ticket.caller, ticket.callerCreatedMs);
|
|
213
|
+
const beforeLabel = await call('terminal.get', { terminal: address });
|
|
214
|
+
worker(beforeLabel, ticket, address, createdMs);
|
|
215
|
+
unplaced(beforeLabel);
|
|
216
|
+
const labels = { 'herdr.space': location.space.id, 'herdr.tab': tab };
|
|
217
|
+
const labeled = await call('terminal.label', { terminal: address, labels });
|
|
218
|
+
const verifyLabels = (r) => {
|
|
219
|
+
worker(r, ticket, address, createdMs);
|
|
220
|
+
if (r.labels?.['herdr.space'] !== labels['herdr.space'] || r.labels?.['herdr.tab'] !== tab)
|
|
221
|
+
throw error('placement labels not confirmed');
|
|
222
|
+
};
|
|
223
|
+
verifyLabels(labeled);
|
|
224
|
+
verifyLabels(await call('terminal.get', { terminal: address }));
|
|
225
|
+
const version = await confirm();
|
|
226
|
+
await identity(call, ticket.coreId);
|
|
227
|
+
live(await call('terminal.get', { terminal: ticket.caller }), ticket.caller, ticket.callerCreatedMs);
|
|
228
|
+
return { terminal: address, terminalCreatedMs: createdMs, coreId: ticket.coreId, space: location.space.id, tab, pane, version, layoutConfirmed: true, uiAcknowledged: false };
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
// Do not leak transport payloads. This deliberately includes failures before
|
|
232
|
+
// our CAS: hc run has already happened and cannot safely be replayed.
|
|
233
|
+
throw new CoreWorkerLayoutUncertainError();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=core-worker-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-worker-layout.js","sourceRoot":"","sources":["../src/core-worker-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,eAAe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E,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;IAChL,CAAC;IAAC,MAAM,CAAC;QACP,6EAA6E;QAC7E,sEAAsE;QACtE,MAAM,IAAI,8BAA8B,EAAE,CAAC;IAC7C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type ChildProcessWithoutNullStreams } from 'node:child_process';
|
|
2
|
+
export type CoreCall = (method: string, params: Record<string, unknown>) => Promise<any>;
|
|
3
|
+
export interface CoreSessionOptions {
|
|
4
|
+
/** Explicit documented HC_SOCKET endpoint; no endpoint discovery or path guessing. */
|
|
5
|
+
endpoint?: string;
|
|
6
|
+
/** Test-only trusted seams. Supplying startClient requires readStatus. */
|
|
7
|
+
startClient?: () => ChildProcessWithoutNullStreams;
|
|
8
|
+
readStatus?: () => Promise<unknown>;
|
|
9
|
+
/** Tests may shorten, never extend, the ten-second whole-operation deadline. */
|
|
10
|
+
timeoutMs?: number;
|
|
11
|
+
}
|
|
12
|
+
/** Resolve only documented Unix defaults. An existing config may override the
|
|
13
|
+
* socket, so require explicit HC_SOCKET rather than silently ignoring that file. */
|
|
14
|
+
export declare function defaultCoreEndpoint(env?: NodeJS.ProcessEnv, home?: string, uid?: number | undefined): Promise<string>;
|
|
15
|
+
/** One bounded, sequential operation on ONE verified connection; never reconnects.
|
|
16
|
+
* Core v0.1.18 schema hello + server.status bind protocol, version, permanent core
|
|
17
|
+
* identity and (with CLI preflight) pid before the callback can send requests.
|
|
18
|
+
* This is not cryptographic authentication or a boot nonce; local endpoint access
|
|
19
|
+
* is the upstream trust boundary. The call handle expires with the callback.
|
|
20
|
+
*
|
|
21
|
+
* IMPORTANT: v0.1.18 cli.rs/server + platform/unix.rs status_may_start_core() show
|
|
22
|
+
* `hc server status` ITSELF autostarts on Unix. Unix therefore connects directly
|
|
23
|
+
* via HC_SOCKET or documented defaults (only when no config override can exist),
|
|
24
|
+
* without starting a process.
|
|
25
|
+
* Public contract: herdr-core v0.1.18 schema/README.md "Connecting" and
|
|
26
|
+
* docs/security.md "State and endpoints". No undocumented endpoint discovery.
|
|
27
|
+
* On Windows only, status is require_existing; preflight precedes hc connect.
|
|
28
|
+
* That check is NOT atomic start avoidance: core could disappear before connect.
|
|
29
|
+
* Use an explicit endpoint even on Windows when strict no-autostart is required.
|
|
30
|
+
*/
|
|
31
|
+
export declare function withCoreSession<T>(operation: (call: CoreCall) => Promise<T>, options?: CoreSessionOptions): Promise<T>;
|
|
32
|
+
/** Standalone compatibility API: one call per bounded session. Multi-call operations
|
|
33
|
+
* MUST use withCoreSession, not repeated coreCall invocations. */
|
|
34
|
+
export declare const coreCall: CoreCall;
|
|
35
|
+
export declare function terminalAddress(value: unknown): asserts value is string;
|
|
36
|
+
/** SOURCE-BACKED PRIVATE FORMAT, not a stable app API or production-readiness claim.
|
|
37
|
+
* herdr-app v0.1.13 src/mirror.rs Document/SharedSpace/SharedTab and src/layout.rs
|
|
38
|
+
* Node/Kind/Content define this opaque core doc. There is NO app-version handshake:
|
|
39
|
+
* core 0.1.18 alone cannot establish app compatibility. An upstream versioned
|
|
40
|
+
* layout contract is still needed. Tested subset: rows/columns, terminal/mod blocks,
|
|
41
|
+
* and mod-only floats (src/layout.rs Float), whose IDs are checked too. Reject
|
|
42
|
+
* stacks, terminal floats and dynamic context/agent content anywhere, including
|
|
43
|
+
* unrelated tabs, rather than silently miss aliases.
|
|
44
|
+
* Unknown metadata is preserved verbatim, not interpreted as a layout extension.
|
|
45
|
+
* Private focus state is separate and is never inferred or changed here. */
|
|
46
|
+
export declare function locateTerminalTab(document: any, terminal: string): {
|
|
47
|
+
space: any;
|
|
48
|
+
tab: any;
|
|
49
|
+
pane: any;
|
|
50
|
+
};
|
|
51
|
+
/** Change only the owning tab name using the app's optimistic document protocol.
|
|
52
|
+
* Success proves shared state, not that an attached Windows window has rendered it. */
|
|
53
|
+
export declare function renameCoreTab(terminal: string, name: string, call?: CoreCall): Promise<void>;
|