quireai 0.1.0__tar.gz
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.
- quireai-0.1.0/LICENSE +21 -0
- quireai-0.1.0/PKG-INFO +598 -0
- quireai-0.1.0/README.md +565 -0
- quireai-0.1.0/pyproject.toml +90 -0
- quireai-0.1.0/pyproject.toml.orig +75 -0
- quireai-0.1.0/src/quire/__init__.py +1 -0
- quireai-0.1.0/src/quire/__main__.py +14 -0
- quireai-0.1.0/src/quire/agent/__init__.py +1 -0
- quireai-0.1.0/src/quire/agent/arms.py +292 -0
- quireai-0.1.0/src/quire/agent/attachments.py +58 -0
- quireai-0.1.0/src/quire/agent/backends/__init__.py +1 -0
- quireai-0.1.0/src/quire/agent/backends/base.py +161 -0
- quireai-0.1.0/src/quire/agent/backends/claude.py +238 -0
- quireai-0.1.0/src/quire/agent/backends/codex.py +380 -0
- quireai-0.1.0/src/quire/agent/backends/opencode.py +364 -0
- quireai-0.1.0/src/quire/agent/backends/rpc.py +167 -0
- quireai-0.1.0/src/quire/agent/bridge.py +203 -0
- quireai-0.1.0/src/quire/agent/conversation.py +311 -0
- quireai-0.1.0/src/quire/agent/prompt.py +157 -0
- quireai-0.1.0/src/quire/agent/session.py +486 -0
- quireai-0.1.0/src/quire/agent/sidecar.py +113 -0
- quireai-0.1.0/src/quire/agent/tools.py +483 -0
- quireai-0.1.0/src/quire/app.py +249 -0
- quireai-0.1.0/src/quire/auth.py +35 -0
- quireai-0.1.0/src/quire/cli.py +81 -0
- quireai-0.1.0/src/quire/context/__init__.py +1 -0
- quireai-0.1.0/src/quire/context/graph.py +121 -0
- quireai-0.1.0/src/quire/context/inventory.py +128 -0
- quireai-0.1.0/src/quire/context/ledger.py +77 -0
- quireai-0.1.0/src/quire/context/packet.py +281 -0
- quireai-0.1.0/src/quire/context/tokens.py +24 -0
- quireai-0.1.0/src/quire/context/variables.py +61 -0
- quireai-0.1.0/src/quire/debugging.py +81 -0
- quireai-0.1.0/src/quire/doc/__init__.py +1 -0
- quireai-0.1.0/src/quire/doc/arms.py +259 -0
- quireai-0.1.0/src/quire/doc/checkpoint.py +148 -0
- quireai-0.1.0/src/quire/doc/ipynb.py +138 -0
- quireai-0.1.0/src/quire/doc/model.py +62 -0
- quireai-0.1.0/src/quire/doc/ops.py +204 -0
- quireai-0.1.0/src/quire/doc/store.py +121 -0
- quireai-0.1.0/src/quire/doc/strip.py +61 -0
- quireai-0.1.0/src/quire/file_api.py +219 -0
- quireai-0.1.0/src/quire/files.py +84 -0
- quireai-0.1.0/src/quire/git.py +575 -0
- quireai-0.1.0/src/quire/git_api.py +176 -0
- quireai-0.1.0/src/quire/hub.py +514 -0
- quireai-0.1.0/src/quire/kernel/__init__.py +1 -0
- quireai-0.1.0/src/quire/kernel/code_help.py +91 -0
- quireai-0.1.0/src/quire/kernel/debugger.py +346 -0
- quireai-0.1.0/src/quire/kernel/executor.py +348 -0
- quireai-0.1.0/src/quire/kernel/interpreter.py +76 -0
- quireai-0.1.0/src/quire/kernel/kernel_helper.py +845 -0
- quireai-0.1.0/src/quire/kernel/outputs.py +166 -0
- quireai-0.1.0/src/quire/kernel/session.py +394 -0
- quireai-0.1.0/src/quire/kernel/table_helper.py +591 -0
- quireai-0.1.0/src/quire/kernel/variable_view.py +332 -0
- quireai-0.1.0/src/quire/kernel/widgets.py +354 -0
- quireai-0.1.0/src/quire/protocol.py +797 -0
- quireai-0.1.0/src/quire/shell_child.py +16 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- quireai-0.1.0/src/quire/static/assets/TerminalPane-Bro4TU3o.css +1 -0
- quireai-0.1.0/src/quire/static/assets/TerminalPane-v20mOnlF.js +18 -0
- quireai-0.1.0/src/quire/static/assets/auto-render-BiUk-CzN.js +257 -0
- quireai-0.1.0/src/quire/static/assets/download-wAs-UBGo.js +766 -0
- quireai-0.1.0/src/quire/static/assets/index-D0vadP_b.css +1 -0
- quireai-0.1.0/src/quire/static/assets/index-Yk83QJ9J.js +420 -0
- quireai-0.1.0/src/quire/static/assets/instrument-serif-latin-400-italic-DKMiL14s.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/instrument-serif-latin-400-italic-u__WvvIK.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/instrument-serif-latin-400-normal-BVbkICAY.woff +0 -0
- quireai-0.1.0/src/quire/static/assets/instrument-serif-latin-400-normal-DnYpCC2O.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/inter-cyrillic-ext-opsz-normal-CfYZpDVp.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/inter-cyrillic-opsz-normal-BFQXbQ-f.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/inter-greek-ext-opsz-normal-BmPQvyvo.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/inter-greek-opsz-normal-BM0NlUE_.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/inter-latin-ext-opsz-normal-DpK-iCPk.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/inter-latin-opsz-normal-BwkfbSeq.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/inter-vietnamese-opsz-normal-Ci9T9ieq.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- quireai-0.1.0/src/quire/static/assets/mermaid.min-CDSj-a4E.js +4330 -0
- quireai-0.1.0/src/quire/static/assets/plotly.min-CaWywiwD.js +3620 -0
- quireai-0.1.0/src/quire/static/assets/widgetLibrary-C3QXBEFI.js +36 -0
- quireai-0.1.0/src/quire/static/assets/widgetLibrary-C88Z8tk3.css +1 -0
- quireai-0.1.0/src/quire/static/index.html +24 -0
- quireai-0.1.0/src/quire/table_protocol.py +113 -0
- quireai-0.1.0/src/quire/terminal.py +197 -0
quireai-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 jwuthri-cloud
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
quireai-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: quireai
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A notebook where Claude is a cell.
|
|
5
|
+
Keywords: notebook,jupyter,claude,ai,agent,ipynb
|
|
6
|
+
Author: jwuthri-cloud
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Environment :: Web Environment
|
|
11
|
+
Classifier: Framework :: Jupyter
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Operating System :: MacOS
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering
|
|
19
|
+
Requires-Dist: claude-agent-sdk==0.2.189
|
|
20
|
+
Requires-Dist: h11>=0.16.0
|
|
21
|
+
Requires-Dist: ipykernel>=7.4.0
|
|
22
|
+
Requires-Dist: jupyter-client>=8.10.0
|
|
23
|
+
Requires-Dist: nbformat>=5.11.1
|
|
24
|
+
Requires-Dist: pydantic>=2.14.3
|
|
25
|
+
Requires-Dist: rich>=15.0.0
|
|
26
|
+
Requires-Dist: starlette>=1.10.0
|
|
27
|
+
Requires-Dist: uvicorn[standard]>=0.54.0
|
|
28
|
+
Requires-Python: >=3.13
|
|
29
|
+
Project-URL: Homepage, https://github.com/jwuthri-cloud/QuireAi
|
|
30
|
+
Project-URL: Repository, https://github.com/jwuthri-cloud/QuireAi
|
|
31
|
+
Project-URL: Issues, https://github.com/jwuthri-cloud/QuireAi/issues
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# Quire
|
|
35
|
+
|
|
36
|
+
**A notebook where Claude is a cell.** Quire is a local, single-user, Jupyter-compatible notebook with
|
|
37
|
+
Claude built in: ask Claude in a cell or in the side panel, and it reads your cells, outputs and live
|
|
38
|
+
kernel variables, then answers, edits or runs code with your permission.
|
|
39
|
+
|
|
40
|
+

|
|
41
|
+
|
|
42
|
+
- **Jupyter-compatible.** Real Jupyter kernels, plain `.ipynb` files. Open any notebook you already have.
|
|
43
|
+
- **Claude in the notebook.** Questions for Claude are cells; the side panel shares the same chats.
|
|
44
|
+
- **Inspectable context.** Claude sees the notebook through an explicit context packet (cells, outputs,
|
|
45
|
+
variables) that you can open and read.
|
|
46
|
+
- **No API key.** Claude runs through your local `claude` CLI and its login. Codex and opencode work the
|
|
47
|
+
same way, through their own CLIs.
|
|
48
|
+
- **Several notebooks in one window.** A files sidebar and a tab per notebook, each with its own kernel.
|
|
49
|
+
- **Local only.** Serves on `127.0.0.1` behind a one-time login link.
|
|
50
|
+
|
|
51
|
+
The [example notebooks](https://github.com/jwuthri-cloud/QuireAi/blob/main/examples/README.md) show every feature below, with their outputs saved.
|
|
52
|
+
|
|
53
|
+
## Contents
|
|
54
|
+
|
|
55
|
+
- [Requirements](#requirements) · [Quick start](#quick-start) · [How Claude is reached](#how-claude-is-reached)
|
|
56
|
+
· [The notebook's Python](#the-notebooks-python)
|
|
57
|
+
- [Tour](#tour): files and tabs, cells, Claude in a cell and in the panel, modes, mentions, chats, other
|
|
58
|
+
agents, arms, outputs, rich output, widgets, outline, Git, find, variables, terminal, debugger, export, themes,
|
|
59
|
+
layout
|
|
60
|
+
- [Keys](#keys) · [Security model](#security-model) · [Limits](#limits) · [Project layout](#project-layout)
|
|
61
|
+
· [Develop](#develop)
|
|
62
|
+
|
|
63
|
+
## Requirements
|
|
64
|
+
|
|
65
|
+
| Tool | Version | Why |
|
|
66
|
+
|---|---|---|
|
|
67
|
+
| Python | ≥ 3.13 | runs the server and kernels |
|
|
68
|
+
| [uv](https://docs.astral.sh/uv/) | recent | from source only: Python env + deps |
|
|
69
|
+
| Node.js | ≥ 22 | from source only: builds the web app |
|
|
70
|
+
| [Claude Code](https://docs.claude.com/en/docs/claude-code) (`claude`) | signed in | runs Claude (`claude`, then `/login`, or workload identity federation) |
|
|
71
|
+
|
|
72
|
+
## Quick start
|
|
73
|
+
|
|
74
|
+
From PyPI (the package is `quireai`, the command is `quire`):
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
uvx --from quireai quire my-notebook.ipynb # run without installing
|
|
78
|
+
pip install quireai && quire . # or install it
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
From source:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
git clone https://github.com/jwuthri-cloud/QuireAi.git && cd QuireAi
|
|
85
|
+
(cd web && npm install && npm run build)
|
|
86
|
+
cd server && uv sync && uv run quire ../examples/01-basics.ipynb
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Quire prints a login link and opens it in your browser:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
Quire is serving .../QuireAi/examples
|
|
93
|
+
|
|
94
|
+
http://127.0.0.1:8765/api/login?token=...&path=01-basics.ipynb
|
|
95
|
+
|
|
96
|
+
Ctrl+C stops it.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`quire [folder or notebook]` serves that folder (default: the current one), and opens the notebook if you
|
|
100
|
+
name one. The files sidebar on the left browses the folder and makes new notebooks. Options:
|
|
101
|
+
|
|
102
|
+
| Flag | Default | Meaning |
|
|
103
|
+
|---|---|---|
|
|
104
|
+
| `--port` | `8765` | port to serve on |
|
|
105
|
+
| `--model` | your Claude Code default | Claude model to use for new chats |
|
|
106
|
+
| `--no-browser` | off | print the link, don't open it |
|
|
107
|
+
| `--dev` | off | serve the API only, for the Vite dev server |
|
|
108
|
+
|
|
109
|
+
Quire saves the notebook by itself a second after each change (`Cmd+S` saves at once). If another program
|
|
110
|
+
changes the file on disk, Quire pauses saving and asks which version to keep.
|
|
111
|
+
|
|
112
|
+
### On another machine
|
|
113
|
+
|
|
114
|
+
Start Quire there with `--no-browser --port N`, forward the same port, and open the printed link locally.
|
|
115
|
+
The port must be the same on both sides.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
ssh -N -L N:127.0.0.1:N host
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## How Claude is reached
|
|
122
|
+
|
|
123
|
+
Quire talks to Claude through the [Claude Agent SDK](https://docs.claude.com/en/docs/claude-code/sdk), which
|
|
124
|
+
runs the `claude` CLI found on your `PATH`. It uses whatever login `claude` uses on that machine: Quire has
|
|
125
|
+
no API key and asks for none. If `claude` works in a terminal, Quire works.
|
|
126
|
+
|
|
127
|
+
- **Model.** `--model` sets the default; the model picker in the panel's message box changes it for the
|
|
128
|
+
chat (your Claude Code default, Fable, Opus, Sonnet or Haiku). Changing the model keeps the conversation.
|
|
129
|
+
- **Instructions.** Quire gives Claude its own system prompt, which you can read and change in the app
|
|
130
|
+
([System prompt](#system-prompt)). It does not load `CLAUDE.md` or your Claude Code settings.
|
|
131
|
+
- **Chats** live in `~/.quire/sessions/`, never in the notebook. The notebook keeps only each question
|
|
132
|
+
and its final answer.
|
|
133
|
+
|
|
134
|
+
### Other agents: Codex and opencode
|
|
135
|
+
|
|
136
|
+
A chat can also run on [Codex](https://github.com/openai/codex) (`codex app-server`) or
|
|
137
|
+
[opencode](https://opencode.ai) (`opencode acp`), each through its own CLI and its own login. Quire looks
|
|
138
|
+
for the command on your `PATH`, then in `~/.local/bin`, and never reads or sets a key.
|
|
139
|
+
|
|
140
|
+
- **Choose the agent** in the picker beside the model picker in the panel's message box. An agent that
|
|
141
|
+
cannot run here is marked "not available"; its tooltip says why and which command fixes it (for
|
|
142
|
+
example `codex login`, or `opencode auth login`). Choose it again after you fix it: Quire checks once
|
|
143
|
+
more. The model picker lists the models the chat's agent offers.
|
|
144
|
+
- **A chat belongs to one agent.** Choosing another agent in a chat that has turns opens a new chat. Arms
|
|
145
|
+
run on the agent of the chat that starts them.
|
|
146
|
+
- **The same tools and modes.** These CLIs reach the notebook tools over a small MCP server on
|
|
147
|
+
`127.0.0.1`, with a token for each chat. Read, Ask and Auto are enforced on Quire's side, in each tool
|
|
148
|
+
call; the CLIs' own tools (shell, file edits) are turned off for the run, without touching your config
|
|
149
|
+
files.
|
|
150
|
+
- They get the same system prompt as Claude, with one line in front that names them.
|
|
151
|
+
|
|
152
|
+
Codex and opencode support is new: it is tested against the two CLIs' recorded protocols (codex-cli
|
|
153
|
+
0.166, opencode 1.19), not yet in daily use.
|
|
154
|
+
|
|
155
|
+
## The notebook's Python
|
|
156
|
+
|
|
157
|
+
Each notebook gets its own Jupyter kernel. Quire picks the Python for it in this order:
|
|
158
|
+
|
|
159
|
+
1. the interpreter named in the notebook's metadata (`metadata.quire.python`, a path), if any;
|
|
160
|
+
2. the nearest `.venv` above the notebook (the notebook's folder, then each parent folder);
|
|
161
|
+
3. Quire's own Python, shown as **built-in** next to the kernel's state. It has no project packages.
|
|
162
|
+
|
|
163
|
+
The chosen Python needs `ipykernel`. If it has none, Quire says so and prints the command that installs it.
|
|
164
|
+
|
|
165
|
+
To give a folder of notebooks its packages, make a `.venv` there, for example with uv:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
cd my-notebooks
|
|
169
|
+
uv venv
|
|
170
|
+
uv pip install ipykernel pandas matplotlib
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Then restart Quire: it picks the Python when it first starts a notebook's kernel, and a kernel restart
|
|
174
|
+
keeps it. Packages you add later to the same `.venv` only need a kernel restart (`0 0`), or none at all
|
|
175
|
+
for a package that was not imported yet. [`examples/`](https://github.com/jwuthri-cloud/QuireAi/blob/main/examples/README.md) has a `pyproject.toml` for its
|
|
176
|
+
notebooks.
|
|
177
|
+
|
|
178
|
+
## Tour
|
|
179
|
+
|
|
180
|
+
### Files and tabs
|
|
181
|
+
|
|
182
|
+
The sidebar on the left shows the **Files** of the served folder, or the **Outline** of the open notebook.
|
|
183
|
+
`Cmd+Shift+E`, or the folder button of the toolbar, shows the files. The tree lists every file (not hidden
|
|
184
|
+
files, tool folders or virtual environments), marks the notebooks open in a tab and those with a running
|
|
185
|
+
kernel, and makes a new notebook in the selected folder.
|
|
186
|
+
|
|
187
|
+
Each notebook opens in a tab in the top bar, with its own kernel, chats and panel. Other files open in a
|
|
188
|
+
tab too: a text file (UTF-8, up to 2 MB) in an editor with line numbers, which `Cmd+S` saves; an image as a
|
|
189
|
+
picture; any other file as one line with its size. Text is shown as text only: Markdown is not rendered.
|
|
190
|
+
If the file changed on disk since Quire read it, saving asks whether to reload it or overwrite it.
|
|
191
|
+
Closing a tab with unsaved edits asks first. A switch keeps the
|
|
192
|
+
scroll position and the selection, and a cell running in a hidden tab goes on. The open tabs come back
|
|
193
|
+
after a reload. Closing a tab (or a middle click) closes the view only: the kernel keeps running. A right
|
|
194
|
+
click on a tab has **Shut down the kernel**.
|
|
195
|
+
|
|
196
|
+

|
|
197
|
+
|
|
198
|
+
### Cells
|
|
199
|
+
|
|
200
|
+
Code, text (Markdown) and raw cells, as in Jupyter, plus a fourth kind: a question for Claude. The
|
|
201
|
+
toolbar above the notebook runs cells, runs all, stops and restarts the kernel, adds, cuts, copies, pastes
|
|
202
|
+
and moves cells, and sets the kind of the selected cell. Each cell's number is in the gutter (`@1`, `@2`,
|
|
203
|
+
...): it is how you point Claude at a cell. The `⋯` menu of a cell also has **Pin** (always in Claude's
|
|
204
|
+
context) and **Hide from Claude** (never sent to Claude).
|
|
205
|
+
|
|
206
|
+
### Claude in a cell and in the panel
|
|
207
|
+
|
|
208
|
+
Press `c` (or "Ask Claude" between cells), type a question, `Shift+Enter`. Claude answers under it, and
|
|
209
|
+
in Ask or Auto mode it can add, edit and run cells. Each answer shows what Claude did (each tool call),
|
|
210
|
+
a **context** box with exactly what was sent (by section, with token counts), and **Reply…** for a
|
|
211
|
+
follow-up. `o` collapses a long one.
|
|
212
|
+
|
|
213
|
+

|
|
214
|
+
|
|
215
|
+
Every cell that Claude adds or edits is marked until you **Keep** or **Undo** it, one by one or all the
|
|
216
|
+
turn's edits at once. Undo puts back the cell as it was; if you changed the cell since, Quire reports a
|
|
217
|
+
conflict instead of overwriting your work. What Claude ran in the kernel cannot be undone.
|
|
218
|
+
|
|
219
|
+
`Cmd+K` puts the cursor in the side panel. Panel and cells share the same chat: Claude sees both.
|
|
220
|
+
|
|
221
|
+
In the `.ipynb` a question is a Markdown cell with the prompt and the answer, so Jupyter and GitHub show
|
|
222
|
+
it; the structured copy is in `metadata.quire`.
|
|
223
|
+
|
|
224
|
+
### Permission modes
|
|
225
|
+
|
|
226
|
+
| Mode | Claude can |
|
|
227
|
+
|---|---|
|
|
228
|
+
| **Read** | only read |
|
|
229
|
+
| **Ask** | propose edits you keep or undo; asks before running code |
|
|
230
|
+
| **Auto** | edit and run without asking |
|
|
231
|
+
|
|
232
|
+
The mode is in the panel's message box; `Shift+Tab` there switches it.
|
|
233
|
+
|
|
234
|
+
### Mentions
|
|
235
|
+
|
|
236
|
+
- `@3` — cell 3. `@above` — every cell above the asking one (in the panel: every cell).
|
|
237
|
+
- `$name` — a kernel variable.
|
|
238
|
+
|
|
239
|
+
Typing `@` or `$` offers the cells and variables. Referenced cells and variables are sent in full, cut
|
|
240
|
+
to the context budget.
|
|
241
|
+
|
|
242
|
+

|
|
243
|
+
|
|
244
|
+
### Attachments
|
|
245
|
+
|
|
246
|
+
Images (PNG, JPEG, GIF, WebP) and text files can go with a panel message: paperclip, paste, or drop.
|
|
247
|
+
At most 5 files, 5 MB each, 10 MB total; long text files are cut. Quire does not keep the files.
|
|
248
|
+
|
|
249
|
+
### Chats
|
|
250
|
+
|
|
251
|
+
A notebook can have many chats. The panel header names the open one; its menu reopens earlier ones with
|
|
252
|
+
their timeline and Claude's memory. "New chat" in that menu, or `/clear`, starts a new chat.
|
|
253
|
+
|
|
254
|
+
### System prompt
|
|
255
|
+
|
|
256
|
+
**System prompt** in the chat menu (also in the command palette, and linked from each turn's context box)
|
|
257
|
+
shows the instructions Claude works under, and lets you change them. Your text is kept in
|
|
258
|
+
`~/.quire/system_prompt.md` and counts for every notebook on the computer; saving the built-in text again
|
|
259
|
+
removes the file. Claude Code keeps the prompt a session started with, so after a change each chat goes on
|
|
260
|
+
in a fresh Claude session from its next question: Claude gets the whole notebook again, but not the
|
|
261
|
+
earlier talk.
|
|
262
|
+
|
|
263
|
+
### Arms: try several approaches side by side
|
|
264
|
+
|
|
265
|
+
Ask for it in a cell or in the panel: "try 3 approaches to flag the outliers: z-score, IQR, MAD", or
|
|
266
|
+
just "try 3 approaches for the outliers" and Claude picks them. You get one block with a tab per arm.
|
|
267
|
+
Each arm is a separate Claude with its own cells and its own copy of the kernel's variables, so the
|
|
268
|
+
arms do not overwrite each other, and your notebook does not change until you keep one.
|
|
269
|
+
|
|
270
|
+

|
|
271
|
+
|
|
272
|
+
- **A tab** shows the arm's state, what Claude did, its verdict, and its cells with their outputs. You
|
|
273
|
+
can edit and run a cell in a tab: it runs with that arm's variables.
|
|
274
|
+
- **Keep this arm** makes its cells normal cells and applies what it changed to your variables (no
|
|
275
|
+
re-run). The other arms are removed. **Discard all** removes the block. **Stop** halts one arm.
|
|
276
|
+
- In **Ask** mode you approve the block once; the arms then work in their tabs without asking again.
|
|
277
|
+
In **Read** mode Claude cannot start arms.
|
|
278
|
+
- 2 to 4 arms per block, one block working at a time. `@3` counts a block as one cell. A cell in a tab
|
|
279
|
+
shows `#4`: the place it gets when its arm is kept.
|
|
280
|
+
- A cell you add or paste in a tab belongs to that arm. A deleted cell of an arm comes back in its arm.
|
|
281
|
+
- The arms work under Quire's own instructions for arms. Your own system prompt is for the chat.
|
|
282
|
+
|
|
283
|
+
What an arm shares with your notebook, because it is the same kernel:
|
|
284
|
+
|
|
285
|
+
| Not shared (until you keep the arm) | Shared |
|
|
286
|
+
|---|---|
|
|
287
|
+
| names it binds, rebinds or deletes | objects changed in place (`df["x"] = ...`, `items.append(...)`): Quire warns on the tab when the shape of one of your variables changed |
|
|
288
|
+
| its cells | module state (`random.seed`, `plt.rcParams`, the working folder), files, GPU memory |
|
|
289
|
+
| | names that start with `_`, and IPython's `In`, `Out`, `_` |
|
|
290
|
+
|
|
291
|
+
The agents think at the same time, but one kernel runs one cell at a time: the cells of all arms take
|
|
292
|
+
turns with each other and with yours. After a kernel restart an arm's cells and verdict are still
|
|
293
|
+
there, its variables are not: keeping it then keeps the cells only.
|
|
294
|
+
|
|
295
|
+
In the `.ipynb` a block is ordinary cells: a summary cell, then the cells of each arm, marked in
|
|
296
|
+
`metadata.quire`. Any notebook program opens it.
|
|
297
|
+
|
|
298
|
+
### Outputs
|
|
299
|
+
|
|
300
|
+
- **Text** with ANSI colours, stdout and stderr, and tracebacks in colour.
|
|
301
|
+
- **Tables** (pandas DataFrames), **images** (PNG, JPEG, SVG), **LaTeX** and **Markdown**.
|
|
302
|
+
- **matplotlib** and **seaborn** plots, as PNG.
|
|
303
|
+
- **HTML.** Plain HTML is drawn in the page, cleaned. HTML with scripts or its own style sheet runs in a
|
|
304
|
+
sandboxed frame.
|
|
305
|
+
- **Plotly** figures (`fig.show()`, or a figure as a cell's last value) are interactive.
|
|
306
|
+
- **Mermaid.** A ```` ```mermaid ```` block in a text cell, or in an answer from Claude, becomes a
|
|
307
|
+
diagram, with a **Source** button to see its text. Text cells also render maths (`$...$`, `$$...$$`) and
|
|
308
|
+
GitHub-style tables and task lists.
|
|
309
|
+
|
|
310
|
+
Scripted HTML, Plotly and Mermaid each run in a sandboxed frame: see [Security model](#security-model).
|
|
311
|
+
|
|
312
|
+
To hide the outputs of a cell, click in the margin on their left, or press `o`. One line stays that says
|
|
313
|
+
how many outputs are hidden, and whether one is an error: a click on it shows them again. They are hidden
|
|
314
|
+
on the page only: they stay in the file, and Claude still reads them.
|
|
315
|
+
|
|
316
|
+
### Rich output
|
|
317
|
+
|
|
318
|
+
The kernel draws four things with [rich](https://github.com/Textualize/rich): the result of a cell,
|
|
319
|
+
`print` in the notebook, `logging`, and tracebacks. A list, a dict or a dataclass is laid out to the
|
|
320
|
+
width of the page; log lines get their level and time; a traceback is a box with the code around each
|
|
321
|
+
frame. The colours are the 16 standard ANSI colours, so the theme draws them, and a saved notebook reads
|
|
322
|
+
the same in any Jupyter front end. Claude reads the text without the colour codes.
|
|
323
|
+
|
|
324
|
+
- `print` keeps its text exactly. A `print` to a file, or of text with control characters (a `\r`
|
|
325
|
+
progress line, colour codes), is Python's own `print`. Imported modules keep Python's `print`.
|
|
326
|
+
- `logging.basicConfig()` with no handler, stream, file or format gets rich's handler; a call that sets
|
|
327
|
+
its own format is left alone.
|
|
328
|
+
- Quire uses the `rich` of the notebook's environment; when it has none, Quire lends its own copy, and
|
|
329
|
+
nothing else of Quire's packages. Hover the kernel's state to see which `rich` is in use.
|
|
330
|
+
- To turn it off for a notebook, set `"rich_output": false` in its `quire` metadata.
|
|
331
|
+
|
|
332
|
+
Claude looks at PNG and JPEG outputs as pictures. An image that exists only as SVG it reads as source
|
|
333
|
+
text, so for a plot Claude should look at, keep PNG on (the default of matplotlib).
|
|
334
|
+
|
|
335
|
+
### Widgets
|
|
336
|
+
|
|
337
|
+
The controls of [ipywidgets](https://ipywidgets.readthedocs.io/) (sliders, text boxes, check boxes,
|
|
338
|
+
buttons, boxes), `interact`, the Output widget (`with out:`) and `tqdm.notebook` progress bars work. Two
|
|
339
|
+
browser tabs on one notebook show the same state. Widgets live in the kernel: after a kernel restart, or
|
|
340
|
+
in a notebook read from disk, a widget shows one line in its place until you run its cell again.
|
|
341
|
+
|
|
342
|
+
Widgets made with [anywidget](https://anywidget.dev) (`anywidget.AnyWidget`, Plotly's `FigureWidget`)
|
|
343
|
+
work too. Their code comes from the kernel, so each one runs in a sandboxed frame, follows the theme,
|
|
344
|
+
and reloads when its code changes. Other widget libraries show one line that names what is missing.
|
|
345
|
+
Quire never loads widget code from the web.
|
|
346
|
+
|
|
347
|
+

|
|
348
|
+
|
|
349
|
+
### Outline and sections
|
|
350
|
+
|
|
351
|
+
`Cmd+Shift+O`, or the first button of the toolbar, shows the outline on the left: the `#`, `##` and `###`
|
|
352
|
+
headings of the text cells, as a tree. A click goes to the cell.
|
|
353
|
+
|
|
354
|
+
A text cell that starts with a heading has a chevron. It folds the section under it: every cell up to the
|
|
355
|
+
next heading of the same or a higher level (`←` / `→` in command mode). Folded cells are only off the
|
|
356
|
+
page: Claude still reads them and "run all" still runs them. The fold is saved in the notebook file
|
|
357
|
+
(`metadata.quire.folded`); Jupyter ignores it.
|
|
358
|
+
|
|
359
|
+
### Git
|
|
360
|
+
|
|
361
|
+
`Cmd+Shift+G`, the **Git** tab of the sidebar or the branch button of the toolbar shows the repository
|
|
362
|
+
that holds the open file. The folder Quire serves need not be a repository itself: it can lie inside
|
|
363
|
+
one or hold several, and the open file says which one is on show.
|
|
364
|
+
|
|
365
|
+
- **Changes** lists the files with a change that the next commit leaves, **Staged** the ones it takes.
|
|
366
|
+
`+` stages a file and `−` takes it out again; the buttons beside the two titles do it for every file.
|
|
367
|
+
A file edited after it was staged is in both lists.
|
|
368
|
+
- A click on a notebook opens it and shows its changes since the last commit, cell by cell, with the
|
|
369
|
+
text you typed but have not saved. A changed cell can take its committed source back.
|
|
370
|
+
- Type a message and press **Commit** (`Cmd+Enter` in the message). Under the message is the name and
|
|
371
|
+
email the commit is signed as. The repository's hooks run, as with `git commit` in a terminal. When a
|
|
372
|
+
hook or git says no, its words are shown and the message stays.
|
|
373
|
+
- When the served folder is itself in a repository, the first line of the files names the branch and
|
|
374
|
+
each changed file carries a letter (`M`, `A`, `U`...). The box button there keeps outputs out of
|
|
375
|
+
commits: with it on, commits of notebooks hold the cells and no outputs.
|
|
376
|
+
|
|
377
|
+
Quire has no pull, push, branch switch or merge: use the terminal (`Cmd+J`) for those.
|
|
378
|
+
|
|
379
|
+
### Find and replace
|
|
380
|
+
|
|
381
|
+
`Cmd+F`, or `f` in command mode, opens the find bar over the sources of the cells. Options: match case, whole word, regular expression. `Enter` / `Shift+Enter` go to the next and
|
|
382
|
+
previous match; the second row replaces one match or all.
|
|
383
|
+
|
|
384
|
+
### Variables
|
|
385
|
+
|
|
386
|
+
`Cmd+Shift+I`, or "Variables" in the toolbar, opens the kernel's variables in the drawer under the
|
|
387
|
+
notebook. The list follows the kernel: it updates after each run.
|
|
388
|
+
|
|
389
|
+
- Click a variable to see it. A pandas or polars DataFrame (or a pandas Series) is a grid, 50 rows to a
|
|
390
|
+
page, with its dtypes and its index:
|
|
391
|
+
- **Sort**: click a column's header (ascending, descending, then the frame's own order).
|
|
392
|
+
- **Filter**: "Filter" adds a condition on a column; all conditions must hold. Text: contains, equals,
|
|
393
|
+
starts with. Numbers and dates: =, ≠, <, ≤, >, ≥, between (dates as `2024-01-31` or
|
|
394
|
+
`2024-01-31 14:30`). Any column: is missing, is not missing. The search box finds text in any column,
|
|
395
|
+
in any case. The grid says "N of M rows".
|
|
396
|
+
- **Summary**: the chart button of a header shows the column's dtype, missing and distinct counts, then
|
|
397
|
+
min, quartiles, max and mean with a histogram for numbers, or the most frequent values for text. It
|
|
398
|
+
covers the filtered rows.
|
|
399
|
+
- **Copy as code**: copies the pandas or polars expression of the filter and the order, to paste in a
|
|
400
|
+
cell (it writes pandas as `pd` and polars as `pl`).
|
|
401
|
+
- **Full size**: opens the same view over the notebook; `Esc` brings it back to the pane.
|
|
402
|
+
- The kernel does the work on your frame, never copies or changes it, and sends one page. Each request
|
|
403
|
+
stops after 8 seconds and says what took too long. A polars LazyFrame shows its schema only: filtering
|
|
404
|
+
it would run its query.
|
|
405
|
+
- An array or a tensor shows its shape, dtype, statistics and a corner of its values. A dict, list, set or
|
|
406
|
+
tuple shows its items. Anything else shows a short description. These are drawn by the server with
|
|
407
|
+
[rich](https://github.com/Textualize/rich), as text in the colours of the theme, as wide as the pane;
|
|
408
|
+
they have no filter.
|
|
409
|
+
|
|
410
|
+

|
|
411
|
+
|
|
412
|
+
### Terminal
|
|
413
|
+
|
|
414
|
+
`Cmd+J`, or "Terminal" in the toolbar, opens a shell on the other tab of the drawer. It is your login
|
|
415
|
+
shell, in the notebook's folder, on the machine that runs Quire (so on the remote machine when Quire runs
|
|
416
|
+
there).
|
|
417
|
+
|
|
418
|
+
- Each notebook has one. It keeps running when you hide it, reload the page or lose the connection, and
|
|
419
|
+
shows its recent output when you come back. "End shell" ends it; so does stopping Quire.
|
|
420
|
+
- Only you reach it: it is behind the same login as the notebook. Claude has no access to it.
|
|
421
|
+
- macOS and Linux only.
|
|
422
|
+
|
|
423
|
+
### Debugger
|
|
424
|
+
|
|
425
|
+
Click beside a line of a code cell to set a breakpoint (or `F9` on the cursor's line), then **Debug cell**
|
|
426
|
+
(`⌥⇧↵`, the cell's `⋯` menu, or the command palette). The cell runs as usual, in turn with the other runs,
|
|
427
|
+
and pauses at the first breakpoint it reaches; with no breakpoint anywhere, it pauses on its first line.
|
|
428
|
+
|
|
429
|
+
- The paused line is marked in its cell, also in a function that an earlier cell defined. A stop in a module
|
|
430
|
+
of your own (a `.py` file) names the file and the line.
|
|
431
|
+
- The **Debugger** tab of the drawer shows the call stack, the variables of the chosen frame as a tree, and a
|
|
432
|
+
box that evaluates an expression in that frame. Continue `F8`, step over `F10`, step in `F11`, step out
|
|
433
|
+
`⇧F11`; stop `⇧F8` ends the session and interrupts the run. Interrupt, restart and shutdown also end it.
|
|
434
|
+
- Only your code stops: libraries, IPython, ipykernel and Quire's own helper are stepped over.
|
|
435
|
+
- Breakpoints live in the page, per cell, and follow their lines as you edit; they are not saved in the
|
|
436
|
+
notebook. Two tabs of a notebook show the same session.
|
|
437
|
+
- While the code is paused, the runs queued behind it wait, Claude's included; the Variables tab and
|
|
438
|
+
Claude's reads of variables still answer. The kernel's state says **paused**.
|
|
439
|
+
- It needs ipykernel with debugpy (ipykernel brings it). A kernel that cannot debug says why, and **Debug
|
|
440
|
+
cell** is off. Cells of arms cannot be debugged.
|
|
441
|
+
|
|
442
|
+
### Export
|
|
443
|
+
|
|
444
|
+
The **Export** menu in the toolbar (also in the command palette) saves the open notebook as a file named
|
|
445
|
+
after it. It holds what the page shows now, unsaved edits and hidden cells included.
|
|
446
|
+
|
|
447
|
+
- **Python script (`.py`)** in [Jupytext](https://jupytext.readthedocs.io)'s percent format: `# %%`
|
|
448
|
+
starts a code cell, text cells are comments, questions to Claude and arms become Markdown cells,
|
|
449
|
+
IPython magics are commented out. No outputs.
|
|
450
|
+
- **HTML file** with every output, that opens from disk with no network: plotly.js and mermaid are put in
|
|
451
|
+
the file only when a figure or a diagram needs them. Scripted outputs stay in sandboxed frames.
|
|
452
|
+
- **PDF**: that HTML file, printed by the browser in a new tab.
|
|
453
|
+
|
|
454
|
+
### Themes
|
|
455
|
+
|
|
456
|
+
The palette button in the top bar lists the themes; the command palette has them too ("Theme: ..."). Two
|
|
457
|
+
are Quire's own (Ink, Paper). The others follow code editor themes: Monokai and Mariana (Sublime Text),
|
|
458
|
+
Dark+ and Light+ (VS Code), One Dark, Dracula, Nord, Solarized Dark, Solarized Light and GitHub Light.
|
|
459
|
+
They colour code as those editors do: keywords, `def`/`class`, constants, names of functions and classes,
|
|
460
|
+
variables and operators each get their own colour. The choice is kept in the browser.
|
|
461
|
+
|
|
462
|
+
### Layout and the command palette
|
|
463
|
+
|
|
464
|
+
Drag the edge of the sidebar, of the Claude panel, or of the drawer (terminal, variables and debugger), to
|
|
465
|
+
resize it; the arrow keys work on the edge too, and a double click gives it its own size back. The sizes
|
|
466
|
+
are kept in the browser.
|
|
467
|
+
The button at the right of the top bar shows or hides the panel.
|
|
468
|
+
|
|
469
|
+
`Cmd+Shift+P` opens the command palette: every command, with its key, to search by name.
|
|
470
|
+
|
|
471
|
+
## Keys
|
|
472
|
+
|
|
473
|
+
| Key | Action |
|
|
474
|
+
|---|---|
|
|
475
|
+
| `Shift+Enter` / `Cmd+Enter` | run cell and go to the next / run cell |
|
|
476
|
+
| `Enter` / `Esc` | edit mode / command mode |
|
|
477
|
+
| `j` / `k` (or `↓` / `↑`) | select the next / previous cell |
|
|
478
|
+
| `a` / `b` | insert cell above / below |
|
|
479
|
+
| `x` / `v` | cut cell / paste it below (`Cmd+X`, `Cmd+C`, `Cmd+V` work too) |
|
|
480
|
+
| `d d` / `z` | delete cell / put the deleted cell back |
|
|
481
|
+
| `y` / `m` / `r` | change the cell to code / text / raw |
|
|
482
|
+
| `i i` / `0 0` | interrupt / restart the kernel |
|
|
483
|
+
| `c` | ask Claude here (new agent cell) |
|
|
484
|
+
| `o` | collapse or expand a question for Claude, or the outputs of a code cell |
|
|
485
|
+
| `←` / `→` | fold / unfold the section under the selected heading |
|
|
486
|
+
| `Cmd+S` | save |
|
|
487
|
+
| `Cmd+Shift+E` / `Cmd+Shift+O` / `Cmd+Shift+G` | show or hide the files / the outline / Git |
|
|
488
|
+
| `Cmd+K` | ask in the panel |
|
|
489
|
+
| `Cmd+J` | show or hide the terminal |
|
|
490
|
+
| `Cmd+F` / `f` | find and replace in the cells |
|
|
491
|
+
| `Cmd+Shift+I` | show or hide the variables |
|
|
492
|
+
| `F9` / `⌥⇧↵` | set or clear a breakpoint / debug the cell |
|
|
493
|
+
| `F8` / `F10` / `F11` / `⇧F11` / `⇧F8` | continue / step over / step in / step out / stop (while debugging) |
|
|
494
|
+
| `Cmd+Shift+P` | all commands |
|
|
495
|
+
| `Shift+Tab` (in panel) | switch permission mode |
|
|
496
|
+
| `Shift+Tab` (in a code cell) | the kernel's docs for the name at the cursor (after spaces only: dedent) |
|
|
497
|
+
| `Ctrl+Space` (in a code cell) | completions from the kernel and the editor |
|
|
498
|
+
| `Tab` (in a code cell) | right after code: the completions, and with the list open, the chosen one. Elsewhere: indent |
|
|
499
|
+
|
|
500
|
+
In a code cell, completions come from the running kernel (attributes of live objects, dict keys, paths,
|
|
501
|
+
magics) together with the editor's own, each with its kind. Hovering a name shows its signature and
|
|
502
|
+
docstring, and typing `(` or `,` in a call shows that call's signature (`Esc` closes it). With ipykernel 7
|
|
503
|
+
or later it works while a cell runs. With the kernel off, only the editor's own completion is there: typing never starts a kernel.
|
|
504
|
+
|
|
505
|
+
On Linux, `Ctrl` takes the place of `Cmd`.
|
|
506
|
+
|
|
507
|
+
## Security model
|
|
508
|
+
|
|
509
|
+
Quire runs code on your computer, and lets Claude run code there: run it only on notebooks and folders
|
|
510
|
+
you are willing to execute. Within that, it keeps a page or a notebook from doing more than it should.
|
|
511
|
+
|
|
512
|
+
- **Local only.** The server listens on `127.0.0.1`. Each start makes a new random launch token; the
|
|
513
|
+
printed link exchanges it for a session cookie (named after the port). Every request needs that cookie,
|
|
514
|
+
a `Host` header naming this server (against DNS rebinding) and, when the browser sends one, an `Origin`
|
|
515
|
+
of this app (against other sites' scripts).
|
|
516
|
+
- **A notebook from disk is untrusted.** Outputs that carry scripts (HTML with `<script>`, Plotly,
|
|
517
|
+
Mermaid) run in frames with `sandbox="allow-scripts"` and no same-origin access: they cannot read the
|
|
518
|
+
page or its cookie, or call Quire's API. Other HTML and the HTML of widgets are cleaned with DOMPurify
|
|
519
|
+
before they reach the page; Markdown is drawn without its raw HTML. The code of ipywidgets comes from
|
|
520
|
+
Quire's own bundle, never from a URL. An anywidget's code comes from the kernel and runs in a sandboxed
|
|
521
|
+
frame; the page reads each message from that frame as untrusted.
|
|
522
|
+
- **Paths stay in the served folder.** Every path from the page is checked: no absolute path, no `..`,
|
|
523
|
+
no symbolic link that leaves the folder.
|
|
524
|
+
- **Files are shown, never run.** A text file is shown as text. An image is served with
|
|
525
|
+
`Content-Security-Policy: sandbox` and `nosniff`, so an SVG opened at its address cannot run a script
|
|
526
|
+
in Quire's origin. Quire saves a text file only over an existing one, never a notebook.
|
|
527
|
+
- **Git runs nothing while you look.** To list the changes and to read a commit, Quire calls git with
|
|
528
|
+
hooks, filter programs, the file-system monitor and every transport turned off, so a repository from
|
|
529
|
+
someone else cannot make it run a program. Two actions are your own git, and happen only on your click
|
|
530
|
+
in the Git tab: staging runs the repository's clean filters (Git LFS, Quire's own), and a commit runs
|
|
531
|
+
its hooks, as both do in a terminal.
|
|
532
|
+
- **Claude works within its mode.** In Read mode it can only read; in Ask mode it asks before it runs
|
|
533
|
+
code, and every edit can be undone. Cells you hide from Claude are left out of its context and its
|
|
534
|
+
tools refuse to read them. Claude has no access to the terminal. Codex and opencode get the same tools
|
|
535
|
+
through an MCP server on `127.0.0.1` that takes only the chat's own token and refuses requests from a
|
|
536
|
+
web page.
|
|
537
|
+
|
|
538
|
+
## Limits
|
|
539
|
+
|
|
540
|
+
- One user, on one computer (or one machine reached through an SSH tunnel). No sharing or collaboration
|
|
541
|
+
between people; two tabs on one notebook stay in step.
|
|
542
|
+
- Python kernels only.
|
|
543
|
+
- Each turn starts with a context packet of about 6,000 tokens: long cells, outputs and variables are
|
|
544
|
+
cut to fit. Claude reads more with its tools (a cell, an output, a variable) when it needs to.
|
|
545
|
+
- The terminal works on macOS and Linux only.
|
|
546
|
+
- Widgets: `@jupyter-widgets/base`, `@jupyter-widgets/controls`, the Output widget and anywidget. An
|
|
547
|
+
anywidget's code is limited to 20 MB. anywidget support is tested against its front-end contract, not
|
|
548
|
+
yet with many real widgets.
|
|
549
|
+
- Codex and opencode are new and less tried than Claude.
|
|
550
|
+
- Lock files are not in the repository: installs resolve fresh, with a 7-day release cooldown.
|
|
551
|
+
|
|
552
|
+
## Project layout
|
|
553
|
+
|
|
554
|
+
```
|
|
555
|
+
server/ Python: Starlette + jupyter_client + claude-agent-sdk
|
|
556
|
+
src/quire/
|
|
557
|
+
agent/ conversations (the chat, the arms), tools, prompts, attachments; backends/ for Claude,
|
|
558
|
+
Codex and opencode, and the MCP server for the CLIs
|
|
559
|
+
context/ context packet: cells, variables, token budget
|
|
560
|
+
doc/ notebook model, .ipynb I/O, checkpoints, blocks of arms
|
|
561
|
+
kernel/ kernel lifecycle, execution, variables, widgets, rich output
|
|
562
|
+
files.py the files sidebar's folder listing and path checks
|
|
563
|
+
web/ React + TypeScript + Vite, CodeMirror 6, plain CSS tokens
|
|
564
|
+
examples/ example notebooks, one per feature, and their environment
|
|
565
|
+
docs/img/ screenshots for this page
|
|
566
|
+
spikes/ de-risking scripts (Agent SDK, kernel protocol)
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
## Develop
|
|
570
|
+
|
|
571
|
+
```bash
|
|
572
|
+
# server
|
|
573
|
+
cd server && uv sync && uv run pytest # add `-m live` for one real turn through `claude`
|
|
574
|
+
ruff check server # from the repo root
|
|
575
|
+
|
|
576
|
+
# web
|
|
577
|
+
cd web && npm install && npm test && npm run typecheck
|
|
578
|
+
|
|
579
|
+
# hot reload: API on :8765, Vite on :5173
|
|
580
|
+
cd server && uv run quire ../examples --dev
|
|
581
|
+
cd web && npm run dev
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
Notes:
|
|
585
|
+
|
|
586
|
+
- `uv` resolves packages with a 7-day release cooldown (`exclude-newer` in `pyproject.toml`).
|
|
587
|
+
- Lock files (`uv.lock`, `package-lock.json`) are gitignored on purpose: they name the package index of
|
|
588
|
+
the machine that made them.
|
|
589
|
+
- A [gitleaks](https://github.com/gitleaks/gitleaks) pre-commit hook is configured: `pre-commit install`.
|
|
590
|
+
|
|
591
|
+
### Release to PyPI
|
|
592
|
+
|
|
593
|
+
1. Bump `version` in `server/pyproject.toml` and commit.
|
|
594
|
+
2. Publish a GitHub release (tag `vX.Y.Z`). The [publish workflow](https://github.com/jwuthri-cloud/QuireAi/blob/main/.github/workflows/publish.yml)
|
|
595
|
+
builds the web app into the package (`server/src/quire/static/`), builds the sdist and wheel, and uploads
|
|
596
|
+
them with PyPI trusted publishing (no token).
|
|
597
|
+
|
|
598
|
+
To build locally: `(cd web && npm run build) && (cd server && uv build)`; the files land in `server/dist/`.
|