Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4e0191c
chore: New sprint, conversation continuation
cephalization Jan 22, 2026
017982e
feat(phoenix-insight): conversation-types - define conversation messa…
cephalization Jan 22, 2026
27ff4a4
feat(phoenix-insight): message-conversion-utils - implement truncateR…
cephalization Jan 22, 2026
04df382
feat(phoenix-insight): agent-messages-api - add optional messages par…
cephalization Jan 22, 2026
d6ca0b4
feat(phoenix-insight): token-error-detection - add isTokenLimitError …
cephalization Jan 22, 2026
5fd3d0e
feat(phoenix-insight): conversation-compaction - implement compactCon…
cephalization Jan 22, 2026
c3d6bf2
feat(phoenix-insight): cli-session-history - pass conversation histor…
cephalization Jan 22, 2026
45fad38
feat(phoenix-insight): cli-session-token-retry - auto-compact convers…
cephalization Jan 22, 2026
41dc762
feat(phoenix-insight): interactive-cli-history - maintain conversatio…
cephalization Jan 22, 2026
71dd371
feat(phoenix-insight): interactive-cli-token-retry - auto-compact con…
cephalization Jan 22, 2026
ca0e921
feat(phoenix-insight): ui-send-history - add conversation history to …
cephalization Jan 22, 2026
53dfda1
feat(phoenix-insight): ui-handle-compaction - handle context_compacte…
cephalization Jan 22, 2026
f9d9f08
feat(phoenix-insight): cli-session-use-ui-history - use client-provid…
cephalization Jan 22, 2026
4218593
feat(phoenix-insight): test-conversation-utils - add unit tests for c…
cephalization Jan 22, 2026
6d9d107
feat(phoenix-insight): test-token-error-detection - add tests for all…
cephalization Jan 22, 2026
53b150e
feat(phoenix-insight): test-session-history - add integration tests f…
cephalization Jan 22, 2026
1a74459
fix: Ensure conversation history is iterable while streaming
cephalization Jan 22, 2026
bce7ffe
fix: Improve syntax highlighting in dark and light mode
cephalization Jan 22, 2026
f0269a7
chore: Add mprocs for dev
cephalization Jan 22, 2026
1fa4086
changeset
cephalization Jan 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/quiet-areas-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@cephalization/phoenix-insight": minor
"@cephalization/phoenix-insight-ui": minor
---

feat: Add conversation continuation to sessions
62 changes: 62 additions & 0 deletions .math/backups/export-shared-types-from-ui/LEARNINGS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Project Learnings Log

This file is appended by each agent after completing a task.
Key insights, gotchas, and patterns discovered during implementation.

Use this knowledge to avoid repeating mistakes and build on what works.

---

<!-- Agents: Append your learnings below this line -->
<!-- Format:
## <task-id>

- Key insight or decision made
- Gotcha or pitfall discovered
- Pattern that worked well
- Anything the next agent should know
-->

## export-websocket-types

- The UI package uses pnpm workspaces with `"workspace:*"` dependency in CLI's package.json to reference the UI package
- For ESM packages, the `exports` field needs both `types` and `import` conditions pointing to source `.ts` files (since this is a private package consumed within the monorepo)
- The barrel file pattern (`src/lib/types.ts`) using `export type { ... } from "./websocket"` works well for re-exporting types
- Pre-existing test failures in `registry.test.tsx` and `catalog.test.ts` exist in the UI package (related to a missing `registry` export and Chart component count mismatch) - these are unrelated to this task
- CLI package typecheck and all 534 tests pass with the new export - verified import works with `npx tsx` test script

## export-catalog-types

- Added `./catalog` export entry to UI package.json following the same pattern as `./types` export
- The `catalog.ts` file already exports: `catalog`, all 11 individual schemas (CardSchema, TextSchema, HeadingSchema, ListSchema, TableSchema, MetricSchema, BadgeSchema, AlertSchema, SeparatorSchema, CodeSchema, ChartSchema), `PhoenixInsightCatalog` type, and re-exports `UITree` and `UIElement` from @json-render/core
- Fixed a pre-existing bug: `registry.tsx` was missing the `registry` object export that `registry.test.tsx` expected - added the export which fixed 3 pre-existing test failures
- Two pre-existing test issues remain unrelated to this task: (1) catalog.test.ts expects 10 components but there are 11 (Chart added later), (2) ReportRenderer.test.tsx has a mock issue with vi.mock not exposing CardRenderer
- Verified CLI can successfully import from `@cephalization/phoenix-insight-ui/catalog` using Node ESM resolution

## cli-import-websocket-types

- When CLI (using `module: nodenext` resolution) imports from UI package (using `moduleResolution: bundler`), the UI barrel file must use explicit `.ts` extensions in re-exports for Node16/NodeNext compatibility
- Fixed UI's `src/lib/types.ts` to use `from "./websocket.ts"` instead of `from "./websocket"` to satisfy CLI's stricter module resolution
- Re-exported the imported types (`export type { ClientMessage, ServerMessage, JSONRenderTree }`) from CLI's websocket.ts so that consumers of the CLI module can still access these types
- Removed ~30 lines of duplicated type definitions from CLI, replaced with 5-line import/re-export pattern
- All 534 CLI tests pass; typecheck passes for both packages
- Pre-existing UI test failures (catalog component count, ReportRenderer mock) remain unrelated to this change

## cli-import-catalog-schemas

- Removed ~90 lines of duplicate Zod schema definitions from `report-tool.ts`, replaced with a single import from `@cephalization/phoenix-insight-ui/catalog`
- The UI schemas use simpler names (e.g., `CardSchema`) while CLI had used `CardPropsSchema` - updated `getPropsSchemaForType()` switch cases accordingly
- Important: The original `UIElementSchema` was missing "Chart" in its type enum - added it to maintain consistency with `VALID_COMPONENT_TYPES` array
- Kept the `UIElementSchema`, `UITreeSchema`, and validation logic in CLI since they're tool-specific (the json-render types from UI don't include the `children` and `parentKey` fields needed for CLI validation)
- All 534 CLI tests pass; typecheck passes for both packages

## dynamic-report-prompt

- Created `generateComponentDocs(catalog)` helper that iterates over `catalog.components` to build documentation dynamically
- Zod schemas can be introspected using `instanceof z.ZodObject` and accessing `.shape` to get the object keys
- For detecting optional props, check for `z.ZodOptional`, `z.ZodNullable`, or use `.isOptional?.()` method (note the optional chaining since not all types have this method)
- The catalog structure provides `props` (Zod schema), `hasChildren` (boolean), and `description` (string) for each component
- Format each component as `- ComponentName: description (props: propA, propB?, propC?; can have children)` where `?` suffix indicates optional props
- Exported `generateComponentDocs` function for testing and potential future use
- Added comprehensive tests: component names, descriptions, prop names, optional markers (`?`), children notes, and formatting
- All 542 CLI tests pass; typecheck passes for both packages
Loading