@notilens/notilens 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/README.md +152 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,152 @@
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://www.notilens.com/nlapi/nl/v1/notify abc123secret
22
+ ```
23
+
24
+ Config is saved to `~/.notilens_config.json`.
25
+
26
+ ---
27
+
28
+ ## Usage
29
+
30
+ ### Task Lifecycle
31
+
32
+ ```bash
33
+ # Start a task (auto-generates task ID if omitted)
34
+ notilens task.start --agent my-agent --task task_001
35
+
36
+ # Mark in progress
37
+ notilens task.in_progress --agent my-agent --task task_001
38
+
39
+ # Complete successfully
40
+ notilens task.complete "Processed 100 records" --agent my-agent --task task_001
41
+
42
+ # Report an error (non-terminal, task continues)
43
+ notilens task.error "Connection timeout, will retry" --agent my-agent --task task_001
44
+
45
+ # Retry
46
+ notilens task.retry --agent my-agent --task task_001
47
+
48
+ # Loop iteration
49
+ notilens task.loop "Processing batch 3/10" --agent my-agent --task task_001
50
+
51
+ # Fail (terminal)
52
+ notilens task.fail "Max retries exceeded" --agent my-agent --task task_001
53
+
54
+ # Timeout (terminal)
55
+ notilens task.timeout "Exceeded 30s limit" --agent my-agent --task task_001
56
+
57
+ # Cancel (terminal)
58
+ notilens task.cancel "User cancelled" --agent my-agent --task task_001
59
+
60
+ # Terminate (terminal)
61
+ notilens task.terminate "Out of memory" --agent my-agent --task task_001
62
+ ```
63
+
64
+ ### AI Response Events
65
+
66
+ ```bash
67
+ notilens ai.response.generate "Summary generated" --agent my-agent --task task_001
68
+ notilens ai.response.fail "Model unavailable" --agent my-agent --task task_001
69
+ ```
70
+
71
+ ### Input Events
72
+
73
+ ```bash
74
+ notilens input.required "Please confirm the output" --agent my-agent --task task_001
75
+ notilens input.approve "User approved" --agent my-agent --task task_001
76
+ notilens input.reject "User rejected" --agent my-agent --task task_001
77
+ ```
78
+
79
+ ### Metrics
80
+
81
+ Track token usage and confidence after an AI call:
82
+
83
+ ```bash
84
+ # set.metrics <prompt_tokens> <completion_tokens> [confidence] --agent ... --task ...
85
+ notilens set.metrics 512 128 0.95 --agent my-agent --task task_001
86
+ ```
87
+
88
+ ### Generic Event
89
+
90
+ Emit any custom event:
91
+
92
+ ```bash
93
+ notilens emit "data.processed" "Ingested 500 rows" --agent my-agent --task task_001
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Options
99
+
100
+ | Flag | Description |
101
+ |------|-------------|
102
+ | `--agent <name>` | Agent name (required) |
103
+ | `--task <id>` | Task ID (auto-generated if omitted) |
104
+ | `--type` | Override notification type: `info` `success` `warning` `urgent` `important` |
105
+ | `--meta key=value` | Custom metadata (repeatable) |
106
+ | `--image_url <url>` | Attach an image |
107
+ | `--open_url <url>` | Link to open |
108
+ | `--download_url <url>` | Link to download |
109
+ | `--tags "tag1,tag2"` | Comma-separated tags |
110
+ | `--is_actionable true\|false` | Override actionable flag |
111
+ | `--confidence <0-1>` | Confidence score |
112
+
113
+ ---
114
+
115
+ ## Notification Types
116
+
117
+ Events are automatically mapped to notification types:
118
+
119
+ | Type | Events |
120
+ |------|--------|
121
+ | `success` | `task.completed`, `response.generated`, `input.approved` |
122
+ | `urgent` | `task.failed`, `task.timeout`, `response.failed` |
123
+ | `important` | `task.error`, `task.terminated` |
124
+ | `warning` | `task.retrying`, `task.cancelled`, `input.required`, `input.rejected` |
125
+ | `info` | All others |
126
+
127
+ ---
128
+
129
+ ## Full Example
130
+
131
+ ```bash
132
+ # Register agent
133
+ notilens add-agent summarizer http https://www.notilens.com/nlapi/nl/v1/notify mysecret
134
+
135
+ # Start task
136
+ notilens task.start --agent summarizer --task job_42
137
+
138
+ # Update token metrics mid-task
139
+ notilens set.metrics 1024 256 --agent summarizer --task job_42
140
+
141
+ # Add custom metadata
142
+ notilens task.complete "Summary ready" --agent summarizer --task job_42 \
143
+ --meta input_file=report.pdf \
144
+ --meta pages=12 \
145
+ --open_url https://example.com/summary.pdf
146
+ ```
147
+
148
+ ---
149
+
150
+ ## License
151
+
152
+ 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.0",
3
+ "version": "0.1.1",
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",