@indianic/dialout 1.1.1 → 1.2.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 +429 -16
- package/bin/AGENTS.md +44 -0
- package/bin/devdash-agent.js +2 -0
- package/dist/ai-adapters/claude.d.ts +3 -0
- package/dist/ai-adapters/claude.d.ts.map +1 -0
- package/dist/ai-adapters/claude.js +98 -0
- package/dist/ai-adapters/claude.js.map +1 -0
- package/dist/ai-adapters/codex.d.ts +3 -0
- package/dist/ai-adapters/codex.d.ts.map +1 -0
- package/dist/ai-adapters/codex.js +147 -0
- package/dist/ai-adapters/codex.js.map +1 -0
- package/dist/ai-adapters/grok.d.ts +3 -0
- package/dist/ai-adapters/grok.d.ts.map +1 -0
- package/dist/ai-adapters/grok.js +164 -0
- package/dist/ai-adapters/grok.js.map +1 -0
- package/dist/ai-adapters/index.d.ts +5 -0
- package/dist/ai-adapters/index.d.ts.map +1 -0
- package/dist/ai-adapters/index.js +30 -0
- package/dist/ai-adapters/index.js.map +1 -0
- package/dist/ai-adapters/types.d.ts +3 -0
- package/dist/ai-adapters/types.d.ts.map +1 -0
- package/dist/ai-adapters/types.js +7 -0
- package/dist/ai-adapters/types.js.map +1 -0
- package/dist/ai-capabilities/claude.d.ts +4 -0
- package/dist/ai-capabilities/claude.d.ts.map +1 -0
- package/dist/ai-capabilities/claude.js +174 -0
- package/dist/ai-capabilities/claude.js.map +1 -0
- package/dist/ai-capabilities/describe.d.ts +2 -0
- package/dist/ai-capabilities/describe.d.ts.map +1 -0
- package/dist/ai-capabilities/describe.js +31 -0
- package/dist/ai-capabilities/describe.js.map +1 -0
- package/dist/ai-capabilities/fsdeps.d.ts +3 -0
- package/dist/ai-capabilities/fsdeps.d.ts.map +1 -0
- package/dist/ai-capabilities/fsdeps.js +71 -0
- package/dist/ai-capabilities/fsdeps.js.map +1 -0
- package/dist/ai-capabilities/grok.d.ts +5 -0
- package/dist/ai-capabilities/grok.d.ts.map +1 -0
- package/dist/ai-capabilities/grok.js +145 -0
- package/dist/ai-capabilities/grok.js.map +1 -0
- package/dist/ai-capabilities/index.d.ts +4 -0
- package/dist/ai-capabilities/index.d.ts.map +1 -0
- package/dist/ai-capabilities/index.js +94 -0
- package/dist/ai-capabilities/index.js.map +1 -0
- package/dist/ai-capabilities/redact.d.ts +2 -0
- package/dist/ai-capabilities/redact.d.ts.map +1 -0
- package/dist/ai-capabilities/redact.js +27 -0
- package/dist/ai-capabilities/redact.js.map +1 -0
- package/dist/ai-capabilities/types.d.ts +11 -0
- package/dist/ai-capabilities/types.d.ts.map +1 -0
- package/dist/ai-capabilities/types.js +3 -0
- package/dist/ai-capabilities/types.js.map +1 -0
- package/dist/ai-launch.d.ts +35 -0
- package/dist/ai-launch.d.ts.map +1 -0
- package/dist/ai-launch.js +211 -0
- package/dist/ai-launch.js.map +1 -0
- package/dist/ai-session-detector.d.ts +19 -0
- package/dist/ai-session-detector.d.ts.map +1 -0
- package/dist/ai-session-detector.js +79 -0
- package/dist/ai-session-detector.js.map +1 -0
- package/dist/ai-sessions.d.ts +36 -0
- package/dist/ai-sessions.d.ts.map +1 -0
- package/dist/ai-sessions.js +309 -0
- package/dist/ai-sessions.js.map +1 -0
- package/dist/ai-status.d.ts +6 -0
- package/dist/ai-status.d.ts.map +1 -0
- package/dist/ai-status.js +40 -0
- package/dist/ai-status.js.map +1 -0
- package/dist/ai-transcript-locator.d.ts +35 -0
- package/dist/ai-transcript-locator.d.ts.map +1 -0
- package/dist/ai-transcript-locator.js +268 -0
- package/dist/ai-transcript-locator.js.map +1 -0
- package/dist/ai-transcript-tail.d.ts +17 -0
- package/dist/ai-transcript-tail.d.ts.map +1 -0
- package/dist/ai-transcript-tail.js +120 -0
- package/dist/ai-transcript-tail.js.map +1 -0
- package/dist/checklist.d.ts +20 -0
- package/dist/checklist.d.ts.map +1 -0
- package/dist/checklist.js +51 -0
- package/dist/checklist.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +1427 -0
- package/dist/cli.js.map +1 -0
- package/dist/command-runner.d.ts +15 -0
- package/dist/command-runner.d.ts.map +1 -0
- package/dist/command-runner.js +84 -0
- package/dist/command-runner.js.map +1 -0
- package/dist/config.d.ts +41 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +152 -0
- package/dist/config.js.map +1 -0
- package/dist/cowork.d.ts +26 -0
- package/dist/cowork.d.ts.map +1 -0
- package/dist/cowork.js +370 -0
- package/dist/cowork.js.map +1 -0
- package/dist/fs-browser.d.ts +6 -0
- package/dist/fs-browser.d.ts.map +1 -0
- package/dist/fs-browser.js +61 -0
- package/dist/fs-browser.js.map +1 -0
- package/dist/has-command.d.ts +12 -0
- package/dist/has-command.d.ts.map +1 -0
- package/dist/has-command.js +24 -0
- package/dist/has-command.js.map +1 -0
- package/dist/heartbeat.d.ts +7 -0
- package/dist/heartbeat.d.ts.map +1 -0
- package/dist/heartbeat.js +50 -0
- package/dist/heartbeat.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -0
- package/dist/port-scanner.d.ts +4 -0
- package/dist/port-scanner.d.ts.map +1 -0
- package/dist/port-scanner.js +75 -0
- package/dist/port-scanner.js.map +1 -0
- package/dist/project-scanner.d.ts +15 -0
- package/dist/project-scanner.d.ts.map +1 -0
- package/dist/project-scanner.js +333 -0
- package/dist/project-scanner.js.map +1 -0
- package/dist/pty-manager.d.ts +28 -0
- package/dist/pty-manager.d.ts.map +1 -0
- package/dist/pty-manager.js +506 -0
- package/dist/pty-manager.js.map +1 -0
- package/dist/service-installer.d.ts +95 -0
- package/dist/service-installer.d.ts.map +1 -0
- package/dist/service-installer.js +911 -0
- package/dist/service-installer.js.map +1 -0
- package/dist/single-instance.d.ts +20 -0
- package/dist/single-instance.d.ts.map +1 -0
- package/dist/single-instance.js +151 -0
- package/dist/single-instance.js.map +1 -0
- package/dist/ssh-local-network.d.ts +26 -0
- package/dist/ssh-local-network.d.ts.map +1 -0
- package/dist/ssh-local-network.js +169 -0
- package/dist/ssh-local-network.js.map +1 -0
- package/dist/terminal-detect.d.ts +52 -0
- package/dist/terminal-detect.d.ts.map +1 -0
- package/dist/terminal-detect.js +147 -0
- package/dist/terminal-detect.js.map +1 -0
- package/dist/terminal-markers.d.ts +52 -0
- package/dist/terminal-markers.d.ts.map +1 -0
- package/dist/terminal-markers.js +174 -0
- package/dist/terminal-markers.js.map +1 -0
- package/dist/tmux-manager.d.ts +35 -0
- package/dist/tmux-manager.d.ts.map +1 -0
- package/dist/tmux-manager.js +274 -0
- package/dist/tmux-manager.js.map +1 -0
- package/dist/update-check.d.ts +3 -0
- package/dist/update-check.d.ts.map +1 -0
- package/dist/update-check.js +202 -0
- package/dist/update-check.js.map +1 -0
- package/dist/websocket.d.ts +8 -0
- package/dist/websocket.d.ts.map +1 -0
- package/dist/websocket.js +472 -0
- package/dist/websocket.js.map +1 -0
- package/node_modules/@dialout/shared/README.md +16 -0
- package/node_modules/@dialout/shared/dist/ai-chat-prefs.d.ts +8 -0
- package/node_modules/@dialout/shared/dist/ai-chat-prefs.d.ts.map +1 -0
- package/node_modules/@dialout/shared/dist/ai-chat-prefs.js +41 -0
- package/node_modules/@dialout/shared/dist/capabilities.d.ts +25 -0
- package/node_modules/@dialout/shared/dist/capabilities.d.ts.map +1 -0
- package/node_modules/@dialout/shared/dist/capabilities.js +2 -0
- package/node_modules/@dialout/shared/dist/chat-blocks.d.ts +33 -0
- package/node_modules/@dialout/shared/dist/chat-blocks.d.ts.map +1 -0
- package/node_modules/@dialout/shared/dist/chat-blocks.js +61 -0
- package/node_modules/@dialout/shared/dist/command-filter.d.ts +4 -0
- package/node_modules/@dialout/shared/dist/command-filter.d.ts.map +1 -0
- package/node_modules/@dialout/shared/dist/command-filter.js +49 -0
- package/node_modules/@dialout/shared/dist/composer-behaviour.d.ts +6 -0
- package/node_modules/@dialout/shared/dist/composer-behaviour.d.ts.map +1 -0
- package/node_modules/@dialout/shared/dist/composer-behaviour.js +24 -0
- package/node_modules/@dialout/shared/dist/events.d.ts +37 -0
- package/node_modules/@dialout/shared/dist/events.d.ts.map +1 -0
- package/node_modules/@dialout/shared/dist/events.js +13 -0
- package/node_modules/@dialout/shared/dist/index.d.ts +21 -0
- package/node_modules/@dialout/shared/dist/index.d.ts.map +1 -0
- package/node_modules/@dialout/shared/dist/index.js +37 -0
- package/node_modules/@dialout/shared/dist/kinds.d.ts +2 -0
- package/node_modules/@dialout/shared/dist/kinds.d.ts.map +1 -0
- package/node_modules/@dialout/shared/dist/kinds.js +2 -0
- package/node_modules/@dialout/shared/dist/notify.d.ts +3 -0
- package/node_modules/@dialout/shared/dist/notify.d.ts.map +1 -0
- package/node_modules/@dialout/shared/dist/notify.js +31 -0
- package/node_modules/@dialout/shared/dist/permission.d.ts +4 -0
- package/node_modules/@dialout/shared/dist/permission.d.ts.map +1 -0
- package/node_modules/@dialout/shared/dist/permission.js +8 -0
- package/node_modules/@dialout/shared/dist/scroll-pin.d.ts +3 -0
- package/node_modules/@dialout/shared/dist/scroll-pin.d.ts.map +1 -0
- package/node_modules/@dialout/shared/dist/scroll-pin.js +11 -0
- package/node_modules/@dialout/shared/dist/session.d.ts +19 -0
- package/node_modules/@dialout/shared/dist/session.d.ts.map +1 -0
- package/node_modules/@dialout/shared/dist/session.js +6 -0
- package/node_modules/@dialout/shared/dist/terminal-name.d.ts +25 -0
- package/node_modules/@dialout/shared/dist/terminal-name.d.ts.map +1 -0
- package/node_modules/@dialout/shared/dist/terminal-name.js +63 -0
- package/node_modules/@dialout/shared/dist/tool-appearance.d.ts +9 -0
- package/node_modules/@dialout/shared/dist/tool-appearance.d.ts.map +1 -0
- package/node_modules/@dialout/shared/dist/tool-appearance.js +30 -0
- package/node_modules/@dialout/shared/package.json +37 -0
- package/node_modules/@dialout/shared/src/ai-chat-prefs.test.ts +40 -0
- package/node_modules/@dialout/shared/src/ai-chat-prefs.ts +39 -0
- package/node_modules/@dialout/shared/src/capabilities.ts +30 -0
- package/node_modules/@dialout/shared/src/chat-blocks.test.ts +65 -0
- package/node_modules/@dialout/shared/src/chat-blocks.ts +79 -0
- package/node_modules/@dialout/shared/src/command-filter.test.ts +76 -0
- package/node_modules/@dialout/shared/src/command-filter.ts +45 -0
- package/node_modules/@dialout/shared/src/composer-behaviour.test.ts +31 -0
- package/node_modules/@dialout/shared/src/composer-behaviour.ts +22 -0
- package/node_modules/@dialout/shared/src/events.ts +27 -0
- package/node_modules/@dialout/shared/src/index.ts +32 -0
- package/node_modules/@dialout/shared/src/kinds.ts +5 -0
- package/node_modules/@dialout/shared/src/notify.test.ts +49 -0
- package/node_modules/@dialout/shared/src/notify.ts +30 -0
- package/node_modules/@dialout/shared/src/permission.ts +10 -0
- package/node_modules/@dialout/shared/src/scroll-pin.test.ts +23 -0
- package/node_modules/@dialout/shared/src/scroll-pin.ts +13 -0
- package/node_modules/@dialout/shared/src/session.ts +25 -0
- package/node_modules/@dialout/shared/src/terminal-name.ts +82 -0
- package/node_modules/@dialout/shared/src/tool-appearance.test.ts +41 -0
- package/node_modules/@dialout/shared/src/tool-appearance.ts +39 -0
- package/package.json +54 -14
- package/scripts/postinstall.js +79 -0
- package/scripts/prepack.js +45 -0
- package/bin/dialout.js +0 -13
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Pure terminal-name rendering. Shared by the /terminals list, the attach
|
|
2
|
+
// header, and the mobile list so one name shows everywhere. No React, no I/O.
|
|
3
|
+
|
|
4
|
+
export interface TerminalNameVars {
|
|
5
|
+
machine_name?: string;
|
|
6
|
+
folder_name?: string;
|
|
7
|
+
folder_path?: string;
|
|
8
|
+
date?: string;
|
|
9
|
+
time?: string;
|
|
10
|
+
ampm?: string;
|
|
11
|
+
git_branch?: string;
|
|
12
|
+
term_program?: string;
|
|
13
|
+
short_id?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const DEFAULT_TERMINAL_TEMPLATE = '[machine_name]-[folder_name]-[date]-[time][ampm]';
|
|
17
|
+
|
|
18
|
+
export const TERMINAL_NAME_TOKENS = [
|
|
19
|
+
'machine_name', 'folder_name', 'folder_path',
|
|
20
|
+
'date', 'time', 'ampm',
|
|
21
|
+
'git_branch', 'term_program', 'short_id',
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
function timeParts(iso: string | null): { date: string; time: string; ampm: string } {
|
|
25
|
+
if (!iso) return { date: '', time: '', ampm: '' };
|
|
26
|
+
const d = new Date(iso);
|
|
27
|
+
if (Number.isNaN(d.getTime())) return { date: '', time: '', ampm: '' };
|
|
28
|
+
const yyyy = d.getFullYear();
|
|
29
|
+
const mm = String(d.getMonth() + 1).padStart(2, '0');
|
|
30
|
+
const dd = String(d.getDate()).padStart(2, '0');
|
|
31
|
+
let h = d.getHours();
|
|
32
|
+
const ampm = h < 12 ? 'am' : 'pm';
|
|
33
|
+
h = h % 12; if (h === 0) h = 12;
|
|
34
|
+
const min = String(d.getMinutes()).padStart(2, '0');
|
|
35
|
+
return { date: `${yyyy}-${mm}-${dd}`, time: `${h}:${min}`, ampm };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function factsFromSession(s: {
|
|
39
|
+
machineName: string;
|
|
40
|
+
folder: string | null;
|
|
41
|
+
folderPath: string | null;
|
|
42
|
+
createdLocal: string | null;
|
|
43
|
+
startedAt: string | null;
|
|
44
|
+
gitBranch: string | null;
|
|
45
|
+
termProgram: string | null;
|
|
46
|
+
tmuxName: string;
|
|
47
|
+
}): TerminalNameVars {
|
|
48
|
+
const t = timeParts(s.createdLocal || s.startedAt);
|
|
49
|
+
const shortId = (s.tmuxName.split('-').pop() || s.tmuxName).slice(0, 8);
|
|
50
|
+
return {
|
|
51
|
+
machine_name: s.machineName || '',
|
|
52
|
+
folder_name: s.folder || '',
|
|
53
|
+
folder_path: s.folderPath || '',
|
|
54
|
+
date: t.date,
|
|
55
|
+
time: t.time,
|
|
56
|
+
ampm: t.ampm,
|
|
57
|
+
git_branch: s.gitBranch || '',
|
|
58
|
+
term_program: s.termProgram && s.termProgram !== 'unknown' ? s.termProgram : '',
|
|
59
|
+
short_id: shortId,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function renderTerminalName(
|
|
64
|
+
template: string,
|
|
65
|
+
vars: TerminalNameVars,
|
|
66
|
+
fallback: string
|
|
67
|
+
): string {
|
|
68
|
+
if (!template) return fallback;
|
|
69
|
+
let out = template;
|
|
70
|
+
for (const token of TERMINAL_NAME_TOKENS) {
|
|
71
|
+
const value = (vars as Record<string, string | undefined>)[token] ?? '';
|
|
72
|
+
if (value) {
|
|
73
|
+
out = out.split(`[${token}]`).join(value);
|
|
74
|
+
} else {
|
|
75
|
+
const re = new RegExp(`(?:[-_ ]+)?\\[${token}\\]|\\[${token}\\](?:[-_ ]+)?`, 'g');
|
|
76
|
+
out = out.replace(re, '');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
out = out.replace(/\[[a-z_]+\]/g, '');
|
|
80
|
+
out = out.replace(/[-_]{2,}/g, (m) => m[0]).replace(/^[-_ ]+|[-_ ]+$/g, '').trim();
|
|
81
|
+
return out || fallback;
|
|
82
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { toolAppearance, toolClass } from './tool-appearance';
|
|
3
|
+
|
|
4
|
+
describe('tool-appearance', () => {
|
|
5
|
+
it('maps known tools to their action class', () => {
|
|
6
|
+
expect(toolClass('Read')).toBe('read');
|
|
7
|
+
expect(toolClass('Glob')).toBe('read');
|
|
8
|
+
expect(toolClass('Grep')).toBe('search');
|
|
9
|
+
expect(toolClass('WebSearch')).toBe('search');
|
|
10
|
+
expect(toolClass('Bash')).toBe('run');
|
|
11
|
+
expect(toolClass('Task')).toBe('run');
|
|
12
|
+
expect(toolClass('Edit')).toBe('write');
|
|
13
|
+
expect(toolClass('Write')).toBe('write');
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('is case and whitespace insensitive', () => {
|
|
17
|
+
expect(toolClass(' bASh ')).toBe('run');
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// New tools ship constantly. An unknown name must render as a neutral row,
|
|
21
|
+
// never throw and never blank the trace.
|
|
22
|
+
it('falls back to other for an unknown tool', () => {
|
|
23
|
+
expect(toolClass('SomeToolShippedNextWeek')).toBe('other');
|
|
24
|
+
expect(toolAppearance('SomeToolShippedNextWeek').colorVar).toBe('--dim');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('failure beats the name-derived class', () => {
|
|
28
|
+
const a = toolAppearance('Read', false);
|
|
29
|
+
expect(a.cls).toBe('failure');
|
|
30
|
+
expect(a.colorVar).toBe('--offline');
|
|
31
|
+
expect(a.glyph).toBe('✕');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('every class has a glyph and a colour token', () => {
|
|
35
|
+
for (const name of ['Read', 'Grep', 'Bash', 'Edit', 'Nonsense']) {
|
|
36
|
+
const a = toolAppearance(name);
|
|
37
|
+
expect(a.glyph.length).toBeGreaterThan(0);
|
|
38
|
+
expect(a.colorVar.startsWith('--')).toBe(true);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// A tool's colour says what it DID, not which vendor produced it. Reading a
|
|
2
|
+
// twenty-step run should show its shape without reading a word.
|
|
3
|
+
|
|
4
|
+
export type ToolClass = 'read' | 'search' | 'run' | 'write' | 'failure' | 'other';
|
|
5
|
+
|
|
6
|
+
export interface ToolAppearance {
|
|
7
|
+
cls: ToolClass;
|
|
8
|
+
glyph: string;
|
|
9
|
+
colorVar: string; // a CSS custom property name, never a literal
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const BY_NAME: Record<string, ToolClass> = {
|
|
13
|
+
read: 'read', glob: 'read', ls: 'read', notebookread: 'read',
|
|
14
|
+
grep: 'search', websearch: 'search', webfetch: 'search',
|
|
15
|
+
bash: 'run', task: 'run', agent: 'run',
|
|
16
|
+
edit: 'write', write: 'write', multiedit: 'write', notebookedit: 'write',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const GLYPH: Record<ToolClass, string> = {
|
|
20
|
+
read: '◇', search: '⌕', run: '▸', write: '✎', failure: '✕', other: '·',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const COLOR: Record<ToolClass, string> = {
|
|
24
|
+
read: '--accent',
|
|
25
|
+
search: '--tool-search',
|
|
26
|
+
run: '--tool-run',
|
|
27
|
+
write: '--static',
|
|
28
|
+
failure: '--offline',
|
|
29
|
+
other: '--dim',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export function toolClass(name: string): ToolClass {
|
|
33
|
+
return BY_NAME[String(name || '').trim().toLowerCase()] ?? 'other';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function toolAppearance(name: string, ok = true): ToolAppearance {
|
|
37
|
+
const cls: ToolClass = ok ? toolClass(name) : 'failure';
|
|
38
|
+
return { cls, glyph: GLYPH[cls], colorVar: COLOR[cls] };
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,33 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indianic/dialout",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Dialout agent — reach your office, home or build machine from any browser or phone. Remote tmux terminals, live port checks, filesystem browsing, process control and HTTP tunnels. The agent dials out: no inbound ports, no VPN, no port forwarding.",
|
|
5
5
|
"bin": {
|
|
6
|
-
"dialout": "./bin/
|
|
6
|
+
"dialout": "./bin/devdash-agent.js"
|
|
7
7
|
},
|
|
8
|
+
"main": "./dist/index.js",
|
|
8
9
|
"files": [
|
|
9
10
|
"bin",
|
|
10
|
-
"
|
|
11
|
+
"dist",
|
|
12
|
+
"scripts/postinstall.js",
|
|
13
|
+
"README.md",
|
|
14
|
+
"scripts/prepack.js"
|
|
11
15
|
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"prebuild": "npx tsc -p ../devdash-shared/tsconfig.json",
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"test": "npm run build && node --test",
|
|
20
|
+
"dev": "tsc --watch",
|
|
21
|
+
"start": "node dist/index.js",
|
|
22
|
+
"clean": "rm -rf dist",
|
|
23
|
+
"postinstall": "node scripts/postinstall.js",
|
|
24
|
+
"prepack": "node scripts/prepack.js"
|
|
25
|
+
},
|
|
12
26
|
"keywords": [
|
|
13
27
|
"dialout",
|
|
14
28
|
"remote-development",
|
|
29
|
+
"remote-access",
|
|
15
30
|
"self-hosted",
|
|
16
31
|
"developer-tools",
|
|
17
|
-
"
|
|
32
|
+
"tmux",
|
|
33
|
+
"terminal",
|
|
34
|
+
"web-terminal",
|
|
35
|
+
"port-scanner",
|
|
36
|
+
"localhost-tunnel",
|
|
37
|
+
"http-tunnel",
|
|
38
|
+
"devops-dashboard",
|
|
39
|
+
"claude-code",
|
|
40
|
+
"codex",
|
|
41
|
+
"ai-agent",
|
|
42
|
+
"agent",
|
|
43
|
+
"daemon",
|
|
44
|
+
"pty",
|
|
45
|
+
"websocket"
|
|
18
46
|
],
|
|
19
47
|
"author": {
|
|
20
48
|
"name": "Sandeep Mundra",
|
|
21
49
|
"email": "sandeep@indianic.com",
|
|
22
50
|
"url": "https://www.indianic.com"
|
|
23
51
|
},
|
|
24
|
-
"contributors": [
|
|
25
|
-
{
|
|
26
|
-
"name": "IndiaNIC Infotech Ltd",
|
|
27
|
-
"email": "hello@indianic.com",
|
|
28
|
-
"url": "https://www.indianic.com"
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
52
|
"license": "MIT",
|
|
32
53
|
"publishConfig": {
|
|
33
54
|
"registry": "https://registry.npmjs.org",
|
|
@@ -41,14 +62,33 @@
|
|
|
41
62
|
"linux"
|
|
42
63
|
],
|
|
43
64
|
"dependencies": {
|
|
44
|
-
"dialout": "^1.
|
|
65
|
+
"@dialout/shared": "^1.0.0",
|
|
66
|
+
"commander": "^12.1.0",
|
|
67
|
+
"node-pty": "^1.2.0-beta.12",
|
|
68
|
+
"smol-toml": "^1.8.0",
|
|
69
|
+
"ws": "^8.17.0"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@types/node": "^22.15.3",
|
|
73
|
+
"@types/ws": "^8.5.10",
|
|
74
|
+
"typescript": "^5.8.3"
|
|
45
75
|
},
|
|
46
76
|
"homepage": "https://www.dialout.dev",
|
|
47
77
|
"repository": {
|
|
48
78
|
"type": "git",
|
|
49
79
|
"url": "git+https://github.com/indianic/dialout.git",
|
|
50
|
-
"directory": "packages/
|
|
80
|
+
"directory": "packages/devdash-agent"
|
|
51
81
|
},
|
|
82
|
+
"bundleDependencies": [
|
|
83
|
+
"@dialout/shared"
|
|
84
|
+
],
|
|
85
|
+
"contributors": [
|
|
86
|
+
{
|
|
87
|
+
"name": "IndiaNIC Infotech Ltd",
|
|
88
|
+
"email": "hello@indianic.com",
|
|
89
|
+
"url": "https://www.indianic.com"
|
|
90
|
+
}
|
|
91
|
+
],
|
|
52
92
|
"bugs": {
|
|
53
93
|
"url": "https://github.com/indianic/dialout/issues",
|
|
54
94
|
"email": "hello@indianic.com"
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execSync } = require('child_process');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
|
|
6
|
+
const GREEN = '\x1b[32m';
|
|
7
|
+
const YELLOW = '\x1b[33m';
|
|
8
|
+
const RED = '\x1b[31m';
|
|
9
|
+
const CYAN = '\x1b[36m';
|
|
10
|
+
const BOLD = '\x1b[1m';
|
|
11
|
+
const NC = '\x1b[0m';
|
|
12
|
+
|
|
13
|
+
function check(label, fn) {
|
|
14
|
+
try {
|
|
15
|
+
const result = fn();
|
|
16
|
+
console.log(`${GREEN} ✓${NC} ${label}${result ? ` — ${result}` : ''}`);
|
|
17
|
+
return true;
|
|
18
|
+
} catch (err) {
|
|
19
|
+
console.log(`${RED} ✗${NC} ${label} — ${err.message || 'failed'}`);
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
console.log('');
|
|
25
|
+
console.log(`${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}`);
|
|
26
|
+
console.log(`${BOLD} dialout installed${NC}`);
|
|
27
|
+
console.log(`${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}`);
|
|
28
|
+
console.log('');
|
|
29
|
+
|
|
30
|
+
console.log(`${CYAN}Checking requirements...${NC}`);
|
|
31
|
+
|
|
32
|
+
const nodeOk = check('Node.js >= 18', () => {
|
|
33
|
+
const v = process.version.replace('v', '');
|
|
34
|
+
const major = parseInt(v.split('.')[0]);
|
|
35
|
+
if (major < 18) throw new Error(`found ${process.version}, need >= 18`);
|
|
36
|
+
return process.version;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const platformOk = check('Platform supported', () => {
|
|
40
|
+
const p = os.platform();
|
|
41
|
+
if (p !== 'darwin' && p !== 'linux') throw new Error(`${p} not supported yet`);
|
|
42
|
+
return `${p} ${os.arch()}`;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const ptyOk = check('node-pty native module', () => {
|
|
46
|
+
require('node-pty');
|
|
47
|
+
return 'loaded';
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
console.log('');
|
|
51
|
+
|
|
52
|
+
if (!ptyOk) {
|
|
53
|
+
console.log(`${YELLOW} node-pty failed to load. Try rebuilding:${NC}`);
|
|
54
|
+
console.log(` npm rebuild node-pty`);
|
|
55
|
+
console.log('');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (nodeOk && platformOk && ptyOk) {
|
|
59
|
+
console.log(`${GREEN}All checks passed!${NC}`);
|
|
60
|
+
} else {
|
|
61
|
+
console.log(`${YELLOW}Some checks failed. The agent may not work correctly.${NC}`);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
console.log('');
|
|
65
|
+
console.log(`${CYAN}Next steps:${NC}`);
|
|
66
|
+
console.log('');
|
|
67
|
+
console.log(' 1. Generate an API key in the DevDash web UI (MACHINES tab)');
|
|
68
|
+
console.log('');
|
|
69
|
+
console.log(' 2. Configure the agent:');
|
|
70
|
+
console.log(` ${BOLD}devdash-agent init${NC}`);
|
|
71
|
+
console.log('');
|
|
72
|
+
console.log(' 3. Start the agent:');
|
|
73
|
+
console.log(` ${BOLD}devdash-agent start${NC}`);
|
|
74
|
+
console.log('');
|
|
75
|
+
console.log(' 4. Install as service (auto-start on boot):');
|
|
76
|
+
console.log(` ${BOLD}devdash-agent install-service${NC}`);
|
|
77
|
+
console.log('');
|
|
78
|
+
console.log(`${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}`);
|
|
79
|
+
console.log('');
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Stages @dialout/shared into this package's own node_modules so that
|
|
4
|
+
* `bundleDependencies` picks it up.
|
|
5
|
+
*
|
|
6
|
+
* Why bundle it at all: `dialout` is meant to be the only thing a user
|
|
7
|
+
* installs. The shared package is a handful of types and constants used by the
|
|
8
|
+
* server, the agent and the mobile app; publishing it separately would mean a
|
|
9
|
+
* second package to version, and an `npm i -g dialout` that silently fails
|
|
10
|
+
* with E404 for anyone who installs before it exists.
|
|
11
|
+
*
|
|
12
|
+
* Why a script rather than letting npm do it: bundleDependencies packs from
|
|
13
|
+
* this package's OWN node_modules, and in a workspace the dependency is
|
|
14
|
+
* symlinked at the repo root instead. npm will not follow that symlink into
|
|
15
|
+
* the tarball, so without this step the tarball ships a require() with nothing
|
|
16
|
+
* behind it — and the failure only shows up on a machine that has no local
|
|
17
|
+
* checkout, which is every real user.
|
|
18
|
+
*
|
|
19
|
+
* Runs automatically on `npm pack` and `npm publish`.
|
|
20
|
+
*/
|
|
21
|
+
const { cpSync, existsSync, mkdirSync, rmSync } = require('node:fs');
|
|
22
|
+
const { join, resolve } = require('node:path');
|
|
23
|
+
|
|
24
|
+
const here = resolve(__dirname, '..');
|
|
25
|
+
const source = resolve(here, '..', 'devdash-shared');
|
|
26
|
+
const target = join(here, 'node_modules', '@dialout', 'shared');
|
|
27
|
+
|
|
28
|
+
if (!existsSync(source)) {
|
|
29
|
+
console.error(`prepack: cannot find the shared package at ${source}`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
if (!existsSync(join(source, 'dist'))) {
|
|
33
|
+
console.error('prepack: the shared package has no dist/ — build it first');
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
rmSync(target, { recursive: true, force: true });
|
|
38
|
+
mkdirSync(join(here, 'node_modules', '@dialout'), { recursive: true });
|
|
39
|
+
cpSync(source, target, {
|
|
40
|
+
recursive: true,
|
|
41
|
+
// Its own node_modules would drag the whole workspace tree in behind it.
|
|
42
|
+
filter: (src) => !src.includes(`${join('shared', 'node_modules')}`) && !src.includes('/.git'),
|
|
43
|
+
});
|
|
44
|
+
rmSync(join(target, 'node_modules'), { recursive: true, force: true });
|
|
45
|
+
console.log('prepack: staged @dialout/shared for bundling');
|
package/bin/dialout.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Delegates straight to the real implementation.
|
|
3
|
-
//
|
|
4
|
-
// This package exists only so that `@indianic/dialout` resolves under the
|
|
5
|
-
// organisation's namespace. It ships no code of its own — `dialout` is the
|
|
6
|
-
// package that does the work, and this depends on it.
|
|
7
|
-
//
|
|
8
|
-
// The require is resolved from this package's own node_modules, so whichever
|
|
9
|
-
// version of `dialout` the dependency range installed is the one that runs.
|
|
10
|
-
// There is deliberately no version check here: pinning would mean this alias
|
|
11
|
-
// has to be republished for every agent release, which is exactly the
|
|
12
|
-
// maintenance burden it is supposed to avoid.
|
|
13
|
-
require('dialout/dist/cli.js');
|