-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(agent-tracing): add @eggjs/agent-tracing package for AI agent tracing #5822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jerryliang64
wants to merge
19
commits into
next
Choose a base branch
from
feat/agent-tracing
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,763
−175
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
7f4c3ba
feat(agent-tracing): add @eggjs/agent-tracing package for AI agent tr…
jerryliang64 9818618
refactor(agent-tracing): rename test files to PascalCase and clean up…
jerryliang64 547bafe
fix(deps): bump @langchain/core to ^1.1.29 and dedupe lockfile
jerryliang64 91efaea
refactor(agent-tracing): replace ali-oss direct dependency with IOssC…
jerryliang64 04b0c9a
refactor(agent-tracing): replace logService config with ILogServiceCl…
jerryliang64 4a583e1
fix(deps): sync pnpm-lock.yaml with agent-tracing package.json
jerryliang64 d455b1c
refactor(agent-tracing): apply code review fixes
jerryliang64 054f009
test(agent-tracing): improve coverage for TracingService and LangGrap…
jerryliang64 551a1c4
fix(agent-tracing): use Date.now() for child run timestamps in TraceS…
jerryliang64 b7fb285
test(agent-tracing): improve coverage for ClaudeAgentTracer and Traci…
jerryliang64 81ddf29
style(agent-tracing): fix oxfmt formatting in test file
jerryliang64 3c535cd
refactor(agent-tracing): address PR review feedback
jerryliang64 0e8c85c
fix(agent-tracing): populate thread_id from session_id in ClaudeAgent…
jerryliang64 3c246f6
style(agent-tracing): fix oxfmt formatting in types.ts
jerryliang64 f2264f8
chore(deps): sync pnpm-lock.yaml after rebase on next
jerryliang64 4de046d
chore(agent-tracing): bump version to 4.0.2-beta.3 to align with othe…
jerryliang64 1e52c2a
refactor(agent-tracing): deduplicate mock Run factories and remove un…
jerryliang64 e51da49
refactor(agent-tracing): make sub-entries self-contained with re-exports
jerryliang64 e39953d
Merge branch 'next' into feat/agent-tracing
jerryliang64 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| { | ||
| "name": "@eggjs/agent-tracing", | ||
| "version": "4.0.2-beta.3", | ||
| "description": "Tracing support for AI agents (LangGraph, Claude Agent SDK)", | ||
| "keywords": [ | ||
| "agent", | ||
| "claude", | ||
| "egg", | ||
| "langchain", | ||
| "langgraph", | ||
| "tegg", | ||
| "tracing", | ||
| "typescript" | ||
| ], | ||
| "homepage": "https://github.com/eggjs/egg/tree/next/tegg/core/agent-tracing", | ||
| "bugs": { | ||
| "url": "https://github.com/eggjs/egg/issues" | ||
| }, | ||
| "license": "MIT", | ||
| "author": "killagu <killa123@126.com>", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/eggjs/egg.git", | ||
| "directory": "tegg/core/agent-tracing" | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "type": "module", | ||
| "main": "./dist/index.js", | ||
| "module": "./dist/index.js", | ||
| "types": "./dist/index.d.ts", | ||
| "exports": { | ||
| ".": "./src/index.ts", | ||
| "./claude": "./src/claude.ts", | ||
| "./langgraph": "./src/langgraph.ts", | ||
| "./package.json": "./package.json" | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public", | ||
| "exports": { | ||
| ".": "./dist/index.js", | ||
| "./claude": "./dist/claude.js", | ||
| "./langgraph": "./dist/langgraph.js", | ||
| "./package.json": "./package.json" | ||
| } | ||
| }, | ||
| "scripts": { | ||
| "typecheck": "tsgo --noEmit", | ||
| "test": "vitest run" | ||
| }, | ||
| "dependencies": { | ||
| "@eggjs/background-task": "workspace:*", | ||
| "@eggjs/core-decorator": "workspace:*", | ||
| "@eggjs/tegg-types": "workspace:*", | ||
| "onelogger": "catalog:" | ||
| }, | ||
| "devDependencies": { | ||
| "@anthropic-ai/claude-agent-sdk": "^0.2.52", | ||
| "@anthropic-ai/sdk": "^0.78.0", | ||
| "@eggjs/tegg-common-util": "workspace:*", | ||
| "@langchain/core": "^1.1.29", | ||
| "@langchain/langgraph": "^0.2.74", | ||
| "@types/node": "catalog:", | ||
| "typescript": "catalog:" | ||
| }, | ||
| "peerDependencies": { | ||
| "@anthropic-ai/claude-agent-sdk": ">=0.2.52", | ||
| "@langchain/core": "^1.1.29" | ||
| }, | ||
| "peerDependenciesMeta": { | ||
| "@anthropic-ai/claude-agent-sdk": { | ||
| "optional": true | ||
| }, | ||
| "@langchain/core": { | ||
| "optional": true | ||
| } | ||
| }, | ||
| "engines": { | ||
| "node": ">=22.18.0" | ||
| }, | ||
| "eggModule": { | ||
| "name": "teggAgentTracing" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /** | ||
| * Abstract log service client for dependency injection. | ||
| * | ||
| * To enable log service syncing in TracingService, implement this class in your application | ||
| * and register it with Tegg IoC. The implementation class MUST be named `LogServiceClient` | ||
| * (or use `@SingletonProto({ name: 'logServiceClient' })`) so the container can resolve it. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { SingletonProto } from '@eggjs/core-decorator'; | ||
| * import { AccessLevel } from '@eggjs/tegg-types'; | ||
| * import { AbstractLogServiceClient } from '@eggjs/agent-tracing'; | ||
| * | ||
| * // Class name must be LogServiceClient (registers as 'logServiceClient' in the IoC container) | ||
| * @SingletonProto({ accessLevel: AccessLevel.PUBLIC }) | ||
| * export class LogServiceClient extends AbstractLogServiceClient { | ||
| * async send(log: string): Promise<void> { | ||
| * await fetch('https://log.example.com/api', { | ||
| * method: 'POST', | ||
| * headers: { 'content-type': 'application/json' }, | ||
| * body: JSON.stringify({ log }), | ||
| * }); | ||
| * } | ||
| * } | ||
| * ``` | ||
| * | ||
| * If no implementation is registered, log service syncing is silently skipped. | ||
| */ | ||
| export abstract class AbstractLogServiceClient { | ||
| abstract send(log: string): Promise<void>; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ixxx 是否为当前项目的 interface 命名风格? |
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| /** | ||
| * Abstract OSS client for dependency injection. | ||
| * | ||
| * To enable OSS uploads in TracingService, implement this class in your application | ||
| * and register it with Tegg IoC. The implementation class MUST be named `OssClient` | ||
| * (or use `@SingletonProto({ name: 'ossClient' })`) so the container can resolve it. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { SingletonProto } from '@eggjs/core-decorator'; | ||
| * import { AccessLevel } from '@eggjs/tegg-types'; | ||
| * import { AbstractOssClient } from '@eggjs/agent-tracing'; | ||
| * | ||
| * // Class name must be OssClient (registers as 'ossClient' in the IoC container) | ||
| * @SingletonProto({ accessLevel: AccessLevel.PUBLIC }) | ||
| * export class OssClient extends AbstractOssClient { | ||
| * async put(key: string, content: string | Buffer): Promise<void> { | ||
| * // your OSS implementation here | ||
| * } | ||
| * } | ||
| * ``` | ||
| * | ||
| * If no implementation is registered, OSS uploads are silently skipped. | ||
| */ | ||
| export abstract class AbstractOssClient { | ||
| abstract put(key: string, content: string | Buffer): Promise<void>; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.