@axonpush/wizard 0.0.5 → 0.0.6
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/README.md +30 -11
- package/dist/bin.js +21632 -12151
- package/package.json +44 -5
- package/skills/anthropic/SKILL.md +4 -0
- package/skills/crewai/SKILL.md +4 -0
- package/skills/{core → custom}/SKILL.md +8 -4
- package/skills/deepagents/SKILL.md +61 -0
- package/skills/langchain/SKILL.md +4 -0
- package/skills/openai-agents/SKILL.md +4 -0
- package/skills/otel-python/SKILL.md +96 -0
- package/skills/otel-ts/SKILL.md +89 -0
- package/skills/ts-anthropic/SKILL.md +51 -0
- package/skills/ts-custom/SKILL.md +46 -0
- package/skills/ts-google-adk/SKILL.md +52 -0
- package/skills/ts-langchain/SKILL.md +50 -0
- package/skills/ts-langgraph/SKILL.md +46 -0
- package/skills/ts-llamaindex/SKILL.md +52 -0
- package/skills/ts-mastra/SKILL.md +51 -0
- package/skills/ts-openai-agents/SKILL.md +45 -0
- package/skills/ts-vercel-ai/SKILL.md +52 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axonpush/wizard",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "AI-powered wizard to integrate AxonPush into your AI agent project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -17,16 +17,55 @@
|
|
|
17
17
|
"start": "bun dist/bin.js",
|
|
18
18
|
"typecheck": "tsc --noEmit"
|
|
19
19
|
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/axonpush/wizard"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"axonpush",
|
|
26
|
+
"observability",
|
|
27
|
+
"tracing",
|
|
28
|
+
"opentelemetry",
|
|
29
|
+
"otel",
|
|
30
|
+
"ai",
|
|
31
|
+
"agents",
|
|
32
|
+
"ai-agents",
|
|
33
|
+
"llm",
|
|
34
|
+
"sdk",
|
|
35
|
+
"wizard",
|
|
36
|
+
"cli",
|
|
37
|
+
"langchain",
|
|
38
|
+
"langgraph",
|
|
39
|
+
"openai",
|
|
40
|
+
"openai-agents",
|
|
41
|
+
"anthropic",
|
|
42
|
+
"claude",
|
|
43
|
+
"vercel-ai",
|
|
44
|
+
"mastra",
|
|
45
|
+
"crewai",
|
|
46
|
+
"llamaindex",
|
|
47
|
+
"google-adk",
|
|
48
|
+
"logging",
|
|
49
|
+
"pino",
|
|
50
|
+
"winston",
|
|
51
|
+
"loguru",
|
|
52
|
+
"structlog",
|
|
53
|
+
"typescript",
|
|
54
|
+
"python"
|
|
55
|
+
],
|
|
20
56
|
"dependencies": {
|
|
21
57
|
"@anthropic-ai/claude-agent-sdk": "^0.2.87",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
58
|
+
"ink": "^6.8.0",
|
|
59
|
+
"ink-select-input": "^6.2.0",
|
|
60
|
+
"ink-spinner": "^5.0.0",
|
|
61
|
+
"ink-text-input": "^6.0.0",
|
|
62
|
+
"js-toml": "^1.0.3",
|
|
63
|
+
"react": "^19.2.4",
|
|
25
64
|
"yargs": "^17.7.2"
|
|
26
65
|
},
|
|
27
66
|
"devDependencies": {
|
|
28
67
|
"@types/bun": "latest",
|
|
29
|
-
"@types/
|
|
68
|
+
"@types/react": "^19.2.14",
|
|
30
69
|
"@types/yargs": "^17.0.33",
|
|
31
70
|
"typescript": "^5.7.0"
|
|
32
71
|
}
|
|
@@ -50,3 +50,7 @@ tracer = AxonPushAnthropicTracer(
|
|
|
50
50
|
4. Add imports and create the tracer
|
|
51
51
|
5. Replace `anthropic_client.messages.create(...)` with `tracer.create_message(anthropic_client, ...)`
|
|
52
52
|
6. For tool results, add `tracer.send_tool_result(tool_use_id, result)` calls
|
|
53
|
+
|
|
54
|
+
## Fail-Open
|
|
55
|
+
|
|
56
|
+
The SDK is fail-open by default (`fail_open=True`). If AxonPush is unreachable, tracing calls are silently suppressed — the Anthropic integration will never crash or block the user's application.
|
package/skills/crewai/SKILL.md
CHANGED
|
@@ -52,3 +52,7 @@ axonpush_callbacks = AxonPushCrewCallbacks(
|
|
|
52
52
|
5. Add `step_callback=axonpush_callbacks.on_step` and `task_callback=axonpush_callbacks.on_task_complete` to `Crew()`
|
|
53
53
|
6. Add `axonpush_callbacks.on_crew_start()` before `crew.kickoff()`
|
|
54
54
|
7. Add `axonpush_callbacks.on_crew_end(result)` after
|
|
55
|
+
|
|
56
|
+
## Fail-Open
|
|
57
|
+
|
|
58
|
+
The SDK is fail-open by default (`fail_open=True`). If AxonPush is unreachable, tracing callbacks are silently suppressed — the CrewAI integration will never crash or block the user's application.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description: Integrate AxonPush event publishing directly
|
|
2
|
+
name: custom
|
|
3
|
+
description: Integrate AxonPush event publishing directly for custom or unsupported frameworks
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# AxonPush
|
|
6
|
+
# AxonPush Custom Framework Integration
|
|
7
7
|
|
|
8
|
-
Integrate AxonPush event publishing directly
|
|
8
|
+
Integrate AxonPush event publishing directly for custom or unsupported frameworks.
|
|
9
9
|
|
|
10
10
|
## What gets added
|
|
11
11
|
|
|
@@ -41,3 +41,7 @@ axonpush_client = AxonPush(
|
|
|
41
41
|
3. Find the main entry point of the project
|
|
42
42
|
4. Add imports and create the client as a module-level singleton
|
|
43
43
|
5. Add example publish calls at key points (e.g., start, end, error handling)
|
|
44
|
+
|
|
45
|
+
## Fail-Open
|
|
46
|
+
|
|
47
|
+
The SDK is fail-open by default (`fail_open=True`). If AxonPush is unreachable, publish calls return `None` instead of raising — the SDK will never crash or block the user's application.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deepagents
|
|
3
|
+
description: Integrate AxonPush tracing into a LangChain Deep Agents project
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AxonPush + Deep Agents Integration
|
|
7
|
+
|
|
8
|
+
Integrate AxonPush tracing into a project using LangChain Deep Agents (`deepagents` package).
|
|
9
|
+
|
|
10
|
+
## What gets added
|
|
11
|
+
|
|
12
|
+
- `AxonPushDeepAgentHandler` that auto-traces chain/LLM/tool lifecycle events with Deep Agent-specific awareness
|
|
13
|
+
- Planning events: `planning.update`, `planning.complete` (when `write_todos` is called)
|
|
14
|
+
- Subagent events: `subagent.spawn`, `subagent.complete` (when `task` tool delegates work)
|
|
15
|
+
- Filesystem events: `filesystem.read`, `filesystem.write` (for `read_file`, `write_file`, `edit_file`, `ls`, `glob`, `grep`)
|
|
16
|
+
- Sandbox events: `sandbox.execute` (for `execute` tool)
|
|
17
|
+
- Standard events: `chain.start/end`, `llm.start/end`, `tool.*.start`, `tool.end`
|
|
18
|
+
|
|
19
|
+
## Reference Code
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
import os
|
|
23
|
+
from deepagents import create_deep_agent
|
|
24
|
+
from axonpush import AxonPush
|
|
25
|
+
from axonpush.integrations.deepagents import AxonPushDeepAgentHandler
|
|
26
|
+
|
|
27
|
+
axonpush_client = AxonPush(
|
|
28
|
+
api_key=os.environ["AXONPUSH_API_KEY"],
|
|
29
|
+
tenant_id=os.environ["AXONPUSH_TENANT_ID"],
|
|
30
|
+
base_url=os.environ.get("AXONPUSH_BASE_URL", "https://api.axonpush.xyz"),
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
axonpush_handler = AxonPushDeepAgentHandler(
|
|
34
|
+
client=axonpush_client,
|
|
35
|
+
channel_id=int(os.environ["AXONPUSH_CHANNEL_ID"]),
|
|
36
|
+
agent_id="deep-agent",
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
agent = create_deep_agent(
|
|
40
|
+
tools=[],
|
|
41
|
+
system_prompt="You are a helpful assistant.",
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
# Run with AxonPush tracing
|
|
45
|
+
result = agent.invoke(
|
|
46
|
+
{"messages": [{"role": "user", "content": "Research AI frameworks"}]},
|
|
47
|
+
config={"callbacks": [axonpush_handler]},
|
|
48
|
+
)
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Steps
|
|
52
|
+
|
|
53
|
+
1. Install `axonpush[deepagents]` using the project's package manager
|
|
54
|
+
2. Add AXONPUSH_API_KEY, AXONPUSH_TENANT_ID, AXONPUSH_BASE_URL, AXONPUSH_CHANNEL_ID to .env
|
|
55
|
+
3. Find the main file where `create_deep_agent()` or `agent.invoke()` is called
|
|
56
|
+
4. Add the imports and client initialization (as module-level code)
|
|
57
|
+
5. Add `config={"callbacks": [axonpush_handler]}` to `.invoke()` calls
|
|
58
|
+
|
|
59
|
+
## Fail-Open
|
|
60
|
+
|
|
61
|
+
The SDK is fail-open by default (`fail_open=True`). If AxonPush is unreachable, tracing callbacks are silently suppressed — the Deep Agents integration will never crash or block the user's application.
|
|
@@ -45,3 +45,7 @@ axonpush_handler = AxonPushCallbackHandler(
|
|
|
45
45
|
3. Find the main file where chains/agents are invoked
|
|
46
46
|
4. Add the imports and client initialization (as module-level code)
|
|
47
47
|
5. Add `config={"callbacks": [axonpush_handler]}` to `.invoke()` calls
|
|
48
|
+
|
|
49
|
+
## Fail-Open
|
|
50
|
+
|
|
51
|
+
The SDK is fail-open by default (`fail_open=True`). If AxonPush is unreachable, tracing callbacks are silently suppressed — the LangChain integration will never crash or block the user's application.
|
|
@@ -47,3 +47,7 @@ axonpush_hooks = AxonPushRunHooks(
|
|
|
47
47
|
- OpenAI Agents SDK is **async-only**, so use `AsyncAxonPush` (not `AxonPush`)
|
|
48
48
|
- Make sure to close the client when done: `await axonpush_client.close()`
|
|
49
49
|
- Or use `async with AsyncAxonPush(...) as client:` context manager
|
|
50
|
+
|
|
51
|
+
## Fail-Open
|
|
52
|
+
|
|
53
|
+
The SDK is fail-open by default (`fail_open=True`). If AxonPush is unreachable, tracing hooks are silently suppressed — the OpenAI Agents integration will never crash or block the user's application.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: otel-python
|
|
3
|
+
description: Wire AxonPushSpanExporter into a Python project's OpenTelemetry TracerProvider
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AxonPush + OpenTelemetry (Python) Integration
|
|
7
|
+
|
|
8
|
+
Forward OpenTelemetry spans from a Python service into AxonPush via `AxonPushSpanExporter`.
|
|
9
|
+
|
|
10
|
+
## What gets added
|
|
11
|
+
|
|
12
|
+
- `AxonPushSpanExporter` attached to the project's `TracerProvider` through a `BatchSpanProcessor`
|
|
13
|
+
- Every OTel span is re-emitted as an `app.span` event with full trace_id, span_id, attributes, events, and links preserved
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
Requires the `otel` extra:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install "axonpush[otel]"
|
|
21
|
+
# or: uv add "axonpush[otel]"
|
|
22
|
+
# or: poetry add "axonpush[otel]"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Reference Code — New Provider
|
|
26
|
+
|
|
27
|
+
Use this path when the project does **not** already have a `TracerProvider`.
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
import os
|
|
31
|
+
from opentelemetry import trace
|
|
32
|
+
from opentelemetry.sdk.resources import Resource
|
|
33
|
+
from opentelemetry.sdk.trace import TracerProvider
|
|
34
|
+
from opentelemetry.sdk.trace.export import BatchSpanProcessor
|
|
35
|
+
|
|
36
|
+
from axonpush import AxonPush
|
|
37
|
+
from axonpush.integrations.otel import AxonPushSpanExporter
|
|
38
|
+
|
|
39
|
+
axonpush_client = AxonPush(
|
|
40
|
+
api_key=os.environ["AXONPUSH_API_KEY"],
|
|
41
|
+
tenant_id=os.environ["AXONPUSH_TENANT_ID"],
|
|
42
|
+
base_url=os.environ.get("AXONPUSH_BASE_URL", "https://api.axonpush.xyz"),
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
provider = TracerProvider(resource=Resource.create({"service.name": "my-service"}))
|
|
46
|
+
provider.add_span_processor(
|
|
47
|
+
BatchSpanProcessor(
|
|
48
|
+
AxonPushSpanExporter(
|
|
49
|
+
client=axonpush_client,
|
|
50
|
+
channel_id=int(os.environ["AXONPUSH_CHANNEL_ID"]),
|
|
51
|
+
service_name="my-service",
|
|
52
|
+
)
|
|
53
|
+
)
|
|
54
|
+
)
|
|
55
|
+
trace.set_tracer_provider(provider)
|
|
56
|
+
|
|
57
|
+
tracer = trace.get_tracer(__name__)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Reference Code — Existing Provider
|
|
61
|
+
|
|
62
|
+
Use this path when the project already calls `trace.set_tracer_provider(...)` or uses an auto-instrumentation entrypoint. Never register a second global provider — attach to the existing one.
|
|
63
|
+
|
|
64
|
+
```python
|
|
65
|
+
from opentelemetry import trace
|
|
66
|
+
from opentelemetry.sdk.trace import TracerProvider
|
|
67
|
+
from opentelemetry.sdk.trace.export import BatchSpanProcessor
|
|
68
|
+
|
|
69
|
+
from axonpush import AxonPush
|
|
70
|
+
from axonpush.integrations.otel import AxonPushSpanExporter
|
|
71
|
+
|
|
72
|
+
provider = trace.get_tracer_provider()
|
|
73
|
+
if isinstance(provider, TracerProvider):
|
|
74
|
+
provider.add_span_processor(
|
|
75
|
+
BatchSpanProcessor(
|
|
76
|
+
AxonPushSpanExporter(
|
|
77
|
+
client=AxonPush(api_key=os.environ["AXONPUSH_API_KEY"], tenant_id=os.environ["AXONPUSH_TENANT_ID"]),
|
|
78
|
+
channel_id=int(os.environ["AXONPUSH_CHANNEL_ID"]),
|
|
79
|
+
service_name="my-service",
|
|
80
|
+
)
|
|
81
|
+
)
|
|
82
|
+
)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Steps
|
|
86
|
+
|
|
87
|
+
1. Install `axonpush[otel]` using the project's package manager
|
|
88
|
+
2. Add `AXONPUSH_API_KEY`, `AXONPUSH_TENANT_ID`, `AXONPUSH_BASE_URL`, `AXONPUSH_CHANNEL_ID` to `.env`
|
|
89
|
+
3. Detect whether a `TracerProvider` already exists in the project (search for `set_tracer_provider`, `TracerProvider(`, or auto-instrumentation setup in the main module)
|
|
90
|
+
4. If one exists, attach `AxonPushSpanExporter` to it via `BatchSpanProcessor`
|
|
91
|
+
5. If none exists, create one (see "New Provider") using the project name as `service.name`
|
|
92
|
+
6. Use `BatchSpanProcessor`, never `SimpleSpanProcessor`, in production
|
|
93
|
+
|
|
94
|
+
## Fail-Open
|
|
95
|
+
|
|
96
|
+
`AxonPush(fail_open=True)` is the default. If AxonPush is unreachable the exporter silently drops spans — no application impact.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: otel-ts
|
|
3
|
+
description: Wire AxonPushSpanExporter into a TypeScript/Node project's OpenTelemetry TracerProvider
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AxonPush + OpenTelemetry (TypeScript) Integration
|
|
7
|
+
|
|
8
|
+
Forward OpenTelemetry spans from a Node.js service into AxonPush via `AxonPushSpanExporter`.
|
|
9
|
+
|
|
10
|
+
## What gets added
|
|
11
|
+
|
|
12
|
+
- `AxonPushSpanExporter` attached to the project's `TracerProvider` through a `BatchSpanProcessor`
|
|
13
|
+
- Every OTel span is re-emitted as an `app.span` event with full traceId, spanId, attributes, events, and links preserved
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
`@opentelemetry/api` and `@opentelemetry/sdk-trace-base` are optional peer dependencies. Install them alongside `@axonpush/sdk`:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bun add @axonpush/sdk @opentelemetry/api @opentelemetry/sdk-trace-base @opentelemetry/sdk-trace-node
|
|
21
|
+
# or pnpm / yarn / npm equivalents
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Reference Code — New Provider
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import { AxonPush } from "@axonpush/sdk";
|
|
28
|
+
import { AxonPushSpanExporter } from "@axonpush/sdk/integrations/otel";
|
|
29
|
+
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
|
|
30
|
+
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
31
|
+
import { Resource } from "@opentelemetry/resources";
|
|
32
|
+
import { SemanticResourceAttributes } from "@opentelemetry/semantic-conventions";
|
|
33
|
+
|
|
34
|
+
const axonpush = new AxonPush({
|
|
35
|
+
apiKey: process.env.AXONPUSH_API_KEY!,
|
|
36
|
+
tenantId: process.env.AXONPUSH_TENANT_ID!,
|
|
37
|
+
baseUrl: process.env.AXONPUSH_BASE_URL,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const provider = new NodeTracerProvider({
|
|
41
|
+
resource: new Resource({ [SemanticResourceAttributes.SERVICE_NAME]: "my-service" }),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
provider.addSpanProcessor(
|
|
45
|
+
new BatchSpanProcessor(
|
|
46
|
+
new AxonPushSpanExporter({
|
|
47
|
+
client: axonpush,
|
|
48
|
+
channelId: Number(process.env.AXONPUSH_CHANNEL_ID),
|
|
49
|
+
serviceName: "my-service",
|
|
50
|
+
}),
|
|
51
|
+
),
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
provider.register();
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Reference Code — Existing Provider
|
|
58
|
+
|
|
59
|
+
Use this path when the project already registers a `TracerProvider` (e.g. via `provider.register()` or `@opentelemetry/sdk-node`). Attach to the existing provider rather than creating a second one.
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import { trace } from "@opentelemetry/api";
|
|
63
|
+
import { BatchSpanProcessor, BasicTracerProvider } from "@opentelemetry/sdk-trace-base";
|
|
64
|
+
import { AxonPushSpanExporter } from "@axonpush/sdk/integrations/otel";
|
|
65
|
+
|
|
66
|
+
const provider = trace.getTracerProvider() as unknown as BasicTracerProvider;
|
|
67
|
+
provider.addSpanProcessor(
|
|
68
|
+
new BatchSpanProcessor(
|
|
69
|
+
new AxonPushSpanExporter({
|
|
70
|
+
client: axonpush,
|
|
71
|
+
channelId: Number(process.env.AXONPUSH_CHANNEL_ID),
|
|
72
|
+
serviceName: "my-service",
|
|
73
|
+
}),
|
|
74
|
+
),
|
|
75
|
+
);
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Steps
|
|
79
|
+
|
|
80
|
+
1. Install `@axonpush/sdk @opentelemetry/api @opentelemetry/sdk-trace-base @opentelemetry/sdk-trace-node` using the project's package manager
|
|
81
|
+
2. Add `AXONPUSH_API_KEY`, `AXONPUSH_TENANT_ID`, `AXONPUSH_BASE_URL`, `AXONPUSH_CHANNEL_ID` to `.env`
|
|
82
|
+
3. Detect whether a `TracerProvider` already exists in the project (search for `provider.register()`, `NodeTracerProvider(`, `NodeSDK(`, or auto-instrumentation setup)
|
|
83
|
+
4. If one exists, attach `AxonPushSpanExporter` to it via `BatchSpanProcessor`
|
|
84
|
+
5. If none exists, create one (see "New Provider") using the project name as `service.name`
|
|
85
|
+
6. Use `BatchSpanProcessor`, never `SimpleSpanProcessor`, in production
|
|
86
|
+
|
|
87
|
+
## Fail-Open
|
|
88
|
+
|
|
89
|
+
`new AxonPush({ failOpen: true })` is the default. If AxonPush is unreachable the exporter silently drops spans — no application impact.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ts-anthropic
|
|
3
|
+
description: Integrate AxonPush tracing into a TypeScript Anthropic SDK project
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AxonPush + Anthropic/Claude (TypeScript) Integration
|
|
7
|
+
|
|
8
|
+
Integrate AxonPush tracing into a TypeScript project using the Anthropic SDK.
|
|
9
|
+
|
|
10
|
+
## What gets added
|
|
11
|
+
|
|
12
|
+
- `AxonPushAnthropicTracer` that wraps `messages.create()` to trace conversations, tool use, and responses
|
|
13
|
+
- Events: `conversation.turn`, `tool.*.start`, `agent.response`, `tool.result`
|
|
14
|
+
|
|
15
|
+
## Reference Code
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { AxonPush } from "@axonpush/sdk";
|
|
19
|
+
import { AxonPushAnthropicTracer } from "@axonpush/sdk/integrations/anthropic";
|
|
20
|
+
|
|
21
|
+
const axonpush = new AxonPush({
|
|
22
|
+
apiKey: process.env.AXONPUSH_API_KEY!,
|
|
23
|
+
tenantId: process.env.AXONPUSH_TENANT_ID!,
|
|
24
|
+
baseUrl: process.env.AXONPUSH_BASE_URL,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const tracer = new AxonPushAnthropicTracer({
|
|
28
|
+
client: axonpush,
|
|
29
|
+
channelId: Number(process.env.AXONPUSH_CHANNEL_ID),
|
|
30
|
+
agentId: "claude-agent",
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Instead of: const response = await anthropic.messages.create(params)
|
|
34
|
+
// Use: const response = await tracer.createMessage(anthropic, params)
|
|
35
|
+
|
|
36
|
+
// For tool results:
|
|
37
|
+
// tracer.sendToolResult(toolUseId, result)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Steps
|
|
41
|
+
|
|
42
|
+
1. Install `@axonpush/sdk` using the project's package manager
|
|
43
|
+
2. Add AXONPUSH_API_KEY, AXONPUSH_TENANT_ID, AXONPUSH_BASE_URL, AXONPUSH_CHANNEL_ID to .env
|
|
44
|
+
3. Find files that call `client.messages.create()` (the Anthropic API)
|
|
45
|
+
4. Add imports and create the tracer
|
|
46
|
+
5. Replace `anthropic.messages.create(params)` with `tracer.createMessage(anthropic, params)`
|
|
47
|
+
6. For tool results, add `tracer.sendToolResult(toolUseId, result)` calls
|
|
48
|
+
|
|
49
|
+
## Fail-Open
|
|
50
|
+
|
|
51
|
+
The SDK is fail-open by default (`failOpen: true`). If AxonPush is unreachable, tracing calls are silently suppressed.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ts-custom
|
|
3
|
+
description: Integrate AxonPush event publishing directly for custom TypeScript frameworks
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AxonPush Custom Framework Integration (TypeScript)
|
|
7
|
+
|
|
8
|
+
Integrate AxonPush event publishing directly for custom or unsupported TypeScript frameworks.
|
|
9
|
+
|
|
10
|
+
## What gets added
|
|
11
|
+
|
|
12
|
+
- `AxonPush` client for publishing custom events
|
|
13
|
+
- Use `client.events.publish()` to send events from anywhere in your code
|
|
14
|
+
|
|
15
|
+
## Reference Code
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { AxonPush } from "@axonpush/sdk";
|
|
19
|
+
|
|
20
|
+
const axonpush = new AxonPush({
|
|
21
|
+
apiKey: process.env.AXONPUSH_API_KEY!,
|
|
22
|
+
tenantId: process.env.AXONPUSH_TENANT_ID!,
|
|
23
|
+
baseUrl: process.env.AXONPUSH_BASE_URL,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Publish events from your code:
|
|
27
|
+
// await axonpush.events.publish({
|
|
28
|
+
// identifier: "my.event",
|
|
29
|
+
// payload: { key: "value" },
|
|
30
|
+
// channelId: Number(process.env.AXONPUSH_CHANNEL_ID),
|
|
31
|
+
// agentId: "my-agent",
|
|
32
|
+
// eventType: "custom",
|
|
33
|
+
// });
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Steps
|
|
37
|
+
|
|
38
|
+
1. Install `@axonpush/sdk` using the project's package manager
|
|
39
|
+
2. Add AXONPUSH_API_KEY, AXONPUSH_TENANT_ID, AXONPUSH_BASE_URL, AXONPUSH_CHANNEL_ID to .env
|
|
40
|
+
3. Find the main entry point of the project
|
|
41
|
+
4. Add imports and create the client as a module-level singleton
|
|
42
|
+
5. Add example publish calls at key points (e.g., start, end, error handling)
|
|
43
|
+
|
|
44
|
+
## Fail-Open
|
|
45
|
+
|
|
46
|
+
The SDK is fail-open by default (`failOpen: true`). If AxonPush is unreachable, publish calls are silently suppressed.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ts-google-adk
|
|
3
|
+
description: Integrate AxonPush tracing into a Google ADK project
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AxonPush + Google ADK Integration
|
|
7
|
+
|
|
8
|
+
Integrate AxonPush tracing into a project using the Google AI Development Kit.
|
|
9
|
+
|
|
10
|
+
## What gets added
|
|
11
|
+
|
|
12
|
+
- `axonPushADKCallbacks` with agent, model, and tool lifecycle callbacks
|
|
13
|
+
- Events: `agent.start`, `agent.end`, `llm.start`, `llm.end`, `tool.*.start`, `tool.*.end`
|
|
14
|
+
|
|
15
|
+
## Reference Code
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { AxonPush } from "@axonpush/sdk";
|
|
19
|
+
import { axonPushADKCallbacks } from "@axonpush/sdk/integrations/google-adk";
|
|
20
|
+
|
|
21
|
+
const axonpush = new AxonPush({
|
|
22
|
+
apiKey: process.env.AXONPUSH_API_KEY!,
|
|
23
|
+
tenantId: process.env.AXONPUSH_TENANT_ID!,
|
|
24
|
+
baseUrl: process.env.AXONPUSH_BASE_URL,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const callbacks = axonPushADKCallbacks({
|
|
28
|
+
client: axonpush,
|
|
29
|
+
channelId: Number(process.env.AXONPUSH_CHANNEL_ID),
|
|
30
|
+
agentId: "google-adk",
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Register callbacks on your ADK agent:
|
|
34
|
+
// callbacks.beforeAgent(agent);
|
|
35
|
+
// callbacks.afterAgent(agent, output);
|
|
36
|
+
// callbacks.beforeModel(model, params);
|
|
37
|
+
// callbacks.afterModel(model, response);
|
|
38
|
+
// callbacks.beforeTool(tool, input);
|
|
39
|
+
// callbacks.afterTool(tool, output);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Steps
|
|
43
|
+
|
|
44
|
+
1. Install `@axonpush/sdk` using the project's package manager
|
|
45
|
+
2. Add AXONPUSH_API_KEY, AXONPUSH_TENANT_ID, AXONPUSH_BASE_URL, AXONPUSH_CHANNEL_ID to .env
|
|
46
|
+
3. Find the main file where the ADK agent is configured
|
|
47
|
+
4. Add imports and create the callbacks
|
|
48
|
+
5. Register the callbacks at the appropriate lifecycle points
|
|
49
|
+
|
|
50
|
+
## Fail-Open
|
|
51
|
+
|
|
52
|
+
The SDK is fail-open by default (`failOpen: true`). If AxonPush is unreachable, callbacks are silently suppressed.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ts-langchain
|
|
3
|
+
description: Integrate AxonPush tracing into a TypeScript LangChain project
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AxonPush + LangChain (TypeScript) Integration
|
|
7
|
+
|
|
8
|
+
Integrate AxonPush tracing into a TypeScript LangChain project.
|
|
9
|
+
|
|
10
|
+
## What gets added
|
|
11
|
+
|
|
12
|
+
- `AxonPushCallbackHandler` that auto-traces chain/LLM/tool lifecycle events
|
|
13
|
+
- Events: `chain.start`, `chain.end`, `llm.start`, `llm.end`, `tool.*.start`, `tool.end`
|
|
14
|
+
|
|
15
|
+
## Reference Code
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { AxonPush } from "@axonpush/sdk";
|
|
19
|
+
import { AxonPushCallbackHandler } from "@axonpush/sdk/integrations/langchain";
|
|
20
|
+
|
|
21
|
+
const axonpush = new AxonPush({
|
|
22
|
+
apiKey: process.env.AXONPUSH_API_KEY!,
|
|
23
|
+
tenantId: process.env.AXONPUSH_TENANT_ID!,
|
|
24
|
+
baseUrl: process.env.AXONPUSH_BASE_URL,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const handler = new AxonPushCallbackHandler({
|
|
28
|
+
client: axonpush,
|
|
29
|
+
channelId: Number(process.env.AXONPUSH_CHANNEL_ID),
|
|
30
|
+
agentId: "my-agent",
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// For any chain:
|
|
34
|
+
// const result = await chain.invoke(input, { callbacks: [handler] });
|
|
35
|
+
|
|
36
|
+
// For an agent executor:
|
|
37
|
+
// const result = await agentExecutor.invoke(input, { callbacks: [handler] });
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Steps
|
|
41
|
+
|
|
42
|
+
1. Install `@axonpush/sdk` using the project's package manager
|
|
43
|
+
2. Add AXONPUSH_API_KEY, AXONPUSH_TENANT_ID, AXONPUSH_BASE_URL, AXONPUSH_CHANNEL_ID to .env
|
|
44
|
+
3. Find the main file where chains/agents are invoked
|
|
45
|
+
4. Add the imports and client initialization (as module-level code)
|
|
46
|
+
5. Add `{ callbacks: [handler] }` to `.invoke()` calls
|
|
47
|
+
|
|
48
|
+
## Fail-Open
|
|
49
|
+
|
|
50
|
+
The SDK is fail-open by default (`failOpen: true`). If AxonPush is unreachable, tracing callbacks are silently suppressed.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ts-langgraph
|
|
3
|
+
description: Integrate AxonPush tracing into a TypeScript LangGraph project
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AxonPush + LangGraph (TypeScript) Integration
|
|
7
|
+
|
|
8
|
+
Integrate AxonPush tracing into a TypeScript LangGraph project.
|
|
9
|
+
|
|
10
|
+
## What gets added
|
|
11
|
+
|
|
12
|
+
- `AxonPushLangGraphHandler` that extends `AxonPushCallbackHandler` with graph node-level tracing
|
|
13
|
+
- Events: `chain.start`, `chain.end`, `graph.node.start`, `graph.node.end`, `llm.start`, `llm.end`, `tool.*.start`, `tool.end`
|
|
14
|
+
|
|
15
|
+
## Reference Code
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { AxonPush } from "@axonpush/sdk";
|
|
19
|
+
import { AxonPushLangGraphHandler } from "@axonpush/sdk/integrations/langgraph";
|
|
20
|
+
|
|
21
|
+
const axonpush = new AxonPush({
|
|
22
|
+
apiKey: process.env.AXONPUSH_API_KEY!,
|
|
23
|
+
tenantId: process.env.AXONPUSH_TENANT_ID!,
|
|
24
|
+
baseUrl: process.env.AXONPUSH_BASE_URL,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const handler = new AxonPushLangGraphHandler({
|
|
28
|
+
client: axonpush,
|
|
29
|
+
channelId: Number(process.env.AXONPUSH_CHANNEL_ID),
|
|
30
|
+
agentId: "langgraph-agent",
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// const result = await graph.invoke(input, { callbacks: [handler] });
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Steps
|
|
37
|
+
|
|
38
|
+
1. Install `@axonpush/sdk` using the project's package manager
|
|
39
|
+
2. Add AXONPUSH_API_KEY, AXONPUSH_TENANT_ID, AXONPUSH_BASE_URL, AXONPUSH_CHANNEL_ID to .env
|
|
40
|
+
3. Find the main file where the LangGraph graph is invoked
|
|
41
|
+
4. Add the imports and client initialization (as module-level code)
|
|
42
|
+
5. Add `{ callbacks: [handler] }` to `.invoke()` calls
|
|
43
|
+
|
|
44
|
+
## Fail-Open
|
|
45
|
+
|
|
46
|
+
The SDK is fail-open by default (`failOpen: true`). If AxonPush is unreachable, tracing callbacks are silently suppressed.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ts-llamaindex
|
|
3
|
+
description: Integrate AxonPush tracing into a TypeScript LlamaIndex project
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AxonPush + LlamaIndex (TypeScript) Integration
|
|
7
|
+
|
|
8
|
+
Integrate AxonPush tracing into a TypeScript LlamaIndex project.
|
|
9
|
+
|
|
10
|
+
## What gets added
|
|
11
|
+
|
|
12
|
+
- `AxonPushLlamaIndexHandler` with LLM, embedding, retriever, and query lifecycle methods
|
|
13
|
+
- Events: `llm.start`, `llm.end`, `llm.token`, `embedding.start`, `embedding.end`, `retriever.query`, `retriever.result`, `query.start`, `query.end`
|
|
14
|
+
|
|
15
|
+
## Reference Code
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { AxonPush } from "@axonpush/sdk";
|
|
19
|
+
import { AxonPushLlamaIndexHandler } from "@axonpush/sdk/integrations/llamaindex";
|
|
20
|
+
|
|
21
|
+
const axonpush = new AxonPush({
|
|
22
|
+
apiKey: process.env.AXONPUSH_API_KEY!,
|
|
23
|
+
tenantId: process.env.AXONPUSH_TENANT_ID!,
|
|
24
|
+
baseUrl: process.env.AXONPUSH_BASE_URL,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const handler = new AxonPushLlamaIndexHandler({
|
|
28
|
+
client: axonpush,
|
|
29
|
+
channelId: Number(process.env.AXONPUSH_CHANNEL_ID),
|
|
30
|
+
agentId: "llamaindex",
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Call handler methods at the appropriate points:
|
|
34
|
+
// handler.onQueryStart("What is...");
|
|
35
|
+
// handler.onLLMStart("gpt-4", 1);
|
|
36
|
+
// handler.onLLMEnd(output);
|
|
37
|
+
// handler.onRetrieverStart("What is...");
|
|
38
|
+
// handler.onRetrieverEnd(5);
|
|
39
|
+
// handler.onQueryEnd(response);
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Steps
|
|
43
|
+
|
|
44
|
+
1. Install `@axonpush/sdk` using the project's package manager
|
|
45
|
+
2. Add AXONPUSH_API_KEY, AXONPUSH_TENANT_ID, AXONPUSH_BASE_URL, AXONPUSH_CHANNEL_ID to .env
|
|
46
|
+
3. Find the main query engine or retrieval pipeline
|
|
47
|
+
4. Add imports and create the handler
|
|
48
|
+
5. Call the appropriate handler methods at each lifecycle point
|
|
49
|
+
|
|
50
|
+
## Fail-Open
|
|
51
|
+
|
|
52
|
+
The SDK is fail-open by default (`failOpen: true`). If AxonPush is unreachable, handler calls are silently suppressed.
|