@slices.sh/ai-chat 0.1.0 → 0.1.2

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.
Files changed (66) hide show
  1. package/dist/fixture/fixture-approval.d.ts +1 -1
  2. package/dist/fixture/fixture-artifacts.d.ts +1 -1
  3. package/dist/fixture/fixture-question.d.ts +1 -1
  4. package/dist/fixture/fixture-script.d.ts +1 -1
  5. package/dist/fixture/fixture-selection.d.ts +1 -1
  6. package/dist/fixture/fixture.d.ts +3 -3
  7. package/dist/fixture/provider.d.ts +2 -2
  8. package/dist/headless/chat-dictation/index.d.ts +5 -5
  9. package/dist/headless/composer-root.d.ts +2 -2
  10. package/dist/headless/context-usage.d.ts +1 -1
  11. package/dist/headless/contexts.d.ts +19 -19
  12. package/dist/headless/failed.d.ts +1 -1
  13. package/dist/headless/file-context.d.ts +2 -2
  14. package/dist/headless/file-kind-gate.d.ts +1 -1
  15. package/dist/headless/index.d.ts +124 -124
  16. package/dist/headless/message.d.ts +1 -1
  17. package/dist/headless/models.d.ts +1 -1
  18. package/dist/headless/optional-tools.d.ts +1 -1
  19. package/dist/headless/part-source.d.ts +1 -1
  20. package/dist/headless/part-text.d.ts +1 -1
  21. package/dist/headless/question-invalid.d.ts +1 -1
  22. package/dist/headless/questions.d.ts +1 -1
  23. package/dist/headless/references.d.ts +1 -1
  24. package/dist/headless/root.d.ts +2 -2
  25. package/dist/headless/source-context.d.ts +2 -2
  26. package/dist/headless/source-root.d.ts +1 -1
  27. package/dist/headless/speaker.d.ts +1 -1
  28. package/dist/headless/timing.d.ts +1 -1
  29. package/dist/headless/use-question.d.ts +1 -1
  30. package/dist/headless/writing.d.ts +1 -1
  31. package/dist/hooks/chat-refusal.d.ts +1 -1
  32. package/dist/hooks/turn-mailbox.d.ts +2 -2
  33. package/dist/hooks/use-branches.d.ts +2 -2
  34. package/dist/hooks/use-chat-instance.d.ts +2 -2
  35. package/dist/hooks/use-chat-settings.d.ts +4 -4
  36. package/dist/hooks/use-chat-sink.d.ts +1 -1
  37. package/dist/hooks/use-context-usage.d.ts +1 -1
  38. package/dist/hooks/use-feedback.d.ts +1 -1
  39. package/dist/hooks/use-media.d.ts +1 -1
  40. package/dist/hooks/use-question-check.d.ts +2 -2
  41. package/dist/hooks/use-question-draft.d.ts +2 -2
  42. package/dist/hooks/use-question-steps.d.ts +2 -2
  43. package/dist/hooks/use-question-write.d.ts +2 -2
  44. package/dist/hooks/use-remembered-approvals.d.ts +2 -2
  45. package/dist/hooks/use-reply.d.ts +1 -1
  46. package/dist/hooks/use-report-missing-configuration.d.ts +1 -1
  47. package/dist/hooks/use-sent-draft.d.ts +1 -1
  48. package/dist/hooks/use-sources.d.ts +1 -1
  49. package/dist/hooks/use-tool-approval-memory.d.ts +1 -1
  50. package/dist/hooks/use-tool-approval.d.ts +1 -1
  51. package/dist/hooks/use-turn-queue.d.ts +2 -2
  52. package/dist/index.d.ts +1 -1
  53. package/dist/services/approval.d.ts +1 -1
  54. package/dist/services/branches.d.ts +1 -1
  55. package/dist/services/chat-session.d.ts +3 -3
  56. package/dist/services/choices.d.ts +1 -1
  57. package/dist/services/continue.d.ts +1 -1
  58. package/dist/services/optional.d.ts +1 -1
  59. package/dist/services/ports.d.ts +3 -3
  60. package/dist/services/questions.d.ts +1 -1
  61. package/dist/services/request.d.ts +2 -2
  62. package/dist/services/selection.d.ts +3 -3
  63. package/dist/services/sources.d.ts +1 -1
  64. package/dist/services/turn.d.ts +3 -3
  65. package/dist/services/types.d.ts +15 -15
  66. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
1
  import { type UIMessageChunk } from "ai";
2
- import type { AiChatMessage } from "../services/types";
2
+ import type { AiChatMessage } from "../services/types.js";
3
3
  export declare function approvalHistory(): AiChatMessage[];
4
4
  export declare function approvalTurn(messages: AiChatMessage[]): UIMessageChunk[];
@@ -1,2 +1,2 @@
1
- import type { AiChatMessage } from "../services/types";
1
+ import type { AiChatMessage } from "../services/types.js";
2
2
  export declare function artifactHistory(): AiChatMessage[];
@@ -1,5 +1,5 @@
1
1
  import { type UIMessageChunk } from "ai";
2
- import { type AiChatMessage, type Questionnaire } from "../services/types";
2
+ import { type AiChatMessage, type Questionnaire } from "../services/types.js";
3
3
  export declare const QUESTIONS: Questionnaire;
4
4
  export declare function questionHistory(): AiChatMessage[];
5
5
  export declare function questionTurn(messages: AiChatMessage[]): UIMessageChunk[];
@@ -1,6 +1,6 @@
1
1
  import type { UIMessageChunk } from "ai";
2
2
  import { type MissingConfigurationAnswer } from "@slices.sh/core/configuration";
3
- import { ChatError, type AiChatMessage } from "../services/types";
3
+ import { ChatError, type AiChatMessage } from "../services/types.js";
4
4
  /**
5
5
  * What a fixture chat does, per scenario.
6
6
  *
@@ -1,5 +1,5 @@
1
1
  import type { UIMessageChunk } from "ai";
2
- import type { ChatChoices, ChatSelection } from "../services/types";
2
+ import type { ChatChoices, ChatSelection } from "../services/types.js";
3
3
  export declare const fixtureChoices: ChatChoices;
4
4
  /** Scripted model variants and actual optional tool chunks, never pretend live inference. */
5
5
  export declare function chosenChunks(chunks: UIMessageChunk[], selection?: ChatSelection): UIMessageChunk[];
@@ -1,7 +1,7 @@
1
- import type { AiChatClient } from "../services/types";
1
+ import type { AiChatClient } from "../services/types.js";
2
2
  import { type ChatTransport } from "ai";
3
- import { CHAT_SCENARIOS, type ChatScenario } from "./fixture-script";
4
- import { type AiChatMessage } from "../services/types";
3
+ import { CHAT_SCENARIOS, type ChatScenario } from "./fixture-script.js";
4
+ import { type AiChatMessage } from "../services/types.js";
5
5
  export { CHAT_SCENARIOS };
6
6
  export type { ChatScenario };
7
7
  /**
@@ -1,5 +1,5 @@
1
- import type { AiChatClient } from "../services/types";
2
- import { type ChatScenario } from "./fixture";
1
+ import type { AiChatClient } from "../services/types.js";
2
+ import { type ChatScenario } from "./fixture.js";
3
3
  export type FixtureOptions = {
4
4
  /**
5
5
  * ready, approval, questions, empty, rich, artifacts, slow, interrupted, failed, rate-limited,
@@ -1,8 +1,8 @@
1
- import { Root } from "./root";
2
- import { Input } from "./input";
3
- import { Voice } from "./voice";
4
- import { Text } from "./text";
5
- import { Confirm } from "./confirm";
1
+ import { Root } from "./root.js";
2
+ import { Input } from "./input.js";
3
+ import { Voice } from "./voice.js";
4
+ import { Text } from "./text.js";
5
+ import { Confirm } from "./confirm.js";
6
6
  export declare const ChatDictation: {
7
7
  Root: typeof Root;
8
8
  Input: typeof Input;
@@ -1,5 +1,5 @@
1
- import type { ChatSettings } from "../services/types";
2
- import type { AiChat } from "../hooks/use-chat-instance";
1
+ import type { ChatSettings } from "../services/types.js";
2
+ import type { AiChat } from "../hooks/use-chat-instance.js";
3
3
  import { type RootProps } from "@slices.sh/core/part";
4
4
  type ComposerRootProps = RootProps & {
5
5
  name: string;
@@ -1,3 +1,3 @@
1
- import { type ContextUsage as UsageState } from "../hooks/use-context-usage";
1
+ import { type ContextUsage as UsageState } from "../hooks/use-context-usage.js";
2
2
  import { type GateProps } from "@slices.sh/core/part";
3
3
  export declare function ContextUsage({ children }: GateProps<UsageState>): import("react").ReactNode;
@@ -1,20 +1,20 @@
1
- import type { ChatFeedbackOptions } from "../services/types";
2
- import type { Branches } from "../hooks/use-branches";
3
- import type { SentDraft } from "../hooks/use-sent-draft";
4
- import type { QueuedTurn } from "../hooks/use-turn-queue";
5
- import type { Reasoning } from "../hooks/use-reasoning";
6
- import type { QuestionDraft } from "../hooks/use-question-draft";
7
- import type { QuestionWrite } from "../hooks/use-question-write";
8
- import type { QuestionCheck } from "../hooks/use-question-check";
9
- import type { QuestionSteps } from "../hooks/use-question-steps";
10
- import type { ToolApprovalMemory } from "../hooks/use-tool-approval-memory";
11
- import type { ApprovalAutomation } from "../hooks/use-remembered-approvals";
12
- import type { ToolApproval } from "../hooks/use-tool-approval";
13
- import type { AiChat, ChatSource } from "../hooks/use-chat-instance";
14
- import type { Composer, ComposerPlacement, ComposerAttachments } from "../hooks/use-composer";
15
- import type { Follow } from "../hooks/use-follow";
16
- import type { TurnQueue } from "../hooks/use-turn-queue";
17
- import type { AiChatMessage } from "../services/types";
1
+ import type { ChatFeedbackOptions } from "../services/types.js";
2
+ import type { Branches } from "../hooks/use-branches.js";
3
+ import type { SentDraft } from "../hooks/use-sent-draft.js";
4
+ import type { QueuedTurn } from "../hooks/use-turn-queue.js";
5
+ import type { Reasoning } from "../hooks/use-reasoning.js";
6
+ import type { QuestionDraft } from "../hooks/use-question-draft.js";
7
+ import type { QuestionWrite } from "../hooks/use-question-write.js";
8
+ import type { QuestionCheck } from "../hooks/use-question-check.js";
9
+ import type { QuestionSteps } from "../hooks/use-question-steps.js";
10
+ import type { ToolApprovalMemory } from "../hooks/use-tool-approval-memory.js";
11
+ import type { ApprovalAutomation } from "../hooks/use-remembered-approvals.js";
12
+ import type { ToolApproval } from "../hooks/use-tool-approval.js";
13
+ import type { AiChat, ChatSource } from "../hooks/use-chat-instance.js";
14
+ import type { Composer, ComposerPlacement, ComposerAttachments } from "../hooks/use-composer.js";
15
+ import type { Follow } from "../hooks/use-follow.js";
16
+ import type { TurnQueue } from "../hooks/use-turn-queue.js";
17
+ import type { AiChatMessage } from "../services/types.js";
18
18
  /**
19
19
  * The AI SDK's chat itself, not a copy of its state: every part that needs the transcript,
20
20
  * the status or the error reads it with the SDK's `useChat({ chat })`.
@@ -24,8 +24,8 @@ export declare const SettingsContext: import("react").Context<{
24
24
  model: (id: string) => void;
25
25
  toggle: (id: string) => void;
26
26
  removeLast: () => boolean;
27
- choices: import("../services/choices").ChatChoices | null;
28
- selection: import("../services/choices").ChatSelection;
27
+ choices: import("../services/choices.js").ChatChoices | null;
28
+ selection: import("../services/choices.js").ChatSelection;
29
29
  } | null>;
30
30
  export declare const ChatContext: import("react").Context<AiChat | null>;
31
31
  /** The config the conversation above talks to, so a Root inside it knows whether it shares it. */
@@ -1,5 +1,5 @@
1
1
  import { type GateProps } from "@slices.sh/core/part";
2
- import type { ChatErrorSlug } from "../services/types";
2
+ import type { ChatErrorSlug } from "../services/types.js";
3
3
  /**
4
4
  * The turn was refused — the SDK's `error` status — and the child is told which refusal it
5
5
  * was.
@@ -1,4 +1,4 @@
1
- import type { ChatMedia } from "../services/types";
1
+ import type { ChatMedia } from "../services/types.js";
2
2
  export declare const FileContext: import("react").Context<ChatMedia | null>;
3
- import type { MediaLoad } from "../hooks/use-media-load";
3
+ import type { MediaLoad } from "../hooks/use-media-load.js";
4
4
  export declare const FileLoadContext: import("react").Context<MediaLoad | null>;
@@ -1,5 +1,5 @@
1
1
  import { type GateProps } from "@slices.sh/core/part";
2
- import type { ChatMediaKind } from "../services/types";
2
+ import type { ChatMediaKind } from "../services/types.js";
3
3
  export declare function FileKind({ kind, children }: GateProps & {
4
4
  kind: ChatMediaKind;
5
5
  }): import("react").ReactNode;
@@ -1,126 +1,126 @@
1
- import { Settings } from "./settings";
2
- import { Models } from "./models";
3
- import { ModelPicker } from "./model-picker";
4
- import { OptionalTools } from "./optional-tools";
5
- import { ToggleTool } from "./toggle-tool";
6
- import { FeedbackRoot } from "./feedback-root";
7
- import { Feedback } from "./feedback";
8
- import { FeedbackError } from "./feedback-error";
9
- import { ReadAloud } from "./read-aloud";
10
- import { FollowUps } from "./follow-ups";
11
- import { Model } from "./model";
12
- import { Timing } from "./timing";
13
- import { EditedAttachments } from "./edited-attachments";
14
- import { BranchNavigation } from "./branch-navigation";
15
- import { BranchPrevious } from "./branch-previous";
16
- import { BranchNext } from "./branch-next";
17
- import { BranchPage } from "./branch-page";
18
- import { MessageEditRoot } from "./message-edit-root";
19
- import { MessageEditing } from "./message-editing";
20
- import { MessageReading } from "./message-reading";
21
- import { Edit } from "./edit";
22
- import { MessageEditor } from "./message-editor";
23
- import { EditedInput } from "./edited-input";
24
- import { CancelEdit } from "./cancel-edit";
25
- import { SaveEdit } from "./save-edit";
26
- import { FileRoot } from "./file-root";
27
- import { FileKind } from "./file-kind-gate";
28
- import { FileImage } from "./file-img";
29
- import { FileAudio } from "./file-audio";
30
- import { FileVideo } from "./file-video";
31
- import { FileLink } from "./file-link";
32
- import { FileUnavailable } from "./file-unavailable";
33
- import { CitationRoot } from "./citation-root";
34
- import { CitationContent } from "./citation-content";
35
- import { CitationTrigger } from "./citation-trigger";
36
- import { CitationTitle } from "./citation-title";
37
- import { CitationDescription } from "./citation-description";
38
- import { SourceSheetRoot } from "./source-sheet-root";
39
- import { SourceSheetContent } from "./source-sheet-content";
40
- import { SourceSheetTrigger } from "./source-sheet-trigger";
41
- import { SourceSheetTitle } from "./source-sheet-title";
42
- import { SourceSheetDescription } from "./source-sheet-description";
43
- import { SourceSheetClose } from "./source-sheet-close";
44
- import { References } from "./references";
45
- import { PartSource } from "./part-source";
46
- import { SourceRoot } from "./source-root";
47
- import { SourceLink } from "./source-link";
48
- import { SourceUnavailable } from "./source-unavailable";
49
- import { PartFile } from "./part-file";
50
- import { ComposerRoot } from "./composer-root";
51
- import { ComposerStandalone } from "./composer-standalone";
52
- import { MessageFooter } from "./message-footer";
53
- import { SendNow } from "./send-now";
54
- import { CancelQueued } from "./cancel-queued";
55
- import { CancelQueueEdit } from "./cancel-queue-edit";
56
- import { SaveQueued } from "./save-queued";
57
- import { EditQueued } from "./edit-queued";
58
- import { QueuedInput } from "./queued-input";
59
- import { QueueEditing } from "./queue-editing";
60
- import { QueuePreview } from "./queue-preview";
61
- import { QueueItem } from "./queue-item";
62
- import { QueueItems } from "./queue-items";
63
- import { StepBoundary } from "./step-boundary";
64
- import { Continue } from "./continue";
65
- import { ReasoningTimer } from "./reasoning-timer";
66
- import { ReasoningDisclosure } from "./reasoning-disclosure";
67
- import { ToolError } from "./tool-error";
68
- import { ToolOutput } from "./tool-output";
69
- import { ToolInput } from "./tool-input";
70
- import { ToolRenderer } from "./tool-renderer";
71
- import { QuestionReceipt } from "./question-receipt";
72
- import { QuestionError } from "./question-error";
73
- import { SubmitAnswers } from "./submit-answers";
74
- import { SkipQuestions } from "./skip-questions";
75
- import { QuestionOther } from "./question-other";
76
- import { OtherAnswer } from "./other-answer";
77
- import { ClearAnswer } from "./clear-answer";
78
- import { QuestionProgress } from "./question-progress";
79
- import { QuestionBack } from "./question-back";
80
- import { QuestionNext } from "./question-next";
81
- import { QuestionInvalid } from "./question-invalid";
82
- import { Answer } from "./answer";
83
- import { QuestionItem } from "./question-item";
84
- import { Questions } from "./questions";
85
- import { PartQuestion } from "./part-question";
86
- import { ForgetApproval } from "./forget-approval";
87
- import { RememberedApproval } from "./remembered-approval";
88
- import { AlwaysAllow } from "./always-allow";
89
- import { ApprovalReceipt } from "./approval-receipt";
90
- import { ApprovalError } from "./approval-error";
91
- import { ApprovalReason } from "./approval-reason";
92
- import { Deny } from "./deny";
93
- import { Approve } from "./approve";
94
- import { PartApproval } from "./part-approval";
95
- import { Composer } from "./composer";
96
- import { Copy } from "./copy";
97
- import { Empty } from "./empty";
98
- import { Failed } from "./failed";
99
- import { Input } from "./input";
100
- import { JumpToLatest } from "./jump-to-latest";
101
- import { Message } from "./message";
102
- import { Messages } from "./messages";
103
- import { PartReasoning } from "./part-reasoning";
104
- import { PartText } from "./part-text";
105
- import { PartTool } from "./part-tool";
106
- import { Parts } from "./parts";
107
- import { Queued } from "./queued";
108
- import { Regenerate } from "./regenerate";
109
- import { Root } from "./root";
110
- import { Sources } from "./sources";
111
- import { Speaker } from "./speaker";
112
- import { Stopped } from "./stopped";
113
- import { Stop } from "./stop";
114
- import { Submit } from "./submit";
115
- import { Suggestion } from "./suggestion";
116
- import { Suggestions } from "./suggestions";
117
- import { Thread } from "./thread";
118
- import { Transcript } from "./transcript";
119
- import { TryAgain } from "./try-again";
120
- import { Unavailable } from "./unavailable";
121
- import { ContextUsage } from "./context-usage";
122
- import { Usage } from "./usage";
123
- import { Waiting } from "./waiting";
1
+ import { Settings } from "./settings.js";
2
+ import { Models } from "./models.js";
3
+ import { ModelPicker } from "./model-picker.js";
4
+ import { OptionalTools } from "./optional-tools.js";
5
+ import { ToggleTool } from "./toggle-tool.js";
6
+ import { FeedbackRoot } from "./feedback-root.js";
7
+ import { Feedback } from "./feedback.js";
8
+ import { FeedbackError } from "./feedback-error.js";
9
+ import { ReadAloud } from "./read-aloud.js";
10
+ import { FollowUps } from "./follow-ups.js";
11
+ import { Model } from "./model.js";
12
+ import { Timing } from "./timing.js";
13
+ import { EditedAttachments } from "./edited-attachments.js";
14
+ import { BranchNavigation } from "./branch-navigation.js";
15
+ import { BranchPrevious } from "./branch-previous.js";
16
+ import { BranchNext } from "./branch-next.js";
17
+ import { BranchPage } from "./branch-page.js";
18
+ import { MessageEditRoot } from "./message-edit-root.js";
19
+ import { MessageEditing } from "./message-editing.js";
20
+ import { MessageReading } from "./message-reading.js";
21
+ import { Edit } from "./edit.js";
22
+ import { MessageEditor } from "./message-editor.js";
23
+ import { EditedInput } from "./edited-input.js";
24
+ import { CancelEdit } from "./cancel-edit.js";
25
+ import { SaveEdit } from "./save-edit.js";
26
+ import { FileRoot } from "./file-root.js";
27
+ import { FileKind } from "./file-kind-gate.js";
28
+ import { FileImage } from "./file-img.js";
29
+ import { FileAudio } from "./file-audio.js";
30
+ import { FileVideo } from "./file-video.js";
31
+ import { FileLink } from "./file-link.js";
32
+ import { FileUnavailable } from "./file-unavailable.js";
33
+ import { CitationRoot } from "./citation-root.js";
34
+ import { CitationContent } from "./citation-content.js";
35
+ import { CitationTrigger } from "./citation-trigger.js";
36
+ import { CitationTitle } from "./citation-title.js";
37
+ import { CitationDescription } from "./citation-description.js";
38
+ import { SourceSheetRoot } from "./source-sheet-root.js";
39
+ import { SourceSheetContent } from "./source-sheet-content.js";
40
+ import { SourceSheetTrigger } from "./source-sheet-trigger.js";
41
+ import { SourceSheetTitle } from "./source-sheet-title.js";
42
+ import { SourceSheetDescription } from "./source-sheet-description.js";
43
+ import { SourceSheetClose } from "./source-sheet-close.js";
44
+ import { References } from "./references.js";
45
+ import { PartSource } from "./part-source.js";
46
+ import { SourceRoot } from "./source-root.js";
47
+ import { SourceLink } from "./source-link.js";
48
+ import { SourceUnavailable } from "./source-unavailable.js";
49
+ import { PartFile } from "./part-file.js";
50
+ import { ComposerRoot } from "./composer-root.js";
51
+ import { ComposerStandalone } from "./composer-standalone.js";
52
+ import { MessageFooter } from "./message-footer.js";
53
+ import { SendNow } from "./send-now.js";
54
+ import { CancelQueued } from "./cancel-queued.js";
55
+ import { CancelQueueEdit } from "./cancel-queue-edit.js";
56
+ import { SaveQueued } from "./save-queued.js";
57
+ import { EditQueued } from "./edit-queued.js";
58
+ import { QueuedInput } from "./queued-input.js";
59
+ import { QueueEditing } from "./queue-editing.js";
60
+ import { QueuePreview } from "./queue-preview.js";
61
+ import { QueueItem } from "./queue-item.js";
62
+ import { QueueItems } from "./queue-items.js";
63
+ import { StepBoundary } from "./step-boundary.js";
64
+ import { Continue } from "./continue.js";
65
+ import { ReasoningTimer } from "./reasoning-timer.js";
66
+ import { ReasoningDisclosure } from "./reasoning-disclosure.js";
67
+ import { ToolError } from "./tool-error.js";
68
+ import { ToolOutput } from "./tool-output.js";
69
+ import { ToolInput } from "./tool-input.js";
70
+ import { ToolRenderer } from "./tool-renderer.js";
71
+ import { QuestionReceipt } from "./question-receipt.js";
72
+ import { QuestionError } from "./question-error.js";
73
+ import { SubmitAnswers } from "./submit-answers.js";
74
+ import { SkipQuestions } from "./skip-questions.js";
75
+ import { QuestionOther } from "./question-other.js";
76
+ import { OtherAnswer } from "./other-answer.js";
77
+ import { ClearAnswer } from "./clear-answer.js";
78
+ import { QuestionProgress } from "./question-progress.js";
79
+ import { QuestionBack } from "./question-back.js";
80
+ import { QuestionNext } from "./question-next.js";
81
+ import { QuestionInvalid } from "./question-invalid.js";
82
+ import { Answer } from "./answer.js";
83
+ import { QuestionItem } from "./question-item.js";
84
+ import { Questions } from "./questions.js";
85
+ import { PartQuestion } from "./part-question.js";
86
+ import { ForgetApproval } from "./forget-approval.js";
87
+ import { RememberedApproval } from "./remembered-approval.js";
88
+ import { AlwaysAllow } from "./always-allow.js";
89
+ import { ApprovalReceipt } from "./approval-receipt.js";
90
+ import { ApprovalError } from "./approval-error.js";
91
+ import { ApprovalReason } from "./approval-reason.js";
92
+ import { Deny } from "./deny.js";
93
+ import { Approve } from "./approve.js";
94
+ import { PartApproval } from "./part-approval.js";
95
+ import { Composer } from "./composer.js";
96
+ import { Copy } from "./copy.js";
97
+ import { Empty } from "./empty.js";
98
+ import { Failed } from "./failed.js";
99
+ import { Input } from "./input.js";
100
+ import { JumpToLatest } from "./jump-to-latest.js";
101
+ import { Message } from "./message.js";
102
+ import { Messages } from "./messages.js";
103
+ import { PartReasoning } from "./part-reasoning.js";
104
+ import { PartText } from "./part-text.js";
105
+ import { PartTool } from "./part-tool.js";
106
+ import { Parts } from "./parts.js";
107
+ import { Queued } from "./queued.js";
108
+ import { Regenerate } from "./regenerate.js";
109
+ import { Root } from "./root.js";
110
+ import { Sources } from "./sources.js";
111
+ import { Speaker } from "./speaker.js";
112
+ import { Stopped } from "./stopped.js";
113
+ import { Stop } from "./stop.js";
114
+ import { Submit } from "./submit.js";
115
+ import { Suggestion } from "./suggestion.js";
116
+ import { Suggestions } from "./suggestions.js";
117
+ import { Thread } from "./thread.js";
118
+ import { Transcript } from "./transcript.js";
119
+ import { TryAgain } from "./try-again.js";
120
+ import { Unavailable } from "./unavailable.js";
121
+ import { ContextUsage } from "./context-usage.js";
122
+ import { Usage } from "./usage.js";
123
+ import { Waiting } from "./waiting.js";
124
124
  export declare const Chat: {
125
125
  ToggleTool: typeof ToggleTool;
126
126
  OptionalTools: typeof OptionalTools;
@@ -246,4 +246,4 @@ export declare const Chat: {
246
246
  TryAgain: typeof TryAgain;
247
247
  Unavailable: typeof Unavailable;
248
248
  };
249
- export type { ToolRenderers, ToolView } from "./tool-renderer";
249
+ export type { ToolRenderers, ToolView } from "./tool-renderer.js";
@@ -1,5 +1,5 @@
1
1
  import { type PartProps } from "@slices.sh/core/part";
2
- import type { AiChatMessage } from "../services/types";
2
+ import type { AiChatMessage } from "../services/types.js";
3
3
  type MessageState = {
4
4
  role: AiChatMessage["role"];
5
5
  interrupted: boolean;
@@ -1,5 +1,5 @@
1
1
  import { type GateProps } from "@slices.sh/core/part";
2
- import type { ChatChoices } from "../services/types";
2
+ import type { ChatChoices } from "../services/types.js";
3
3
  export declare function Models({ children }: GateProps<{
4
4
  models: NonNullable<ChatChoices["models"]>;
5
5
  }>): import("react").ReactNode;
@@ -1,5 +1,5 @@
1
1
  import { type GateProps } from "@slices.sh/core/part";
2
- import type { ChatChoices } from "../services/types";
2
+ import type { ChatChoices } from "../services/types.js";
3
3
  export declare function OptionalTools({ selected, children }: GateProps<{
4
4
  tools: NonNullable<ChatChoices["tools"]>;
5
5
  }> & {
@@ -1,5 +1,5 @@
1
1
  import { type GateProps } from "@slices.sh/core/part";
2
- import type { ChatSource } from "../services/types";
2
+ import type { ChatSource } from "../services/types.js";
3
3
  export declare function PartSource({ children }: GateProps<{
4
4
  source: ChatSource;
5
5
  }>): import("react").ReactNode;
@@ -1,6 +1,6 @@
1
1
  import type { TextUIPart } from "ai";
2
2
  import { type GateProps } from "@slices.sh/core/part";
3
- import type { AiChatMessage } from "../services/types";
3
+ import type { AiChatMessage } from "../services/types.js";
4
4
  type PartTextState = TextUIPart & {
5
5
  role: AiChatMessage["role"];
6
6
  streaming: boolean;
@@ -1,4 +1,4 @@
1
- import type { QuestionProblem } from "../services/types";
1
+ import type { QuestionProblem } from "../services/types.js";
2
2
  import { type PartProps } from "@slices.sh/core/part";
3
3
  /** What is missing from one question's answer, once the person tried to go on without it. */
4
4
  export declare function QuestionInvalid({ name, ...props }: PartProps<"p", {
@@ -1,3 +1,3 @@
1
1
  import { type GateProps } from "@slices.sh/core/part";
2
- import type { Questionnaire } from "../services/types";
2
+ import type { Questionnaire } from "../services/types.js";
3
3
  export declare function Questions({ children }: GateProps<Questionnaire>): import("react").ReactNode;
@@ -1,5 +1,5 @@
1
1
  import { type GateProps } from "@slices.sh/core/part";
2
- import type { ChatSource } from "../services/types";
2
+ import type { ChatSource } from "../services/types.js";
3
3
  /** URL and document references in native transcript order, deduplicated by source identity. */
4
4
  export declare function References({ children }: GateProps<{
5
5
  sources: readonly ChatSource[];
@@ -1,5 +1,5 @@
1
- import type { ChatSettings, ChatFeedbackOptions } from "../services/types";
2
- import { type AiChat } from "../hooks/use-chat-instance";
1
+ import type { ChatSettings, ChatFeedbackOptions } from "../services/types.js";
2
+ import { type AiChat } from "../hooks/use-chat-instance.js";
3
3
  import type { Enabled } from "@slices.sh/core";
4
4
  import { type RootProps } from "@slices.sh/core/part";
5
5
  type ChatRootProps = RootProps & ChatFeedbackOptions & {
@@ -1,5 +1,5 @@
1
- import type { ChatSource } from "../services/types";
2
- import type { SourceDisclosure } from "../hooks/use-source-disclosure";
1
+ import type { ChatSource } from "../services/types.js";
2
+ import type { SourceDisclosure } from "../hooks/use-source-disclosure.js";
3
3
  export declare const SourceScope: import("react").Context<ChatSource | null>;
4
4
  export declare const CitationDisclosureContext: import("react").Context<SourceDisclosure | null>;
5
5
  export declare const SourceSheetContext: import("react").Context<SourceDisclosure | null>;
@@ -1,4 +1,4 @@
1
- import type { ChatSource } from "../services/types";
1
+ import type { ChatSource } from "../services/types.js";
2
2
  import type { RootProps } from "@slices.sh/core/part";
3
3
  export declare function SourceRoot({ source, children }: RootProps & {
4
4
  source: ChatSource;
@@ -1,5 +1,5 @@
1
1
  import { type PartProps } from "@slices.sh/core/part";
2
- import type { AiChatMessage } from "../services/types";
2
+ import type { AiChatMessage } from "../services/types.js";
3
3
  /**
4
4
  * Who said it, in words.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  import { type GateProps } from "@slices.sh/core/part";
2
- import type { AiChatMetadata } from "../services/types";
2
+ import type { AiChatMetadata } from "../services/types.js";
3
3
  export declare function Timing({ children }: GateProps<{
4
4
  timing: NonNullable<AiChatMetadata["timing"]>;
5
5
  }>): import("react").ReactNode;
@@ -1,3 +1,3 @@
1
- import type { Question } from "../services/types";
1
+ import type { Question } from "../services/types.js";
2
2
  /** The question a part is about, by the name the pattern gave it. */
3
3
  export declare function useQuestion(name: string, part: string): Question | undefined;
@@ -1,5 +1,5 @@
1
1
  import type { ChatStatus } from "ai";
2
- import type { AiChatMessage } from "../services/types";
2
+ import type { AiChatMessage } from "../services/types.js";
3
3
  /** Whether this is the answer the chat is writing right now. */
4
4
  export declare function isWriting(message: AiChatMessage, messages: AiChatMessage[], status: ChatStatus): boolean;
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { type ChatErrorSlug } from "../services/types";
1
+ import { type ChatErrorSlug } from "../services/types.js";
2
2
  /**
3
3
  * Which refusal the AI SDK's error was, so a screen can say something true about it.
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import type { FileUIPart } from "ai";
2
- import type { AiChat } from "./use-chat-instance";
3
- import type { QueuedTurn, QueueChange } from "./use-turn-queue";
2
+ import type { AiChat } from "./use-chat-instance.js";
3
+ import type { QueuedTurn, QueueChange } from "./use-turn-queue.js";
4
4
  export declare function createMailbox(): {
5
5
  open(): () => void;
6
6
  snapshot: () => readonly QueuedTurn[];
@@ -1,5 +1,5 @@
1
- import { type BranchPage } from "../services/types";
2
- import type { AiChat } from "./use-chat-instance";
1
+ import { type BranchPage } from "../services/types.js";
2
+ import type { AiChat } from "./use-chat-instance.js";
3
3
  export type Branches = {
4
4
  blocked: boolean;
5
5
  page: (messageId: string) => BranchPage | null;
@@ -1,7 +1,7 @@
1
1
  import { Chat } from "@ai-sdk/react";
2
- import { type ChatSettings } from "../services/types";
2
+ import { type ChatSettings } from "../services/types.js";
3
3
  import { type Enabled } from "@slices.sh/core";
4
- import type { AiChatMessage } from "../services/types";
4
+ import type { AiChatMessage } from "../services/types.js";
5
5
  /** The AI SDK's own chat, typed with the metadata a route writes. */
6
6
  export type AiChat = Chat<AiChatMessage>;
7
7
  /**
@@ -1,11 +1,11 @@
1
- import { type ChatSettings } from "../services/types";
2
- import type { AiChat } from "./use-chat-instance";
1
+ import { type ChatSettings } from "../services/types.js";
2
+ import type { AiChat } from "./use-chat-instance.js";
3
3
  export declare function useChatSettings(chat: AiChat, settings: ChatSettings | null, waiting: number): {
4
4
  blocked: boolean;
5
5
  model: (id: string) => void;
6
6
  toggle: (id: string) => void;
7
7
  removeLast: () => boolean;
8
- choices: import("../services/choices").ChatChoices | null;
9
- selection: import("../services/choices").ChatSelection;
8
+ choices: import("../services/choices.js").ChatChoices | null;
9
+ selection: import("../services/choices.js").ChatSelection;
10
10
  };
11
11
  export type ChatSettingsView = ReturnType<typeof useChatSettings>;
@@ -1,6 +1,6 @@
1
1
  import type { FileUIPart } from "ai";
2
2
  import type { Sink } from "@slices.sh/composer";
3
- import type { AiChat, ChatSource } from "./use-chat-instance";
3
+ import type { AiChat, ChatSource } from "./use-chat-instance.js";
4
4
  /**
5
5
  * The chat as a destination for Composer: one concern, how a message gets into the
6
6
  * conversation. Sending is the queue's `enqueue` while the chat queues, and a direct send
@@ -1,4 +1,4 @@
1
- import type { AiChat } from "./use-chat-instance";
1
+ import type { AiChat } from "./use-chat-instance.js";
2
2
  export type ContextUsage = {
3
3
  tokens: number;
4
4
  capacity: number;
@@ -1,4 +1,4 @@
1
- import type { ChatFeedback, ChatFeedbackOptions } from "../services/types";
1
+ import type { ChatFeedback, ChatFeedbackOptions } from "../services/types.js";
2
2
  export declare function useFeedback(target: Pick<ChatFeedback, "chatId" | "messageId">, onFeedback: ChatFeedbackOptions["onFeedback"]): {
3
3
  rating: "up" | "down" | null;
4
4
  pending: boolean;
@@ -1,3 +1,3 @@
1
1
  import type { FileUIPart } from "ai";
2
- import { type ChatMedia } from "../services/types";
2
+ import { type ChatMedia } from "../services/types.js";
3
3
  export declare function useMedia(file: FileUIPart): ChatMedia;
@@ -1,5 +1,5 @@
1
- import { type QuestionProblem, type Questionnaire } from "../services/types";
2
- import type { QuestionDraft } from "./use-question-draft";
1
+ import { type QuestionProblem, type Questionnaire } from "../services/types.js";
2
+ import type { QuestionDraft } from "./use-question-draft.js";
3
3
  export type QuestionCheck = {
4
4
  /** What is wrong with a question's answer right now; null when nothing is. */
5
5
  problem(name: string): QuestionProblem | null;
@@ -1,5 +1,5 @@
1
- import type { QuestionAnswers, Questionnaire } from "../services/types";
2
- export { isSkippedQuestion, questionInput } from "../services/types";
1
+ import type { QuestionAnswers, Questionnaire } from "../services/types.js";
2
+ export { isSkippedQuestion, questionInput } from "../services/types.js";
3
3
  export type DraftChange =
4
4
  /** Replaces the choice of a single question and toggles one of a multiple question. */
5
5
  {
@@ -1,5 +1,5 @@
1
- import type { Questionnaire } from "../services/types";
2
- import type { QuestionCheck } from "./use-question-check";
1
+ import type { Questionnaire } from "../services/types.js";
2
+ import type { QuestionCheck } from "./use-question-check.js";
3
3
  export type StepMove = "back"
4
4
  /** Stays, and says why, while the question being left has no good answer. */
5
5
  | "next"
@@ -1,5 +1,5 @@
1
- import { type QuestionAnswers } from "../services/types";
2
- import type { AiChat } from "./use-chat-instance";
1
+ import { type QuestionAnswers } from "../services/types.js";
2
+ import type { AiChat } from "./use-chat-instance.js";
3
3
  export type QuestionWrite = {
4
4
  run(answers: QuestionAnswers): Promise<void>;
5
5
  pending: boolean;
@@ -1,5 +1,5 @@
1
- import type { AiChat } from "./use-chat-instance";
2
- import type { ToolApprovalMemory } from "./use-tool-approval-memory";
1
+ import type { AiChat } from "./use-chat-instance.js";
2
+ import type { ToolApprovalMemory } from "./use-tool-approval-memory.js";
3
3
  export type ApprovalAutomation = {
4
4
  failure: {
5
5
  id: string;
@@ -1,3 +1,3 @@
1
- import type { AiChat } from "./use-chat-instance";
1
+ import type { AiChat } from "./use-chat-instance.js";
2
2
  /** Sends at once, for a chat with no queue; an open question is skipped, and this is the reply. */
3
3
  export declare function useReply(chat: AiChat): (text: string) => void;
@@ -1,5 +1,5 @@
1
1
  import { type Chat } from "@ai-sdk/react";
2
- import type { AiChatMessage } from "../services/types";
2
+ import type { AiChatMessage } from "../services/types.js";
3
3
  /**
4
4
  * Tells the tab when a turn was refused because the server lacks configuration.
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { AiChatMessage } from "../services/types";
1
+ import type { AiChatMessage } from "../services/types.js";
2
2
  export type SentDraft = {
3
3
  value: string | null;
4
4
  start: () => void;
@@ -1,3 +1,3 @@
1
- import { type AiChatMessage, type ChatSource } from "../services/types";
1
+ import { type AiChatMessage, type ChatSource } from "../services/types.js";
2
2
  export type Sources = readonly ChatSource[];
3
3
  export declare function useSources(message: AiChatMessage): Sources;
@@ -1,4 +1,4 @@
1
- import type { AiChat } from "./use-chat-instance";
1
+ import type { AiChat } from "./use-chat-instance.js";
2
2
  export type ToolApprovalMemory = {
3
3
  enabled: boolean;
4
4
  tools: readonly string[];
@@ -1,4 +1,4 @@
1
- import type { AiChat } from "./use-chat-instance";
1
+ import type { AiChat } from "./use-chat-instance.js";
2
2
  export type ToolApproval = {
3
3
  run(input: {
4
4
  approved: boolean;
@@ -1,6 +1,6 @@
1
1
  import type { FileUIPart } from "ai";
2
- import { type Blocker } from "../services/types";
3
- import type { AiChat } from "./use-chat-instance";
2
+ import { type Blocker } from "../services/types.js";
3
+ import type { AiChat } from "./use-chat-instance.js";
4
4
  export type QueuedTurn = {
5
5
  id: string;
6
6
  text: string;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { AiChatClient } from "./services/types";
1
+ import type { AiChatClient } from "./services/types.js";
2
2
  export type { AiChatClient };
3
3
  /**
4
4
  * Configures the ai-chat service: services/ai-chat/<config>.config.ts has
@@ -1,5 +1,5 @@
1
1
  import type { Chat } from "@ai-sdk/react";
2
- import type { AiChatMessage } from "./messages";
2
+ import type { AiChatMessage } from "./messages.js";
3
3
  type ApprovalChat = Pick<Chat<AiChatMessage>, "messages" | "addToolApprovalResponse">;
4
4
  /** One decision per native approval id, even when two views share a chat. */
5
5
  export declare function respondToApproval(chat: ApprovalChat, id: string, approved: boolean): Promise<void>;
@@ -1,4 +1,4 @@
1
- import type { AiChatMessage } from "./messages";
1
+ import type { AiChatMessage } from "./messages.js";
2
2
  export type BranchPage = {
3
3
  id: string;
4
4
  index: number;
@@ -1,7 +1,7 @@
1
1
  import type { ChatTransport } from "ai";
2
- import type { AiChatClient } from "./ports";
3
- import type { AiChatMessage } from "./messages";
4
- import type { ChatChoices, ChatSelection } from "./choices";
2
+ import type { AiChatClient } from "./ports.js";
3
+ import type { AiChatMessage } from "./messages.js";
4
+ import type { ChatChoices, ChatSelection } from "./choices.js";
5
5
  export type ChatSettingsState = {
6
6
  choices: ChatChoices | null;
7
7
  selection: ChatSelection;
@@ -1,4 +1,4 @@
1
- import type { ChatConfig, ChatModel } from "./turn";
1
+ import type { ChatConfig, ChatModel } from "./turn.js";
2
2
  export type ChatModelOption = {
3
3
  label: string;
4
4
  model: ChatModel;
@@ -1,4 +1,4 @@
1
- import type { AiChatMessage } from "./messages";
1
+ import type { AiChatMessage } from "./messages.js";
2
2
  /** Continue only client questions here; server-executed tools have their own step loop. */
3
3
  export declare function shouldContinueChat(input: {
4
4
  messages: AiChatMessage[];
@@ -1,4 +1,4 @@
1
- import type { AiChatClient } from "./types";
1
+ import type { AiChatClient } from "./types.js";
2
2
  /**
3
3
  * The client of the config the screen targets, or null when the service has no such config.
4
4
  * Hooks import only this, so a screen builds, and runs on a fixture, before a service is set up.
@@ -1,7 +1,7 @@
1
1
  import type { ChatTransport } from "ai";
2
- import type { AiChatMessage } from "./messages";
3
- import type { ChatChoices } from "./choices";
4
- import type { ChatConfig } from "./turn";
2
+ import type { AiChatMessage } from "./messages.js";
3
+ import type { ChatChoices } from "./choices.js";
4
+ import type { ChatConfig } from "./turn.js";
5
5
  /**
6
6
  * Where a chat's turns go, as the AI SDK's own transport.
7
7
  *
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import type { Chat } from "@ai-sdk/react";
3
- import type { AiChatMessage, AiChatPart } from "./messages";
3
+ import type { AiChatMessage, AiChatPart } from "./messages.js";
4
4
  export declare const questionSchema: z.ZodObject<{
5
5
  title: z.ZodString;
6
6
  questions: z.ZodArray<z.ZodObject<{
@@ -1,6 +1,6 @@
1
1
  import "server-only";
2
- import type { AiChatMessage } from "./messages";
3
- import type { ChatConfig, ChatRequestContext, ChatTurnEnd } from "./turn";
2
+ import type { AiChatMessage } from "./messages.js";
3
+ import type { ChatConfig, ChatRequestContext, ChatTurnEnd } from "./turn.js";
4
4
  /**
5
5
  * The conversation a turn carries, checked by the SDK's own validator.
6
6
  *
@@ -1,8 +1,8 @@
1
- import { type ChatSelection } from "./choices";
2
- import type { ChatConfig } from "./turn";
1
+ import { type ChatSelection } from "./choices.js";
2
+ import type { ChatConfig } from "./turn.js";
3
3
  /** A browser may choose only declared alternatives and may disable only optional tools. */
4
4
  export declare function selectChat(config: ChatConfig, given: unknown): {
5
- model: import("./turn").ChatModel;
5
+ model: import("./turn.js").ChatModel;
6
6
  modelId: string | undefined;
7
7
  selection: ChatSelection;
8
8
  activeTools: string[] | undefined;
@@ -1,4 +1,4 @@
1
- import type { AiChatMessage } from "./messages";
1
+ import type { AiChatMessage } from "./messages.js";
2
2
  export type ChatSource = {
3
3
  key: string;
4
4
  number: number;
@@ -1,7 +1,7 @@
1
1
  import type { LanguageModel, LanguageModelCallOptions, UIMessageStreamOnEndCallback } from "ai";
2
- import type { AiChatMessage } from "./messages";
3
- import type { ChatModelOption, ChatToolOption, ChatSelection } from "./choices";
4
- import type { ChatToolSet } from "./tools";
2
+ import type { AiChatMessage } from "./messages.js";
3
+ import type { ChatModelOption, ChatToolOption, ChatSelection } from "./choices.js";
4
+ import type { ChatToolSet } from "./tools.js";
5
5
  /**
6
6
  * The model a chat answers with.
7
7
  *
@@ -6,18 +6,18 @@
6
6
  * to an app — the metadata a route writes, the refusals it can answer with, and how a chat
7
7
  * is configured — because this is the one file the layers above may read.
8
8
  */
9
- export * from "./errors";
10
- export * from "./messages";
11
- export * from "./ports";
12
- export * from "./tools";
13
- export * from "./turn";
14
- export * from "./approval";
15
- export * from "./approval-memory";
16
- export * from "./questions";
17
- export * from "./continue";
18
- export * from "./sources";
19
- export * from "./media";
20
- export * from "./branches";
21
- export * from "./chat-session";
22
- export * from "./choices";
23
- export * from "./selection";
9
+ export * from "./errors.js";
10
+ export * from "./messages.js";
11
+ export * from "./ports.js";
12
+ export * from "./tools.js";
13
+ export * from "./turn.js";
14
+ export * from "./approval.js";
15
+ export * from "./approval-memory.js";
16
+ export * from "./questions.js";
17
+ export * from "./continue.js";
18
+ export * from "./sources.js";
19
+ export * from "./media.js";
20
+ export * from "./branches.js";
21
+ export * from "./chat-session.js";
22
+ export * from "./choices.js";
23
+ export * from "./selection.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slices.sh/ai-chat",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "slices v2: ai-chat",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -806,9 +806,9 @@
806
806
  "@ai-sdk/provider-utils": "^5.0.53",
807
807
  "@ai-sdk/react": "^4.0.130",
808
808
  "@shadcn/react": "^0.3.1",
809
- "@slices.sh/composer": "^0.1.0",
810
- "@slices.sh/core": "^0.1.0",
811
- "@slices.sh/transcription": "^0.1.0",
809
+ "@slices.sh/composer": "^0.1.3",
810
+ "@slices.sh/core": "^0.1.6",
811
+ "@slices.sh/transcription": "^0.1.8",
812
812
  "ai": "^7.0.127",
813
813
  "server-only": "^0.0.1",
814
814
  "zod": "^4.6.5"