@elizaos/plugin-trajectory-logger 2.0.0-alpha.8 → 2.0.11-beta.7

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shaw Walters and elizaOS Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # @elizaos/plugin-trajectory-logger
2
+
3
+ A developer plugin for elizaOS that provides a realtime trajectory inspector, showing the agent's active and last-completed turns broken down by phase: **HANDLE → PLAN → ACTION → EVALUATE**.
4
+
5
+ ## What it does
6
+
7
+ When installed, the plugin adds an overlay view to the elizaOS UI. The view polls the trajectory API every 700 ms and displays two side-by-side strips:
8
+
9
+ - **Current turn** — the in-flight trajectory, with the active phase pulsing.
10
+ - **Last turn** — the most recently completed trajectory.
11
+
12
+ Clicking any phase chip expands a drilldown showing LLM calls, provider accesses, tool events, or evaluator results depending on the phase.
13
+
14
+ A **TUI variant** is also registered for terminal environments, supporting the `list-trajectories`, `open-latest`, `filter-phase`, and `refresh` capabilities.
15
+
16
+ ## Phases
17
+
18
+ | Phase | What it covers |
19
+ |---|---|
20
+ | HANDLE | `should_respond` and `compose_state` LLM calls; provider context accesses |
21
+ | PLAN | Reasoning, response, and action LLM calls |
22
+ | ACTION | Tool/action execution events (call, result, error, duration) |
23
+ | EVALUATE | Evaluator LLM calls and evaluation events with decisions |
24
+
25
+ ## Requirements
26
+
27
+ - **`@elizaos/plugin-training`** must be loaded alongside this plugin. It serves the `/api/trajectories` and `/api/trajectories/:id` routes that this inspector reads from. Without it, the view shows a fetch error.
28
+
29
+ ## Installation
30
+
31
+ Add the plugin to your agent character file:
32
+
33
+ ```json
34
+ {
35
+ "plugins": ["@elizaos/plugin-trajectory-logger"]
36
+ }
37
+ ```
38
+
39
+ Or register it programmatically:
40
+
41
+ ```ts
42
+ import trajectoryLoggerPlugin from "@elizaos/plugin-trajectory-logger";
43
+
44
+ const agent = new AgentRuntime({
45
+ plugins: [trajectoryLoggerPlugin],
46
+ // ...
47
+ });
48
+ ```
49
+
50
+ ## Configuration
51
+
52
+ No environment variables or settings are required. The plugin reads data from the running elizaOS API server.
53
+
54
+ ## Exported API
55
+
56
+ The package entry (`@elizaos/plugin-trajectory-logger`) re-exports, in addition to the default plugin:
57
+
58
+ - `summarizePhases(detail, options)` — maps a `TrajectoryDetail` into `PhaseSummary[]` with status and summary text per phase.
59
+ - `PHASES` — readonly array `["HANDLE", "PLAN", "ACTION", "EVALUATE"]` (typed `readonly PhaseName[]`).
60
+ - `TrajectoryLoggerView` — the React overlay component.
61
+ - `registerTrajectoryLoggerApp()` — registers the overlay app in the `@elizaos/ui` overlay registry (called automatically on plugin load via `register.ts`).
62
+ - `trajectoryLoggerApp` / `TRAJECTORY_LOGGER_APP_NAME` — the `OverlayApp` definition and its name.
63
+ - Types: `TrajectoryDetail`, `TrajectoryListItem`, `PhaseName`, `PhaseStatus`, `PhaseSummary`.
64
+
65
+ The typed fetch helpers (`fetchTrajectoryList`, `fetchTrajectoryDetail`, `purgeTrajectory`, `fetchTrajectoryExport`) live in `src/api-client.ts` and are reachable via the `@elizaos/plugin-trajectory-logger/api-client` subpath, not the main entry. `fetchTrajectoryExport` returns the `/export` archive as a `Blob`.
66
+
67
+ ## Privacy
68
+
69
+ Trajectory logging is controlled by the elizaOS runtime (see `ELIZA_DISABLE_TRAJECTORY_LOGGING=1` to disable). This plugin only reads and displays existing trajectory data — it does not write or enable logging on its own.
Binary file
package/package.json CHANGED
@@ -1,89 +1,76 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-trajectory-logger",
3
- "description": "Trajectory logging plugin for ElizaOS - capture agent interaction trajectories for RL training",
4
- "version": "2.0.0-alpha.8",
3
+ "version": "2.0.11-beta.7",
5
4
  "type": "module",
6
- "main": "dist/node/index.node.js",
7
- "module": "dist/node/index.node.js",
8
- "types": "dist/index.d.ts",
9
- "packageType": "plugin",
10
- "platform": "node",
11
- "license": "MIT",
12
- "author": "elizaOS",
13
- "keywords": [
14
- "plugin",
15
- "elizaos",
16
- "trajectory",
17
- "rl",
18
- "training",
19
- "logging"
20
- ],
21
- "repository": {
22
- "type": "git",
23
- "url": "https://github.com/elizaos/elizaos"
24
- },
25
- "homepage": "https://elizaos.ai",
5
+ "description": "Realtime trajectory inspector overlay app — surfaces the last completed and the in-flight trajectory with HANDLE / PLAN / ACTION / EVALUATE phase drilldowns.",
6
+ "main": "./dist/index.js",
26
7
  "exports": {
27
8
  "./package.json": "./package.json",
28
9
  ".": {
29
10
  "types": "./dist/index.d.ts",
30
- "node": {
31
- "types": "./dist/index.d.ts",
32
- "import": "./dist/node/index.node.js",
33
- "default": "./dist/node/index.node.js"
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./plugin": {
15
+ "eliza-source": {
16
+ "types": "./src/plugin.ts",
17
+ "import": "./src/plugin.ts",
18
+ "default": "./src/plugin.ts"
34
19
  },
35
20
  "bun": {
36
- "types": "./dist/index.d.ts",
37
- "default": "./dist/node/index.node.js"
21
+ "types": "./src/plugin.ts",
22
+ "import": "./src/plugin.ts",
23
+ "default": "./src/plugin.ts"
38
24
  },
39
- "default": "./dist/node/index.node.js"
25
+ "import": "./dist/plugin.js",
26
+ "default": "./dist/plugin.js",
27
+ "types": "./dist/plugin.d.ts"
28
+ },
29
+ "./*.css": "./dist/*.css",
30
+ "./*": {
31
+ "types": "./dist/*.d.ts",
32
+ "import": "./dist/*.js",
33
+ "default": "./dist/*.js"
40
34
  }
41
35
  },
42
- "files": [
43
- "dist",
44
- "README.md"
45
- ],
46
- "sideEffects": false,
36
+ "scripts": {
37
+ "typecheck": "tsgo --noEmit -p tsconfig.json",
38
+ "lint": "bunx @biomejs/biome check src",
39
+ "test": "bunx vitest run --config ./vitest.config.ts",
40
+ "build": "bun run build:js && bun run build:views && bun run build:types",
41
+ "clean": "rm -rf dist",
42
+ "build:js": "tsup --config ../tsup.plugin-packages.shared.ts",
43
+ "build:views": "bunx --bun vite build --config vite.config.views.ts",
44
+ "build:types": "tsc --noCheck -p tsconfig.build.json"
45
+ },
47
46
  "dependencies": {
48
- "@elizaos/core": "2.0.0-alpha.3",
49
- "uuid": "^13.0.0"
47
+ "@elizaos/app-core": "2.0.11-beta.7",
48
+ "@elizaos/core": "2.0.11-beta.7",
49
+ "@elizaos/ui": "2.0.11-beta.7",
50
+ "lucide-react": "^1.0.0"
50
51
  },
51
- "devDependencies": {
52
- "@biomejs/biome": "^2.3.11",
53
- "@types/bun": "^1.3.5",
54
- "@types/node": "^25.0.3",
55
- "@types/uuid": "^11.0.0",
56
- "typescript": "^5.9.3"
52
+ "peerDependencies": {
53
+ "react": "^19.0.0",
54
+ "react-dom": "^19.0.0"
57
55
  },
58
- "scripts": {
59
- "dev": "bun --hot build.ts",
60
- "clean": "rm -rf dist .turbo node_modules tsconfig.tsbuildinfo",
61
- "format": "bunx @biomejs/biome format --write .",
62
- "format:check": "bunx @biomejs/biome format .",
63
- "typecheck": "tsc --noEmit -p tsconfig.json",
64
- "test": "vitest run tests/",
65
- "test:unit": "vitest run tests/",
66
- "test:watch": "vitest",
67
- "lint": "bunx @biomejs/biome check --write --unsafe .",
68
- "lint:check": "bunx @biomejs/biome check .",
69
- "build": "bun run build.ts",
70
- "build:ts": "bun run build.ts"
56
+ "elizaos": {
57
+ "app": {
58
+ "displayName": "Trajectory Logger",
59
+ "category": "developer",
60
+ "heroImage": "assets/hero.png"
61
+ }
71
62
  },
72
63
  "publishConfig": {
73
64
  "access": "public"
74
65
  },
75
- "agentConfig": {
76
- "pluginType": "elizaos:plugin:1.0.0",
77
- "pluginParameters": {},
78
- "description": "Collects complete agent interaction trajectories for RL training."
66
+ "types": "./dist/index.d.ts",
67
+ "files": [
68
+ "dist",
69
+ "assets"
70
+ ],
71
+ "devDependencies": {
72
+ "tsup": "^8.5.1",
73
+ "vite": "^8.0.0"
79
74
  },
80
- "milady": {
81
- "platforms": [
82
- "node"
83
- ],
84
- "runtime": "node",
85
- "platformDetails": {
86
- "node": "Node.js only (platform: node)"
87
- }
88
- }
75
+ "gitHead": "cdbc876f793d96073d7eb0d09715a031ce0cd32e"
89
76
  }