@notilens/notilens 0.1.0 → 0.1.2
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 +150 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# NotiLens
|
|
2
|
+
|
|
3
|
+
CLI tool for sending AI agent task lifecycle notifications to [NotiLens](https://www.notilens.com).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @notilens/notilens
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
Register your agent with its endpoint and secret from the NotiLens dashboard:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
notilens add-agent <agent-name> http <endpoint> <secret>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Example:**
|
|
20
|
+
```bash
|
|
21
|
+
notilens add-agent my-agent http https://hook.notilens.com/webhook/[TOPIC_TOKEN]/send [TOPIC_SECRET]
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
### Task Lifecycle
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Start a task (auto-generates task ID if omitted)
|
|
32
|
+
notilens task.start --agent my-agent --task task_001
|
|
33
|
+
|
|
34
|
+
# Mark in progress
|
|
35
|
+
notilens task.in_progress --agent my-agent --task task_001
|
|
36
|
+
|
|
37
|
+
# Complete successfully
|
|
38
|
+
notilens task.complete "Processed 100 records" --agent my-agent --task task_001
|
|
39
|
+
|
|
40
|
+
# Report an error (non-terminal, task continues)
|
|
41
|
+
notilens task.error "Step 3 flow Crashed" --agent my-agent --task task_001
|
|
42
|
+
|
|
43
|
+
# Retry
|
|
44
|
+
notilens task.retry --agent my-agent --task task_001
|
|
45
|
+
|
|
46
|
+
# Loop iteration
|
|
47
|
+
notilens task.loop "Processing step 1" --agent my-agent --task task_001
|
|
48
|
+
|
|
49
|
+
# Fail (terminal)
|
|
50
|
+
notilens task.fail "Worker failed" --agent my-agent --task task_001
|
|
51
|
+
|
|
52
|
+
# Timeout (terminal)
|
|
53
|
+
notilens task.timeout "Took more than 15 secs" --agent my-agent --task task_001
|
|
54
|
+
|
|
55
|
+
# Cancel (terminal)
|
|
56
|
+
notilens task.cancel "User cancelled" --agent my-agent --task task_001
|
|
57
|
+
|
|
58
|
+
# Terminate (terminal)
|
|
59
|
+
notilens task.terminate "Out of memory" --agent my-agent --task task_001
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### AI Response Events
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
notilens ai.response.generate "Summary generated" --agent my-agent --task task_001
|
|
66
|
+
notilens ai.response.fail "Model unavailable" --agent my-agent --task task_001
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Input Events
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
notilens input.required "Please confirm the output" --agent my-agent --task task_001
|
|
73
|
+
notilens input.approve "User approved" --agent my-agent --task task_001
|
|
74
|
+
notilens input.reject "User rejected" --agent my-agent --task task_001
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Metrics
|
|
78
|
+
|
|
79
|
+
Track token usage and confidence after an AI call:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# set.metrics <prompt_tokens> <completion_tokens> [confidence] --agent ... --task ...
|
|
83
|
+
notilens set.metrics 512 128 0.95 --agent my-agent --task task_001
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Generic Event
|
|
87
|
+
|
|
88
|
+
Emit any custom event:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
notilens emit "data.processed" "Ingested 500 rows" --agent my-agent --task task_001
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Options
|
|
97
|
+
|
|
98
|
+
| Flag | Description |
|
|
99
|
+
|------|-------------|
|
|
100
|
+
| `--agent <name>` | Agent name (required) |
|
|
101
|
+
| `--task <id>` | Task ID (auto-generated if omitted) |
|
|
102
|
+
| `--type` | Override notification type: `info` `success` `warning` `urgent` `important` |
|
|
103
|
+
| `--meta key=value` | Custom metadata (repeatable) |
|
|
104
|
+
| `--image_url <url>` | Attach an image |
|
|
105
|
+
| `--open_url <url>` | Link to open |
|
|
106
|
+
| `--download_url <url>` | Link to download |
|
|
107
|
+
| `--tags "tag1,tag2"` | Comma-separated tags |
|
|
108
|
+
| `--is_actionable true\|false` | Override actionable flag |
|
|
109
|
+
| `--confidence <0-1>` | Confidence score |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Notification Types
|
|
114
|
+
|
|
115
|
+
Events are automatically mapped to notification types:
|
|
116
|
+
|
|
117
|
+
| Type | Events |
|
|
118
|
+
|------|--------|
|
|
119
|
+
| `success` | `task.completed`, `response.generated`, `input.approved` |
|
|
120
|
+
| `urgent` | `task.failed`, `task.timeout`, `response.failed` |
|
|
121
|
+
| `important` | `task.error`, `task.terminated` |
|
|
122
|
+
| `warning` | `task.retrying`, `task.cancelled`, `input.required`, `input.rejected` |
|
|
123
|
+
| `info` | All others |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Full Example
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Register agent
|
|
131
|
+
notilens add-agent summarizer http https://hook.notilens.com/webhook/my_topic_token/send mysecret
|
|
132
|
+
|
|
133
|
+
# Start task
|
|
134
|
+
notilens task.start --agent summarizer --task job_42
|
|
135
|
+
|
|
136
|
+
# Update token metrics mid-task
|
|
137
|
+
notilens set.metrics 1024 256 --agent summarizer --task job_42
|
|
138
|
+
|
|
139
|
+
# Add custom metadata
|
|
140
|
+
notilens task.complete "Summary ready" --agent summarizer --task job_42 \
|
|
141
|
+
--meta input_file=report.pdf \
|
|
142
|
+
--meta pages=12 \
|
|
143
|
+
--open_url https://example.com/summary.pdf
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
MIT — [notilens.com](https://www.notilens.com)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@notilens/notilens",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "NotiLens CLI — send AI agent task lifecycle notifications",
|
|
5
5
|
"keywords": ["notilens", "ai-agent", "notifications", "monitoring", "cli"],
|
|
6
6
|
"homepage": "https://www.notilens.com",
|