@adhdev/daemon-core 0.9.74 → 0.9.76-rc.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.
- package/dist/cli-adapters/provider-cli-adapter.d.ts +1 -0
- package/dist/config/config.d.ts +3 -0
- package/dist/index.js +57 -19
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +57 -19
- package/dist/index.mjs.map +1 -1
- package/dist/repo-mesh-types.d.ts +1 -0
- package/package.json +2 -2
- package/src/cli-adapters/provider-cli-adapter.ts +23 -4
- package/src/commands/mesh-coordinator.ts +5 -0
- package/src/commands/router.ts +40 -11
- package/src/config/config.ts +6 -0
- package/src/mesh/coordinator-prompt.ts +7 -5
- package/src/repo-mesh-types.ts +1 -0
- package/node_modules/@adhdev/session-host-core/dist/defaults.d.mts +0 -6
- package/node_modules/@adhdev/session-host-core/dist/defaults.d.ts +0 -6
- package/node_modules/@adhdev/session-host-core/dist/defaults.js +0 -49
- package/node_modules/@adhdev/session-host-core/dist/defaults.js.map +0 -1
- package/node_modules/@adhdev/session-host-core/dist/defaults.mjs +0 -21
- package/node_modules/@adhdev/session-host-core/dist/defaults.mjs.map +0 -1
- package/node_modules/@adhdev/session-host-core/dist/index.d.mts +0 -444
- package/node_modules/@adhdev/session-host-core/dist/index.d.ts +0 -444
- package/node_modules/@adhdev/session-host-core/dist/index.js +0 -702
- package/node_modules/@adhdev/session-host-core/dist/index.js.map +0 -1
- package/node_modules/@adhdev/session-host-core/dist/index.mjs +0 -648
- package/node_modules/@adhdev/session-host-core/dist/index.mjs.map +0 -1
- package/node_modules/@adhdev/session-host-core/package.json +0 -49
|
@@ -144,6 +144,7 @@ export interface LocalMeshNodeEntry {
|
|
|
144
144
|
id: string;
|
|
145
145
|
workspace: string;
|
|
146
146
|
repoRoot?: string;
|
|
147
|
+
daemonId?: string;
|
|
147
148
|
userOverrides: Partial<RepoMeshNodeCapabilities>;
|
|
148
149
|
policy: RepoMeshNodePolicy;
|
|
149
150
|
/** For single-machine mesh: same daemon, different worktree */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adhdev/daemon-core",
|
|
3
|
-
"version": "0.9.
|
|
4
|
-
"description": "ADHDev daemon core
|
|
3
|
+
"version": "0.9.76-rc.1",
|
|
4
|
+
"description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -262,6 +262,23 @@ export class ProviderCliAdapter implements CliAdapter {
|
|
|
262
262
|
return screenText;
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
+
private getParseScreenText(screenText: string): string {
|
|
266
|
+
const currentSnapshot = normalizeScreenSnapshot(screenText);
|
|
267
|
+
const lastSnapshot = this.lastScreenSnapshot;
|
|
268
|
+
if (!lastSnapshot || lastSnapshot === currentSnapshot) return screenText;
|
|
269
|
+
const staleSnapshotLooksActive = /\besc to (?:interrupt|stop)\b|Enter to interrupt, Ctrl\+C to cancel/i.test(lastSnapshot);
|
|
270
|
+
const currentScreenLooksIdle = /(?:^|\n|\r)\s*[❯›>]\s*(?:\n|\r|$)/.test(screenText)
|
|
271
|
+
&& !/\besc to (?:interrupt|stop)\b|Enter to interrupt, Ctrl\+C to cancel/i.test(screenText);
|
|
272
|
+
if (staleSnapshotLooksActive && currentScreenLooksIdle) return screenText;
|
|
273
|
+
if (currentSnapshot.length >= lastSnapshot.length) return screenText;
|
|
274
|
+
// Terminal screen reads can miss a just-rendered completed Hermes box while
|
|
275
|
+
// the normalized snapshot captured during output still has it. Feed both
|
|
276
|
+
// views to provider parsers so flattened snapshot-only final bubbles do
|
|
277
|
+
// not disappear from read_chat/chat_tail, but only when the older snapshot
|
|
278
|
+
// carries extra content instead of stale status chrome.
|
|
279
|
+
return `${screenText}\n${lastSnapshot}`;
|
|
280
|
+
}
|
|
281
|
+
|
|
265
282
|
private shouldReadTerminalScreenSnapshot(now: number): boolean {
|
|
266
283
|
if (!this.lastScreenText) return true;
|
|
267
284
|
return (now - this.lastScreenSnapshotReadAt) >= ProviderCliAdapter.SCREEN_SNAPSHOT_MIN_INTERVAL_MS;
|
|
@@ -1424,12 +1441,13 @@ export class ProviderCliAdapter implements CliAdapter {
|
|
|
1424
1441
|
}
|
|
1425
1442
|
try {
|
|
1426
1443
|
const screenText = this.terminalScreen.getText();
|
|
1444
|
+
const parseScreenText = this.getParseScreenText(screenText);
|
|
1427
1445
|
const tail = this.recentOutputBuffer.slice(-500);
|
|
1428
1446
|
const input = buildCliParseInput({
|
|
1429
1447
|
accumulatedBuffer: this.accumulatedBuffer,
|
|
1430
1448
|
accumulatedRawBuffer: this.accumulatedRawBuffer,
|
|
1431
1449
|
recentOutputBuffer: this.recentOutputBuffer,
|
|
1432
|
-
terminalScreenText:
|
|
1450
|
+
terminalScreenText: parseScreenText,
|
|
1433
1451
|
baseMessages: [],
|
|
1434
1452
|
partialResponse: this.responseBuffer,
|
|
1435
1453
|
isWaitingForResponse: this.isWaitingForResponse,
|
|
@@ -1534,6 +1552,7 @@ export class ProviderCliAdapter implements CliAdapter {
|
|
|
1534
1552
|
*/
|
|
1535
1553
|
getScriptParsedStatus(): any {
|
|
1536
1554
|
const screenText = this.readTerminalScreenText();
|
|
1555
|
+
const parseScreenText = this.getParseScreenText(screenText);
|
|
1537
1556
|
const cached = this.parsedStatusCache;
|
|
1538
1557
|
if (
|
|
1539
1558
|
cached
|
|
@@ -1541,7 +1560,7 @@ export class ProviderCliAdapter implements CliAdapter {
|
|
|
1541
1560
|
&& cached.currentTurnScope === this.currentTurnScope
|
|
1542
1561
|
&& cached.recentOutputBuffer === this.recentOutputBuffer
|
|
1543
1562
|
&& cached.accumulatedBuffer === this.accumulatedBuffer
|
|
1544
|
-
&& cached.screenText ===
|
|
1563
|
+
&& cached.screenText === parseScreenText
|
|
1545
1564
|
&& cached.currentStatus === this.currentStatus
|
|
1546
1565
|
&& cached.activeModal === this.activeModal
|
|
1547
1566
|
&& cached.cliName === this.cliName
|
|
@@ -1580,7 +1599,7 @@ export class ProviderCliAdapter implements CliAdapter {
|
|
|
1580
1599
|
currentTurnScope: this.currentTurnScope,
|
|
1581
1600
|
recentOutputBuffer: this.recentOutputBuffer,
|
|
1582
1601
|
accumulatedBuffer: this.accumulatedBuffer,
|
|
1583
|
-
screenText,
|
|
1602
|
+
screenText: parseScreenText,
|
|
1584
1603
|
currentStatus: this.currentStatus,
|
|
1585
1604
|
activeModal: this.activeModal,
|
|
1586
1605
|
cliName: this.cliName,
|
|
@@ -1598,7 +1617,7 @@ export class ProviderCliAdapter implements CliAdapter {
|
|
|
1598
1617
|
accumulatedBuffer: this.accumulatedBuffer,
|
|
1599
1618
|
accumulatedRawBuffer: this.accumulatedRawBuffer,
|
|
1600
1619
|
recentOutputBuffer: this.recentOutputBuffer,
|
|
1601
|
-
terminalScreenText: this.terminalScreen.getText(),
|
|
1620
|
+
terminalScreenText: this.getParseScreenText(this.terminalScreen.getText()),
|
|
1602
1621
|
baseMessages: [],
|
|
1603
1622
|
partialResponse: this.responseBuffer,
|
|
1604
1623
|
isWaitingForResponse: this.isWaitingForResponse,
|
|
@@ -149,6 +149,11 @@ function resolveAdhdevMcpEntryPath(explicitPath?: string): string | null {
|
|
|
149
149
|
addCandidate(resolve(dir, '../vendor/mcp-server/index.js'))
|
|
150
150
|
addCandidate(resolve(dir, '../../vendor/mcp-server/index.js'))
|
|
151
151
|
addCandidate(resolve(dir, '../../../vendor/mcp-server/index.js'))
|
|
152
|
+
// Source checkout/dev mode does not vendor the MCP server into daemon-standalone.
|
|
153
|
+
// Resolve the sibling workspace build directly so Repo Mesh auto-import still
|
|
154
|
+
// writes an absolute Node entrypoint instead of falling back to a PATH bin shim.
|
|
155
|
+
addCandidate(resolve(dir, '../../mcp-server/dist/index.js'))
|
|
156
|
+
addCandidate(resolve(dir, '../../../mcp-server/dist/index.js'))
|
|
152
157
|
}
|
|
153
158
|
|
|
154
159
|
addPackagedCandidates(process.argv[1])
|
package/src/commands/router.ts
CHANGED
|
@@ -38,6 +38,25 @@ import { buildSessionEntries } from '../status/builders.js';
|
|
|
38
38
|
import { buildMachineInfo, buildStatusSnapshot } from '../status/snapshot.js';
|
|
39
39
|
import { getSessionCompletionMarker } from '../status/snapshot.js';
|
|
40
40
|
import { execNpmCommandSync, resolveCurrentGlobalInstallSurface, spawnDetachedDaemonUpgradeHelper } from './upgrade-helper.js';
|
|
41
|
+
|
|
42
|
+
type ReleaseChannel = 'stable' | 'preview';
|
|
43
|
+
const CHANNEL_NPM_TAG: Record<ReleaseChannel, 'latest' | 'next'> = { stable: 'latest', preview: 'next' };
|
|
44
|
+
|
|
45
|
+
function normalizeReleaseChannel(value: unknown): ReleaseChannel | null {
|
|
46
|
+
if (typeof value !== 'string') return null;
|
|
47
|
+
const normalized = value.trim().toLowerCase();
|
|
48
|
+
if (normalized === 'stable' || normalized === 'latest') return 'stable';
|
|
49
|
+
if (normalized === 'preview' || normalized === 'next') return 'preview';
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function resolveUpgradeChannel(args: any): ReleaseChannel {
|
|
54
|
+
return normalizeReleaseChannel(args?.channel)
|
|
55
|
+
|| normalizeReleaseChannel(args?.updatePolicy?.channel)
|
|
56
|
+
|| normalizeReleaseChannel(args?.npmTag)
|
|
57
|
+
|| normalizeReleaseChannel(loadConfig().updateChannel)
|
|
58
|
+
|| 'stable';
|
|
59
|
+
}
|
|
41
60
|
import * as fs from 'fs';
|
|
42
61
|
|
|
43
62
|
// ─── Types ───
|
|
@@ -867,10 +886,12 @@ export class DaemonCommandRouter {
|
|
|
867
886
|
|| process.argv[1]?.includes('daemon-standalone');
|
|
868
887
|
const pkgName = isStandalone ? '@adhdev/daemon-standalone' : 'adhdev';
|
|
869
888
|
const npmSurface = resolveCurrentGlobalInstallSurface({ packageName: pkgName });
|
|
889
|
+
const channel = resolveUpgradeChannel(args);
|
|
890
|
+
const npmTag = CHANNEL_NPM_TAG[channel];
|
|
870
891
|
|
|
871
|
-
// Check
|
|
872
|
-
const latest = String(execNpmCommandSync(['view', pkgName
|
|
873
|
-
LOG.info('Upgrade', `Latest ${pkgName}: v${latest}`);
|
|
892
|
+
// Check channel-pinned dist-tag and resolve it to a concrete install version.
|
|
893
|
+
const latest = String(execNpmCommandSync(['view', `${pkgName}@${npmTag}`, 'version'], { encoding: 'utf-8', timeout: 10000 }, npmSurface)).trim();
|
|
894
|
+
LOG.info('Upgrade', `Latest ${pkgName}@${npmTag}: v${latest}`);
|
|
874
895
|
let currentInstalled: string | null = null;
|
|
875
896
|
try {
|
|
876
897
|
const currentJson = String(execNpmCommandSync(['ls', '-g', pkgName, '--depth=0', '--json'], {
|
|
@@ -888,8 +909,8 @@ export class DaemonCommandRouter {
|
|
|
888
909
|
? this.deps.statusVersion.trim().replace(/^v/, '')
|
|
889
910
|
: null;
|
|
890
911
|
if (currentInstalled === latest && runningVersion === latest) {
|
|
891
|
-
LOG.info('Upgrade', `Already on
|
|
892
|
-
return { success: true, upgraded: false, alreadyLatest: true, version: latest };
|
|
912
|
+
LOG.info('Upgrade', `Already on ${channel} channel version v${latest}; skipping install`);
|
|
913
|
+
return { success: true, upgraded: false, alreadyLatest: true, version: latest, channel, npmTag };
|
|
893
914
|
}
|
|
894
915
|
if (currentInstalled === latest && runningVersion && runningVersion !== latest) {
|
|
895
916
|
LOG.info('Upgrade', `Installed package is v${latest}, but running daemon is v${runningVersion}; scheduling restart`);
|
|
@@ -903,7 +924,7 @@ export class DaemonCommandRouter {
|
|
|
903
924
|
cwd: process.cwd(),
|
|
904
925
|
sessionHostAppName: process.env.ADHDEV_SESSION_HOST_NAME || 'adhdev',
|
|
905
926
|
});
|
|
906
|
-
LOG.info('Upgrade', `Scheduled detached upgrade to v${latest}`);
|
|
927
|
+
LOG.info('Upgrade', `Scheduled detached ${channel} upgrade to v${latest}`);
|
|
907
928
|
|
|
908
929
|
// Exit after the command response has been sent so the helper can replace the package cleanly.
|
|
909
930
|
setTimeout(() => {
|
|
@@ -911,7 +932,7 @@ export class DaemonCommandRouter {
|
|
|
911
932
|
process.exit(0);
|
|
912
933
|
}, 3000);
|
|
913
934
|
|
|
914
|
-
return { success: true, upgraded: true, version: latest, restarting: true };
|
|
935
|
+
return { success: true, upgraded: true, version: latest, restarting: true, channel, npmTag };
|
|
915
936
|
} catch (e: any) {
|
|
916
937
|
LOG.error('Upgrade', `Failed: ${e.message}`);
|
|
917
938
|
return { success: false, error: e.message };
|
|
@@ -1101,14 +1122,22 @@ export class DaemonCommandRouter {
|
|
|
1101
1122
|
}
|
|
1102
1123
|
|
|
1103
1124
|
// Merge ADHDev mesh server into existing config.
|
|
1125
|
+
// Pass full mesh data as env var so the MCP server can bootstrap
|
|
1126
|
+
// without depending on meshes.json or a running daemon.
|
|
1127
|
+
const mcpServerEntry: Record<string, any> = {
|
|
1128
|
+
command: coordinatorSetup.mcpServer.command,
|
|
1129
|
+
args: coordinatorSetup.mcpServer.args,
|
|
1130
|
+
};
|
|
1131
|
+
if (args?.inlineMesh) {
|
|
1132
|
+
mcpServerEntry.env = {
|
|
1133
|
+
ADHDEV_INLINE_MESH: JSON.stringify(mesh),
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1104
1136
|
const mcpConfig = {
|
|
1105
1137
|
...existingMcpConfig,
|
|
1106
1138
|
mcpServers: {
|
|
1107
1139
|
...(existingMcpConfig.mcpServers || {}),
|
|
1108
|
-
[coordinatorSetup.serverName]:
|
|
1109
|
-
command: coordinatorSetup.mcpServer.command,
|
|
1110
|
-
args: coordinatorSetup.mcpServer.args,
|
|
1111
|
-
},
|
|
1140
|
+
[coordinatorSetup.serverName]: mcpServerEntry,
|
|
1112
1141
|
},
|
|
1113
1142
|
};
|
|
1114
1143
|
writeFileSync(mcpConfigPath, JSON.stringify(mcpConfig, null, 2), 'utf-8');
|
package/src/config/config.ts
CHANGED
|
@@ -15,6 +15,7 @@ export type { SavedProviderSessionEntry } from './saved-sessions.js';
|
|
|
15
15
|
export type { DaemonState } from './state-store.js';
|
|
16
16
|
|
|
17
17
|
export type ProviderSourceMode = 'normal' | 'no-upstream';
|
|
18
|
+
export type ReleaseChannel = 'stable' | 'preview';
|
|
18
19
|
|
|
19
20
|
export function resolveProviderSourceMode(
|
|
20
21
|
providerSourceMode: unknown,
|
|
@@ -122,6 +123,9 @@ export interface ADHDevConfig {
|
|
|
122
123
|
// Optional explicit provider override root (for example a local adhdev-providers checkout)
|
|
123
124
|
providerDir?: string;
|
|
124
125
|
|
|
126
|
+
/** Preferred daemon update channel. Defaults to stable/latest. */
|
|
127
|
+
updateChannel?: ReleaseChannel;
|
|
128
|
+
|
|
125
129
|
/**
|
|
126
130
|
* Browser terminal sizing behavior for dashboard CLI panes.
|
|
127
131
|
* Default `measured` keeps terminal size daemon-authoritative.
|
|
@@ -151,6 +155,7 @@ const DEFAULT_CONFIG: ADHDevConfig = {
|
|
|
151
155
|
machineProviders: {},
|
|
152
156
|
ideSettings: {},
|
|
153
157
|
providerSourceMode: 'normal',
|
|
158
|
+
updateChannel: 'stable',
|
|
154
159
|
terminalSizingMode: 'measured',
|
|
155
160
|
};
|
|
156
161
|
|
|
@@ -228,6 +233,7 @@ function normalizeConfig(raw: unknown): ADHDevConfig & { activeWorkspaceId?: str
|
|
|
228
233
|
ideSettings: isPlainObject(parsed.ideSettings) ? parsed.ideSettings : {},
|
|
229
234
|
providerSourceMode: resolveProviderSourceMode(parsed.providerSourceMode, parsed.disableUpstream),
|
|
230
235
|
providerDir: asOptionalString(parsed.providerDir),
|
|
236
|
+
updateChannel: parsed.updateChannel === 'preview' ? 'preview' : 'stable',
|
|
231
237
|
terminalSizingMode: parsed.terminalSizingMode === 'fit' ? 'fit' : 'measured',
|
|
232
238
|
};
|
|
233
239
|
}
|
|
@@ -92,7 +92,7 @@ function buildNodeConfigSection(mesh: LocalMeshEntry): string {
|
|
|
92
92
|
for (const n of mesh.nodes) {
|
|
93
93
|
const labels: string[] = [];
|
|
94
94
|
if (n.isLocalWorktree) labels.push('worktree');
|
|
95
|
-
if (n.policy
|
|
95
|
+
if (n.policy?.readOnly) labels.push('read-only');
|
|
96
96
|
const suffix = labels.length ? ` [${labels.join(', ')}]` : '';
|
|
97
97
|
lines.push(`- **${n.workspace}** (${n.id})${suffix}`);
|
|
98
98
|
}
|
|
@@ -139,7 +139,7 @@ const WORKFLOW_SECTION = `## Orchestration Workflow
|
|
|
139
139
|
3. **Delegate** — For each task:
|
|
140
140
|
a. Pick the best node (consider: health, dirty state, current workload).
|
|
141
141
|
b. If no session exists, call \`mesh_launch_session\` to start one.
|
|
142
|
-
c. Call \`mesh_send_task\` with a
|
|
142
|
+
c. Call \`mesh_send_task\` with a **complete, self-contained** instruction that includes all context the agent needs (file paths, line numbers, what to change, why). Do not send partial instructions expecting future follow-up.
|
|
143
143
|
4. **Monitor** — Periodically call \`mesh_read_chat\` to check progress. Handle approvals via \`mesh_approve\`.
|
|
144
144
|
5. **Verify** — When a task reports completion, call \`mesh_git_status\` to verify changes were made.
|
|
145
145
|
6. **Checkpoint** — Call \`mesh_checkpoint\` to save the work.
|
|
@@ -147,10 +147,12 @@ const WORKFLOW_SECTION = `## Orchestration Workflow
|
|
|
147
147
|
|
|
148
148
|
const RULES_SECTION = `## Rules
|
|
149
149
|
|
|
150
|
-
- **
|
|
151
|
-
- **
|
|
150
|
+
- **Minimize coordinator context.** The coordinator's job is routing, not implementing. Do not read source files, run commands, or analyze code directly — delegate all of that to node agents. Your context should stay lean.
|
|
151
|
+
- **Delegate analysis too.** If you need to understand a bug or explore the codebase, send that investigation as a task to a node. Do not do it yourself.
|
|
152
|
+
- **Front-load the task message.** When calling \`mesh_send_task\`, include everything the agent needs: what files to touch, what the problem is, what the fix should look like. The agent won't ask follow-up questions.
|
|
153
|
+
- **Don't inspect code.** Trust the agent's output. Verify via \`mesh_git_status\`, not by reading source files.
|
|
152
154
|
- **Don't over-parallelize.** Start with 1-2 concurrent tasks. Scale up if they succeed.
|
|
153
155
|
- **Handle failures gracefully.** If a task fails, read the chat to understand why, then retry or reassign.
|
|
154
|
-
- **Keep the user informed.** Report progress after each delegation round.
|
|
156
|
+
- **Keep the user informed.** Report progress after each delegation round — one or two sentences, not a narration.
|
|
155
157
|
- **Respect node capabilities.** Don't send build tasks to read-only nodes. Don't push from nodes that aren't allowed to.
|
|
156
158
|
- **Never fabricate tool results.** Always call the actual tool; never pretend you did.`;
|
package/src/repo-mesh-types.ts
CHANGED
|
@@ -184,6 +184,7 @@ export interface LocalMeshNodeEntry {
|
|
|
184
184
|
id: string;
|
|
185
185
|
workspace: string;
|
|
186
186
|
repoRoot?: string;
|
|
187
|
+
daemonId?: string;
|
|
187
188
|
userOverrides: Partial<RepoMeshNodeCapabilities>;
|
|
188
189
|
policy: RepoMeshNodePolicy;
|
|
189
190
|
/** For single-machine mesh: same daemon, different worktree */
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
declare const DEFAULT_SESSION_HOST_COLS = 80;
|
|
2
|
-
declare const DEFAULT_SESSION_HOST_ROWS = 32;
|
|
3
|
-
declare function resolveSessionHostCols(value: number | undefined): number;
|
|
4
|
-
declare function resolveSessionHostRows(value: number | undefined): number;
|
|
5
|
-
|
|
6
|
-
export { DEFAULT_SESSION_HOST_COLS, DEFAULT_SESSION_HOST_ROWS, resolveSessionHostCols, resolveSessionHostRows };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
declare const DEFAULT_SESSION_HOST_COLS = 80;
|
|
2
|
-
declare const DEFAULT_SESSION_HOST_ROWS = 32;
|
|
3
|
-
declare function resolveSessionHostCols(value: number | undefined): number;
|
|
4
|
-
declare function resolveSessionHostRows(value: number | undefined): number;
|
|
5
|
-
|
|
6
|
-
export { DEFAULT_SESSION_HOST_COLS, DEFAULT_SESSION_HOST_ROWS, resolveSessionHostCols, resolveSessionHostRows };
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/defaults.ts
|
|
21
|
-
var defaults_exports = {};
|
|
22
|
-
__export(defaults_exports, {
|
|
23
|
-
DEFAULT_SESSION_HOST_COLS: () => DEFAULT_SESSION_HOST_COLS,
|
|
24
|
-
DEFAULT_SESSION_HOST_ROWS: () => DEFAULT_SESSION_HOST_ROWS,
|
|
25
|
-
resolveSessionHostCols: () => resolveSessionHostCols,
|
|
26
|
-
resolveSessionHostRows: () => resolveSessionHostRows
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(defaults_exports);
|
|
29
|
-
var DEFAULT_SESSION_HOST_COLS = 80;
|
|
30
|
-
var DEFAULT_SESSION_HOST_ROWS = 32;
|
|
31
|
-
function normalizeSessionHostDimension(value, fallback) {
|
|
32
|
-
if (typeof value !== "number" || !Number.isFinite(value)) return fallback;
|
|
33
|
-
const rounded = Math.floor(value);
|
|
34
|
-
return rounded > 0 ? rounded : fallback;
|
|
35
|
-
}
|
|
36
|
-
function resolveSessionHostCols(value) {
|
|
37
|
-
return normalizeSessionHostDimension(value, DEFAULT_SESSION_HOST_COLS);
|
|
38
|
-
}
|
|
39
|
-
function resolveSessionHostRows(value) {
|
|
40
|
-
return normalizeSessionHostDimension(value, DEFAULT_SESSION_HOST_ROWS);
|
|
41
|
-
}
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
DEFAULT_SESSION_HOST_COLS,
|
|
45
|
-
DEFAULT_SESSION_HOST_ROWS,
|
|
46
|
-
resolveSessionHostCols,
|
|
47
|
-
resolveSessionHostRows
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=defaults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.ts"],"sourcesContent":["export const DEFAULT_SESSION_HOST_COLS = 80;\nexport const DEFAULT_SESSION_HOST_ROWS = 32;\n\nfunction normalizeSessionHostDimension(value: number | undefined, fallback: number): number {\n if (typeof value !== 'number' || !Number.isFinite(value)) return fallback;\n const rounded = Math.floor(value);\n return rounded > 0 ? rounded : fallback;\n}\n\nexport function resolveSessionHostCols(value: number | undefined): number {\n return normalizeSessionHostDimension(value, DEFAULT_SESSION_HOST_COLS);\n}\n\nexport function resolveSessionHostRows(value: number | undefined): number {\n return normalizeSessionHostDimension(value, DEFAULT_SESSION_HOST_ROWS);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,4BAA4B;AAClC,IAAM,4BAA4B;AAEzC,SAAS,8BAA8B,OAA2B,UAA0B;AAC1F,MAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,EAAG,QAAO;AACjE,QAAM,UAAU,KAAK,MAAM,KAAK;AAChC,SAAO,UAAU,IAAI,UAAU;AACjC;AAEO,SAAS,uBAAuB,OAAmC;AACxE,SAAO,8BAA8B,OAAO,yBAAyB;AACvE;AAEO,SAAS,uBAAuB,OAAmC;AACxE,SAAO,8BAA8B,OAAO,yBAAyB;AACvE;","names":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// src/defaults.ts
|
|
2
|
-
var DEFAULT_SESSION_HOST_COLS = 80;
|
|
3
|
-
var DEFAULT_SESSION_HOST_ROWS = 32;
|
|
4
|
-
function normalizeSessionHostDimension(value, fallback) {
|
|
5
|
-
if (typeof value !== "number" || !Number.isFinite(value)) return fallback;
|
|
6
|
-
const rounded = Math.floor(value);
|
|
7
|
-
return rounded > 0 ? rounded : fallback;
|
|
8
|
-
}
|
|
9
|
-
function resolveSessionHostCols(value) {
|
|
10
|
-
return normalizeSessionHostDimension(value, DEFAULT_SESSION_HOST_COLS);
|
|
11
|
-
}
|
|
12
|
-
function resolveSessionHostRows(value) {
|
|
13
|
-
return normalizeSessionHostDimension(value, DEFAULT_SESSION_HOST_ROWS);
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
DEFAULT_SESSION_HOST_COLS,
|
|
17
|
-
DEFAULT_SESSION_HOST_ROWS,
|
|
18
|
-
resolveSessionHostCols,
|
|
19
|
-
resolveSessionHostRows
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=defaults.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/defaults.ts"],"sourcesContent":["export const DEFAULT_SESSION_HOST_COLS = 80;\nexport const DEFAULT_SESSION_HOST_ROWS = 32;\n\nfunction normalizeSessionHostDimension(value: number | undefined, fallback: number): number {\n if (typeof value !== 'number' || !Number.isFinite(value)) return fallback;\n const rounded = Math.floor(value);\n return rounded > 0 ? rounded : fallback;\n}\n\nexport function resolveSessionHostCols(value: number | undefined): number {\n return normalizeSessionHostDimension(value, DEFAULT_SESSION_HOST_COLS);\n}\n\nexport function resolveSessionHostRows(value: number | undefined): number {\n return normalizeSessionHostDimension(value, DEFAULT_SESSION_HOST_ROWS);\n}\n"],"mappings":";AAAO,IAAM,4BAA4B;AAClC,IAAM,4BAA4B;AAEzC,SAAS,8BAA8B,OAA2B,UAA0B;AAC1F,MAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,EAAG,QAAO;AACjE,QAAM,UAAU,KAAK,MAAM,KAAK;AAChC,SAAO,UAAU,IAAI,UAAU;AACjC;AAEO,SAAS,uBAAuB,OAAmC;AACxE,SAAO,8BAA8B,OAAO,yBAAyB;AACvE;AAEO,SAAS,uBAAuB,OAAmC;AACxE,SAAO,8BAA8B,OAAO,yBAAyB;AACvE;","names":[]}
|