@hydraharness/harness-client-ui-conversation 0.1.1-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +79 -0
- package/lib/client.js +11683 -0
- package/lib/index.js +28 -0
- package/lib/invariant.js +25 -0
- package/lib/types/client/apply.d.ts +16 -0
- package/lib/types/client/chat/ActivityGroup.d.ts +22 -0
- package/lib/types/client/chat/AssistantMarkdown.d.ts +20 -0
- package/lib/types/client/chat/AssistantNodeView.d.ts +4 -0
- package/lib/types/client/chat/ChatNodeSeat.d.ts +11 -0
- package/lib/types/client/chat/ChatView.d.ts +7 -0
- package/lib/types/client/chat/CommandNodeView.d.ts +9 -0
- package/lib/types/client/chat/CompactionCommandCard.d.ts +8 -0
- package/lib/types/client/chat/CompactionItem.d.ts +19 -0
- package/lib/types/client/chat/ContextBody.d.ts +130 -0
- package/lib/types/client/chat/ContextInjectionRow.d.ts +26 -0
- package/lib/types/client/chat/GenericCommandCard.d.ts +9 -0
- package/lib/types/client/chat/MessageIconActions.d.ts +44 -0
- package/lib/types/client/chat/MessageItem.d.ts +46 -0
- package/lib/types/client/chat/PromptVersionMenu.d.ts +21 -0
- package/lib/types/client/chat/ReasoningRow.d.ts +14 -0
- package/lib/types/client/chat/StatsLine.d.ts +87 -0
- package/lib/types/client/chat/TurnTailNodeView.d.ts +9 -0
- package/lib/types/client/chat/message-chrome.d.ts +49 -0
- package/lib/types/client/chat/register-node-renderers.d.ts +11 -0
- package/lib/types/client/chat/tool-node-reader.d.ts +16 -0
- package/lib/types/client/chat/turn-assistant.d.ts +8 -0
- package/lib/types/client/chat/turn-metrics.d.ts +38 -0
- package/lib/types/client/chat/use-calendar-day.d.ts +6 -0
- package/lib/types/client/chat/use-throttled-visual-update.d.ts +8 -0
- package/lib/types/client/chat/useVersionNavigation.d.ts +12 -0
- package/lib/types/client/chat/web-citations.d.ts +11 -0
- package/lib/types/client/contract/chat-nodes.d.ts +68 -0
- package/lib/types/client/contract/composer-submission.d.ts +8 -0
- package/lib/types/client/contract/prompt-edit.d.ts +6 -0
- package/lib/types/client/contract/queue.d.ts +9 -0
- package/lib/types/client/contract/slots.d.ts +819 -0
- package/lib/types/client/contract/views.d.ts +39 -0
- package/lib/types/client/conversation-nodes/assistant.d.ts +35 -0
- package/lib/types/client/conversation-nodes/chat-snapshot-builder.d.ts +29 -0
- package/lib/types/client/conversation-nodes/command.d.ts +54 -0
- package/lib/types/client/conversation-nodes/common.d.ts +40 -0
- package/lib/types/client/conversation-nodes/compaction.d.ts +21 -0
- package/lib/types/client/conversation-nodes/fallback.d.ts +16 -0
- package/lib/types/client/conversation-nodes/inbox.d.ts +21 -0
- package/lib/types/client/conversation-nodes/message.d.ts +30 -0
- package/lib/types/client/conversation-nodes/register.d.ts +7 -0
- package/lib/types/client/conversation-nodes/retry.d.ts +23 -0
- package/lib/types/client/conversation-nodes/tool.d.ts +25 -0
- package/lib/types/client/conversation-nodes/turn-error.d.ts +30 -0
- package/lib/types/client/conversation-nodes/turn-max-tokens.d.ts +22 -0
- package/lib/types/client/conversation-nodes/turn-tail.d.ts +28 -0
- package/lib/types/client/image-labels.d.ts +22 -0
- package/lib/types/client/index.d.ts +30 -0
- package/lib/types/client/input/blocks.d.ts +57 -0
- package/lib/types/client/input/contract.d.ts +340 -0
- package/lib/types/client/input/decorations.d.ts +71 -0
- package/lib/types/client/input/facade.d.ts +261 -0
- package/lib/types/client/input/hub.d.ts +88 -0
- package/lib/types/client/input/machine.d.ts +135 -0
- package/lib/types/client/input/submission-policy.d.ts +46 -0
- package/lib/types/client/locales.d.ts +242 -0
- package/lib/types/client/queue/QueueDock.d.ts +29 -0
- package/lib/types/client/queue/store.d.ts +19 -0
- package/lib/types/client/reference/ReferenceIcon.d.ts +16 -0
- package/lib/types/client/service.d.ts +220 -0
- package/lib/types/client/settings/EnterBehaviorRow.d.ts +21 -0
- package/lib/types/client/settings/UsageSection.d.ts +21 -0
- package/lib/types/client/skeleton/ApprovalPanel.d.ts +13 -0
- package/lib/types/client/skeleton/ContextMeter.d.ts +14 -0
- package/lib/types/client/skeleton/ConversationRoot.d.ts +5 -0
- package/lib/types/client/skeleton/ConversationSession.d.ts +20 -0
- package/lib/types/client/skeleton/DetailsPanel.d.ts +5 -0
- package/lib/types/client/skeleton/EmptyHero.d.ts +58 -0
- package/lib/types/client/skeleton/InputBar.d.ts +11 -0
- package/lib/types/client/skeleton/PermissionSelect.d.ts +11 -0
- package/lib/types/client/skeleton/TodoPanel.d.ts +28 -0
- package/lib/types/client/skeleton/safari.d.ts +18 -0
- package/lib/types/client/stores.d.ts +22 -0
- package/lib/types/index.d.ts +9 -0
- package/lib/types/invariant.d.ts +16 -0
- package/lib/types/submission-settings.d.ts +20 -0
- package/package.json +121 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scope-addressed conversation send, cancel, and history orchestration.
|
|
3
|
+
*
|
|
4
|
+
* Scope addressing rides the cordis Service tracker: property access through
|
|
5
|
+
* `ctx.conversation` rebinds `this.ctx` to the caller's context, so methods
|
|
6
|
+
* read the session tag with `scopeOf`. Mutable state must remain reachable
|
|
7
|
+
* through one property read; assignment through the tracker proxy and `#`
|
|
8
|
+
* private fields bypass that rebinding.
|
|
9
|
+
*/
|
|
10
|
+
import { Service } from '@hydraharness/cordis';
|
|
11
|
+
import type { Context } from '@hydraharness/cordis';
|
|
12
|
+
import type { SessionFace, SessionId } from '@hydraharness/harness-client-runtime/client';
|
|
13
|
+
import type { SubmitImageAttachment, SubmitOutcome } from '@hydraharness/harness-client-ui-input-trigger/client';
|
|
14
|
+
import type { ImageAttachmentRef, VideoAttachmentRef } from '@hydraharness/harness-attachment';
|
|
15
|
+
import type { BrowserAnnotationAttachment, ComposerAttachment } from './contract/slots.ts';
|
|
16
|
+
import type { QueueAction, QueueItemId } from './contract/queue.ts';
|
|
17
|
+
import type { ComposerBlocks } from './input/blocks.ts';
|
|
18
|
+
import type { DraftAttachmentId, SessionInputResolver } from './input/contract.ts';
|
|
19
|
+
import type { InputSubmitMode } from './contract/composer-submission.ts';
|
|
20
|
+
/**
|
|
21
|
+
* The outward conversation face (`ctx.conversation`): the scope-addressed
|
|
22
|
+
* verbs and the input registry other plugins may reach — and exactly what a
|
|
23
|
+
* test fake must supply.
|
|
24
|
+
*/
|
|
25
|
+
export interface IConversation {
|
|
26
|
+
/** The per-session input machine registry (SessionInputResolver face). */
|
|
27
|
+
readonly input: SessionInputResolver;
|
|
28
|
+
/**
|
|
29
|
+
* The per-session composer-block registry: how a plugin the composer
|
|
30
|
+
* cannot import makes a session's input inert with its own reason.
|
|
31
|
+
*/
|
|
32
|
+
readonly blocks: ComposerBlocks;
|
|
33
|
+
/**
|
|
34
|
+
* Send a prompt into the caller scope's session (queued turn).
|
|
35
|
+
* @param text - prompt text, sent verbatim as one text block.
|
|
36
|
+
* @returns completion; business failures reject (and land in promptError).
|
|
37
|
+
*/
|
|
38
|
+
send(text: string): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Apply one edit, remove, or strict steer operation to a pending queue occurrence.
|
|
41
|
+
* @param itemId - agent-owned inbox occurrence identity.
|
|
42
|
+
* @param action - requested queue operation.
|
|
43
|
+
* @returns completion; converged strict-steer races resolve, while other failures reject.
|
|
44
|
+
*/
|
|
45
|
+
updateQueue(itemId: QueueItemId, action: QueueAction): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Cancel the scoped session's in-flight turn while preserving its pending Queue.
|
|
48
|
+
* @returns completion; failures reject as in send.
|
|
49
|
+
*/
|
|
50
|
+
cancel(): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Pull one older history page for the scoped session.
|
|
53
|
+
* @returns completion of the page pull.
|
|
54
|
+
*/
|
|
55
|
+
loadOlder(): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
interface BrowserAnnotationBase {
|
|
58
|
+
readonly url: string;
|
|
59
|
+
readonly title: string;
|
|
60
|
+
readonly preview: string;
|
|
61
|
+
}
|
|
62
|
+
interface BrowserAnnotationRect {
|
|
63
|
+
readonly x: number;
|
|
64
|
+
readonly y: number;
|
|
65
|
+
readonly width: number;
|
|
66
|
+
readonly height: number;
|
|
67
|
+
}
|
|
68
|
+
/** One bounded element or viewport-region selection received from Browser. */
|
|
69
|
+
export type BrowserAnnotationSelection = BrowserAnnotationBase & ({
|
|
70
|
+
readonly kind: 'browser-element';
|
|
71
|
+
readonly index?: number;
|
|
72
|
+
readonly rect?: BrowserAnnotationRect;
|
|
73
|
+
} | {
|
|
74
|
+
readonly kind: 'browser-region';
|
|
75
|
+
readonly rect: BrowserAnnotationRect;
|
|
76
|
+
readonly index?: never;
|
|
77
|
+
});
|
|
78
|
+
/** Browser-owned annotation file waiting in the current composer. */
|
|
79
|
+
export type DraftBrowserAnnotation = BrowserAnnotationAttachment;
|
|
80
|
+
/** Unsupported browser-declared image type, localized by the UI boundary. */
|
|
81
|
+
export declare class UnsupportedImageMediaTypeError extends Error {
|
|
82
|
+
/** Browser-declared MIME value, possibly empty. */
|
|
83
|
+
readonly mediaType: string;
|
|
84
|
+
/** @param mediaType - Browser-declared MIME value, possibly empty. */
|
|
85
|
+
constructor(mediaType: string);
|
|
86
|
+
}
|
|
87
|
+
/** Scope-addressed conversation service (root singleton, provided as `conversation`). */
|
|
88
|
+
export declare class ConversationController extends Service implements IConversation {
|
|
89
|
+
/** The per-session input machine registry (SessionInputResolver face). */
|
|
90
|
+
readonly input: SessionInputResolver;
|
|
91
|
+
/** The per-session composer-block registry. */
|
|
92
|
+
readonly blocks: ComposerBlocks;
|
|
93
|
+
private readonly draftAttachments;
|
|
94
|
+
private readonly imageUrls;
|
|
95
|
+
private readonly imageGenerations;
|
|
96
|
+
private readonly createdImageUrls;
|
|
97
|
+
private disposed;
|
|
98
|
+
/**
|
|
99
|
+
* @param ctx - owning root context (the plugin apply context; the service
|
|
100
|
+
* registers itself and follows that fiber's lifetime).
|
|
101
|
+
* @param config - carries the SessionInputResolver and composer-block registry
|
|
102
|
+
* constructed by the plugin apply (the same instances the slot inject
|
|
103
|
+
* factories close over).
|
|
104
|
+
*/
|
|
105
|
+
constructor(ctx: Context, config: {
|
|
106
|
+
input: SessionInputResolver;
|
|
107
|
+
blocks: ComposerBlocks;
|
|
108
|
+
});
|
|
109
|
+
/**
|
|
110
|
+
* Send a prompt into the scoped session. Business failures also land in the
|
|
111
|
+
* session snapshot's promptError (object-layer state); the rejection here
|
|
112
|
+
* exists for caller choreography (the composer restores the draft on it).
|
|
113
|
+
* @param text - prompt text, sent verbatim as one text block.
|
|
114
|
+
*/
|
|
115
|
+
send(text: string): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Submit ordered draft images with text through one host admission.
|
|
118
|
+
* @param session - target session.
|
|
119
|
+
* @param text - serialized prompt text.
|
|
120
|
+
* @param imageIds - ordered draft-local attachment ids.
|
|
121
|
+
* @param mode - queue or steer delivery selected by composer policy.
|
|
122
|
+
* @param signal - optional cancellation for the complete Host admission.
|
|
123
|
+
* @param browserAnnotationIds - ordered draft-local browser annotation ids.
|
|
124
|
+
* @returns the Host admission outcome; local attachment preparation failures reject.
|
|
125
|
+
*/
|
|
126
|
+
sendSession(session: SessionFace, text: string, imageIds: readonly DraftAttachmentId[], mode: InputSubmitMode, signal?: AbortSignal, browserAnnotationIds?: readonly DraftAttachmentId[]): Promise<SubmitOutcome>;
|
|
127
|
+
/**
|
|
128
|
+
* Create runtime-only draft images and their object URLs.
|
|
129
|
+
* @param files - browser files to register after MIME validation.
|
|
130
|
+
* @returns ordered draft descriptors.
|
|
131
|
+
*/
|
|
132
|
+
createDraftImages(files: readonly File[]): readonly ComposerAttachment[];
|
|
133
|
+
/**
|
|
134
|
+
* Create one browser-selected text attachment without touching the draft string.
|
|
135
|
+
* @param annotation - bounded Browser selection metadata and optional image.
|
|
136
|
+
* @param comment - user comment carried with the attachment.
|
|
137
|
+
* @returns the runtime-owned draft attachment.
|
|
138
|
+
*/
|
|
139
|
+
createDraftBrowserAnnotation(annotation: BrowserAnnotationSelection, comment?: string): DraftBrowserAnnotation;
|
|
140
|
+
/** Pair a browser annotation with its optional screenshot draft image.
|
|
141
|
+
* @param annotationId - Browser annotation draft to update.
|
|
142
|
+
* @param screenshotId - Screenshot draft attached to the annotation.
|
|
143
|
+
*/
|
|
144
|
+
attachDraftBrowserAnnotationScreenshot(annotationId: DraftAttachmentId, screenshotId: DraftAttachmentId): void;
|
|
145
|
+
/**
|
|
146
|
+
* Resolve ordered input-state ids to runtime-owned draft images.
|
|
147
|
+
* @param ids - draft attachment ids.
|
|
148
|
+
* @returns descriptors that remain live, in requested order.
|
|
149
|
+
*/
|
|
150
|
+
draftImages(ids: readonly DraftAttachmentId[]): readonly ComposerAttachment[];
|
|
151
|
+
/**
|
|
152
|
+
* Resolve ordered input-state ids to browser-selected text attachments.
|
|
153
|
+
* @param ids - draft attachment ids.
|
|
154
|
+
* @returns descriptors that remain live, in requested order.
|
|
155
|
+
*/
|
|
156
|
+
draftBrowserAnnotations(ids: readonly DraftAttachmentId[]): readonly DraftBrowserAnnotation[];
|
|
157
|
+
/**
|
|
158
|
+
* Update the user comment carried with one browser annotation attachment.
|
|
159
|
+
* @param id - draft attachment id.
|
|
160
|
+
* @param comment - replacement user comment.
|
|
161
|
+
*/
|
|
162
|
+
updateDraftBrowserAnnotationComment(id: DraftAttachmentId, comment: string): void;
|
|
163
|
+
/**
|
|
164
|
+
* Serialize ordered draft images to command-submit wire payloads without
|
|
165
|
+
* sending or releasing them (the composer releases only after the command
|
|
166
|
+
* settles successfully).
|
|
167
|
+
* @param imageIds - ordered draft-local attachment ids.
|
|
168
|
+
* @returns base64 payloads in id order.
|
|
169
|
+
*/
|
|
170
|
+
serializeDraftImages(imageIds: readonly DraftAttachmentId[]): Promise<readonly SubmitImageAttachment[]>;
|
|
171
|
+
/**
|
|
172
|
+
* Release one browser-owned draft image and preview URL.
|
|
173
|
+
* @param id - draft attachment id.
|
|
174
|
+
*/
|
|
175
|
+
releaseDraftImage(id: DraftAttachmentId): void;
|
|
176
|
+
/**
|
|
177
|
+
* Release one browser-selected text attachment.
|
|
178
|
+
* @param id - draft attachment id.
|
|
179
|
+
*/
|
|
180
|
+
releaseDraftBrowserAnnotation(id: DraftAttachmentId): void;
|
|
181
|
+
/**
|
|
182
|
+
* Release a set of browser-owned draft images.
|
|
183
|
+
* @param attachments - descriptors to release.
|
|
184
|
+
*/
|
|
185
|
+
releaseDraftImages(attachments: readonly ComposerAttachment[]): void;
|
|
186
|
+
/**
|
|
187
|
+
* Release a set of browser-selected text attachments.
|
|
188
|
+
* @param attachments - descriptors to release.
|
|
189
|
+
*/
|
|
190
|
+
releaseDraftBrowserAnnotations(attachments: readonly DraftBrowserAnnotation[]): void;
|
|
191
|
+
/**
|
|
192
|
+
* Resolve and cache one session-authorized image or video URL.
|
|
193
|
+
* @param sessionId - owning session authorization scope.
|
|
194
|
+
* @param attachment - durable media reference.
|
|
195
|
+
* @returns browser URL valid until its rendered session is released.
|
|
196
|
+
*/
|
|
197
|
+
resolveMedia(sessionId: SessionId, attachment: ImageAttachmentRef | VideoAttachmentRef): Promise<string>;
|
|
198
|
+
/**
|
|
199
|
+
* Release every historical image URL owned by one rendered session.
|
|
200
|
+
* @param sessionId - rendered session scope.
|
|
201
|
+
*/
|
|
202
|
+
releaseSessionImages(sessionId: SessionId): void;
|
|
203
|
+
/** Apply one operation to a pending queue occurrence. */
|
|
204
|
+
updateQueue(itemId: QueueItemId, action: QueueAction): Promise<void>;
|
|
205
|
+
/** Cancel the scoped session's in-flight turn while preserving Queue (failures land in promptError and reject, as in send). */
|
|
206
|
+
cancel(): Promise<void>;
|
|
207
|
+
/** Pull one older history page for the scoped Session. */
|
|
208
|
+
loadOlder(): Promise<void>;
|
|
209
|
+
/** Resolve the caller scope's session face or throw on root contexts. */
|
|
210
|
+
private scopedSession;
|
|
211
|
+
/** Read the caller's session scope tag via the sessions service; root contexts fail loud. */
|
|
212
|
+
private scopeId;
|
|
213
|
+
private requireSessions;
|
|
214
|
+
/** Convert browser files to canonical base64 prompt parts. */
|
|
215
|
+
private serializeImages;
|
|
216
|
+
/** Canonical base64 wire form of one browser image file. */
|
|
217
|
+
private encodeImage;
|
|
218
|
+
}
|
|
219
|
+
export {};
|
|
220
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SnapshotStore } from '@hydraharness/harness-client-runtime/client';
|
|
2
|
+
import type { InjectFace, PropsLocale, PropsRuntime } from '@hydraharness/harness-client-ui-slots';
|
|
3
|
+
import type { BusyEnterBehavior } from '../contract/composer-submission.ts';
|
|
4
|
+
/** Registration-side preference face. */
|
|
5
|
+
export interface EnterBehaviorRowInjected {
|
|
6
|
+
hooks: {
|
|
7
|
+
/** Persisted busy-state preference bound as useBusyEnter. */
|
|
8
|
+
busyEnter: SnapshotStore<BusyEnterBehavior>;
|
|
9
|
+
};
|
|
10
|
+
/** Change the busy-state plain-Enter behavior. */
|
|
11
|
+
setBusyEnter: (behavior: BusyEnterBehavior) => void;
|
|
12
|
+
}
|
|
13
|
+
/** Full Settings-row props. */
|
|
14
|
+
export type EnterBehaviorRowProps = PropsRuntime<'settings.general.item'> & PropsLocale<'conversation'> & InjectFace<EnterBehaviorRowInjected>;
|
|
15
|
+
/**
|
|
16
|
+
* Render the busy-state Enter behavior selector.
|
|
17
|
+
* @param props - composed Settings slot props.
|
|
18
|
+
* @returns the preference row.
|
|
19
|
+
*/
|
|
20
|
+
export declare function EnterBehaviorRow({ useBusyEnter, setBusyEnter, t }: EnterBehaviorRowProps): import("react").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=EnterBehaviorRow.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SessionListState } from '@hydraharness/harness-client-runtime/client';
|
|
2
|
+
import type { InjectFace, PropsLocale, PropsRuntime } from '@hydraharness/harness-client-ui-slots';
|
|
3
|
+
export interface UsageRow {
|
|
4
|
+
provider: string;
|
|
5
|
+
model: string;
|
|
6
|
+
inputTokens: number;
|
|
7
|
+
outputTokens: number;
|
|
8
|
+
}
|
|
9
|
+
/** Registration-side face: pull a fresh session.list when the page opens. */
|
|
10
|
+
export interface UsageSectionInjected {
|
|
11
|
+
/** Refresh the session list so cold rows carry the latest modelTokenUsage cut. */
|
|
12
|
+
refresh: () => Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
/** Sum each session's durable model buckets without assigning usage to its latest model. */
|
|
15
|
+
export declare function collectModelUsage(list: Pick<SessionListState, 'ids' | 'byId'>): UsageRow[];
|
|
16
|
+
/** Whether two usage tables carry the same provider/model totals in the same order. */
|
|
17
|
+
export declare function usageRowsEqual(left: readonly UsageRow[], right: readonly UsageRow[]): boolean;
|
|
18
|
+
export type UsageSectionProps = PropsRuntime<'settings.section'> & PropsLocale<'conversation'> & InjectFace<UsageSectionInjected>;
|
|
19
|
+
/** Render exact token counts grouped across every listed session. */
|
|
20
|
+
export declare function UsageSection({ useSessions, refresh, t }: UsageSectionProps): import("react").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=UsageSection.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RunningToolCall } from '@hydraharness/harness-client-runtime/client';
|
|
2
|
+
import { type ApprovalComposerProps } from '../contract/slots.ts';
|
|
3
|
+
/** Extract the shell command from an approval's paired running call (bash-family args carry `command`); undefined hides the line. */
|
|
4
|
+
export declare function commandOf(call: RunningToolCall | undefined): string | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Composer takeover boundary: mints the domain face on the carrier's stable
|
|
7
|
+
* identity and remounts the flow per request key, so the one-shot answered
|
|
8
|
+
* latch never leaks to the next pending approval.
|
|
9
|
+
* @param props - the selector-matched pending approval carrier plus the framework standard kit.
|
|
10
|
+
* @returns The approval prompt for this request.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ApprovalPanel(props: ApprovalComposerProps): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=ApprovalPanel.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Composer context-occupancy meter: a ring beside the send button fed by the
|
|
2
|
+
* `contextPressure` projection, with a click-open panel of the heuristic
|
|
3
|
+
* `contextBreakdown` composition (system prompt, tools, conversation).
|
|
4
|
+
* Renders nothing until a provider reports both pressure and a route
|
|
5
|
+
* capacity. */
|
|
6
|
+
import type { UseProjection } from '@hydraharness/harness-client-runtime/client';
|
|
7
|
+
import type { ComposerBarProps } from '../contract/slots.ts';
|
|
8
|
+
export interface ContextMeterProps {
|
|
9
|
+
useProjection: UseProjection;
|
|
10
|
+
/** The owning bar's locale seat, passed down as a plain prop. */
|
|
11
|
+
t: ComposerBarProps['t'];
|
|
12
|
+
}
|
|
13
|
+
export declare function ContextMeter({ useProjection, t }: ContextMeterProps): import("react").JSX.Element | null;
|
|
14
|
+
//# sourceMappingURL=ContextMeter.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ConversationSlotProps } from '../contract/slots.ts';
|
|
2
|
+
/** Full props composed from the slot contract. */
|
|
3
|
+
export type ConversationRootProps = ConversationSlotProps;
|
|
4
|
+
export declare function ConversationRoot({ sessionId, useSession, useSessions, useWorkspaces, useInput, useComposerBlock, renderSlot, renderSlotChain, selectWorkspace, secondary, t, }: ConversationRootProps): import("react").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=ConversationRoot.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Strict per-session header/body content inserted into the resident conversation layout. */
|
|
2
|
+
import type { ConversationSessionHeaderSlotProps, ConversationSessionSlotProps } from '../contract/slots.ts';
|
|
3
|
+
/** Full props composed from the strict session body contract. */
|
|
4
|
+
export type ConversationSessionProps = ConversationSessionSlotProps;
|
|
5
|
+
/** Full props composed from the strict session header contract. */
|
|
6
|
+
export type ConversationSessionHeaderProps = ConversationSessionHeaderSlotProps;
|
|
7
|
+
/**
|
|
8
|
+
* Renders Session header chrome above the resident conversation scrollport.
|
|
9
|
+
* @param props - Strict Session store, view ledger, navigation, render, and locale shares.
|
|
10
|
+
* @returns the hidden blank-session header or visible title and tabs.
|
|
11
|
+
*/
|
|
12
|
+
export declare function ConversationSessionHeader({ sessionId, useSession, useSessions, useStore, actions, renderSlot, views, open, openVersion, referenceVersion, t, }: ConversationSessionHeaderProps): import("react").JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* Renders the active Session view inside the resident scrollport and keeps
|
|
15
|
+
* the input draft mirrored while blank Hero chrome is visible.
|
|
16
|
+
* @param props - Strict Session input/store, view ledger, and render shares.
|
|
17
|
+
* @returns the active view area, or null while the Session remains blank.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ConversationSession({ sessionId, useSession, useInput, inputActions, useStore, actions, renderSlot, views, bindDraftMirror, releaseSessionImages, }: ConversationSessionProps): import("react").JSX.Element | null;
|
|
20
|
+
//# sourceMappingURL=ConversationSession.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DetailsSlotProps } from '../contract/slots.ts';
|
|
2
|
+
/** Full props composed by reference from the contract (automatic shares & injected share). */
|
|
3
|
+
export type DetailsPanelProps = DetailsSlotProps;
|
|
4
|
+
export declare function DetailsPanel({ useSession, useSessions, sessionId, useStore, renderSlot, closeDetails, t }: DetailsPanelProps): import("react").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=DetailsPanel.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ReactNode, RefObject } from 'react';
|
|
2
|
+
import type { ConversationSlotProps } from '../contract/slots.ts';
|
|
3
|
+
/** The owner's locale seat type, passed to hero chrome as a plain prop. */
|
|
4
|
+
type HeroTranslate = ConversationSlotProps['t'];
|
|
5
|
+
/**
|
|
6
|
+
* Basename label for the workspace chip (the shared derivation);
|
|
7
|
+
* separator-only paths echo the raw cwd.
|
|
8
|
+
* @param cwd - workspace directory path (non-empty).
|
|
9
|
+
* @returns chip label.
|
|
10
|
+
*/
|
|
11
|
+
export declare function workspaceLabel(cwd: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* The workspace chip (folder + label + chevron), always interactive: before
|
|
14
|
+
* the first message the workspace stays switchable — picking another one
|
|
15
|
+
* moves the New Session flow to that workspace's blank session. Without a
|
|
16
|
+
* label the chip renders its placeholder state: closed folder + the
|
|
17
|
+
* "Choose workspace" call to action.
|
|
18
|
+
* @param props.label - chip label (see {@link workspaceLabel}); omitted → placeholder.
|
|
19
|
+
* @param props.menuOpen - menu expansion echo.
|
|
20
|
+
* @param props.onClick - menu toggle.
|
|
21
|
+
* @returns the chip button element.
|
|
22
|
+
*/
|
|
23
|
+
export declare function WorkspaceChip({ buttonRef, label, menuOpen, disabled, onClick, t }: {
|
|
24
|
+
buttonRef?: RefObject<HTMLButtonElement>;
|
|
25
|
+
label?: string | undefined;
|
|
26
|
+
menuOpen?: boolean;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
onClick?: () => void;
|
|
29
|
+
t: HeroTranslate;
|
|
30
|
+
}): import("react").JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* The soft blue backdrop ellipse (figma 313:14109). Rendered by the hero
|
|
33
|
+
* owner (ConversationRoot), not HeroShell, so it can center on the input
|
|
34
|
+
* card; the owner's className supplies all positioning.
|
|
35
|
+
* @param props.className - positioning class from the owner.
|
|
36
|
+
* @returns the blurred-ellipse svg element.
|
|
37
|
+
*/
|
|
38
|
+
export declare function HeroGlow({ className }: {
|
|
39
|
+
className?: string | undefined;
|
|
40
|
+
}): import("react").JSX.Element;
|
|
41
|
+
/** Hero chrome props. The workspace row rides the InputBar accessory hole, not here. */
|
|
42
|
+
export interface HeroShellProps {
|
|
43
|
+
/** The owner's locale seat, passed down as a plain prop. */
|
|
44
|
+
t: HeroTranslate;
|
|
45
|
+
/** Authorized renderer for the hero brand-mark slot. */
|
|
46
|
+
renderSlot: ConversationSlotProps['renderSlot'];
|
|
47
|
+
/** Overlay content after the stack (modals). */
|
|
48
|
+
children?: ReactNode;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Render the hero chrome (headline only; no glow, no composer, no workspace
|
|
52
|
+
* row — the glow is the owner's {@link HeroGlow}).
|
|
53
|
+
* @param props - see {@link HeroShellProps}.
|
|
54
|
+
* @returns the centered hero element tree.
|
|
55
|
+
*/
|
|
56
|
+
export declare function HeroShell({ t, renderSlot, children }: HeroShellProps): import("react").JSX.Element;
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=EmptyHero.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** The default composer body: the 'conversation.composer.bar' slot entry.
|
|
2
|
+
* Machine state arrives through the standard provide channel
|
|
3
|
+
* (useInput + inputActions); the keyboard/DOM command face and stop arrive
|
|
4
|
+
* through this entry's own inject, whose hooks compartment binds
|
|
5
|
+
* useNotices/useLexicon; layout-phase inputs (variant, placeholder,
|
|
6
|
+
* region-slot content) ride the owner props. Session facts
|
|
7
|
+
* (running/removed/promptError) are self-selected via useSession. */
|
|
8
|
+
import type { ComposerBarProps } from '../contract/slots.ts';
|
|
9
|
+
export type InputBarProps = ComposerBarProps;
|
|
10
|
+
export declare function InputBar({ useSession, useInput, inputActions, keyboard, addImages, removeImage, draftImages, draftBrowserAnnotations, removeBrowserAnnotation, updateBrowserAnnotationComment, resolveSubmitMode, toggleCommandMenu, stop, command, t, renderSlot, useNotices, useLexicon, useMenuLauncher, useProjection, sessionId, variant, disabled: inert, blocked, workspacePickerOpen, onRequestWorkspace, placeholder, accessory, overlay, leftItems, rightItems, footer, }: InputBarProps): import("react").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=InputBar.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PermissionSelect as PermissionSelectValue } from '@hydraharness/harness-permission-presets/client';
|
|
2
|
+
import type { ComposerBarProps } from '../contract/slots.ts';
|
|
3
|
+
export interface PermissionSelectProps {
|
|
4
|
+
value: PermissionSelectValue | undefined;
|
|
5
|
+
locked: boolean;
|
|
6
|
+
command: (line: string) => Promise<boolean>;
|
|
7
|
+
/** The owning bar's locale seat, passed down as a plain prop. */
|
|
8
|
+
t: ComposerBarProps['t'];
|
|
9
|
+
}
|
|
10
|
+
export declare function PermissionSelect({ value, locked, command, t }: PermissionSelectProps): import("react").JSX.Element | null;
|
|
11
|
+
//# sourceMappingURL=PermissionSelect.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Context } from '@hydraharness/cordis';
|
|
2
|
+
import type { PropsLocale, PropsRuntime } from '@hydraharness/harness-client-ui-slots';
|
|
3
|
+
import type { TodoItem } from '@hydraharness/harness-tool-todo/client';
|
|
4
|
+
export interface TodoPanelProps {
|
|
5
|
+
/** The session's current plan (empty renders nothing) — selected by the dock adapter. */
|
|
6
|
+
todos: readonly TodoItem[];
|
|
7
|
+
/** The dock entry's locale seat, passed down as a plain prop. */
|
|
8
|
+
t: TodoDockProps['t'];
|
|
9
|
+
}
|
|
10
|
+
export declare function TodoPanel({ todos, t }: TodoPanelProps): import("react").JSX.Element | null;
|
|
11
|
+
/** Full props of a dock entry: InputZone owner share + session standard kit + global seat + the locale seat. */
|
|
12
|
+
export type TodoDockProps = PropsRuntime<'conversation.input.dock'> & PropsLocale<'conversation'>;
|
|
13
|
+
/** Dock adapter: reads the host-computed 'todos' projection (whole list; absent or null renders nothing). */
|
|
14
|
+
export declare function TodoDock({ useProjection, t }: TodoDockProps): import("react").JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* The plan strip as a plain registrant plugin (QueueDock posture), following
|
|
17
|
+
* the input-dock declaration across independent activation and reload.
|
|
18
|
+
*/
|
|
19
|
+
export declare const todoDockEntry: {
|
|
20
|
+
name: string;
|
|
21
|
+
inject: string[];
|
|
22
|
+
/**
|
|
23
|
+
* Register the plan strip before the goal and queue entries (order 0).
|
|
24
|
+
* @param ctx - registrant context (disposal rides ctx.effect inside slots.register).
|
|
25
|
+
*/
|
|
26
|
+
apply(ctx: Context): void;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=TodoPanel.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Safari-specific textarea layout recovery for the conversation composer. */
|
|
2
|
+
/** Browser identity fields needed to distinguish Safari from other WebKit-based browsers. */
|
|
3
|
+
export interface BrowserIdentity {
|
|
4
|
+
readonly userAgent: string;
|
|
5
|
+
readonly vendor: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Detect Safari's `Version/... Safari/...` form while excluding known alternate iOS browser tokens.
|
|
9
|
+
* @param identity - Browser user-agent and vendor values.
|
|
10
|
+
* @returns Whether the identity should use the Safari-specific recovery.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isSafariBrowser(identity: BrowserIdentity): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Repair Safari's stale native textarea layout and the scrollport auto height it can contaminate.
|
|
15
|
+
* @param input - Composer textarea whose own scrollable overflow must stay zero.
|
|
16
|
+
*/
|
|
17
|
+
export declare function repairSafariTextareaLayout(input: HTMLTextAreaElement | null): void;
|
|
18
|
+
//# sourceMappingURL=safari.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-session chat store shared by conversation and details registrations.
|
|
3
|
+
* The plugin creates its handle at apply time so identity follows the fiber.
|
|
4
|
+
*/
|
|
5
|
+
import { type EngineStoreHandle } from '@hydraharness/harness-client-runtime/client';
|
|
6
|
+
import type { CallId, ChatStoreState, SelectionTarget } from './contract/views.ts';
|
|
7
|
+
/** Declared action shape used to give the exported factory a stable return type. */
|
|
8
|
+
type ChatActions = {
|
|
9
|
+
select: (draft: ChatStoreState, target: SelectionTarget | null) => void;
|
|
10
|
+
setDraft: (draft: ChatStoreState, text: string) => void;
|
|
11
|
+
setView: (draft: ChatStoreState, view: string) => void;
|
|
12
|
+
setInspect: (draft: ChatStoreState, target: {
|
|
13
|
+
callId: CallId;
|
|
14
|
+
} | null) => void;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Declares the per-session chat state and write surface.
|
|
18
|
+
* @returns the store handle.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createChatStore(): EngineStoreHandle<ChatStoreState, ChatActions>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=stores.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Host registration for browser conversation preferences. */
|
|
2
|
+
import type { Context } from '@hydraharness/cordis';
|
|
3
|
+
export { BUSY_ENTER_BEHAVIORS, BUSY_ENTER_FIELD, CONVERSATION_SETTINGS_NAMESPACE, DEFAULT_BUSY_ENTER_BEHAVIOR, type BusyEnterBehavior, type ConversationSettings, } from './submission-settings.ts';
|
|
4
|
+
/**
|
|
5
|
+
* Register the durable conversation section when a settings provider exists.
|
|
6
|
+
* @param ctx - Host context whose optional settings service owns the section.
|
|
7
|
+
*/
|
|
8
|
+
export declare function apply(ctx: Context): void;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package-owned invariant companion for `@hydraharness/harness-client-ui-conversation`.
|
|
3
|
+
* @module @hydraharness/harness-client-ui-conversation/invariant
|
|
4
|
+
*/
|
|
5
|
+
import type { Context } from '@hydraharness/cordis';
|
|
6
|
+
/** Cordis companion plugin name. */
|
|
7
|
+
export declare const name = "client-ui-conversation-invariant";
|
|
8
|
+
/** Service required before the companion can reserve package ownership. */
|
|
9
|
+
export declare const inject: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Register this package's invariant companion.
|
|
12
|
+
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
+
* @returns the installed registration's disposer after setup succeeds.
|
|
14
|
+
*/
|
|
15
|
+
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
16
|
+
//# sourceMappingURL=invariant.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Busy-Enter preference stored in the Host user-settings document. */
|
|
2
|
+
import z from '@hydraharness/schemastery';
|
|
3
|
+
/** Settings namespace owned by the conversation plugin. */
|
|
4
|
+
export declare const CONVERSATION_SETTINGS_NAMESPACE = "ui-conversation";
|
|
5
|
+
/** Field carrying the delivery mode for plain Enter while an agent is busy. */
|
|
6
|
+
export declare const BUSY_ENTER_FIELD = "busyEnter";
|
|
7
|
+
/** Busy-Enter behaviors accepted at settings and input boundaries. */
|
|
8
|
+
export declare const BUSY_ENTER_BEHAVIORS: readonly ["queue", "steer"];
|
|
9
|
+
/** Configurable meaning of plain Enter while the addressed agent is busy. */
|
|
10
|
+
export type BusyEnterBehavior = typeof BUSY_ENTER_BEHAVIORS[number];
|
|
11
|
+
/** Default preserves Enter-as-Queue for running conversations. */
|
|
12
|
+
export declare const DEFAULT_BUSY_ENTER_BEHAVIOR: BusyEnterBehavior;
|
|
13
|
+
/** Durable conversation section shared by the Host schema and the browser scope. */
|
|
14
|
+
export interface ConversationSettings {
|
|
15
|
+
/** Delivery mode for plain Enter while the addressed agent is busy. */
|
|
16
|
+
busyEnter: BusyEnterBehavior;
|
|
17
|
+
}
|
|
18
|
+
/** Durable conversation schema; also the wire envelope the browser scope validates against. */
|
|
19
|
+
export declare const ConversationSettingsSchema: z<ConversationSettings>;
|
|
20
|
+
//# sourceMappingURL=submission-settings.d.ts.map
|