@creativeintelligence/abbie 0.1.5 → 0.1.7

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 (142) hide show
  1. package/bin/dev.js +1 -49
  2. package/bin/run.js +42 -49
  3. package/dist/cli/commands/login.js +26 -0
  4. package/dist/cli/commands/project/add.d.ts +0 -1
  5. package/dist/cli/commands/project/add.js +16 -52
  6. package/dist/cli/commands/project/list.js +13 -93
  7. package/dist/cli/commands/project/remove.d.ts +0 -2
  8. package/dist/cli/commands/project/remove.js +11 -28
  9. package/dist/cli/commands/session/list.js +3 -12
  10. package/dist/cli/commands/session/mark-done.js +1 -7
  11. package/dist/cli/commands/session/start.d.ts +0 -1
  12. package/dist/cli/commands/session/start.js +5 -7
  13. package/dist/lib/active-sessions.d.ts +0 -12
  14. package/dist/lib/active-sessions.js +6 -175
  15. package/dist/lib/project-path.d.ts +6 -0
  16. package/dist/lib/project-path.js +21 -0
  17. package/dist/lib.d.ts +1 -2
  18. package/dist/lib.js +2 -4
  19. package/oclif.manifest.json +2569 -6368
  20. package/package.json +1 -1
  21. package/dist/cli/commands/backlog/add.d.ts +0 -22
  22. package/dist/cli/commands/backlog/add.js +0 -65
  23. package/dist/cli/commands/backlog/claim.d.ts +0 -19
  24. package/dist/cli/commands/backlog/claim.js +0 -45
  25. package/dist/cli/commands/backlog/complete.d.ts +0 -18
  26. package/dist/cli/commands/backlog/complete.js +0 -42
  27. package/dist/cli/commands/backlog/list.d.ts +0 -20
  28. package/dist/cli/commands/backlog/list.js +0 -91
  29. package/dist/cli/commands/backlog/pick.d.ts +0 -18
  30. package/dist/cli/commands/backlog/pick.js +0 -42
  31. package/dist/cli/commands/backlog/sync.d.ts +0 -24
  32. package/dist/cli/commands/backlog/sync.js +0 -109
  33. package/dist/cli/commands/daemon.d.ts +0 -56
  34. package/dist/cli/commands/daemon.js +0 -1465
  35. package/dist/cli/commands/docs/lint.d.ts +0 -18
  36. package/dist/cli/commands/docs/lint.js +0 -82
  37. package/dist/cli/commands/docs/sync.d.ts +0 -19
  38. package/dist/cli/commands/docs/sync.js +0 -76
  39. package/dist/cli/commands/gc.d.ts +0 -29
  40. package/dist/cli/commands/gc.js +0 -211
  41. package/dist/cli/commands/index.d.ts +0 -36
  42. package/dist/cli/commands/index.js +0 -228
  43. package/dist/cli/commands/panes/broker.d.ts +0 -17
  44. package/dist/cli/commands/panes/broker.js +0 -57
  45. package/dist/cli/commands/panes/pipe-sink.d.ts +0 -17
  46. package/dist/cli/commands/panes/pipe-sink.js +0 -90
  47. package/dist/cli/commands/panes/snapshot.d.ts +0 -20
  48. package/dist/cli/commands/panes/snapshot.js +0 -125
  49. package/dist/cli/commands/preview/init.d.ts +0 -25
  50. package/dist/cli/commands/preview/init.js +0 -159
  51. package/dist/cli/commands/preview/sync.d.ts +0 -23
  52. package/dist/cli/commands/preview/sync.js +0 -144
  53. package/dist/cli/commands/preview/watch.d.ts +0 -24
  54. package/dist/cli/commands/preview/watch.js +0 -153
  55. package/dist/cli/commands/resource/acquire.d.ts +0 -21
  56. package/dist/cli/commands/resource/acquire.js +0 -90
  57. package/dist/cli/commands/resource/list.d.ts +0 -15
  58. package/dist/cli/commands/resource/list.js +0 -61
  59. package/dist/cli/commands/resource/release.d.ts +0 -18
  60. package/dist/cli/commands/resource/release.js +0 -50
  61. package/dist/cli/commands/resource/wait.d.ts +0 -21
  62. package/dist/cli/commands/resource/wait.js +0 -73
  63. package/dist/cli/commands/session/view.d.ts +0 -24
  64. package/dist/cli/commands/session/view.js +0 -145
  65. package/dist/cli/commands/start.d.ts +0 -37
  66. package/dist/cli/commands/start.js +0 -234
  67. package/dist/cli/commands/triage/claim.d.ts +0 -23
  68. package/dist/cli/commands/triage/claim.js +0 -186
  69. package/dist/cli/commands/triage/list.d.ts +0 -22
  70. package/dist/cli/commands/triage/list.js +0 -112
  71. package/dist/cli/commands/triage/next.d.ts +0 -18
  72. package/dist/cli/commands/triage/next.js +0 -63
  73. package/dist/cli/commands/triage/pull.d.ts +0 -19
  74. package/dist/cli/commands/triage/pull.js +0 -82
  75. package/dist/cli/commands/triage/stats.d.ts +0 -16
  76. package/dist/cli/commands/triage/stats.js +0 -69
  77. package/dist/cli/commands/tunnel/list.d.ts +0 -16
  78. package/dist/cli/commands/tunnel/list.js +0 -98
  79. package/dist/cli/commands/tunnel/start.d.ts +0 -24
  80. package/dist/cli/commands/tunnel/start.js +0 -107
  81. package/dist/cli/commands/tunnel/stop.d.ts +0 -20
  82. package/dist/cli/commands/tunnel/stop.js +0 -90
  83. package/dist/cli/commands/tunnel/url.d.ts +0 -21
  84. package/dist/cli/commands/tunnel/url.js +0 -70
  85. package/dist/cli/commands/windows/context.d.ts +0 -18
  86. package/dist/cli/commands/windows/context.js +0 -326
  87. package/dist/cli/commands/windows/focus.d.ts +0 -17
  88. package/dist/cli/commands/windows/focus.js +0 -103
  89. package/dist/cli/commands/windows/list.d.ts +0 -21
  90. package/dist/cli/commands/windows/list.js +0 -172
  91. package/dist/cli/commands/windows/map.d.ts +0 -17
  92. package/dist/cli/commands/windows/map.js +0 -168
  93. package/dist/cli/commands/windows/read.d.ts +0 -21
  94. package/dist/cli/commands/windows/read.js +0 -241
  95. package/dist/cli/commands/windows/search.d.ts +0 -24
  96. package/dist/cli/commands/windows/search.js +0 -171
  97. package/dist/cli/commands/windows/show.d.ts +0 -19
  98. package/dist/cli/commands/windows/show.js +0 -165
  99. package/dist/cli/commands/windows/watch.d.ts +0 -19
  100. package/dist/cli/commands/windows/watch.js +0 -241
  101. package/dist/lib/managed-session.d.ts +0 -27
  102. package/dist/lib/managed-session.js +0 -105
  103. package/dist/lib/panes/broker.d.ts +0 -130
  104. package/dist/lib/panes/broker.js +0 -97
  105. package/dist/lib/panes/index.d.ts +0 -2
  106. package/dist/lib/panes/index.js +0 -1
  107. package/dist/lib/panes/server.d.ts +0 -17
  108. package/dist/lib/panes/server.js +0 -308
  109. package/dist/lib/preview/manager.d.ts +0 -77
  110. package/dist/lib/preview/manager.js +0 -369
  111. package/dist/lib/preview/schema.d.ts +0 -2
  112. package/dist/lib/preview/schema.js +0 -32
  113. package/dist/lib/preview/sprite.d.ts +0 -85
  114. package/dist/lib/preview/sprite.js +0 -321
  115. package/dist/lib/preview/watcher.d.ts +0 -63
  116. package/dist/lib/preview/watcher.js +0 -185
  117. package/dist/lib/project-identity.d.ts +0 -16
  118. package/dist/lib/project-identity.js +0 -75
  119. package/dist/lib/tmux/bridge.d.ts +0 -133
  120. package/dist/lib/tmux/bridge.js +0 -315
  121. package/dist/lib/tmux/context.d.ts +0 -82
  122. package/dist/lib/tmux/context.js +0 -239
  123. package/dist/lib/tmux/index.d.ts +0 -8
  124. package/dist/lib/tmux/index.js +0 -11
  125. package/dist/lib/tmux/map.d.ts +0 -57
  126. package/dist/lib/tmux/map.js +0 -198
  127. package/dist/lib/tmux/panes.d.ts +0 -27
  128. package/dist/lib/tmux/panes.js +0 -151
  129. package/dist/lib/tmux/redaction.d.ts +0 -57
  130. package/dist/lib/tmux/redaction.js +0 -152
  131. package/dist/lib/web/analytics.d.ts +0 -63
  132. package/dist/lib/web/analytics.js +0 -168
  133. package/dist/lib/web/server.d.ts +0 -26
  134. package/dist/lib/web/server.js +0 -697
  135. package/dist/lib/web/tmux-bridge.d.ts +0 -7
  136. package/dist/lib/web/tmux-bridge.js +0 -7
  137. package/dist/lib/windows/index.d.ts +0 -3
  138. package/dist/lib/windows/index.js +0 -2
  139. package/dist/lib/windows/inventory.d.ts +0 -21
  140. package/dist/lib/windows/inventory.js +0 -263
  141. package/dist/lib/windows/types.d.ts +0 -46
  142. package/dist/lib/windows/types.js +0 -1
@@ -1,7 +0,0 @@
1
- /**
2
- * tmux bridge for agents web.
3
- *
4
- * This file re-exports from the core tmux bridge module for backwards compatibility.
5
- * New code should import from '../tmux/bridge.js' or '../tmux/index.js' directly.
6
- */
7
- export * from "../tmux/bridge.js";
@@ -1,7 +0,0 @@
1
- /**
2
- * tmux bridge for agents web.
3
- *
4
- * This file re-exports from the core tmux bridge module for backwards compatibility.
5
- * New code should import from '../tmux/bridge.js' or '../tmux/index.js' directly.
6
- */
7
- export * from "../tmux/bridge.js";
@@ -1,3 +0,0 @@
1
- export * from "./inventory.js";
2
- export * from "./types.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +0,0 @@
1
- export * from "./inventory.js";
2
- export * from "./types.js";
@@ -1,21 +0,0 @@
1
- import type { WindowState } from "./types.js";
2
- export interface InventoryOptions {
3
- session?: string;
4
- includeNvim?: boolean;
5
- includeAgent?: boolean;
6
- includeBuffers?: boolean;
7
- }
8
- /**
9
- * Get complete inventory of all workspace windows.
10
- * Correlates tmux panes → nvim instances → agent processes.
11
- */
12
- export declare function inventory(options?: InventoryOptions): Promise<WindowState[]>;
13
- /**
14
- * Get a single window's state by pane ID or session:window.pane reference.
15
- */
16
- export declare function getWindowState(ref: string, options?: Omit<InventoryOptions, "session">): Promise<WindowState | null>;
17
- /**
18
- * Get the currently focused window's state.
19
- */
20
- export declare function getFocusedWindow(options?: Omit<InventoryOptions, "session">): Promise<WindowState | null>;
21
- //# sourceMappingURL=inventory.d.ts.map
@@ -1,263 +0,0 @@
1
- import * as nvim from "../nvim/index.js";
2
- import * as process from "../process/snapshot.js";
3
- import * as tmux from "../tmux/bridge.js";
4
- function normalizeTty(tty) {
5
- if (!tty)
6
- return null;
7
- const trimmed = tty.trim();
8
- if (!trimmed)
9
- return null;
10
- if (trimmed.startsWith("/dev/"))
11
- return trimmed.slice("/dev/".length);
12
- return trimmed;
13
- }
14
- function guessPanePidFromTty(paneTty, snapshot) {
15
- const normalizedPaneTty = normalizeTty(paneTty);
16
- if (!normalizedPaneTty)
17
- return null;
18
- const matching = [];
19
- for (const [, info] of snapshot) {
20
- if (normalizeTty(info.tty) === normalizedPaneTty) {
21
- matching.push(info);
22
- }
23
- }
24
- if (matching.length === 0)
25
- return null;
26
- const pidSet = new Set(matching.map((p) => p.pid));
27
- const roots = matching.filter((p) => !pidSet.has(p.ppid));
28
- const candidates = roots.length > 0 ? roots : matching;
29
- const shells = new Set(["zsh", "bash", "fish", "sh", "nu", "pwsh", "tcsh", "csh", "ksh", "dash"]);
30
- candidates.sort((a, b) => {
31
- const aShell = shells.has(a.cmd.toLowerCase()) ? 0 : 1;
32
- const bShell = shells.has(b.cmd.toLowerCase()) ? 0 : 1;
33
- if (aShell !== bShell)
34
- return aShell - bShell;
35
- return a.pid - b.pid;
36
- });
37
- return candidates[0]?.pid ?? null;
38
- }
39
- function extractSessionId(args) {
40
- const match = args.match(/(?:^|\s)--session-id(?:=|\s+)([^\s]+)/);
41
- return match?.[1];
42
- }
43
- function extractIssue(args) {
44
- const match = args.match(/\b[A-Z][A-Z0-9]{1,9}-\d+\b/);
45
- return match?.[0];
46
- }
47
- function depthFromRoot(rootPid, pid, snapshot, maxDepth = 50) {
48
- if (pid === rootPid)
49
- return 0;
50
- let depth = 0;
51
- let current = pid;
52
- const visited = new Set();
53
- while (depth < maxDepth) {
54
- if (current === rootPid)
55
- return depth;
56
- if (visited.has(current))
57
- break;
58
- visited.add(current);
59
- const info = snapshot.get(current);
60
- if (!info)
61
- break;
62
- current = info.ppid;
63
- depth++;
64
- }
65
- return depth;
66
- }
67
- function toBufferInfo(buf) {
68
- const record = typeof buf === "object" && buf !== null ? buf : {};
69
- const name = typeof record.name === "string" ? record.name : "";
70
- const filetype = typeof record.filetype === "string" ? record.filetype : "";
71
- const lineCount = typeof record.lineCount === "number"
72
- ? record.lineCount
73
- : typeof record.linecount === "number"
74
- ? record.linecount
75
- : 0;
76
- const cursor = typeof record.cursor === "object" &&
77
- record.cursor !== null &&
78
- typeof record.cursor.line === "number" &&
79
- typeof record.cursor.col === "number"
80
- ? {
81
- line: record.cursor.line,
82
- col: record.cursor.col,
83
- }
84
- : undefined;
85
- return {
86
- name,
87
- path: name,
88
- modified: Boolean(record.modified),
89
- filetype,
90
- lineCount,
91
- cursor,
92
- };
93
- }
94
- function detectAgentForPane(panePid, snapshot, tree) {
95
- if (panePid <= 0)
96
- return null;
97
- const candidatePids = process.findDescendants(panePid, tree, snapshot, (p) => {
98
- return process.detectAgentType(p) !== null;
99
- });
100
- // Include root pid if pane is running the agent directly.
101
- const paneInfo = snapshot.get(panePid);
102
- if (paneInfo && process.detectAgentType(paneInfo)) {
103
- candidatePids.push(panePid);
104
- }
105
- if (candidatePids.length === 0)
106
- return null;
107
- let best = null;
108
- for (const pid of candidatePids) {
109
- const info = snapshot.get(pid);
110
- if (!info)
111
- continue;
112
- const type = process.detectAgentType(info);
113
- if (!type)
114
- continue;
115
- const depth = depthFromRoot(panePid, pid, snapshot);
116
- if (!best || depth > best.depth || (depth === best.depth && pid < best.pid)) {
117
- best = { pid, depth, type, info };
118
- }
119
- }
120
- if (!best)
121
- return null;
122
- return {
123
- type: best.type,
124
- pid: best.pid,
125
- sessionId: extractSessionId(best.info.args),
126
- issue: extractIssue(best.info.args),
127
- };
128
- }
129
- async function buildWindowState(params) {
130
- const { sessionName, windowIndex, windowName, pane, snapshot, tree, options } = params;
131
- const paneId = (await tmux.getPaneId(windowIndex, pane.index, sessionName)) ?? "";
132
- const paneTty = (await tmux.getPaneTty(windowIndex, pane.index, sessionName)) ?? "";
133
- const panePid = guessPanePidFromTty(paneTty, snapshot) ?? -1;
134
- const window = {
135
- session: sessionName,
136
- window: windowIndex,
137
- windowName,
138
- pane: pane.index,
139
- paneId,
140
- panePid,
141
- paneTty,
142
- title: pane.currentCommand,
143
- cwd: pane.currentPath,
144
- active: pane.active,
145
- size: { cols: pane.width, rows: pane.height },
146
- };
147
- const agent = options.includeAgent ? detectAgentForPane(panePid, snapshot, tree) : null;
148
- if (!options.includeNvim) {
149
- return { window, nvim: null, agent, buffers: [] };
150
- }
151
- const nvimState = {
152
- available: false,
153
- pid: null,
154
- serverAddr: null,
155
- discoveryMethod: null,
156
- currentBuffer: null,
157
- };
158
- let buffers = [];
159
- if (panePid > 0) {
160
- let nvimPid = nvim.findNvimPidForWindow(panePid, snapshot, tree);
161
- // If the pane is running nvim directly (no shell), treat it as the nvim pid.
162
- if (!nvimPid) {
163
- const rootInfo = snapshot.get(panePid);
164
- if (rootInfo && process.isNvimProcess(rootInfo)) {
165
- nvimPid = panePid;
166
- }
167
- }
168
- if (nvimPid) {
169
- nvimState.available = true;
170
- nvimState.pid = nvimPid;
171
- const discovery = await nvim.discoverNvimServerAddress(nvimPid, snapshot);
172
- nvimState.serverAddr = discovery?.addr ?? null;
173
- nvimState.discoveryMethod = discovery?.method ?? null;
174
- if (options.includeBuffers && nvimState.serverAddr) {
175
- const [listed, current] = await Promise.all([
176
- nvim.listBuffers(nvimState.serverAddr),
177
- nvim.getCurrentBufferInfo(nvimState.serverAddr),
178
- ]);
179
- buffers = (listed ?? []).map(toBufferInfo);
180
- nvimState.currentBuffer = current ? toBufferInfo(current) : null;
181
- }
182
- }
183
- }
184
- return { window, nvim: nvimState, agent, buffers };
185
- }
186
- /**
187
- * Get complete inventory of all workspace windows.
188
- * Correlates tmux panes → nvim instances → agent processes.
189
- */
190
- export async function inventory(options) {
191
- const { session, includeNvim = true, includeAgent = true, includeBuffers = false, } = options || {};
192
- const tmuxRunning = await tmux.isRunning();
193
- if (!tmuxRunning)
194
- return [];
195
- const sessions = await tmux.listSessions();
196
- const targetSessions = session ? sessions.filter((s) => s.name === session) : sessions;
197
- if (session && targetSessions.length === 0)
198
- return [];
199
- const snapshot = await process.getProcessSnapshot();
200
- const tree = process.buildProcessTree(snapshot);
201
- const states = [];
202
- for (const s of targetSessions) {
203
- const windows = await tmux.listWindows(s.name);
204
- for (const w of windows) {
205
- const panes = await tmux.listPanes(w.index, s.name);
206
- for (const pane of panes) {
207
- states.push(await buildWindowState({
208
- sessionName: s.name,
209
- windowIndex: w.index,
210
- windowName: w.name,
211
- pane,
212
- snapshot,
213
- tree,
214
- options: { includeNvim, includeAgent, includeBuffers },
215
- }));
216
- }
217
- }
218
- }
219
- return states;
220
- }
221
- /**
222
- * Get a single window's state by pane ID or session:window.pane reference.
223
- */
224
- export async function getWindowState(ref, options) {
225
- const trimmed = ref.trim();
226
- if (!trimmed)
227
- return null;
228
- // Pane ID form: "%3"
229
- if (trimmed.startsWith("%")) {
230
- const states = await inventory({ ...(options || {}) });
231
- return states.find((s) => s.window.paneId === trimmed) ?? null;
232
- }
233
- // session:window.pane form, e.g. "work:1.0"
234
- const match = trimmed.match(/^([^:]+):(\d+)\.(\d+)$/);
235
- if (!match)
236
- return null;
237
- const sessionName = match[1];
238
- const windowIndex = parseInt(match[2], 10);
239
- const paneIndex = parseInt(match[3], 10);
240
- const states = await inventory({ ...(options || {}), session: sessionName });
241
- return states.find((s) => s.window.window === windowIndex && s.window.pane === paneIndex) ?? null;
242
- }
243
- /**
244
- * Get the currently focused window's state.
245
- */
246
- export async function getFocusedWindow(options) {
247
- const tmuxRunning = await tmux.isRunning();
248
- if (!tmuxRunning)
249
- return null;
250
- const sessions = await tmux.listSessions();
251
- const attachedSession = sessions.find((s) => s.attached);
252
- if (!attachedSession)
253
- return null;
254
- const windows = await tmux.listWindows(attachedSession.name);
255
- const activeWindow = windows.find((w) => w.active);
256
- if (!activeWindow)
257
- return null;
258
- const panes = await tmux.listPanes(activeWindow.index, attachedSession.name);
259
- const activePane = panes.find((p) => p.active);
260
- if (!activePane)
261
- return null;
262
- return getWindowState(`${attachedSession.name}:${activeWindow.index}.${activePane.index}`, options);
263
- }
@@ -1,46 +0,0 @@
1
- export interface WindowInfo {
2
- session: string;
3
- window: number;
4
- windowName: string;
5
- pane: number;
6
- paneId: string;
7
- panePid: number;
8
- paneTty: string;
9
- title: string;
10
- cwd: string;
11
- active: boolean;
12
- size: {
13
- cols: number;
14
- rows: number;
15
- };
16
- }
17
- export interface BufferInfo {
18
- name: string;
19
- path: string;
20
- modified: boolean;
21
- filetype: string;
22
- lineCount: number;
23
- cursor?: {
24
- line: number;
25
- col: number;
26
- };
27
- }
28
- export interface AgentInfo {
29
- type: "claude" | "codex" | "copilot" | "gemini";
30
- pid: number;
31
- sessionId?: string;
32
- issue?: string;
33
- }
34
- export interface WindowState {
35
- window: WindowInfo;
36
- nvim: {
37
- available: boolean;
38
- pid: number | null;
39
- serverAddr: string | null;
40
- discoveryMethod: "argv" | "lsof" | null;
41
- currentBuffer: BufferInfo | null;
42
- } | null;
43
- agent: AgentInfo | null;
44
- buffers: BufferInfo[];
45
- }
46
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- export {};