@assistant-ui/core 0.1.12 → 0.1.13
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/dist/adapters/index.d.ts +2 -0
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/mention.d.ts +3 -17
- package/dist/adapters/mention.d.ts.map +1 -1
- package/dist/adapters/mention.js.map +1 -1
- package/dist/adapters/trigger.d.ts +28 -0
- package/dist/adapters/trigger.d.ts.map +1 -0
- package/dist/adapters/trigger.js +2 -0
- package/dist/adapters/trigger.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react/runtimes/RemoteThreadListHookInstanceManager.d.ts +2 -2
- package/dist/react/runtimes/RemoteThreadListThreadListRuntimeCore.d.ts +2 -2
- package/dist/runtime/api/bindings.d.ts +2 -2
- package/dist/runtime/api/bindings.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.d.ts +6 -3
- package/dist/runtime/api/composer-runtime.d.ts.map +1 -1
- package/dist/runtime/api/composer-runtime.js +4 -2
- package/dist/runtime/api/composer-runtime.js.map +1 -1
- package/dist/runtime/api/thread-runtime.d.ts +2 -27
- package/dist/runtime/api/thread-runtime.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.d.ts +3 -3
- package/dist/runtime/base/base-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/base-composer-runtime-core.js +2 -2
- package/dist/runtime/base/base-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts +4 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-edit-composer-runtime-core.js +9 -2
- package/dist/runtime/base/default-edit-composer-runtime-core.js.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts +2 -2
- package/dist/runtime/base/default-thread-composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.js +2 -1
- package/dist/runtime/base/default-thread-composer-runtime-core.js.map +1 -1
- package/dist/runtime/interfaces/composer-runtime-core.d.ts +8 -1
- package/dist/runtime/interfaces/composer-runtime-core.d.ts.map +1 -1
- package/dist/runtime/interfaces/thread-runtime-core.d.ts +2 -2
- package/dist/runtime/interfaces/thread-runtime-core.d.ts.map +1 -1
- package/dist/store/scopes/composer.d.ts +2 -2
- package/dist/store/scopes/composer.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/mention.d.ts +3 -14
- package/dist/types/mention.d.ts.map +1 -1
- package/dist/types/trigger.d.ts +15 -0
- package/dist/types/trigger.d.ts.map +1 -0
- package/dist/types/trigger.js +2 -0
- package/dist/types/trigger.js.map +1 -0
- package/package.json +6 -6
- package/src/adapters/index.ts +9 -0
- package/src/adapters/mention.ts +3 -20
- package/src/adapters/trigger.ts +52 -0
- package/src/index.ts +17 -0
- package/src/runtime/api/bindings.ts +2 -1
- package/src/runtime/api/composer-runtime.ts +12 -5
- package/src/runtime/base/base-composer-runtime-core.ts +4 -2
- package/src/runtime/base/default-edit-composer-runtime-core.ts +14 -3
- package/src/runtime/base/default-thread-composer-runtime-core.ts +6 -1
- package/src/runtime/interfaces/composer-runtime-core.ts +11 -1
- package/src/runtime/interfaces/thread-runtime-core.ts +2 -2
- package/src/store/scopes/composer.ts +5 -2
- package/src/types/index.ts +5 -0
- package/src/types/mention.ts +5 -16
- package/src/types/trigger.ts +24 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AppendMessage } from "../../types/message.js";
|
|
2
2
|
import type { AttachmentAdapter } from "../../adapters/attachment.js";
|
|
3
3
|
import type { DictationAdapter } from "../../adapters/speech.js";
|
|
4
|
-
import type { ThreadComposerRuntimeCore } from "../interfaces/composer-runtime-core.js";
|
|
4
|
+
import type { SendOptions, ThreadComposerRuntimeCore } from "../interfaces/composer-runtime-core.js";
|
|
5
5
|
import type { ThreadRuntimeCore } from "../interfaces/thread-runtime-core.js";
|
|
6
6
|
import { BaseComposerRuntimeCore } from "./base-composer-runtime-core.js";
|
|
7
7
|
export declare class DefaultThreadComposerRuntimeCore extends BaseComposerRuntimeCore implements ThreadComposerRuntimeCore {
|
|
@@ -17,7 +17,7 @@ export declare class DefaultThreadComposerRuntimeCore extends BaseComposerRuntim
|
|
|
17
17
|
} | undefined;
|
|
18
18
|
});
|
|
19
19
|
connect(): import("../..").Unsubscribe;
|
|
20
|
-
handleSend(message: Omit<AppendMessage, "parentId" | "sourceId"
|
|
20
|
+
handleSend(message: Omit<AppendMessage, "parentId" | "sourceId">, options?: SendOptions): Promise<void>;
|
|
21
21
|
handleCancel(): Promise<void>;
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=default-thread-composer-runtime-core.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-thread-composer-runtime-core.d.ts","sourceRoot":"","sources":["../../../src/runtime/base/default-thread-composer-runtime-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA4B;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,qCAAkC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,iCAA8B;AAC9D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"default-thread-composer-runtime-core.d.ts","sourceRoot":"","sources":["../../../src/runtime/base/default-thread-composer-runtime-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA4B;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,qCAAkC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,iCAA8B;AAC9D,OAAO,KAAK,EACV,WAAW,EACX,yBAAyB,EAC1B,+CAA4C;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,6CAA0C;AAC3E,OAAO,EAAE,uBAAuB,EAAE,wCAAqC;AAEvE,qBAAa,gCACX,SAAQ,uBACR,YAAW,yBAAyB;IAgBlC,OAAO,CAAC,OAAO;IAdjB,OAAO,CAAC,UAAU,CAAS;IAC3B,IAAW,SAAS,YAEnB;IAED,SAAS,CAAC,oBAAoB;IAI9B,SAAS,CAAC,mBAAmB;gBAKnB,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG;QACrD,QAAQ,CAAC,EACL;YACE,WAAW,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;YAC5C,SAAS,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;SAC1C,GACD,SAAS,CAAC;KACf;IAMI,OAAO;IASD,UAAU,CACrB,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,CAAC,EACrD,OAAO,CAAC,EAAE,WAAW;IAUV,YAAY;CAG1B"}
|
|
@@ -24,11 +24,12 @@ export class DefaultThreadComposerRuntimeCore extends BaseComposerRuntimeCore {
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
async handleSend(message) {
|
|
27
|
+
async handleSend(message, options) {
|
|
28
28
|
this.runtime.append({
|
|
29
29
|
...message,
|
|
30
30
|
parentId: this.runtime.messages.at(-1)?.id ?? null,
|
|
31
31
|
sourceId: null,
|
|
32
|
+
startRun: options?.startRun,
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
35
|
async handleCancel() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-thread-composer-runtime-core.js","sourceRoot":"","sources":["../../../src/runtime/base/default-thread-composer-runtime-core.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default-thread-composer-runtime-core.js","sourceRoot":"","sources":["../../../src/runtime/base/default-thread-composer-runtime-core.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,uBAAuB,EAAE,wCAAqC;AAEvE,MAAM,OAAO,gCACX,SAAQ,uBAAuB;IAiBrB;IA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};
|
|
13
|
+
export type SendOptions = {
|
|
14
|
+
startRun?: boolean;
|
|
15
|
+
};
|
|
13
16
|
export type ComposerRuntimeCore = Readonly<{
|
|
14
17
|
isEditing: boolean;
|
|
15
18
|
canCancel: boolean;
|
|
@@ -28,7 +31,7 @@ export type ComposerRuntimeCore = Readonly<{
|
|
|
28
31
|
setQuote: (quote: QuoteInfo | undefined) => void;
|
|
29
32
|
reset: () => Promise<void>;
|
|
30
33
|
clearAttachments: () => Promise<void>;
|
|
31
|
-
send: () => void;
|
|
34
|
+
send: (options?: SendOptions) => void;
|
|
32
35
|
cancel: () => void;
|
|
33
36
|
dictation: DictationState | undefined;
|
|
34
37
|
startDictation: () => void;
|
|
@@ -37,4 +40,8 @@ export type ComposerRuntimeCore = Readonly<{
|
|
|
37
40
|
unstable_on: (event: ComposerRuntimeEventType, callback: () => void) => Unsubscribe;
|
|
38
41
|
}>;
|
|
39
42
|
export type ThreadComposerRuntimeCore = ComposerRuntimeCore;
|
|
43
|
+
export type EditComposerRuntimeCore = ComposerRuntimeCore & Readonly<{
|
|
44
|
+
parentId: string | null;
|
|
45
|
+
sourceId: string | null;
|
|
46
|
+
}>;
|
|
40
47
|
//# sourceMappingURL=composer-runtime-core.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composer-runtime-core.d.ts","sourceRoot":"","sources":["../../../src/runtime/interfaces/composer-runtime-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,+BAA4B;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,6BAA0B;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,kCAA+B;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,mCAAgC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA4B;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,iCAA8B;AAE9D,MAAM,MAAM,wBAAwB,GAChC,MAAM,GACN,eAAe,GAC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SAAS,CAAC;IACrB,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC;IAE7C,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;IAC7B,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAC;IAEjD,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC;IACtC,MAAM,EAAE,MAAM,IAAI,CAAC;IAEnB,SAAS,EAAE,cAAc,GAAG,SAAS,CAAC;IACtC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,WAAW,CAAC;IAEjD,WAAW,EAAE,CACX,KAAK,EAAE,wBAAwB,EAC/B,QAAQ,EAAE,MAAM,IAAI,KACjB,WAAW,CAAC;CAClB,CAAC,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,mBAAmB,CAAC;AAE5D,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,GACvD,QAAQ,CAAC;IACP,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC,CAAC"}
|
|
@@ -8,7 +8,7 @@ import type { RealtimeVoiceAdapter } from "../../adapters/voice.js";
|
|
|
8
8
|
import type { ChatModelRunOptions, ChatModelRunResult } from "../utils/chat-model-adapter.js";
|
|
9
9
|
import type { ExportedMessageRepository } from "../utils/message-repository.js";
|
|
10
10
|
import type { ThreadMessageLike } from "../utils/thread-message-like.js";
|
|
11
|
-
import type {
|
|
11
|
+
import type { EditComposerRuntimeCore, ThreadComposerRuntimeCore } from "./composer-runtime-core.js";
|
|
12
12
|
export type RuntimeCapabilities = {
|
|
13
13
|
readonly switchToBranch: boolean;
|
|
14
14
|
readonly switchBranchDuringRun: boolean;
|
|
@@ -86,7 +86,7 @@ export type ThreadRuntimeCore = Readonly<{
|
|
|
86
86
|
submitFeedback: (feedback: SubmitFeedbackOptions) => void;
|
|
87
87
|
getModelContext: () => ModelContext;
|
|
88
88
|
composer: ThreadComposerRuntimeCore;
|
|
89
|
-
getEditComposer: (messageId: string) =>
|
|
89
|
+
getEditComposer: (messageId: string) => EditComposerRuntimeCore | undefined;
|
|
90
90
|
beginEdit: (messageId: string) => void;
|
|
91
91
|
speech: SpeechState | undefined;
|
|
92
92
|
voice: VoiceSessionState | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread-runtime-core.d.ts","sourceRoot":"","sources":["../../../src/runtime/interfaces/thread-runtime-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,qCAAkC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,mCAAgC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,+BAA4B;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA4B;AACrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,iCAA8B;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,gCAA6B;AACjE,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EACnB,uCAAoC;AACrC,OAAO,KAAK,EAAE,yBAAyB,EAAE,uCAAoC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,wCAAqC;AACtE,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"thread-runtime-core.d.ts","sourceRoot":"","sources":["../../../src/runtime/interfaces/thread-runtime-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,C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AAK,IAAI,CAAC;IAEvC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;IAChC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAErC,YAAY,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IAC5C,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IACnC,KAAK,EAAE,iBAAiB,CAAC;IACzB,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAEzC,MAAM,EAAE,OAAO,CAAC;IAEhB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,WAAW,CAAC;IAEjD,cAAc,EAAE,MAAM,MAAM,CAAC;IAC7B,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,WAAW,CAAC;IAE5D,MAAM,CAAC,UAAU,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACpD,MAAM,IAAI,yBAAyB,CAAC;IAEpC,mBAAmB,IAAI,GAAG,CAAC;IAC3B,mBAAmB,CAAC,KAAK,EAAE,GAAG,GAAG,IAAI,CAAC;IAEtC,KAAK,CAAC,eAAe,CAAC,EAAE,SAAS,iBAAiB,EAAE,GAAG,IAAI,CAAC;IAE5D,WAAW,CAAC,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,WAAW,CAAC;IAE9E;;OAEG;IACH,0BAA0B,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CAClD,CAAC,CAAC"}
|
|
@@ -3,10 +3,10 @@ import type { MessageRole } from "../../types/message.js";
|
|
|
3
3
|
import type { QuoteInfo } from "../../types/quote.js";
|
|
4
4
|
import type { RunConfig } from "../../types/message.js";
|
|
5
5
|
import type { ComposerRuntime } from "../../runtime/api/composer-runtime.js";
|
|
6
|
-
import type { DictationState } from "../../runtime/interfaces/composer-runtime-core.js";
|
|
6
|
+
import type { DictationState, SendOptions } from "../../runtime/interfaces/composer-runtime-core.js";
|
|
7
7
|
import type { AttachmentMethods } from "./attachment.js";
|
|
8
8
|
import type { QueueItemState, QueueItemMethods } from "./queue-item.js";
|
|
9
|
-
export type ComposerSendOptions = {
|
|
9
|
+
export type ComposerSendOptions = SendOptions & {
|
|
10
10
|
/**
|
|
11
11
|
* Whether to steer (interrupt the current run and process this message immediately).
|
|
12
12
|
* When false (default), the message is queued and processed in order.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../../src/store/scopes/composer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,kCAA+B;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,+BAA4B;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,6BAA0B;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA4B;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,8CAA2C;AAC1E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../../src/store/scopes/composer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,kCAA+B;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,+BAA4B;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,6BAA0B;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA4B;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,8CAA2C;AAC1E,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACZ,0DAAuD;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAqB;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,wBAAqB;AAErE,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG;IAC9C;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CAC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scribe.js";
|
|
4
4
|
export type { QuoteInfo } from "./quote.js";
|
|
5
5
|
export type { Unstable_MentionItem, Unstable_MentionCategory, Unstable_DirectiveSegment, Unstable_DirectiveFormatter, } from "./mention.js";
|
|
6
|
+
export type { Unstable_TriggerItem, Unstable_TriggerCategory, } from "./trigger.js";
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAEV,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAE1B,iBAAiB,EACjB,yBAAyB,EACzB,aAAa,EAEb,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,WAAW,EAEX,SAAS,EACT,aAAa,GACd,qBAAkB;AAEnB,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,wBAAqB;AAEtB,YAAY,EAAE,WAAW,EAAE,yBAAsB;AAEjD,YAAY,EAAE,SAAS,EAAE,mBAAgB;AAEzC,YAAY,EACV,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,GAC5B,qBAAkB"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAEV,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAE1B,iBAAiB,EACjB,yBAAyB,EACzB,aAAa,EAEb,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,aAAa,EACb,WAAW,EAEX,SAAS,EACT,aAAa,GACd,qBAAkB;AAEnB,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,wBAAqB;AAEtB,YAAY,EAAE,WAAW,EAAE,yBAAsB;AAEjD,YAAY,EAAE,SAAS,EAAE,mBAAgB;AAEzC,YAAY,EACV,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,GAC5B,qBAAkB;AAEnB,YAAY,EACV,oBAAoB,EACpB,wBAAwB,GACzB,qBAAkB"}
|
package/dist/types/mention.d.ts
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type Unstable_MentionItem =
|
|
3
|
-
|
|
4
|
-
readonly type: string;
|
|
5
|
-
readonly label: string;
|
|
6
|
-
readonly icon?: string | undefined;
|
|
7
|
-
readonly description?: string | undefined;
|
|
8
|
-
readonly metadata?: ReadonlyJSONObject | undefined;
|
|
9
|
-
};
|
|
10
|
-
export type Unstable_MentionCategory = {
|
|
11
|
-
readonly id: string;
|
|
12
|
-
readonly label: string;
|
|
13
|
-
readonly icon?: string | undefined;
|
|
14
|
-
};
|
|
1
|
+
import type { Unstable_TriggerItem, Unstable_TriggerCategory } from "./trigger.js";
|
|
2
|
+
export type Unstable_MentionItem = Unstable_TriggerItem;
|
|
3
|
+
export type Unstable_MentionCategory = Unstable_TriggerCategory;
|
|
15
4
|
/** Parsed segment from directive text */
|
|
16
5
|
export type Unstable_DirectiveSegment = {
|
|
17
6
|
readonly kind: "text";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mention.d.ts","sourceRoot":"","sources":["../../src/types/mention.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"mention.d.ts","sourceRoot":"","sources":["../../src/types/mention.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,qBAAkB;AAMhF,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAMxD,MAAM,MAAM,wBAAwB,GAAG,wBAAwB,CAAC;AAMhE,yCAAyC;AACzC,MAAM,MAAM,yBAAyB,GACjC;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChD;IACE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB,CAAC;AAMN,yEAAyE;AACzE,MAAM,MAAM,2BAA2B,GAAG;IACxC,iDAAiD;IACjD,SAAS,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAAC;IAC9C,4DAA4D;IAC5D,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,yBAAyB,EAAE,CAAC;CAC3D,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReadonlyJSONObject } from "assistant-stream/utils";
|
|
2
|
+
export type Unstable_TriggerItem = {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly type: string;
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly icon?: string | undefined;
|
|
7
|
+
readonly description?: string | undefined;
|
|
8
|
+
readonly metadata?: ReadonlyJSONObject | undefined;
|
|
9
|
+
};
|
|
10
|
+
export type Unstable_TriggerCategory = {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly icon?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=trigger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../src/types/trigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAMjE,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;CACpD,CAAC;AAMF,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../src/types/trigger.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Framework-agnostic core runtime for assistant-ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"assistant",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@assistant-ui/store": "^0.2.6",
|
|
55
|
-
"@assistant-ui/tap": "^0.5.
|
|
55
|
+
"@assistant-ui/tap": "^0.5.7",
|
|
56
56
|
"@types/react": "*",
|
|
57
57
|
"react": "^18 || ^19",
|
|
58
|
-
"assistant-cloud": "^0.1.
|
|
58
|
+
"assistant-cloud": "^0.1.25",
|
|
59
59
|
"zustand": "^5.0.11"
|
|
60
60
|
},
|
|
61
61
|
"peerDependenciesMeta": {
|
|
@@ -77,10 +77,10 @@
|
|
|
77
77
|
"react": "^19.2.4",
|
|
78
78
|
"vitest": "^4.1.2",
|
|
79
79
|
"zustand": "^5.0.12",
|
|
80
|
-
"@assistant-ui/tap": "0.5.6",
|
|
81
|
-
"@assistant-ui/x-buildutils": "0.0.3",
|
|
82
80
|
"@assistant-ui/store": "0.2.6",
|
|
83
|
-
"assistant-
|
|
81
|
+
"@assistant-ui/tap": "0.5.7",
|
|
82
|
+
"@assistant-ui/x-buildutils": "0.0.4",
|
|
83
|
+
"assistant-cloud": "0.1.25"
|
|
84
84
|
},
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public",
|
package/src/adapters/index.ts
CHANGED
|
@@ -24,6 +24,15 @@ export type { FeedbackAdapter } from "./feedback";
|
|
|
24
24
|
// Suggestion adapter
|
|
25
25
|
export type { SuggestionAdapter } from "./suggestion";
|
|
26
26
|
|
|
27
|
+
// Trigger adapter (generic)
|
|
28
|
+
export type { Unstable_TriggerAdapter } from "./trigger";
|
|
29
|
+
|
|
30
|
+
// Slash command adapter
|
|
31
|
+
export type {
|
|
32
|
+
Unstable_SlashCommandAdapter,
|
|
33
|
+
Unstable_SlashCommandItem,
|
|
34
|
+
} from "./trigger";
|
|
35
|
+
|
|
27
36
|
// Mention adapter
|
|
28
37
|
export type { Unstable_MentionAdapter } from "./mention";
|
|
29
38
|
export { unstable_defaultDirectiveFormatter } from "./mention";
|
package/src/adapters/mention.ts
CHANGED
|
@@ -1,32 +1,15 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
Unstable_MentionCategory,
|
|
3
2
|
Unstable_MentionItem,
|
|
4
3
|
Unstable_DirectiveSegment,
|
|
5
4
|
Unstable_DirectiveFormatter,
|
|
6
5
|
} from "../types/mention";
|
|
6
|
+
import type { Unstable_TriggerAdapter } from "./trigger";
|
|
7
7
|
|
|
8
8
|
// =============================================================================
|
|
9
|
-
// Mention Adapter
|
|
9
|
+
// Mention Adapter — alias of the generic TriggerAdapter
|
|
10
10
|
// =============================================================================
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
* Adapter for providing mention categories and items to the mention picker.
|
|
14
|
-
*
|
|
15
|
-
* All methods are synchronous by design — the adapter drives UI display and
|
|
16
|
-
* must return data immediately. Use external state management (e.g. React
|
|
17
|
-
* Query, SWR, or local state) to handle async data fetching, then expose
|
|
18
|
-
* the loaded results synchronously through this adapter.
|
|
19
|
-
*/
|
|
20
|
-
export type Unstable_MentionAdapter = {
|
|
21
|
-
/** Return the top-level categories for the mention picker. */
|
|
22
|
-
categories(): readonly Unstable_MentionCategory[];
|
|
23
|
-
|
|
24
|
-
/** Return items within a category. */
|
|
25
|
-
categoryItems(categoryId: string): readonly Unstable_MentionItem[];
|
|
26
|
-
|
|
27
|
-
/** Global search across all categories (optional). */
|
|
28
|
-
search?(query: string): readonly Unstable_MentionItem[];
|
|
29
|
-
};
|
|
12
|
+
export type Unstable_MentionAdapter = Unstable_TriggerAdapter;
|
|
30
13
|
|
|
31
14
|
// =============================================================================
|
|
32
15
|
// Default Directive Formatter
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Unstable_TriggerCategory,
|
|
3
|
+
Unstable_TriggerItem,
|
|
4
|
+
} from "../types/trigger";
|
|
5
|
+
|
|
6
|
+
// =============================================================================
|
|
7
|
+
// Trigger Adapter — generic adapter for any trigger-based popover
|
|
8
|
+
// =============================================================================
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Adapter for providing categories and items to a trigger popover.
|
|
12
|
+
*
|
|
13
|
+
* All methods are synchronous by design — the adapter drives UI display and
|
|
14
|
+
* must return data immediately. Use external state management (e.g. React
|
|
15
|
+
* Query, SWR, or local state) to handle async data fetching, then expose
|
|
16
|
+
* the loaded results synchronously through this adapter.
|
|
17
|
+
*/
|
|
18
|
+
export type Unstable_TriggerAdapter = {
|
|
19
|
+
/** Return the top-level categories for the trigger popover. */
|
|
20
|
+
categories(): readonly Unstable_TriggerCategory[];
|
|
21
|
+
|
|
22
|
+
/** Return items within a category. */
|
|
23
|
+
categoryItems(categoryId: string): readonly Unstable_TriggerItem[];
|
|
24
|
+
|
|
25
|
+
/** Global search across all categories (optional). */
|
|
26
|
+
search?(query: string): readonly Unstable_TriggerItem[];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// =============================================================================
|
|
30
|
+
// Slash Command Item — extends TriggerItem with an execute callback
|
|
31
|
+
// =============================================================================
|
|
32
|
+
|
|
33
|
+
export type Unstable_SlashCommandItem = Unstable_TriggerItem & {
|
|
34
|
+
/** Action to execute when the command is selected. */
|
|
35
|
+
readonly execute?: (() => void) | undefined;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// =============================================================================
|
|
39
|
+
// Slash Command Adapter — extends TriggerAdapter with narrower return types
|
|
40
|
+
// so consumers get SlashCommandItem directly without casting.
|
|
41
|
+
// =============================================================================
|
|
42
|
+
|
|
43
|
+
export type Unstable_SlashCommandAdapter = Omit<
|
|
44
|
+
Unstable_TriggerAdapter,
|
|
45
|
+
"categoryItems" | "search"
|
|
46
|
+
> & {
|
|
47
|
+
/** Return commands within a category. */
|
|
48
|
+
categoryItems(categoryId: string): readonly Unstable_SlashCommandItem[];
|
|
49
|
+
|
|
50
|
+
/** Global search across all categories (optional). */
|
|
51
|
+
search?(query: string): readonly Unstable_SlashCommandItem[];
|
|
52
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -50,6 +50,15 @@ export type {
|
|
|
50
50
|
Unstable_DirectiveFormatter,
|
|
51
51
|
} from "./types/mention";
|
|
52
52
|
|
|
53
|
+
export type {
|
|
54
|
+
Unstable_TriggerItem,
|
|
55
|
+
Unstable_TriggerCategory,
|
|
56
|
+
} from "./types/trigger";
|
|
57
|
+
|
|
58
|
+
// === trigger adapter ===
|
|
59
|
+
|
|
60
|
+
export type { Unstable_TriggerAdapter } from "./adapters/trigger";
|
|
61
|
+
|
|
53
62
|
// === model-context ===
|
|
54
63
|
|
|
55
64
|
export type {
|
|
@@ -123,6 +132,12 @@ export type { SuggestionAdapter } from "./adapters/suggestion";
|
|
|
123
132
|
export type { Unstable_MentionAdapter } from "./adapters/mention";
|
|
124
133
|
export { unstable_defaultDirectiveFormatter } from "./adapters/mention";
|
|
125
134
|
|
|
135
|
+
// Slash command adapter
|
|
136
|
+
export type {
|
|
137
|
+
Unstable_SlashCommandAdapter,
|
|
138
|
+
Unstable_SlashCommandItem,
|
|
139
|
+
} from "./adapters/trigger";
|
|
140
|
+
|
|
126
141
|
// Thread history adapters
|
|
127
142
|
export type {
|
|
128
143
|
ThreadHistoryAdapter,
|
|
@@ -150,6 +165,8 @@ export type {
|
|
|
150
165
|
ComposerRuntimeCore,
|
|
151
166
|
ComposerRuntimeEventType,
|
|
152
167
|
DictationState,
|
|
168
|
+
EditComposerRuntimeCore,
|
|
169
|
+
SendOptions,
|
|
153
170
|
ThreadComposerRuntimeCore,
|
|
154
171
|
} from "./runtime/interfaces/composer-runtime-core";
|
|
155
172
|
|
|
@@ -2,6 +2,7 @@ import type { ThreadMessage } from "../../types/message";
|
|
|
2
2
|
import type { SubscribableWithState } from "../../subscribable/subscribable";
|
|
3
3
|
import type {
|
|
4
4
|
ComposerRuntimeCore,
|
|
5
|
+
EditComposerRuntimeCore,
|
|
5
6
|
ThreadComposerRuntimeCore,
|
|
6
7
|
} from "../interfaces/composer-runtime-core";
|
|
7
8
|
import type {
|
|
@@ -21,7 +22,7 @@ export type ThreadComposerRuntimeCoreBinding = SubscribableWithState<
|
|
|
21
22
|
>;
|
|
22
23
|
|
|
23
24
|
export type EditComposerRuntimeCoreBinding = SubscribableWithState<
|
|
24
|
-
|
|
25
|
+
EditComposerRuntimeCore | undefined,
|
|
25
26
|
ComposerRuntimePath & { composerSource: "edit" }
|
|
26
27
|
>;
|
|
27
28
|
|
|
@@ -12,9 +12,10 @@ import {
|
|
|
12
12
|
SKIP_UPDATE,
|
|
13
13
|
} from "../../subscribable/subscribable";
|
|
14
14
|
import type {
|
|
15
|
-
ComposerRuntimeCore,
|
|
16
15
|
ComposerRuntimeEventType,
|
|
17
16
|
DictationState,
|
|
17
|
+
EditComposerRuntimeCore,
|
|
18
|
+
SendOptions,
|
|
18
19
|
ThreadComposerRuntimeCore,
|
|
19
20
|
} from "../interfaces/composer-runtime-core";
|
|
20
21
|
import type {
|
|
@@ -68,6 +69,8 @@ export type ThreadComposerState = BaseComposerState & {
|
|
|
68
69
|
|
|
69
70
|
export type EditComposerState = BaseComposerState & {
|
|
70
71
|
readonly type: "edit";
|
|
72
|
+
readonly parentId: string | null;
|
|
73
|
+
readonly sourceId: string | null;
|
|
71
74
|
};
|
|
72
75
|
|
|
73
76
|
export type ComposerState = ThreadComposerState | EditComposerState;
|
|
@@ -97,7 +100,7 @@ const getThreadComposerState = (
|
|
|
97
100
|
};
|
|
98
101
|
|
|
99
102
|
const getEditComposerState = (
|
|
100
|
-
runtime:
|
|
103
|
+
runtime: EditComposerRuntimeCore | undefined,
|
|
101
104
|
): EditComposerState => {
|
|
102
105
|
return Object.freeze({
|
|
103
106
|
type: "edit",
|
|
@@ -114,6 +117,9 @@ const getEditComposerState = (
|
|
|
114
117
|
dictation: runtime?.dictation,
|
|
115
118
|
quote: runtime?.quote,
|
|
116
119
|
|
|
120
|
+
parentId: runtime?.parentId ?? null,
|
|
121
|
+
sourceId: runtime?.sourceId ?? null,
|
|
122
|
+
|
|
117
123
|
value: runtime?.text ?? "",
|
|
118
124
|
});
|
|
119
125
|
};
|
|
@@ -173,8 +179,9 @@ export type ComposerRuntime = {
|
|
|
173
179
|
|
|
174
180
|
/**
|
|
175
181
|
* Send a message. This will send whatever text or attachments are in the composer.
|
|
182
|
+
* @param options Optional send options. Use `{ startRun: true }` to force starting a new run.
|
|
176
183
|
*/
|
|
177
|
-
send(): void;
|
|
184
|
+
send(options?: SendOptions): void;
|
|
178
185
|
|
|
179
186
|
/**
|
|
180
187
|
* Cancel the current run. In edit mode, this will exit edit mode.
|
|
@@ -278,10 +285,10 @@ export abstract class ComposerRuntimeImpl implements ComposerRuntime {
|
|
|
278
285
|
return core.clearAttachments();
|
|
279
286
|
}
|
|
280
287
|
|
|
281
|
-
public send() {
|
|
288
|
+
public send(options?: SendOptions) {
|
|
282
289
|
const core = this._core.getState();
|
|
283
290
|
if (!core) throw new Error("Composer is not available");
|
|
284
|
-
core.send();
|
|
291
|
+
core.send(options);
|
|
285
292
|
}
|
|
286
293
|
|
|
287
294
|
public cancel() {
|
|
@@ -17,6 +17,7 @@ import type {
|
|
|
17
17
|
ComposerRuntimeCore,
|
|
18
18
|
ComposerRuntimeEventType,
|
|
19
19
|
DictationState,
|
|
20
|
+
SendOptions,
|
|
20
21
|
} from "../interfaces/composer-runtime-core";
|
|
21
22
|
import type { DictationAdapter } from "../../adapters/speech";
|
|
22
23
|
import { generateId } from "../../utils/id";
|
|
@@ -152,7 +153,7 @@ export abstract class BaseComposerRuntimeCore
|
|
|
152
153
|
await task;
|
|
153
154
|
}
|
|
154
155
|
|
|
155
|
-
public async send() {
|
|
156
|
+
public async send(options?: SendOptions) {
|
|
156
157
|
if (this.isEmpty) return;
|
|
157
158
|
|
|
158
159
|
if (this._dictationSession) {
|
|
@@ -187,7 +188,7 @@ export abstract class BaseComposerRuntimeCore
|
|
|
187
188
|
metadata: { custom: { ...(quote ? { quote } : {}) } },
|
|
188
189
|
};
|
|
189
190
|
|
|
190
|
-
this.handleSend(message);
|
|
191
|
+
this.handleSend(message, options);
|
|
191
192
|
this._notifyEventSubscribers("send");
|
|
192
193
|
}
|
|
193
194
|
|
|
@@ -197,6 +198,7 @@ export abstract class BaseComposerRuntimeCore
|
|
|
197
198
|
|
|
198
199
|
protected abstract handleSend(
|
|
199
200
|
message: Omit<AppendMessage, "parentId" | "sourceId">,
|
|
201
|
+
options?: SendOptions,
|
|
200
202
|
): void;
|
|
201
203
|
protected abstract handleCancel(): void;
|
|
202
204
|
|
|
@@ -2,6 +2,7 @@ import type { AppendMessage, ThreadMessage } from "../../types/message";
|
|
|
2
2
|
import { getThreadMessageText } from "../../utils/text";
|
|
3
3
|
import type { AttachmentAdapter } from "../../adapters/attachment";
|
|
4
4
|
import type { DictationAdapter } from "../../adapters/speech";
|
|
5
|
+
import type { SendOptions } from "../interfaces/composer-runtime-core";
|
|
5
6
|
import type { ThreadRuntimeCore } from "../interfaces/thread-runtime-core";
|
|
6
7
|
import { BaseComposerRuntimeCore } from "./base-composer-runtime-core";
|
|
7
8
|
|
|
@@ -20,8 +21,8 @@ export class DefaultEditComposerRuntimeCore extends BaseComposerRuntimeCore {
|
|
|
20
21
|
|
|
21
22
|
private _nonTextParts;
|
|
22
23
|
private _previousText;
|
|
23
|
-
private _parentId;
|
|
24
|
-
private _sourceId;
|
|
24
|
+
private _parentId: string | null;
|
|
25
|
+
private _sourceId: string | null;
|
|
25
26
|
constructor(
|
|
26
27
|
private runtime: ThreadRuntimeCore & {
|
|
27
28
|
adapters?:
|
|
@@ -48,16 +49,26 @@ export class DefaultEditComposerRuntimeCore extends BaseComposerRuntimeCore {
|
|
|
48
49
|
this.setRunConfig({ ...runtime.composer.runConfig });
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
public get parentId() {
|
|
53
|
+
return this._parentId;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public get sourceId() {
|
|
57
|
+
return this._sourceId;
|
|
58
|
+
}
|
|
59
|
+
|
|
51
60
|
public async handleSend(
|
|
52
61
|
message: Omit<AppendMessage, "parentId" | "sourceId">,
|
|
62
|
+
options?: SendOptions,
|
|
53
63
|
) {
|
|
54
64
|
const text = getThreadMessageText(message as AppendMessage);
|
|
55
|
-
if (text !== this._previousText) {
|
|
65
|
+
if (text !== this._previousText || options?.startRun) {
|
|
56
66
|
this.runtime.append({
|
|
57
67
|
...message,
|
|
58
68
|
content: [...message.content, ...this._nonTextParts] as any,
|
|
59
69
|
parentId: this._parentId,
|
|
60
70
|
sourceId: this._sourceId,
|
|
71
|
+
startRun: options?.startRun,
|
|
61
72
|
});
|
|
62
73
|
}
|
|
63
74
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { AppendMessage } from "../../types/message";
|
|
2
2
|
import type { AttachmentAdapter } from "../../adapters/attachment";
|
|
3
3
|
import type { DictationAdapter } from "../../adapters/speech";
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
SendOptions,
|
|
6
|
+
ThreadComposerRuntimeCore,
|
|
7
|
+
} from "../interfaces/composer-runtime-core";
|
|
5
8
|
import type { ThreadRuntimeCore } from "../interfaces/thread-runtime-core";
|
|
6
9
|
import { BaseComposerRuntimeCore } from "./base-composer-runtime-core";
|
|
7
10
|
|
|
@@ -47,11 +50,13 @@ export class DefaultThreadComposerRuntimeCore
|
|
|
47
50
|
|
|
48
51
|
public async handleSend(
|
|
49
52
|
message: Omit<AppendMessage, "parentId" | "sourceId">,
|
|
53
|
+
options?: SendOptions,
|
|
50
54
|
) {
|
|
51
55
|
this.runtime.append({
|
|
52
56
|
...(message as AppendMessage),
|
|
53
57
|
parentId: this.runtime.messages.at(-1)?.id ?? null,
|
|
54
58
|
sourceId: null,
|
|
59
|
+
startRun: options?.startRun,
|
|
55
60
|
});
|
|
56
61
|
}
|
|
57
62
|
|
|
@@ -16,6 +16,10 @@ export type DictationState = {
|
|
|
16
16
|
readonly inputDisabled?: boolean;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
export type SendOptions = {
|
|
20
|
+
startRun?: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
19
23
|
export type ComposerRuntimeCore = Readonly<{
|
|
20
24
|
isEditing: boolean;
|
|
21
25
|
|
|
@@ -43,7 +47,7 @@ export type ComposerRuntimeCore = Readonly<{
|
|
|
43
47
|
reset: () => Promise<void>;
|
|
44
48
|
clearAttachments: () => Promise<void>;
|
|
45
49
|
|
|
46
|
-
send: () => void;
|
|
50
|
+
send: (options?: SendOptions) => void;
|
|
47
51
|
cancel: () => void;
|
|
48
52
|
|
|
49
53
|
dictation: DictationState | undefined;
|
|
@@ -59,3 +63,9 @@ export type ComposerRuntimeCore = Readonly<{
|
|
|
59
63
|
}>;
|
|
60
64
|
|
|
61
65
|
export type ThreadComposerRuntimeCore = ComposerRuntimeCore;
|
|
66
|
+
|
|
67
|
+
export type EditComposerRuntimeCore = ComposerRuntimeCore &
|
|
68
|
+
Readonly<{
|
|
69
|
+
parentId: string | null;
|
|
70
|
+
sourceId: string | null;
|
|
71
|
+
}>;
|