@celljs/ta-agents 0.0.0-stage → 4.8.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.
@@ -0,0 +1,147 @@
1
+ import { realpathSync } from 'node:fs';
2
+ import { homedir } from 'node:os';
3
+ import { join, sep } from 'node:path';
4
+ import { AcpAgent } from './acp-agent';
5
+ import type { AgentConfig } from './agent-catalog';
6
+ import type { AgentSession } from './agent-session';
7
+ import type { OpenedSession } from './agent-streamer';
8
+ import { text } from './texts';
9
+
10
+ /** The custom entry of a pi session that names the session of an agent it talks to. */
11
+ export const BINDING_ENTRY = 'ta-agents.session';
12
+
13
+ export interface Binding {
14
+ agent: string;
15
+ session: string;
16
+ }
17
+
18
+ const POOL = Symbol.for('ta-agents.pool');
19
+
20
+ /**
21
+ * The agents' processes of this process, shared by its pi sessions, which load this package each: one
22
+ * per agent and directory, since some agents run commands where they were started.
23
+ */
24
+ export namespace AgentPool {
25
+ export function of(config: AgentConfig, cwd: string): AcpAgent {
26
+ const global = globalThis as Record<symbol, Map<string, AcpAgent> | undefined>;
27
+ const pool = global[POOL] ?? create();
28
+ global[POOL] = pool;
29
+ const key = JSON.stringify([config.command, config.args, config.env ?? {}, config.clientMeta ?? {}, cwd]);
30
+ let agent = pool.get(key);
31
+ if (!agent) {
32
+ agent = new AcpAgent(config.name, { command: config.command, args: config.args, env: config.env, clientMeta: config.clientMeta, cwd });
33
+ pool.set(key, agent);
34
+ }
35
+ return agent;
36
+ }
37
+
38
+ function create(): Map<string, AcpAgent> {
39
+ const pool = new Map<string, AcpAgent>();
40
+ process.once('exit', () => {
41
+ for (const agent of pool.values()) {
42
+ agent.stop();
43
+ }
44
+ });
45
+ return pool;
46
+ }
47
+ }
48
+
49
+ /**
50
+ * The sessions of agents one pi session talks to, one per agent. Which session that is stays in the
51
+ * pi session (a custom entry on its branch), so that reopening the conversation loads the agent's
52
+ * session again; a fork, or going back in the conversation, starts a new one.
53
+ */
54
+ export class AgentBindings {
55
+ cwd = process.cwd();
56
+
57
+ protected readonly ids = new Map<string, string>();
58
+ protected readonly opened = new Map<string, Promise<OpenedSession>>();
59
+
60
+ constructor(
61
+ protected readonly save: (binding: Binding) => void,
62
+ protected readonly prepare: (config: AgentConfig, session: AgentSession) => void,
63
+ protected readonly agentOf: (config: AgentConfig, cwd: string) => AcpAgent = AgentPool.of,
64
+ ) {}
65
+
66
+ restore(entries: readonly unknown[], fork: boolean): void {
67
+ this.ids.clear();
68
+ this.opened.clear();
69
+ if (fork) {
70
+ return;
71
+ }
72
+ for (const entry of entries) {
73
+ const { type, customType, data } = (entry ?? {}) as { type?: string; customType?: string; data?: Partial<Binding> };
74
+ if (type === 'custom' && customType === BINDING_ENTRY && typeof data?.agent === 'string' && typeof data.session === 'string') {
75
+ this.ids.set(data.agent, data.session);
76
+ }
77
+ }
78
+ }
79
+
80
+ /**
81
+ * The conversation went back (pi's tree): the agents' sessions remember what came after, so the next
82
+ * prompt starts new ones, with the conversation up to here.
83
+ */
84
+ forget(): void {
85
+ this.ids.clear();
86
+ this.opened.clear();
87
+ }
88
+
89
+ sessionId(agent: string): string | undefined {
90
+ return this.ids.get(agent);
91
+ }
92
+
93
+ open(config: AgentConfig, signal?: AbortSignal): Promise<OpenedSession> {
94
+ const agent = this.agentOf(config, this.cwd);
95
+ let opened = this.opened.get(config.id);
96
+ if (opened) {
97
+ // The program may have stopped since, idle, and its sessions with it.
98
+ // It starts empty only the first time.
99
+ opened = opened.then(value =>
100
+ agent.running && agent.sessions.get(value.session.id) === value.session ? { ...value, fresh: false } : this.connect(config, agent, signal),
101
+ );
102
+ } else {
103
+ opened = this.connect(config, agent, signal);
104
+ }
105
+ opened.catch(() => this.opened.delete(config.id));
106
+ this.opened.set(config.id, opened);
107
+ return opened;
108
+ }
109
+
110
+ close(): void {
111
+ this.opened.clear();
112
+ }
113
+
114
+ protected async connect(config: AgentConfig, agent: AcpAgent, signal?: AbortSignal): Promise<OpenedSession> {
115
+ if (AgentBindings.isRemote(this.cwd)) {
116
+ throw new Error(text('remote', config.name));
117
+ }
118
+ const known = this.ids.get(config.id);
119
+ let session = known ? await agent.loadSession(known, this.cwd, signal) : undefined;
120
+ const fresh = !session;
121
+ if (!session) {
122
+ session = await agent.newSession(this.cwd, signal);
123
+ for (const [option, value] of Object.entries(config.options ?? {})) {
124
+ await session.select(option, value, signal).catch(() => undefined);
125
+ }
126
+ this.ids.set(config.id, session.id);
127
+ this.save({ agent: config.id, session: session.id });
128
+ }
129
+ this.prepare(config, session);
130
+ return { session, fresh, images: !!agent.initialized?.agentCapabilities?.promptCapabilities?.image, dirs: AgentBindings.dirs(this.cwd) };
131
+ }
132
+
133
+ static dirs(cwd: string): string[] {
134
+ try {
135
+ const real = realpathSync(cwd);
136
+ return real === cwd ? [cwd] : [cwd, real];
137
+ } catch {
138
+ return [cwd];
139
+ }
140
+ }
141
+
142
+ /** Ta works in a remote directory (`ssh://`) through a directory of its own for pi: `<agent directory>/remote`. */
143
+ static isRemote(cwd: string): boolean {
144
+ const agentDir = process.env.TA_CODING_AGENT_DIR ?? join(homedir(), '.ta', 'agent');
145
+ return cwd.startsWith(join(agentDir, 'remote') + sep);
146
+ }
147
+ }
@@ -0,0 +1,56 @@
1
+ import { describe, expect, it } from 'bun:test';
2
+ import { mkdtempSync, readFileSync } from 'node:fs';
3
+ import { tmpdir } from 'node:os';
4
+ import { join } from 'node:path';
5
+ import { AgentCatalog, ModelCache } from './agent-catalog';
6
+
7
+ describe('AgentCatalog', () => {
8
+ it('offers the built-in agents whose programs are installed', () => {
9
+ const installed = new Set(['codebuddy', 'codex']);
10
+ const agents = AgentCatalog.agents(undefined, program => (installed.has(program) ? program : undefined));
11
+ expect(agents.map(agent => [agent.id, agent.command, agent.args[0]])).toEqual([
12
+ ['codebuddy-code', 'codebuddy', '--acp'],
13
+ ['codex', 'npx', '-y'],
14
+ ]);
15
+ });
16
+
17
+ it('takes the settings: an agent turned off, one changed, and one of the user', () => {
18
+ const agents = AgentCatalog.agents(
19
+ {
20
+ 'codebuddy-code': false,
21
+ 'claude-code': { permissions: 'ask' },
22
+ gemini: { name: 'Gemini', command: 'gemini', args: ['--experimental-acp'] },
23
+ broken: { name: 'No command' },
24
+ },
25
+ () => 'found',
26
+ );
27
+ const named = AgentCatalog.agents({ codex: { env: { CODEX_PATH: 'tcodex' } } }, () => undefined);
28
+ expect(named.map(agent => [agent.id, agent.env])).toEqual([['codex', { CODEX_PATH: 'tcodex' }]]);
29
+ // The settings add to the environment and the options of a built-in agent.
30
+ const [cbc] = AgentCatalog.agents({ 'codebuddy-code': { env: { X: '1' }, options: { mode: 'default' } } }, program =>
31
+ program === 'cbc' ? program : undefined,
32
+ );
33
+ expect([cbc.env, cbc.options, cbc.clientMeta]).toEqual([
34
+ { CODEBUDDY_CODE_MODE_ENABLED: '1', X: '1' },
35
+ { mode: 'default' },
36
+ { 'codebuddy.ai': { mainAgentSupport: true, toolModeSupport: true } },
37
+ ]);
38
+ expect(agents.map(agent => [agent.id, agent.name, agent.command, agent.permissions])).toEqual([
39
+ ['claude-code', 'Claude Code', 'npx', 'ask'],
40
+ ['codex', 'Codex', 'npx', undefined],
41
+ ['gemini', 'Gemini', 'gemini', undefined],
42
+ ]);
43
+ });
44
+ });
45
+
46
+ describe('ModelCache', () => {
47
+ it('keeps the models of each agent in a file, and says when they changed', () => {
48
+ const file = join(mkdtempSync(join(tmpdir(), 'ta-agents-cache-')), 'models.json');
49
+ const cache = new ModelCache(file);
50
+ const models = { models: [{ id: 'fast', name: 'Fast' }], reasoning: true };
51
+ expect(cache.set('fake', models)).toBe(true);
52
+ expect(cache.set('fake', models)).toBe(false);
53
+ expect(new ModelCache(file).get('fake')).toEqual(models);
54
+ expect(JSON.parse(readFileSync(file, 'utf8'))).toEqual({ fake: models });
55
+ });
56
+ });
@@ -0,0 +1,176 @@
1
+ import { existsSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from 'node:fs';
2
+ import { homedir } from 'node:os';
3
+ import { delimiter, dirname, join } from 'node:path';
4
+
5
+ /** An agent to offer: pi's provider `id`, and how to start it. */
6
+ export interface AgentConfig {
7
+ id: string;
8
+ name: string;
9
+ command: string;
10
+ args: string[];
11
+ env?: Record<string, string>;
12
+ /** What signs the user in, to run in a terminal. */
13
+ login?: string;
14
+ /** `ask` shows the agent's permission requests to the user; by default they are allowed, as pi does not ask. */
15
+ permissions?: 'allow' | 'ask';
16
+ /** `_meta` of the client's capabilities in `initialize`: what the client opts in to, in the agent's own words. */
17
+ clientMeta?: Record<string, unknown>;
18
+ /** Settings of a new session, by the id or category of the agent's option (`mode`, `model`...). */
19
+ options?: Record<string, string>;
20
+ }
21
+
22
+ /** An agent of `agents` in pi's settings.json; `false` turns a built-in one off. */
23
+ export type AgentSetting = false | Partial<AgentConfig>;
24
+
25
+ interface Preset extends AgentConfig {
26
+ /** Offered when one of these programs is installed; the first found is the command when `command` is one of them. */
27
+ programs: string[];
28
+ }
29
+
30
+ /**
31
+ * The agents that come with the package. CodeBuddy Code speaks ACP itself; Claude Code and Codex
32
+ * through the adapters of the ACP project, which use the login of the user's own CLI; npx fetches them
33
+ * the first time.
34
+ */
35
+ const PRESETS: readonly Preset[] = [
36
+ {
37
+ id: 'codebuddy-code',
38
+ name: 'CodeBuddy Code',
39
+ command: 'cbc',
40
+ args: ['--acp'],
41
+ programs: ['cbc', 'codebuddy'],
42
+ login: 'cbc',
43
+ // As in its own terminal: the client takes its main-agent modes, PTC (code mode) included, which
44
+ // ACP clients that do not say so never get; full access, as pi does not ask.
45
+ env: { CODEBUDDY_CODE_MODE_ENABLED: '1' },
46
+ clientMeta: { 'codebuddy.ai': { mainAgentSupport: true, toolModeSupport: true } },
47
+ options: { mode: 'fullAccess' },
48
+ },
49
+ {
50
+ id: 'claude-code',
51
+ name: 'Claude Code',
52
+ command: 'npx',
53
+ args: ['-y', '@agentclientprotocol/claude-agent-acp@0.106.0'],
54
+ programs: ['claude'],
55
+ login: 'claude',
56
+ },
57
+ { id: 'codex', name: 'Codex', command: 'npx', args: ['-y', '@agentclientprotocol/codex-acp@2.6.0'], programs: ['codex'], login: 'codex login' },
58
+ ];
59
+
60
+ /** A model of an agent, as it listed it last. */
61
+ export interface AgentModel {
62
+ id: string;
63
+ name: string;
64
+ }
65
+
66
+ export interface AgentModels {
67
+ models: AgentModel[];
68
+ reasoning: boolean;
69
+ contextWindow?: number;
70
+ }
71
+
72
+ export namespace AgentCatalog {
73
+ /** The model that leaves the choice to the agent: what the user set up in it. */
74
+ export const DEFAULT_MODEL = 'default';
75
+
76
+ /** The built-in agents that are installed and not turned off, then those of the settings. */
77
+ export function agents(settings: Record<string, AgentSetting> | undefined, find: (program: string) => string | undefined = Programs.find): AgentConfig[] {
78
+ const configured = settings && typeof settings === 'object' ? settings : {};
79
+ const result: AgentConfig[] = [];
80
+ for (const preset of PRESETS) {
81
+ const setting = configured[preset.id];
82
+ if (setting === false) {
83
+ continue;
84
+ }
85
+ const found = preset.programs.find(program => find(program));
86
+ // Named in the settings, it is wanted: its program may be another one (`env`, `command`).
87
+ if (!found && !setting) {
88
+ continue;
89
+ }
90
+ const { programs, ...config } = preset;
91
+ const command = programs.includes(config.command) && found ? found : config.command;
92
+ const own = setting || {};
93
+ result.push({
94
+ ...config,
95
+ command,
96
+ ...own,
97
+ id: preset.id,
98
+ env: config.env || own.env ? { ...config.env, ...own.env } : undefined,
99
+ options: config.options || own.options ? { ...config.options, ...own.options } : undefined,
100
+ });
101
+ }
102
+ for (const [id, setting] of Object.entries(configured)) {
103
+ if (setting && typeof setting === 'object' && !PRESETS.some(preset => preset.id === id) && typeof setting.command === 'string') {
104
+ result.push({ name: id, args: [], ...setting, id, command: setting.command });
105
+ }
106
+ }
107
+ return result;
108
+ }
109
+ }
110
+
111
+ export namespace Programs {
112
+ /** The name of `program` if it is on the PATH; only `stat`s, nothing runs. */
113
+ export function find(program: string): string | undefined {
114
+ const extensions = process.platform === 'win32' ? (process.env.PATHEXT ?? '.EXE;.CMD;.BAT').split(';') : [''];
115
+ for (const dir of (process.env.PATH ?? '').split(delimiter)) {
116
+ for (const extension of extensions) {
117
+ if (dir && isFile(join(dir, program + extension))) {
118
+ return program;
119
+ }
120
+ }
121
+ }
122
+ return undefined;
123
+ }
124
+
125
+ function isFile(path: string): boolean {
126
+ try {
127
+ return statSync(path).isFile();
128
+ } catch {
129
+ return false;
130
+ }
131
+ }
132
+ }
133
+
134
+ /** The models each agent listed last, so that pi offers them before the agent runs again. */
135
+ export class ModelCache {
136
+ protected entries?: Record<string, AgentModels>;
137
+
138
+ constructor(readonly file = ModelCache.defaultFile()) {}
139
+
140
+ get(id: string): AgentModels | undefined {
141
+ return this.read()[id];
142
+ }
143
+
144
+ /** Keeps `models`; false when they were known. */
145
+ set(id: string, models: AgentModels): boolean {
146
+ const entries = this.read();
147
+ if (JSON.stringify(entries[id]) === JSON.stringify(models)) {
148
+ return false;
149
+ }
150
+ entries[id] = models;
151
+ try {
152
+ mkdirSync(dirname(this.file), { recursive: true });
153
+ const temp = `${this.file}.${process.pid}.tmp`;
154
+ writeFileSync(temp, JSON.stringify(entries, undefined, 2));
155
+ renameSync(temp, this.file);
156
+ } catch {
157
+ // A cache: without it the agent lists its models again next time.
158
+ }
159
+ return true;
160
+ }
161
+
162
+ protected read(): Record<string, AgentModels> {
163
+ if (!this.entries) {
164
+ try {
165
+ this.entries = existsSync(this.file) ? JSON.parse(readFileSync(this.file, 'utf8')) : {};
166
+ } catch {
167
+ this.entries = {};
168
+ }
169
+ }
170
+ return this.entries ?? {};
171
+ }
172
+
173
+ static defaultFile(): string {
174
+ return join(process.env.XDG_CACHE_HOME || join(homedir(), '.cache'), 'ta-agents', 'models.json');
175
+ }
176
+ }
@@ -0,0 +1,44 @@
1
+ import { describe, expect, it } from 'bun:test';
2
+ import { ACTIVITY_TEXT, AgentPrompt } from './agent-prompt';
3
+ import type { Message } from './pi-types';
4
+
5
+ const at = 0;
6
+ const answer = (text: string) => ({ role: 'assistant', content: [{ type: 'text', text }] }) as unknown as Message;
7
+
8
+ describe('AgentPrompt', () => {
9
+ const messages: Message[] = [
10
+ { role: 'system', content: 'pi prompt' } as Message,
11
+ { role: 'user', content: 'first', timestamp: at },
12
+ answer('ok'),
13
+ { role: 'user', content: 'second', timestamp: at },
14
+ { role: 'system', content: 'tools changed' } as Message,
15
+ {
16
+ role: 'user',
17
+ content: [
18
+ { type: 'text', text: 'third' },
19
+ { type: 'image', data: 'AA', mimeType: 'image/png' },
20
+ ],
21
+ timestamp: at,
22
+ },
23
+ { role: 'user', content: ACTIVITY_TEXT, timestamp: at },
24
+ ];
25
+
26
+ it('sends what the user said since the last answer, images when the agent takes them', () => {
27
+ const pending = AgentPrompt.pending(messages);
28
+ expect(pending.map(AgentPrompt.text)).toEqual(['second', 'third']);
29
+ expect(AgentPrompt.blocks(pending, true)).toEqual([
30
+ { type: 'text', text: 'second' },
31
+ { type: 'text', text: 'third' },
32
+ { type: 'image', data: 'AA', mimeType: 'image/png' },
33
+ ]);
34
+ expect(AgentPrompt.blocks(pending, false)[2]).toEqual({ type: 'text', text: '[An image the agent cannot take was left out]' });
35
+ expect(AgentPrompt.pending([...messages, answer('done')])).toEqual([]);
36
+ });
37
+
38
+ it('tells an agent that joins what was said before', () => {
39
+ const transcript = AgentPrompt.transcript(messages, 2);
40
+ expect(transcript).toContain('User: first\n\nAssistant: ok');
41
+ expect(transcript).not.toContain('second');
42
+ expect(AgentPrompt.transcript(messages.slice(0, 2), 1)).toBeUndefined();
43
+ });
44
+ });
@@ -0,0 +1,83 @@
1
+ import type { Acp } from './acp-protocol';
2
+ import type { Message } from './pi-types';
3
+
4
+ /** The text of the message pi adds to start a turn when the agent began one on its own; not sent to the agent. */
5
+ export const ACTIVITY_TEXT = '[The agent continued on its own]';
6
+
7
+ const TRANSCRIPT_CHARS = 30_000;
8
+
9
+ /** What of pi's transcript goes to an agent, which keeps its own history: only what the user said since it last answered. */
10
+ export namespace AgentPrompt {
11
+ /** The user messages at the end of the transcript, after the last answer or tool result. */
12
+ export function pending(messages: readonly Message[]): Message[] {
13
+ const result: Message[] = [];
14
+ for (let index = messages.length - 1; index >= 0; index--) {
15
+ const message = messages[index];
16
+ if (message.role === 'system') {
17
+ continue;
18
+ }
19
+ if (message.role !== 'user') {
20
+ break;
21
+ }
22
+ if (text(message) !== ACTIVITY_TEXT) {
23
+ result.unshift(message);
24
+ }
25
+ }
26
+ return result;
27
+ }
28
+
29
+ /** The messages as a prompt; images when the agent takes them. */
30
+ export function blocks(messages: readonly Message[], images: boolean): Acp.ContentBlock[] {
31
+ const result: Acp.ContentBlock[] = [];
32
+ for (const message of messages) {
33
+ if (message.role !== 'user') {
34
+ continue;
35
+ }
36
+ if (typeof message.content === 'string') {
37
+ result.push({ type: 'text', text: message.content });
38
+ continue;
39
+ }
40
+ for (const part of message.content) {
41
+ if (part.type === 'text') {
42
+ result.push({ type: 'text', text: part.text });
43
+ } else if (images) {
44
+ result.push({ type: 'image', data: part.data, mimeType: part.mimeType });
45
+ } else {
46
+ result.push({ type: 'text', text: '[An image the agent cannot take was left out]' });
47
+ }
48
+ }
49
+ }
50
+ return result;
51
+ }
52
+
53
+ /**
54
+ * The conversation before `pending`, for an agent that joins it: a session of its own starts empty,
55
+ * and the user may have talked with another model first. Text only, the latest part.
56
+ */
57
+ export function transcript(messages: readonly Message[], pendingCount: number): string | undefined {
58
+ const earlier = messages.filter(message => (message.role === 'user' || message.role === 'assistant') && text(message) !== ACTIVITY_TEXT);
59
+ const lines: string[] = [];
60
+ for (const message of earlier.slice(0, Math.max(0, earlier.length - pendingCount))) {
61
+ const content = text(message).trim();
62
+ if (content) {
63
+ lines.push(`${message.role === 'user' ? 'User' : 'Assistant'}: ${content}`);
64
+ }
65
+ }
66
+ if (!lines.length) {
67
+ return undefined;
68
+ }
69
+ const body = lines.join('\n\n');
70
+ const kept = body.length > TRANSCRIPT_CHARS ? `…${body.slice(-TRANSCRIPT_CHARS)}` : body;
71
+ return `<earlier_conversation>\nThe user talked with another assistant before you joined; this is what was said:\n\n${kept}\n</earlier_conversation>`;
72
+ }
73
+
74
+ export function text(message: Message): string {
75
+ if (message.role === 'user' || message.role === 'system') {
76
+ return typeof message.content === 'string' ? message.content : message.content.map(part => (part.type === 'text' ? part.text : '')).join('');
77
+ }
78
+ if (message.role === 'assistant') {
79
+ return message.content.map(part => (part.type === 'text' ? part.text : '')).join('');
80
+ }
81
+ return '';
82
+ }
83
+ }
@@ -0,0 +1,45 @@
1
+ import { describe, expect, it } from 'bun:test';
2
+ import { AgentSession } from './agent-session';
3
+
4
+ /** A host whose prompts are answered only when the test says. */
5
+ function host() {
6
+ const answers: (() => void)[] = [];
7
+ return {
8
+ answers,
9
+ request: <T>() => new Promise<T>(resolve => answers.push(() => resolve({ stopReason: 'end_turn' } as T))),
10
+ notify: () => undefined,
11
+ };
12
+ }
13
+
14
+ const phase = (value: string, request: string) => ({
15
+ sessionUpdate: 'session_info_update',
16
+ _meta: { 'x/agentPhase': { phase: value }, 'x/requestId': request },
17
+ });
18
+
19
+ describe('AgentSession', () => {
20
+ it('ends a turn when the agent goes back to idle, but not on what it still says of an earlier request', async () => {
21
+ const session = new AgentSession(host(), 's', {});
22
+ const first = session.prompt([{ type: 'text', text: '/compact' }]);
23
+ session.update(phase('model_streaming', 'a'));
24
+ session.update(phase('idle', 'a'));
25
+ expect(first.ended).toBe(true);
26
+ session.finished(first);
27
+ const second = session.prompt([{ type: 'text', text: '/cost' }]);
28
+ // The compaction goes on after it said idle.
29
+ session.update(phase('model_streaming', 'a'));
30
+ session.update(phase('idle', 'a'));
31
+ expect(second.ended).toBe(false);
32
+ session.update(phase('model_streaming', 'b'));
33
+ session.update(phase('idle', 'b'));
34
+ expect(second.ended).toBe(true);
35
+ });
36
+
37
+ it('names the session once, when the agent gives a title', () => {
38
+ const titles: string[] = [];
39
+ const session = new AgentSession(host(), 's', {});
40
+ session.callbacks = { ...session.callbacks, title: title => titles.push(title) };
41
+ session.update({ sessionUpdate: 'session_info_update', title: 'Fix the build' });
42
+ session.update({ sessionUpdate: 'session_info_update', title: 'Fix the build' });
43
+ expect(titles).toEqual(['Fix the build']);
44
+ });
45
+ });