plain.observer 0.3.2__py3-none-any.whl → 0.3.4__py3-none-any.whl

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.

Potentially problematic release.


This version of plain.observer might be problematic. Click here for more details.

@@ -1,5 +1,28 @@
1
1
  # plain-observer changelog
2
2
 
3
+ ## [0.3.4](https://github.com/dropseed/plain/releases/plain-observer@0.3.4) (2025-07-30)
4
+
5
+ ### What's changed
6
+
7
+ - Fixed URL configuration examples in installation documentation to use `ObserverRouter` instead of string path ([f55ac7d](https://github.com/dropseed/plain/commit/f55ac7d491))
8
+ - Enhanced README with table of contents, PyPI installation link, and post-installation usage instructions ([4ebecd1](https://github.com/dropseed/plain/commit/4ebecd1856))
9
+
10
+ ### Upgrade instructions
11
+
12
+ - No changes required
13
+
14
+ ## [0.3.3](https://github.com/dropseed/plain/releases/plain-observer@0.3.3) (2025-07-25)
15
+
16
+ ### What's changed
17
+
18
+ - Added `--print` option to the `plain observer diagnose` command to print prompts without running agents ([9721331](https://github.com/dropseed/plain/commit/9721331e40))
19
+ - The `plain observer diagnose` command now uses the shared `prompt_agent` utility for better consistency ([de1fa72](https://github.com/dropseed/plain/commit/de1fa7253a))
20
+ - Added comprehensive installation instructions to the README including package installation, URL configuration, and migration steps ([950939b](https://github.com/dropseed/plain/commit/950939b619))
21
+
22
+ ### Upgrade instructions
23
+
24
+ - No changes required
25
+
3
26
  ## [0.3.2](https://github.com/dropseed/plain/releases/plain-observer@0.3.2) (2025-07-25)
4
27
 
5
28
  ### What's changed
plain/observer/README.md CHANGED
@@ -1,3 +1,46 @@
1
1
  # plain.observer
2
2
 
3
- **Monitor.**
3
+ **On-page telemetry and observability tools for Plain.**
4
+
5
+ - [Installation](#installation)
6
+
7
+ ## Installation
8
+
9
+ Install the `plain.observer` package from [PyPI](https://pypi.org/project/plain.observer/):
10
+
11
+ ```bash
12
+ uv add plain.observer
13
+ ```
14
+
15
+ Add `plain.observer` to your `INSTALLED_PACKAGES`:
16
+
17
+ ```python
18
+ # app/settings.py
19
+ INSTALLED_PACKAGES = [
20
+ # ...
21
+ "plain.observer",
22
+ ]
23
+ ```
24
+
25
+ Include the observer URLs in your URL configuration:
26
+
27
+ ```python
28
+ # app/urls.py
29
+ from plain.observer.urls import ObserverRouter
30
+ from plain.urls import Router, include
31
+
32
+ class AppRouter(Router):
33
+ namespace = ""
34
+ urls = [
35
+ # ...
36
+ include("observer/", ObserverRouter),
37
+ ]
38
+ ```
39
+
40
+ Run migrations to create the necessary database tables:
41
+
42
+ ```bash
43
+ plain migrate
44
+ ```
45
+
46
+ After installation, Observer will automatically integrate with your application's toolbar (if using `plain.admin`). You can access the web interface at `/observer/traces/` or use the CLI commands to analyze traces.
plain/observer/cli.py CHANGED
@@ -1,12 +1,11 @@
1
1
  import json
2
- import shlex
3
- import subprocess
4
2
  import sys
5
3
  import urllib.request
6
4
 
7
5
  import click
8
6
 
9
7
  from plain.cli import register_cli
8
+ from plain.cli.agent import prompt_agent
10
9
  from plain.observer.models import Span, Trace
11
10
 
12
11
 
@@ -497,7 +496,13 @@ def format_trace_output(trace):
497
496
  envvar="PLAIN_AGENT_COMMAND",
498
497
  help="Run command with generated prompt",
499
498
  )
500
- def diagnose(trace_id, url, json_input, agent_command):
499
+ @click.option(
500
+ "--print",
501
+ "print_only",
502
+ is_flag=True,
503
+ help="Print the prompt without running the agent",
504
+ )
505
+ def diagnose(trace_id, url, json_input, agent_command, print_only):
501
506
  """Generate a diagnostic prompt for analyzing a trace.
502
507
 
503
508
  By default, provide a trace ID from the database. Use --url for a shareable
@@ -556,21 +561,6 @@ def diagnose(trace_id, url, json_input, agent_command):
556
561
 
557
562
  prompt = "\n".join(prompt_lines)
558
563
 
559
- if agent_command:
560
- cmd = shlex.split(agent_command)
561
- cmd.append(prompt)
562
- result = subprocess.run(cmd, check=False)
563
- if result.returncode != 0:
564
- click.secho(
565
- f"Agent command failed with exit code {result.returncode}",
566
- fg="red",
567
- err=True,
568
- )
569
- else:
570
- click.echo(prompt)
571
- click.secho(
572
- "\nCopy the prompt above to a coding agent. To run an agent automatically, use --agent-command or set the PLAIN_AGENT_COMMAND environment variable.",
573
- dim=True,
574
- italic=True,
575
- err=True,
576
- )
564
+ success = prompt_agent(prompt, agent_command, print_only)
565
+ if not success:
566
+ raise click.Abort()
@@ -0,0 +1,59 @@
1
+ Metadata-Version: 2.4
2
+ Name: plain.observer
3
+ Version: 0.3.4
4
+ Summary: On-page telemetry and observability tools for Plain.
5
+ Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
+ License-Expression: BSD-3-Clause
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.11
9
+ Requires-Dist: opentelemetry-sdk>=1.34.1
10
+ Requires-Dist: plain-admin<1.0.0
11
+ Requires-Dist: plain<1.0.0
12
+ Description-Content-Type: text/markdown
13
+
14
+ # plain.observer
15
+
16
+ **On-page telemetry and observability tools for Plain.**
17
+
18
+ - [Installation](#installation)
19
+
20
+ ## Installation
21
+
22
+ Install the `plain.observer` package from [PyPI](https://pypi.org/project/plain.observer/):
23
+
24
+ ```bash
25
+ uv add plain.observer
26
+ ```
27
+
28
+ Add `plain.observer` to your `INSTALLED_PACKAGES`:
29
+
30
+ ```python
31
+ # app/settings.py
32
+ INSTALLED_PACKAGES = [
33
+ # ...
34
+ "plain.observer",
35
+ ]
36
+ ```
37
+
38
+ Include the observer URLs in your URL configuration:
39
+
40
+ ```python
41
+ # app/urls.py
42
+ from plain.observer.urls import ObserverRouter
43
+ from plain.urls import Router, include
44
+
45
+ class AppRouter(Router):
46
+ namespace = ""
47
+ urls = [
48
+ # ...
49
+ include("observer/", ObserverRouter),
50
+ ]
51
+ ```
52
+
53
+ Run migrations to create the necessary database tables:
54
+
55
+ ```bash
56
+ plain migrate
57
+ ```
58
+
59
+ After installation, Observer will automatically integrate with your application's toolbar (if using `plain.admin`). You can access the web interface at `/observer/traces/` or use the CLI commands to analyze traces.
@@ -1,8 +1,8 @@
1
- plain/observer/CHANGELOG.md,sha256=Q7gKwSL1kcjuBtccwnXArsdjNFwuyafBUcfw-JA3Rks,3348
2
- plain/observer/README.md,sha256=5wM48-iE8i7xOjIK8KCgZ-Vmp2xpDtX73UnE5QeNnd4,31
1
+ plain/observer/CHANGELOG.md,sha256=j1BKNuG5ejEPh5mCJ0h9AMHSdA9QwNjihvnWtjv1AJ0,4557
2
+ plain/observer/README.md,sha256=39RA17fgcyOkqeIWBOAg4Be6YZjoiDzK5PVOG-nseuY,988
3
3
  plain/observer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  plain/observer/admin.py,sha256=Csvd5V9F5u0zksWpbpISY_NlBJa-0TptSX_Kn652WRc,2719
5
- plain/observer/cli.py,sha256=-wNAYhChMsO_cxNLOvbFI_bpMWjlEetzGuK9lR47iS8,21026
5
+ plain/observer/cli.py,sha256=oP_aeno-xYQ2YemQVNFwhmLevDdkf1uLRk-wpOUxqdU,20640
6
6
  plain/observer/config.py,sha256=FuJi1jiDSvOTcmP-6Ea4OlGZt5cRf4iTp1e0dgpJ45E,1494
7
7
  plain/observer/core.py,sha256=D9vX0GP8JBB8-NFAKrOwPSHl_wdZo1h0A5C6xKsJVjA,2245
8
8
  plain/observer/default_settings.py,sha256=JN2jT2wfa6f80EqU0p4Ox_47xyxL-Ym5-_pftY7xj2U,197
@@ -19,7 +19,7 @@ plain/observer/templates/observer/trace_share.html,sha256=HrYLti5BpX96-6Bm_37OOb
19
19
  plain/observer/templates/observer/traces.html,sha256=cFnlIuCf6XJEpHRD2_yfVmPDGZfiqMq6Cg-iMlT3CWY,22184
20
20
  plain/observer/templates/toolbar/observer.html,sha256=uaDKiWR7EYqC1kEXE-uHDlE7nfFEMR_zmOgvlKwQHJ4,1365
21
21
  plain/observer/templates/toolbar/observer_button.html,sha256=xsHJSuOjW6ddnxlPlPKek22WrWnuVYGIcBfFdkb76pk,1199
22
- plain_observer-0.3.2.dist-info/METADATA,sha256=Ljo4eyqmz5vPoxf1Lmgm32Om9S_gdRwGKrvFrRF_0lw,429
23
- plain_observer-0.3.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
24
- plain_observer-0.3.2.dist-info/licenses/LICENSE,sha256=YZdq6Pz8ivjs97eSVLRmoGDI1hjEikX6N49DfM0DWio,1500
25
- plain_observer-0.3.2.dist-info/RECORD,,
22
+ plain_observer-0.3.4.dist-info/METADATA,sha256=_z5gkIjRtiMiS7GelTKAwY1Xce1cSC8abmVnekHvpxo,1386
23
+ plain_observer-0.3.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
24
+ plain_observer-0.3.4.dist-info/licenses/LICENSE,sha256=YZdq6Pz8ivjs97eSVLRmoGDI1hjEikX6N49DfM0DWio,1500
25
+ plain_observer-0.3.4.dist-info/RECORD,,
@@ -1,16 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: plain.observer
3
- Version: 0.3.2
4
- Summary: On-page telemetry and observability tools for Plain.
5
- Author-email: Dave Gaeddert <dave.gaeddert@dropseed.dev>
6
- License-Expression: BSD-3-Clause
7
- License-File: LICENSE
8
- Requires-Python: >=3.11
9
- Requires-Dist: opentelemetry-sdk>=1.34.1
10
- Requires-Dist: plain-admin<1.0.0
11
- Requires-Dist: plain<1.0.0
12
- Description-Content-Type: text/markdown
13
-
14
- # plain.observer
15
-
16
- **Monitor.**