copilot-tap-extension 1.1.1 → 1.1.3

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 CHANGED
@@ -62,7 +62,7 @@ npx copilot-tap-extension
62
62
  npx copilot-tap-extension --local
63
63
  ```
64
64
 
65
- This installs the bundled extension, the `/loop` skill, and the agent instructions to the appropriate Copilot directory. Run `npx copilot-tap-extension --help` for all options.
65
+ This installs the bundled extension, the `/loop` skill, the `/monitor` skill, and the agent instructions to the appropriate Copilot directory. Run `npx copilot-tap-extension --help` for all options.
66
66
 
67
67
  To update to the latest version, re-run the same command with `--force`:
68
68
 
@@ -109,6 +109,8 @@ Once inside the session, describe what you want in natural language. You can als
109
109
 
110
110
  > _"/loop 5m check for new PR review comments"_
111
111
 
112
+ > _"/monitor tail -f /var/log/app.log"_
113
+
112
114
  > _"Tail the API logs, inject errors, drop health checks"_
113
115
 
114
116
  The agent translates these into emitter and filter configurations behind the scenes.
@@ -171,6 +173,17 @@ Tell Copilot to watch a log, build, or command. It creates a CommandEmitter, fil
171
173
 
172
174
  You keep coding. Twenty minutes later, Copilot interrupts: "Run 48291: deployment rollback triggered on prod."
173
175
 
176
+ **Monitor a command with self-tuning filters**
177
+
178
+ Use `/monitor` to run a shell command continuously while a companion agent periodically reads the output and updates the filter expressions to separate noise from signal automatically.
179
+
180
+ ```
181
+ /monitor tail -f /var/log/app.log
182
+ /monitor 10m docker logs -f mycontainer
183
+ ```
184
+
185
+ The command stream starts with a sensible initial `notifyPattern`. Every few minutes (configurable) the companion reviews recent log lines and calls `tap_set_event_filter` if the patterns need adjustment. The filter tightens itself based on real output — no manual tuning required.
186
+
174
187
  **Loop a prompt on a schedule**
175
188
 
176
189
  A PromptEmitter re-runs an agent prompt at a fixed interval. Useful for PR comments, CI status, or ticket queues.
@@ -210,6 +223,7 @@ Rules can be added or changed while the emitter is running. You never need to re
210
223
  .github/
211
224
  extensions/tap/extension.mjs # extension entry point (loads the runtime)
212
225
  skills/loop/ # /loop skill for scheduled and idle prompts
226
+ skills/monitor/ # /monitor skill for self-tuning command monitors
213
227
  copilot-instructions.md # agent guidance for using this extension
214
228
  src/
215
229
  emitter/ # supervisor, lifecycle, spawn, line router
package/bin/install.mjs CHANGED
@@ -40,7 +40,8 @@ Installs:
40
40
  extensions/tap/extension.mjs The bundled ※ tap extension
41
41
  extensions/tap/version.json Installed version metadata
42
42
  skills/loop/SKILL.md The /loop skill for prompt-based loops
43
- skills/provider/SKILL.md The /provider skill for scaffolding providers
43
+ skills/create-provider/SKILL.md The /create-provider skill for scaffolding providers
44
+ skills/monitor/SKILL.md The /monitor skill for self-tuning command monitors
44
45
  copilot-instructions.md Agent instructions for using ※ tap
45
46
  `);
46
47
  }
@@ -174,9 +175,14 @@ function install(flags) {
174
175
  label: "skills/loop/SKILL.md"
175
176
  },
176
177
  {
177
- src: path.join(distDir, "skills", "provider", "SKILL.md"),
178
- dest: path.join(targetRoot, "skills", "provider", "SKILL.md"),
179
- label: "skills/provider/SKILL.md"
178
+ src: path.join(distDir, "skills", "create-provider", "SKILL.md"),
179
+ dest: path.join(targetRoot, "skills", "create-provider", "SKILL.md"),
180
+ label: "skills/create-provider/SKILL.md"
181
+ },
182
+ {
183
+ src: path.join(distDir, "skills", "monitor", "SKILL.md"),
184
+ dest: path.join(targetRoot, "skills", "monitor", "SKILL.md"),
185
+ label: "skills/monitor/SKILL.md"
180
186
  },
181
187
  {
182
188
  src: path.join(distDir, "copilot-instructions.md"),
@@ -1,7 +1,7 @@
1
1
  ---
2
- name: provider
3
- description: "Scaffold a tap provider — an external process that registers tools with Copilot via WebSocket. Use when the user wants to create a provider, extend tap with custom tools, or connect an external service."
4
- argument-hint: "<description of what the provider should do>"
2
+ name: create-provider
3
+ description: "Create an external tool provider that connects to tap. Use when the user says 'create a provider', 'build a provider', 'scaffold a provider', 'add an external tool', 'connect a service to tap', or wants to extend Copilot with tools written in any language."
4
+ argument-hint: "<what the provider should do>"
5
5
  user-invocable: true
6
6
  ---
7
7
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: loop
3
- description: "Create a prompt-based scheduled loop with tap. Use for requests like '/loop 5m check the deploy' or any ask to run a prompt on a recurring interval."
3
+ description: "Run a prompt on a recurring schedule or when idle. Use when the user says 'loop', 'every 5 minutes', 'check periodically', 'keep watching', 'repeat this', 'run when idle', or wants any prompt to re-run automatically."
4
4
  argument-hint: "<interval|idle> <prompt>"
5
5
  user-invocable: true
6
6
  ---
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: monitor
3
+ description: "Start a self-tuning command monitor. Use when the user says 'monitor', 'watch', 'tail', 'track', 'keep an eye on', or wants a shell command to run continuously while Copilot automatically reviews and tunes the output filters over time."
4
+ argument-hint: "[review-interval] <shell-command>"
5
+ user-invocable: true
6
+ ---
7
+
8
+ Start a CommandEmitter for the given shell command paired with a companion PromptEmitter that periodically reads the stream and dynamically updates the filter expressions with `tap_set_event_filter`.
9
+
10
+ ## Expected input
11
+
12
+ Interpret the invocation as:
13
+
14
+ 1. An **optional** first argument that is the review interval for the companion (e.g. `5m`, `10m`, `1h`). Defaults to `5m` when omitted.
15
+ 2. The rest of the input is the shell command to run continuously.
16
+
17
+ Example (with explicit interval):
18
+
19
+ ```text
20
+ /monitor 10m tail -f /var/log/app.log
21
+ ```
22
+
23
+ means:
24
+
25
+ - `reviewInterval = "10m"` — companion reviews the stream every 10 minutes
26
+ - `command = "tail -f /var/log/app.log"`
27
+
28
+ Example (default interval):
29
+
30
+ ```text
31
+ /monitor docker logs -f mycontainer
32
+ ```
33
+
34
+ means:
35
+
36
+ - `reviewInterval = "5m"` (default)
37
+ - `command = "docker logs -f mycontainer"`
38
+
39
+ If the command is missing, ask the user for it instead of guessing.
40
+
41
+ ## What to create
42
+
43
+ ### 1. CommandEmitter — the live command stream
44
+
45
+ Use `tap_start_emitter` to start the CommandEmitter:
46
+
47
+ - `command` — the user's shell command.
48
+ - No `every` field — commands default to continuous (always running).
49
+ - Initial `notifyPattern` — derive a sensible starting pattern from the command context (e.g. `error|warn|fail|exception` for log tailing, or omit entirely and let the companion tune it on first review).
50
+ - `subscribe = true`, `delivery = "important"` — injected lines reach the session.
51
+ - `scope = "temporary"`, `managedBy = "modelOwned"` (unless the user asked for persistence).
52
+ - Name the emitter concisely after the command (e.g. `app-logs`, `docker-mycontainer`).
53
+ - The EventStream is created automatically with the same name.
54
+
55
+ ### 2. Companion PromptEmitter — the periodic filter reviewer
56
+
57
+ Use `tap_start_emitter` to start a second emitter immediately after the command emitter:
58
+
59
+ - `prompt` — a **fully self-contained** instruction (see template below).
60
+ - `every = <reviewInterval>` — timed schedule.
61
+ - `scope = "temporary"`, `managedBy = "modelOwned"`.
62
+ - Name it `<command-emitter-name>-review`.
63
+ - `subscribe = false` — review is internal housekeeping, not user-facing.
64
+ - `maxRuns` is optional. Only set it if the user explicitly requests a limit.
65
+
66
+ ### Companion prompt template
67
+
68
+ Write the companion prompt so it stands alone — it must reference the command emitter and stream by their exact names, because the companion runs independently with no surrounding context. Use this structure:
69
+
70
+ ```
71
+ Review the event stream for the '<command-emitter-name>' monitor and update its filters if needed.
72
+
73
+ Steps:
74
+ 1. Call tap_stream_history for stream '<stream-name>' (limit 50).
75
+ 2. If there are fewer than 5 entries, stop — not enough data to judge patterns yet.
76
+ 3. Scan the recent lines for recurring patterns:
77
+ - Lines that are always noise (timestamps-only, heartbeats, blank pings) → candidates for excludePattern.
78
+ - Lines that indicate important events (errors, warnings, state changes) → candidates for notifyPattern.
79
+ - Lines that are never relevant at all → candidates for tighter includePattern.
80
+ 4. Compare what you see against the current filter patterns for emitter '<command-emitter-name>'.
81
+ 5. Only update if the evidence clearly justifies a change (signal-to-noise is poor or a pattern is clearly wrong).
82
+ 6. If an update is needed, call tap_set_event_filter with the revised patterns for emitter '<command-emitter-name>'.
83
+ 7. Do not report your findings to the user unless you made a change. If you made a change, send one short message describing what you updated and why.
84
+ ```
85
+
86
+ Substitute the real emitter name and stream name into the prompt before passing it to `tap_start_emitter`.
87
+
88
+ ## Required behavior
89
+
90
+ When this skill is invoked:
91
+
92
+ 1. Parse the review interval and command from the invocation.
93
+ 2. Start the CommandEmitter.
94
+ 3. Start the companion PromptEmitter using the self-contained prompt template above.
95
+ 4. Confirm to the user:
96
+ - Command emitter name and stream.
97
+ - Initial filter patterns (or "none set — companion will tune on first review").
98
+ - Companion reviewer name and review interval.
99
+ 5. Stop there — do not immediately inspect stream history or simulate a review.
100
+
101
+ ## Stopping the monitor
102
+
103
+ To stop monitoring, both emitters must be stopped:
104
+
105
+ ```
106
+ tap_stop_emitter '<command-emitter-name>'
107
+ tap_stop_emitter '<command-emitter-name>-review'
108
+ ```
109
+
110
+ If the user asks to stop monitoring, stop both in a single response.
111
+
112
+ ## Persistence
113
+
114
+ If the user explicitly asks to keep the monitor across sessions, set `scope = "persistent"` on **both** emitters. Say that both will be restored from config on the next session start.
115
+
116
+ ## Conservative filter updates
117
+
118
+ Remind the companion (via the prompt) to be conservative:
119
+
120
+ - Update only when there is clear evidence from at least 5 recent entries (the same minimum checked inside the companion prompt).
121
+ - Prefer broadening `notifyPattern` over narrowing it — missing a real event is worse than an extra notification.
122
+ - Never remove `notifyPattern` entirely unless the stream is provably silent.
123
+ - Do not change `includePattern` or `excludePattern` on every review cycle — only when a pattern is clearly wrong.
124
+
125
+ ## If the input is incomplete
126
+
127
+ If the review interval looks like part of the command (e.g. `/monitor tail -f …`), treat the first token as the command start and use the default interval `5m`.
128
+
129
+ If only an interval is given with no command, ask for the command.
package/dist/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "1.1.1"
2
+ "version": "1.1.3"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "copilot-tap-extension",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Copilot CLI extension for background event emitters, event streams, and session injection.",
5
5
  "type": "module",
6
6
  "license": "MIT",