@online5880/opensession 0.1.1 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/HANDOVER.md ADDED
@@ -0,0 +1,78 @@
1
+ # OpenSession Project Handover & Progress Report
2
+
3
+ > **작성일**: 2026년 3월 15일
4
+ > **목적**: 현재까지 진행된 개발 내역을 정리하고, 향후 작업을 매끄럽게 이어가기 위한 인수인계 문서입니다.
5
+
6
+ ---
7
+
8
+ ## 🚀 1. 현재까지 진행된 핵심 작업 (Completed)
9
+
10
+ ### (1) OpenSession CLI 고도화 (v0.1.3)
11
+ - **TUI 대시보드 추가 (`opss tui`)**: `blessed` 라이브러리를 활용하여 터미널 내에서 세션 목록과 실시간 이벤트를 모니터링할 수 있는 대화형 인터페이스를 구축했습니다.
12
+ - **TUI 실시간 자동 갱신(Auto-refresh)**: 선택한 세션의 이벤트를 5초 간격으로 자동 폴링(Polling)하여 화면 새로고침 없이 최신 상태를 보여줍니다.
13
+ - **글로벌화 (영문화)**: CLI의 모든 프롬프트(`init`, 에러 메시지, 결과 출력 등)를 영어로 번역하여 글로벌 사용자 접근성을 높였습니다.
14
+ - **용어 전문화**: Supabase의 내부 용어인 `ANON KEY` 대신 사용자 친화적인 **`Public API Key`**로 용어를 일괄 변경했습니다.
15
+ - **Product-grade README**: 영문/국문(`README.md`, `README.ko.md`) 버전을 분리하여 작성하고, 아키텍처 다이어그램 및 배지(Badges)를 추가하여 제품의 신뢰도를 높였습니다.
16
+
17
+ ### (2) 랜딩 페이지 (`opensession-site`) 고도화
18
+ - **다중 언어 (i18n)**: 한국어/영어 스위처를 우측 상단에 구현했습니다.
19
+ - **다크/라이트 모드 (Theme)**: 달/해 아이콘을 통해 테마를 전환할 수 있으며, 최신 웹 트렌드에 맞춘 Vibe 디자인을 적용했습니다.
20
+ - **사용자 경험(UX) 개선**:
21
+ - `npm install` 명령어를 원클릭으로 복사할 수 있는 버튼 추가.
22
+ - Windows 사용자를 위한 **PowerShell 설정 함수** 가이드 추가.
23
+ - `Bash/Zsh` 와 `PowerShell` 코드를 시각적으로 전환할 수 있는 버튼 탭 구현.
24
+ - **Git 연동 및 배포**: `opensession.pages.dev` 도메인에 연결할 수 있도록 Cloudflare Pages 구조를 세팅하고 GitHub 원격 저장소 푸시를 완료했습니다.
25
+
26
+ ---
27
+
28
+ ## 🏗️ 2. 현재 시스템 아키텍처 요약
29
+
30
+ - **Backend**: Supabase (PostgreSQL) - 세션 메타데이터(`projects`, `sessions`)와 실시간 로그(`session_events`)를 영속적으로 저장합니다.
31
+ - **Continuity Engine**: `opensession` CLI 패키지 (`cli.js`, `supabase.js`, `idempotency.js`).
32
+ - **3-Layer Interface**:
33
+ 1. **CLI**: 가장 빠르고 가벼운 명령어 흐름 제어.
34
+ 2. **Web Viewer (`opss viewer`)**: 브라우저 기반의 JSON 페이로드 분석 및 28일 KPI 통계.
35
+ 3. **TUI (`opss tui`)**: 실시간 터미널 대시보드.
36
+
37
+ ---
38
+
39
+ ## 🔮 3. 향후 개발 로드맵 (Next Steps)
40
+
41
+ 나중에 작업을 이어가실 때 아래 항목들을 우선적으로 고려하시면 좋습니다.
42
+
43
+ ### [Phase 4] 실시간 웹소켓 스트리밍
44
+ - 현재 TUI는 5초마다 REST API를 폴링(Polling)하여 이벤트를 가져옵니다. 이를 **Supabase Realtime (WebSocket)** 구독 방식으로 변경하면 서버 부하를 줄이고 훨씬 더 즉각적인 반응(Real-time)을 얻을 수 있습니다.
45
+
46
+ ### [Phase 5] SDK 및 언어 생태계 확장
47
+ - 현재는 Node.js 기반 CLI 중심이지만, Python 생태계(LangChain, CrewAI 등)나 Go 언어에서 OpenSession 백엔드와 직접 통신할 수 있는 **경량 SDK**를 제공하면 파급력이 커집니다.
48
+
49
+ ### [Phase 6] 엔터프라이즈 SaaS화 (상품화 단계)
50
+ - 본 저장소의 핵심 코드는 오픈소스로 유지(Open Core 전략)하되, 여러 명의 에이전트와 사람 팀원이 협업할 수 있는 **역할 기반(RBAC) 멀티 테넌트 대시보드**를 비공개 저장소에서 개발하여 유료 서비스(SaaS)로 전환할 수 있습니다.
51
+ - Slack / Discord 실시간 알림 웹훅(Webhook) 기능 강화.
52
+
53
+ ---
54
+
55
+ ## 📋 4. 작업 재개 가이드
56
+
57
+ 다음번 세션 시작 시, 이 문서를 참고하여 현재 위치를 파악하세요.
58
+
59
+ 1. **로컬 테스트 환경 구동**:
60
+ ```powershell
61
+ cd E:\019_gemini\opensession
62
+ node src/cli.js tui
63
+ ```
64
+ 2. **랜딩 페이지 수정 시**:
65
+ ```powershell
66
+ cd E:\019_gemini\opensession-site
67
+ python -m http.server 8080
68
+ # 접속: http://localhost:8080
69
+ ```
70
+ 3. **NPM 패키지 배포 (새 기능 추가 시)**:
71
+ ```powershell
72
+ # 1. package.json 버전 올리기
73
+ # 2. 터미널에서 로그인 및 배포
74
+ npm login
75
+ npm publish --access public
76
+ ```
77
+
78
+ *본 문서는 프로젝트의 지속성을 위해 작성되었습니다. 화이팅입니다!* 🚀
package/README.ko.md ADDED
@@ -0,0 +1,133 @@
1
+ # 🌐 OpenSession
2
+
3
+ **[English](README.md) | [한국어](README.ko.md)**
4
+
5
+ > **AI 에이전트 운영을 위한 실행 연속성 계층 (Execution Continuity Layer)**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@online5880/opensession.svg?style=flat-square)](https://www.npmjs.com/package/@online5880/opensession)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
9
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](#)
10
+ [![Built with Supabase](https://img.shields.io/badge/Backend-Supabase-green.svg?style=flat-square)](https://supabase.com)
11
+
12
+ **OpenSession**은 AI 에이전트가 다양한 도구, 환경, 네트워크 상태 사이에서 작업의 맥락(Context)과 연속성(Continuity)을 잃지 않도록 돕는 **실행 연속성 OS**입니다. 한 번 시작하면 어디서든 재개할 수 있습니다.
13
+
14
+ ---
15
+
16
+ ## 🚀 왜 OpenSession 인가요?
17
+
18
+ AI 에이전트와 협업할 때 가장 큰 문제는 **"맥락의 단절(Context Fragmentation)"**입니다.
19
+ - 로컬에서 작업하던 에이전트를 서버로 옮기면?
20
+ - 네트워크 오류로 세션이 끊기면?
21
+ - 여러 도구가 각자의 로그를 남겨서 전체 흐름을 파악하기 힘들다면?
22
+
23
+ **OpenSession은 이 모든 문제를 해결합니다.** 단일 세션 ID로 모든 활동을 Supabase에 영속화하고, CLI/Web/TUI를 통해 끊김 없이 실시간으로 모니터링할 수 있습니다.
24
+
25
+ ---
26
+
27
+ ## ✨ 핵심 기능
28
+
29
+ ### 1. 영속적 세션 모델 (Stable Session Model)
30
+ - 어떤 환경에서도 동일한 `session_id`를 사용하여 작업을 이어갑니다.
31
+ - `start` -> `pause` -> `resume` 워크플로우를 완벽하게 지원합니다.
32
+
33
+ ### 2. 강력한 이벤트 타임라인 (Durable Event Timeline)
34
+ - **의도 (Intent)**: 무엇을 하려고 하는가?
35
+ - **액션 (Action)**: 실제 어떤 명령을 실행했는가?
36
+ - **결과물 (Artifact)**: 무엇을 만들어냈는가?
37
+ - 위 세 가지 핵심 요소를 구조화된 JSON으로 기록하여 심층 분석이 가능합니다.
38
+
39
+ ### 3. 다중 모니터링 인터페이스 (Multi-Surface Monitoring)
40
+ - **CLI**: 직관적인 터미널 기반 제어.
41
+ - **WebUI (Viewer)**: 브라우저에서 확인하는 고해상도 타임라인 대시보드.
42
+ - **TUI (Terminal UI)**: 터미널 안에서 키보드로 조작하는 대화형 대시보드.
43
+
44
+ ### 4. 엔터프라이즈급 신뢰성 (Enterprise-Grade Reliability)
45
+ - **멱등성(Idempotency)** 보장: 동일한 이벤트가 중복 기록되는 것을 방지합니다.
46
+ - **지수 백오프(Exponential Backoff)**: 불안정한 네트워크 환경에서도 자동으로 재시도합니다.
47
+
48
+ ---
49
+
50
+ ## 🗺️ 로드맵: 3단계 인터페이스
51
+
52
+ | 단계 (Phase) | 인터페이스 | 상태 | 기능 설명 |
53
+ | :--- | :--- | :--- | :--- |
54
+ | **Phase 1** | **CLI 코어** | ✅ 안정됨 | 세션 제어, 기본 로깅, 설정 관리 |
55
+ | **Phase 2** | **WebUI 뷰어** | ✅ 안정됨 | 다크 테마, 통계(KPI) 리포트, JSON 페이로드 뷰어 |
56
+ | **Phase 3** | **인터랙티브 TUI** | ✅ 활성화 | 대화형 세션 선택, 실시간 이벤트 스트리밍 자동 갱신 |
57
+
58
+ ---
59
+
60
+ ## 🛠️ 시작하기
61
+
62
+ ### 설치 및 단축어 설정 (Alias)
63
+
64
+ 빠른 실행을 위해 쉘 프로필에 단축어를 추가하세요:
65
+
66
+ **macOS / Linux (Bash/Zsh):**
67
+ ```bash
68
+ alias opss='npx -y @online5880/opensession'
69
+ ```
70
+
71
+ **Windows (PowerShell):**
72
+ ```powershell
73
+ function opss { npx -y @online5880/opensession @args }
74
+ ```
75
+
76
+ ### 1분 퀵 스타트
77
+
78
+ 1. **초기화**: Supabase URL과 API 키를 설정합니다.
79
+ ```bash
80
+ opss init
81
+ ```
82
+
83
+ 2. **세션 시작**: 새로운 프로젝트 세션을 시작합니다.
84
+ ```bash
85
+ opss start --project-key my-ai-lab --actor mane
86
+ ```
87
+
88
+ 3. **이벤트 기록**: 에이전트의 활동을 기록합니다.
89
+ ```bash
90
+ opss log --limit 10
91
+ ```
92
+
93
+ 4. **대시보드 실행**: 원하는 뷰어를 선택해 모니터링하세요.
94
+ ```bash
95
+ opss tui # 터미널 대시보드 (추천)
96
+ opss viewer # 웹 브라우저 뷰어
97
+ ```
98
+
99
+ ---
100
+
101
+ ## 📖 명령어 가이드
102
+
103
+ | 명령어 | 단축어 | 설명 |
104
+ | :--- | :--- | :--- |
105
+ | `init` | `setup` | Supabase 서버 연결 및 로컬 설정을 초기화합니다. |
106
+ | `start` | `st` | 새로운 세션을 생성하고 타임라인을 시작합니다. |
107
+ | `resume` | `rs` | 멱등성 보호를 통해 기존 세션을 재개합니다. |
108
+ | `tui` | - | **(New)** 인터랙티브 터미널 대시보드(TUI)를 실행합니다. |
109
+ | `viewer` | `vw` | 로컬 웹 뷰어 서버를 실행합니다 (기본 8787 포트). |
110
+ | `status` | `ps` | CLI 버전 정보 및 활성 세션 상태를 확인합니다. |
111
+ | `report` | - | 28일간의 KPI 통계 및 주간 트렌드 분석 리포트를 생성합니다. |
112
+
113
+ ---
114
+
115
+ ## 🏗️ 아키텍처
116
+
117
+ OpenSession은 에이전트 런타임과 영구 스토리지 사이의 **신뢰성 높은 연결 계층**으로 작동합니다.
118
+
119
+ ```mermaid
120
+ graph TD
121
+ Agent[AI Agent / Developer] -->|Log/Control| CLI[OpenSession CLI]
122
+ CLI -->|Persist| DB[(Supabase Cloud)]
123
+ DB -->|Stream| TUI[TUI Dashboard]
124
+ DB -->|Render| Web[Web Viewer]
125
+ ```
126
+
127
+ ---
128
+
129
+ ## 🤝 기여하기 (Contributing)
130
+
131
+ 기여는 언제나 환영합니다! 버그 제보 및 기능 제안은 [GitHub Issues](https://github.com/online5880/opensession/issues)를 이용해 주세요.
132
+
133
+ MIT © [online5880](https://github.com/online5880)
package/README.md CHANGED
@@ -1,32 +1,137 @@
1
- # @online5880/opensession
2
-
3
- MVP CLI for session continuity with Supabase.
4
-
5
- ## Commands
6
-
7
- - `init [--project-key] [--actor]` (프롬프트로 URL/ANON KEY 입력)
8
- - `login --actor`
9
- - `start --project-key [--project-name] [--actor]`
10
- - `resume --session-id [--actor]`
11
- - `status [--project-key]`
12
- - `sync --project <name>`
13
- - `log [--session-id] [--limit]`
14
-
15
- ## Quick start
16
-
17
- ```bash
18
- npm install
19
- node src/cli.js init --project-key demo --actor mane
20
- node src/cli.js sync --project demo
21
- node src/cli.js start --project-key demo
22
- node src/cli.js status
23
- node src/cli.js log
24
- ```
25
-
26
- Apply `sql/schema.sql` in Supabase SQL editor before using the CLI.
27
-
28
- ## npx 실행
29
-
30
- ```bash
31
- npx @online5880/opensession init
32
- ```
1
+ # 🌐 OpenSession
2
+
3
+ **[English](README.md) | [한국어](README.ko.md)**
4
+
5
+ > **The Execution Continuity Layer for AI Agent Operations**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@online5880/opensession.svg?style=flat-square)](https://www.npmjs.com/package/@online5880/opensession)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
9
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](#)
10
+ [![Built with Supabase](https://img.shields.io/badge/Backend-Supabase-green.svg?style=flat-square)](https://supabase.com)
11
+
12
+ **OpenSession** is an execution continuity layer designed to help AI agents maintain context and workflow stability across different tools, environments, and network conditions.
13
+
14
+ ---
15
+
16
+ ## 🚀 Why OpenSession?
17
+
18
+ The biggest challenge in collaborating with AI agents is **"Context Fragmentation."**
19
+ - What happens if you move an agent from local to a remote server?
20
+ - What if the session drops due to network issues?
21
+ - How do you track the flow across multiple tools with disparate logs?
22
+
23
+ **OpenSession solves this.** By using a single session ID, all activities are persisted to Supabase, allowing you to monitor and resume work seamlessly via CLI, Web, or TUI.
24
+
25
+ ---
26
+
27
+ ## ✨ Key Capabilities
28
+
29
+ ### 1. Stable Session Model
30
+ - Resume work anywhere using the same `session_id`.
31
+ - Native support for `start` -> `pause` -> `resume` workflows.
32
+
33
+ ### 2. Durable Event Timeline
34
+ - **Intent**: What is the goal?
35
+ - **Action**: What command was executed?
36
+ - **Artifact**: What was produced?
37
+ - All elements are recorded in structured JSON for deep analysis.
38
+
39
+ ### 3. Multi-Surface Monitoring
40
+ - **CLI**: Intuitive terminal-based control.
41
+ - **WebUI (Viewer)**: High-resolution timeline dashboard in your browser.
42
+ - **TUI (Terminal UI)**: Keyboard-driven interactive dashboard inside your terminal.
43
+
44
+ ### 4. Enterprise-Grade Reliability
45
+ - **Idempotency**: Prevents duplicate event recording.
46
+ - **Exponential Backoff**: Automatic retries for unstable network scenarios.
47
+
48
+ ---
49
+
50
+ ## 🗺️ Roadmap: The 3-Layer Interface
51
+
52
+ | Phase | Surface | Status | Features |
53
+ | :--- | :--- | :--- | :--- |
54
+ | **Phase 1** | **CLI Core** | ✅ Stable | Session control, basic logging, config management |
55
+ | **Phase 2** | **WebUI Viewer** | ✅ Stable | Dark theme, KPI reports, JSON payload viewer |
56
+ | **Phase 3** | **Interactive TUI** | ✅ Active | Real-time session switching, live event streaming |
57
+
58
+ ### Installation & Setup
59
+
60
+ #### 1. Alias / Function Setup
61
+ To use the `opss` shorthand, add the following to your shell profile:
62
+
63
+ **macOS / Linux (Bash/Zsh):**
64
+ ```bash
65
+ alias opss='npx -y @online5880/opensession'
66
+ ```
67
+
68
+ **Windows (PowerShell):**
69
+ ```powershell
70
+ function opss { npx -y @online5880/opensession @args }
71
+ ```
72
+
73
+ #### 2. Global Install (Optional)
74
+ ```bash
75
+ npm install -g @online5880/opensession
76
+ ```
77
+
78
+ ---
79
+
80
+ ## 🚀 1-Minute Quickstart
81
+
82
+ 1. **Initialize**: Set up your Supabase URL and API Key.
83
+ ```bash
84
+ opss init
85
+ ```
86
+
87
+ 2. **Start Session**: Begin a new project session.
88
+ ```bash
89
+ opss start --project-key my-ai-lab --actor mane
90
+ ```
91
+
92
+ 3. **Log Events**: Record agent activities.
93
+ ```bash
94
+ opss log --limit 10
95
+ ```
96
+
97
+ 4. **Launch Dashboard**: Choose your preferred view.
98
+ ```bash
99
+ opss tui # Terminal dashboard (Recommended)
100
+ opss viewer # Web browser viewer
101
+ ```
102
+
103
+ ---
104
+
105
+ ## 📖 Command Reference
106
+
107
+ | Command | Alias | Description |
108
+ | :--- | :--- | :--- |
109
+ | `init` | `setup` | Initialize Supabase connection and local config. |
110
+ | `start` | `st` | Create a new session and start the timeline. |
111
+ | `resume` | `rs` | Resume an existing session with idempotency protection. |
112
+ | `tui` | - | **(New)** Launch the interactive Terminal UI dashboard. |
113
+ | `viewer` | `vw` | Run a local read-only web viewer server. |
114
+ | `status` | `ps` | Check CLI version and active session status. |
115
+ | `report` | - | Generate 28-day KPI stats and weekly trend analysis. |
116
+
117
+ ---
118
+
119
+ ## 🏗️ Architecture
120
+
121
+ OpenSession acts as a high-reliability bridge between agent runtimes and persistent storage.
122
+
123
+ ```mermaid
124
+ graph TD
125
+ Agent[AI Agent / Developer] -->|Log/Control| CLI[OpenSession CLI]
126
+ CLI -->|Persist| DB[(Supabase Cloud)]
127
+ DB -->|Stream| TUI[TUI Dashboard]
128
+ DB -->|Render| Web[Web Viewer]
129
+ ```
130
+
131
+ ---
132
+
133
+ ## 🤝 Contributing
134
+
135
+ Contributions are welcome! Please use [GitHub Issues](https://github.com/online5880/opensession/issues) for bug reports and feature requests.
136
+
137
+ MIT © [online5880](https://github.com/online5880)
package/package.json CHANGED
@@ -1,20 +1,23 @@
1
- {
2
- "name": "@online5880/opensession",
3
- "version": "0.1.1",
4
- "description": "Session continuity bridge CLI with Supabase backend",
5
- "type": "module",
6
- "bin": {
7
- "opensession": "src/cli.js"
8
- },
9
- "scripts": {
10
- "start": "node src/cli.js",
11
- "lint": "sh -c 'for f in src/*.js; do node --check \"$f\"; done'"
12
- },
13
- "engines": {
14
- "node": ">=18"
15
- },
16
- "dependencies": {
17
- "@supabase/supabase-js": "^2.52.1",
18
- "commander": "^14.0.1"
19
- }
20
- }
1
+ {
2
+ "name": "@online5880/opensession",
3
+ "version": "0.1.4",
4
+ "description": "Session continuity bridge CLI with Supabase backend",
5
+ "type": "module",
6
+ "bin": {
7
+ "opensession": "src/cli.js",
8
+ "opss": "src/cli.js"
9
+ },
10
+ "scripts": {
11
+ "start": "node src/cli.js",
12
+ "lint": "sh -c 'for f in src/*.js; do node --check \"$f\"; done'",
13
+ "test": "node --test test/*.test.js"
14
+ },
15
+ "engines": {
16
+ "node": ">=18"
17
+ },
18
+ "dependencies": {
19
+ "@supabase/supabase-js": "^2.52.1",
20
+ "blessed": "^0.1.81",
21
+ "commander": "^14.0.1"
22
+ }
23
+ }
@@ -0,0 +1,35 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>OpenSession — Agent Execution Continuity OS</title>
7
+ <meta name="description" content="Start once, resume anywhere. OpenSession is the execution continuity layer for AI agent operations." />
8
+ <link rel="preconnect" href="https://fonts.googleapis.com">
9
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap" rel="stylesheet">
11
+ <style>
12
+ :root {--bg:#080b12;--bg-soft:#0f1420;--panel:#121a28;--panel-2:#182234;--text:#e9f1ff;--muted:#99abc9;--line:#22314a;--brand:#64d6ff;--brand-2:#8c7bff;--ok:#37d67a;}
13
+ *{box-sizing:border-box} body{margin:0;font-family:Inter,system-ui,-apple-system,sans-serif;color:var(--text);background:radial-gradient(1200px 700px at 85% -10%,rgba(140,123,255,.22),transparent 60%),radial-gradient(1000px 600px at 10% -10%,rgba(100,214,255,.18),transparent 58%),var(--bg)}
14
+ .container{width:min(1120px,92vw);margin:0 auto}.topbar{display:flex;justify-content:space-between;align-items:center;padding:18px 0;border-bottom:1px solid rgba(255,255,255,.06);position:sticky;top:0;backdrop-filter:blur(10px);background:rgba(8,11,18,.75)}
15
+ .brand{font-weight:800}.brand span{color:var(--brand)}.nav a{color:var(--muted);text-decoration:none;margin-left:18px;font-size:.95rem}.hero{padding:74px 0 34px;text-align:center}
16
+ .eyebrow{color:var(--brand);font-weight:600;letter-spacing:.12em;text-transform:uppercase;font-size:.78rem}h1{margin:14px auto;max-width:900px;font-size:clamp(2rem,5vw,3.8rem);line-height:1.08}.sub{margin:0 auto;max-width:760px;color:var(--muted);font-size:1.08rem}
17
+ .cta{margin-top:28px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap}.btn{padding:12px 18px;border-radius:12px;text-decoration:none;font-weight:600}.btn.primary{color:#06121a;background:linear-gradient(90deg,var(--brand),#7de6ff)}.btn.secondary{color:var(--text);border:1px solid #2a3c59;background:rgba(255,255,255,.02)}
18
+ .metrics{margin-top:28px;display:grid;grid-template-columns:repeat(4,1fr);gap:10px;background:rgba(255,255,255,.02);border:1px solid var(--line);border-radius:14px;padding:10px}.metric{background:linear-gradient(180deg,var(--panel),var(--panel-2));border-radius:10px;padding:14px}.metric .n{font-size:1.1rem;font-weight:800}.metric .l{color:var(--muted);font-size:.85rem;margin-top:4px}
19
+ section{padding:36px 0}h2{margin:0 0 14px;font-size:1.45rem}.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.card{border:1px solid var(--line);background:linear-gradient(180deg,var(--panel),#111827);border-radius:14px;padding:16px}.card h3{margin:0 0 8px}.card p{margin:0;color:var(--muted);font-size:.93rem}
20
+ .arch{border:1px solid var(--line);border-radius:14px;padding:16px;background:linear-gradient(180deg,#101827,#0d1421)}.layers{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:12px}.layer{border:1px solid #2a3e60;border-radius:10px;padding:12px;background:#0c1320}
21
+ .timeline{border-left:2px solid #2a3b5a;margin-left:6px;padding-left:16px}.event{margin:0 0 14px}.event span{color:var(--muted);display:block;margin-top:4px}
22
+ .code{border:1px solid #2a3f60;border-radius:12px;background:#08111d;overflow:auto;font-family:"JetBrains Mono",monospace;font-size:.9rem;line-height:1.6;padding:14px}.code .ok{color:var(--ok)}.code .cmd{color:#8fd0ff}
23
+ footer{padding:30px 0 42px;color:var(--muted);font-size:.9rem;border-top:1px solid rgba(255,255,255,.06);margin-top:22px}
24
+ @media (max-width:900px){.cards{grid-template-columns:1fr}.layers{grid-template-columns:1fr 1fr}.metrics{grid-template-columns:1fr 1fr}}
25
+ </style>
26
+ </head>
27
+ <body><div class="container"><div class="topbar"><div class="brand">Open<span>Session</span></div><div class="nav"><a href="#features">Features</a><a href="#docs">Docs</a><a href="#updates">What's New</a></div></div>
28
+ <section class="hero"><div class="eyebrow">Agent Execution Continuity OS</div><h1>Start once, resume anywhere.<br/>Keep every agent run connected.</h1><p class="sub">OpenSession keeps intent, actions, and artifacts connected so teams can hand off work without losing context.</p><div class="cta"><a class="btn primary" href="#docs">Quickstart</a><a class="btn secondary" href="https://github.com/online5880/opensession" target="_blank" rel="noreferrer">GitHub</a></div>
29
+ <div class="metrics"><div class="metric"><div class="n">Resume Anywhere</div><div class="l">single session id across environments</div></div><div class="metric"><div class="n">Intent → Action → Artifact</div><div class="l">structured execution chain</div></div><div class="metric"><div class="n">Handoff Packet</div><div class="l">3-minute transfer context</div></div><div class="metric"><div class="n">Guardrails</div><div class="l">risk-level automation control</div></div></div></section>
30
+ <section id="features"><h2>Core capabilities</h2><div class="cards"><article class="card"><h3>Resume Anywhere ID</h3><p>Continue the same session from CLI, automation, or another machine using one stable session id.</p></article><article class="card"><h3>Automation Guardrails</h3><p>Classify risky automation paths and enforce approval policies before external side effects.</p></article><article class="card"><h3>Session Health Score</h3><p>Detect likely breakage early with health indicators for interruptions and loops.</p></article></div></section>
31
+ <section><h2>Architecture</h2><div class="arch">OpenSession runs as an execution continuity layer above your agent/runtime stack.<div class="layers"><div class="layer"><b>Surface</b>CLI / WebUI / TUI</div><div class="layer"><b>Core</b>Sessions / Events / Handoff</div><div class="layer"><b>Policy</b>Guardrails / Approvals</div><div class="layer"><b>Storage</b>Supabase + Artifact links</div></div></div></section>
32
+ <section id="updates"><h2>What’s New</h2><div class="timeline"><div class="event"><b>v0.1.x — continuity baseline</b><span>init/sync/start/resume/status/log stabilized with Supabase-backed runtime flow.</span></div><div class="event"><b>Viewer/TUI surfaces</b><span>read-only viewer and operational terminal flow added for daily ops visibility.</span></div><div class="event"><b>Reliability hardening</b><span>retry/idempotency and runbook-oriented operations added for unstable runtime scenarios.</span></div></div></section>
33
+ <section id="docs"><h2>Docs · One-command start</h2><div class="code"><div><span class="cmd">alias opss='npx -y @online5880/opensession'</span></div><div><span class="cmd">opss init</span> <span class="ok"># set Supabase URL/key</span></div><div><span class="cmd">opss sync --project demo</span></div><div><span class="cmd">opss start --project-key demo --actor mane</span></div><div><span class="cmd">opss status --project demo</span></div><div><span class="cmd">opss log --limit 50</span></div></div></section>
34
+ <footer>OpenSession · Execution continuity for AI agent operations · <a href="https://github.com/online5880/opensession" target="_blank" rel="noreferrer" style="color:#9fd6ff">GitHub</a></footer></div></body>
35
+ </html>
package/sql/schema.sql CHANGED
@@ -1,27 +1,38 @@
1
- create table if not exists projects (
2
- id uuid primary key default gen_random_uuid(),
3
- project_key text unique not null,
4
- name text not null,
5
- created_at timestamptz not null default now()
6
- );
7
-
8
- create table if not exists sessions (
9
- id uuid primary key default gen_random_uuid(),
10
- project_id uuid not null references projects(id) on delete cascade,
11
- actor text not null,
12
- status text not null default 'active',
13
- started_at timestamptz not null default now(),
14
- ended_at timestamptz
15
- );
16
-
17
- create index if not exists sessions_project_status_idx on sessions(project_id, status);
18
-
19
- create table if not exists session_events (
20
- id uuid primary key default gen_random_uuid(),
21
- session_id uuid not null references sessions(id) on delete cascade,
22
- type text not null,
23
- payload jsonb not null default '{}'::jsonb,
24
- created_at timestamptz not null default now()
25
- );
26
-
27
- create index if not exists session_events_session_created_idx on session_events(session_id, created_at);
1
+ create table if not exists projects (
2
+ id uuid primary key default gen_random_uuid(),
3
+ project_key text unique not null,
4
+ name text not null,
5
+ created_at timestamptz not null default now()
6
+ );
7
+
8
+ create table if not exists sessions (
9
+ id uuid primary key default gen_random_uuid(),
10
+ project_id uuid not null references projects(id) on delete cascade,
11
+ actor text not null,
12
+ status text not null default 'active',
13
+ started_at timestamptz not null default now(),
14
+ ended_at timestamptz
15
+ );
16
+
17
+ create index if not exists sessions_project_status_idx on sessions(project_id, status);
18
+
19
+ create table if not exists session_events (
20
+ id uuid primary key default gen_random_uuid(),
21
+ session_id uuid not null references sessions(id) on delete cascade,
22
+ type text not null,
23
+ idempotency_key text,
24
+ payload jsonb not null default '{}'::jsonb,
25
+ created_at timestamptz not null default now()
26
+ );
27
+
28
+ update session_events
29
+ set idempotency_key = payload->>'idempotencyKey'
30
+ where idempotency_key is null
31
+ and payload ? 'idempotencyKey'
32
+ and nullif(payload->>'idempotencyKey', '') is not null;
33
+
34
+ create index if not exists session_events_session_created_idx on session_events(session_id, created_at);
35
+ create index if not exists session_events_idempotency_idx on session_events(session_id, type, idempotency_key);
36
+ create unique index if not exists session_events_session_type_idempotency_key_uidx
37
+ on session_events(session_id, type, idempotency_key)
38
+ where idempotency_key is not null;