⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@ardaerzin
Copy link
Contributor

No description provided.

Add new internal workspace package `@agenta/shared` containing shared utilities, API helpers, and state atoms for use across Agenta packages and apps.

- Add package documentation and configuration
- Implement axios instance with configurable interceptors
- Add environment variable utilities with runtime override support
- Create project ID state atom
- Add validation utilities (URL, regex, UUID)
- Add date/time utilities with Web
- Add new package exports: hooks, schemas, types
- Add dependencies: json5, jsonrepair, @types/react
- Add peer dependency: react >=18.0.0
- Add useDebounceInput hook for debounced input handling with synchronized state
- Add chat message types: SimpleChatMessage, MessageContent, ToolCall, etc.
- Add chat message schemas: MESSAGE_CONTENT_SCHEMA, CHAT_MESSAGE_SCHEMA, CHAT_MESSAGES_ARRAY_SCHEMA
- Add chat message utilities: extract
Add comprehensive documentation for formatting utilities and OpenAPI schema dereferencing:
- Document preset formatters (number, currency, latency, tokens, percent, significant)
- Document createFormatter factory for custom formatters
- Add migration guide from OSS formatters
- Document dereferenceSchema utility for OpenAPI specs
- Add @scalar/openapi-parser dependency
- Export formatting utilities and types from package index
Add tryParseJsonValue function and JsonParseResult type to handle JSON parsing uniformly across objects, arrays, and JSON strings. Returns both the parsed value and an isJson flag to distinguish JSON from plain values.

Export new utility and type from package index and utils/index.
feat(shared): add pluralization utilities with formatCount helper

Add pluralize and formatCount utility functions for word pluralization:
- Add pluralize function with optional custom plural form (defaults to singular + "s")
- Add formatCount helper to format count with pluralized word (e.g., "5 items")
- Export utilities from package index and utils/index
- Add comprehensive JSDoc examples and usage documentation
```
feat(shared): add isPlainObject type guard and getValueAtStringPath utility

Add new utilities for type checking and path navigation:
- Add isPlainObject type guard to check for plain objects (not arrays, null, or primitives)
- Add getValueAtStringPath convenience wrapper for dot-notation path access
- Export both utilities from utils and package index
- Add JSDoc documentation with usage examples
```
…play

Add formatPreviewValue function for formatting unknown values in UI previews:
- Truncates long strings with configurable max length (default: 50)
- Type-aware formatting for primitives, arrays, and objects
- Shows array length and object keys preview
- Handles null/undefined with explicit labels
- Export from package index and utils/index
refactor(shared): improve type safety in env and pathUtils

- Add WindowWithEnv interface for type-safe window.__env access
- Replace (window as any) casts with proper WindowWithEnv type
- Fix hasValueAtPath to explicitly check for null before object type check
- Improve code readability with clearer conditional structure
```
refactor(shared): improve type safety in createBatchFetcher result resolution

- Add explicit type casts for Map key lookups with explanatory comments
- Try both original key type K and serialized string key for Map lookups
- Separate Map<K,V> and Map<string,V> access patterns for clarity
- Remove unnecessary 'unknown' cast from map-like object check
- Add comments explaining cast requirements and fallback logic
```
@vercel
Copy link

vercel bot commented Jan 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jan 26, 2026 1:40pm

Request Review

fix(shared): add null check after JSON parsing in getValueAtPath

Add null/undefined check after JSON parsing in getValueAtPath to handle cases where parsed JSON value is null. Prevents attempting object property access on null values.
```
@ardaerzin ardaerzin changed the title [Monorepo] Shared utils package [Monorepo] 1. Shared utils package Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants