streamlit-coco 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.
- streamlit_coco-0.1.0/.gitignore +20 -0
- streamlit_coco-0.1.0/.python-version +1 -0
- streamlit_coco-0.1.0/AGENTS.md +43 -0
- streamlit_coco-0.1.0/CHANGELOG.md +141 -0
- streamlit_coco-0.1.0/ID.md +64 -0
- streamlit_coco-0.1.0/LICENSE +201 -0
- streamlit_coco-0.1.0/Makefile +73 -0
- streamlit_coco-0.1.0/PKG-INFO +213 -0
- streamlit_coco-0.1.0/README.md +180 -0
- streamlit_coco-0.1.0/doc/api.md +323 -0
- streamlit_coco-0.1.0/doc/deployment/README.md +12 -0
- streamlit_coco-0.1.0/doc/deployment/local.md +191 -0
- streamlit_coco-0.1.0/doc/deployment/publish.md +101 -0
- streamlit_coco-0.1.0/doc/features/README.md +40 -0
- streamlit_coco-0.1.0/doc/features/approvals/approvals.md +28 -0
- streamlit_coco-0.1.0/doc/features/approvals/test-checklist.md +41 -0
- streamlit_coco-0.1.0/doc/features/chat-ccv2/chat-ccv2.md +40 -0
- streamlit_coco-0.1.0/doc/features/chat-ccv2/test-checklist.md +37 -0
- streamlit_coco-0.1.0/doc/features/headless/headless.md +53 -0
- streamlit_coco-0.1.0/doc/features/headless/test-checklist.md +36 -0
- streamlit_coco-0.1.0/doc/features/panel/panel.md +29 -0
- streamlit_coco-0.1.0/doc/features/panel/test-checklist.md +41 -0
- streamlit_coco-0.1.0/doc/features/structured-output/structured-output.md +27 -0
- streamlit_coco-0.1.0/doc/features/structured-output/test-checklist.md +36 -0
- streamlit_coco-0.1.0/doc/features/text-renderer/test-checklist.md +26 -0
- streamlit_coco-0.1.0/doc/features/text-renderer/text-renderer.md +28 -0
- streamlit_coco-0.1.0/doc/features/tools-display/SPEC.md +336 -0
- streamlit_coco-0.1.0/doc/features/tools-display/test-checklist.md +55 -0
- streamlit_coco-0.1.0/doc/features/tools-display/tools-display.md +27 -0
- streamlit_coco-0.1.0/doc/marketing/demo.md +125 -0
- streamlit_coco-0.1.0/doc/marketing/one-pager.md +88 -0
- streamlit_coco-0.1.0/doc/prd.md +676 -0
- streamlit_coco-0.1.0/doc/roadmap.md +67 -0
- streamlit_coco-0.1.0/doc/screenshot.png +0 -0
- streamlit_coco-0.1.0/doc/security/findings-report.md +96 -0
- streamlit_coco-0.1.0/doc/security/threat-model.md +140 -0
- streamlit_coco-0.1.0/examples/approval_gate.py +28 -0
- streamlit_coco-0.1.0/examples/backlog_desk/.streamlit/config.toml +46 -0
- streamlit_coco-0.1.0/examples/backlog_desk/README.md +55 -0
- streamlit_coco-0.1.0/examples/backlog_desk/app_pages/board.py +82 -0
- streamlit_coco-0.1.0/examples/backlog_desk/app_pages/epic.py +57 -0
- streamlit_coco-0.1.0/examples/backlog_desk/app_pages/release.py +53 -0
- streamlit_coco-0.1.0/examples/backlog_desk/app_pages/ticket.py +60 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/epics/E-01.json +8 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/epics/E-02.json +8 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/epics/E-03.json +8 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/policies/dod.md +10 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/releases/0.1.0.md +20 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/releases/0.2.0.md +25 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/tickets/T-040.json +11 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/tickets/T-041.json +11 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/tickets/T-042.json +11 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/tickets/T-043.json +11 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/tickets/T-044.json +11 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/tickets/T-045.json +11 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/tickets/T-046.json +11 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/tickets/T-047.json +11 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/tickets/T-048.json +11 -0
- streamlit_coco-0.1.0/examples/backlog_desk/data/tickets/T-049.json +11 -0
- streamlit_coco-0.1.0/examples/backlog_desk/streamlit_app.py +67 -0
- streamlit_coco-0.1.0/examples/backlog_desk/utils/__init__.py +1 -0
- streamlit_coco-0.1.0/examples/backlog_desk/utils/backlog.py +251 -0
- streamlit_coco-0.1.0/examples/backlog_desk/utils/copilot_panel.py +289 -0
- streamlit_coco-0.1.0/examples/backlog_desk/utils/paths.py +13 -0
- streamlit_coco-0.1.0/examples/backlog_desk/utils/skills.py +102 -0
- streamlit_coco-0.1.0/examples/backlog_desk/utils/snowflake_connections.py +49 -0
- streamlit_coco-0.1.0/examples/backlog_desk/utils/ui.py +65 -0
- streamlit_coco-0.1.0/examples/chat_app.py +209 -0
- streamlit_coco-0.1.0/examples/headless_pipeline.py +108 -0
- streamlit_coco-0.1.0/examples/structured_output.py +73 -0
- streamlit_coco-0.1.0/examples/testdata/README.md +49 -0
- streamlit_coco-0.1.0/examples/testdata/prompts.json +422 -0
- streamlit_coco-0.1.0/pyproject.toml +73 -0
- streamlit_coco-0.1.0/release_notes.txt +57 -0
- streamlit_coco-0.1.0/streamlit_coco/__init__.py +115 -0
- streamlit_coco-0.1.0/streamlit_coco/ask_user.py +120 -0
- streamlit_coco-0.1.0/streamlit_coco/bootstrap.py +198 -0
- streamlit_coco-0.1.0/streamlit_coco/bridge.py +42 -0
- streamlit_coco-0.1.0/streamlit_coco/component.py +336 -0
- streamlit_coco-0.1.0/streamlit_coco/debug.py +35 -0
- streamlit_coco-0.1.0/streamlit_coco/diagnostics.py +127 -0
- streamlit_coco-0.1.0/streamlit_coco/display.py +232 -0
- streamlit_coco-0.1.0/streamlit_coco/errors.py +120 -0
- streamlit_coco-0.1.0/streamlit_coco/frontend/__init__.py +1 -0
- streamlit_coco-0.1.0/streamlit_coco/frontend/index.html +1 -0
- streamlit_coco-0.1.0/streamlit_coco/frontend/main.js +565 -0
- streamlit_coco-0.1.0/streamlit_coco/frontend/style.css +224 -0
- streamlit_coco-0.1.0/streamlit_coco/messages.py +527 -0
- streamlit_coco-0.1.0/streamlit_coco/options.py +107 -0
- streamlit_coco-0.1.0/streamlit_coco/permissions.py +258 -0
- streamlit_coco-0.1.0/streamlit_coco/query.py +39 -0
- streamlit_coco-0.1.0/streamlit_coco/session.py +498 -0
- streamlit_coco-0.1.0/streamlit_coco/sql_tool.py +130 -0
- streamlit_coco-0.1.0/streamlit_coco/text_renderer.py +40 -0
- streamlit_coco-0.1.0/streamlit_coco/tool_cards.py +490 -0
- streamlit_coco-0.1.0/streamlit_coco/tool_extract.py +167 -0
- streamlit_coco-0.1.0/streamlit_coco/tool_names.py +86 -0
- streamlit_coco-0.1.0/streamlit_coco/ui.py +642 -0
- streamlit_coco-0.1.0/tests/fixtures/ndjson/README.md +27 -0
- streamlit_coco-0.1.0/tests/fixtures/ndjson/assistant_text.ndjson +1 -0
- streamlit_coco-0.1.0/tests/fixtures/ndjson/assistant_tool_glob.ndjson +1 -0
- streamlit_coco-0.1.0/tests/fixtures/ndjson/assistant_tool_result.ndjson +1 -0
- streamlit_coco-0.1.0/tests/fixtures/ndjson/manifest.json +62 -0
- streamlit_coco-0.1.0/tests/fixtures/ndjson/result_structured.ndjson +1 -0
- streamlit_coco-0.1.0/tests/fixtures/ndjson/result_success.ndjson +1 -0
- streamlit_coco-0.1.0/tests/fixtures/ndjson/stream_delta.ndjson +1 -0
- streamlit_coco-0.1.0/tests/fixtures/ndjson/system_init.ndjson +1 -0
- streamlit_coco-0.1.0/tests/fixtures/ndjson/turn_glob.ndjson +4 -0
- streamlit_coco-0.1.0/tests/fixtures/ndjson/user_tool_result.ndjson +1 -0
- streamlit_coco-0.1.0/tests/test_backlog_desk.py +33 -0
- streamlit_coco-0.1.0/tests/test_core.py +610 -0
- streamlit_coco-0.1.0/tests/test_errors.py +75 -0
- streamlit_coco-0.1.0/tests/test_ndjson_fixtures.py +43 -0
- streamlit_coco-0.1.0/tests/test_smoke.py +124 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.venv/
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
.pytest_cache/
|
|
5
|
+
.ruff_cache/
|
|
6
|
+
dist/
|
|
7
|
+
*.egg-info/
|
|
8
|
+
.DS_Store
|
|
9
|
+
*.tmp
|
|
10
|
+
tmp/
|
|
11
|
+
|
|
12
|
+
# Secrets & credentials
|
|
13
|
+
.env
|
|
14
|
+
*.secret
|
|
15
|
+
*.key
|
|
16
|
+
client_*.yaml
|
|
17
|
+
|
|
18
|
+
# Streamlit agent skills (environment-specific symlinks)
|
|
19
|
+
.agents/skills/developing-with-streamlit
|
|
20
|
+
.claude/skills/developing-with-streamlit
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# AGENTS.md — streamlit-coco
|
|
2
|
+
|
|
3
|
+
Guidance for coding agents working in this repository.
|
|
4
|
+
|
|
5
|
+
## Product
|
|
6
|
+
|
|
7
|
+
Streamlit library + optional CCv2 component for Snowflake CoCo (Cortex Code Agent SDK). Preferred UX: `panel()` + app-owned `chat_input_bar` / `st.chat_input`.
|
|
8
|
+
|
|
9
|
+
Canonical SDK docs: https://docs.snowflake.com/en/user-guide/cortex-code-agent-sdk/cortex-code-agent-sdk
|
|
10
|
+
Pinned rule: `.cursor/rules/coco-sdk-docs.mdc`
|
|
11
|
+
|
|
12
|
+
## Layout
|
|
13
|
+
|
|
14
|
+
- `streamlit_coco/` — library (`ui`, `session`, `permissions`, `tool_*`, `bootstrap`, …)
|
|
15
|
+
- `examples/` — chat, approval, structured, headless demos
|
|
16
|
+
- `doc/prd.md`, `doc/api.md`, `doc/roadmap.md`, `doc/features/` — product + API + DSP N1 feature docs/checklists
|
|
17
|
+
- `doc-dev/` — **dev-only** docs (never synced to public `streamlit-coco`)
|
|
18
|
+
- `doc/deployment/publish.md` — dual-repo sync + tag → PyPI (`streamlit-coco`)
|
|
19
|
+
- `CHANGELOG.md` — shipped history (not the roadmap)
|
|
20
|
+
|
|
21
|
+
**Repos:** develop in `DevoteamSP/streamlit-coco-dev`; publish from `lletourmy/streamlit-coco` (`make sync-release`, then tag `v*`) until DevoteamSP is PyPI-validated.
|
|
22
|
+
|
|
23
|
+
## Commands
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
make install # uv sync --extra dev
|
|
27
|
+
make check # ruff + pytest
|
|
28
|
+
make audit # pip-audit
|
|
29
|
+
make chat # Streamlit demo
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Conventions
|
|
33
|
+
|
|
34
|
+
- Do not default-show raw JSON tool payloads; use meaningful compact tool expanders (`doc/features/tools-display/SPEC.md`).
|
|
35
|
+
- Approval buttons left→right: Approve once · Always allow · Deny.
|
|
36
|
+
- AskUserQuestion / ExitPlanMode always go through pending HITL; never “Always allow”.
|
|
37
|
+
- Update `CHANGELOG.md` `[Unreleased]` for user-visible changes; update feature checklists when UX changes.
|
|
38
|
+
- Prefer small, focused diffs; no drive-by refactors.
|
|
39
|
+
|
|
40
|
+
## Testing
|
|
41
|
+
|
|
42
|
+
- Unit/smoke: `tests/`
|
|
43
|
+
- Manual UI: `doc/features/*/test-checklist.md` before release
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
6
|
+
Versioning: date-based (`YYYY-MM-DD`) until v1.0.0 is cut, then semantic versioning.
|
|
7
|
+
Package version in `pyproject.toml` is `0.1.0` (first PyPI release).
|
|
8
|
+
|
|
9
|
+
Living plan (what’s next): [`doc/roadmap.md`](doc/roadmap.md).
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## [Unreleased]
|
|
14
|
+
|
|
15
|
+
## [0.1.0] — 2026-08-06
|
|
16
|
+
|
|
17
|
+
First PyPI release of `streamlit-coco` (alpha). Published from temporary Trusted Publisher on [`lletourmy/streamlit-coco`](https://github.com/lletourmy/streamlit-coco).
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- **Temporary PyPI release repo** — `make sync-release` / Trusted Publisher gate target [`lletourmy/streamlit-coco`](https://github.com/lletourmy/streamlit-coco) until DevoteamSP is validated on PyPI ([`doc/deployment/publish.md`](doc/deployment/publish.md))
|
|
21
|
+
- **Dependabot** — bump transitive `cryptography` to `50.0.0` (and `pyopenssl` to `26.4.0`); `GitPython` already at `3.1.58`
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
#### Examples
|
|
26
|
+
- **Product Backlog Desk** — multipage demo (`examples/backlog_desk/`, `make backlog`): Board / Epic / Ticket / Release with a right-rail Copilot (skills + `panel()`) over local JSON/Markdown (no SQL); navigator-style theme; Edit/Write gated by approvals
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
- **Compact tool cards** — transcript tools render as collapsed expanders (label: family · status · meta); auto-open on error; CCv2 `<details>` parity ([`doc/features/tools-display/SPEC.md`](doc/features/tools-display/SPEC.md))
|
|
30
|
+
|
|
31
|
+
#### Dual-repo publish
|
|
32
|
+
- Public release repo (temporary) [`lletourmy/streamlit-coco`](https://github.com/lletourmy/streamlit-coco); `make sync-release` / `scripts/sync_release.sh`; guide [`doc/deployment/publish.md`](doc/deployment/publish.md)
|
|
33
|
+
- Apache-2.0 `LICENSE`; PyPI Trusted Publisher gate in `release.yml` (`github.repository == lletourmy/streamlit-coco` only)
|
|
34
|
+
|
|
35
|
+
#### Phase 3 — HITL, headless, render flexibility
|
|
36
|
+
- **Headless multi-turn** — `CocoSession.stream()` and `await session.run(prompt)`; `execute_plan()` / `set_permission_mode()`; extended `examples/headless_pipeline.py`
|
|
37
|
+
- **Streamlit-free core imports** — lazy `__getattr__` for UI exports so headless scripts never load Streamlit; smoke test + example assert
|
|
38
|
+
- **Plan mode Execute CTA** — native `render_plan_banner()` in `panel()`; CCv2 banner **Execute plan** trigger
|
|
39
|
+
- **Edit/Write unified diff** — approval + transcript previews via `difflib` (`tool_extract.unified_diff`); Before/After fallback when empty
|
|
40
|
+
- **Pluggable text renderer** — `text_renderer=` on `panel()`, `render_transcript()`, `render_output_field()` (`markdown` / `write` / `text` / … or callable); feature docs under `doc/features/text-renderer/`
|
|
41
|
+
- **App-owned `request_input`** — form + optional multi-field `schema=` (AskUserQuestion remains the in-turn CoCo channel)
|
|
42
|
+
- Headless checklist re-signed (2026-07-27): `query()` + `run()` + `stream()` live path; no Streamlit import
|
|
43
|
+
|
|
44
|
+
#### Earlier unreleased (pre–Phase 3 on this branch)
|
|
45
|
+
- **Clear tool “running” captions when done** — parse SDK `UserMessage` / NDJSON `user` tool results; finalize leftover `running` tools on turn `result`
|
|
46
|
+
- **CCv2 skill hygiene** — JS cleanup via AbortController; pause `run_every` on pending approval; drop `provide_input`; `isolate_styles=True`; CSS via `--st-yellow-*` / `--st-red-*` / radius tokens
|
|
47
|
+
- **API reference** — [`doc/api.md`](doc/api.md)
|
|
48
|
+
- **Deployment docs (local)** — [`doc/deployment/local.md`](doc/deployment/local.md)
|
|
49
|
+
- **Typed error hierarchy** — `streamlit_coco.errors`; `require_environment()`
|
|
50
|
+
- **NDJSON fixture corpus** — `tests/fixtures/ndjson/` + `tests/test_ndjson_fixtures.py`
|
|
51
|
+
- Feature docs pack + checklist sign-offs (panel, approvals, tools-display, structured-output, chat-ccv2, headless)
|
|
52
|
+
- GitHub CI/CD (ci / security / release + optional PyPI publish on `v*` tags); `make publish`; hatch sdist excludes for agent/IDE dirs
|
|
53
|
+
- Smoke tests: CCv2 register-once; core import does not load Streamlit
|
|
54
|
+
|
|
55
|
+
### Changed
|
|
56
|
+
- [`doc/prd.md`](doc/prd.md) reconciled with shipped Phase 3; FR-S* / FR-ST* status; FR-S3 superseded by tools-display SPEC (not “collapse cards”)
|
|
57
|
+
- [`doc/roadmap.md`](doc/roadmap.md) — Later: FR-S2, FR-S7, FR-ST4 truncation, Vite/CCv2, e2e; Next: Docker/SPCS docs; PyPI `0.1.0` via temporary Trusted Publisher
|
|
58
|
+
- `doc-dev/` — development-only docs tree; excluded from `make sync-release` and sdist (never published to `streamlit-coco`)
|
|
59
|
+
- Package / README / identity URLs point at the public [`streamlit-coco`](https://github.com/lletourmy/streamlit-coco) repo; development continues on [`streamlit-coco-dev`](https://github.com/DevoteamSP/streamlit-coco-dev)
|
|
60
|
+
- GitHub repository renamed to [`DevoteamSP/streamlit-coco-dev`](https://github.com/DevoteamSP/streamlit-coco-dev) (package name remains `streamlit-coco`)
|
|
61
|
+
- Examples `structured_output.py` / `approval_gate.py`: `get_or_create_session` + eager `start()` for CCv2 transcript across reruns
|
|
62
|
+
- Chat demo sidebar: compact status badges; Settings popover; test prompts behind a toggle
|
|
63
|
+
- CCv2 `chat()` registration cached (`@lru_cache`) so `st.components.v2.component` runs once per process
|
|
64
|
+
- Headless example: separate event loops for `query()` vs `CocoSession` to avoid SDK cancel-scope teardown issues
|
|
65
|
+
|
|
66
|
+
### Fixed
|
|
67
|
+
- Grep / Glob completed cards: compact summary instead of dumping full result bodies
|
|
68
|
+
- AskUserQuestion: free-form / “Other…” options always last in radio / multiselect
|
|
69
|
+
- Security workflow: free Gitleaks CLI instead of `gitleaks-action@v2` (org license)
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## [2026-07-24]
|
|
74
|
+
|
|
75
|
+
### Added
|
|
76
|
+
- **Tools display & user interactions** — full spec + implementation ([`doc/features/tools-display/SPEC.md`](doc/features/tools-display/SPEC.md))
|
|
77
|
+
- Meaningful bordered tool cards (no default JSON expanders) for Glob, Grep, Read, Write, Edit, Bash, SQL / `sql_execute`, AskUserQuestion, ExitPlanMode, and generic / MCP tools
|
|
78
|
+
- `streamlit_coco.tool_names`, `tool_extract`, `tool_cards` dispatch; CCv2 frontend parity
|
|
79
|
+
- AskUserQuestion UI: radio / multiselect, **Other…** free-text, Submit / Cancel; always routed through `can_use_tool`
|
|
80
|
+
- SQL card: query code block + dataframe / text results; SQL preview on approval
|
|
81
|
+
- ExitPlanMode: Approve plan / Reject (with optional feedback); never “Always allow”
|
|
82
|
+
- CoCo debug mode (`STREAMLIT_COCO_DEBUG` / `COCO_DEBUG` / `st.session_state["coco_debug"]`) for collapsed **Raw tool payload**
|
|
83
|
+
- Feature checklist + `display_*` test prompt pack ([`doc/features/tools-display/test-checklist.md`](doc/features/tools-display/test-checklist.md), [`examples/testdata/prompts.json`](examples/testdata/prompts.json) v2 — 50+ prompts)
|
|
84
|
+
- Chat demo: Plan mode toggle, debug checkbox, test-prompt runner by category
|
|
85
|
+
|
|
86
|
+
### Changed
|
|
87
|
+
- Approval button order (left → right): **Approve once** · **Always allow** · **Deny** (Deny rightmost); AskUser Submit · Cancel; plan Approve · Reject
|
|
88
|
+
- Tool approvals show family-specific previews (path, content, Before/After, command, SQL) instead of raw JSON by default
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## [2026-07-23]
|
|
93
|
+
|
|
94
|
+
### Added
|
|
95
|
+
- `streamlit_coco.bootstrap` — `check_environment` / start gate helpers, `get_or_create_session`, `chat_input_bar`, `reset_session`, `stop_session`
|
|
96
|
+
- `streamlit_coco.diagnostics` — `CocoEnvironment` probe (CLI, SDK, Snowflake config) without starting an agent
|
|
97
|
+
- Session readiness lifecycle — `CONNECTING` → `READY` / `ERROR`, `ensure_ready()`, init metadata capture
|
|
98
|
+
- Soft status chrome in `panel()` — Starting / Thinking / tool activity / Needs approval without remount flicker
|
|
99
|
+
- DSP N1 feature test checklists under `doc/features/*/test-checklist.md`
|
|
100
|
+
- `doc/roadmap.md` — Now / Next / Soon / Later plan aligned with `doc/PRD.md`
|
|
101
|
+
- `Makefile` targets for install, test, lint, format, check, build, and example apps
|
|
102
|
+
- Cursor rule pinning Cortex Code Agent SDK docs as source of truth
|
|
103
|
+
|
|
104
|
+
### Changed
|
|
105
|
+
- Preferred app pattern documented as `panel()` + `chat_input_bar` / `st.chat_input` (legacy `chat()` retained)
|
|
106
|
+
- `doc/PRD.md` and `README.md` synced to the implemented `panel()`-first API and package layout
|
|
107
|
+
- Example `examples/chat_app.py` simplified around bootstrap helpers
|
|
108
|
+
|
|
109
|
+
### Fixed
|
|
110
|
+
- Avoid double-display of Snowflake connections TOML path in the environment / start gate UI
|
|
111
|
+
- `chat_input_bar` — graceful fallback when Streamlit lacks `submit_mode` (< 1.59)
|
|
112
|
+
- Session status skeleton — fallback placeholder when `st.skeleton` is unavailable (< 1.59)
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## [2026-07-22] — Alpha baseline (shipped)
|
|
117
|
+
|
|
118
|
+
Core library and preferred Streamlit UX first landed:
|
|
119
|
+
|
|
120
|
+
- [x] Pip-installable package + `CocoOptions` / `CocoSession` / `query()`
|
|
121
|
+
- [x] Native UI: `panel()` + app-owned input (`chat_input_bar` / `send_prompt`)
|
|
122
|
+
- [x] Streaming transcript, tool cards, Stop, fragment polling
|
|
123
|
+
- [x] Human-in-the-loop approvals (`require_approval_for`, Deny / Approve once / Always)
|
|
124
|
+
- [x] Structured output (inline JSON or `on_structured_output`)
|
|
125
|
+
- [x] Legacy CCv2 `chat()` (still supported)
|
|
126
|
+
- [x] Examples: chat, approval gate, structured output, headless pipeline
|
|
127
|
+
|
|
128
|
+
### Added (detail)
|
|
129
|
+
- Initial `streamlit-coco` package (`0.1.0` alpha): Python API + Streamlit embedding for Snowflake CoCo
|
|
130
|
+
- Normalized `CocoEvent` model and unit tests (`tests/test_core.py`)
|
|
131
|
+
- Legacy CCv2 `chat()` component with static frontend assets under `streamlit_coco/frontend/`
|
|
132
|
+
- `doc/PRD.md` and `README.md`
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
<!-- Notes:
|
|
137
|
+
- Link PRs/issues when available: (#42) or (DevoteamSP/streamlit-coco-dev#42)
|
|
138
|
+
- One entry per user-visible change
|
|
139
|
+
- Security fixes always under "Security", never under "Fixed"
|
|
140
|
+
- Update [Unreleased] as you go; rename to a date (or semver after v1.0.0) on release
|
|
141
|
+
-->
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Asset Identity Sheet
|
|
2
|
+
|
|
3
|
+
| Field | Value |
|
|
4
|
+
|-------|-------|
|
|
5
|
+
| **Name** | `streamlit-coco` |
|
|
6
|
+
| **Display name** | streamlit-coco |
|
|
7
|
+
| **Snow Builders level** | N0 (working toward N1) |
|
|
8
|
+
| **Status** | active |
|
|
9
|
+
| **Asset Owner** | Laurent Letourmy |
|
|
10
|
+
| **Contributors** | DevoteamSP / streamlit-coco contributors |
|
|
11
|
+
| **Created** | 2026-07 |
|
|
12
|
+
| **Last updated** | 2026-07 |
|
|
13
|
+
| **Confidentiality** | Public |
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Domain & Technology
|
|
18
|
+
|
|
19
|
+
**Domain**: ai_ml / streamlit / analytics
|
|
20
|
+
|
|
21
|
+
**Snowflake features**: cortex (CoCo / Cortex Code Agent SDK), Streamlit
|
|
22
|
+
|
|
23
|
+
**Other tech**: Python, uv, hatchling, pytest, ruff
|
|
24
|
+
|
|
25
|
+
**Industry**: cross_industry
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Maturity Justification
|
|
30
|
+
|
|
31
|
+
**Current level**: N0 → closing alpha toward N1
|
|
32
|
+
|
|
33
|
+
- Clients where used: 0 (alpha)
|
|
34
|
+
- Consultants trained: —
|
|
35
|
+
- Demo available: yes (`make chat`, examples/)
|
|
36
|
+
- Snowflake Alliance pre-alignment: —
|
|
37
|
+
|
|
38
|
+
**Next milestone**: N1 — conditions needed:
|
|
39
|
+
|
|
40
|
+
- [x] Feature golden-path checklists under `doc/features/`
|
|
41
|
+
- [x] CI + PR template
|
|
42
|
+
- [ ] Fill owner / KPIs on this sheet
|
|
43
|
+
- [ ] Run and sign off UI checklists on a live CoCo + Snowflake connection
|
|
44
|
+
- [ ] Security threat model + audit pack (`doc/security/`)
|
|
45
|
+
- [ ] Marketing one-pager (`doc/marketing/`)
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Repository
|
|
50
|
+
|
|
51
|
+
| Role | URL |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| **Public / PyPI source** | [github.com/lletourmy/streamlit-coco](https://github.com/lletourmy/streamlit-coco) *(temporary until DevoteamSP is PyPI-validated)* |
|
|
54
|
+
| **Development** | [github.com/DevoteamSP/streamlit-coco-dev](https://github.com/DevoteamSP/streamlit-coco-dev) |
|
|
55
|
+
|
|
56
|
+
Publish procedure: [`doc/deployment/publish.md`](doc/deployment/publish.md)
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Security
|
|
61
|
+
|
|
62
|
+
- IP review done: no
|
|
63
|
+
- Threat model: not yet (`doc/security/` TBD)
|
|
64
|
+
- Last security scan: GitHub Actions Security workflow (Gitleaks CLI, CodeQL, pip-audit)
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 DevoteamSP / streamlit-coco contributors
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# streamlit-coco — local development
|
|
2
|
+
UV ?= uv
|
|
3
|
+
PYTHON ?= $(UV) run
|
|
4
|
+
STREAMLIT = $(PYTHON) streamlit run
|
|
5
|
+
EXAMPLE ?= examples/chat_app.py
|
|
6
|
+
|
|
7
|
+
.DEFAULT_GOAL := help
|
|
8
|
+
|
|
9
|
+
.PHONY: help install sync test lint format check audit \
|
|
10
|
+
run chat approval structured headless backlog \
|
|
11
|
+
build publish sync-release clean
|
|
12
|
+
|
|
13
|
+
# Public release clone (override: make sync-release RELEASE_REPO=/path/to/streamlit-coco)
|
|
14
|
+
# Temporary: personal repo until DevoteamSP is validated on PyPI (see doc/deployment/publish.md).
|
|
15
|
+
RELEASE_REPO ?= $(abspath $(CURDIR)/../streamlit-coco)
|
|
16
|
+
RELEASE_REMOTE ?= https://github.com/lletourmy/streamlit-coco.git
|
|
17
|
+
|
|
18
|
+
help: ## Show this help
|
|
19
|
+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
|
|
20
|
+
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-14s\033[0m %s\n", $$1, $$2}'
|
|
21
|
+
|
|
22
|
+
install: ## Install package + [dev] extras (editable via uv)
|
|
23
|
+
$(UV) sync --extra dev
|
|
24
|
+
|
|
25
|
+
sync: install ## Alias for install
|
|
26
|
+
|
|
27
|
+
test: ## Run pytest
|
|
28
|
+
$(PYTHON) pytest tests/ -v
|
|
29
|
+
|
|
30
|
+
lint: ## Lint with ruff
|
|
31
|
+
$(PYTHON) ruff check .
|
|
32
|
+
|
|
33
|
+
format: ## Format with ruff
|
|
34
|
+
$(PYTHON) ruff format .
|
|
35
|
+
$(PYTHON) ruff check --fix .
|
|
36
|
+
|
|
37
|
+
audit: ## Dependency vulnerability scan (pip-audit)
|
|
38
|
+
$(PYTHON) pip-audit
|
|
39
|
+
|
|
40
|
+
check: lint test ## Lint then test
|
|
41
|
+
|
|
42
|
+
run: ## Run EXAMPLE (default: examples/chat_app.py)
|
|
43
|
+
$(STREAMLIT) $(EXAMPLE)
|
|
44
|
+
|
|
45
|
+
chat: ## Run examples/chat_app.py
|
|
46
|
+
$(STREAMLIT) examples/chat_app.py
|
|
47
|
+
|
|
48
|
+
approval: ## Run examples/approval_gate.py
|
|
49
|
+
$(STREAMLIT) examples/approval_gate.py
|
|
50
|
+
|
|
51
|
+
structured: ## Run examples/structured_output.py
|
|
52
|
+
$(STREAMLIT) examples/structured_output.py
|
|
53
|
+
|
|
54
|
+
headless: ## Run examples/headless_pipeline.py
|
|
55
|
+
$(PYTHON) examples/headless_pipeline.py
|
|
56
|
+
|
|
57
|
+
backlog: ## Run Product Backlog Desk demo (examples/backlog_desk)
|
|
58
|
+
cd examples/backlog_desk && $(UV) run --project ../.. streamlit run streamlit_app.py
|
|
59
|
+
|
|
60
|
+
build: ## Build sdist + wheel into dist/
|
|
61
|
+
$(UV) build
|
|
62
|
+
|
|
63
|
+
publish: build ## Upload dist/ to PyPI (prefer tagging streamlit-coco; see doc/deployment/publish.md)
|
|
64
|
+
$(UV) publish
|
|
65
|
+
|
|
66
|
+
sync-release: ## Sync release tree → ../streamlit-coco (DRY_RUN=1 / COMMIT=1 / PUSH=1)
|
|
67
|
+
RELEASE_REPO="$(RELEASE_REPO)" RELEASE_REMOTE="$(RELEASE_REMOTE)" \
|
|
68
|
+
DRY_RUN="$(DRY_RUN)" COMMIT="$(COMMIT)" PUSH="$(PUSH)" MESSAGE="$(MESSAGE)" \
|
|
69
|
+
bash scripts/sync_release.sh
|
|
70
|
+
|
|
71
|
+
clean: ## Remove caches and build artifacts
|
|
72
|
+
rm -rf dist/ build/ *.egg-info .pytest_cache .ruff_cache
|
|
73
|
+
find . -type d -name __pycache__ -not -path './.venv/*' -exec rm -rf {} +
|