tabherd 0.0.0-stage → 0.6.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +166 -0
  2. package/LICENSE +674 -0
  3. package/README.md +540 -2
  4. package/launcher/npm.js +9 -0
  5. package/lib/agents.js +324 -0
  6. package/lib/codex-client.js +306 -0
  7. package/lib/codex-rollout.js +251 -0
  8. package/lib/codex.js +424 -0
  9. package/lib/comfy.js +479 -0
  10. package/lib/completed.js +55 -0
  11. package/lib/copilot.js +359 -0
  12. package/lib/cursor.js +516 -0
  13. package/lib/dismissed.js +30 -0
  14. package/lib/filters.js +120 -0
  15. package/lib/groups.js +144 -0
  16. package/lib/history.js +253 -0
  17. package/lib/llamacpp.js +159 -0
  18. package/lib/lmstudio.js +134 -0
  19. package/lib/localai.js +291 -0
  20. package/lib/memory.js +55 -0
  21. package/lib/ollama.js +124 -0
  22. package/lib/open-dashboard.js +39 -0
  23. package/lib/opencode.js +371 -0
  24. package/lib/repos.js +81 -0
  25. package/lib/saved.js +33 -0
  26. package/lib/secrets.js +196 -0
  27. package/lib/session-id.js +9 -0
  28. package/lib/settings.js +231 -0
  29. package/lib/store.js +44 -0
  30. package/lib/terminals/index.js +62 -0
  31. package/lib/terminals/kitty.js +126 -0
  32. package/lib/terminals/linux.js +310 -0
  33. package/lib/terminals/macos.js +468 -0
  34. package/lib/terminals/tmux.js +89 -0
  35. package/lib/terminals/unix-driver.js +172 -0
  36. package/lib/terminals/unix.js +204 -0
  37. package/lib/terminals/unsupported.js +22 -0
  38. package/lib/terminals/wezterm.js +103 -0
  39. package/lib/terminals/windows-close.ps1 +125 -0
  40. package/lib/terminals/windows-focus.ps1 +235 -0
  41. package/lib/terminals/windows-pick-folder.ps1 +57 -0
  42. package/lib/terminals/windows-titles.js +124 -0
  43. package/lib/terminals/windows-titles.ps1 +95 -0
  44. package/lib/terminals/windows.js +166 -0
  45. package/lib/ticket-refs.js +184 -0
  46. package/lib/tickets.js +437 -0
  47. package/lib/todos.js +166 -0
  48. package/lib/trackers.js +541 -0
  49. package/lib/transcript.js +314 -0
  50. package/lib/updates.js +186 -0
  51. package/package.json +44 -4
  52. package/public/app.js +4077 -0
  53. package/public/favicon.svg +1 -0
  54. package/public/icons/tabherd-128.png +0 -0
  55. package/public/icons/tabherd-16.png +0 -0
  56. package/public/icons/tabherd-20.png +0 -0
  57. package/public/icons/tabherd-24.png +0 -0
  58. package/public/icons/tabherd-256.png +0 -0
  59. package/public/icons/tabherd-32.png +0 -0
  60. package/public/icons/tabherd-40.png +0 -0
  61. package/public/icons/tabherd-48.png +0 -0
  62. package/public/icons/tabherd-512.png +0 -0
  63. package/public/icons/tabherd-64.png +0 -0
  64. package/public/index.html +655 -0
  65. package/public/lang/es.js +742 -0
  66. package/public/style.css +1443 -0
  67. package/server.js +814 -0
@@ -0,0 +1,314 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const { StringDecoder } = require('string_decoder');
6
+ const ticketRefs = require('./ticket-refs');
7
+
8
+ const CHUNK = 4 * 1024 * 1024;
9
+ const TEXT_MAX = 600;
10
+ const MAX_TICKET_REFS = 500;
11
+
12
+ // Claude Code appends one JSON object per line. Each update() reads only the
13
+ // bytes added since the last call, so polling a long transcript stays cheap.
14
+ class Transcript {
15
+ constructor(file) {
16
+ this.file = file;
17
+ this.reset();
18
+ }
19
+
20
+ reset() {
21
+ this.offset = 0;
22
+ this.carry = '';
23
+ this.decoder = new StringDecoder('utf8');
24
+ this.lastMsgId = null;
25
+ this.lastMsgOut = 0;
26
+ this.s = {
27
+ cwd: null,
28
+ entrypoint: null,
29
+ startedAt: null,
30
+ title: null,
31
+ customTitle: null,
32
+ model: null,
33
+ modelName: null,
34
+ permissionMode: null,
35
+ gitBranch: null,
36
+ firstPrompt: null,
37
+ lastPrompt: null,
38
+ lastReply: null,
39
+ recap: null,
40
+ tools: new Map(),
41
+ lastEventAt: null,
42
+ lastTurnMs: null,
43
+ contextTokens: 0,
44
+ outputTokens: 0,
45
+ prompts: 0,
46
+ compactions: 0,
47
+ prs: new Map(),
48
+ // Tickets claimed, given up and (in prompts) linked, in order.
49
+ ticketRefs: [],
50
+ };
51
+ }
52
+
53
+ // Notes the tickets a prompt or reply claims, gives up or links. Every
54
+ // reader calls it with each one's whole text, before it's shortened.
55
+ noteTickets(text, from) {
56
+ const found = ticketRefs.find(text, from);
57
+ if (!found.length) return;
58
+ const list = this.s.ticketRefs;
59
+ list.push(...found);
60
+ if (list.length > MAX_TICKET_REFS) list.splice(0, list.length - MAX_TICKET_REFS);
61
+ }
62
+
63
+ update() {
64
+ let size;
65
+ try {
66
+ size = fs.statSync(this.file).size;
67
+ } catch {
68
+ return false;
69
+ }
70
+ if (size < this.offset) this.reset();
71
+ if (size === this.offset) return true;
72
+
73
+ const fd = fs.openSync(this.file, 'r');
74
+ try {
75
+ const buf = Buffer.allocUnsafe(Math.min(CHUNK, size - this.offset));
76
+ while (this.offset < size) {
77
+ const n = fs.readSync(fd, buf, 0, Math.min(buf.length, size - this.offset), this.offset);
78
+ if (n <= 0) break;
79
+ this.offset += n;
80
+ const lines = (this.carry + this.decoder.write(buf.subarray(0, n))).split('\n');
81
+ this.carry = lines.pop();
82
+ for (const line of lines) this.line(line);
83
+ }
84
+ } finally {
85
+ fs.closeSync(fd);
86
+ }
87
+ return true;
88
+ }
89
+
90
+ line(line) {
91
+ // Request snapshots are the largest lines and carry nothing we display.
92
+ if (!line || line.startsWith('{"type":"api-request')) return;
93
+ let e;
94
+ try {
95
+ e = JSON.parse(line);
96
+ } catch {
97
+ return;
98
+ }
99
+ const s = this.s;
100
+ if (e.timestamp && e.type !== 'queue-operation') {
101
+ s.lastEventAt = e.timestamp;
102
+ s.startedAt = s.startedAt || e.timestamp;
103
+ }
104
+ s.cwd = s.cwd || e.cwd || null;
105
+ s.entrypoint = s.entrypoint || e.entrypoint || null;
106
+ if (e.gitBranch && e.gitBranch !== 'HEAD') s.gitBranch = e.gitBranch;
107
+
108
+ switch (e.type) {
109
+ case 'ai-title':
110
+ s.title = e.aiTitle || s.title;
111
+ break;
112
+ case 'custom-title':
113
+ s.customTitle = e.customTitle || s.customTitle;
114
+ break;
115
+ case 'permission-mode':
116
+ s.permissionMode = e.permissionMode || s.permissionMode;
117
+ break;
118
+ case 'pr-link':
119
+ if (e.prUrl) s.prs.set(e.prUrl, { url: e.prUrl, number: e.prNumber, repo: e.prRepository });
120
+ break;
121
+ case 'attachment':
122
+ if (e.attachment?.type === 'model' && e.attachment.identity) {
123
+ s.model = e.attachment.identity.modelId || s.model;
124
+ s.modelName = e.attachment.identity.marketingName || null;
125
+ }
126
+ break;
127
+ case 'system':
128
+ if (e.subtype === 'turn_duration') {
129
+ s.tools.clear();
130
+ s.lastTurnMs = e.durationMs ?? null;
131
+ } else if (e.subtype === 'away_summary' && typeof e.content === 'string') {
132
+ s.recap = { text: clip(e.content.replace(/\s*\(disable recaps in \/config\)\s*$/, '')), at: e.timestamp };
133
+ } else if (e.subtype === 'compact_boundary') {
134
+ s.compactions++;
135
+ }
136
+ break;
137
+ case 'user':
138
+ this.user(e);
139
+ break;
140
+ case 'assistant':
141
+ this.assistant(e);
142
+ break;
143
+ }
144
+ }
145
+
146
+ user(e) {
147
+ const s = this.s;
148
+ const content = e.message?.content;
149
+ let text = null;
150
+ if (typeof content === 'string') {
151
+ text = content;
152
+ } else if (Array.isArray(content)) {
153
+ const parts = [];
154
+ for (const b of content) {
155
+ if (b.type === 'tool_result') s.tools.delete(b.tool_use_id);
156
+ else if (b.type === 'text') parts.push(b.text);
157
+ }
158
+ if (parts.length) text = parts.join('\n');
159
+ }
160
+ if (text === null || e.isMeta || e.isCompactSummary) return;
161
+ const prompt = cleanPrompt(text);
162
+ if (!prompt) return;
163
+ // Not what Claude Code adds, nor text pasted in from elsewhere.
164
+ this.noteTickets(text.replace(/<system-reminder>[\s\S]*?<\/system-reminder>|<pasted_content[^>]*>[\s\S]*?<\/pasted_content>/g, ''), 'prompt');
165
+ s.tools.clear();
166
+ s.lastPrompt = { text: prompt, at: e.timestamp };
167
+ s.firstPrompt = s.firstPrompt || s.lastPrompt;
168
+ s.prompts++;
169
+ }
170
+
171
+ assistant(e) {
172
+ const s = this.s;
173
+ const m = e.message;
174
+ if (!m) return;
175
+ if (m.model && m.model !== '<synthetic>' && m.model !== baseModel(s.model)) {
176
+ s.model = m.model;
177
+ s.modelName = null;
178
+ }
179
+ const u = m.usage;
180
+ if (u) {
181
+ const out = u.output_tokens || 0;
182
+ s.contextTokens =
183
+ (u.input_tokens || 0) + (u.cache_creation_input_tokens || 0) + (u.cache_read_input_tokens || 0) + out;
184
+ // A response is logged once per content block, each line repeating the usage.
185
+ if (m.id && m.id === this.lastMsgId) s.outputTokens += out - this.lastMsgOut;
186
+ else s.outputTokens += out;
187
+ this.lastMsgId = m.id;
188
+ this.lastMsgOut = out;
189
+ }
190
+ if (!Array.isArray(m.content)) return;
191
+ for (const b of m.content) {
192
+ if (b.type === 'tool_use') {
193
+ s.tools.set(b.id, { name: toolName(b.name), detail: describeTool(b.name, b.input), at: e.timestamp });
194
+ } else if (b.type === 'text' && b.text?.trim()) {
195
+ s.lastReply = { text: clip(b.text), at: e.timestamp };
196
+ this.noteTickets(b.text, 'reply');
197
+ }
198
+ }
199
+ }
200
+
201
+ // Where and how the session began, for reading a transcript after its
202
+ // session has closed. Kept out of summary(), which is merged over the
203
+ // session registry's own values.
204
+ origin() {
205
+ const { cwd, entrypoint, startedAt } = this.s;
206
+ return { cwd, entrypoint, startedAt };
207
+ }
208
+
209
+ summary() {
210
+ const s = this.s;
211
+ const ctxLimit = /\[1m\]/i.test(s.model || '') || s.contextTokens > 200000 ? 1000000 : 200000;
212
+ return {
213
+ title: s.customTitle || s.title,
214
+ model: s.model,
215
+ modelName: s.modelName,
216
+ permissionMode: s.permissionMode,
217
+ gitBranch: s.gitBranch,
218
+ firstPrompt: s.firstPrompt,
219
+ lastPrompt: s.lastPrompt,
220
+ lastReply: s.lastReply,
221
+ recap: s.recap,
222
+ tools: [...s.tools.values()],
223
+ lastEventAt: s.lastEventAt,
224
+ lastTurnMs: s.lastTurnMs,
225
+ contextTokens: s.contextTokens,
226
+ contextLimit: ctxLimit,
227
+ outputTokens: s.outputTokens,
228
+ prompts: s.prompts,
229
+ compactions: s.compactions,
230
+ prs: [...s.prs.values()],
231
+ ticketRefs: s.ticketRefs,
232
+ };
233
+ }
234
+ }
235
+
236
+ function cleanPrompt(raw) {
237
+ let t = String(raw).trim();
238
+ if (/^<(task-notification|local-command-stdout|local-command-stderr|local-command-caveat|bash-stdout|bash-stderr)>/.test(t)) {
239
+ return null;
240
+ }
241
+ if (/^\[Request interrupted by user/.test(t)) return null;
242
+ const cmd = t.match(/<command-name>([^<]*)<\/command-name>/);
243
+ if (cmd) {
244
+ const args = t.match(/<command-args>([\s\S]*?)<\/command-args>/);
245
+ t = `${cmd[1].trim()} ${args ? args[1].trim() : ''}`;
246
+ }
247
+ const bash = t.match(/^<bash-input>([\s\S]*?)<\/bash-input>/);
248
+ if (bash) t = `! ${bash[1]}`;
249
+ t = t
250
+ .replace(/<system-reminder>[\s\S]*?<\/system-reminder>/g, '')
251
+ .replace(/<pasted_content[^>]*>[\s\S]*?<\/pasted_content>/g, '[pasted text]')
252
+ .trim();
253
+ return t ? clip(t) : null;
254
+ }
255
+
256
+ function clip(text) {
257
+ const t = String(text).replace(/\s+/g, ' ').trim();
258
+ return t.length > TEXT_MAX ? `${t.slice(0, TEXT_MAX - 1)}…` : t;
259
+ }
260
+
261
+ function baseModel(id) {
262
+ return id ? id.replace(/\[[^\]]*\]$/, '') : id;
263
+ }
264
+
265
+ function toolName(name) {
266
+ if (!name?.startsWith('mcp__')) return name;
267
+ const [server, ...rest] = name.slice(5).split('__');
268
+ return `${server.replace(/^claude_ai_/, '').replace(/_/g, ' ')}: ${rest.join('__')}`;
269
+ }
270
+
271
+ function describeTool(name, input) {
272
+ const i = input || {};
273
+ const base = (p) => (p ? path.basename(String(p)) : '');
274
+ let d;
275
+ switch (name) {
276
+ case 'Bash':
277
+ case 'PowerShell':
278
+ d = i.description || i.command;
279
+ break;
280
+ case 'Read':
281
+ case 'Write':
282
+ case 'Edit':
283
+ case 'NotebookEdit':
284
+ d = base(i.file_path || i.notebook_path);
285
+ break;
286
+ case 'Grep':
287
+ case 'Glob':
288
+ d = i.pattern;
289
+ break;
290
+ case 'Agent':
291
+ case 'Task':
292
+ d = i.description || i.subagent_type;
293
+ break;
294
+ case 'WebFetch':
295
+ d = i.url;
296
+ break;
297
+ case 'WebSearch':
298
+ d = i.query;
299
+ break;
300
+ case 'Skill':
301
+ d = i.skill;
302
+ break;
303
+ case 'AskUserQuestion':
304
+ d = i.questions?.[0]?.question;
305
+ break;
306
+ default:
307
+ d = Object.values(i).find((v) => typeof v === 'string' && v.length < 200);
308
+ }
309
+ if (!d) return '';
310
+ const t = String(d).replace(/\s+/g, ' ').trim();
311
+ return t.length > 160 ? `${t.slice(0, 159)}…` : t;
312
+ }
313
+
314
+ module.exports = { Transcript, clip };
package/lib/updates.js ADDED
@@ -0,0 +1,186 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const store = require('./store');
6
+ const { version } = require('../package.json');
7
+
8
+ // Whether a newer Tabherd is out, from GitHub's list of its releases. The
9
+ // server only asks once Settings says yes, which the dashboard asks once, or
10
+ // when someone clicks Check now: the README promises nothing is sent anywhere
11
+ // unless it's asked for. It asks at most once a day, and sends nothing about
12
+ // this computer or its sessions.
13
+ const RELEASES = 'https://api.github.com/repos/tleeadams/tabherd/releases?per_page=30';
14
+ const RELEASE_PAGES = 'https://github.com/tleeadams/tabherd/releases/';
15
+ const DAY_MS = 24 * 60 * 60 * 1000;
16
+ // After a check that failed, as when the computer was offline, the next is
17
+ // sooner.
18
+ const RETRY_MS = 60 * 60 * 1000;
19
+ const MAX_NOTES = 20000;
20
+
21
+ // A version's parts, to compare: 0.6.0-beta.2 is 0, 6 and 0, then beta and 2.
22
+ function parse(v) {
23
+ const m = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(String(v));
24
+ if (!m) return null;
25
+ const pre = m[4] ? m[4].split('.').map((p) => (/^\d+$/.test(p) ? Number(p) : p)) : [];
26
+ return { core: [Number(m[1]), Number(m[2]), Number(m[3])], pre };
27
+ }
28
+
29
+ // Below zero if a comes before b, in Semantic Versioning's order: a
30
+ // prerelease comes before its release, and beta.2 before beta.10.
31
+ function compare(a, b) {
32
+ const x = parse(a);
33
+ const y = parse(b);
34
+ for (let i = 0; i < 3; i++) if (x.core[i] !== y.core[i]) return x.core[i] - y.core[i];
35
+ if (!x.pre.length || !y.pre.length) return y.pre.length - x.pre.length;
36
+ for (let i = 0; i < Math.max(x.pre.length, y.pre.length); i++) {
37
+ const [p, q] = [x.pre[i], y.pre[i]];
38
+ if (p === q) continue;
39
+ if (p === undefined) return -1;
40
+ if (q === undefined) return 1;
41
+ if (typeof p !== typeof q) return typeof p === 'number' ? -1 : 1;
42
+ return p < q ? -1 : 1;
43
+ }
44
+ return 0;
45
+ }
46
+
47
+ const isPrerelease = (v) => parse(v)?.pre.length > 0;
48
+
49
+ // A release as it's kept and shown, or null. Its page must be one of
50
+ // Tabherd's on GitHub.
51
+ function clean(r) {
52
+ if (!r || typeof r !== 'object' || !parse(r.version)) return null;
53
+ return {
54
+ version: String(r.version).replace(/^v/, ''),
55
+ url: typeof r.url === 'string' && r.url.startsWith(RELEASE_PAGES) ? r.url : RELEASE_PAGES,
56
+ notes: typeof r.notes === 'string' ? r.notes.slice(0, MAX_NOTES) : '',
57
+ published: typeof r.published === 'string' ? r.published : null,
58
+ prerelease: Boolean(r.prerelease),
59
+ };
60
+ }
61
+
62
+ // The newest release in GitHub's list, or null: of full releases only, or of
63
+ // prereleases too.
64
+ function newestOf(releases, prereleases) {
65
+ const found = (Array.isArray(releases) ? releases : [])
66
+ .filter((r) => r && !r.draft && (prereleases || !r.prerelease))
67
+ .map((r) => clean({ version: r.tag_name, url: r.html_url, notes: r.body, published: r.published_at, prerelease: r.prerelease }))
68
+ .filter(Boolean)
69
+ .sort((a, b) => compare(b.version, a.version));
70
+ return found[0] || null;
71
+ }
72
+
73
+ // Whether prereleases count as newer versions: when Settings asks for them,
74
+ // and always for someone already on one, who hears of the next.
75
+ const countsPrereleases = (prereleases, current) => Boolean(prereleases) || isPrerelease(current);
76
+
77
+ // The newest release after `current`, from GitHub's list, or null.
78
+ function newest(releases, current = version, { prereleases = false } = {}) {
79
+ const found = newestOf(releases, countsPrereleases(prereleases, current));
80
+ return found && compare(found.version, current) > 0 ? found : null;
81
+ }
82
+
83
+ async function fromGitHub() {
84
+ const res = await fetch(RELEASES, {
85
+ // GitHub's API asks for a name. Only the app's is sent.
86
+ headers: { Accept: 'application/vnd.github+json', 'User-Agent': 'Tabherd' },
87
+ signal: AbortSignal.timeout(15000),
88
+ });
89
+ if (!res.ok) throw new Error(`GitHub answered ${res.status}`);
90
+ return res.json();
91
+ }
92
+
93
+ // The last check, kept in ~/.tabherd/updates.json, so a server started again,
94
+ // as the desktop app does each time it opens, doesn't ask again that day. It
95
+ // keeps the newest full release and the newest of all, so turning
96
+ // prereleases on or off needs no new check.
97
+ function load() {
98
+ const saved = store.read('updates', null);
99
+ const ok = saved && typeof saved === 'object';
100
+ const time = (t) => (ok && Number.isFinite(t) ? t : 0);
101
+ return {
102
+ checkedAt: time(saved?.checkedAt),
103
+ failedAt: time(saved?.failedAt),
104
+ latest: ok ? clean(saved.latest) : null,
105
+ latestAny: ok ? clean(saved.latestAny) : null,
106
+ error: ok && typeof saved.error === 'string' ? saved.error : null,
107
+ };
108
+ }
109
+
110
+ let state = load();
111
+ let checking = null;
112
+
113
+ // Asks GitHub when `enabled` and the last check is a day old, or at once if
114
+ // `force`d, as Check now does. A failed check keeps what the last one found.
115
+ function check({ enabled = false, force = false, now = Date.now(), fetchReleases = fromGitHub } = {}) {
116
+ const due = now - state.checkedAt >= DAY_MS && now - state.failedAt >= RETRY_MS;
117
+ if (!force && !(enabled && due)) return Promise.resolve(state);
118
+ checking ||= Promise.resolve()
119
+ .then(fetchReleases)
120
+ .then(
121
+ (releases) => ({ checkedAt: now, failedAt: 0, latest: newestOf(releases, false), latestAny: newestOf(releases, true), error: null }),
122
+ (err) => ({ ...state, failedAt: now, error: err?.message || String(err) }),
123
+ )
124
+ .then((next) => {
125
+ state = next;
126
+ try {
127
+ store.write('updates', state);
128
+ } catch {}
129
+ return state;
130
+ })
131
+ .finally(() => {
132
+ checking = null;
133
+ });
134
+ return checking;
135
+ }
136
+
137
+ // The release found, if it's newer than this one, counting prereleases or
138
+ // not. Once this copy is updated to it, it isn't.
139
+ function newer(prereleases, current) {
140
+ const found = countsPrereleases(prereleases, current) ? state.latestAny : state.latest;
141
+ return found && compare(found.version, current) > 0 ? found : null;
142
+ }
143
+
144
+ // For every snapshot: this version, whether checking is on (null until it's
145
+ // been asked), whether prereleases count and whether this is one, and the
146
+ // newer release, without its notes.
147
+ function summary(updateCheck, prereleases = false, current = version) {
148
+ const latest = newer(prereleases, current);
149
+ return {
150
+ check: updateCheck,
151
+ prereleases: countsPrereleases(prereleases, current),
152
+ onPrerelease: isPrerelease(current),
153
+ version: current,
154
+ latest: latest && { version: latest.version, url: latest.url, prerelease: latest.prerelease },
155
+ checkedAt: state.checkedAt || null,
156
+ error: state.failedAt > state.checkedAt ? state.error : null,
157
+ };
158
+ }
159
+
160
+ // For the update dialog: the newer release with its notes, and how this copy
161
+ // was installed, so it can say how to update it.
162
+ const details = (prereleases = false) => ({ version, latest: newer(prereleases, version), install: installKind() });
163
+
164
+ // How this copy was installed, from where it runs: a clone of the repository,
165
+ // Homebrew, npm or npx, winget, the desktop app's installer or packages, or a
166
+ // download unpacked somewhere.
167
+ function installKind(root = path.join(__dirname, '..'), { platform = process.platform, env = process.env } = {}) {
168
+ const slashed = (p) => String(p).replace(/\\/g, '/').replace(/\/+$/, '');
169
+ const dir = slashed(root);
170
+ if (fs.existsSync(path.join(root, '.git'))) return 'git';
171
+ if (/\/Cellar\/tabherd\//i.test(dir)) return 'homebrew';
172
+ // npx keeps what it runs in _npx, in npm's cache.
173
+ if (/\/node_modules\/tabherd$/i.test(dir)) return /\/_npx\//.test(dir) ? 'npx' : 'npm';
174
+ if (env.APPIMAGE) return 'appimage';
175
+ if (/\.app\/Contents\/Resources\//.test(dir)) return 'mac-app';
176
+ if (/^\/usr\/lib(64)?\/Tabherd\//.test(dir)) return 'linux-package';
177
+ if (platform === 'win32') {
178
+ if (/\/Microsoft\/WinGet\/Packages\//i.test(dir)) return 'winget';
179
+ const installed = env.LOCALAPPDATA && `${slashed(env.LOCALAPPDATA)}/Tabherd/`.toLowerCase();
180
+ if (installed && dir.toLowerCase().startsWith(installed)) return 'windows-installer';
181
+ return 'windows-zip';
182
+ }
183
+ return 'archive';
184
+ }
185
+
186
+ module.exports = { check, summary, details, compare, newest, installKind, DAY_MS, RETRY_MS };
package/package.json CHANGED
@@ -1,6 +1,46 @@
1
1
  {
2
2
  "name": "tabherd",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.6.0",
4
+ "description": "A dashboard for your Claude Code and Codex sessions: which ones need you, which are working, and what they last said",
5
+ "keywords": [
6
+ "claude-code",
7
+ "codex",
8
+ "dashboard",
9
+ "agents"
10
+ ],
11
+ "homepage": "https://github.com/tleeadams/tabherd#readme",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/tleeadams/tabherd.git"
15
+ },
16
+ "bugs": "https://github.com/tleeadams/tabherd/issues",
17
+ "main": "server.js",
18
+ "bin": {
19
+ "tabherd": "launcher/npm.js"
20
+ },
21
+ "files": [
22
+ "server.js",
23
+ "lib/",
24
+ "public/",
25
+ "launcher/npm.js",
26
+ "CHANGELOG.md"
27
+ ],
28
+ "scripts": {
29
+ "start": "node server.js --open",
30
+ "serve": "node server.js",
31
+ "check": "node server.js --once",
32
+ "setup": "node scripts/gitflow.js setup",
33
+ "setup-github": "node scripts/gitflow.js github",
34
+ "test": "node --test",
35
+ "build": "node scripts/build-release.js",
36
+ "install-shortcut": "node scripts/install-shortcut.js",
37
+ "uninstall-shortcut": "node scripts/install-shortcut.js --uninstall",
38
+ "check-terminals": "node scripts/check-terminals.js",
39
+ "check-package": "node scripts/check-package.js",
40
+ "icons": "node scripts/icons.js"
41
+ },
42
+ "engines": {
43
+ "node": ">=18"
44
+ },
45
+ "license": "GPL-3.0-or-later"
46
+ }