Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"@corbits/approvals": "workspace:*",
"@corbits/artifact-ui": "workspace:*",
"@corbits/bench-ui": "workspace:*",
"@corbits/chat": "workspace:*",
"@corbits/chat-ui": "workspace:*",
"@corbits/client-log": "workspace:*",
"@corbits/command-palette": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/block-response-actions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Builds the `BlockResponseActions` port `ChatWorkspace` (`@corbits/chat-ui`)
// calls for its in-chat poll/form cards, mirroring `createChatApprovalActions`
// in `./approval-actions.ts`: `@corbits/chat-ui` owns no session, so the host
// supplies the concrete fetches against `@corbits/chat`'s own response
// supplies the concrete fetches against the hub's chat response
// routes (`getBlockResponses`/`submitPollResponse`/`submitFormResponse` in
// `api.ts`).

Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/insights-stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// routines). No new analytics backend — I1 is an honest live surface on
// existing endpoints.

import { isWorkbenchHostDefinitionName } from "@corbits/chat/workbench-host-naming";
import { isWorkbenchHostDefinitionName } from "@corbits/chat-ui/wire/workbench-host-naming";
import {
runOutcomeStatus,
withListingAbandoned,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/pages/new-workbench-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
listTenantInvitableDefinitions,
WorkbenchLoadingState,
} from "@corbits/chat-ui";
import { humanizeSlug } from "@corbits/chat/display-name";
import { humanizeSlug } from "@corbits/chat-ui/wire/display-name";
import { useEffect, useRef, useState } from "react";
import { useQuery, useQueryClient } from "@tanstack/react-query";
import { ApiQueryError, describeApiError } from "@corbits/api-query";
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/profile-relations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// participant instead of by a fixed title, and fall back to creating one —
// to any profile subject rather than one hardcoded agent.

import { localPartOf } from "@corbits/chat/agent-address";
import { localPartOf } from "@corbits/chat-ui/wire/agent-address";
import {
createWorkbench,
findDirectWorkbenchWith,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/skill-display-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// `displayTitle` (or the native skill asset's `displayName`, which the
// stock asset routes carry as of CL-8086) or a Title Case reading of that
// slug (CL-6747).
import { humanizeSlug } from "@corbits/chat/display-name";
import { humanizeSlug } from "@corbits/chat-ui/wire/display-name";

export function skillDisplayName(skill: {
readonly name: string;
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/workbench-timeline-merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
// array. No new backend: every input here is already fetched by an
// existing page (chat-ui, api.ts).

import { isAgentAddress } from "@corbits/chat/mentions";
import { localPartOf } from "@corbits/chat/agent-address";
import { isAgentAddress } from "@corbits/chat-ui/wire/mentions";
import { localPartOf } from "@corbits/chat-ui/wire/agent-address";
import type { WorkbenchThread, MessageItem } from "@corbits/chat-ui";

import type { PendingApproval } from "./pending-approvals";
Expand Down
6 changes: 0 additions & 6 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions packages/chat-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,24 @@
"sideEffects": false,
"exports": {
".": "./src/index.ts",
"./styles.css": "./src/styles.css"
"./styles.css": "./src/styles.css",
"./wire/parts": "./src/wire/parts.ts",
"./wire/blocks": "./src/wire/blocks.ts",
"./wire/mentions": "./src/wire/mentions.ts",
"./wire/participants": "./src/wire/participants.ts",
"./wire/display-name": "./src/wire/display-name.ts",
"./wire/agent-address": "./src/wire/agent-address.ts",
"./wire/reaction-emoji": "./src/wire/reaction-emoji.ts",
"./wire/workbench-host-naming": "./src/wire/workbench-host-naming.ts",
"./wire/stream-events": "./src/wire/stream-events.ts",
"./wire/consumer-inference-text": "./src/wire/consumer-inference-text.ts"
},
"scripts": {
"typecheck": "tsc --noEmit",
"test": "bun test"
},
"dependencies": {
"@corbits/api-query": "workspace:*",
"@corbits/chat": "workspace:*",
"@corbits/context-menu": "workspace:*",
"@corbits/error-sink": "workspace:*",
"@corbits/inference-settings": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/chat-ui/src/agent-part-adapter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Adapting `@corbits/chat`'s parts to the shapes `@corbits/react-ui`
// Adapting the chat wire's parts (`./wire/parts`) to the shapes `@corbits/react-ui`
// renders (CL-6318).
//
// Only reasoning crosses this boundary now. Tool calls used to as well,
Expand All @@ -8,7 +8,7 @@
// turn's calls into rounds and never shows a reader JSON at all.

import type { PartReasoning } from "@corbits/react-ui";
import type { ReasoningPart } from "@corbits/chat/parts";
import type { ReasoningPart } from "./wire/parts";

/** chat's reasoning carries no duration; react-ui's is optional, so it
* stays absent rather than being fabricated. */
Expand Down
35 changes: 18 additions & 17 deletions packages/chat-ui/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
// The chat surface's one seam to `@corbits/chat`'s HTTP routes (see
// packages/chat/src/routes.ts). Every fetch the chat/* components make goes
// through a function here, and every response is parsed with an arktype
// schema at the boundary — a route shape change is a one-file fix.
// The chat surface's one seam to the hub's chat HTTP routes (see
// packages/chat/src/routes.ts, still the routes' implementation). Every
// fetch the chat/* components make goes through a function here, and every
// response is parsed with an arktype schema at the boundary — a route
// shape change is a one-file fix.
//
// The wire-level `Part` and participant schemas are imported from
// `@corbits/chat` rather than redefined here: this UI validates the wire
// contract at its own boundary, but against the one real schema rather than
// a second, hand-copied one.
// The wire-level `Part` and participant schemas live in this package's own
// `./wire` (mirrored off the hub's wire contract) rather than being
// imported from `@corbits/chat` directly, so this browser bundle never
// carries a server-only dependency.

import { type } from "arktype";
import type { ArkErrors } from "arktype";
import { Part } from "@corbits/chat/parts";
import { parseParticipants } from "@corbits/chat/participants";
import type { ParticipantRecord } from "@corbits/chat/participants";
import type { WorkbenchOnboardingStep } from "@corbits/chat/blocks";
import { Part } from "./wire/parts";
import { parseParticipants } from "./wire/participants";
import type { ParticipantRecord } from "./wire/participants";
import type { WorkbenchOnboardingStep } from "./wire/blocks";
import { UnauthenticatedError } from "@corbits/api-query";
import { InferenceSettingsApiError } from "@corbits/inference-settings";
import { jimmyAgentRequest } from "@workbench/templates";
Expand All @@ -27,14 +28,14 @@ export {
FilePart,
EventPart,
Part,
} from "@corbits/chat/parts";
export type { ParticipantRecord } from "@corbits/chat/participants";
} from "./wire/parts";
export type { ParticipantRecord } from "./wire/participants";
export type {
OnboardingStepLabel,
WorkbenchOnboardingStep,
} from "@corbits/chat/blocks";
export { REACTION_EMOJI } from "@corbits/chat/reaction-emoji";
export type { ReactionEmoji } from "@corbits/chat/reaction-emoji";
} from "./wire/blocks";
export { REACTION_EMOJI } from "./wire/reaction-emoji";
export type { ReactionEmoji } from "./wire/reaction-emoji";

export const WorkbenchKind = type("'workbench' | 'chat'");
export type WorkbenchKind = typeof WorkbenchKind.infer;
Expand Down
2 changes: 1 addition & 1 deletion packages/chat-ui/src/blocks/approve-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// pre-round-trip framing: fixed disabled buttons, no fetch.

import { Button, toast } from "@corbits/react-ui";
import type { ApproveBlockData } from "@corbits/chat/blocks";
import type { ApproveBlockData } from "../wire/blocks";
import { useEffect, useState } from "react";

import { CHAT_STRINGS } from "../strings";
Expand Down
2 changes: 1 addition & 1 deletion packages/chat-ui/src/blocks/block-responses.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// The in-chat poll/form cards' one seam to `@corbits/chat`'s response
// The in-chat poll/form cards' one seam to the hub's chat response
// routes. `@corbits/chat-ui` owns no session, so it never fetches or
// mutates responses itself -- the host supplies this port, mirroring how
// `ApprovalActions` threads the approve card's round-trip through
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// known-good connection. An explicit `disconnected` result clears the
// snapshot so a real disconnect still shows Connect.
import { useCallback, useEffect, useRef, useState } from "react";
import type { ConnectGithubBlockData } from "@corbits/chat/blocks";
import type { ConnectGithubBlockData } from "../wire/blocks";
import { reportError } from "@corbits/error-sink";

import { CHAT_STRINGS } from "../strings";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// connect that goes nowhere, matching the "no port, no feature"
// fallback every other block uses.
import { useEffect, useState } from "react";
import type { ConnectServiceBlockData } from "@corbits/chat/blocks";
import type { ConnectServiceBlockData } from "../wire/blocks";

import type {
ConnectServiceActions,
Expand Down
2 changes: 1 addition & 1 deletion packages/chat-ui/src/blocks/form-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { Button } from "@corbits/react-ui";
import { useEffect, useState } from "react";
import type { FormEvent } from "react";
import type { FormBlockData } from "@corbits/chat/blocks";
import type { FormBlockData } from "../wire/blocks";

import { CHAT_STRINGS } from "../strings";
import { BlockCard } from "./block-card";
Expand Down
2 changes: 1 addition & 1 deletion packages/chat-ui/src/blocks/metrics-block.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MetricsBlockData } from "@corbits/chat/blocks";
import type { MetricsBlockData } from "../wire/blocks";

import { BlockCard } from "./block-card";

Expand Down
2 changes: 1 addition & 1 deletion packages/chat-ui/src/blocks/poll-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// nothing here is ever trusted twice.

import { useEffect, useState } from "react";
import type { PollBlockData } from "@corbits/chat/blocks";
import type { PollBlockData } from "../wire/blocks";

import { CHAT_STRINGS } from "../strings";
import { BlockCard } from "./block-card";
Expand Down
2 changes: 1 addition & 1 deletion packages/chat-ui/src/blocks/question-block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// collapsing as if the agent had already been reached.

import { useEffect, useRef, useState, type FormEvent } from "react";
import type { QuestionBlockData } from "@corbits/chat/blocks";
import type { QuestionBlockData } from "../wire/blocks";
import { Check } from "@corbits/icons";

import { CHAT_STRINGS } from "../strings";
Expand Down
6 changes: 3 additions & 3 deletions packages/chat-ui/src/blocks/registry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// and routes each known type to its view; anything unknown or malformed
// renders a labeled fallback card instead of raw JSON or a crash.

import type { Block } from "@corbits/chat/blocks";
import { parseBlock } from "@corbits/chat/blocks";
import type { BlockPart } from "@corbits/chat/parts";
import type { Block } from "../wire/blocks";
import { parseBlock } from "../wire/blocks";
import type { BlockPart } from "../wire/parts";
import type { ReactElement } from "react";

import { CHAT_STRINGS } from "../strings";
Expand Down
2 changes: 1 addition & 1 deletion packages/chat-ui/src/blocks/steps-block.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StepsBlockData } from "@corbits/chat/blocks";
import type { StepsBlockData } from "../wire/blocks";

import { BlockCard } from "./block-card";

Expand Down
2 changes: 1 addition & 1 deletion packages/chat-ui/src/blocks/stream-block.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StreamBlockData } from "@corbits/chat/blocks";
import type { StreamBlockData } from "../wire/blocks";

import { BlockCard } from "./block-card";

Expand Down
8 changes: 4 additions & 4 deletions packages/chat-ui/src/chat-workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
// `@workbench/web` that is the same `/api/me/principals` call the Home
// and Settings pages use), so `ChatWorkspace` takes a small
// `TenantResolution` value rather than importing app code: the same
// narrow-port shape `@corbits/chat`'s `routes.ts` uses for `ChatPlatform`.
// narrow-port shape the hub's chat routes uses for `ChatPlatform`.

import { isAgentAddress } from "@corbits/chat/mentions";
import { isAgentAddress } from "./wire/mentions";
import { Button, EmptyState, toast } from "@corbits/react-ui";
import { reportError } from "@corbits/error-sink";
import { getResolvedCatalog } from "@corbits/inference-settings";
Expand Down Expand Up @@ -124,7 +124,7 @@ import {
ChatPinEventData,
ChatReactionEventData,
ChatSettingsEventData,
} from "@corbits/chat/stream-events";
} from "./wire/stream-events";
import { useThreadNavigation } from "./use-thread-navigation";
import { mergePendingSends, useOptimisticSends } from "./use-optimistic-sends";
export {
Expand Down Expand Up @@ -459,7 +459,7 @@ const REPLY_TIMED_OUT_ITEM_ID = "reply_timed_out_notice";
* (`PENDING_REPLY_CLEAR_MS`) has fired — a turn that opened but never got a
* single token and never closed out either, so the reader was left staring
* at a typing indicator that just vanished with no explanation. This is
* the same class of failure `postUndeliveredNotice` (`@corbits/chat`)
* the same class of failure `postUndeliveredNotice` (the hub's chat routes)
* already gives an honest, actionable backstop to when the dispatch fails
* loud enough for the server to see it — a cold-waking agent that never
* streams a token back fails silently instead, so before CL-6677 this
Expand Down
2 changes: 1 addition & 1 deletion packages/chat-ui/src/inference-failure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const CLASSIFIED_INFERENCE_FAILURE_PREAMBLES: readonly string[] = [
export {
CONSUMER_INFERENCE_FAILURE_NOTICE,
consumerFacingInferenceText,
} from "@corbits/chat/consumer-inference-text";
} from "./wire/consumer-inference-text";

export function isClassifiedInferenceFailureText(text: string): boolean {
return CLASSIFIED_INFERENCE_FAILURE_PREAMBLES.some((preamble) =>
Expand Down
4 changes: 2 additions & 2 deletions packages/chat-ui/src/invite-agent-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
import { Users, WarningCircle } from "@corbits/icons";
import { useEffect, useState } from "react";

import { deriveDisplayName } from "@corbits/chat/display-name";
import { deriveDisplayName } from "./wire/display-name";
import {
ChatApiError,
describeChatError,
Expand Down Expand Up @@ -158,7 +158,7 @@ export function InviteAgentDialog({
// set at creation, else a humanized reading of the
// immutable slug — never a scattered reimplementation
// that could drift (or leak an internal id as a fake
// name) beside `@corbits/chat/display-name`.
// name) beside `@corbits/chat-ui/wire/display-name`.
const displayName = deriveDisplayName({
name: definition.name,
...(definition.description !== undefined
Expand Down
6 changes: 3 additions & 3 deletions packages/chat-ui/src/mentions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
// `packages/chat/src/participants.ts`), the same friendly, deduplicated
// mention name `mentionedParticipants` in `packages/chat/src/routes.ts`
// matches against — never the instance-id local part. Filtering to agent
// addresses delegates to `@corbits/chat`'s `isAgentAddress`, the same
// addresses delegates to this package's own `isAgentAddress` (`./wire/mentions`), the same
// function the server's fan-out uses, so the candidate set is always
// exactly the set the server will fan a copy to. `label` is a friendlier
// string shown alongside the handle in the popover only.

import { isAgentAddress } from "@corbits/chat/mentions";
import { handleFromName } from "@corbits/chat/participants";
import { isAgentAddress } from "./wire/mentions";
import { handleFromName } from "./wire/participants";
import type { ParticipantRecord } from "./api";
import {
displayNameForAddress,
Expand Down
2 changes: 1 addition & 1 deletion packages/chat-ui/src/profile-subject.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Identity payload for opening a ProfileCard in the shell canvas. Chat-ui
// never mounts the card itself — the host canvas column owns that surface.

import { isAgentAddress } from "@corbits/chat/mentions";
import { isAgentAddress } from "./wire/mentions";

import type { ParticipantRecord } from "./api";

Expand Down
2 changes: 1 addition & 1 deletion packages/chat-ui/src/shared-workbenches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// (`workbenchOrder.filter(members.some(subject))`, capped at 4) over the real
// `Workbench.participants` feed instead of the mock's in-memory fixture.

import { localPartOf } from "@corbits/chat/agent-address";
import { localPartOf } from "./wire/agent-address";

import type { Workbench } from "./api";

Expand Down
4 changes: 2 additions & 2 deletions packages/chat-ui/src/streaming-reply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import { useEffect, useRef, useState } from "react";

import { isAgentAddress, mentionedParticipants } from "@corbits/chat/mentions";
import { isAgentAddress, mentionedParticipants } from "./wire/mentions";
import { reportError } from "@corbits/error-sink";
import type { Part, ParticipantRecord } from "./api";
import { REAL_CLOCK, type Clock } from "./clock";
Expand Down Expand Up @@ -314,7 +314,7 @@ export function useStreamingReply(
/** Set once the backstop above has fired for the turn just cleared — a
* `reportError` refId (CL-6677) the host's honest notice quotes, the
* same "ref id + Retry" treatment `postUndeliveredNotice`
* (`@corbits/chat`) gives a dispatch failure that surfaces server-side.
* (the hub's chat routes) gives a dispatch failure that surfaces server-side.
* This is the same class of failure with no server signal at all (a
* cold-waking agent that never streams back a token), so it deserves
* the same backstop rather than the ref-less, action-less notice this
Expand Down
Loading
Loading