Spaces:
Sleeping
Sleeping
Tasks: ChatGPT App Integration
Feature: 003-chatgpt-app-integration Status: Pending Spec: spec.md
Phase 1: Setup (Project Initialization)
Goal: Configure build pipelines and backend settings to support the new widget and auth modes.
- T001 Update
backend/src/services/config.pyto includechatgpt_service_tokenandchatgpt_cors_originfields - T002 Update
frontend/vite.config.tsto support multi-page build (index.htmlandwidget.html) - T003 Create
frontend/widget.htmlas the entry point for the ChatGPT widget - T004 Create
frontend/src/widget.tsxas the root React component for the widget
Phase 2: Foundational Tasks
Goal: Establish authentication and infrastructure required for the integration.
- T005 Refactor
backend/src/services/auth.pyto implement Strategy pattern (JWTValidatorandStaticTokenValidator) - T006 [P] Create unit tests for new Auth Strategy in
backend/tests/unit/test_auth_strategy.py - T007 Update
backend/src/api/middleware/auth_middleware.pyto use the new Auth Service strategies - T008 Update
backend/src/api/main.pyto configure CORS forhttps://chatgpt.com - T009 [P] Update
backend/src/api/main.pyto servewidget.htmlon/widgetroute withtext/html+skybridgeMIME type
Phase 3: User Story 1 - The Recall Loop
Goal: Enable searching and viewing notes within ChatGPT.
- T010 [US1] Extract
NoteViewercomponent logic into a reusable pure component (if not already) infrontend/src/components/NoteViewer.tsx - T011 [P] [US1] Create
SearchWidgetcomponent infrontend/src/components/SearchWidget.tsxfor the widget view - T012 [US1] Implement
WidgetAppcomponent infrontend/src/widget.tsxto handle routing between Note and Search views based on props/URL - T013 [US1] Update
backend/src/mcp/server.pyread_notetool to returnCallToolResultwith_meta.openai.outputTemplate - T014 [US1] Update
backend/src/mcp/server.pysearch_notestool to returnCallToolResultwith_meta.openai.outputTemplate
Phase 4: User Story 2 - In-Context Editing
Goal: Enable editing notes from ChatGPT interactions.
- T015 [US2] Verify
write_notetool functionality with Service Token auth (no code change expected if T007 is correct, but validation needed) - T016 [US2] Implement auto-refresh or status indication in
WidgetAppwhen a note is updated externally (by ChatGPT)
Final Phase: Polish
Goal: Ensure seamless experience and robustness.
- T017 Verify widget load performance and optimize bundle size if needed
- T018 Add error boundary to
WidgetAppto handle load failures gracefully inside the iframe
Dependencies
- Setup (T001-T004): Must be done first to enable widget development.
- Foundational (T005-T009): Auth and serving infrastructure required before widgets can be loaded by ChatGPT.
- US1 (T010-T014): Depends on Foundational. T013/T014 depend on T009 (widget serving).
- US2 (T015-T016): Depends on US1.
Parallel Execution Strategy
- Frontend vs Backend: T002-T004 (Frontend Setup) can run parallel to T001 & T005-T008 (Backend Auth).
- Within US1: T011 (Search Widget UI) and T013/T014 (MCP Tool Updates) can be done in parallel.
Implementation Strategy
- Infrastructure First: Get the backend serving the widget HTML and accepting the service token.
- Widget Shell: Build the minimal widget shell that can display something.
- Tool Connection: Wire up the MCP tools to point to the widget.
- Features: Flesh out the Viewer and Search capabilities.