@stll/chat 0.1.39 → 0.2.0
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/README.md +9 -0
- package/dist/.bun/install/cache/links/@tanstack_ai-event-client@0.13.1-c12313b8e0f930fe/node_modules/@tanstack/ai-event-client/dist/esm/envelope.d.ts +5 -0
- package/dist/.bun/install/cache/links/@tanstack_ai-event-client@0.13.1-c12313b8e0f930fe/node_modules/@tanstack/ai-event-client/dist/esm/index.d.ts +141 -0
- package/dist/.bun/install/cache/links/@tanstack_devtools-event-client@0.4.4-93caf0d86e8c814b/node_modules/@tanstack/devtools-event-client/dist/esm/index.d.ts +1 -0
- package/dist/.bun/install/cache/links/@tanstack_devtools-event-client@0.4.4-93caf0d86e8c814b/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.d.ts +5 -0
- package/dist/durable-transport.d.ts +68 -0
- package/dist/durable-transport.js +239 -0
- package/dist/link-detection.d.ts +14 -0
- package/dist/link-detection.js +68 -0
- package/dist/link-editor.d.ts +5 -0
- package/dist/link-editor.js +84 -0
- package/dist/link-markdown.d.ts +5 -0
- package/dist/link-markdown.js +58 -0
- package/dist/link.d.ts +20 -0
- package/dist/link.js +104 -0
- package/dist/resume-contract.d.ts +32 -0
- package/dist/resume-contract.js +30 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/activity-records.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/adapter.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/agent-loop-strategies.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/agents/define-agent.d.ts +4 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/agents/route.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/agents/spawn.d.ts +6 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/agents/turn.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/cancel.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/index.d.ts +9 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/mcp/manager.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/mcp/types.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/messages.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/builder.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/compose.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/define.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/generic-interrupts.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/index.d.ts +8 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/locks.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/run-store.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/types.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/validate.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/runtime-context-types.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/index.d.ts +4 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/processor.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/strategies.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/types.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/approval-schema.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/lazy-tool-manager.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/lazy-tools.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/schema-converter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/tool-calls.d.ts +5 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/tool-definition.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/unique-tool-names.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/embed/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/embed/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/evaluate/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/evaluate/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/files/index.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateAudio/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateAudio/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateImage/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateImage/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateLiveVideo/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateLiveVideo/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateSpeech/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateSpeech/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateTranscription/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateTranscription/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateVideo/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateVideo/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateVideo/snap.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateVoice/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateVoice/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateWorld/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateWorld/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/index.d.ts +32 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/middleware/index.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/middleware/run.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/middleware/types.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/rerank/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/rerank/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/summarize/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/summarize/chat-stream-summarize.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/summarize/index.d.ts +4 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/client.d.ts +23 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/custom-events.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/extend-adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/generic-interrupt-continuation.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/index.d.ts +66 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/interrupt-definition.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/interrupt-resume.d.ts +4 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/interrupts.d.ts +30 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/realtime/event-emitter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/realtime/index.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/realtime/types.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/stream-durability.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/stream-to-response.d.ts +4 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/stream-to-websocket.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/tool-registry.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/tools/provider-tool.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/types.d.ts +539 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/adapter-yield-chunk.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/ag-ui-usage.d.ts +8 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/ag-ui-wire.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/chat-params.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/chunk-ids.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/content-source.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/embedding-input.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/errors.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/media-prompt.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/merge-metadata.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/normalize-stream-chunk.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/provider-executed.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/restore-inbound-chunk.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/subagent-wire.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/tool-result.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/usage.d.ts +1 -0
- package/package.json +53 -9
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { detectChatLinks } from "./link-detection.js";
|
|
2
|
+
import { CHAT_LINK_ATTRIBUTES } from "./link.js";
|
|
3
|
+
//#region src/link-markdown.ts
|
|
4
|
+
const SKIPPED_ELEMENTS = /* @__PURE__ */ new Set([
|
|
5
|
+
"a",
|
|
6
|
+
"code",
|
|
7
|
+
"pre",
|
|
8
|
+
"stll-anon"
|
|
9
|
+
]);
|
|
10
|
+
/** Run after sanitization and source-offset anchoring; existing links keep their renderer contract. */
|
|
11
|
+
const rehypeChatLinks = () => (tree) => {
|
|
12
|
+
const visit = (parent) => {
|
|
13
|
+
if (parent.type === "element" && SKIPPED_ELEMENTS.has(parent.tagName)) return;
|
|
14
|
+
const children = [];
|
|
15
|
+
for (const child of parent.children) {
|
|
16
|
+
if (child.type === "element") visit(child);
|
|
17
|
+
if (child.type !== "text") {
|
|
18
|
+
children.push(child);
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const links = detectChatLinks(child.value);
|
|
22
|
+
if (!links.length) {
|
|
23
|
+
children.push(child);
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
let offset = 0;
|
|
27
|
+
for (const link of links) {
|
|
28
|
+
if (link.start > offset) children.push({
|
|
29
|
+
type: "text",
|
|
30
|
+
value: child.value.slice(offset, link.start)
|
|
31
|
+
});
|
|
32
|
+
children.push({
|
|
33
|
+
type: "element",
|
|
34
|
+
tagName: "a",
|
|
35
|
+
properties: {
|
|
36
|
+
href: link.href,
|
|
37
|
+
target: CHAT_LINK_ATTRIBUTES.target,
|
|
38
|
+
rel: CHAT_LINK_ATTRIBUTES.rel.split(" ")
|
|
39
|
+
},
|
|
40
|
+
children: [{
|
|
41
|
+
type: "text",
|
|
42
|
+
value: link.text
|
|
43
|
+
}]
|
|
44
|
+
});
|
|
45
|
+
offset = link.end;
|
|
46
|
+
}
|
|
47
|
+
if (offset < child.value.length) children.push({
|
|
48
|
+
type: "text",
|
|
49
|
+
value: child.value.slice(offset)
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (parent.type === "root") parent.children = children;
|
|
53
|
+
else parent.children = children.filter((child) => child.type !== "doctype");
|
|
54
|
+
};
|
|
55
|
+
visit(tree);
|
|
56
|
+
};
|
|
57
|
+
//#endregion
|
|
58
|
+
export { rehypeChatLinks };
|
package/dist/link.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes } from "react";
|
|
2
|
+
//#region src/link.d.ts
|
|
3
|
+
export declare const CHAT_LINK_ATTRIBUTES: {
|
|
4
|
+
readonly target: "_blank";
|
|
5
|
+
readonly rel: "noopener noreferrer";
|
|
6
|
+
};
|
|
7
|
+
export declare const CHAT_LINK_CLASS_NAME = "text-foreground decoration-border hover:decoration-foreground rounded-xs underline underline-offset-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring";
|
|
8
|
+
export declare const hasBundledChatLinkIcon: (hostname: string) => boolean;
|
|
9
|
+
export type ChatLinkIconSource = {
|
|
10
|
+
type: "proxy";
|
|
11
|
+
src: string;
|
|
12
|
+
};
|
|
13
|
+
type ChatLinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href" | "target" | "rel" | "className"> & {
|
|
14
|
+
href: string;
|
|
15
|
+
appearance?: "inline" | "tray";
|
|
16
|
+
iconSource?: ChatLinkIconSource | undefined;
|
|
17
|
+
newTabLabel?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const ChatLink: ({ appearance, children, href, iconSource, newTabLabel, title, ...anchorProps }: ChatLinkProps) => import("react").JSX.Element;
|
|
20
|
+
//#endregion
|
package/dist/link.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { normalizeChatLink } from "./link-detection.js";
|
|
2
|
+
import { GlobeIcon } from "@stll/ui/icons";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { isValidElement, useState } from "react";
|
|
5
|
+
import { GitHubLogoIcon, XLogoIcon } from "@stll/ui/brand-icons";
|
|
6
|
+
//#region src/link.tsx
|
|
7
|
+
const CHAT_LINK_ATTRIBUTES = {
|
|
8
|
+
target: "_blank",
|
|
9
|
+
rel: "noopener noreferrer"
|
|
10
|
+
};
|
|
11
|
+
const CHAT_LINK_CLASS_NAME = "text-foreground decoration-border hover:decoration-foreground rounded-xs underline underline-offset-2 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring";
|
|
12
|
+
const linkText = (node) => {
|
|
13
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
14
|
+
if (Array.isArray(node)) return node.map(linkText).join("");
|
|
15
|
+
if (isValidElement(node)) return linkText(node.props.children);
|
|
16
|
+
return "";
|
|
17
|
+
};
|
|
18
|
+
const ProxyIcon = ({ src }) => {
|
|
19
|
+
const [failed, setFailed] = useState(false);
|
|
20
|
+
if (failed || !src.startsWith("blob:")) return /* @__PURE__ */ jsx(GlobeIcon, {
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
className: "size-[1em]"
|
|
23
|
+
});
|
|
24
|
+
return /* @__PURE__ */ jsx("img", {
|
|
25
|
+
alt: "",
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
className: "size-[1em] object-contain",
|
|
28
|
+
onError: () => setFailed(true),
|
|
29
|
+
src
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const GITHUB_LINK_ICON = /* @__PURE__ */ jsx(GitHubLogoIcon, {
|
|
33
|
+
"aria-hidden": "true",
|
|
34
|
+
className: "size-[1em]"
|
|
35
|
+
});
|
|
36
|
+
const X_LINK_ICON = /* @__PURE__ */ jsx(XLogoIcon, {
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
className: "size-[1em]"
|
|
39
|
+
});
|
|
40
|
+
const BUNDLED_ICONS = /* @__PURE__ */ new Map([
|
|
41
|
+
["github.com", GITHUB_LINK_ICON],
|
|
42
|
+
["www.github.com", GITHUB_LINK_ICON],
|
|
43
|
+
["x.com", X_LINK_ICON],
|
|
44
|
+
["www.x.com", X_LINK_ICON],
|
|
45
|
+
["twitter.com", X_LINK_ICON],
|
|
46
|
+
["www.twitter.com", X_LINK_ICON]
|
|
47
|
+
]);
|
|
48
|
+
const hasBundledChatLinkIcon = (hostname) => BUNDLED_ICONS.has(hostname);
|
|
49
|
+
const ChatLink = ({ appearance = "inline", children, href, iconSource, newTabLabel, title, ...anchorProps }) => {
|
|
50
|
+
const className = appearance === "tray" ? "bg-muted/50 hover:bg-muted inline-flex shrink-0 items-center gap-1 rounded-md border px-1.5 py-0.5 text-xs focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring" : CHAT_LINK_CLASS_NAME;
|
|
51
|
+
const labelClassName = appearance === "tray" ? "max-w-[20ch] truncate" : void 0;
|
|
52
|
+
const target = normalizeChatLink(href);
|
|
53
|
+
if (!target) {
|
|
54
|
+
const parsed = URL.canParse(href) ? new URL(href) : null;
|
|
55
|
+
const safeLocal = href.startsWith("#") || /^(?:\/(?![\\/])|\.{1,2}\/)/u.test(href);
|
|
56
|
+
const safeMail = parsed?.protocol === "mailto:";
|
|
57
|
+
if (!safeLocal && !safeMail || /[\p{Cc}\p{Cf}]/u.test(href)) return appearance === "tray" ? /* @__PURE__ */ jsx("span", {
|
|
58
|
+
className,
|
|
59
|
+
children: /* @__PURE__ */ jsx("bdi", {
|
|
60
|
+
className: labelClassName,
|
|
61
|
+
children: children ?? href
|
|
62
|
+
})
|
|
63
|
+
}) : /* @__PURE__ */ jsx("span", { children: children ?? href });
|
|
64
|
+
return /* @__PURE__ */ jsx("a", {
|
|
65
|
+
...anchorProps,
|
|
66
|
+
title: newTabLabel ?? title,
|
|
67
|
+
className,
|
|
68
|
+
href,
|
|
69
|
+
target: CHAT_LINK_ATTRIBUTES.target,
|
|
70
|
+
rel: CHAT_LINK_ATTRIBUTES.rel,
|
|
71
|
+
children: /* @__PURE__ */ jsx("bdi", {
|
|
72
|
+
className: labelClassName,
|
|
73
|
+
children: children ?? href
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
const text = linkText(children).trim();
|
|
78
|
+
const label = text && normalizeChatLink(text) === null ? children : target.hostname.replace(/^www\./u, "");
|
|
79
|
+
let icon = /* @__PURE__ */ jsx(GlobeIcon, {
|
|
80
|
+
"aria-hidden": "true",
|
|
81
|
+
className: "size-[1em]"
|
|
82
|
+
});
|
|
83
|
+
const bundledIcon = BUNDLED_ICONS.get(target.hostname);
|
|
84
|
+
if (iconSource) icon = /* @__PURE__ */ jsx(ProxyIcon, { src: iconSource.src }, iconSource.src);
|
|
85
|
+
else if (bundledIcon) icon = bundledIcon;
|
|
86
|
+
return /* @__PURE__ */ jsxs("a", {
|
|
87
|
+
...anchorProps,
|
|
88
|
+
title: newTabLabel ?? title,
|
|
89
|
+
className,
|
|
90
|
+
href: target.href,
|
|
91
|
+
target: CHAT_LINK_ATTRIBUTES.target,
|
|
92
|
+
rel: CHAT_LINK_ATTRIBUTES.rel,
|
|
93
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
94
|
+
"aria-hidden": "true",
|
|
95
|
+
className: appearance === "tray" ? "inline-block shrink-0" : "me-1 inline-block align-[-0.125em]",
|
|
96
|
+
children: icon
|
|
97
|
+
}), /* @__PURE__ */ jsx("bdi", {
|
|
98
|
+
className: labelClassName,
|
|
99
|
+
children: label
|
|
100
|
+
})]
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
//#endregion
|
|
104
|
+
export { CHAT_LINK_ATTRIBUTES, CHAT_LINK_CLASS_NAME, ChatLink, hasBundledChatLinkIcon };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Interrupt } from "@ag-ui/core";
|
|
2
|
+
import * as v from "valibot";
|
|
3
|
+
//#region src/resume-contract.d.ts
|
|
4
|
+
/** Keep native interrupt validation tied to the protocol's owning schema. */
|
|
5
|
+
export declare const chatResumeSnapshotSchema: v.ObjectSchema<{
|
|
6
|
+
readonly resumeState: v.ObjectSchema<{
|
|
7
|
+
readonly threadId: v.StringSchema<undefined>;
|
|
8
|
+
readonly runId: v.StringSchema<undefined>;
|
|
9
|
+
}, undefined>;
|
|
10
|
+
readonly pendingInterrupts: v.ExactOptionalSchema<v.ArraySchema<v.CustomSchema<Interrupt, undefined>, undefined>, undefined>;
|
|
11
|
+
}, undefined>;
|
|
12
|
+
/** Server truth for reconnecting readers; no local pointer establishes ownership. */
|
|
13
|
+
export declare const chatTurnResumeProbeSchema: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
14
|
+
readonly type: v.LiteralSchema<"preparing", undefined>;
|
|
15
|
+
readonly turnId: v.StringSchema<undefined>;
|
|
16
|
+
}, undefined>, v.ObjectSchema<{
|
|
17
|
+
readonly type: v.LiteralSchema<"running", undefined>;
|
|
18
|
+
readonly turnId: v.StringSchema<undefined>;
|
|
19
|
+
readonly runId: v.StringSchema<undefined>;
|
|
20
|
+
}, undefined>, v.ObjectSchema<{
|
|
21
|
+
readonly type: v.LiteralSchema<"transcript", undefined>;
|
|
22
|
+
readonly turnId: v.StringSchema<undefined>;
|
|
23
|
+
readonly resumeSnapshot: v.ExactOptionalSchema<v.ObjectSchema<{
|
|
24
|
+
readonly resumeState: v.ObjectSchema<{
|
|
25
|
+
readonly threadId: v.StringSchema<undefined>;
|
|
26
|
+
readonly runId: v.StringSchema<undefined>;
|
|
27
|
+
}, undefined>;
|
|
28
|
+
readonly pendingInterrupts: v.ExactOptionalSchema<v.ArraySchema<v.CustomSchema<Interrupt, undefined>, undefined>, undefined>;
|
|
29
|
+
}, undefined>, undefined>;
|
|
30
|
+
}, undefined>], undefined>;
|
|
31
|
+
export type ChatTurnResumeProbe = v.InferOutput<typeof chatTurnResumeProbeSchema>;
|
|
32
|
+
//#endregion
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { InterruptSchema } from "@ag-ui/core/schemas";
|
|
3
|
+
//#region src/resume-contract.ts
|
|
4
|
+
/** Keep native interrupt validation tied to the protocol's owning schema. */
|
|
5
|
+
const chatResumeSnapshotSchema = v.object({
|
|
6
|
+
resumeState: v.object({
|
|
7
|
+
threadId: v.string(),
|
|
8
|
+
runId: v.string()
|
|
9
|
+
}),
|
|
10
|
+
pendingInterrupts: v.exactOptional(v.array(v.custom((value) => InterruptSchema.safeParse(value).success)))
|
|
11
|
+
});
|
|
12
|
+
/** Server truth for reconnecting readers; no local pointer establishes ownership. */
|
|
13
|
+
const chatTurnResumeProbeSchema = v.variant("type", [
|
|
14
|
+
v.object({
|
|
15
|
+
type: v.literal("preparing"),
|
|
16
|
+
turnId: v.string()
|
|
17
|
+
}),
|
|
18
|
+
v.object({
|
|
19
|
+
type: v.literal("running"),
|
|
20
|
+
turnId: v.string(),
|
|
21
|
+
runId: v.string()
|
|
22
|
+
}),
|
|
23
|
+
v.object({
|
|
24
|
+
type: v.literal("transcript"),
|
|
25
|
+
turnId: v.string(),
|
|
26
|
+
resumeSnapshot: v.exactOptional(chatResumeSnapshotSchema)
|
|
27
|
+
})
|
|
28
|
+
]);
|
|
29
|
+
//#endregion
|
|
30
|
+
export { chatResumeSnapshotSchema, chatTurnResumeProbeSchema };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./middleware/run-store.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "../../types.js";
|
|
2
|
+
import "./adapter.js";
|
|
3
|
+
import "../../interrupt-definition.js";
|
|
4
|
+
import "./agents/define-agent.js";
|
|
5
|
+
import "./middleware/types.js";
|
|
6
|
+
import "./agents/spawn.js";
|
|
7
|
+
import "./middleware/builder.js";
|
|
8
|
+
import "./runtime-context-types.js";
|
|
9
|
+
import "./mcp/types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../tools/tool-definition.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../../interrupt-definition.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./middleware/types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { ToolCallState, ToolResultState } from "../../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./adapter.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import "./chat/adapter.js";
|
|
2
|
+
import "./summarize/adapter.js";
|
|
3
|
+
import "./generateImage/adapter.js";
|
|
4
|
+
import "./generateAudio/adapter.js";
|
|
5
|
+
import "./generateVideo/adapter.js";
|
|
6
|
+
import "./generateSpeech/adapter.js";
|
|
7
|
+
import "./generateVoice/adapter.js";
|
|
8
|
+
import "./generateTranscription/adapter.js";
|
|
9
|
+
import "./embed/adapter.js";
|
|
10
|
+
import "./rerank/adapter.js";
|
|
11
|
+
import "./evaluate/adapter.js";
|
|
12
|
+
import "./generateWorld/adapter.js";
|
|
13
|
+
import "./generateLiveVideo/adapter.js";
|
|
14
|
+
import "./chat/agents/define-agent.js";
|
|
15
|
+
import "./chat/agents/spawn.js";
|
|
16
|
+
import "./chat/index.js";
|
|
17
|
+
import "./evaluate/index.js";
|
|
18
|
+
import "./chat/agents/route.js";
|
|
19
|
+
import "./summarize/chat-stream-summarize.js";
|
|
20
|
+
import "./summarize/index.js";
|
|
21
|
+
import "./rerank/index.js";
|
|
22
|
+
import "./generateImage/index.js";
|
|
23
|
+
import "./generateAudio/index.js";
|
|
24
|
+
import "./generateVideo/index.js";
|
|
25
|
+
import "./generateVideo/snap.js";
|
|
26
|
+
import "./generateSpeech/index.js";
|
|
27
|
+
import "./generateVoice/index.js";
|
|
28
|
+
import "./generateTranscription/index.js";
|
|
29
|
+
import "./embed/index.js";
|
|
30
|
+
import "./generateWorld/index.js";
|
|
31
|
+
import "./generateLiveVideo/index.js";
|
|
32
|
+
import "./files/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../types.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BatchInterruptError, BatchInterruptErrorCode, InterruptCorrelation, InterruptSubmissionError, ItemInterruptError, ItemInterruptErrorCode } from "./interrupts.js";
|
|
2
|
+
import { SpecTokenUsage } from "./utilities/ag-ui-usage.js";
|
|
3
|
+
import { ActivityPart, AudioPart as AudioPart$1, ContentPart, CustomEvent as CustomEvent$1, DocumentPart as DocumentPart$1, ImagePart as ImagePart$1, MessagePart, ModelMessage, RunErrorEvent as RunErrorEvent$1, RunFinishedEvent as RunFinishedEvent$1, StructuredOutputPart, SubagentHandleData, SubagentStatus, TanStackRunMetadata, TextPart, ThinkingPart, ToolCall as ToolCall$1, ToolCallPart, ToolCallState, ToolResultOutcome, ToolResultPart, ToolResultState, UIMessage, UIResourcePart, VideoPart as VideoPart$1 } from "./types.js";
|
|
4
|
+
import "./utilities/adapter-yield-chunk.js";
|
|
5
|
+
import "./interrupt-definition.js";
|
|
6
|
+
import "./activities/chat/tools/tool-definition.js";
|
|
7
|
+
import "./activities/chat/agents/define-agent.js";
|
|
8
|
+
import "./activities/chat/agents/spawn.js";
|
|
9
|
+
import "./activities/chat/agents/route.js";
|
|
10
|
+
import "./activities/files/index.js";
|
|
11
|
+
import "./activities/chat/tools/approval-schema.js";
|
|
12
|
+
import "./interrupt-resume.js";
|
|
13
|
+
import "./activities/chat/tools/schema-converter.js";
|
|
14
|
+
import "./generic-interrupt-continuation.js";
|
|
15
|
+
import "./realtime/types.js";
|
|
16
|
+
import "./activities/chat/messages.js";
|
|
17
|
+
import "./activities/chat/stream/index.js";
|
|
18
|
+
import "./utilities/merge-metadata.js";
|
|
19
|
+
import "./utilities/ag-ui-wire.js";
|
|
20
|
+
import "./utilities/normalize-stream-chunk.js";
|
|
21
|
+
import "./utilities/restore-inbound-chunk.js";
|
|
22
|
+
import "./utilities/chunk-ids.js";
|
|
23
|
+
import "@ag-ui/core";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./types.js";
|