@indianic/dialout 1.13.2 → 1.14.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 (54) hide show
  1. package/dist/ai-adapters/augment.d.ts +3 -0
  2. package/dist/ai-adapters/augment.d.ts.map +1 -0
  3. package/dist/ai-adapters/augment.js +147 -0
  4. package/dist/ai-adapters/augment.js.map +1 -0
  5. package/dist/ai-adapters/index.d.ts.map +1 -1
  6. package/dist/ai-adapters/index.js +2 -0
  7. package/dist/ai-adapters/index.js.map +1 -1
  8. package/dist/ai-json-tail.d.ts +26 -0
  9. package/dist/ai-json-tail.d.ts.map +1 -0
  10. package/dist/ai-json-tail.js +153 -0
  11. package/dist/ai-json-tail.js.map +1 -0
  12. package/dist/ai-session-detector.d.ts +22 -4
  13. package/dist/ai-session-detector.d.ts.map +1 -1
  14. package/dist/ai-session-detector.js +43 -6
  15. package/dist/ai-session-detector.js.map +1 -1
  16. package/dist/ai-sessions.d.ts +4 -2
  17. package/dist/ai-sessions.d.ts.map +1 -1
  18. package/dist/ai-sessions.js +24 -8
  19. package/dist/ai-sessions.js.map +1 -1
  20. package/dist/ai-transcript-locator.d.ts +74 -0
  21. package/dist/ai-transcript-locator.d.ts.map +1 -1
  22. package/dist/ai-transcript-locator.js +181 -0
  23. package/dist/ai-transcript-locator.js.map +1 -1
  24. package/dist/ai-transcript-tail.d.ts +17 -1
  25. package/dist/ai-transcript-tail.d.ts.map +1 -1
  26. package/dist/ai-transcript-tail.js.map +1 -1
  27. package/dist/cli-client.d.ts.map +1 -1
  28. package/dist/cli-client.js +1 -0
  29. package/dist/cli-client.js.map +1 -1
  30. package/dist/cli.js +96 -0
  31. package/dist/cli.js.map +1 -1
  32. package/dist/config.d.ts +21 -1
  33. package/dist/config.d.ts.map +1 -1
  34. package/dist/config.js +28 -2
  35. package/dist/config.js.map +1 -1
  36. package/node_modules/@indianic/dialout-shared/dist/custom-agents.d.ts +97 -0
  37. package/node_modules/@indianic/dialout-shared/dist/custom-agents.d.ts.map +1 -0
  38. package/node_modules/@indianic/dialout-shared/dist/custom-agents.js +147 -0
  39. package/node_modules/@indianic/dialout-shared/dist/custom-agents.test.d.ts +2 -0
  40. package/node_modules/@indianic/dialout-shared/dist/custom-agents.test.d.ts.map +1 -0
  41. package/node_modules/@indianic/dialout-shared/dist/custom-agents.test.js +155 -0
  42. package/node_modules/@indianic/dialout-shared/dist/index.d.ts +2 -0
  43. package/node_modules/@indianic/dialout-shared/dist/index.d.ts.map +1 -1
  44. package/node_modules/@indianic/dialout-shared/dist/index.js +11 -2
  45. package/node_modules/@indianic/dialout-shared/dist/kinds.d.ts +1 -1
  46. package/node_modules/@indianic/dialout-shared/dist/kinds.d.ts.map +1 -1
  47. package/node_modules/@indianic/dialout-shared/package.json +1 -1
  48. package/node_modules/@indianic/dialout-shared/src/.impeccable/hook.cache.json +1 -0
  49. package/node_modules/@indianic/dialout-shared/src/.omc/state/sessions/e864cc5c-dad7-49c4-8666-6d7fb2297d2a/pre-tool-advisory-throttle.json +14 -0
  50. package/node_modules/@indianic/dialout-shared/src/custom-agents.test.ts +185 -0
  51. package/node_modules/@indianic/dialout-shared/src/custom-agents.ts +198 -0
  52. package/node_modules/@indianic/dialout-shared/src/index.ts +5 -0
  53. package/node_modules/@indianic/dialout-shared/src/kinds.ts +1 -1
  54. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ import { AiAdapter } from './types';
2
+ export declare const augmentAdapter: AiAdapter;
3
+ //# sourceMappingURL=augment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"augment.d.ts","sourceRoot":"","sources":["../../src/ai-adapters/augment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,SAAS,CAAC;AAkDtD,eAAO,MAAM,cAAc,EAAE,SAwF5B,CAAC"}
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.augmentAdapter = void 0;
4
+ const types_1 = require("./types");
5
+ // Augment ("agy", formerly auggie) stores ONE JSON document per session at
6
+ // ~/.augment/sessions/<uuid>.json — not JSONL. The whole-file shape is
7
+ // { sessionId, created, modified, chatHistory[], agentState, rootTaskUuid,
8
+ // terminalId }, and JsonSessionTail feeds this adapter one chatHistory
9
+ // entry at a time so the adapter contract stays identical to the JSONL ones.
10
+ //
11
+ // An entry is { exchange, completed, sequenceId, finishedAt, changedFiles… }
12
+ // where exchange = { request_message, response_text, request_id,
13
+ // request_nodes[], response_nodes[] }.
14
+ //
15
+ // Measured across 808 real exchanges in 5 session files:
16
+ //
17
+ // response_nodes type=5 873 tool_use -> tool_call
18
+ // response_nodes type=0 800 content -> assistant message
19
+ // request_nodes type=1 851 tool_result_node -> tool_result
20
+ // request_nodes type=4 796 ide_state_node -> DROPPED
21
+ // request_nodes type=0 94 text_node -> fallback only
22
+ // request_nodes type=10 17 history_summary -> DROPPED
23
+ //
24
+ // Two of those counts are the whole reason this file reads the way it does.
25
+ //
26
+ // `ide_state_node` appeared 796 times — almost once per exchange. It is
27
+ // Augment's own editor-state blob, not anything a person said. Emitting it
28
+ // would put 796 junk bubbles into an 808-exchange conversation, which is the
29
+ // same mistake the Codex adapter made with its `developer` role.
30
+ //
31
+ // `thinking` was null on all 1704 nodes and `token_usage` on every one, so
32
+ // this adapter emits no thinking events and contributes no usage. Augment
33
+ // simply does not persist either. Emitting empty thinking bubbles to prove we
34
+ // looked would be worse than emitting nothing.
35
+ const NODE_ASSISTANT_TEXT = 0;
36
+ const NODE_TOOL_USE = 5;
37
+ const NODE_TOOL_RESULT = 1;
38
+ function toolInput(raw) {
39
+ // `input_json` is a JSON *string*. Parse it for structured display, but a
40
+ // parse failure must never drop the call: the raw string still tells the
41
+ // user what ran. Same rule as the Codex adapter's `arguments`.
42
+ if (typeof raw !== 'string')
43
+ return raw;
44
+ try {
45
+ return JSON.parse(raw);
46
+ }
47
+ catch {
48
+ return raw;
49
+ }
50
+ }
51
+ function asText(v) {
52
+ if (typeof v === 'string')
53
+ return v;
54
+ if (Array.isArray(v))
55
+ return v.map((b) => (typeof b?.text === 'string' ? b.text : '')).join('');
56
+ return '';
57
+ }
58
+ exports.augmentAdapter = {
59
+ toEvents(record) {
60
+ const entry = record;
61
+ if (!entry || typeof entry !== 'object')
62
+ return [];
63
+ const ex = entry.exchange;
64
+ if (!ex || typeof ex !== 'object')
65
+ return [];
66
+ const at = typeof entry.finishedAt === 'string' ? entry.finishedAt : '';
67
+ const rid = String(ex.request_id || '');
68
+ const out = [];
69
+ // The user's turn. `request_message` carried text on every one of the 808
70
+ // exchanges; `text_node` appeared on only 94, so it is a fallback rather
71
+ // than a second source — using both would double every message that has
72
+ // one of each.
73
+ const userText = typeof ex.request_message === 'string' && ex.request_message.trim()
74
+ ? ex.request_message
75
+ : asText((ex.request_nodes || []).find((n) => n?.type === NODE_ASSISTANT_TEXT)?.text_node?.content);
76
+ if (userText.trim()) {
77
+ out.push({ kind: 'message', role: 'user', text: userText, id: rid ? `${rid}:req` : undefined, at });
78
+ }
79
+ // Results arrive attached to the request that carries them, which is the
80
+ // turn AFTER the one that made the call — so they are emitted before this
81
+ // turn's own calls, matching the order they actually happened in. Pairing
82
+ // is by `tool_use_id`, verified exactly: 849 of 849 result ids matched a
83
+ // call id. (860 calls to 849 results; the surplus are calls still in
84
+ // flight, which is what lets deriveStatus see 'waiting_approval'.)
85
+ for (const n of ex.request_nodes || []) {
86
+ if (n?.type !== NODE_TOOL_RESULT || !n.tool_result_node)
87
+ continue;
88
+ const t = n.tool_result_node;
89
+ out.push({
90
+ kind: 'tool_result',
91
+ forId: String(t.tool_use_id || ''),
92
+ // Augment publishes a real failure flag, unlike Codex where none was
93
+ // observable. Anything other than an explicit true is a success, so a
94
+ // missing field never turns a healthy result into an error.
95
+ ok: t.is_error !== true,
96
+ preview: (0, types_1.preview)(asText(t.content)),
97
+ at,
98
+ });
99
+ }
100
+ // The response, in file order, so text and tool calls stay interleaved the
101
+ // way the agent produced them. `exchange.response_text` holds the same
102
+ // prose flattened into one string; using it as well would duplicate every
103
+ // assistant message, so it is only a fallback for an empty node list.
104
+ const nodes = Array.isArray(ex.response_nodes) ? ex.response_nodes : [];
105
+ for (const n of nodes) {
106
+ if (n?.type === NODE_ASSISTANT_TEXT) {
107
+ const text = asText(n.content);
108
+ if (text)
109
+ out.push({ kind: 'message', role: 'assistant', text, id: String(n.id ?? ''), at });
110
+ }
111
+ else if (n?.type === NODE_TOOL_USE && n.tool_use) {
112
+ const tu = n.tool_use;
113
+ // A partial call is still being streamed into the file; its arguments
114
+ // are incomplete, but showing the call is right — that is exactly the
115
+ // moment the user wants to see what it is about to run.
116
+ out.push({
117
+ kind: 'tool_call',
118
+ name: String(tu.tool_name || 'tool'),
119
+ summary: (0, types_1.preview)(typeof tu.input_json === 'string' ? tu.input_json : JSON.stringify(tu.input_json ?? '')),
120
+ input: toolInput(tu.input_json),
121
+ id: String(tu.tool_use_id || ''),
122
+ at,
123
+ });
124
+ }
125
+ }
126
+ if (!nodes.length && typeof ex.response_text === 'string' && ex.response_text.trim()) {
127
+ out.push({ kind: 'message', role: 'assistant', text: ex.response_text, at });
128
+ }
129
+ return out;
130
+ },
131
+ title(record) {
132
+ const entry = record;
133
+ // ai-sessions keeps the LAST non-null title, so answering for every
134
+ // exchange would retitle the session on every turn. Augment numbers
135
+ // exchanges from 1 (measured: min=1 across all files), so only the opening
136
+ // turn names the session — and its ids are not unique (one 219-entry file
137
+ // tops out at 209), which is why this is a title guard and nothing else.
138
+ if (!entry || entry.sequenceId !== 1)
139
+ return null;
140
+ const msg = entry.exchange?.request_message;
141
+ if (typeof msg !== 'string')
142
+ return null;
143
+ const line = msg.trim().split('\n')[0].trim();
144
+ return line ? line.slice(0, 60) : null;
145
+ },
146
+ };
147
+ //# sourceMappingURL=augment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"augment.js","sourceRoot":"","sources":["../../src/ai-adapters/augment.ts"],"names":[],"mappings":";;;AAAA,mCAAsD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,EAAE,eAAe,CAAC;QAC5C,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QACzC,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9C,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACzC,CAAC;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai-adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAWpC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAElD;AAED,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai-adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAapC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAElD;AAED,cAAc,SAAS,CAAC"}
@@ -18,10 +18,12 @@ exports.adapterFor = adapterFor;
18
18
  const claude_1 = require("./claude");
19
19
  const codex_1 = require("./codex");
20
20
  const grok_1 = require("./grok");
21
+ const augment_1 = require("./augment");
21
22
  const ADAPTERS = {
22
23
  claude: claude_1.claudeAdapter,
23
24
  codex: codex_1.codexAdapter,
24
25
  grok: grok_1.grokAdapter,
26
+ augment: augment_1.augmentAdapter,
25
27
  };
26
28
  function adapterFor(kind) {
27
29
  return ADAPTERS[kind];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ai-adapters/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAYA,gCAEC;AAZD,qCAAyC;AACzC,mCAAuC;AACvC,iCAAqC;AAErC,MAAM,QAAQ,GAA8B;IAC1C,MAAM,EAAE,sBAAa;IACrB,KAAK,EAAE,oBAAY;IACnB,IAAI,EAAE,kBAAW;CAClB,CAAC;AAEF,SAAgB,UAAU,CAAC,IAAY;IACrC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAED,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ai-adapters/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAcA,gCAEC;AAdD,qCAAyC;AACzC,mCAAuC;AACvC,iCAAqC;AACrC,uCAA2C;AAE3C,MAAM,QAAQ,GAA8B;IAC1C,MAAM,EAAE,sBAAa;IACrB,KAAK,EAAE,oBAAY;IACnB,IAAI,EAAE,kBAAW;IACjB,OAAO,EAAE,wBAAc;CACxB,CAAC;AAEF,SAAgB,UAAU,CAAC,IAAY;IACrC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAED,0CAAwB"}
@@ -0,0 +1,26 @@
1
+ import type { SessionTail } from './ai-transcript-tail';
2
+ export interface JsonTailDeps {
3
+ readFile?: (path: string) => string;
4
+ stat?: (path: string) => {
5
+ size: number;
6
+ mtimeMs: number;
7
+ };
8
+ }
9
+ /** The entries this document holds, or null when it is not a shape we know. */
10
+ export declare function historyOf(parsed: unknown): unknown[] | null;
11
+ export declare class JsonSessionTail implements SessionTail {
12
+ private readonly path;
13
+ private readonly onRecords;
14
+ private readonly deps;
15
+ private emitted;
16
+ private lastSize;
17
+ private lastMtime;
18
+ private timer;
19
+ lastGrowthMs: number;
20
+ constructor(path: string, onRecords: (records: unknown[]) => void, deps?: JsonTailDeps);
21
+ start(): void;
22
+ stop(): void;
23
+ catchUp(): void;
24
+ pump(): boolean;
25
+ }
26
+ //# sourceMappingURL=ai-json-tail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-json-tail.d.ts","sourceRoot":"","sources":["../src/ai-json-tail.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAsBxD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5D;AAED,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,EAAE,GAAG,IAAI,CAI3D;AAED,qBAAa,eAAgB,YAAW,WAAW;IAQ/C,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,IAAI;IATvB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,KAAK,CAA+B;IAC5C,YAAY,SAAK;gBAGE,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,EACvC,IAAI,GAAE,YAAiB;IAG1C,KAAK,IAAI,IAAI;IAMb,IAAI,IAAI,IAAI;IAOZ,OAAO,IAAI,IAAI;IAIf,IAAI,IAAI,OAAO;CAyDhB"}
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.JsonSessionTail = void 0;
37
+ exports.historyOf = historyOf;
38
+ const fs = __importStar(require("fs"));
39
+ // Follower for a vendor that keeps one whole-JSON document per session
40
+ // instead of an append-only JSONL file. Augment is the first; the three
41
+ // vendors before it all append line by line, which TranscriptTail follows by
42
+ // byte offset.
43
+ //
44
+ // A byte offset is meaningless here. Augment rewrites the entire document on
45
+ // every turn, so the interesting change is not "the file grew" but "the array
46
+ // inside it got longer". This class therefore tracks how many chatHistory
47
+ // entries it has already handed over, and emits the new ones — each entry
48
+ // going out as one `record`, so the adapter contract is identical to the
49
+ // JSONL vendors' and AiAdapter needed no change at all.
50
+ const POLL_MS = 1000;
51
+ // A whole-file parse is the price of the format. 64 MB is far above the
52
+ // largest real session measured (3.0 MB) and well below what would stall the
53
+ // agent's event loop; past it, something is wrong and refusing to parse is
54
+ // better than freezing every other session on the machine.
55
+ const MAX_FILE = 64 << 20;
56
+ /** The entries this document holds, or null when it is not a shape we know. */
57
+ function historyOf(parsed) {
58
+ if (!parsed || typeof parsed !== 'object')
59
+ return null;
60
+ const h = parsed.chatHistory;
61
+ return Array.isArray(h) ? h : null;
62
+ }
63
+ class JsonSessionTail {
64
+ path;
65
+ onRecords;
66
+ deps;
67
+ emitted = 0;
68
+ lastSize = -1;
69
+ lastMtime = -1;
70
+ timer = null;
71
+ lastGrowthMs = 0;
72
+ constructor(path, onRecords, deps = {}) {
73
+ this.path = path;
74
+ this.onRecords = onRecords;
75
+ this.deps = deps;
76
+ }
77
+ start() {
78
+ this.stop();
79
+ this.timer = setInterval(() => this.pump(), POLL_MS);
80
+ this.pump();
81
+ }
82
+ stop() {
83
+ if (this.timer) {
84
+ clearInterval(this.timer);
85
+ this.timer = null;
86
+ }
87
+ }
88
+ // One pass is all a whole-file format ever needs: the single read already
89
+ // holds the complete history, so there is nothing to loop over. The JSONL
90
+ // version loops because it reads in bounded 4 MB chunks.
91
+ catchUp() {
92
+ this.pump();
93
+ }
94
+ pump() {
95
+ const stat = this.deps.stat || ((p) => fs.statSync(p));
96
+ const readFile = this.deps.readFile || ((p) => fs.readFileSync(p, 'utf8'));
97
+ let size;
98
+ let mtimeMs;
99
+ try {
100
+ const s = stat(this.path);
101
+ size = s.size;
102
+ mtimeMs = s.mtimeMs;
103
+ }
104
+ catch {
105
+ return false; // not created yet, or rotated away; try again next tick
106
+ }
107
+ if (size > MAX_FILE)
108
+ return false;
109
+ // Nothing has touched the file, so the array inside cannot have changed.
110
+ // This is what keeps the cost at one parse per turn rather than one per
111
+ // second: an idle session re-parses nothing at all.
112
+ if (size === this.lastSize && mtimeMs === this.lastMtime)
113
+ return false;
114
+ let parsed;
115
+ try {
116
+ parsed = JSON.parse(readFile(this.path));
117
+ }
118
+ catch {
119
+ // Expected, and the whole reason this is not a fatal path. The file is
120
+ // rewritten wholesale on every turn, so a poll that lands mid-write sees
121
+ // truncated JSON. Deliberately DON'T record size/mtime here: leaving
122
+ // them stale is what makes the next tick retry instead of treating a
123
+ // half-written document as the current state and going quiet until the
124
+ // turn after.
125
+ return false;
126
+ }
127
+ this.lastSize = size;
128
+ this.lastMtime = mtimeMs;
129
+ const history = historyOf(parsed);
130
+ if (!history)
131
+ return false;
132
+ if (history.length < this.emitted) {
133
+ // The history shrank, so this is not the document we were following:
134
+ // Augment compacted it, or the session id was reused. Re-emitting from
135
+ // zero would duplicate the whole conversation in the open chat, so the
136
+ // counter is moved to the new length and only genuinely new entries
137
+ // follow. The already-sent events stay as they are — a compaction
138
+ // rewrites history the viewer has already read, and silently retracting
139
+ // it would be a worse lie than leaving it.
140
+ this.emitted = history.length;
141
+ return false;
142
+ }
143
+ if (history.length === this.emitted)
144
+ return false;
145
+ const fresh = history.slice(this.emitted);
146
+ this.emitted = history.length;
147
+ this.lastGrowthMs = Date.now();
148
+ this.onRecords(fresh);
149
+ return true;
150
+ }
151
+ }
152
+ exports.JsonSessionTail = JsonSessionTail;
153
+ //# sourceMappingURL=ai-json-tail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-json-tail.js","sourceRoot":"","sources":["../src/ai-json-tail.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,8BAIC;AAjCD,uCAAyB;AAGzB,uEAAuE;AACvE,wEAAwE;AACxE,6EAA6E;AAC7E,eAAe;AACf,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,wDAAwD;AAExD,MAAM,OAAO,GAAG,IAAI,CAAC;AAErB,wEAAwE;AACxE,6EAA6E;AAC7E,2EAA2E;AAC3E,2DAA2D;AAC3D,MAAM,QAAQ,GAAG,EAAE,IAAI,EAAE,CAAC;AAO1B,+EAA+E;AAC/E,SAAgB,SAAS,CAAC,MAAe;IACvC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACvD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AAG,OAAO,CAAC,MAAM,CAAC;YAC9B,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,OAAO;YAAE,OAAO,KAAK,CAAC;QAElD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;QAC9B,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAvFD,0CAuFC"}
@@ -1,5 +1,5 @@
1
- import type { AiKind } from '@indianic/dialout-shared';
2
- export type { AiKind };
1
+ import type { AiKind, CustomAgent } from '@indianic/dialout-shared';
2
+ export type { AiKind, CustomAgent };
3
3
  export interface ProcRow {
4
4
  pid: number;
5
5
  ppid: number;
@@ -7,10 +7,28 @@ export interface ProcRow {
7
7
  }
8
8
  export declare function parseProcessTable(psOutput: string): ProcRow[];
9
9
  export declare function descendantsOf(rows: ProcRow[], rootPid: number): ProcRow[];
10
- export declare function classifyProcess(command: string): AiKind | null;
11
- export declare function findAgentInPane(rows: ProcRow[], panePid: number): {
10
+ /**
11
+ * Which agent a command line is, including the ones this machine's owner
12
+ * declared by hand.
13
+ *
14
+ * Built-in rules are tried FIRST and a custom entry can never override one. A
15
+ * declaration is a way to recognise something we would otherwise miss, not a
16
+ * way to re-label a CLI we already read correctly — and the failure mode of
17
+ * the other order is ugly: one careless entry named `claude` would reroute
18
+ * every real Claude session on the machine to another parser.
19
+ *
20
+ * The custom agent itself comes back alongside the kind, because the caller
21
+ * needs its transcript template to find the conversation.
22
+ */
23
+ export declare function matchProcess(command: string, customs?: CustomAgent[]): {
24
+ kind: AiKind;
25
+ custom?: CustomAgent;
26
+ } | null;
27
+ export declare function classifyProcess(command: string, customs?: CustomAgent[]): AiKind | null;
28
+ export declare function findAgentInPane(rows: ProcRow[], panePid: number, customs?: CustomAgent[]): {
12
29
  pid: number;
13
30
  kind: AiKind;
31
+ custom?: CustomAgent;
14
32
  } | null;
15
33
  export interface ProcessTableDeps {
16
34
  run?: () => Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"ai-session-detector.d.ts","sourceRoot":"","sources":["../src/ai-session-detector.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EAAE,MAAM,EAAE,CAAC;AAEvB,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,EAAE,CAQ7D;AAKD,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,CAmBzE;AAYD,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK9D;AAID,wBAAgB,eAAe,CAC7B,IAAI,EAAE,OAAO,EAAE,EACf,OAAO,EAAE,MAAM,GACd;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAMtC;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED,wBAAsB,gBAAgB,CAAC,IAAI,GAAE,gBAAqB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAOtF"}
1
+ {"version":3,"file":"ai-session-detector.d.ts","sourceRoot":"","sources":["../src/ai-session-detector.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEpE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AAEpC,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,EAAE,CAQ7D;AAKD,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,CAmBzE;AAoBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,WAAW,EAAO,GAC1B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,GAAG,IAAI,CAQ/C;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,WAAW,EAAO,GAAG,MAAM,GAAG,IAAI,CAG3F;AAID,wBAAgB,eAAe,CAC7B,IAAI,EAAE,OAAO,EAAE,EACf,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,WAAW,EAAO,GAC1B;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,GAAG,IAAI,CAY5D;AAED,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED,wBAAsB,gBAAgB,CAAC,IAAI,GAAE,gBAAqB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAOtF"}
@@ -2,10 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseProcessTable = parseProcessTable;
4
4
  exports.descendantsOf = descendantsOf;
5
+ exports.matchProcess = matchProcess;
5
6
  exports.classifyProcess = classifyProcess;
6
7
  exports.findAgentInPane = findAgentInPane;
7
8
  exports.readProcessTable = readProcessTable;
8
9
  const child_process_1 = require("child_process");
10
+ const dialout_shared_1 = require("@indianic/dialout-shared");
9
11
  const PS_ROW_RE = /^\s*(\d+)\s+(\d+)\s+(\S.*)$/;
10
12
  function parseProcessTable(psOutput) {
11
13
  const rows = [];
@@ -51,21 +53,56 @@ const KIND_RULES = [
51
53
  // Grok installs to ~/.grok/bin/grok, so the install-layout half is anchored
52
54
  // on that directory rather than a package manager's.
53
55
  { kind: 'grok', re: /(^|\/)grok(\s|$)|\/\.grok\/bin\// },
56
+ // Augment ships a compiled binary called `agy` (and `auggie` before the
57
+ // rename) into whichever bin directory the installer picks — ~/.local/bin on
58
+ // the machine this was measured on, which is far too generic to anchor on.
59
+ // So this rule has only the name half, and leans on the same path-segment
60
+ // boundary as the others: `agy` and `/usr/local/bin/agy` match, while
61
+ // `vim agy` does not, because the boundary requires start-of-string or a
62
+ // slash and a bare space is neither.
63
+ { kind: 'augment', re: /(^|\/)(agy|auggie)(\s|$)/ },
54
64
  ];
55
- function classifyProcess(command) {
65
+ /**
66
+ * Which agent a command line is, including the ones this machine's owner
67
+ * declared by hand.
68
+ *
69
+ * Built-in rules are tried FIRST and a custom entry can never override one. A
70
+ * declaration is a way to recognise something we would otherwise miss, not a
71
+ * way to re-label a CLI we already read correctly — and the failure mode of
72
+ * the other order is ugly: one careless entry named `claude` would reroute
73
+ * every real Claude session on the machine to another parser.
74
+ *
75
+ * The custom agent itself comes back alongside the kind, because the caller
76
+ * needs its transcript template to find the conversation.
77
+ */
78
+ function matchProcess(command, customs = []) {
56
79
  for (const rule of KIND_RULES) {
57
80
  if (rule.re.test(command))
58
- return rule.kind;
81
+ return { kind: rule.kind };
82
+ }
83
+ for (const custom of customs) {
84
+ if ((0, dialout_shared_1.customAgentRule)(custom).test(command))
85
+ return { kind: custom.kind, custom };
59
86
  }
60
87
  return null;
61
88
  }
89
+ function classifyProcess(command, customs = []) {
90
+ const match = matchProcess(command, customs);
91
+ return match ? match.kind : null;
92
+ }
62
93
  // Shallowest match wins: the agent CLI is a direct child of the pane shell,
63
94
  // while its MCP servers and subprocesses sit deeper and may share its name.
64
- function findAgentInPane(rows, panePid) {
95
+ function findAgentInPane(rows, panePid, customs = []) {
65
96
  for (const proc of descendantsOf(rows, panePid)) {
66
- const kind = classifyProcess(proc.command);
67
- if (kind)
68
- return { pid: proc.pid, kind };
97
+ const match = matchProcess(proc.command, customs);
98
+ if (!match)
99
+ continue;
100
+ // `custom` is omitted rather than set to undefined when a built-in rule
101
+ // matched, so the result for the three original vendors is byte-identical
102
+ // to what callers have always received.
103
+ return match.custom
104
+ ? { pid: proc.pid, kind: match.kind, custom: match.custom }
105
+ : { pid: proc.pid, kind: match.kind };
69
106
  }
70
107
  return null;
71
108
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ai-session-detector.js","sourceRoot":"","sources":["../src/ai-session-detector.ts"],"names":[],"mappings":";;AAoBA,8CAQC;AAKD,sCAmBC;AAYD,0CAKC;AAID,0CASC;AAMD,4CAOC;AA/FD,iDAAyC;AAkBzC,MAAM,SAAS,GAAG,6BAA6B,CAAC;AAEhD,SAAgB,iBAAiB,CAAC,QAAgB;IAChD,MAAM,IAAI,GAAc,EAAE,CAAC;IAC3B,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAChC,IAAI,CAAC,CAAC;YAAE,SAAS;QACjB,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAClF,CAAC;IACD,OAAO,IA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E;IAChE,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE;QAC7D,oDAAoD;QACpD,IAAA,wBAAQ,EAAC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,qBAAqB,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,EACvF,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC,CAAC;IACJ,OAAO,iBAAiB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AACxC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { AiKind, ProcRow } from './ai-session-detector';
1
+ import { AiKind, CustomAgent, ProcRow } from './ai-session-detector';
2
2
  import { LaunchedRecord } from './ai-launch';
3
3
  import { AiEvent, AiStatus } from './ai-adapters';
4
4
  import type { AiUsage } from './ai-adapters/types';
@@ -10,7 +10,9 @@ export interface DiscoverDeps {
10
10
  listSessions?: () => Promise<any[]>;
11
11
  panePid?: (tmuxName: string) => number;
12
12
  processTable?: () => Promise<ProcRow[]>;
13
- locate?: (pid: number, kind: AiKind, exclude: Set<string>) => string | null;
13
+ locate?: (pid: number, kind: AiKind, exclude: Set<string>, custom?: CustomAgent) => string | null;
14
+ /** Agents this machine's owner declared by hand; never server-supplied. */
15
+ customAgents?: () => CustomAgent[];
14
16
  procStartMs?: (pid: number) => number;
15
17
  profileOf?: (pid: number) => string;
16
18
  capturePane?: (tmuxName: string) => Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"ai-sessions.d.ts","sourceRoot":"","sources":["../src/ai-sessions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAoD,OAAO,EAAE,MAAM,uBAAuB,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