You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 705b1d2
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CLAUDE.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,9 @@ All providers talk directly to their APIs over native `fetch` (no vendor SDKs).
121
121
|`azure`|`gpt-4o`|`api-key` header — set `AI_BASE_URL` to the full deployment endpoint incl. `?api-version=…`|
122
122
|`ollama`|`llama3`|`Authorization: Bearer ollama`; default base `http://localhost:11434`|
123
123
124
-
`lib/sseLines.ts` is the shared SSE line reader used by every streaming provider. Currently only `POST /api/ai/cards/:id/summarize` consumes the provider.
124
+
`lib/sseLines.ts` is the shared SSE line reader used by every streaming provider. Two AI endpoints are currently implemented:
125
+
-`POST /api/ai/cards/:id/summarize` — generates a 2–3 sentence summary of a story card
126
+
-`POST /api/ai/parse-item` — parses natural-language work item requests and returns a discriminated union with type + payload (used for universal NL input across the board, epics, sprints, calendar, and project creation)
Copy file name to clipboardExpand all lines: client/CLAUDE.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,6 +65,7 @@ Scoped guidance for Claude Code when editing under `client/`. For repo-wide cont
65
65
-`CardModal` — full story editor; **5 tabs**: Description (with inline Tasks checklist), Comments, Activity, Tests, Dependencies (blocks / blocked-by). Right sidebar holds Sprint, Feature, Assignee, Priority, Story Points selectors
66
66
-`ProtectedRoute` — auth gate; redirects to `/login` when no session
67
67
-`FeatureGate` — `<FeatureGate flag="ai">{children}</FeatureGate>`; renders only when the flag resolves true
68
+
-`NLItemInput` — universal natural-language work item creation (gated by `FEATURE_AI`). Props: `allowedTypes` (array of types the parser can return), `context` (projectId/epicId/laneId), `lanes` (for story lane picker), `cards` (for task parent picker), `onCreated` (refresh callback). State machine: idle → input → loading → preview → confirming. Editable fields appear based on inferred type (priority/assignee for epics/features/stories, dates for sprints/calendar, parent selectors as needed). Wrapped in `<FeatureGate flag="ai">` at every mount site: BoardPage, EpicsPage, SprintsPage, CalendarPage, DashboardPage
68
69
-`ProjectAccessModal` — per-user table of all projects with role dropdowns; saves inline on change
69
70
-`CreateUserModal` (inline in AdminPage) — chains `POST /users` then `POST /projects/:id/access` per assigned project
70
71
-`SettingsTab` (inline in AdminPage) — feature flag toggles; toggle is disabled when the env var is `false` (env is the ceiling)
@@ -84,10 +85,15 @@ Scoped guidance for Claude Code when editing under `client/`. For repo-wide cont
84
85
Two files exist; the codebase is mid-migration:
85
86
86
87
-[src/api.ts](src/api.ts) — fetch-based, flat function exports. Most existing pages import from `'../api'` which resolves to this file (TS prefers the `.ts` over the `api/` directory).
87
-
-[src/api/index.ts](src/api/index.ts) — newer axios namespace (`api.projects.list()`, `api.cards.create()`, …). More complete coverage of new endpoints (roadmap, reports, projectAccess).
88
+
-[src/api/index.ts](src/api/index.ts) — newer axios namespace (`api.projects.list()`, `api.cards.create()`, …). More complete coverage of new endpoints (roadmap, reports, projectAccess, ai).
88
89
89
90
**When adding new endpoints:** add to the axios namespace in `api/index.ts`. Don't extend `api.ts` further. If you touch a page that's still on fetch, leave the migration for a separate change unless trivial — do NOT mix axios and fetch in the same component.
90
91
92
+
**AI methods and types exported from `api/index.ts`:**
93
+
-`api.ai.parseItem(data)` — `(input: string, context?: { projectId?, epicId?, laneId?, allowedTypes? }) => Promise<ParsedIntent>` — parses natural-language input into a work item
94
+
-`type ParsedIntent = { type, payload } | { type: "unknown", reason }` — discriminated union returned by the `/api/ai/parse-item` endpoint; `type` is one of `"epic"`, `"feature"`, `"story"`, `"task"`, `"project"`, `"sprint"`, `"calendar"`, or `"unknown"`; each type carries different fields in `payload` (e.g., epic/feature/story have priority + assignee, sprint has dates + goal, task has assignee only)
95
+
-`type NLAllowedType = "epic" | "feature" | "story" | "task" | "project" | "sprint" | "calendar"` — work item types the parser can infer
96
+
91
97
Vite proxies `/api` → `localhost:3000` in dev (see `vite.config.ts`). Both clients send credentials so the `sf_token` cookie is included.
0 commit comments