@phnx-labs/agents-cli 1.23.34 → 1.23.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -1
- package/dist/commands/config.js +9 -7
- package/dist/commands/feed-watch.js +2 -1
- package/dist/commands/lead.js +65 -13
- package/dist/commands/projects.js +34 -2
- package/dist/lib/config-keys.d.ts +1 -1
- package/dist/lib/config-keys.js +6 -4
- package/dist/lib/device-config.js +9 -0
- package/dist/lib/github/project-prs.d.ts +7 -0
- package/dist/lib/github/project-prs.js +22 -0
- package/dist/lib/lead/act.d.ts +10 -0
- package/dist/lib/lead/act.js +119 -0
- package/dist/lib/lead/brief.d.ts +2 -0
- package/dist/lib/lead/brief.js +16 -5
- package/dist/lib/lead/client.d.ts +0 -3
- package/dist/lib/lead/client.js +1 -50
- package/dist/lib/lead/confirm.d.ts +12 -10
- package/dist/lib/lead/confirm.js +1 -0
- package/dist/lib/lead/events.d.ts +4 -2
- package/dist/lib/lead/events.js +5 -3
- package/dist/lib/lead/harness.d.ts +2 -3
- package/dist/lib/lead/harness.js +4 -4
- package/dist/lib/lead/host.d.ts +15 -8
- package/dist/lib/lead/host.js +63 -35
- package/dist/lib/lead/roster.d.ts +18 -0
- package/dist/lib/lead/roster.js +75 -0
- package/dist/lib/lead/shapes.d.ts +42 -0
- package/dist/lib/lead/shapes.js +202 -1
- package/dist/lib/lead/speak.d.ts +35 -0
- package/dist/lib/lead/speak.js +165 -0
- package/dist/lib/lead/store.d.ts +1 -0
- package/dist/lib/lead/tools.d.ts +11 -0
- package/dist/lib/lead/tools.js +98 -37
- package/dist/lib/lead/visibility.d.ts +1 -1
- package/dist/lib/lead/visibility.js +14 -4
- package/dist/lib/session/db.d.ts +1 -1
- package/dist/lib/session/db.js +10 -5
- package/dist/lib/session/session-cache.d.ts +1 -1
- package/dist/lib/session/session-cache.js +10 -8
- package/dist/lib/session/touched.js +1 -0
- package/package.json +2 -2
package/dist/lib/lead/tools.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { execFile } from 'node:child_process';
|
|
2
|
-
import { getCliLaunch } from '../cli-entry.js';
|
|
3
1
|
import { loadProjectDef } from '../projects.js';
|
|
4
2
|
import { atomicWriteFileSync } from '../fs-atomic.js';
|
|
5
3
|
import { connectHost, sendRequest } from './client.js';
|
|
6
|
-
import {
|
|
4
|
+
import { runAgents, runLinear } from './act.js';
|
|
5
|
+
import { LeadToolError, answerArgv, appendNote, assertAgent, assertPrNumber, assertRepo, assertSessionId, assertTask, assertTicketId, dispatchPrompt, linearCreateArgv, linearPickupArgv, linearTasksArgv, linearViewArgv, prArgv, prFailureArgv, prReadArgv, prsListArgv, runArgv, sendArgv, } from './shapes.js';
|
|
7
6
|
import { ensureLeadDir } from './paths.js';
|
|
8
7
|
import { readMemory } from './store.js';
|
|
9
8
|
export * from './shapes.js';
|
|
10
|
-
const LINEAR_TIMEOUT_MS = 20_000;
|
|
11
9
|
export function leadToolContext(env = process.env) {
|
|
12
10
|
const project = env.AGENTS_LEAD_PROJECT;
|
|
13
11
|
if (!project)
|
|
@@ -17,16 +15,6 @@ export function leadToolContext(env = process.env) {
|
|
|
17
15
|
throw new LeadToolError(`Unknown project '${project}'.`);
|
|
18
16
|
return { project, def, paths: ensureLeadDir(project) };
|
|
19
17
|
}
|
|
20
|
-
function runLinear(args) {
|
|
21
|
-
return new Promise((resolve, reject) => {
|
|
22
|
-
execFile('linear', args, { timeout: LINEAR_TIMEOUT_MS, maxBuffer: 8 * 1024 * 1024 }, (err, stdout, stderr) => {
|
|
23
|
-
if (err)
|
|
24
|
-
reject(new LeadToolError(`linear ${args[0]} failed: ${String(stderr || err.message).trim().split('\n').pop()}`));
|
|
25
|
-
else
|
|
26
|
-
resolve(stdout);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
18
|
async function hostRequest(project, req) {
|
|
31
19
|
const socket = await connectHost(project);
|
|
32
20
|
if (!socket)
|
|
@@ -39,50 +27,123 @@ async function hostRequest(project, req) {
|
|
|
39
27
|
throw new LeadToolError(String(reply.message));
|
|
40
28
|
return reply;
|
|
41
29
|
}
|
|
42
|
-
async function
|
|
43
|
-
const reply = await hostRequest(ctx.project, { op: '
|
|
44
|
-
return String(reply.
|
|
30
|
+
async function hold(ctx, held) {
|
|
31
|
+
const reply = await hostRequest(ctx.project, { op: 'hold', held });
|
|
32
|
+
return `Queued for the owner's Confirm: ${String(reply.label)}. Nothing has happened yet. Say what you queued and ask once; do not queue it again.`;
|
|
45
33
|
}
|
|
46
34
|
export async function toolRoster(ctx, project) {
|
|
47
35
|
const reply = await hostRequest(ctx.project, { op: 'roster', project: project ?? ctx.project });
|
|
48
36
|
return String(reply.text);
|
|
49
37
|
}
|
|
38
|
+
export async function toolAttention(ctx) {
|
|
39
|
+
const reply = await hostRequest(ctx.project, { op: 'attention' });
|
|
40
|
+
return String(reply.text);
|
|
41
|
+
}
|
|
50
42
|
export async function toolDispatch(ctx, ticket, agent) {
|
|
51
43
|
assertTicketId(ticket);
|
|
52
44
|
assertAgent(agent);
|
|
53
45
|
const issue = JSON.parse(await runLinear(linearViewArgv(ticket)));
|
|
54
46
|
const prompt = dispatchPrompt(issue.identifier, issue.title);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
return hold(ctx, {
|
|
48
|
+
action: 'dispatch',
|
|
49
|
+
argv: runArgv(agent, prompt, ctx.project),
|
|
50
|
+
linearArgv: linearPickupArgv(issue.identifier, agent),
|
|
51
|
+
label: `Dispatch ${agent} on ${issue.identifier}: ${issue.title}`,
|
|
52
|
+
detail: prompt,
|
|
53
|
+
});
|
|
59
54
|
}
|
|
60
55
|
export async function toolStart(ctx, agent, task) {
|
|
61
|
-
runArgv(agent, task, ctx.project);
|
|
62
|
-
|
|
63
|
-
return `Started ${agent} on: ${assertTask(task).slice(0, 120)}. Log: ${log}`;
|
|
56
|
+
const argv = runArgv(agent, task, ctx.project);
|
|
57
|
+
return hold(ctx, { action: 'start', argv, label: `Start ${agent} on: ${argv[2].slice(0, 80)}`, detail: argv[2] });
|
|
64
58
|
}
|
|
65
59
|
export async function toolSend(ctx, session, text) {
|
|
66
60
|
assertSessionId(session);
|
|
67
|
-
|
|
61
|
+
const argv = sendArgv(session, text);
|
|
68
62
|
const reply = await hostRequest(ctx.project, { op: 'resolve', session });
|
|
69
63
|
const id = String(reply.id);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
64
|
+
return hold(ctx, { action: 'send', argv: sendArgv(id, text), sessionId: id, label: `Send to “${String(reply.title)}”`, detail: argv[6] });
|
|
65
|
+
}
|
|
66
|
+
export async function toolAnswer(ctx, key, value) {
|
|
67
|
+
const argv = answerArgv(key, value);
|
|
68
|
+
const reply = await hostRequest(ctx.project, { op: 'attention-item', key });
|
|
69
|
+
const ask = reply.ask;
|
|
70
|
+
let detail;
|
|
71
|
+
if ('choice' in value) {
|
|
72
|
+
const choice = ask.choices.find((c) => c.id === value.choice);
|
|
73
|
+
if (!choice) {
|
|
74
|
+
const known = ask.choices.map((c) => `${c.id}=${c.label}`).join(', ');
|
|
75
|
+
throw new LeadToolError(`'${value.choice}' is not a choice of this ask (${known || 'it takes a free-text answer'}).`);
|
|
76
|
+
}
|
|
77
|
+
detail = choice.label;
|
|
78
|
+
}
|
|
79
|
+
else
|
|
80
|
+
detail = argv[4];
|
|
81
|
+
return hold(ctx, { action: 'answer', argv, sessionId: ask.sessionId, label: `Answer “${String(reply.title)}”`, detail });
|
|
81
82
|
}
|
|
82
83
|
export async function toolStop(ctx, session) {
|
|
83
84
|
assertSessionId(session);
|
|
84
85
|
const reply = await hostRequest(ctx.project, { op: 'hold-stop', session });
|
|
85
|
-
return `
|
|
86
|
+
return `Queued for the owner's Confirm: ${String(reply.label)}. Nothing was stopped. Do not retry.`;
|
|
87
|
+
}
|
|
88
|
+
export async function toolPrsList(ctx, repo) {
|
|
89
|
+
const envelope = JSON.parse(await runAgents(prsListArgv(ctx.project, repo)));
|
|
90
|
+
const lines = [];
|
|
91
|
+
for (const r of envelope.repositories) {
|
|
92
|
+
if (r.error) {
|
|
93
|
+
lines.push(`${r.slug}: could not be read (${r.error})`);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
for (const pr of r.pullRequests)
|
|
97
|
+
lines.push(`${r.slug}#${pr.number}${pr.isDraft ? ' [draft]' : ''} ${pr.title}`);
|
|
98
|
+
}
|
|
99
|
+
return lines.length ? lines.join('\n') : `No open PRs for ${ctx.project}.`;
|
|
100
|
+
}
|
|
101
|
+
async function readPr(ctx, repo, number) {
|
|
102
|
+
const envelope = JSON.parse(await runAgents(prReadArgv(ctx.project, repo, number)));
|
|
103
|
+
const pr = envelope.repositories.flatMap((r) => r.pullRequests).find((p) => p.number === number);
|
|
104
|
+
if (!pr)
|
|
105
|
+
throw new LeadToolError(`${repo}#${number} is not an open PR of ${ctx.project}.`);
|
|
106
|
+
return pr;
|
|
107
|
+
}
|
|
108
|
+
async function failingRunIds(ctx, repo, sha) {
|
|
109
|
+
const report = JSON.parse(await runAgents(prFailureArgv(ctx.project, repo, sha)));
|
|
110
|
+
if (report.error)
|
|
111
|
+
throw new LeadToolError(`Could not read the failing checks: ${report.error}`);
|
|
112
|
+
return [...new Set(report.checks.flatMap((c) => (c.runId === null ? [] : [c.runId])))];
|
|
113
|
+
}
|
|
114
|
+
const PR_LABEL = { merge: 'Merge', comment: 'Comment on', ready: 'Mark ready', rerun: 'Re-run failed CI of', close: 'Close' };
|
|
115
|
+
export async function toolPrAct(ctx, verb, opts) {
|
|
116
|
+
const repo = assertRepo(opts.repo);
|
|
117
|
+
const number = assertPrNumber(opts.number);
|
|
118
|
+
if (opts.body !== undefined && verb !== 'comment')
|
|
119
|
+
throw new LeadToolError('--body applies only to prs comment.');
|
|
120
|
+
if (opts.runId !== undefined && verb !== 'rerun')
|
|
121
|
+
throw new LeadToolError('--run-id applies only to prs rerun.');
|
|
122
|
+
if (verb === 'comment')
|
|
123
|
+
assertTask(opts.body ?? '');
|
|
124
|
+
const pr = await readPr(ctx, repo, number);
|
|
125
|
+
const sha = opts.sha ?? (verb === 'merge' || verb === 'rerun' ? pr.headSha : undefined);
|
|
126
|
+
if ((verb === 'merge' || verb === 'rerun') && !sha)
|
|
127
|
+
throw new LeadToolError(`${repo}#${number} has no head commit to pin; pass --sha.`);
|
|
128
|
+
let runId;
|
|
129
|
+
if (verb === 'rerun') {
|
|
130
|
+
const runs = await failingRunIds(ctx, repo, sha);
|
|
131
|
+
runId = opts.runId !== undefined ? assertPrNumber(opts.runId) : runs.length === 1 ? runs[0] : undefined;
|
|
132
|
+
if (runId === undefined) {
|
|
133
|
+
throw new LeadToolError(runs.length === 0
|
|
134
|
+
? `${repo}#${number} has no failing GitHub Actions run at ${sha.slice(0, 7)}.`
|
|
135
|
+
: `${repo}#${number} has ${runs.length} failing runs (${runs.join(', ')}); pass --run-id <id>.`);
|
|
136
|
+
}
|
|
137
|
+
if (!runs.includes(runId))
|
|
138
|
+
throw new LeadToolError(`Run ${runId} is not a failing run of ${repo}#${number}.`);
|
|
139
|
+
}
|
|
140
|
+
const argv = prArgv(ctx.project, verb, { repo, number, sha: verb === 'rerun' ? undefined : sha, body: opts.body, runId });
|
|
141
|
+
return hold(ctx, {
|
|
142
|
+
action: 'pr',
|
|
143
|
+
argv,
|
|
144
|
+
label: `${PR_LABEL[verb]} ${repo}#${number} “${pr.title}”`,
|
|
145
|
+
detail: verb === 'comment' ? argv[argv.indexOf('--body') + 1] : pr.title,
|
|
146
|
+
});
|
|
86
147
|
}
|
|
87
148
|
export async function toolLinearTasks(ctx, status, limit) {
|
|
88
149
|
const raw = JSON.parse(await runLinear(linearTasksArgv(ctx.def, status, limit)));
|
|
@@ -13,4 +13,4 @@ export declare function hideLeadInSessionEnvelope<E extends {
|
|
|
13
13
|
}>(event: E, hostSessionIds: ReadonlySet<string>): E;
|
|
14
14
|
export declare function hideLeadInFeedEnvelope<E extends {
|
|
15
15
|
type: string;
|
|
16
|
-
}>(event: E, hostSessionIds: ReadonlySet<string>): E;
|
|
16
|
+
}>(event: E, hostSessionIds: ReadonlySet<string>, hidden?: Set<string>): E;
|
|
@@ -57,21 +57,31 @@ export function hideLeadInSessionEnvelope(event, hostSessionIds) {
|
|
|
57
57
|
}
|
|
58
58
|
return event;
|
|
59
59
|
}
|
|
60
|
-
export function hideLeadInFeedEnvelope(event, hostSessionIds) {
|
|
60
|
+
export function hideLeadInFeedEnvelope(event, hostSessionIds, hidden = new Set()) {
|
|
61
61
|
const e = event;
|
|
62
|
+
const isHiddenAsk = (a) => !!a.sessionId && (hidden.has(a.sessionId) || hostSessionIds.has(a.sessionId));
|
|
62
63
|
if (e.type === 'reset') {
|
|
63
64
|
const agents = e.agents ?? [];
|
|
64
65
|
const attention = e.attention ?? [];
|
|
65
|
-
|
|
66
|
+
for (const a of agents)
|
|
67
|
+
if (a.sessionId && isLeadSession(a, hostSessionIds))
|
|
68
|
+
hidden.add(a.sessionId);
|
|
66
69
|
return {
|
|
67
70
|
...event,
|
|
68
71
|
agents: agents.filter((a) => !isLeadSession(a, hostSessionIds)),
|
|
69
|
-
attention: attention.filter((a) => !
|
|
72
|
+
attention: attention.filter((a) => !isHiddenAsk(a)),
|
|
70
73
|
};
|
|
71
74
|
}
|
|
72
75
|
if (e.type === 'agent.upsert' && isLeadSession(e.agent, hostSessionIds)) {
|
|
73
|
-
const { agent
|
|
76
|
+
const { agent, ...rest } = e;
|
|
77
|
+
const id = agent.sessionId;
|
|
78
|
+
if (id)
|
|
79
|
+
hidden.add(id);
|
|
74
80
|
return { ...rest, type: 'agent.remove' };
|
|
75
81
|
}
|
|
82
|
+
if (e.type === 'attention.upsert' && isHiddenAsk((e.attention ?? {}))) {
|
|
83
|
+
const { attention: _attention, ...rest } = e;
|
|
84
|
+
return { ...rest, type: 'attention.remove' };
|
|
85
|
+
}
|
|
76
86
|
return event;
|
|
77
87
|
}
|
package/dist/lib/session/db.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { TouchedPr, TouchedTicket } from './touched.js';
|
|
|
5
5
|
import { type IndexedToolCall } from '@phnx-labs/sessions-cli/reader';
|
|
6
6
|
import { type ToolScanResumePoint } from './tool-store.js';
|
|
7
7
|
import { type TimelineState } from '@phnx-labs/sessions-cli/reader';
|
|
8
|
-
export declare const SCHEMA_VERSION =
|
|
8
|
+
export declare const SCHEMA_VERSION = 54;
|
|
9
9
|
export declare const CONTENT_INDEX_VERSION = 8;
|
|
10
10
|
export declare const INSIGHTS_EXTRACTOR_VERSION = 7;
|
|
11
11
|
export declare const SESSION_SUMMARY_EXTRACTOR_VERSION = 1;
|
package/dist/lib/session/db.js
CHANGED
|
@@ -18,7 +18,7 @@ import { firstUserMessageFromEvents, lastUserMessageFromEvents } from '@phnx-lab
|
|
|
18
18
|
import { emptyTimelineState, TIMELINE_EXTRACTOR_VERSION } from '@phnx-labs/sessions-cli/reader';
|
|
19
19
|
const SESSIONS_DIR = getSessionsDir();
|
|
20
20
|
const DB_PATH = getSessionsDbPath();
|
|
21
|
-
export const SCHEMA_VERSION =
|
|
21
|
+
export const SCHEMA_VERSION = 54;
|
|
22
22
|
export const CONTENT_INDEX_VERSION = 8;
|
|
23
23
|
const RESOURCE_INDEX_VERSION = 2;
|
|
24
24
|
function canonicalLedgerKey(filePath) {
|
|
@@ -1036,11 +1036,16 @@ function migrateSchema(db, fromVersion) {
|
|
|
1036
1036
|
const cols = db.prepare(`PRAGMA table_info(sessions)`).all();
|
|
1037
1037
|
if (!cols.some(c => c.name === 'pr_urls'))
|
|
1038
1038
|
db.exec(`ALTER TABLE sessions ADD COLUMN pr_urls TEXT`);
|
|
1039
|
-
const withPr = db.prepare(`SELECT file_path FROM sessions WHERE pr_url IS NOT NULL AND file_path IS NOT NULL`).all();
|
|
1040
|
-
const dropLedger = db.prepare(`DELETE FROM scan_ledger WHERE file_path = ?`);
|
|
1041
|
-
for (const { file_path } of withPr)
|
|
1042
|
-
dropLedger.run(canonicalLedgerKey(file_path));
|
|
1043
1039
|
}
|
|
1040
|
+
if (fromVersion < 54)
|
|
1041
|
+
reparseSessionsWithPr(db);
|
|
1042
|
+
}
|
|
1043
|
+
function reparseSessionsWithPr(db) {
|
|
1044
|
+
const withPr = db.prepare(`SELECT file_path FROM sessions WHERE pr_url IS NOT NULL AND file_path IS NOT NULL AND mirror_synced_at IS NULL`).all();
|
|
1045
|
+
const dropLedger = db.prepare(`DELETE FROM scan_ledger WHERE file_path = ?`);
|
|
1046
|
+
for (const { file_path } of withPr)
|
|
1047
|
+
dropLedger.run(canonicalLedgerKey(file_path));
|
|
1048
|
+
db.exec(`UPDATE sessions SET pr_url = NULL, pr_urls = NULL, pr_number = NULL WHERE mirror_synced_at IS NOT NULL AND pr_url IS NOT NULL`);
|
|
1044
1049
|
}
|
|
1045
1050
|
function backfillClaudeAccounts(db, scope = 'all') {
|
|
1046
1051
|
const where = scope === 'all'
|
|
@@ -67,7 +67,7 @@ export declare function stripLiveStatusKeys<T extends Record<string, unknown>>(f
|
|
|
67
67
|
export declare function assertNoLiveStatusFields(fields: Record<string, unknown>): boolean;
|
|
68
68
|
export declare function updateImmutableMemos(sessions: ReadonlyArray<ActiveSession>, nowMs?: number): void;
|
|
69
69
|
export declare function resolveStreamSummaryState(current: import('@phnx-labs/sessions-cli/reader').SummaryState | undefined, nowMs?: number): import('@phnx-labs/sessions-cli/reader').SummaryState;
|
|
70
|
-
export declare function
|
|
70
|
+
export declare function withProducedArtifacts(s: ActiveSession): ActiveSession;
|
|
71
71
|
export declare function mergeSessionTimeline(s: ActiveSession): ActiveSession;
|
|
72
72
|
export declare function applyImmutableMemo(s: ActiveSession): ActiveSession;
|
|
73
73
|
interface LoadLocalActiveSessionsOptions {
|
|
@@ -4,7 +4,7 @@ import * as path from 'path';
|
|
|
4
4
|
import { createMemoryCache } from '../memory-cache.js';
|
|
5
5
|
import { getCacheDir } from '../state.js';
|
|
6
6
|
import { artifactKind, backfillActiveRowsFromIndex, foldRecap, sessionProcessIsLocal } from './active.js';
|
|
7
|
-
import { extractArtifacts, mergeArtifacts } from '@phnx-labs/sessions-cli/reader';
|
|
7
|
+
import { extractArtifacts, mergeArtifacts, reviewedArtifacts } from '@phnx-labs/sessions-cli/reader';
|
|
8
8
|
import { enrichGlanceFiles } from './glance-files.js';
|
|
9
9
|
import { enrichLiveWork } from './pending-work.js';
|
|
10
10
|
import { readSessionSummaryAny, readSessionTimelineAny } from './db.js';
|
|
@@ -72,6 +72,7 @@ export const LIVE_STATUS_KEYS = [
|
|
|
72
72
|
'rateLimited',
|
|
73
73
|
'plan',
|
|
74
74
|
];
|
|
75
|
+
const IMMUTABLE_MEMO_VERSION = 2;
|
|
75
76
|
export const ACTIVE_SESSIONS_READER_IDLE_WINDOW_MS = 45_000;
|
|
76
77
|
let snapshotPathOverride = null;
|
|
77
78
|
let immutablePathOverride = null;
|
|
@@ -238,13 +239,13 @@ export function transcriptMtimeMs(s) {
|
|
|
238
239
|
function readImmutableFile() {
|
|
239
240
|
try {
|
|
240
241
|
const parsed = JSON.parse(fs.readFileSync(immutablePath(), 'utf-8'));
|
|
241
|
-
if (parsed && parsed.version ===
|
|
242
|
+
if (parsed && parsed.version === IMMUTABLE_MEMO_VERSION && parsed.entries && typeof parsed.entries === 'object') {
|
|
242
243
|
return parsed;
|
|
243
244
|
}
|
|
244
245
|
}
|
|
245
246
|
catch {
|
|
246
247
|
}
|
|
247
|
-
return { version:
|
|
248
|
+
return { version: IMMUTABLE_MEMO_VERSION, entries: {} };
|
|
248
249
|
}
|
|
249
250
|
export function readImmutableMemo(sessionId, mtimeMs) {
|
|
250
251
|
if (!sessionId || !Number.isFinite(mtimeMs))
|
|
@@ -326,11 +327,12 @@ export function resolveStreamSummaryState(current, nowMs = Date.now()) {
|
|
|
326
327
|
return current;
|
|
327
328
|
return isSummarizerReady(nowMs) ? 'pending' : 'skipped';
|
|
328
329
|
}
|
|
329
|
-
export function
|
|
330
|
-
const
|
|
331
|
-
.filter((c) => c.op
|
|
330
|
+
export function withProducedArtifacts(s) {
|
|
331
|
+
const written = (s.files?.changes ?? [])
|
|
332
|
+
.filter((c) => c.op !== 'deleted')
|
|
332
333
|
.map((c) => ({ path: path.isAbsolute(c.path) || !s.cwd ? c.path : path.resolve(s.cwd, c.path), op: c.op }));
|
|
333
|
-
const
|
|
334
|
+
const produced = written.length > 0 ? reviewedArtifacts(extractArtifacts(written)) : [];
|
|
335
|
+
const merged = produced.length > 0 ? mergeArtifacts(produced, s.artifacts ?? []) : (s.artifacts ?? []);
|
|
334
336
|
if (merged.length > 0)
|
|
335
337
|
s.artifacts = merged.map((a) => ({ ...a, kind: artifactKind(a.path) }));
|
|
336
338
|
return s;
|
|
@@ -364,7 +366,7 @@ export function mergeSessionTimeline(s) {
|
|
|
364
366
|
return s;
|
|
365
367
|
}
|
|
366
368
|
export function applyImmutableMemo(s) {
|
|
367
|
-
return
|
|
369
|
+
return withProducedArtifacts(applyStoredFields(s));
|
|
368
370
|
}
|
|
369
371
|
function applyStoredFields(s) {
|
|
370
372
|
if (!s.sessionId)
|
|
@@ -24,6 +24,7 @@ const AGENTS_PRS_ACTIONS = {
|
|
|
24
24
|
merge: 'merged',
|
|
25
25
|
review: 'reviewed',
|
|
26
26
|
comment: 'commented',
|
|
27
|
+
close: 'closed',
|
|
27
28
|
};
|
|
28
29
|
const LINEAR_UPDATE_VALUE_FLAGS = new Set([
|
|
29
30
|
'--status', '--comment', '--proof', '--label', '--unlabel', '--priority', '--assign', '--delegate',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phnx-labs/agents-cli",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.36",
|
|
4
4
|
"description": "One CLI for all your AI coding agents - versions, config, cloud dispatch, sessions, and teams (now with first-class Grok Build CLI support)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@fontsource/jetbrains-mono": "^5.3.0",
|
|
90
90
|
"@inquirer/prompts": "8.5.2",
|
|
91
91
|
"@phnx-labs/secrets-cli": "0.4.0",
|
|
92
|
-
"@phnx-labs/sessions-cli": "0.8.
|
|
92
|
+
"@phnx-labs/sessions-cli": "0.8.10",
|
|
93
93
|
"@resvg/resvg-wasm": "^2.6.2",
|
|
94
94
|
"@types/proper-lockfile": "4.1.4",
|
|
95
95
|
"@zed-industries/agent-client-protocol": "0.4.5",
|