conversationalist 0.0.3 → 0.0.5
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 +140 -21
- package/dist/history.d.ts +7 -1
- package/dist/history.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3771 -47
- package/dist/index.js.map +49 -5
- package/dist/utilities.d.ts +75 -1
- package/dist/utilities.d.ts.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -218,6 +218,108 @@ const boundTruncate = history.bind(truncateToTokenLimit);
|
|
|
218
218
|
boundTruncate(4000); // Uses tiktokenEstimator automatically
|
|
219
219
|
```
|
|
220
220
|
|
|
221
|
+
### Markdown Conversion
|
|
222
|
+
|
|
223
|
+
Convert conversations to human-readable Markdown format, or parse Markdown back into a conversation object.
|
|
224
|
+
|
|
225
|
+
#### Basic Usage (Clean Markdown)
|
|
226
|
+
|
|
227
|
+
By default, `toMarkdown` produces clean, readable Markdown without metadata:
|
|
228
|
+
|
|
229
|
+
```ts
|
|
230
|
+
import {
|
|
231
|
+
toMarkdown,
|
|
232
|
+
fromMarkdown,
|
|
233
|
+
createConversation,
|
|
234
|
+
appendMessages,
|
|
235
|
+
} from 'conversationalist';
|
|
236
|
+
|
|
237
|
+
let conversation = createConversation({ id: 'conv-1' });
|
|
238
|
+
conversation = appendMessages(
|
|
239
|
+
conversation,
|
|
240
|
+
{ role: 'user', content: 'What is 2 + 2?' },
|
|
241
|
+
{ role: 'assistant', content: 'The answer is 4.' },
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
const markdown = toMarkdown(conversation);
|
|
245
|
+
// Output:
|
|
246
|
+
// ### User
|
|
247
|
+
//
|
|
248
|
+
// What is 2 + 2?
|
|
249
|
+
//
|
|
250
|
+
// ### Assistant
|
|
251
|
+
//
|
|
252
|
+
// The answer is 4.
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
When parsing simple Markdown without metadata, `fromMarkdown` generates new IDs and uses sensible defaults:
|
|
256
|
+
|
|
257
|
+
```ts
|
|
258
|
+
const parsed = fromMarkdown(markdown);
|
|
259
|
+
// parsed.id is a new generated ID
|
|
260
|
+
// parsed.status is 'active'
|
|
261
|
+
// Message IDs are generated, positions are assigned sequentially
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
#### Lossless Round-Trip (with Metadata)
|
|
265
|
+
|
|
266
|
+
For archiving or backup scenarios where you need to preserve all data, use `{ includeMetadata: true }`:
|
|
267
|
+
|
|
268
|
+
```ts
|
|
269
|
+
const markdown = toMarkdown(conversation, { includeMetadata: true });
|
|
270
|
+
// Output includes YAML frontmatter with all metadata keyed by message ID:
|
|
271
|
+
// ---
|
|
272
|
+
// id: conv-1
|
|
273
|
+
// status: active
|
|
274
|
+
// metadata: {}
|
|
275
|
+
// tags: []
|
|
276
|
+
// createdAt: '2024-01-15T10:00:00.000Z'
|
|
277
|
+
// updatedAt: '2024-01-15T10:01:00.000Z'
|
|
278
|
+
// messages:
|
|
279
|
+
// msg-1:
|
|
280
|
+
// position: 0
|
|
281
|
+
// createdAt: '2024-01-15T10:00:00.000Z'
|
|
282
|
+
// metadata: {}
|
|
283
|
+
// hidden: false
|
|
284
|
+
// msg-2:
|
|
285
|
+
// position: 1
|
|
286
|
+
// createdAt: '2024-01-15T10:01:00.000Z'
|
|
287
|
+
// metadata: {}
|
|
288
|
+
// hidden: false
|
|
289
|
+
// ---
|
|
290
|
+
// ### User (msg-1)
|
|
291
|
+
//
|
|
292
|
+
// What is 2 + 2?
|
|
293
|
+
//
|
|
294
|
+
// ### Assistant (msg-2)
|
|
295
|
+
//
|
|
296
|
+
// The answer is 4.
|
|
297
|
+
|
|
298
|
+
// Parse back with all metadata preserved
|
|
299
|
+
const restored = fromMarkdown(markdown);
|
|
300
|
+
// restored.id === 'conv-1'
|
|
301
|
+
// restored.messages[0].id === 'msg-1'
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
#### Multi-Modal Content
|
|
305
|
+
|
|
306
|
+
Both functions handle multi-modal content. Images render as Markdown images, and with metadata enabled, additional properties like `mimeType` are preserved in the YAML frontmatter:
|
|
307
|
+
|
|
308
|
+
```ts
|
|
309
|
+
conversation = appendMessages(conversation, {
|
|
310
|
+
role: 'user',
|
|
311
|
+
content: [
|
|
312
|
+
{ type: 'text', text: 'Describe this:' },
|
|
313
|
+
{ type: 'image', url: 'https://example.com/photo.png', mimeType: 'image/png' },
|
|
314
|
+
],
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
const md = toMarkdown(conversation);
|
|
318
|
+
// Describe this:
|
|
319
|
+
//
|
|
320
|
+
// 
|
|
321
|
+
```
|
|
322
|
+
|
|
221
323
|
## Plugins
|
|
222
324
|
|
|
223
325
|
**Conversationalist** supports a plugin system that allows you to transform messages as they are appended to a conversation. Plugins are functions that take a `MessageInput` and return a modified `MessageInput`.
|
|
@@ -409,14 +511,11 @@ const conversation = pipeConversation(
|
|
|
409
511
|
|
|
410
512
|
Use the `ConversationHistory` class to manage a stack of conversation states. Because every change returns a new immutable object, supporting undo/redo is built into the architecture.
|
|
411
513
|
|
|
412
|
-
|
|
413
|
-
import {
|
|
414
|
-
ConversationHistory,
|
|
415
|
-
createConversation,
|
|
416
|
-
appendUserMessage,
|
|
417
|
-
} from 'conversationalist';
|
|
514
|
+
```ts
|
|
515
|
+
import { ConversationHistory } from 'conversationalist';
|
|
418
516
|
|
|
419
|
-
|
|
517
|
+
// Create a new history (defaults to an empty conversation)
|
|
518
|
+
const history = new ConversationHistory();
|
|
420
519
|
|
|
421
520
|
// You can use convenience methods that automatically track state
|
|
422
521
|
history.appendUserMessage('Hello!');
|
|
@@ -443,7 +542,7 @@ const tokens = history.estimateTokens();
|
|
|
443
542
|
#### Using DOM Events
|
|
444
543
|
|
|
445
544
|
```ts
|
|
446
|
-
const history = new ConversationHistory(
|
|
545
|
+
const history = new ConversationHistory();
|
|
447
546
|
|
|
448
547
|
// addEventListener returns a convenient unsubscribe function
|
|
449
548
|
const unsubscribe = history.addEventListener('change', (event) => {
|
|
@@ -480,12 +579,12 @@ controller.abort();
|
|
|
480
579
|
The `ConversationHistory` class supports branching. When you undo to a previous state and push a new update, it creates an alternate path instead of deleting the old history.
|
|
481
580
|
|
|
482
581
|
```ts
|
|
483
|
-
const history = new ConversationHistory(
|
|
582
|
+
const history = new ConversationHistory();
|
|
484
583
|
|
|
485
|
-
history.
|
|
584
|
+
history.appendUserMessage('Path A');
|
|
486
585
|
history.undo();
|
|
487
586
|
|
|
488
|
-
history.
|
|
587
|
+
history.appendUserMessage('Path B');
|
|
489
588
|
|
|
490
589
|
console.log(history.branchCount); // 2
|
|
491
590
|
console.log(history.current.messages[0].content); // "Path B"
|
|
@@ -512,6 +611,28 @@ const restoredWithEnv = ConversationHistory.from(json, {
|
|
|
512
611
|
});
|
|
513
612
|
```
|
|
514
613
|
|
|
614
|
+
### Markdown Serialization
|
|
615
|
+
|
|
616
|
+
You can also convert a conversation to Markdown format for human-readable storage or export, and restore it later.
|
|
617
|
+
|
|
618
|
+
```ts
|
|
619
|
+
// Export to clean, readable Markdown
|
|
620
|
+
const markdown = history.toMarkdown();
|
|
621
|
+
// ### User
|
|
622
|
+
//
|
|
623
|
+
// Hello!
|
|
624
|
+
//
|
|
625
|
+
// ### Assistant
|
|
626
|
+
//
|
|
627
|
+
// Hi there!
|
|
628
|
+
|
|
629
|
+
// Export with full metadata (lossless round-trip)
|
|
630
|
+
const markdownWithMetadata = history.toMarkdown({ includeMetadata: true });
|
|
631
|
+
|
|
632
|
+
// Restore from Markdown
|
|
633
|
+
const restored = ConversationHistory.fromMarkdown(markdownWithMetadata);
|
|
634
|
+
```
|
|
635
|
+
|
|
515
636
|
## Integration
|
|
516
637
|
|
|
517
638
|
### Using with React
|
|
@@ -547,16 +668,14 @@ For more complex applications, you can wrap the logic into a custom hook. This e
|
|
|
547
668
|
|
|
548
669
|
```tsx
|
|
549
670
|
import { useState, useCallback, useEffect } from 'react';
|
|
550
|
-
import {
|
|
551
|
-
createConversation,
|
|
552
|
-
ConversationHistory,
|
|
553
|
-
toChatMessages,
|
|
554
|
-
} from 'conversationalist';
|
|
671
|
+
import { createConversation, ConversationHistory } from 'conversationalist';
|
|
555
672
|
|
|
556
673
|
export function useChat(initialTitle?: string) {
|
|
557
674
|
// 1. Initialize history (this could also come from context or props)
|
|
558
|
-
const [history] = useState(
|
|
559
|
-
|
|
675
|
+
const [history] = useState(() =>
|
|
676
|
+
initialTitle
|
|
677
|
+
? new ConversationHistory(createConversation({ title: initialTitle }))
|
|
678
|
+
: new ConversationHistory(),
|
|
560
679
|
);
|
|
561
680
|
|
|
562
681
|
// 2. Sync history with local state for reactivity
|
|
@@ -660,10 +779,10 @@ Svelte 5's runes pair perfectly with **Conversationalist**. You can use the `Con
|
|
|
660
779
|
|
|
661
780
|
```svelte
|
|
662
781
|
<script lang="ts">
|
|
663
|
-
import { ConversationHistory
|
|
782
|
+
import { ConversationHistory } from 'conversationalist';
|
|
664
783
|
|
|
665
784
|
// history implements the Svelte store contract
|
|
666
|
-
const history = new ConversationHistory(
|
|
785
|
+
const history = new ConversationHistory();
|
|
667
786
|
</script>
|
|
668
787
|
|
|
669
788
|
<div>
|
|
@@ -688,6 +807,7 @@ Svelte 5's runes pair perfectly with **Conversationalist**. You can use the `Con
|
|
|
688
807
|
| **Modification** | `redactMessageAtPosition`, `replaceSystemMessage`, `collapseSystemMessages` |
|
|
689
808
|
| **Context** | `truncateToTokenLimit`, `getRecentMessages`, `estimateConversationTokens` |
|
|
690
809
|
| **Querying** | `getConversationMessages`, `getMessageByIdentifier`, `computeConversationStatistics` |
|
|
810
|
+
| **Conversion** | `toMarkdown`, `fromMarkdown`, `toChatMessages`, `pairToolCallsWithResults` |
|
|
691
811
|
| **History** | `ConversationHistory`, `bindToConversationHistory` |
|
|
692
812
|
|
|
693
813
|
## Deterministic Environments (Testing)
|
|
@@ -710,4 +830,3 @@ bun install
|
|
|
710
830
|
bun test
|
|
711
831
|
bun run build
|
|
712
832
|
```
|
|
713
|
-
````
|
package/dist/history.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type TruncateOptions } from './context';
|
|
2
2
|
import { type ConversationEnvironment } from './environment';
|
|
3
3
|
import type { Conversation, ConversationHistoryJSON, Message, MessageInput, TokenUsage } from './types';
|
|
4
|
+
import { type ToMarkdownOptions } from './utilities';
|
|
4
5
|
/**
|
|
5
6
|
* Event detail for conversation history changes.
|
|
6
7
|
*/
|
|
@@ -20,7 +21,7 @@ export declare class ConversationHistoryEvent extends CustomEvent<ConversationHi
|
|
|
20
21
|
export declare class ConversationHistory extends EventTarget {
|
|
21
22
|
private currentNode;
|
|
22
23
|
private environment;
|
|
23
|
-
constructor(initial
|
|
24
|
+
constructor(initial?: Conversation, environment?: Partial<ConversationEnvironment>);
|
|
24
25
|
/**
|
|
25
26
|
* Dispatches a change event.
|
|
26
27
|
*/
|
|
@@ -113,6 +114,7 @@ export declare class ConversationHistory extends EventTarget {
|
|
|
113
114
|
getSystemMessages(): ReadonlyArray<Message>;
|
|
114
115
|
serialize(): import("./types").ConversationJSON;
|
|
115
116
|
toChatMessages(): import("@lasercat/homogenaize").Message[];
|
|
117
|
+
toMarkdown(options?: ToMarkdownOptions): string;
|
|
116
118
|
estimateTokens(estimator?: (message: Message) => number): number;
|
|
117
119
|
getRecentMessages(count: number, options?: {
|
|
118
120
|
includeHidden?: boolean;
|
|
@@ -146,6 +148,10 @@ export declare class ConversationHistory extends EventTarget {
|
|
|
146
148
|
* Reconstructs a ConversationHistory instance from JSON.
|
|
147
149
|
*/
|
|
148
150
|
static from(json: ConversationHistoryJSON, environment?: Partial<ConversationEnvironment>): ConversationHistory;
|
|
151
|
+
/**
|
|
152
|
+
* Creates a ConversationHistory instance from a Markdown string.
|
|
153
|
+
*/
|
|
154
|
+
static fromMarkdown(markdown: string, environment?: Partial<ConversationEnvironment>): ConversationHistory;
|
|
149
155
|
/**
|
|
150
156
|
* Binds a function to this history instance.
|
|
151
157
|
* The first argument of the function must be a Conversation.
|
package/dist/history.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,eAAe,EAErB,MAAM,WAAW,CAAC;AAuBnB,OAAO,EACL,KAAK,uBAAuB,EAE7B,MAAM,eAAe,CAAC;AAQvB,OAAO,KAAK,EACV,YAAY,EACZ,uBAAuB,EAEvB,OAAO,EACP,YAAY,EACZ,UAAU,EACX,MAAM,SAAS,CAAC;AACjB,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE/E;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,WAAW,CAAC,8BAA8B,CAAC;gBAC3E,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;CAGjE;AAQD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;IAClD,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,WAAW,CAA0B;gBAG3C,OAAO,GAAE,YAAmC,EAC5C,WAAW,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC;IAWhD;;OAEG;IACH,OAAO,CAAC,YAAY;IASpB;;;OAGG;IACM,gBAAgB,CACvB,IAAI,EAAE,MAAM,EACZ,QAAQ,EACJ,CAAC,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,CAAC,GAC3C,kCAAkC,GAClC,IAAI,EACR,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI,GA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ACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,CAAC,EAC9D,OAAO,EAAE,mBAAmB,EAC5B,EAAE,EAAE,CACF,YAAY,EAAE,YAAY,EAC1B,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC,KAC/C,CAAC,GACL,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAYnB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ export { withEnvironment } from './environment';
|
|
|
9
9
|
export { createMessage } from './utilities';
|
|
10
10
|
export type { ConversationalistErrorCode } from './errors';
|
|
11
11
|
export { ConversationalistError, createDuplicateIdError, createInvalidInputError, createInvalidPositionError, createInvalidToolReferenceError, createLockedError, createNotFoundError, createSerializationError, createValidationError, } from './errors';
|
|
12
|
-
export type { ToolCallPair } from './utilities';
|
|
13
|
-
export { normalizeContent, pairToolCallsWithResults, toMultiModalArray, } from './utilities';
|
|
12
|
+
export type { ToMarkdownOptions, ToolCallPair } from './utilities';
|
|
13
|
+
export { fromMarkdown, MarkdownParseError, normalizeContent, pairToolCallsWithResults, toMarkdown, toMultiModalArray, } from './utilities';
|
|
14
14
|
export type { ConversationDraft } from './with-conversation';
|
|
15
15
|
export { pipeConversation, withConversation } from './with-conversation';
|
|
16
16
|
export { bindToConversationHistory, ConversationHistory } from './history';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACnE,YAAY,EACV,OAAO,IAAI,eAAe,EAC1B,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EACV,YAAY,EACZ,gBA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