diff-chat 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.
- diff_chat-0.1.0/.github/ISSUE_TEMPLATE/bug.yml +39 -0
- diff_chat-0.1.0/.github/ISSUE_TEMPLATE/feature.yml +15 -0
- diff_chat-0.1.0/.github/workflows/publish.yml +61 -0
- diff_chat-0.1.0/.github/workflows/tests.yml +34 -0
- diff_chat-0.1.0/.gitignore +67 -0
- diff_chat-0.1.0/CHANGELOG.md +15 -0
- diff_chat-0.1.0/CONTRIBUTING.md +21 -0
- diff_chat-0.1.0/LICENSE +21 -0
- diff_chat-0.1.0/PKG-INFO +101 -0
- diff_chat-0.1.0/README.md +83 -0
- diff_chat-0.1.0/SECURITY.md +5 -0
- diff_chat-0.1.0/Start diff.command +41 -0
- diff_chat-0.1.0/adapters/README.md +28 -0
- diff_chat-0.1.0/adapters/__init__.py +48 -0
- diff_chat-0.1.0/adapters/_base.py +102 -0
- diff_chat-0.1.0/adapters/_cli.py +405 -0
- diff_chat-0.1.0/adapters/claude.py +141 -0
- diff_chat-0.1.0/adapters/gemini.py +323 -0
- diff_chat-0.1.0/adapters/gpt.py +217 -0
- diff_chat-0.1.0/adapters/local.py +146 -0
- diff_chat-0.1.0/adapters/registry.py +33 -0
- diff_chat-0.1.0/api_fallback.py +189 -0
- diff_chat-0.1.0/app.py +827 -0
- diff_chat-0.1.0/app_preferences.py +205 -0
- diff_chat-0.1.0/archive_schema.py +142 -0
- diff_chat-0.1.0/attachments.py +129 -0
- diff_chat-0.1.0/chat_titles.py +60 -0
- diff_chat-0.1.0/connection_handoff.py +64 -0
- diff_chat-0.1.0/context_engine.py +256 -0
- diff_chat-0.1.0/conversation_actions.py +160 -0
- diff_chat-0.1.0/diff_launcher.py +93 -0
- diff_chat-0.1.0/discussion.py +239 -0
- diff_chat-0.1.0/docs/DEMO_SCRIPT.md +21 -0
- diff_chat-0.1.0/docs/RELEASE_CHECKLIST.md +76 -0
- diff_chat-0.1.0/docs/RELEASE_NOTES_v0.1.0.md +18 -0
- diff_chat-0.1.0/docs/antigravity-probe.txt +161 -0
- diff_chat-0.1.0/docs/banner-dark.svg +17 -0
- diff_chat-0.1.0/docs/banner.svg +15 -0
- diff_chat-0.1.0/docs/cli-adapters.md +48 -0
- diff_chat-0.1.0/docs/demo.gif +0 -0
- diff_chat-0.1.0/docs/demo.mp4 +0 -0
- diff_chat-0.1.0/history_search.py +68 -0
- diff_chat-0.1.0/library_manager.py +251 -0
- diff_chat-0.1.0/macos/Icon.svg +13 -0
- diff_chat-0.1.0/macos/Info.plist +21 -0
- diff_chat-0.1.0/macos/build-requirements.txt +18 -0
- diff_chat-0.1.0/macos/build.sh +64 -0
- diff_chat-0.1.0/macos/diff.icns +0 -0
- diff_chat-0.1.0/macos/main.m +537 -0
- diff_chat-0.1.0/macos/notices.py +52 -0
- diff_chat-0.1.0/macos/render-icon.sh +16 -0
- diff_chat-0.1.0/memory.example.md +1 -0
- diff_chat-0.1.0/model_options.py +132 -0
- diff_chat-0.1.0/plan_usage.py +72 -0
- diff_chat-0.1.0/private_store.py +71 -0
- diff_chat-0.1.0/probe.py +195 -0
- diff_chat-0.1.0/prompts/about_you_export.md +19 -0
- diff_chat-0.1.0/pyproject.toml +41 -0
- diff_chat-0.1.0/requirements.txt +6 -0
- diff_chat-0.1.0/runtime_paths.py +195 -0
- diff_chat-0.1.0/scripts/check_participant_isolation.py +6 -0
- diff_chat-0.1.0/scripts/clean_install_test.ps1 +24 -0
- diff_chat-0.1.0/scripts/clean_install_test.sh +22 -0
- diff_chat-0.1.0/scripts/demo_seed.py +42 -0
- diff_chat-0.1.0/scripts/sandbox_test.py +113 -0
- diff_chat-0.1.0/server_security.py +100 -0
- diff_chat-0.1.0/settings.json +6 -0
- diff_chat-0.1.0/setup_status.py +123 -0
- diff_chat-0.1.0/shared_memory.py +189 -0
- diff_chat-0.1.0/static/about-you-parser.js +46 -0
- diff_chat-0.1.0/static/about-you.js +171 -0
- diff_chat-0.1.0/static/actions.css +275 -0
- diff_chat-0.1.0/static/actions.js +650 -0
- diff_chat-0.1.0/static/app.css +345 -0
- diff_chat-0.1.0/static/app.js +1344 -0
- diff_chat-0.1.0/static/attachments.js +80 -0
- diff_chat-0.1.0/static/brand/favicon-32.png +0 -0
- diff_chat-0.1.0/static/brand/icon.svg +11 -0
- diff_chat-0.1.0/static/brand/wordmark-dark.svg +15 -0
- diff_chat-0.1.0/static/brand/wordmark-light.svg +13 -0
- diff_chat-0.1.0/static/characters/CREDITS.md +7 -0
- diff_chat-0.1.0/static/characters/characters.css +37 -0
- diff_chat-0.1.0/static/characters/claude.json +507 -0
- diff_chat-0.1.0/static/characters/claude.png +0 -0
- diff_chat-0.1.0/static/characters/claude.webp +0 -0
- diff_chat-0.1.0/static/characters/gemini.json +54 -0
- diff_chat-0.1.0/static/characters/gemini.png +0 -0
- diff_chat-0.1.0/static/characters/gemini.webp +0 -0
- diff_chat-0.1.0/static/characters/gpt.json +507 -0
- diff_chat-0.1.0/static/characters/gpt.png +0 -0
- diff_chat-0.1.0/static/characters/gpt.webp +0 -0
- diff_chat-0.1.0/static/characters/local.json +387 -0
- diff_chat-0.1.0/static/characters/local.png +0 -0
- diff_chat-0.1.0/static/characters/local.webp +0 -0
- diff_chat-0.1.0/static/characters/player.js +318 -0
- diff_chat-0.1.0/static/chat-filing.js +84 -0
- diff_chat-0.1.0/static/controls.js +194 -0
- diff_chat-0.1.0/static/corners.css +59 -0
- diff_chat-0.1.0/static/craft.css +246 -0
- diff_chat-0.1.0/static/drafts.js +41 -0
- diff_chat-0.1.0/static/index.html +208 -0
- diff_chat-0.1.0/static/library.css +30 -0
- diff_chat-0.1.0/static/library.js +181 -0
- diff_chat-0.1.0/static/memory.js +81 -0
- diff_chat-0.1.0/static/preference-dialog.js +21 -0
- diff_chat-0.1.0/static/preferences.css +56 -0
- diff_chat-0.1.0/static/session.js +46 -0
- diff_chat-0.1.0/static/settings.css +111 -0
- diff_chat-0.1.0/static/settings.js +463 -0
- diff_chat-0.1.0/static/setup.js +238 -0
- diff_chat-0.1.0/static/utility.js +64 -0
- diff_chat-0.1.0/static/vendor/LICENSES.txt +531 -0
- diff_chat-0.1.0/static/vendor/highlight.min.js +1262 -0
- diff_chat-0.1.0/static/vendor/markdown-it.min.js +13 -0
- diff_chat-0.1.0/static/vendor/plex-mono.woff2 +0 -0
- diff_chat-0.1.0/static/vendor/plex-sans.woff2 +0 -0
- diff_chat-0.1.0/storage.py +185 -0
- diff_chat-0.1.0/tests/check_installed.py +120 -0
- diff_chat-0.1.0/tests/test_about_you.py +63 -0
- diff_chat-0.1.0/tests/test_about_you_parser.cjs +24 -0
- diff_chat-0.1.0/tests/test_attachments.py +54 -0
- diff_chat-0.1.0/tests/test_chat_titles.py +41 -0
- diff_chat-0.1.0/tests/test_cli_paths.py +43 -0
- diff_chat-0.1.0/tests/test_cli_sessions.py +114 -0
- diff_chat-0.1.0/tests/test_connections.py +133 -0
- diff_chat-0.1.0/tests/test_context.py +191 -0
- diff_chat-0.1.0/tests/test_conversation_actions.py +153 -0
- diff_chat-0.1.0/tests/test_desktop.py +129 -0
- diff_chat-0.1.0/tests/test_multi_participants.py +193 -0
- diff_chat-0.1.0/tests/test_participant_adapters.py +164 -0
- diff_chat-0.1.0/tests/test_preferences.py +93 -0
- diff_chat-0.1.0/tests/test_server_security.py +111 -0
- diff_chat-0.1.0/tests/test_settings_library.py +160 -0
- diff_chat-0.1.0/tests/test_usage_gemini.py +71 -0
- diff_chat-0.1.0/tests/test_workflows.py +168 -0
- diff_chat-0.1.0/usage_budget.py +77 -0
- diff_chat-0.1.0/usage_claude.py +110 -0
- diff_chat-0.1.0/usage_codex.py +170 -0
- diff_chat-0.1.0/usage_gemini.py +70 -0
- diff_chat-0.1.0/utility_models.py +104 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report unexpected behavior in diff
|
|
3
|
+
body:
|
|
4
|
+
- type: input
|
|
5
|
+
id: system
|
|
6
|
+
attributes:
|
|
7
|
+
label: Operating system and diff version
|
|
8
|
+
placeholder: e.g. macOS 15.5, diff 0.1.0 (Mac app)
|
|
9
|
+
validations:
|
|
10
|
+
required: true
|
|
11
|
+
- type: input
|
|
12
|
+
id: python
|
|
13
|
+
attributes:
|
|
14
|
+
label: Python version
|
|
15
|
+
description: Run python --version, or enter “bundled” for the Mac app.
|
|
16
|
+
validations:
|
|
17
|
+
required: true
|
|
18
|
+
- type: textarea
|
|
19
|
+
id: providers
|
|
20
|
+
attributes:
|
|
21
|
+
label: Which CLIs or local services are involved, and which versions?
|
|
22
|
+
description: See Settings → Models. Include the Ollama model when relevant.
|
|
23
|
+
validations:
|
|
24
|
+
required: true
|
|
25
|
+
- type: textarea
|
|
26
|
+
id: steps
|
|
27
|
+
attributes:
|
|
28
|
+
label: Steps and expected result
|
|
29
|
+
description: Use a fictional prompt. Include what happened and what you expected.
|
|
30
|
+
validations:
|
|
31
|
+
required: true
|
|
32
|
+
- type: textarea
|
|
33
|
+
id: screenshot
|
|
34
|
+
attributes:
|
|
35
|
+
label: Screenshot (optional)
|
|
36
|
+
description: Crop personal chats, account details and the private launch URL before attaching.
|
|
37
|
+
- type: markdown
|
|
38
|
+
attributes:
|
|
39
|
+
value: Please report vulnerabilities privately from the repository’s Security tab.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Suggest an improvement to diff
|
|
3
|
+
body:
|
|
4
|
+
- type: textarea
|
|
5
|
+
id: task
|
|
6
|
+
attributes:
|
|
7
|
+
label: What are you trying to do?
|
|
8
|
+
validations:
|
|
9
|
+
required: true
|
|
10
|
+
- type: textarea
|
|
11
|
+
id: proposal
|
|
12
|
+
attributes:
|
|
13
|
+
label: How would the change help?
|
|
14
|
+
validations:
|
|
15
|
+
required: true
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions: {}
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
16
|
+
with:
|
|
17
|
+
persist-credentials: false
|
|
18
|
+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
19
|
+
with:
|
|
20
|
+
python-version: "3.12"
|
|
21
|
+
- name: Check the release tag
|
|
22
|
+
env:
|
|
23
|
+
RELEASE_TAG: ${{ github.event.release.tag_name }}
|
|
24
|
+
run: |
|
|
25
|
+
python - <<'PY'
|
|
26
|
+
import os
|
|
27
|
+
from pathlib import Path
|
|
28
|
+
import tomllib
|
|
29
|
+
|
|
30
|
+
project = tomllib.loads(Path("pyproject.toml").read_text(encoding="utf-8"))["project"]
|
|
31
|
+
expected = "v" + project["version"]
|
|
32
|
+
if os.environ["RELEASE_TAG"] != expected:
|
|
33
|
+
raise SystemExit(f"Release tag must match the package version: {expected}")
|
|
34
|
+
PY
|
|
35
|
+
- name: Build and validate distributions
|
|
36
|
+
run: |
|
|
37
|
+
python -m pip install build==1.6.1 twine==7.0.0
|
|
38
|
+
python -m build
|
|
39
|
+
python -m twine check --strict dist/*.whl dist/*.tar.gz
|
|
40
|
+
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
41
|
+
with:
|
|
42
|
+
name: python-distributions
|
|
43
|
+
path: |
|
|
44
|
+
dist/*.whl
|
|
45
|
+
dist/*.tar.gz
|
|
46
|
+
if-no-files-found: error
|
|
47
|
+
|
|
48
|
+
publish:
|
|
49
|
+
needs: build
|
|
50
|
+
runs-on: ubuntu-latest
|
|
51
|
+
environment:
|
|
52
|
+
name: pypi
|
|
53
|
+
url: https://pypi.org/project/diff-chat/
|
|
54
|
+
permissions:
|
|
55
|
+
id-token: write
|
|
56
|
+
steps:
|
|
57
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
58
|
+
with:
|
|
59
|
+
name: python-distributions
|
|
60
|
+
path: dist
|
|
61
|
+
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
permissions:
|
|
4
|
+
contents: read
|
|
5
|
+
jobs:
|
|
6
|
+
offline-tests:
|
|
7
|
+
strategy:
|
|
8
|
+
fail-fast: false
|
|
9
|
+
matrix:
|
|
10
|
+
os: [ubuntu-latest, macos-15, windows-latest]
|
|
11
|
+
python: ["3.11", "3.12"]
|
|
12
|
+
runs-on: ${{ matrix.os }}
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
15
|
+
with:
|
|
16
|
+
persist-credentials: false
|
|
17
|
+
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
|
18
|
+
with:
|
|
19
|
+
python-version: ${{ matrix.python }}
|
|
20
|
+
cache: pip
|
|
21
|
+
- run: python -m pip install .
|
|
22
|
+
- run: node --test tests/test_about_you_parser.cjs
|
|
23
|
+
- run: python -m unittest discover -s tests -v
|
|
24
|
+
env:
|
|
25
|
+
TRANSCRIPT_DATA_ROOT: ${{ runner.temp }}/diff-ci-library
|
|
26
|
+
- name: Clean install and authenticated launch (macOS and Linux)
|
|
27
|
+
if: runner.os != 'Windows'
|
|
28
|
+
run: ./scripts/clean_install_test.sh
|
|
29
|
+
env:
|
|
30
|
+
PYTHON: python
|
|
31
|
+
- name: Clean install and authenticated launch (Windows)
|
|
32
|
+
if: runner.os == 'Windows'
|
|
33
|
+
shell: pwsh
|
|
34
|
+
run: ./scripts/clean_install_test.ps1
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Saved conversations, personal settings, and locally installed model clients
|
|
2
|
+
/chats/
|
|
3
|
+
/settings.local.json
|
|
4
|
+
/.runtime/
|
|
5
|
+
|
|
6
|
+
# Local environments and credentials
|
|
7
|
+
.env
|
|
8
|
+
.env.*
|
|
9
|
+
*.env
|
|
10
|
+
!.env.example
|
|
11
|
+
.envrc
|
|
12
|
+
.secrets/
|
|
13
|
+
secrets/
|
|
14
|
+
secrets.json
|
|
15
|
+
token.json
|
|
16
|
+
tokens.json
|
|
17
|
+
.claude/
|
|
18
|
+
.codex/
|
|
19
|
+
.claude.json*
|
|
20
|
+
.credentials.json*
|
|
21
|
+
auth.json*
|
|
22
|
+
auth.lock
|
|
23
|
+
credentials.json*
|
|
24
|
+
.netrc
|
|
25
|
+
*.pem
|
|
26
|
+
*.key
|
|
27
|
+
*.p12
|
|
28
|
+
*.pfx
|
|
29
|
+
|
|
30
|
+
# Development environments, build output, and caches
|
|
31
|
+
.venv/
|
|
32
|
+
venv/
|
|
33
|
+
env/
|
|
34
|
+
node_modules/
|
|
35
|
+
__pycache__/
|
|
36
|
+
*.py[cod]
|
|
37
|
+
.pytest_cache/
|
|
38
|
+
.mypy_cache/
|
|
39
|
+
.ruff_cache/
|
|
40
|
+
.cache/
|
|
41
|
+
.coverage
|
|
42
|
+
.coverage.*
|
|
43
|
+
/build/
|
|
44
|
+
/dist/
|
|
45
|
+
*.egg-info/
|
|
46
|
+
*.log
|
|
47
|
+
.DS_Store
|
|
48
|
+
|
|
49
|
+
# Local memories and transcripts, credentials, temporary launch records
|
|
50
|
+
memory.md
|
|
51
|
+
.sessions/
|
|
52
|
+
sessions/
|
|
53
|
+
.preferences/
|
|
54
|
+
logs/
|
|
55
|
+
*.jsonl
|
|
56
|
+
*.sqlite*
|
|
57
|
+
instance-*.json
|
|
58
|
+
/publication-audit/
|
|
59
|
+
|
|
60
|
+
# Local distributions, recordings-in-progress, provider journals, and demo libraries
|
|
61
|
+
/downloads/
|
|
62
|
+
*.dmg
|
|
63
|
+
*.whl
|
|
64
|
+
*.tar.gz
|
|
65
|
+
*.session
|
|
66
|
+
*.session-*
|
|
67
|
+
/.demo-library/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v0.1.0
|
|
4
|
+
|
|
5
|
+
First public release of diff.
|
|
6
|
+
|
|
7
|
+
- Start a shared conversation with Claude Code, Codex, Antigravity and installed Ollama models. Select participants with chips or @mentions. Choose a model, reasoning level and role for each participant.
|
|
8
|
+
- Continue a round, invite a challenge, combine answers with a participant of your choice, or run a bounded discussion to find agreement. Stop a run at any time.
|
|
9
|
+
- Compare two replies side by side and read a cached summary of common ground and disagreements. Larger rounds support choosing a pair.
|
|
10
|
+
- Share notes across a library or within one chat. Import a profile from another AI, review each fact and see how much memory it uses. Choose a separate model for summaries and comparisons.
|
|
11
|
+
- Resume supported CLI sessions, send new turns incrementally and carry a rolling summary into fresh sessions. View duration, character counts and provider-reported usage.
|
|
12
|
+
- Attach supported text, documents and images. Enable provider-hosted web search on compatible participants.
|
|
13
|
+
- Edit, retry, branch, pin, rename and search chats. Export Markdown or JSON and import a JSON library.
|
|
14
|
+
- Use the Mac Dock app or a local browser. Settings include light and dark themes, type choices, animated characters, reduced-motion support and background notifications.
|
|
15
|
+
- Connect and disconnect individual participants at any time. Each local server uses a fresh access token, checks the request origin and host, and limits CLI tool access.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Contributing to diff
|
|
2
|
+
|
|
3
|
+
Use Python 3.11 or newer and Node.js 20 or newer for the browser parser tests. From the source checkout, create a virtual environment with `python -m venv .venv`. Activate it with `source .venv/bin/activate` in a POSIX shell or `.venv\Scripts\Activate.ps1` in PowerShell.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
python -m pip install -e .
|
|
7
|
+
diff-chat
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Set `TRANSCRIPT_DATA_ROOT` to an empty directory for private development data. `TRANSCRIPT_PORT` selects a separate loopback port if your regular app is running.
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
python -m unittest discover -s tests -v
|
|
14
|
+
node --test tests/test_about_you_parser.cjs
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The offline tests exercise chat history, resuming and summarizing sessions, participant selection, local-server security and shared memory. Use `scripts/clean_install_test.sh` or `scripts/clean_install_test.ps1` to check a built package in a fresh environment. The optional live check, `python scripts/sandbox_test.py`, uses synthetic prompts and consumes provider allowance.
|
|
18
|
+
|
|
19
|
+
For a new participant, implement the registry adapter and test discovery, sending, cancellation and unsupported capabilities. Describe the operating systems and provider versions you checked in your pull request. [Adapter interface](adapters/README.md)
|
|
20
|
+
|
|
21
|
+
Use fictional examples in screenshots, bug reports and fixtures. For private security reports, follow the [security policy](SECURITY.md). Contributions use the [MIT license](LICENSE).
|
diff_chat-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aadil Challawala
|
|
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.
|
diff_chat-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: diff-chat
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A local group chat for model comparisons and shared discussions
|
|
5
|
+
Project-URL: Repository, https://github.com/aadilchallawala-cloud/diff-chat
|
|
6
|
+
Project-URL: Issues, https://github.com/aadilchallawala-cloud/diff-chat/issues
|
|
7
|
+
Project-URL: Changelog, https://github.com/aadilchallawala-cloud/diff-chat/releases
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
|
+
Requires-Dist: fastapi==0.165.0
|
|
12
|
+
Requires-Dist: httpx==0.29.0
|
|
13
|
+
Requires-Dist: keyring==25.7.0
|
|
14
|
+
Requires-Dist: pillow==13.0.0
|
|
15
|
+
Requires-Dist: pypdf==7.2.0
|
|
16
|
+
Requires-Dist: uvicorn==0.55.0
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
<picture>
|
|
20
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/aadilchallawala-cloud/diff-chat/v0.1.0/docs/banner-dark.svg">
|
|
21
|
+
<img src="https://raw.githubusercontent.com/aadilchallawala-cloud/diff-chat/v0.1.0/docs/banner.svg" width="100%" alt="diff">
|
|
22
|
+
</picture>
|
|
23
|
+
|
|
24
|
+
Ask once. Hear from Claude, ChatGPT, Gemini and local models in the same chat — on the plans you already pay for.
|
|
25
|
+
|
|
26
|
+
[](https://github.com/aadilchallawala-cloud/diff-chat/actions/workflows/tests.yml)
|
|
27
|
+
[](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/LICENSE)
|
|
28
|
+
[](https://pypi.org/project/diff-chat/)
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
In the demo, we asked whether a six-person team should try a four-day week. Claude worried that staggering days off would leave just one or two people on duty. ChatGPT pointed out that with a staggered schedule, at least four people could work each day. Claude agreed it had the numbers wrong. By the second round, both backed a three-month trial, provided nobody had to work evenings or days off.
|
|
33
|
+
|
|
34
|
+
## Install
|
|
35
|
+
|
|
36
|
+
You'll need Python 3.11 or newer and [pipx](https://pipx.pypa.io/stable/installation/). Run these commands in a terminal.
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
pipx ensurepath
|
|
40
|
+
pipx install diff-chat
|
|
41
|
+
diff-chat
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The last command opens diff in your browser on macOS, Windows or Linux. If your terminal can't find `diff-chat`, open a new terminal so it picks up the updated PATH. To run a source checkout, use `pipx install .` from the project folder. A signed Mac app is planned.
|
|
45
|
+
|
|
46
|
+
## Connect your first model
|
|
47
|
+
|
|
48
|
+
You can start with one. Setup shows which tools diff found and how to install anything missing. Later, open **Settings → Models → Connect models** to add or disconnect one.
|
|
49
|
+
|
|
50
|
+
| Participant | Tool | What you need | How to connect |
|
|
51
|
+
| --- | --- | --- | --- |
|
|
52
|
+
| Claude | Claude Code 2.1.280 | Claude Pro or higher. [Plans](https://code.claude.com/docs/en/quickstart) | Run `claude auth login --claudeai`. |
|
|
53
|
+
| ChatGPT | Codex CLI 0.166.0 | Any ChatGPT plan, including Free. [Plan details](https://help.openai.com/en/articles/11369540-using-codex-with-your-chatgpt-plan) | Run `codex login`. |
|
|
54
|
+
| Gemini | Antigravity CLI 1.5.20 (`agy`) | An eligible Google account. The free tier works. [Eligibility](https://antigravity.google/docs/faq) | Choose **Connect Gemini**, or run `diff-chat --login-gemini`, then select Google OAuth. |
|
|
55
|
+
| Local | Ollama | Enough space and memory for the model you choose. Ollama is free. [Setup](https://docs.ollama.com/quickstart) | Open Ollama or run `ollama serve`. To download a first model, try `ollama pull gemma3:4b`. |
|
|
56
|
+
|
|
57
|
+
Have Claude Pro? Add a free ChatGPT account for the full experience.
|
|
58
|
+
|
|
59
|
+
## In a chat
|
|
60
|
+
|
|
61
|
+
Click the names beside the message box to choose who replies. To ask just Claude, start your message with `@claude`. You can choose a model and role for each participant, and set the reasoning level where the provider supports it.
|
|
62
|
+
|
|
63
|
+
| After a round | What happens |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| Continue | The participants read each other's answers and reply once more. |
|
|
66
|
+
| Find agreement | They take turns looking for a position everyone accepts. You see the maximum number of replies before you start. |
|
|
67
|
+
| Combine | Choose one participant to write a single answer and flag anything still unresolved. |
|
|
68
|
+
| Compare replies (Diff view) | Read two replies side by side. A short summary covers where everyone in the round agreed and differed. |
|
|
69
|
+
|
|
70
|
+
You can attach a document or a supported image, edit a question, retry a reply, or branch the chat to try another line of argument. Pin chats you come back to often, or search by title and message. You can export a single chat as Markdown or your whole library as Markdown or JSON.
|
|
71
|
+
|
|
72
|
+
**Shared memory** is for things you're tired of repeating. A note can belong to one chat or follow you across chats. **Import from another AI** lets you edit or untick each fact before saving it. Settings also has light and dark themes, font and accent choices, and a switch for the animated characters. The characters follow your system's reduced-motion setting.
|
|
73
|
+
|
|
74
|
+
## How it works
|
|
75
|
+
|
|
76
|
+
`diff-chat` starts a server on `127.0.0.1`. The private link it opens contains a fresh token that protects the API and the live reply stream.
|
|
77
|
+
|
|
78
|
+
For Claude, ChatGPT and Gemini, diff runs the provider's official CLI in an empty temporary folder with file and shell tools restricted. Web search is available where the provider supports it. A CLI that can resume a session gets the new messages since its last turn. When a conversation gets long, diff can use a cheaper model of your choice to summarize it. Local connects to Ollama on your computer and lists the models you've installed. [Adapter details](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/docs/cli-adapters.md)
|
|
79
|
+
|
|
80
|
+
## Privacy
|
|
81
|
+
|
|
82
|
+
Your saved chats, memory and settings stay on your computer. **Settings → Data** shows the folder. diff collects no telemetry.
|
|
83
|
+
|
|
84
|
+
When you invite a cloud model, its provider receives the messages, shared notes and attachments needed for that reply. Its own data and telemetry policies apply. To keep a conversation local, leave only **Local** on in the message box. Ollama will handle the summaries too. If you enable API fallback, diff stores the key in your OS keychain and the provider bills that usage separately. Checking for an update contacts GitHub.
|
|
85
|
+
|
|
86
|
+
## Limitations
|
|
87
|
+
|
|
88
|
+
- Cloud replies, comparisons and summaries draw on your plan. **Find agreement** can use several rounds and still end in disagreement.
|
|
89
|
+
- Usage meters show the allowance left and when it resets, if the provider reports those figures. Gemini gets its reading from Antigravity's `/usage` command. Some accounts show only a weekly allowance. Local has no plan limit.
|
|
90
|
+
- Smaller local models can miss earlier details or struggle with a harder question. Image support depends on the model. Codex may return a whole reply at once.
|
|
91
|
+
- diff depends on the providers' CLI versions, account rules and terms. On Windows, Codex may need Developer Mode to link its local credentials. [Anthropic's CLI guidance](https://code.claude.com/docs/en/legal-and-compliance) · [OpenAI's terms](https://openai.com/policies/terms-of-use/) · [Google's Antigravity terms](https://antigravity.google/terms)
|
|
92
|
+
|
|
93
|
+
Unofficial. Not affiliated with or endorsed by Anthropic, OpenAI, or Google.
|
|
94
|
+
|
|
95
|
+
## Contributing
|
|
96
|
+
|
|
97
|
+
To run the tests or make a change, start with [Contributing](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/CONTRIBUTING.md). For a new participant, see the [adapter guide](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/adapters/README.md). Please report vulnerabilities through the [security policy](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/SECURITY.md).
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
diff is [MIT licensed](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/LICENSE). The fonts and bundled libraries have their own [third-party notices](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/static/vendor/LICENSES.txt). [Character credits](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/static/characters/CREDITS.md)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<picture>
|
|
2
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/aadilchallawala-cloud/diff-chat/v0.1.0/docs/banner-dark.svg">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/aadilchallawala-cloud/diff-chat/v0.1.0/docs/banner.svg" width="100%" alt="diff">
|
|
4
|
+
</picture>
|
|
5
|
+
|
|
6
|
+
Ask once. Hear from Claude, ChatGPT, Gemini and local models in the same chat — on the plans you already pay for.
|
|
7
|
+
|
|
8
|
+
[](https://github.com/aadilchallawala-cloud/diff-chat/actions/workflows/tests.yml)
|
|
9
|
+
[](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/LICENSE)
|
|
10
|
+
[](https://pypi.org/project/diff-chat/)
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
In the demo, we asked whether a six-person team should try a four-day week. Claude worried that staggering days off would leave just one or two people on duty. ChatGPT pointed out that with a staggered schedule, at least four people could work each day. Claude agreed it had the numbers wrong. By the second round, both backed a three-month trial, provided nobody had to work evenings or days off.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
You'll need Python 3.11 or newer and [pipx](https://pipx.pypa.io/stable/installation/). Run these commands in a terminal.
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
pipx ensurepath
|
|
22
|
+
pipx install diff-chat
|
|
23
|
+
diff-chat
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The last command opens diff in your browser on macOS, Windows or Linux. If your terminal can't find `diff-chat`, open a new terminal so it picks up the updated PATH. To run a source checkout, use `pipx install .` from the project folder. A signed Mac app is planned.
|
|
27
|
+
|
|
28
|
+
## Connect your first model
|
|
29
|
+
|
|
30
|
+
You can start with one. Setup shows which tools diff found and how to install anything missing. Later, open **Settings → Models → Connect models** to add or disconnect one.
|
|
31
|
+
|
|
32
|
+
| Participant | Tool | What you need | How to connect |
|
|
33
|
+
| --- | --- | --- | --- |
|
|
34
|
+
| Claude | Claude Code 2.1.280 | Claude Pro or higher. [Plans](https://code.claude.com/docs/en/quickstart) | Run `claude auth login --claudeai`. |
|
|
35
|
+
| ChatGPT | Codex CLI 0.166.0 | Any ChatGPT plan, including Free. [Plan details](https://help.openai.com/en/articles/11369540-using-codex-with-your-chatgpt-plan) | Run `codex login`. |
|
|
36
|
+
| Gemini | Antigravity CLI 1.5.20 (`agy`) | An eligible Google account. The free tier works. [Eligibility](https://antigravity.google/docs/faq) | Choose **Connect Gemini**, or run `diff-chat --login-gemini`, then select Google OAuth. |
|
|
37
|
+
| Local | Ollama | Enough space and memory for the model you choose. Ollama is free. [Setup](https://docs.ollama.com/quickstart) | Open Ollama or run `ollama serve`. To download a first model, try `ollama pull gemma3:4b`. |
|
|
38
|
+
|
|
39
|
+
Have Claude Pro? Add a free ChatGPT account for the full experience.
|
|
40
|
+
|
|
41
|
+
## In a chat
|
|
42
|
+
|
|
43
|
+
Click the names beside the message box to choose who replies. To ask just Claude, start your message with `@claude`. You can choose a model and role for each participant, and set the reasoning level where the provider supports it.
|
|
44
|
+
|
|
45
|
+
| After a round | What happens |
|
|
46
|
+
| --- | --- |
|
|
47
|
+
| Continue | The participants read each other's answers and reply once more. |
|
|
48
|
+
| Find agreement | They take turns looking for a position everyone accepts. You see the maximum number of replies before you start. |
|
|
49
|
+
| Combine | Choose one participant to write a single answer and flag anything still unresolved. |
|
|
50
|
+
| Compare replies (Diff view) | Read two replies side by side. A short summary covers where everyone in the round agreed and differed. |
|
|
51
|
+
|
|
52
|
+
You can attach a document or a supported image, edit a question, retry a reply, or branch the chat to try another line of argument. Pin chats you come back to often, or search by title and message. You can export a single chat as Markdown or your whole library as Markdown or JSON.
|
|
53
|
+
|
|
54
|
+
**Shared memory** is for things you're tired of repeating. A note can belong to one chat or follow you across chats. **Import from another AI** lets you edit or untick each fact before saving it. Settings also has light and dark themes, font and accent choices, and a switch for the animated characters. The characters follow your system's reduced-motion setting.
|
|
55
|
+
|
|
56
|
+
## How it works
|
|
57
|
+
|
|
58
|
+
`diff-chat` starts a server on `127.0.0.1`. The private link it opens contains a fresh token that protects the API and the live reply stream.
|
|
59
|
+
|
|
60
|
+
For Claude, ChatGPT and Gemini, diff runs the provider's official CLI in an empty temporary folder with file and shell tools restricted. Web search is available where the provider supports it. A CLI that can resume a session gets the new messages since its last turn. When a conversation gets long, diff can use a cheaper model of your choice to summarize it. Local connects to Ollama on your computer and lists the models you've installed. [Adapter details](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/docs/cli-adapters.md)
|
|
61
|
+
|
|
62
|
+
## Privacy
|
|
63
|
+
|
|
64
|
+
Your saved chats, memory and settings stay on your computer. **Settings → Data** shows the folder. diff collects no telemetry.
|
|
65
|
+
|
|
66
|
+
When you invite a cloud model, its provider receives the messages, shared notes and attachments needed for that reply. Its own data and telemetry policies apply. To keep a conversation local, leave only **Local** on in the message box. Ollama will handle the summaries too. If you enable API fallback, diff stores the key in your OS keychain and the provider bills that usage separately. Checking for an update contacts GitHub.
|
|
67
|
+
|
|
68
|
+
## Limitations
|
|
69
|
+
|
|
70
|
+
- Cloud replies, comparisons and summaries draw on your plan. **Find agreement** can use several rounds and still end in disagreement.
|
|
71
|
+
- Usage meters show the allowance left and when it resets, if the provider reports those figures. Gemini gets its reading from Antigravity's `/usage` command. Some accounts show only a weekly allowance. Local has no plan limit.
|
|
72
|
+
- Smaller local models can miss earlier details or struggle with a harder question. Image support depends on the model. Codex may return a whole reply at once.
|
|
73
|
+
- diff depends on the providers' CLI versions, account rules and terms. On Windows, Codex may need Developer Mode to link its local credentials. [Anthropic's CLI guidance](https://code.claude.com/docs/en/legal-and-compliance) · [OpenAI's terms](https://openai.com/policies/terms-of-use/) · [Google's Antigravity terms](https://antigravity.google/terms)
|
|
74
|
+
|
|
75
|
+
Unofficial. Not affiliated with or endorsed by Anthropic, OpenAI, or Google.
|
|
76
|
+
|
|
77
|
+
## Contributing
|
|
78
|
+
|
|
79
|
+
To run the tests or make a change, start with [Contributing](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/CONTRIBUTING.md). For a new participant, see the [adapter guide](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/adapters/README.md). Please report vulnerabilities through the [security policy](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/SECURITY.md).
|
|
80
|
+
|
|
81
|
+
## License
|
|
82
|
+
|
|
83
|
+
diff is [MIT licensed](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/LICENSE). The fonts and bundled libraries have their own [third-party notices](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/static/vendor/LICENSES.txt). [Character credits](https://github.com/aadilchallawala-cloud/diff-chat/blob/v0.1.0/static/characters/CREDITS.md)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
Use **Security → Report a vulnerability** on this repository (GitHub private vulnerability reporting). Include the diff version, operating system, affected provider and a minimal example using a disposable library. Crop private launch URLs, tokens, account details, chat text and personal paths from evidence. If the button is unavailable, ask the maintainer to enable private reports before sending details. [GitHub’s private reporting guide](https://docs.github.com/en/code-security/how-tos/report-and-fix-vulnerabilities/report-privately)
|
|
4
|
+
|
|
5
|
+
diff serves its API on IPv4 loopback. A private launch URL grants access to the library for the lifetime of that server. Local chats, memory and session journals are readable by your user account. The test in `scripts/sandbox_test.py` checks observable effects of three requests against disposable files using your installed participants.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Open from Finder or run from a terminal. All dependencies stay inside the app.
|
|
3
|
+
set -eu
|
|
4
|
+
cd -P "$(dirname "$0")"
|
|
5
|
+
PATH="$PATH:/opt/homebrew/bin:/usr/local/bin:$HOME/.local/bin"
|
|
6
|
+
export PATH
|
|
7
|
+
runtime=""
|
|
8
|
+
for candidate in .venv/bin/python python3 python3.14 python3.13 python3.12 python3.11; do
|
|
9
|
+
if command -v "$candidate" >/dev/null 2>&1 && "$candidate" -c 'import sys; sys.exit(sys.version_info < (3, 11))'; then
|
|
10
|
+
runtime="$candidate"
|
|
11
|
+
break
|
|
12
|
+
fi
|
|
13
|
+
done
|
|
14
|
+
if [ -z "$runtime" ]; then
|
|
15
|
+
echo 'Install Python 3.11 or later from python.org, then open Start diff again.' >&2
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
if [ ! -d .venv ]; then
|
|
19
|
+
echo 'Preparing diff for the first launch…'
|
|
20
|
+
"$runtime" -m venv .venv
|
|
21
|
+
fi
|
|
22
|
+
if ! .venv/bin/python -c 'import sys; sys.exit(sys.version_info < (3, 11))'; then
|
|
23
|
+
echo 'The .venv folder needs Python 3.11 or later. Move it aside, then open Start diff again.' >&2
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
if ! .venv/bin/python - <<'PY'
|
|
27
|
+
from importlib.metadata import version, PackageNotFoundError
|
|
28
|
+
from pathlib import Path
|
|
29
|
+
import sys
|
|
30
|
+
try:
|
|
31
|
+
for line in Path('requirements.txt').read_text().splitlines():
|
|
32
|
+
name, expected = line.split('==')
|
|
33
|
+
if version(name) != expected:
|
|
34
|
+
sys.exit(1)
|
|
35
|
+
except PackageNotFoundError:
|
|
36
|
+
sys.exit(1)
|
|
37
|
+
PY
|
|
38
|
+
then
|
|
39
|
+
.venv/bin/python -m pip --disable-pip-version-check install -r requirements.txt
|
|
40
|
+
fi
|
|
41
|
+
exec .venv/bin/python diff_launcher.py
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Adding a participant
|
|
2
|
+
|
|
3
|
+
A participant is a Python module in this directory. Copy the structure of `local.py` for a service or `claude.py` for a CLI. Define a `Participant` subclass with a stable lowercase ID matching the filename and export one instance named `ADAPTER`. The registry discovers modules inside the installed package and sorts them by `order` and then ID. Prefix private helper modules with an underscore.
|
|
4
|
+
|
|
5
|
+
Declare `id`, `label`, `order`, `color` and `dark_color`. Optional attributes include `fill`, `dark_fill`, `character` (the URL of a sprite manifest), `cli_name`, `kind` (`cli` or `http`), `usage_note`, `search_tool` and `default_enabled`. The application uses these values for ordering, controls, setup and presentation. New participants default to off. Adding an adapter never installs its underlying service.
|
|
6
|
+
|
|
7
|
+
| Method | Contract |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| `async detect()` | Return a mapping with `status`, `hint`, and optionally `version`, `path`, `command`, `install_url` or `suggestion`. Use `ready` only when the account or local service can be used. Setup checks must not spend model tokens. |
|
|
10
|
+
| `async list_models()` | Return `{"default_model": "...", "models": [...]}`. Each choice supplies `id`, `label`, `efforts` and `default_effort`. Use `["default"]` for an unconfigurable effort and an empty list of models when unavailable. |
|
|
11
|
+
| `send(messages, model, reasoning, system, attachments, session_id, **runtime)` | An async iterator yielding visible strings. Accept a speaker-labelled transcript or a list of role/content dictionaries. Prepared image attachments contain a display name, MIME type and base64 image data. The host has already extracted selected text documents into the transcript. Raise `ModelError` for an incomplete reply and reject unsupported attachments explicitly. |
|
|
12
|
+
| `resume(session_id)` | Validate an explicit, app-owned session handle before using the provider's resume facility. Sessionless participants inherit a `ResumeUnavailable` implementation. The actual resumed turn streams through `send`. |
|
|
13
|
+
| `async usage()` | Return the plan-meter schema used in `plan_usage.py` or `None` if the provider has no such report. |
|
|
14
|
+
| `capabilities()` | Return booleans for streaming, sessions, reasoning_levels, web_search, attachments, images and api_fallback. Describe features usable **through this adapter**. Model-specific restrictions can further narrow capabilities. |
|
|
15
|
+
|
|
16
|
+
`runtime` supplies a timeout, Stop event, optional private session directory and four callbacks. `on_input(count)` records accepted input. `on_session(id)` commits a provider-confirmed session. `on_search(sources)` carries checked citations. `on_final(text)` supplies authoritative final text when a CLI's partial events differ. The host cancels the iterator on timeout or Stop. Close every request or subprocess in a `finally` block. A canceled subprocess must also terminate its children.
|
|
17
|
+
|
|
18
|
+
The CLI launcher uses an empty working directory and an environment restricted to required values. Recheck the actual executable's help before adopting flags. Block model access to local tools, hooks, external plugins and arbitrary files. Keep account sign-in with the official provider client. Do not persist raw keys, automatically open local file paths mentioned in chat, or enable cloud transport in an adapter labelled local.
|
|
19
|
+
|
|
20
|
+
Run `python -m unittest discover -s tests` for offline regression tests. `python probe.py` prints actual CLI help. The optional live `python scripts/sandbox_test.py` sends synthetic canary prompts through installed providers and reports skipped providers separately. It uses provider credits and creates no real chat.
|
|
21
|
+
|
|
22
|
+
## Built-in transports
|
|
23
|
+
|
|
24
|
+
Adapters can also implement `setup_action(status)` to return a `SetupAction(id, label, argv)` for a specific readiness state. diff shows the label in **Connect models** and rechecks that state before opening the local terminal. Supply the executable and each argument separately. The display-only setup command is a manual alternative.
|
|
25
|
+
|
|
26
|
+
- Claude and GPT retain their original subscription command profiles. Claude exposes incremental text. The pinned Codex JSON protocol returns completed agent messages. Both support explicit session IDs, attached images, and optional service-hosted web search.
|
|
27
|
+
- Gemini uses Antigravity CLI 1.5.20. diff owns its Google profile and launches Google's interactive OAuth from setup. The account catalog supplies all selectable model/effort variants. The CLI's framing is an input prefix. Strict tool permissions deny files, commands, MCP and URL actions. Its headless protocol accepts text. Provider-native history lives in the private Google profile, and each chat keeps its own confirmed conversation ID. Deleting a diff chat does not guarantee erasure of the CLI's private native history. See the [headless protocol](https://antigravity.google/docs/cli/headless/) and [CLI permissions](https://antigravity.google/docs/permissions/?tab=cli).
|
|
28
|
+
- Local uses a fixed loopback HTTP connection, ignores proxy variables, and refuses remote-backed models. It discovers installed tags at runtime. Vision requires the selected model to advertise vision. Text is streamed from NDJSON, with no client-side tool execution. It gets the summary and recent turns on each request. `ollama pull gemma3:4b` is an optional starting point, verified in the public catalog. See the [tag API](https://docs.ollama.com/api/tags), [chat API](https://docs.ollama.com/api/chat) and [Gemma 3 4B listing](https://ollama.com/library/gemma3:4b).
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""Registered participants and the transport used by diff's conversation engine."""
|
|
2
|
+
import asyncio
|
|
3
|
+
from contextlib import aclosing
|
|
4
|
+
from ._cli import (CLAUDE_CONTROL, CODEX_DISABLE, INSTALL, LOGIN, VERSIONS, ModelError,
|
|
5
|
+
ResumeUnavailable, _Invocation, _check_login, _environment, _terminate)
|
|
6
|
+
from .gpt import _prepare_codex
|
|
7
|
+
from .registry import REGISTRY, participant_info, public_registry
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def require_connection(provider):
|
|
11
|
+
from private_store import is_disconnected
|
|
12
|
+
if is_disconnected(provider):
|
|
13
|
+
raise ModelError(f"{REGISTRY[provider].label} is disconnected from diff. Reconnect it in Connect models.")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
async def run_model(model, framing, transcript, timeout, on_delta, stop, *,
|
|
17
|
+
model_id=None, effort=None, images=None, session_id=None, **runtime):
|
|
18
|
+
adapter = REGISTRY.get(model)
|
|
19
|
+
if adapter is None:
|
|
20
|
+
raise ModelError("Unknown participant.")
|
|
21
|
+
require_connection(model)
|
|
22
|
+
if stop.is_set():
|
|
23
|
+
raise ModelError("Stopped.")
|
|
24
|
+
complete = []
|
|
25
|
+
chunks = []
|
|
26
|
+
stream = adapter.send(transcript, model_id, effort, framing, images or [], session_id,
|
|
27
|
+
timeout=timeout, stop=stop, on_final=complete.append, **runtime)
|
|
28
|
+
async def consume():
|
|
29
|
+
async with aclosing(stream):
|
|
30
|
+
async for chunk in stream:
|
|
31
|
+
chunks.append(chunk)
|
|
32
|
+
await on_delta(chunk)
|
|
33
|
+
return complete[-1] if complete else "".join(chunks)
|
|
34
|
+
|
|
35
|
+
request = asyncio.create_task(consume())
|
|
36
|
+
stopped = asyncio.create_task(stop.wait())
|
|
37
|
+
try:
|
|
38
|
+
done, _ = await asyncio.wait((request, stopped), timeout=timeout, return_when=asyncio.FIRST_COMPLETED)
|
|
39
|
+
if stopped in done:
|
|
40
|
+
raise ModelError("Stopped.")
|
|
41
|
+
if request not in done:
|
|
42
|
+
raise ModelError(f"Timed out after {timeout}s.")
|
|
43
|
+
return request.result()
|
|
44
|
+
finally:
|
|
45
|
+
for task in (request, stopped):
|
|
46
|
+
if not task.done():
|
|
47
|
+
task.cancel()
|
|
48
|
+
await asyncio.gather(request, stopped, return_exceptions=True)
|