aethralive 0.0.0-stage → 0.2.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.
- package/.env.example +13 -0
- package/README.md +120 -2
- package/dist/activity.d.ts +24 -0
- package/dist/activity.js +46 -0
- package/dist/activity.js.map +1 -0
- package/dist/adapter.d.ts +11 -0
- package/dist/adapter.js +81 -0
- package/dist/adapter.js.map +1 -0
- package/dist/agents.d.ts +11 -0
- package/dist/agents.js +147 -0
- package/dist/agents.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +267 -0
- package/dist/cli.js.map +1 -0
- package/dist/lifecycle.d.ts +13 -0
- package/dist/lifecycle.js +51 -0
- package/dist/lifecycle.js.map +1 -0
- package/dist/local.d.ts +19 -0
- package/dist/local.js +88 -0
- package/dist/local.js.map +1 -0
- package/dist/protocol.d.ts +50 -0
- package/dist/protocol.js +98 -0
- package/dist/protocol.js.map +1 -0
- package/dist/relay-main.d.ts +2 -0
- package/dist/relay-main.js +55 -0
- package/dist/relay-main.js.map +1 -0
- package/dist/relay.d.ts +11 -0
- package/dist/relay.js +231 -0
- package/dist/relay.js.map +1 -0
- package/dist/store.d.ts +41 -0
- package/dist/store.js +93 -0
- package/dist/store.js.map +1 -0
- package/dist/telegram.d.ts +14 -0
- package/dist/telegram.js +46 -0
- package/dist/telegram.js.map +1 -0
- package/dist/widget.d.ts +17 -0
- package/dist/widget.js +51 -0
- package/dist/widget.js.map +1 -0
- package/package.json +16 -4
package/.env.example
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Relay only. Never distribute your bot token to CLI users.
|
|
2
|
+
TELEGRAM_BOT_TOKEN=
|
|
3
|
+
# polling for local development, webhook behind HTTPS in production
|
|
4
|
+
TELEGRAM_MODE=polling
|
|
5
|
+
AETHRALIVE_WIDGETS=true
|
|
6
|
+
TELEGRAM_WEBHOOK_SECRET=
|
|
7
|
+
AETHRALIVE_HOST=127.0.0.1
|
|
8
|
+
PORT=8787
|
|
9
|
+
AETHRALIVE_DB=./data/pairing.sqlite
|
|
10
|
+
# CLI: point to your deployed relay (HTTPS except loopback)
|
|
11
|
+
AETHRALIVE_RELAY=http://127.0.0.1:8787
|
|
12
|
+
# Optional: writable directory for CLI credentials, raw logs and outbox
|
|
13
|
+
AETHRALIVE_HOME=./.aethralive
|
package/README.md
CHANGED
|
@@ -1,3 +1,121 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AethraLive
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Actual coding-agent activity in your private Telegram chat: readable streaming replies, expandable thoughts and tool cards, full output attachments, and automatic pause when a run stops. No AI summaries and no remote agent control.
|
|
4
|
+
|
|
5
|
+
Formerly CodeRemote. The bot is [@AethraLiveBot](https://t.me/AethraLiveBot); its username is discovered from the relay token. This project is not published to npm or publicly hosted yet. Use the local commands until publication.
|
|
6
|
+
|
|
7
|
+
## Run locally (relay owner only)
|
|
8
|
+
|
|
9
|
+
Requires Node.js 24+, a supported source, and one Telegram bot from [BotFather](https://t.me/BotFather). The bot and token are configured **once by the relay owner**; do not ask every AethraLive user to create a bot.
|
|
10
|
+
|
|
11
|
+
```powershell
|
|
12
|
+
npm.cmd install
|
|
13
|
+
npm.cmd run build
|
|
14
|
+
# First setup only: do not overwrite an existing configured .env
|
|
15
|
+
Copy-Item .env.example .env
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Save `TELEGRAM_BOT_TOKEN` directly in the relay owner's `.env`. Never commit, embed, or distribute it. Start the single shared relay:
|
|
19
|
+
|
|
20
|
+
```powershell
|
|
21
|
+
npm.cmd run relay
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
In another terminal, with your coding agent running:
|
|
25
|
+
|
|
26
|
+
```powershell
|
|
27
|
+
npm.cmd start
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
On first run, the terminal shows a unique QR code, a clickable Telegram pairing link, and the path to a QR image **before looking for an agent**. Scan the QR or open the link and tap Start. Then choose your agent/session. If `t.me` is inaccessible, open the bot in Telegram and send the exact `/start TOKEN` command printed in the terminal. Pairings expire in ten minutes and work once. Used/expired QR images are removed when the command finishes.
|
|
31
|
+
|
|
32
|
+
Use `npm.cmd start -- connect` (or `aethralive connect` after installation) to pair by itself without an agent installed/running. Already-paired installations show their bot link and keep their existing pairing; no fresh QR is required. Installation does not launch a hidden postinstall process: users explicitly run `npx aethralive` or the installed `aethralive` command.
|
|
33
|
+
|
|
34
|
+
For public distribution, deploy this one shared relay behind HTTPS and give users its URL. During development it defaults to `http://127.0.0.1:8787`, which is reachable only from the same computer. Other users must supply your hosted address with `--relay` or `AETHRALIVE_RELAY`. End users do not need BotFather, a bot token, or a second relay.
|
|
35
|
+
|
|
36
|
+
The relay holds the bot token and determines the recipient from the authenticated device. Each user's chat is isolated. Run only one relay/update receiver for a bot.
|
|
37
|
+
|
|
38
|
+
## Install as an end user
|
|
39
|
+
|
|
40
|
+
End users only need Node.js and the package/repository:
|
|
41
|
+
|
|
42
|
+
```powershell
|
|
43
|
+
npm.cmd install
|
|
44
|
+
npm.cmd run build
|
|
45
|
+
npm.cmd start -- connect --relay https://YOUR-HOSTED-RELAY
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The command prints a QR code and pairing link. Scan it with Telegram and tap **Start**. Each installation gets its own pairing credential and receives only its own agent activity, while all users continue using the same shared bot. Never copy the relay owner's `.env` or `TELEGRAM_BOT_TOKEN` to an end-user machine.
|
|
49
|
+
|
|
50
|
+
## Agents and commands
|
|
51
|
+
|
|
52
|
+
```powershell
|
|
53
|
+
npm.cmd start -- --agent opencode --session SESSION_ID
|
|
54
|
+
npm.cmd start -- --agent codex
|
|
55
|
+
npm.cmd start -- --agent jsonl --events ./agent-events.jsonl --session external
|
|
56
|
+
npm.cmd start -- agents
|
|
57
|
+
npm.cmd start -- connect
|
|
58
|
+
npm.cmd start -- status
|
|
59
|
+
npm.cmd start -- stop
|
|
60
|
+
npm.cmd start -- unpair
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`npm.cmd start` loads `.env`. Direct `node dist/cli.js` uses shell environment variables. Use `AETHRALIVE_HOME` or `--home DIR` consistently; the default is `~/.aethralive`. Previous CodeRemote state can be reused by pointing this variable to its previous directory. One foreground watcher runs per home directory. `stop` stops monitoring without stopping your agent or revoking pairing. `unpair` revokes this device; Telegram `/revoke` revokes all devices belonging to that sender.
|
|
64
|
+
|
|
65
|
+
**OpenCode:** discovers an existing OpenCode v2.3.x background service through the official client. It never starts another agent session. `--opencode-url URL` selects an explicit existing endpoint; `OPENCODE_TOKEN` supplies optional bearer authentication. Source events are live-only and session/descendant scoped. Filesystem/global events without session attribution are not guessed or forwarded.
|
|
66
|
+
|
|
67
|
+
**Codex:** discovers recent logs in `$CODEX_HOME/sessions` (default `~/.codex/sessions`). `--events FILE` selects an explicit Codex log. It tails newly appended assistant messages, exposed reasoning summaries, tool calls/results, and task lifecycle. Encrypted reasoning, instructions and duplicate agent-message records are ignored. This is an experimental local-log adapter verified against installed records, not an official streaming API. Text timing depends on when Codex writes its log; token-by-token output is not guaranteed.
|
|
68
|
+
|
|
69
|
+
**Other agents:** `--agent jsonl` tails a file supplied by another integration. That integration writes the neutral `Activity` contract from `src/activity.ts`, for example:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{"agent":"My agent","session":"external","kind":"status","id":"run-1","state":"Running"}
|
|
73
|
+
{"agent":"My agent","session":"external","kind":"text","id":"reply-1","phase":"delta","text":"Actual streamed text"}
|
|
74
|
+
{"agent":"My agent","session":"external","kind":"tool","id":"tool-1","title":"Read","input":"src/main.ts","state":"Running"}
|
|
75
|
+
{"agent":"My agent","session":"external","kind":"tool","id":"tool-1","text":"Actual file contents","state":"Completed"}
|
|
76
|
+
{"agent":"My agent","session":"external","kind":"status","id":"run-1","state":"Stopped"}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Kinds are `text`, `thought`, `tool`, `status`, and `notice`. Text phases are `start`, `delta`, and `end`; block IDs identify the same logical message or tool across updates. Lifecycle states include `Running`, `Completed`, `Failed`, `Idle`, `Stopped`, and `Offline`. The source must emit lifecycle signals to enable automatic stop detection. Antigravity and other editors need a source adapter/feed; they are not automatically observable just because they are installed.
|
|
80
|
+
|
|
81
|
+
## Presentation and lifecycle
|
|
82
|
+
|
|
83
|
+
- Assistant text appears directly. IDs, JSON envelopes, model metadata, usage accounting, and lifecycle bookkeeping never appear as chat messages.
|
|
84
|
+
- Thoughts and tool inputs/results use native expandable Telegram block quotations. Tool start, input, and completion update the same card. End events finalize streamed blocks without repeating their full content.
|
|
85
|
+
- Text continues in a new message after 3,600 UTF-16 units, preserving Unicode pairs. Consecutive queued updates for the same message combine mechanically without summarizing content.
|
|
86
|
+
- Large tool outputs become `.txt` attachments containing actual output. Files larger than 512 KiB split into byte parts; concatenate them numerically to recover the full content. Source HTML is escaped before relay-generated formatting is applied.
|
|
87
|
+
- Interrupting a run, an unfinished run becoming idle, or a source disconnection cancels pending presentation for that run. Late tool/text events are suppressed. Pairing and monitoring remain alive; the next root Running event resumes delivery. Successful completion preserves its final reply.
|
|
88
|
+
- The relay enforces per-device delivery generations and cancels an in-flight request when the generation changes. A message Telegram already accepted cannot be recalled by cancelling its request.
|
|
89
|
+
- Closing a TUI alone does not mean its shared background service stopped working. State reflects the actual agent session, not whether a window is visible.
|
|
90
|
+
- Telegram API throttling remains in effect. Active-run deliveries retry after `retry_after`; interruption supersedes the old queue. Detailed rate-limit tuning is deferred.
|
|
91
|
+
|
|
92
|
+
## Status widgets
|
|
93
|
+
|
|
94
|
+
Private native status cards show the current agent, latest observed state, device, observation time and expandable session details. The fixed HTML uses Telegram theme variables and system fonts with no network access. `sendWidget` creates a card and `editMessageWidgetData` updates message-specific `chat_data`; no session content is published as shared widget data.
|
|
95
|
+
|
|
96
|
+
Set `AETHRALIVE_WIDGETS=false` on the relay to use a regular editable status message. Unsupported requests (Bot API 400/404) disable widgets for that device and automatically fall back to that readable status message. Re-pair to retry native widgets after upgrading the API. Older Telegram clients may show unsupported media; expandable thought/tool blocks remain independent of widget support. A timestamp is an observation, not a heartbeat.
|
|
97
|
+
|
|
98
|
+
`node scripts/widget-preview.mjs` generates local light/dark previews. Tests check Telegram HTML/compression/state limits and the local details toggle. A real Telegram client is needed to verify native rendering.
|
|
99
|
+
|
|
100
|
+
## Storage, reconnects and privacy
|
|
101
|
+
|
|
102
|
+
Raw events are flushed to local `events.jsonl` before delivery. The checkpoint saves presentation state after acknowledgement. An active run can resume delivery through network failures. Interrupting or restarting the watcher intentionally skips old pending presentation while preserving the local archive. A torn final append is repaired; completed corrupt records fail loudly. Unknown agent events stay local until an adapter gives them presentation semantics.
|
|
103
|
+
|
|
104
|
+
The relay SQLite database stores pairing ownership, hashed credentials, revocation, message IDs, operation hashes, delivery generations, and the polling offset. It does not store code or chat-history payloads. The relay handles outgoing contents transiently; Telegram stores delivered messages. Protect local files with OS permissions, including Windows ACLs.
|
|
105
|
+
|
|
106
|
+
Delivery is at least once. A crash after Telegram accepts a message but before its receipt is committed can duplicate that message. Local logs and receipt metadata currently have no automatic retention policy.
|
|
107
|
+
|
|
108
|
+
## Deploy and validate
|
|
109
|
+
|
|
110
|
+
Use one always-on Node process behind HTTPS, with persistent SQLite storage configured through `AETHRALIVE_DB`. Set `AETHRALIVE_HOST=0.0.0.0` only inside the intended private container/network and proxy it securely. CLI remote URLs must use HTTPS. Monitor `/health`, disk space and sanitized logs. Disable request-body/Authorization logging at the proxy. The relay caps JSON requests at 2 MiB and queued operations at 100.
|
|
111
|
+
|
|
112
|
+
Polling is the development default. For webhooks, set `TELEGRAM_MODE=webhook`, generate `TELEGRAM_WEBHOOK_SECRET` (32–256 URL-safe characters), and explicitly register `/telegram/webhook` through Telegram's `setWebhook` with the same `secret_token` and `allowed_updates: ["message"]`. Polling refuses to run while a webhook exists. Back up SQLite using SQLite-aware backup or a stopped process.
|
|
113
|
+
|
|
114
|
+
```powershell
|
|
115
|
+
npm.cmd test
|
|
116
|
+
npm.cmd pack
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Tests use temporary databases and fake sources/Telegram transport, including the actual CLI subprocess. They cover readable streaming, Unicode continuation, attachments, lifecycle cancellation, queue races, account isolation, pairing persistence, and alternate adapters. The package excludes local history, tokens, databases, tests and the source transcript. Publishing and hosting are separate operations.
|
|
120
|
+
|
|
121
|
+
Sources: [OpenCode client](https://opencode.ai/docs/build/client/), [Telegram Bot API](https://core.telegram.org/bots/api).
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Agent-neutral presentation contract. Native envelopes stay in the local journal. */
|
|
2
|
+
export type Activity = {
|
|
3
|
+
agent: string;
|
|
4
|
+
session: string;
|
|
5
|
+
kind: 'text' | 'thought' | 'tool' | 'status' | 'notice';
|
|
6
|
+
id: string;
|
|
7
|
+
phase?: 'start' | 'delta' | 'end';
|
|
8
|
+
text?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
input?: string;
|
|
11
|
+
state?: string;
|
|
12
|
+
root?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function readable(value: unknown): string;
|
|
15
|
+
export declare function openCodeActivity(raw: {
|
|
16
|
+
type: string;
|
|
17
|
+
data?: Record<string, unknown>;
|
|
18
|
+
}): Activity | undefined;
|
|
19
|
+
export declare function activityFor(raw: {
|
|
20
|
+
type: string;
|
|
21
|
+
activity?: Activity;
|
|
22
|
+
data?: Record<string, unknown>;
|
|
23
|
+
}): Activity | undefined;
|
|
24
|
+
export declare function isInterrupted(a: Activity | undefined): boolean;
|
package/dist/activity.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const string = (v) => typeof v === 'string' ? v : '';
|
|
2
|
+
export function readable(value) {
|
|
3
|
+
if (typeof value === 'string')
|
|
4
|
+
return value;
|
|
5
|
+
if (Array.isArray(value))
|
|
6
|
+
return value.map(readable).filter(Boolean).join('\n');
|
|
7
|
+
if (!value || typeof value !== 'object')
|
|
8
|
+
return value == null ? '' : String(value);
|
|
9
|
+
const obj = value;
|
|
10
|
+
for (const field of ['text', 'output', 'message', 'content', 'diff', 'patch'])
|
|
11
|
+
if (obj[field] !== undefined)
|
|
12
|
+
return readable(obj[field]);
|
|
13
|
+
return Object.entries(obj).filter(([key]) => !['native', 'metadata', 'sessionID', 'assistantMessageID', 'type'].includes(key)).map(([key, item]) => `${key}: ${readable(item)}`).join('\n');
|
|
14
|
+
}
|
|
15
|
+
export function openCodeActivity(raw) {
|
|
16
|
+
const d = raw.data ?? {}, session = string(d.sessionID);
|
|
17
|
+
if (!session)
|
|
18
|
+
return;
|
|
19
|
+
const a = { agent: 'OpenCode', session, kind: 'notice', id: string(d.id) || string(d.assistantMessageID) || raw.type };
|
|
20
|
+
const type = raw.type;
|
|
21
|
+
if (/^session\.(text|reasoning)\.(started|delta|ended)$/.test(type)) {
|
|
22
|
+
const thought = type.includes('reasoning');
|
|
23
|
+
return { ...a, kind: thought ? 'thought' : 'text', id: `${thought ? 'thought' : 'text'}:${d.assistantMessageID ?? ''}:${d.ordinal ?? 0}`, phase: type.endsWith('started') ? 'start' : type.endsWith('delta') ? 'delta' : 'end', text: string(d.delta ?? d.text) };
|
|
24
|
+
}
|
|
25
|
+
if (type.startsWith('session.tool.')) {
|
|
26
|
+
if (type.includes('input.delta') || type.includes('input.ended') || type.endsWith('progress'))
|
|
27
|
+
return;
|
|
28
|
+
return { ...a, kind: 'tool', title: string(d.name), input: d.input === undefined ? undefined : readable(d.input), text: type.endsWith('success') ? readable(d.content) : type.endsWith('failed') ? readable(d.error) : undefined, state: type.endsWith('success') ? 'Completed' : type.endsWith('failed') ? 'Failed' : type.endsWith('called') ? 'Running' : 'Preparing' };
|
|
29
|
+
}
|
|
30
|
+
const status = d.status;
|
|
31
|
+
const states = { 'session.execution.started': 'Running', 'session.execution.succeeded': 'Completed', 'session.execution.failed': 'Failed', 'session.execution.interrupted': 'Stopped', 'session.idle': 'Idle', 'session.deleted': 'Offline', 'permission.asked': 'Waiting for permission', 'permission.replied': 'Running', 'session.retry.scheduled': 'Retrying', 'aethralive.watching': 'Connected', 'aethralive.capture-gap': 'Offline' };
|
|
32
|
+
const state = type === 'session.status' ? ({ busy: 'Running', idle: 'Idle', retry: 'Retrying' }[String(status?.type)]) : states[type];
|
|
33
|
+
if (state)
|
|
34
|
+
return { ...a, kind: 'status', state, text: type === 'permission.asked' ? [d.action, readable(d.resources)].filter(Boolean).join('\n') : undefined };
|
|
35
|
+
if (type === 'session.shell.started' || type === 'session.shell.ended') {
|
|
36
|
+
const shell = d.shell;
|
|
37
|
+
return { ...a, kind: 'tool', id: `shell:${shell?.id ?? a.id}`, title: 'Terminal', input: string(shell?.command), text: readable(d.output), state: type.endsWith('ended') ? 'Completed' : 'Running' };
|
|
38
|
+
}
|
|
39
|
+
if (type === 'session.step.failed')
|
|
40
|
+
return { ...a, kind: 'notice', title: 'Error', text: readable(d.error) };
|
|
41
|
+
if (type === 'session.skill.activated' || type === 'session.instructions.updated')
|
|
42
|
+
return { ...a, kind: 'notice', title: type.includes('skill') ? 'Skill loaded' : 'Instructions updated', text: string(d.name) };
|
|
43
|
+
}
|
|
44
|
+
export function activityFor(raw) { return raw.activity ?? openCodeActivity(raw); }
|
|
45
|
+
export function isInterrupted(a) { return a?.kind === 'status' && ['Stopped', 'Offline'].includes(a.state ?? ''); }
|
|
46
|
+
//# sourceMappingURL=activity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../src/activity.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,CAAC,CAAU,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9D,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,G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,CAAC;AACpN,CAAC;AACD,MAAM,UAAU,WAAW,CAAC,GAA0E,IAA0B,OAAO,GAAG,CAAC,QAAQ,IAAI,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC/K,MAAM,UAAU,aAAa,CAAC,CAAuB,IAAI,OAAO,CAAC,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OpenCode } from '@opencode/client';
|
|
2
|
+
import type { RawEvent } from './protocol.js';
|
|
3
|
+
export interface AgentAdapter {
|
|
4
|
+
sessions(): Promise<{
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}[]>;
|
|
8
|
+
watch(session: string, signal: AbortSignal): AsyncIterable<RawEvent>;
|
|
9
|
+
}
|
|
10
|
+
export declare function openCodeAdapter(url?: string): Promise<AgentAdapter>;
|
|
11
|
+
export declare function fromClient(client: Pick<ReturnType<typeof OpenCode.make>, 'session' | 'event'>): AgentAdapter;
|
package/dist/adapter.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { OpenCode } from '@opencode/client';
|
|
2
|
+
import { Service } from '@opencode/client/service';
|
|
3
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
4
|
+
import { openCodeActivity } from './activity.js';
|
|
5
|
+
export async function openCodeAdapter(url) {
|
|
6
|
+
const endpoint = url ? undefined : await Service.discover();
|
|
7
|
+
if (!url && !endpoint)
|
|
8
|
+
throw new Error('No running OpenCode service found. Open OpenCode first, or pass --opencode-url for its existing service.');
|
|
9
|
+
const client = OpenCode.make({ baseUrl: url ?? endpoint.url, headers: endpoint ? Service.headers(endpoint) :
|
|
10
|
+
process.env.OPENCODE_TOKEN ? { authorization: `Bearer ${process.env.OPENCODE_TOKEN}` } : undefined });
|
|
11
|
+
return fromClient(client);
|
|
12
|
+
}
|
|
13
|
+
export function fromClient(client) {
|
|
14
|
+
const parents = new Map();
|
|
15
|
+
return {
|
|
16
|
+
async sessions() {
|
|
17
|
+
const sessions = [];
|
|
18
|
+
let cursor;
|
|
19
|
+
do {
|
|
20
|
+
const result = await client.session.list({ cursor, limit: 100 });
|
|
21
|
+
for (const s of result.data) {
|
|
22
|
+
parents.set(s.id, s.parentID);
|
|
23
|
+
sessions.push({ id: s.id, name: s.title ?? s.id });
|
|
24
|
+
}
|
|
25
|
+
cursor = result.cursor.next ?? undefined;
|
|
26
|
+
} while (cursor);
|
|
27
|
+
return sessions;
|
|
28
|
+
},
|
|
29
|
+
async *watch(session, signal) {
|
|
30
|
+
let disconnected = false;
|
|
31
|
+
while (!signal.aborted) {
|
|
32
|
+
try {
|
|
33
|
+
for await (const event of client.event.subscribe({ signal })) {
|
|
34
|
+
if (signal.aborted)
|
|
35
|
+
return;
|
|
36
|
+
const raw = event;
|
|
37
|
+
if (raw.type === 'server.connected') {
|
|
38
|
+
disconnected = false;
|
|
39
|
+
if (typeof client.session.get === 'function') {
|
|
40
|
+
try {
|
|
41
|
+
const info = await client.session.get({ sessionID: session }, { signal });
|
|
42
|
+
const busy = (info.time.busy ?? 0) > (info.time.idle ?? 0);
|
|
43
|
+
yield { type: 'session.status', created: Date.now(), data: { sessionID: session, status: { type: busy ? 'busy' : 'idle' } } };
|
|
44
|
+
}
|
|
45
|
+
catch { /* Capture can still proceed; never start or alter the agent. */ }
|
|
46
|
+
}
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (raw.type === 'session.created' && typeof raw.data?.sessionID === 'string') {
|
|
50
|
+
parents.set(raw.data.sessionID, typeof raw.data.parentID === 'string' ? raw.data.parentID : undefined);
|
|
51
|
+
}
|
|
52
|
+
// Include descendants, but never attribute location-wide events to this session.
|
|
53
|
+
let id = raw.data?.sessionID;
|
|
54
|
+
const seen = new Set();
|
|
55
|
+
while (typeof id === 'string' && !seen.has(id)) {
|
|
56
|
+
if (id === session) {
|
|
57
|
+
const activity = openCodeActivity(raw);
|
|
58
|
+
yield { ...raw, ...(activity ? { activity: { ...activity, root: raw.data?.sessionID === session } } : {}) };
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
seen.add(id);
|
|
62
|
+
id = parents.get(id);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
if (signal.aborted)
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (signal.aborted)
|
|
71
|
+
return;
|
|
72
|
+
if (!disconnected)
|
|
73
|
+
yield { type: 'aethralive.capture-gap', created: Date.now(), data: { sessionID: session,
|
|
74
|
+
notice: 'OpenCode event connection ended. Events during this gap cannot be replayed by the live stream. Reconnecting.' } };
|
|
75
|
+
disconnected = true;
|
|
76
|
+
await delay(2000, undefined, { signal }).catch(() => { });
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAMjD,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,GAAY;IAChD,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC5D,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,0GAA0G,CAAC,CAAC;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,EAAE,EAAE,CAAC;gBAC7H,YAAY,GAAG,IAAI,CAAC;gBACpB,MAAM,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/agents.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type AgentAdapter } from './adapter.js';
|
|
2
|
+
import { type Activity } from './activity.js';
|
|
3
|
+
export declare const AGENTS: readonly ["opencode", "codex", "jsonl"];
|
|
4
|
+
export declare function agentAdapter(name: string, options?: {
|
|
5
|
+
url?: string;
|
|
6
|
+
events?: string;
|
|
7
|
+
session?: string;
|
|
8
|
+
}): Promise<AgentAdapter>;
|
|
9
|
+
export declare function codexActivity(record: any, session: string): Activity | undefined;
|
|
10
|
+
export declare function logAdapter(path: string, mode: 'codex' | 'external', sessionHint?: string): AgentAdapter;
|
|
11
|
+
export declare function codexAdapter(explicit?: string): AgentAdapter;
|
package/dist/agents.js
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { existsSync, readdirSync, statSync, openSync, readSync, closeSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { basename, join, resolve } from 'node:path';
|
|
4
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
5
|
+
import { openCodeAdapter } from './adapter.js';
|
|
6
|
+
import { readable } from './activity.js';
|
|
7
|
+
export const AGENTS = ['opencode', 'codex', 'jsonl'];
|
|
8
|
+
export async function agentAdapter(name, options = {}) {
|
|
9
|
+
if (name === 'opencode')
|
|
10
|
+
return openCodeAdapter(options.url);
|
|
11
|
+
if (name === 'codex')
|
|
12
|
+
return codexAdapter(options.events);
|
|
13
|
+
if (name === 'jsonl' && options.events)
|
|
14
|
+
return logAdapter(resolve(options.events), 'external', options.session);
|
|
15
|
+
throw new Error(`Choose --agent opencode, codex, or jsonl (--events FILE required for jsonl).`);
|
|
16
|
+
}
|
|
17
|
+
export function codexActivity(record, session) {
|
|
18
|
+
const p = record.payload ?? {}, a = { agent: 'Codex', session, id: p.call_id ?? p.id ?? p.turn_id ?? record.timestamp ?? 'event', kind: 'notice', root: true };
|
|
19
|
+
if (record.type === 'event_msg') {
|
|
20
|
+
const states = { task_started: 'Running', task_complete: 'Completed', turn_aborted: 'Stopped', task_failed: 'Failed' };
|
|
21
|
+
if (states[p.type])
|
|
22
|
+
return { ...a, kind: 'status', state: states[p.type] };
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (record.type !== 'response_item')
|
|
26
|
+
return;
|
|
27
|
+
if (p.type === 'message' && p.role === 'assistant')
|
|
28
|
+
return { ...a, kind: 'text', phase: 'end', text: readable(p.content) };
|
|
29
|
+
if (p.type === 'reasoning') {
|
|
30
|
+
const text = readable(p.summary);
|
|
31
|
+
return text ? { ...a, kind: 'thought', phase: 'end', text } : undefined;
|
|
32
|
+
}
|
|
33
|
+
if (['function_call', 'custom_tool_call'].includes(p.type)) {
|
|
34
|
+
let input = p.arguments ?? p.input;
|
|
35
|
+
if (typeof input === 'string') {
|
|
36
|
+
try {
|
|
37
|
+
input = JSON.parse(input);
|
|
38
|
+
}
|
|
39
|
+
catch { }
|
|
40
|
+
}
|
|
41
|
+
return { ...a, kind: 'tool', title: p.name, input: readable(input), state: 'Running' };
|
|
42
|
+
}
|
|
43
|
+
if (['function_call_output', 'custom_tool_call_output'].includes(p.type)) {
|
|
44
|
+
let output = p.output;
|
|
45
|
+
if (typeof output === 'string') {
|
|
46
|
+
try {
|
|
47
|
+
const parsed = JSON.parse(output);
|
|
48
|
+
if (parsed.output !== undefined)
|
|
49
|
+
output = parsed.output;
|
|
50
|
+
}
|
|
51
|
+
catch { }
|
|
52
|
+
}
|
|
53
|
+
return { ...a, kind: 'tool', text: readable(output), state: 'Completed' };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function activityRecord(record) {
|
|
57
|
+
const a = record.activity ?? record;
|
|
58
|
+
if (!a || !['text', 'thought', 'tool', 'status', 'notice'].includes(a.kind) || typeof a.agent !== 'string' || typeof a.session !== 'string' || typeof a.id !== 'string')
|
|
59
|
+
return;
|
|
60
|
+
for (const key of ['text', 'title', 'input', 'state'])
|
|
61
|
+
if (a[key] !== undefined && typeof a[key] !== 'string')
|
|
62
|
+
return;
|
|
63
|
+
if (a.phase !== undefined && !['start', 'delta', 'end'].includes(a.phase))
|
|
64
|
+
return;
|
|
65
|
+
return a;
|
|
66
|
+
}
|
|
67
|
+
export function logAdapter(path, mode, sessionHint = 'external') {
|
|
68
|
+
let session = sessionHint;
|
|
69
|
+
if (mode === 'codex') {
|
|
70
|
+
const fd = openSync(path, 'r');
|
|
71
|
+
const head = Buffer.alloc(64 * 1024);
|
|
72
|
+
const length = readSync(fd, head, 0, head.length, 0);
|
|
73
|
+
closeSync(fd);
|
|
74
|
+
const meta = JSON.parse(head.subarray(0, length).toString('utf8').split('\n')[0]);
|
|
75
|
+
session = meta.payload?.id ?? sessionHint;
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
async sessions() { return [{ id: session, name: `${mode === 'codex' ? 'Codex' : 'External agent'} · ${basename(path)}` }]; },
|
|
79
|
+
async *watch(selected, signal) {
|
|
80
|
+
let offset = statSync(path).size, pending = Buffer.alloc(0), offline = false;
|
|
81
|
+
while (!signal.aborted) {
|
|
82
|
+
try {
|
|
83
|
+
const size = statSync(path).size;
|
|
84
|
+
if (size < offset) {
|
|
85
|
+
offset = 0;
|
|
86
|
+
pending = Buffer.alloc(0);
|
|
87
|
+
}
|
|
88
|
+
if (size > offset) {
|
|
89
|
+
const fd = openSync(path, 'r');
|
|
90
|
+
const bytes = Buffer.alloc(Math.min(size - offset, 512 * 1024));
|
|
91
|
+
let count;
|
|
92
|
+
try {
|
|
93
|
+
count = readSync(fd, bytes, 0, bytes.length, offset);
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
closeSync(fd);
|
|
97
|
+
}
|
|
98
|
+
offset += count;
|
|
99
|
+
pending = Buffer.concat([pending, bytes.subarray(0, count)]);
|
|
100
|
+
let end;
|
|
101
|
+
while ((end = pending.indexOf(10)) >= 0) {
|
|
102
|
+
const line = pending.subarray(0, end).toString('utf8');
|
|
103
|
+
pending = pending.subarray(end + 1);
|
|
104
|
+
if (!line.trim())
|
|
105
|
+
continue;
|
|
106
|
+
const record = JSON.parse(line);
|
|
107
|
+
const activity = mode === 'codex' ? codexActivity(record, session) : activityRecord(record);
|
|
108
|
+
if (activity && activity.session === selected)
|
|
109
|
+
yield { type: 'activity', created: Date.parse(record.timestamp) || Date.now(), activity };
|
|
110
|
+
}
|
|
111
|
+
if (pending.length > 16 * 1024 * 1024)
|
|
112
|
+
throw new Error('Source record too large.');
|
|
113
|
+
}
|
|
114
|
+
offline = false;
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
if (!offline)
|
|
118
|
+
yield { type: 'activity', created: Date.now(), activity: { agent: mode === 'codex' ? 'Codex' : 'External agent', session: selected, id: 'source-offline', kind: 'status', state: 'Offline', root: true } };
|
|
119
|
+
offline = true;
|
|
120
|
+
}
|
|
121
|
+
await delay(150, undefined, { signal }).catch(() => { });
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export function codexAdapter(explicit) {
|
|
127
|
+
if (explicit)
|
|
128
|
+
return logAdapter(resolve(explicit), 'codex');
|
|
129
|
+
const root = join(process.env.CODEX_HOME ?? join(homedir(), '.codex'), 'sessions');
|
|
130
|
+
if (!existsSync(root))
|
|
131
|
+
throw new Error('No Codex session logs found. Use --events FILE for an existing session log.');
|
|
132
|
+
const files = readdirSync(root, { recursive: true }).filter(f => typeof f === 'string' && f.endsWith('.jsonl')).map(f => join(root, String(f)))
|
|
133
|
+
.sort((a, b) => statSync(b).mtimeMs - statSync(a).mtimeMs).slice(0, 100);
|
|
134
|
+
const adapters = files.map(file => logAdapter(file, 'codex'));
|
|
135
|
+
const bySession = new Map();
|
|
136
|
+
return {
|
|
137
|
+
async sessions() { const sessions = []; for (const adapter of adapters) {
|
|
138
|
+
for (const s of await adapter.sessions()) {
|
|
139
|
+
bySession.set(s.id, adapter);
|
|
140
|
+
sessions.push(s);
|
|
141
|
+
}
|
|
142
|
+
} return sessions; },
|
|
143
|
+
watch(session, signal) { const adapter = bySession.get(session); if (!adapter)
|
|
144
|
+
throw new Error('Codex session not found.'); return adapter.watch(session, signal); },
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../src/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAgB,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzG,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAqB,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAiB,MAAM,eAAe,CAAC;AAGxD,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,CAAU,CAAC;AAC9D,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,UAA+D,EAAE;IAChH,IAAI,IAAI,KAAK,UAAU;QAAE,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7D,IAAI,IAAI,KAAK,OAAO;QAAE,OAAO,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1D,IAAI,IAAI,KA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