-
Notifications
You must be signed in to change notification settings - Fork 466
[Monorepo] 1. Shared utils package #3555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ardaerzin
wants to merge
18
commits into
main
Choose a base branch
from
agenta-packages/agenta-shared-initial
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ```
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.