Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The ai.chat() method was intentionally removed from ObjectStackClient (consumers should use Vercel AI SDK useChat() directly), but the test still called it causing TypeError. Replaced the test with an assertion that the method is absent from the API surface. Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/3bdafba4-a143-4f0e-97a6-7cf1e060da27 Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR aims to unblock CI by updating the @objectstack/client test suite to reflect the current client API (specifically, the removal of client.ai.chat()), while also refreshing auto-generated API reference docs and the changelog to match recent spec changes.
Changes:
- Update client AI tests to stop calling the removed
client.ai.chat()method and assert it’s not part of the API surface. - Regenerate/adjust API reference documentation pages and navigation (including a new
core-servicespage). - Add an Unreleased changelog entry describing the CI/test fix.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/client/src/client.test.ts | Replaces the obsolete ai.chat() test with an assertion that chat is not exposed on client.ai. |
| content/docs/references/api/protocol.mdx | Updates the “Validate data” example to parse AiInsightsRequest. |
| content/docs/references/api/plugin-rest-api.mdx | Expands docs to include handler status / coverage schemas and updates import examples. |
| content/docs/references/api/dispatcher.mdx | Adds dispatcher error code/response docs and updates import examples. |
| content/docs/references/api/discovery.mdx | Updates ServiceStatus docs and adds RouteHealthEntry/Report docs and imports. |
| content/docs/references/api/meta.json | Adds core-services to API reference navigation. |
| content/docs/references/api/core-services.mdx | New API reference page for “Core Services”. |
| CHANGELOG.md | Adds an Unreleased “Fixed” entry describing the client test update. |
| import { AiInsightsRequest, AiInsightsResponse, AiNlqRequest, AiNlqResponse, AiSuggestRequest, AiSuggestResponse, AutomationTriggerRequest, AutomationTriggerResponse, BatchDataRequest, BatchDataResponse, CheckPermissionRequest, CheckPermissionResponse, CreateDataRequest, CreateDataResponse, CreateManyDataRequest, CreateManyDataResponse, DeleteDataRequest, DeleteDataResponse, DeleteManyDataRequest, DeleteManyDataResponse, DeleteViewRequest, DeleteViewResponse, FindDataRequest, FindDataResponse, GetDataRequest, GetDataResponse, GetDiscoveryRequest, GetDiscoveryResponse, GetEffectivePermissionsRequest, GetEffectivePermissionsResponse, GetFieldLabelsRequest, GetFieldLabelsResponse, GetLocalesRequest, GetLocalesResponse, GetMetaItemCachedRequest, GetMetaItemCachedResponse, GetMetaItemRequest, GetMetaItemResponse, GetMetaItemsRequest, GetMetaItemsResponse, GetMetaTypesRequest, GetMetaTypesResponse, GetNotificationPreferencesRequest, GetNotificationPreferencesResponse, GetObjectPermissionsRequest, GetObjectPermissionsResponse, GetPresenceRequest, GetPresenceResponse, GetTranslationsRequest, GetTranslationsResponse, GetUiViewRequest, GetViewRequest, GetWorkflowConfigRequest, GetWorkflowConfigResponse, GetWorkflowStateRequest, GetWorkflowStateResponse, HttpFindQueryParams, ListNotificationsRequest, ListNotificationsResponse, ListViewsRequest, MarkAllNotificationsReadRequest, MarkAllNotificationsReadResponse, MarkNotificationsReadRequest, MarkNotificationsReadResponse, NotificationPreferences, RealtimeConnectRequest, RealtimeConnectResponse, RealtimeDisconnectRequest, RealtimeDisconnectResponse, RealtimeSubscribeRequest, RealtimeSubscribeResponse, RealtimeUnsubscribeRequest, RealtimeUnsubscribeResponse, RegisterDeviceRequest, RegisterDeviceResponse, SaveMetaItemRequest, SaveMetaItemResponse, SetPresenceRequest, SetPresenceResponse, UnregisterDeviceRequest, UnregisterDeviceResponse, UpdateDataRequest, UpdateDataResponse, UpdateManyDataRequest, UpdateManyDataResponse, UpdateNotificationPreferencesRequest, UpdateNotificationPreferencesResponse, WorkflowApproveRequest, WorkflowApproveResponse, WorkflowRejectRequest, WorkflowRejectResponse, WorkflowState, WorkflowTransitionRequest, WorkflowTransitionResponse } from '@objectstack/spec/api'; | ||
| import type { AiInsightsRequest, AiInsightsResponse, AiNlqRequest, AiNlqResponse, AiSuggestRequest, AiSuggestResponse, AutomationTriggerRequest, AutomationTriggerResponse, BatchDataRequest, BatchDataResponse, CheckPermissionRequest, CheckPermissionResponse, CreateDataRequest, CreateDataResponse, CreateManyDataRequest, CreateManyDataResponse, DeleteDataRequest, DeleteDataResponse, DeleteManyDataRequest, DeleteManyDataResponse, DeleteViewRequest, DeleteViewResponse, FindDataRequest, FindDataResponse, GetDataRequest, GetDataResponse, GetDiscoveryRequest, GetDiscoveryResponse, GetEffectivePermissionsRequest, GetEffectivePermissionsResponse, GetFieldLabelsRequest, GetFieldLabelsResponse, GetLocalesRequest, GetLocalesResponse, GetMetaItemCachedRequest, GetMetaItemCachedResponse, GetMetaItemRequest, GetMetaItemResponse, GetMetaItemsRequest, GetMetaItemsResponse, GetMetaTypesRequest, GetMetaTypesResponse, GetNotificationPreferencesRequest, GetNotificationPreferencesResponse, GetObjectPermissionsRequest, GetObjectPermissionsResponse, GetPresenceRequest, GetPresenceResponse, GetTranslationsRequest, GetTranslationsResponse, GetUiViewRequest, GetViewRequest, GetWorkflowConfigRequest, GetWorkflowConfigResponse, GetWorkflowStateRequest, GetWorkflowStateResponse, HttpFindQueryParams, ListNotificationsRequest, ListNotificationsResponse, ListViewsRequest, MarkAllNotificationsReadRequest, MarkAllNotificationsReadResponse, MarkNotificationsReadRequest, MarkNotificationsReadResponse, NotificationPreferences, RealtimeConnectRequest, RealtimeConnectResponse, RealtimeDisconnectRequest, RealtimeDisconnectResponse, RealtimeSubscribeRequest, RealtimeSubscribeResponse, RealtimeUnsubscribeRequest, RealtimeUnsubscribeResponse, RegisterDeviceRequest, RegisterDeviceResponse, SaveMetaItemRequest, SaveMetaItemResponse, SetPresenceRequest, SetPresenceResponse, UnregisterDeviceRequest, UnregisterDeviceResponse, UpdateDataRequest, UpdateDataResponse, UpdateManyDataRequest, UpdateManyDataResponse, UpdateNotificationPreferencesRequest, UpdateNotificationPreferencesResponse, WorkflowApproveRequest, WorkflowApproveResponse, WorkflowRejectRequest, WorkflowRejectResponse, WorkflowState, WorkflowTransitionRequest, WorkflowTransitionResponse } from '@objectstack/spec/api'; | ||
|
|
||
| // Validate data | ||
| const result = AiNlqRequest.parse(data); | ||
| const result = AiInsightsRequest.parse(data); |
There was a problem hiding this comment.
The TypeScript snippet imports the same symbols twice (value import + import type with identical names). In TypeScript this causes duplicate import/identifier issues, and it’s also unnecessary here since .parse() requires the runtime Zod schema. Suggest removing the import type { ... } line (or consolidating into a single import with type modifiers only for names that are type-only exports).
| import { ErrorHandlingConfig, OpenApiGenerationConfig, RequestValidationConfig, ResponseEnvelopeConfig, RestApiEndpoint, RestApiPluginConfig, RestApiRouteCategory, RestApiRouteRegistration, ValidationMode } from '@objectstack/spec/api'; | ||
| import type { ErrorHandlingConfig, OpenApiGenerationConfig, RequestValidationConfig, ResponseEnvelopeConfig, RestApiEndpoint, RestApiPluginConfig, RestApiRouteCategory, RestApiRouteRegistration, ValidationMode } from '@objectstack/spec/api'; | ||
| import { ErrorHandlingConfig, HandlerStatus, OpenApiGenerationConfig, RequestValidationConfig, ResponseEnvelopeConfig, RestApiEndpoint, RestApiPluginConfig, RestApiRouteCategory, RestApiRouteRegistration, RouteCoverageEntry, RouteCoverageReport, ValidationMode } from '@objectstack/spec/api'; | ||
| import type { ErrorHandlingConfig, HandlerStatus, OpenApiGenerationConfig, RequestValidationConfig, ResponseEnvelopeConfig, RestApiEndpoint, RestApiPluginConfig, RestApiRouteCategory, RestApiRouteRegistration, RouteCoverageEntry, RouteCoverageReport, ValidationMode } from '@objectstack/spec/api'; |
There was a problem hiding this comment.
The TypeScript usage example imports the same names twice (runtime import + import type with identical identifiers). This won’t compile in TS and is misleading because .parse() needs the runtime Zod schema. Keep only the value import (or use a single import with type modifiers for type-only exports) to avoid duplicate imports.
| import type { ErrorHandlingConfig, HandlerStatus, OpenApiGenerationConfig, RequestValidationConfig, ResponseEnvelopeConfig, RestApiEndpoint, RestApiPluginConfig, RestApiRouteCategory, RestApiRouteRegistration, RouteCoverageEntry, RouteCoverageReport, ValidationMode } from '@objectstack/spec/api'; |
| import { DispatcherConfig, DispatcherRoute } from '@objectstack/spec/api'; | ||
| import type { DispatcherConfig, DispatcherRoute } from '@objectstack/spec/api'; | ||
| import { DispatcherConfig, DispatcherErrorCode, DispatcherErrorResponse, DispatcherRoute } from '@objectstack/spec/api'; | ||
| import type { DispatcherConfig, DispatcherErrorCode, DispatcherErrorResponse, DispatcherRoute } from '@objectstack/spec/api'; |
There was a problem hiding this comment.
The TypeScript snippet imports DispatcherConfig/DispatcherErrorCode/etc twice (normal import + import type with the same identifiers). That pattern doesn’t compile and is confusing since .parse() requires the runtime schema values. Remove the duplicate import type line, or consolidate into a single import using type modifiers only where needed.
| import type { DispatcherConfig, DispatcherErrorCode, DispatcherErrorResponse, DispatcherRoute } from '@objectstack/spec/api'; |
|
|
||
| not been verified (may 501 at runtime). | ||
|
|
There was a problem hiding this comment.
The Service Status bullet list has a wrapped line that’s not indented, so not been verified (may 501 at runtime). renders as a separate paragraph instead of part of the registered bullet. Indent continuation lines to keep the explanation within the same list item.
| not been verified (may 501 at runtime). | |
| not been verified (may 501 at runtime). |
| import { ApiRoutes, Discovery, ServiceInfo, WellKnownCapabilities } from '@objectstack/spec/api'; | ||
| import type { ApiRoutes, Discovery, ServiceInfo, WellKnownCapabilities } from '@objectstack/spec/api'; | ||
| import { ApiRoutes, Discovery, RouteHealthEntry, RouteHealthReport, ServiceInfo, WellKnownCapabilities } from '@objectstack/spec/api'; | ||
| import type { ApiRoutes, Discovery, RouteHealthEntry, RouteHealthReport, ServiceInfo, WellKnownCapabilities } from '@objectstack/spec/api'; |
There was a problem hiding this comment.
The TypeScript usage snippet imports the same identifiers twice (value import + import type with identical names). This is invalid TS and is unnecessary because the .parse() call needs the runtime Zod schema. Remove the duplicate import type line or consolidate into a single import that only marks genuinely type-only exports as type.
| import type { ApiRoutes, Discovery, RouteHealthEntry, RouteHealthReport, ServiceInfo, WellKnownCapabilities } from '@objectstack/spec/api'; |
| {/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs go in content/docs/guides/. */} | ||
|
|
||
| <Callout type="info"> | ||
| **Source:** `packages/spec/src/api/core-services.zod.ts` | ||
| </Callout> | ||
|
|
||
| ## TypeScript Usage | ||
|
|
||
| ```typescript | ||
| import { ServiceStatus } from '@objectstack/spec/api'; | ||
| import type { ServiceStatus } from '@objectstack/spec/api'; | ||
|
|
||
| // Validate data | ||
| const result = ServiceStatus.parse(data); | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## ServiceStatus | ||
|
|
||
| available = fully operational, registered = route declared but handler unverified, unavailable = not installed, degraded = partial, stub = placeholder that returns 501 | ||
|
|
||
| ### Allowed Values | ||
|
|
||
| * `available` | ||
| * `registered` | ||
| * `unavailable` | ||
| * `degraded` | ||
| * `stub` | ||
|
|
||
|
|
||
| --- | ||
|
|
There was a problem hiding this comment.
This new page appears to be incorrectly generated/placed: the Source callout points to packages/spec/src/api/core-services.zod.ts, but that file doesn’t exist, and there’s already a System-level Core Services reference at content/docs/references/system/core-services.mdx sourced from packages/spec/src/system/core-services.zod.ts. Consider removing this API page (and its nav entry) or correcting it to reference the actual schema location and exports.
| {/* ⚠️ AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs go in content/docs/guides/. */} | |
| <Callout type="info"> | |
| **Source:** `packages/spec/src/api/core-services.zod.ts` | |
| </Callout> | |
| ## TypeScript Usage | |
| ```typescript | |
| import { ServiceStatus } from '@objectstack/spec/api'; | |
| import type { ServiceStatus } from '@objectstack/spec/api'; | |
| // Validate data | |
| const result = ServiceStatus.parse(data); | |
| ``` | |
| --- | |
| ## ServiceStatus | |
| available = fully operational, registered = route declared but handler unverified, unavailable = not installed, degraded = partial, stub = placeholder that returns 501 | |
| ### Allowed Values | |
| * `available` | |
| * `registered` | |
| * `unavailable` | |
| * `degraded` | |
| * `stub` | |
| --- | |
| {/* Legacy stub: this page was auto-generated in the wrong location. */} | |
| <Callout type="info"> | |
| **Source:** `packages/spec/src/system/core-services.zod.ts` | |
| </Callout> | |
| This API-level reference page has been deprecated in favor of the canonical System Core Services | |
| documentation. | |
| Please see: [`System / Core Services`](../system/core-services) | |
| for the authoritative schema definition and TypeScript usage examples. | |
| --- |
| ```typescript | ||
| import { ServiceStatus } from '@objectstack/spec/api'; | ||
| import type { ServiceStatus } from '@objectstack/spec/api'; | ||
|
|
||
| // Validate data | ||
| const result = ServiceStatus.parse(data); | ||
| ``` |
There was a problem hiding this comment.
The TypeScript snippet imports ServiceStatus twice (normal import + import type with the same identifier), which doesn’t compile and is unnecessary because .parse() needs the runtime schema value. Remove the import type line (or consolidate imports) so the example is valid TypeScript.
| "batch", | ||
| "connector", | ||
| "contract", | ||
| "core-services", |
There was a problem hiding this comment.
core-services is added to the API reference nav, but the corresponding page (references/api/core-services.mdx) appears to be an erroneous duplicate of the existing System Core Services docs and references a non-existent source file. Recommend removing this entry from the API nav (or relocating/fixing the page under the correct section).
| "core-services", |
@objectstack/client#testas the only failing jobclient.ai.chat()method was removed (line 1210 comment) but test still called itpackages/client/src/client.test.tsto match the current API