@xenosystem/agent-interface-host 0.1.174 → 0.1.176
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/dist/index.d.ts +13 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/isolation/CommandExecution.d.ts +2 -2
- package/dist/isolation/CommandExecution.js +2 -2
- package/dist/isolation/RunIsolationService.d.ts +1 -1
- package/dist/isolation/RunIsolationService.js +1 -1
- package/dist/isolation/SandboxCapabilities.d.ts +1 -2
- package/dist/isolation/SandboxCapabilities.d.ts.map +1 -1
- package/dist/isolation/SandboxCapabilities.js +1 -2
- package/dist/isolation/SandboxCapabilities.js.map +1 -1
- package/dist/isolation/SandboxCommandExecutor.d.ts +1 -1
- package/dist/isolation/SandboxCommandExecutor.js +1 -1
- package/dist/isolation/SandboxCommandStream.d.ts +1 -1
- package/dist/isolation/SandboxCommandStream.js +1 -1
- package/dist/machine/MachineActionHttpTransport.d.ts +3 -3
- package/dist/machine/MachineActionHttpTransport.d.ts.map +1 -1
- package/dist/machine/MachineActionHttpTransport.js +2 -3
- package/dist/machine/MachineActionHttpTransport.js.map +1 -1
- package/dist/machine/machineEndpoint.js +1 -1
- package/dist/machine/machineEndpoint.js.map +1 -1
- package/dist/machine/managedUseDaemon.js +4 -4
- package/dist/node.d.ts +2 -1
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +2 -1
- package/dist/node.js.map +1 -1
- package/dist/observation/MountContentReader.d.ts +1 -1
- package/dist/observation/MountContentReader.js +1 -1
- package/dist/observation/RunObservationService.d.ts +7 -12
- package/dist/observation/RunObservationService.d.ts.map +1 -1
- package/dist/observation/RunObservationService.js +6 -11
- package/dist/observation/RunObservationService.js.map +1 -1
- package/dist/observation/XenoUseObservationSource.d.ts +2 -3
- package/dist/observation/XenoUseObservationSource.d.ts.map +1 -1
- package/dist/observation/XenoUseObservationSource.js +2 -3
- package/dist/observation/XenoUseObservationSource.js.map +1 -1
- package/dist/observation/XenoUseRunObserver.d.ts +2 -2
- package/dist/observation/XenoUseRunObserver.js +2 -2
- package/dist/transcript/sessionTranscript.d.ts +91 -0
- package/dist/transcript/sessionTranscript.d.ts.map +1 -0
- package/dist/transcript/sessionTranscript.js +227 -0
- package/dist/transcript/sessionTranscript.js.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { AgentRuntimeEventEnvelope } from '@xenosystem/agent-interface-contract';
|
|
2
|
+
/** The longest text one line carries; a longer tool output or reply is clipped, never split. */
|
|
3
|
+
export declare const TRANSCRIPT_TEXT_LIMIT = 64000;
|
|
4
|
+
/**
|
|
5
|
+
* A stable, readable folder name for a project path: `<basename>-<12 hex of the absolute path>`. The same function as
|
|
6
|
+
* the CLI's audit logs (`projectAuditKey`), so one project has one folder name across the agent's state.
|
|
7
|
+
*/
|
|
8
|
+
export declare function transcriptProjectKey(cwd: string | null | undefined): string;
|
|
9
|
+
export type SessionTranscriptLine = {
|
|
10
|
+
type: 'session';
|
|
11
|
+
id: string;
|
|
12
|
+
cwd: string | null;
|
|
13
|
+
startedAt: string;
|
|
14
|
+
agent: 'xeno';
|
|
15
|
+
} | {
|
|
16
|
+
type: 'message';
|
|
17
|
+
role: 'user' | 'assistant';
|
|
18
|
+
text: string;
|
|
19
|
+
at: string;
|
|
20
|
+
requestId: string;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'tool_call';
|
|
23
|
+
name: string;
|
|
24
|
+
input: unknown;
|
|
25
|
+
at: string;
|
|
26
|
+
requestId: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'tool_result';
|
|
29
|
+
name: string;
|
|
30
|
+
text: string;
|
|
31
|
+
at: string;
|
|
32
|
+
requestId: string;
|
|
33
|
+
} | {
|
|
34
|
+
type: 'compaction';
|
|
35
|
+
summary: string;
|
|
36
|
+
at: string;
|
|
37
|
+
compactionId: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* The lines for one ended turn, from the conversation's log. Pure, so it is tested without a host. A summarising turn
|
|
41
|
+
* (compaction) contributes nothing here: what it produced is written once, as its compaction line.
|
|
42
|
+
*/
|
|
43
|
+
export declare function transcriptLinesForTurn(log: readonly AgentRuntimeEventEnvelope[], requestId: string): SessionTranscriptLine[];
|
|
44
|
+
/** Every compaction in the conversation's own thread, as lines, in the order they were recorded. */
|
|
45
|
+
export declare function compactionLines(log: readonly AgentRuntimeEventEnvelope[]): SessionTranscriptLine[];
|
|
46
|
+
export interface SessionTranscriptWriterOptions {
|
|
47
|
+
/** The directory for a project's transcripts: `dirs.path('state', 'agents/sessions', 'transcripts', key)`. */
|
|
48
|
+
directoryFor(projectKey: string): string;
|
|
49
|
+
/** The conversation's whole log, oldest first. */
|
|
50
|
+
readLog(conversationId: string): Promise<AgentRuntimeEventEnvelope[]>;
|
|
51
|
+
/** Told after lines were appended, e.g. to run Corpus's session hook. Its failure is ignored. */
|
|
52
|
+
afterAppend?(file: string, cwd: string | null): void | Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
export declare class SessionTranscriptWriter {
|
|
55
|
+
private readonly options;
|
|
56
|
+
private readonly written;
|
|
57
|
+
private readonly queues;
|
|
58
|
+
constructor(options: SessionTranscriptWriterOptions);
|
|
59
|
+
/** Where a conversation's transcript lives. */
|
|
60
|
+
fileFor(conversationId: string, cwd: string | null | undefined): string;
|
|
61
|
+
/** Append what a turn that just ended added. Never throws. */
|
|
62
|
+
turnEnded(input: {
|
|
63
|
+
conversationId: string;
|
|
64
|
+
requestId: string;
|
|
65
|
+
cwd?: string | null;
|
|
66
|
+
subagentRunId?: string;
|
|
67
|
+
}): Promise<void>;
|
|
68
|
+
private append;
|
|
69
|
+
/** What this file already holds, read once per conversation per process, from the ids on its lines. */
|
|
70
|
+
private load;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Where `corpus` is on the person's PATH, or null when no Corpus is installed. The Corpus desktop app puts
|
|
74
|
+
* `bin/corpus.cmd` (Windows) or `bin/corpus` on the user PATH; nothing else is searched.
|
|
75
|
+
*/
|
|
76
|
+
export declare function findCorpusCommand(env?: NodeJS.ProcessEnv): string | null;
|
|
77
|
+
/**
|
|
78
|
+
* Tells Corpus a transcript grew: `corpus sessions sync --from <cwd> --only <file>`, detached, with no stdin, never
|
|
79
|
+
* waited on. Corpus walks up from `cwd` to the nearest corpus and does nothing when there is none; it takes its own
|
|
80
|
+
* lock, so a sync per turn is safe. No folder, or no Corpus installed: nothing is run.
|
|
81
|
+
*/
|
|
82
|
+
export declare function syncCorpusSession(file: string, cwd: string | null, env?: NodeJS.ProcessEnv): void;
|
|
83
|
+
/**
|
|
84
|
+
* The writer every real host uses: transcripts in the XENO local home (`state`, area `agents/sessions`), each turn
|
|
85
|
+
* followed by a Corpus sync when Corpus is installed. `XENO_HOME` moves it with everything else.
|
|
86
|
+
*/
|
|
87
|
+
export declare function createLocalSessionTranscriptWriter(input: {
|
|
88
|
+
readLog: SessionTranscriptWriterOptions['readLog'];
|
|
89
|
+
env?: NodeJS.ProcessEnv;
|
|
90
|
+
}): SessionTranscriptWriter;
|
|
91
|
+
//# sourceMappingURL=sessionTranscript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionTranscript.d.ts","sourceRoot":"","sources":["../../src/transcript/sessionTranscript.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AASrF,gGAAgG;AAChG,eAAO,MAAM,qBAAqB,QAAS,CAAA;AAE3C;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAO3E;AAED,MAAM,MAAM,qBAAqB,GAC7B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,EAA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IAAI,CAAC,CAAA;CACrE;AAID,qBAAa,uBAAuB;IAKtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IAErD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmC;gBAE7B,OAAO,EAAE,8BAA8B;IAEpE,+CAA+C;IAC/C,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM;IAIvE,8DAA8D;IAC9D,SAAS,CAAC,KAAK,EAAE;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;YAQ7G,MAAM;IAsCpB,uGAAuG;YACzF,IAAI;CAgBnB;AAMD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,IAAI,CAUrF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,IAAI,CAW9G;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,KAAK,EAAE;IACxD,OAAO,EAAE,8BAA8B,CAAC,SAAS,CAAC,CAAA;IAClD,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CACxB,GAAG,uBAAuB,CAQ1B"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The session transcript FILE: one append-only JSONL file per conversation, so XENO Corpus can search a session's
|
|
3
|
+
* whole history, including everything compaction later took out of the model's context (owner, 2026-11-03).
|
|
4
|
+
*
|
|
5
|
+
* It is written from the host's own conversation log, which already keeps every turn: compaction is recorded as an
|
|
6
|
+
* event and the summarised turns stay in the log. This file is that log in the shape Corpus reads for every agent
|
|
7
|
+
* (Claude Code, Codex, XENO), placed where Corpus can find it without asking the host.
|
|
8
|
+
*
|
|
9
|
+
* <state>/agents/sessions/transcripts/<projectKey>/<conversationId>.jsonl (XENO LOCAL HOME, area agents/sessions)
|
|
10
|
+
*
|
|
11
|
+
* {"type":"session","id":…,"cwd":…,"startedAt":…,"agent":"xeno"} first line, written once
|
|
12
|
+
* {"type":"message","role":"user"|"assistant","text":…,"at":…}
|
|
13
|
+
* {"type":"tool_call","name":…,"input":{…},"at":…} then {"type":"tool_result","name":…,"text":…,"at":…}
|
|
14
|
+
* {"type":"compaction","summary":…,"at":…}
|
|
15
|
+
*
|
|
16
|
+
* Lines are written when a turn has ENDED, never mid-turn, and never rewritten: an edit or rewind appends, and the
|
|
17
|
+
* abandoned branch stays in the file as history. Every line also carries `requestId` (or `compactionId`), which is how
|
|
18
|
+
* a restarted host knows what it already wrote. Private reasoning is never written. A subagent's run is not part of its
|
|
19
|
+
* parent's file. A failure here never affects the turn: the file is a copy, the log is the record.
|
|
20
|
+
*/
|
|
21
|
+
import { spawn } from 'child_process';
|
|
22
|
+
import { createHash } from 'crypto';
|
|
23
|
+
import { existsSync } from 'fs';
|
|
24
|
+
import { appendFile, mkdir, readFile } from 'fs/promises';
|
|
25
|
+
import { basename, delimiter, dirname, join, resolve } from 'path';
|
|
26
|
+
import { createDirs } from '@xenosystem/primitives/dirs';
|
|
27
|
+
import { projectRuntimeTimeline } from '../runtime/RuntimeTimelineProjection.js';
|
|
28
|
+
import { COMPACTION_TURN_PURPOSE, CONVERSATION_COMPACTED_EVENT_TYPE, TURN_INPUT_EVENT_TYPE, inThread, } from './hostTranscript.js';
|
|
29
|
+
/** The longest text one line carries; a longer tool output or reply is clipped, never split. */
|
|
30
|
+
export const TRANSCRIPT_TEXT_LIMIT = 64_000;
|
|
31
|
+
/**
|
|
32
|
+
* A stable, readable folder name for a project path: `<basename>-<12 hex of the absolute path>`. The same function as
|
|
33
|
+
* the CLI's audit logs (`projectAuditKey`), so one project has one folder name across the agent's state.
|
|
34
|
+
*/
|
|
35
|
+
export function transcriptProjectKey(cwd) {
|
|
36
|
+
if (!cwd)
|
|
37
|
+
return 'no-folder';
|
|
38
|
+
const absolute = resolve(cwd);
|
|
39
|
+
const identity = process.platform === 'win32' ? absolute.toLowerCase() : absolute;
|
|
40
|
+
const digest = createHash('sha256').update(identity).digest('hex').slice(0, 12);
|
|
41
|
+
const name = basename(absolute).replace(/[^A-Za-z0-9._-]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 40) || 'project';
|
|
42
|
+
return `${name}-${digest}`;
|
|
43
|
+
}
|
|
44
|
+
const clip = (text) => (text.length > TRANSCRIPT_TEXT_LIMIT ? `${text.slice(0, TRANSCRIPT_TEXT_LIMIT)}\n…` : text);
|
|
45
|
+
const textOf = (value) => (typeof value === 'string' ? value : value === undefined || value === null ? '' : JSON.stringify(value));
|
|
46
|
+
/**
|
|
47
|
+
* The lines for one ended turn, from the conversation's log. Pure, so it is tested without a host. A summarising turn
|
|
48
|
+
* (compaction) contributes nothing here: what it produced is written once, as its compaction line.
|
|
49
|
+
*/
|
|
50
|
+
export function transcriptLinesForTurn(log, requestId) {
|
|
51
|
+
const turn = log.filter((event) => event.requestId === requestId && inThread(event, undefined));
|
|
52
|
+
const input = turn.find((event) => event.type === TURN_INPUT_EVENT_TYPE);
|
|
53
|
+
if (input && input.event.purpose === COMPACTION_TURN_PURPOSE)
|
|
54
|
+
return [];
|
|
55
|
+
const lines = [];
|
|
56
|
+
if (input && typeof input.event.text === 'string' && input.event.text) {
|
|
57
|
+
lines.push({ type: 'message', role: 'user', text: clip(input.event.text), at: input.timestamp, requestId });
|
|
58
|
+
}
|
|
59
|
+
const timeline = projectRuntimeTimeline(turn.filter((event) => event.type !== TURN_INPUT_EVENT_TYPE));
|
|
60
|
+
const reply = timeline.requests.find((request) => request.requestId === requestId);
|
|
61
|
+
for (const tool of timeline.tools.filter((t) => t.requestId === requestId)) {
|
|
62
|
+
const at = tool.startedAt || reply?.startedAt || input?.timestamp || new Date(0).toISOString();
|
|
63
|
+
lines.push({ type: 'tool_call', name: tool.toolName, input: tool.input ?? {}, at, requestId });
|
|
64
|
+
const result = tool.output ?? tool.outputPreview ?? tool.error;
|
|
65
|
+
if (result !== undefined)
|
|
66
|
+
lines.push({ type: 'tool_result', name: tool.toolName, text: clip(textOf(result)), at: tool.completedAt || at, requestId });
|
|
67
|
+
}
|
|
68
|
+
if (reply && reply.text) {
|
|
69
|
+
lines.push({ type: 'message', role: 'assistant', text: clip(reply.text), at: reply.completedAt || reply.failedAt || reply.startedAt || input?.timestamp || new Date(0).toISOString(), requestId });
|
|
70
|
+
}
|
|
71
|
+
return lines;
|
|
72
|
+
}
|
|
73
|
+
/** Every compaction in the conversation's own thread, as lines, in the order they were recorded. */
|
|
74
|
+
export function compactionLines(log) {
|
|
75
|
+
return log
|
|
76
|
+
.filter((event) => event.type === CONVERSATION_COMPACTED_EVENT_TYPE && inThread(event, undefined) && typeof event.event.summary === 'string')
|
|
77
|
+
.sort((a, b) => a.sequence - b.sequence)
|
|
78
|
+
.map((event) => ({ type: 'compaction', summary: clip(event.event.summary), at: event.timestamp, compactionId: event.id }));
|
|
79
|
+
}
|
|
80
|
+
export class SessionTranscriptWriter {
|
|
81
|
+
options;
|
|
82
|
+
written = new Map();
|
|
83
|
+
// One write at a time per conversation, so two ending turns never interleave lines.
|
|
84
|
+
queues = new Map();
|
|
85
|
+
constructor(options) {
|
|
86
|
+
this.options = options;
|
|
87
|
+
}
|
|
88
|
+
/** Where a conversation's transcript lives. */
|
|
89
|
+
fileFor(conversationId, cwd) {
|
|
90
|
+
return resolve(this.options.directoryFor(transcriptProjectKey(cwd)), `${conversationId}.jsonl`);
|
|
91
|
+
}
|
|
92
|
+
/** Append what a turn that just ended added. Never throws. */
|
|
93
|
+
turnEnded(input) {
|
|
94
|
+
if (input.subagentRunId)
|
|
95
|
+
return Promise.resolve();
|
|
96
|
+
const previous = this.queues.get(input.conversationId) ?? Promise.resolve();
|
|
97
|
+
const next = previous.then(() => this.append(input.conversationId, input.cwd ?? null)).catch(() => { });
|
|
98
|
+
this.queues.set(input.conversationId, next);
|
|
99
|
+
return next;
|
|
100
|
+
}
|
|
101
|
+
async append(conversationId, cwd) {
|
|
102
|
+
const file = this.fileFor(conversationId, cwd);
|
|
103
|
+
const written = await this.load(conversationId, file);
|
|
104
|
+
const log = await this.options.readLog(conversationId);
|
|
105
|
+
const lines = [];
|
|
106
|
+
if (!written.requests.size && !written.compactions.size && !(await exists(file))) {
|
|
107
|
+
const first = log.reduce((at, event) => (at === undefined || event.timestamp < at ? event.timestamp : at), undefined);
|
|
108
|
+
lines.push({ type: 'session', id: conversationId, cwd: cwd ? resolve(cwd) : null, startedAt: first ?? new Date().toISOString(), agent: 'xeno' });
|
|
109
|
+
}
|
|
110
|
+
// Turns in the order they started; only turns that have a reply recorded or were answered with tools are ended.
|
|
111
|
+
const order = [];
|
|
112
|
+
for (const event of [...log].sort((a, b) => a.sequence - b.sequence)) {
|
|
113
|
+
if (!inThread(event, undefined) || event.type === CONVERSATION_COMPACTED_EVENT_TYPE)
|
|
114
|
+
continue;
|
|
115
|
+
if (!order.includes(event.requestId))
|
|
116
|
+
order.push(event.requestId);
|
|
117
|
+
}
|
|
118
|
+
const compactions = compactionLines(log);
|
|
119
|
+
for (const requestId of order) {
|
|
120
|
+
if (written.requests.has(requestId))
|
|
121
|
+
continue;
|
|
122
|
+
const turnLines = transcriptLinesForTurn(log, requestId);
|
|
123
|
+
// A compaction recorded before this turn started is written before it.
|
|
124
|
+
const startedAt = log.find((event) => event.requestId === requestId)?.sequence ?? Number.POSITIVE_INFINITY;
|
|
125
|
+
for (const line of compactions) {
|
|
126
|
+
if (line.type !== 'compaction' || written.compactions.has(line.compactionId))
|
|
127
|
+
continue;
|
|
128
|
+
const at = log.find((event) => event.id === line.compactionId)?.sequence ?? 0;
|
|
129
|
+
if (at < startedAt) {
|
|
130
|
+
lines.push(line);
|
|
131
|
+
written.compactions.add(line.compactionId);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
lines.push(...turnLines);
|
|
135
|
+
written.requests.add(requestId);
|
|
136
|
+
}
|
|
137
|
+
for (const line of compactions) {
|
|
138
|
+
if (line.type === 'compaction' && !written.compactions.has(line.compactionId)) {
|
|
139
|
+
lines.push(line);
|
|
140
|
+
written.compactions.add(line.compactionId);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (!lines.length)
|
|
144
|
+
return;
|
|
145
|
+
await mkdir(dirname(file), { recursive: true });
|
|
146
|
+
await appendFile(file, lines.map((line) => JSON.stringify(line)).join('\n') + '\n', 'utf8');
|
|
147
|
+
try {
|
|
148
|
+
await this.options.afterAppend?.(file, cwd);
|
|
149
|
+
}
|
|
150
|
+
catch { /* a hook never affects the turn */ }
|
|
151
|
+
}
|
|
152
|
+
/** What this file already holds, read once per conversation per process, from the ids on its lines. */
|
|
153
|
+
async load(conversationId, file) {
|
|
154
|
+
const known = this.written.get(conversationId);
|
|
155
|
+
if (known)
|
|
156
|
+
return known;
|
|
157
|
+
const written = { requests: new Set(), compactions: new Set() };
|
|
158
|
+
const text = await readFile(file, 'utf8').catch(() => '');
|
|
159
|
+
for (const raw of text.split('\n')) {
|
|
160
|
+
if (!raw.trim())
|
|
161
|
+
continue;
|
|
162
|
+
try {
|
|
163
|
+
const line = JSON.parse(raw);
|
|
164
|
+
if (typeof line.requestId === 'string')
|
|
165
|
+
written.requests.add(line.requestId);
|
|
166
|
+
if (typeof line.compactionId === 'string')
|
|
167
|
+
written.compactions.add(line.compactionId);
|
|
168
|
+
}
|
|
169
|
+
catch { /* a torn last line from a crash is left as it is */ }
|
|
170
|
+
}
|
|
171
|
+
this.written.set(conversationId, written);
|
|
172
|
+
return written;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
async function exists(file) {
|
|
176
|
+
return readFile(file).then(() => true, () => false);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Where `corpus` is on the person's PATH, or null when no Corpus is installed. The Corpus desktop app puts
|
|
180
|
+
* `bin/corpus.cmd` (Windows) or `bin/corpus` on the user PATH; nothing else is searched.
|
|
181
|
+
*/
|
|
182
|
+
export function findCorpusCommand(env = process.env) {
|
|
183
|
+
const names = process.platform === 'win32' ? ['corpus.cmd', 'corpus.exe'] : ['corpus'];
|
|
184
|
+
for (const dir of String(env.PATH ?? env.Path ?? '').split(delimiter)) {
|
|
185
|
+
if (!dir)
|
|
186
|
+
continue;
|
|
187
|
+
for (const name of names) {
|
|
188
|
+
const candidate = join(dir, name);
|
|
189
|
+
if (existsSync(candidate))
|
|
190
|
+
return candidate;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Tells Corpus a transcript grew: `corpus sessions sync --from <cwd> --only <file>`, detached, with no stdin, never
|
|
197
|
+
* waited on. Corpus walks up from `cwd` to the nearest corpus and does nothing when there is none; it takes its own
|
|
198
|
+
* lock, so a sync per turn is safe. No folder, or no Corpus installed: nothing is run.
|
|
199
|
+
*/
|
|
200
|
+
export function syncCorpusSession(file, cwd, env = process.env) {
|
|
201
|
+
if (!cwd)
|
|
202
|
+
return;
|
|
203
|
+
const corpus = findCorpusCommand(env);
|
|
204
|
+
if (!corpus)
|
|
205
|
+
return;
|
|
206
|
+
const args = ['sessions', 'sync', '--from', cwd, '--only', file];
|
|
207
|
+
// A .cmd shim only runs through cmd.exe; every argument is a path we built, quoted whole.
|
|
208
|
+
const child = corpus.endsWith('.cmd')
|
|
209
|
+
? spawn(process.env.ComSpec || 'cmd.exe', ['/d', '/s', '/c', `"${[corpus, ...args].map((a) => `"${a}"`).join(' ')}"`], { detached: true, stdio: 'ignore', windowsHide: true, windowsVerbatimArguments: true, env })
|
|
210
|
+
: spawn(corpus, args, { detached: true, stdio: 'ignore', windowsHide: true, env });
|
|
211
|
+
child.on('error', () => { });
|
|
212
|
+
child.unref();
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* The writer every real host uses: transcripts in the XENO local home (`state`, area `agents/sessions`), each turn
|
|
216
|
+
* followed by a Corpus sync when Corpus is installed. `XENO_HOME` moves it with everything else.
|
|
217
|
+
*/
|
|
218
|
+
export function createLocalSessionTranscriptWriter(input) {
|
|
219
|
+
const env = input.env ?? process.env;
|
|
220
|
+
const dirs = createDirs({ env });
|
|
221
|
+
return new SessionTranscriptWriter({
|
|
222
|
+
directoryFor: (projectKey) => dirs.path('state', 'agents/sessions', 'transcripts', projectKey),
|
|
223
|
+
readLog: input.readLog,
|
|
224
|
+
afterAppend: (file, cwd) => syncCorpusSession(file, cwd, env),
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=sessionTranscript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionTranscript.js","sourceRoot":"","sources":["../../src/transcript/sessionTranscript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAC/B,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAExD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAA;AAChF,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,qBAAqB,EACrB,QAAQ,GACT,MAAM,qBAAqB,CAAA;AAE5B,gGAAgG;AA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index.js",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"@xenosystem/capability-sdk": "0.1.1",
|
|
38
38
|
"@xenosystem/primitives": "0.3.1",
|
|
39
39
|
"zod": "4.6.7",
|
|
40
|
-
"@xenosystem/
|
|
41
|
-
"@xenosystem/
|
|
42
|
-
"@xenosystem/agent-interface-core": "0.1.
|
|
40
|
+
"@xenosystem/capability-mcp": "0.1.176",
|
|
41
|
+
"@xenosystem/agent-interface-contract": "0.1.176",
|
|
42
|
+
"@xenosystem/agent-interface-core": "0.1.176"
|
|
43
43
|
},
|
|
44
44
|
"optionalDependencies": {
|
|
45
45
|
"@xenosystem/acp-agent": "0.2.25",
|
|
46
|
-
"@xenosystem/agent-interface-client": "0.1.
|
|
46
|
+
"@xenosystem/agent-interface-client": "0.1.176"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@xeno-corporation/account": "0.4.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"better-sqlite3": "13.0.3",
|
|
67
67
|
"node-pty": "^1.1.0",
|
|
68
68
|
"fflate": "^0.8.3",
|
|
69
|
-
"@xenosystem/agent-interface-client": "0.1.
|
|
69
|
+
"@xenosystem/agent-interface-client": "0.1.176"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {}
|
|
72
72
|
}
|