conversationalist 0.0.7 → 0.0.9

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 (97) hide show
  1. package/README.md +158 -104
  2. package/dist/adapters/anthropic/index.d.ts +11 -6
  3. package/dist/adapters/anthropic/index.d.ts.map +1 -1
  4. package/dist/adapters/anthropic/index.js +16 -3
  5. package/dist/adapters/anthropic/index.js.map +5 -4
  6. package/dist/adapters/gemini/index.d.ts +2 -2
  7. package/dist/adapters/gemini/index.d.ts.map +1 -1
  8. package/dist/adapters/gemini/index.js +52 -9
  9. package/dist/adapters/gemini/index.js.map +5 -4
  10. package/dist/adapters/openai/index.d.ts +32 -5
  11. package/dist/adapters/openai/index.d.ts.map +1 -1
  12. package/dist/adapters/openai/index.js +30 -8
  13. package/dist/adapters/openai/index.js.map +5 -4
  14. package/dist/context.d.ts.map +1 -1
  15. package/dist/conversation/append.d.ts +4 -4
  16. package/dist/conversation/append.d.ts.map +1 -1
  17. package/dist/conversation/create.d.ts +2 -3
  18. package/dist/conversation/create.d.ts.map +1 -1
  19. package/dist/conversation/index.d.ts +2 -2
  20. package/dist/conversation/index.d.ts.map +1 -1
  21. package/dist/conversation/modify.d.ts.map +1 -1
  22. package/dist/conversation/query.d.ts +9 -5
  23. package/dist/conversation/query.d.ts.map +1 -1
  24. package/dist/conversation/serialization.d.ts +6 -28
  25. package/dist/conversation/serialization.d.ts.map +1 -1
  26. package/dist/conversation/system-messages.d.ts +3 -3
  27. package/dist/conversation/system-messages.d.ts.map +1 -1
  28. package/dist/conversation/transform.d.ts.map +1 -1
  29. package/dist/conversation.d.ts +74 -18
  30. package/dist/conversation.d.ts.map +1 -1
  31. package/dist/export/index.d.ts +7 -0
  32. package/dist/export/index.d.ts.map +1 -0
  33. package/dist/export/index.js +3762 -0
  34. package/dist/export/index.js.map +62 -0
  35. package/dist/history.d.ts +102 -24
  36. package/dist/history.d.ts.map +1 -1
  37. package/dist/index.d.ts +7 -8
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +392 -4075
  40. package/dist/index.js.map +15 -60
  41. package/dist/markdown/index.d.ts +15 -0
  42. package/dist/markdown/index.d.ts.map +1 -0
  43. package/dist/markdown/index.js +4969 -0
  44. package/dist/markdown/index.js.map +69 -0
  45. package/dist/message.d.ts +1 -1
  46. package/dist/message.d.ts.map +1 -1
  47. package/dist/multi-modal.d.ts +3 -0
  48. package/dist/multi-modal.d.ts.map +1 -1
  49. package/dist/plugins/index.d.ts +1 -1
  50. package/dist/plugins/index.d.ts.map +1 -1
  51. package/dist/plugins/index.js +59 -0
  52. package/dist/plugins/index.js.map +10 -0
  53. package/dist/plugins/pii-redaction.d.ts +10 -1
  54. package/dist/plugins/pii-redaction.d.ts.map +1 -1
  55. package/dist/redaction/index.d.ts +2 -0
  56. package/dist/redaction/index.d.ts.map +1 -0
  57. package/dist/redaction/index.js +59 -0
  58. package/dist/redaction/index.js.map +10 -0
  59. package/dist/schemas/index.d.ts +2 -0
  60. package/dist/schemas/index.d.ts.map +1 -0
  61. package/dist/schemas/index.js +114 -0
  62. package/dist/schemas/index.js.map +10 -0
  63. package/dist/schemas.d.ts +324 -15
  64. package/dist/schemas.d.ts.map +1 -1
  65. package/dist/sort/index.d.ts +2 -0
  66. package/dist/sort/index.d.ts.map +1 -0
  67. package/dist/sort/index.js +32 -0
  68. package/dist/sort/index.js.map +10 -0
  69. package/dist/streaming.d.ts +3 -3
  70. package/dist/streaming.d.ts.map +1 -1
  71. package/dist/types.d.ts +72 -50
  72. package/dist/types.d.ts.map +1 -1
  73. package/dist/utilities/index.d.ts +1 -3
  74. package/dist/utilities/index.d.ts.map +1 -1
  75. package/dist/utilities/line-endings.d.ts +5 -0
  76. package/dist/utilities/line-endings.d.ts.map +1 -0
  77. package/dist/utilities/markdown.d.ts +1 -1
  78. package/dist/utilities/markdown.d.ts.map +1 -1
  79. package/dist/utilities/message-store.d.ts +6 -0
  80. package/dist/utilities/message-store.d.ts.map +1 -0
  81. package/dist/utilities/message.d.ts +9 -3
  82. package/dist/utilities/message.d.ts.map +1 -1
  83. package/dist/utilities/tool-calls.d.ts +4 -4
  84. package/dist/utilities/tool-calls.d.ts.map +1 -1
  85. package/dist/utilities/tool-results.d.ts +10 -0
  86. package/dist/utilities/tool-results.d.ts.map +1 -0
  87. package/dist/utilities/transient.d.ts +2 -2
  88. package/dist/utilities/transient.d.ts.map +1 -1
  89. package/dist/utilities.d.ts +3 -5
  90. package/dist/utilities.d.ts.map +1 -1
  91. package/dist/versioning/index.d.ts +3 -0
  92. package/dist/versioning/index.d.ts.map +1 -0
  93. package/dist/versioning/index.js +58 -0
  94. package/dist/versioning/index.js.map +11 -0
  95. package/dist/with-conversation.d.ts +8 -8
  96. package/dist/with-conversation.d.ts.map +1 -1
  97. package/package.json +26 -1
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;;GAGG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,WAAW,GACX,QAAQ,GACR,WAAW,GACX,UAAU,GACV,aAAa,GACb,UAAU,CAAC;AAEf,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,WAAW,CAAC;IACl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Y,CAAC;IAC3B,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,mBAAmB,CAAC;IAC1B,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
@@ -1,8 +1,6 @@
1
1
  export type { ToMarkdownOptions } from '../types';
2
2
  export { normalizeContent, toMultiModalArray } from './content';
3
- export { sortMessagesByPosition, sortObjectKeys } from './deterministic';
4
- export { fromMarkdown, getRoleFromLabel, getRoleLabel, LABEL_TO_ROLE, MarkdownParseError, ROLE_LABELS, toMarkdown, } from './markdown';
5
- export { createMessage, messageHasImages, messageParts, messageText, messageToJSON, messageToString, } from './message';
3
+ export { createMessage, isAssistantMessage, messageHasImages, messageParts, messageText, messageToJSON, messageToString, } from './message';
6
4
  export type { ToolCallPair } from './tool-calls';
7
5
  export { pairToolCallsWithResults } from './tool-calls';
8
6
  export { isTransientKey, stripTransientFromRecord, stripTransientMetadata, } from './transient';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGhE,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGzE,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,WAAW,EACX,UAAU,GACX,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,eAAe,GAChB,MAAM,WAAW,CAAC;AAGnB,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utilities/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGlD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAKhE,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,eAAe,GAChB,MAAM,WAAW,CAAC;AAGnB,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Normalizes line endings to LF (\n).
3
+ */
4
+ export declare function normalizeLineEndings(text: string): string;
5
+ //# sourceMappingURL=line-endings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-endings.d.ts","sourceRoot":"","sources":["../../src/utilities/line-endings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD"}
@@ -92,7 +92,7 @@ export declare class MarkdownParseError extends Error {
92
92
  * - Conversation ID and timestamps are generated
93
93
  * - Message IDs are generated, positions are inferred from order
94
94
  * - Content is parsed from markdown body
95
- * - Defaults: status='active', hidden=false, empty metadata/tags
95
+ * - Defaults: status='active', hidden=false, empty metadata
96
96
  *
97
97
  * @param markdown - The markdown string to parse
98
98
  * @returns A Conversation object
@@ -1 +1 @@
1
- {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/utilities/markdown.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,YAAY,EAGZ,WAAW,EAEX,iBAAiB,EAGlB,MAAM,UAAU,CAAC;AAIlB;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAQnD,CAAC;AAKF;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAQrD,CAAC;AAKF;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAEtD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEvE;AAuDD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CACxB,YAAY,EAAE,YAAY,EAC1B,OAAO,GAAE,iBAAsB,GAC9B,MAAM,CAQR;AAqFD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,OAAO,EAAE,MAAM;CAI5B;AASD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAW3D"}
1
+ {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/utilities/markdown.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,YAAY,EAIZ,WAAW,EAEX,iBAAiB,EAGlB,MAAM,UAAU,CAAC;AAQlB;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAQnD,CAAC;AAKF;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAQrD,CAAC;AAKF;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAEtD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEvE;AAgKD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CACxB,YAAY,EAAE,YAAY,EAC1B,OAAO,GAAE,iBAAsB,GAC9B,MAAM,CASR;AAwFD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,OAAO,EAAE,MAAM;CAI5B;AASD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAW3D"}
@@ -0,0 +1,6 @@
1
+ import type { Conversation, Message } from '../types';
2
+ export declare function getOrderedMessages(conversation: Conversation): Message[];
3
+ export declare function toIdRecord<T extends {
4
+ id: string;
5
+ }>(items: readonly T[]): Record<string, T>;
6
+ //# sourceMappingURL=message-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-store.d.ts","sourceRoot":"","sources":["../../src/utilities/message-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEtD,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,EAAE,CASxE;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EACjD,KAAK,EAAE,SAAS,CAAC,EAAE,GAClB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAMnB"}
@@ -1,15 +1,17 @@
1
1
  import type { MultiModalContent } from '@lasercat/homogenaize';
2
- import type { Message, MessageJSON } from '../types';
2
+ import type { AssistantMessage, Message } from '../types';
3
3
  /**
4
4
  * Creates an immutable Message from a JSON representation.
5
5
  * Deep copies nested objects and arrays to ensure immutability.
6
6
  */
7
- export declare function createMessage(props: MessageJSON): Message;
7
+ export declare function createMessage(props: AssistantMessage): AssistantMessage;
8
+ export declare function createMessage(props: Message): Message;
8
9
  /**
9
10
  * Converts an immutable Message to a mutable JSON representation.
10
11
  * Creates deep copies of all nested objects.
11
12
  */
12
- export declare function messageToJSON(message: Message): MessageJSON;
13
+ export declare function messageToJSON(message: AssistantMessage): AssistantMessage;
14
+ export declare function messageToJSON(message: Message): Message;
13
15
  /**
14
16
  * Extracts the content parts from a message as a multi-modal array.
15
17
  * String content is converted to a single text part.
@@ -29,4 +31,8 @@ export declare function messageHasImages(message: Message): boolean;
29
31
  * Images are rendered as markdown image syntax.
30
32
  */
31
33
  export declare function messageToString(message: Message): string;
34
+ /**
35
+ * Type guard for narrowing a Message to an AssistantMessage.
36
+ */
37
+ export declare function isAssistantMessage(message: Message): message is AssistantMessage;
32
38
  //# sourceMappingURL=message.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/utilities/message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG/D,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGrD;;;G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AAE,OAAO,GAAG,OAAO,CAE1D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CASxD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,gBAAgB,CAEhF"}
@@ -1,4 +1,4 @@
1
- import type { MessageJSON, ToolResult } from '../types';
1
+ import type { JSONValue, Message, ToolResult } from '../types';
2
2
  /**
3
3
  * Represents a paired tool call with its optional result.
4
4
  */
@@ -7,7 +7,7 @@ export interface ToolCallPair {
7
7
  call: {
8
8
  id: string;
9
9
  name: string;
10
- arguments: unknown;
10
+ arguments: JSONValue;
11
11
  };
12
12
  /** The corresponding result, if available */
13
13
  result?: ToolResult | undefined;
@@ -20,7 +20,7 @@ export interface ToolCallPair {
20
20
  * 1. Collects all tool results into a map by their callId
21
21
  * 2. Pairs each tool call with its matching result (if any)
22
22
  *
23
- * @param messages - Array of messages that may contain tool calls and results
23
+ * @param messages - Messages that may contain tool calls and results (array or record)
24
24
  * @returns Array of tool call pairs, preserving the order of tool calls
25
25
  *
26
26
  * @example
@@ -29,5 +29,5 @@ export interface ToolCallPair {
29
29
  * // pairs: [{ call: ToolCall, result?: ToolResult }, ...]
30
30
  * ```
31
31
  */
32
- export declare function pairToolCallsWithResults(messages: readonly MessageJSON[]): ToolCallPair[];
32
+ export declare function pairToolCallsWithResults(messages: ReadonlyArray<Message> | Readonly<Record<string, Message>>): ToolCallPair[];
33
33
  //# sourceMappingURL=tool-calls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-calls.d.ts","sourceRoot":"","sources":["../../src/utilities/tool-calls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oBAAoB;IACpB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,OAAO,CAAC;KACpB,CAAC;IACF,6CAA6C;IAC7C,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAC/B,YAAY,EAAE,CAsBhB"}
1
+ {"version":3,"file":"tool-calls.d.ts","sourceRoot":"","sources":["../../src/utilities/tool-calls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oBAAoB;IACpB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,SAAS,CAAC;KACtB,CAAC;IACF,6CAA6C;IAC7C,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACnE,YAAY,EAAE,CA6BhB"}
@@ -0,0 +1,10 @@
1
+ import type { ToolResult } from '../types';
2
+ /**
3
+ * Returns a shallow copy of a tool result.
4
+ */
5
+ export declare function copyToolResult(toolResult: ToolResult): ToolResult;
6
+ /**
7
+ * Redacts tool result payload fields while preserving the original shape.
8
+ */
9
+ export declare function redactToolResult(toolResult: ToolResult, placeholder: string): ToolResult;
10
+ //# sourceMappingURL=tool-results.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-results.d.ts","sourceRoot":"","sources":["../../src/utilities/tool-results.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;GAEG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAEjE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,MAAM,GAClB,UAAU,CASZ"}
@@ -1,4 +1,4 @@
1
- import type { Conversation } from '../types';
1
+ import type { Conversation, JSONValue } from '../types';
2
2
  /**
3
3
  * Checks if a metadata key is transient (starts with '_').
4
4
  * Transient metadata is intended for temporary UI state and should not be persisted.
@@ -26,7 +26,7 @@ export declare function isTransientKey(key: string): boolean;
26
26
  * // Returns: { source: 'web' }
27
27
  * ```
28
28
  */
29
- export declare function stripTransientFromRecord(metadata: Record<string, unknown>): Record<string, unknown>;
29
+ export declare function stripTransientFromRecord(metadata: Record<string, JSONValue>): Record<string, JSONValue>;
30
30
  /**
31
31
  * Strips all transient metadata from a conversation.
32
32
  * Transient metadata is identified by keys starting with '_'.
@@ -1 +1 @@
1
- {"version":3,"file":"transient.d.ts","sourceRoot":"","sources":["../../src/utilities/transient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAW,MAAM,UAAU,CAAC;AAGtD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQzB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,GAAG,YAAY,CA4B/E"}
1
+ {"version":3,"file":"transient.d.ts","sourceRoot":"","sources":["../../src/utilities/transient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAoB,YAAY,EAAE,SAAS,EAAW,MAAM,UAAU,CAAC;AAKnF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAClC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAQ3B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,GAAG,YAAY,CAsC/E"}
@@ -2,8 +2,8 @@
2
2
  * This file re-exports all utilities from the utilities/ directory.
3
3
  * For new code, prefer importing directly from the specific modules:
4
4
  * - './utilities/content' for content normalization
5
- * - './utilities/deterministic' for deterministic output
6
- * - './utilities/markdown' for markdown conversion
5
+ * - './utilities/deterministic' for sort utilities (also exported via conversationalist/sort)
6
+ * - './utilities/markdown' for markdown conversion (exposed via conversationalist/markdown)
7
7
  * - './utilities/message' for message utilities
8
8
  * - './utilities/tool-calls' for tool call pairing
9
9
  * - './utilities/transient' for transient metadata handling
@@ -11,9 +11,7 @@
11
11
  */
12
12
  export type { ToMarkdownOptions } from './types';
13
13
  export { normalizeContent, toMultiModalArray } from './utilities/content';
14
- export { sortMessagesByPosition, sortObjectKeys } from './utilities/deterministic';
15
- export { fromMarkdown, getRoleFromLabel, getRoleLabel, LABEL_TO_ROLE, MarkdownParseError, ROLE_LABELS, toMarkdown, } from './utilities/markdown';
16
- export { createMessage, messageHasImages, messageParts, messageText, messageToJSON, messageToString, } from './utilities/message';
14
+ export { createMessage, isAssistantMessage, messageHasImages, messageParts, messageText, messageToJSON, messageToString, } from './utilities/message';
17
15
  export type { ToolCallPair } from './utilities/tool-calls';
18
16
  export { pairToolCallsWithResults } from './utilities/tool-calls';
19
17
  export { isTransientKey, stripTransientFromRecord, stripTransientMetadata, } from './utilities/transient';
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../src/utilities.ts"],"names":[],"mappings":"AAAA;;;;;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UAAU,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { migrateConversation } from '../conversation/serialization';
2
+ export { CURRENT_SCHEMA_VERSION } from '../types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/versioning/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,58 @@
1
+ // src/types.ts
2
+ var CURRENT_SCHEMA_VERSION = 3;
3
+ // src/conversation/serialization.ts
4
+ function migrateConversation(json) {
5
+ if (typeof json !== "object" || json === null || Array.isArray(json)) {
6
+ return {
7
+ schemaVersion: CURRENT_SCHEMA_VERSION,
8
+ id: "",
9
+ status: "active",
10
+ metadata: {},
11
+ ids: [],
12
+ messages: {},
13
+ createdAt: new Date().toISOString(),
14
+ updatedAt: new Date().toISOString()
15
+ };
16
+ }
17
+ const data = json;
18
+ const rawMessages = data.messages;
19
+ let messages = {};
20
+ let ids = [];
21
+ const rawIds = data.ids;
22
+ const isStringArray = (value) => Array.isArray(value) && value.every((item) => typeof item === "string");
23
+ if (Array.isArray(rawMessages)) {
24
+ const rawMessageArray = rawMessages;
25
+ ids = rawMessageArray.map((message) => message.id);
26
+ messages = Object.fromEntries(rawMessageArray.map((message) => [message.id, message]));
27
+ } else if (rawMessages && typeof rawMessages === "object") {
28
+ messages = { ...rawMessages };
29
+ if (isStringArray(rawIds) && rawIds.length > 0) {
30
+ ids = [...rawIds];
31
+ } else {
32
+ ids = Object.values(messages).sort((a, b) => a.position - b.position).map((message) => message.id);
33
+ }
34
+ }
35
+ if (ids.length > 0) {
36
+ ids = ids.filter((id) => (id in messages));
37
+ const missing = Object.keys(messages).filter((id) => !ids.includes(id));
38
+ if (missing.length > 0) {
39
+ const sortedMissing = missing.sort((a, b) => (messages[a]?.position ?? 0) - (messages[b]?.position ?? 0));
40
+ ids = [...ids, ...sortedMissing];
41
+ }
42
+ }
43
+ if (!("schemaVersion" in json)) {
44
+ return {
45
+ ...data,
46
+ schemaVersion: CURRENT_SCHEMA_VERSION,
47
+ ids,
48
+ messages
49
+ };
50
+ }
51
+ return { ...data, ids, messages };
52
+ }
53
+ export {
54
+ migrateConversation,
55
+ CURRENT_SCHEMA_VERSION
56
+ };
57
+
58
+ //# debugId=F3F48096769F752764756E2164756E21
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/types.ts", "../../src/conversation/serialization.ts"],
4
+ "sourcesContent": [
5
+ "import type { MultiModalContent } from '@lasercat/homogenaize';\n\n/**\n * Current schema version for serialized conversation data.\n * Increment when making breaking changes to the schema.\n */\nexport const CURRENT_SCHEMA_VERSION = 3;\n\n/**\n * JSON-serializable value types.\n */\nexport type JSONPrimitive = string | number | boolean | null;\nexport type JSONValue = JSONPrimitive | JSONValue[] | { [key: string]: JSONValue };\n\n/**\n * Supported message roles in a conversation.\n */\nexport type MessageRole =\n | 'user'\n | 'assistant'\n | 'system'\n | 'developer'\n | 'tool-use'\n | 'tool-result'\n | 'snapshot';\n\n/**\n * Tool call metadata for tool-use messages.\n */\nexport interface ToolCall {\n id: string;\n name: string;\n arguments: JSONValue;\n}\n\n/**\n * Tool execution result metadata for tool-result messages.\n */\nexport interface ToolResult {\n callId: string;\n outcome: 'success' | 'error';\n content: JSONValue;\n toolCallId?: string | undefined;\n toolName?: string | undefined;\n result?: JSONValue | undefined;\n error?: string | undefined;\n}\n\n/**\n * Token usage accounting for a message.\n */\nexport interface TokenUsage {\n prompt: number;\n completion: number;\n total: number;\n}\n\n/**\n * Mutable input shape for creating a message.\n */\nexport interface MessageInput {\n role: MessageRole;\n content: string | MultiModalContent[];\n metadata?: Record<string, JSONValue> | undefined;\n hidden?: boolean | undefined;\n toolCall?: ToolCall | undefined;\n toolResult?: ToolResult | undefined;\n tokenUsage?: TokenUsage | undefined;\n /** Indicates if this message represents goal completion (assistant only) */\n goalCompleted?: boolean | undefined;\n}\n\n/**\n * Immutable message shape exposed by the library.\n */\nexport interface Message {\n id: string;\n role: MessageRole;\n content: string | ReadonlyArray<MultiModalContent>;\n position: number;\n createdAt: string;\n metadata: Readonly<Record<string, JSONValue>>;\n hidden: boolean;\n toolCall?: Readonly<ToolCall> | undefined;\n toolResult?: Readonly<ToolResult> | undefined;\n tokenUsage?: Readonly<TokenUsage> | undefined;\n}\n\n/**\n * Assistant-only message shape with optional goal completion metadata.\n */\nexport interface AssistantMessage extends Message {\n role: 'assistant';\n /** Indicates if this message represents goal completion */\n goalCompleted?: boolean | undefined;\n}\n\n/**\n * Status values for a conversation lifecycle.\n */\nexport type ConversationStatus = 'active' | 'archived' | 'deleted';\n\n/**\n * Immutable conversation state.\n */\nexport interface Conversation {\n schemaVersion: number;\n id: string;\n title?: string | undefined;\n status: ConversationStatus;\n metadata: Readonly<Record<string, JSONValue>>;\n ids: ReadonlyArray<string>;\n messages: Readonly<Record<string, Message>>;\n createdAt: string;\n updatedAt: string;\n}\n\n/**\n * A function that estimates the number of tokens in a message.\n */\nexport type TokenEstimator = (message: Message) => number;\n\n/**\n * A plugin that can transform a MessageInput before it is appended.\n */\nexport type MessagePlugin = (input: MessageInput) => MessageInput;\n\n/**\n * Serialized form of a single node in the conversation history tree.\n */\nexport interface HistoryNodeSnapshot {\n conversation: Conversation;\n children: HistoryNodeSnapshot[];\n}\n\n/**\n * Serialized form of the entire conversation history.\n */\nexport interface ConversationHistorySnapshot {\n root: HistoryNodeSnapshot;\n currentPath: number[];\n}\n\n/**\n * Base options for all export operations.\n */\nexport interface ExportOptions {\n /**\n * When true, strips transient metadata (keys starting with '_').\n * @default false\n */\n stripTransient?: boolean;\n\n /**\n * When false, hidden messages are omitted from export output.\n * @default true\n */\n includeHidden?: boolean;\n\n /**\n * When true, hidden message content is replaced with a redacted placeholder.\n * Only applies when includeHidden is true.\n * @default false\n */\n redactHiddenContent?: boolean;\n\n /**\n * Placeholder used when redacting tool or hidden content.\n * @default \"[REDACTED]\"\n */\n redactedPlaceholder?: string;\n\n /**\n * When true, redacts tool call arguments with '[REDACTED]'.\n * @default false\n */\n redactToolArguments?: boolean;\n\n /**\n * When true, redacts tool result content with '[REDACTED]'.\n * @default false\n */\n redactToolResults?: boolean;\n}\n\n/**\n * Options for exporting to markdown format.\n */\nexport interface ToMarkdownOptions extends ExportOptions {\n /**\n * When true, includes YAML frontmatter with full metadata for lossless round-trip.\n * Headers include message ID: `### Role (msg-id)`\n * @default false\n */\n includeMetadata?: boolean;\n}\n",
6
+ "import { createInvalidPositionError, createSerializationError } from '../errors';\nimport type { Conversation, Message } from '../types';\nimport { CURRENT_SCHEMA_VERSION } from '../types';\nimport { createMessage, toReadonly } from '../utilities';\nimport { toIdRecord } from '../utilities/message-store';\nimport { assertToolReference, registerToolUse, type ToolUseIndex } from './tool-tracking';\n\n/**\n * Migrates a serialized conversation object to the current schema version.\n * Handles data from older versions that may not have a schemaVersion field.\n *\n * @param json - The conversation data to migrate (may be from an older version)\n * @returns A Conversation with the current schema version\n *\n * @example\n * ```ts\n * // Old data without schemaVersion\n * const old = { id: 'conv-1', status: 'active', ... };\n * const migrated = migrateConversation(old);\n * // migrated.schemaVersion === CURRENT_SCHEMA_VERSION\n * ```\n */\nexport function migrateConversation(json: unknown): Conversation {\n // Handle non-object input\n if (typeof json !== 'object' || json === null || Array.isArray(json)) {\n return {\n schemaVersion: CURRENT_SCHEMA_VERSION,\n id: '',\n status: 'active',\n metadata: {},\n ids: [],\n messages: {},\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n };\n }\n\n const data = json as Conversation & { messages?: unknown };\n const rawMessages = data.messages;\n\n let messages: Record<string, Message> = {};\n let ids: string[] = [];\n const rawIds = (data as { ids?: unknown }).ids;\n const isStringArray = (value: unknown): value is string[] =>\n Array.isArray(value) && value.every((item) => typeof item === 'string');\n\n if (Array.isArray(rawMessages)) {\n const rawMessageArray = rawMessages as Message[];\n ids = rawMessageArray.map((message) => message.id);\n messages = Object.fromEntries(\n rawMessageArray.map((message) => [message.id, message]),\n );\n } else if (rawMessages && typeof rawMessages === 'object') {\n messages = { ...(rawMessages as Record<string, Message>) };\n if (isStringArray(rawIds) && rawIds.length > 0) {\n ids = [...rawIds];\n } else {\n ids = Object.values(messages)\n .sort((a, b) => a.position - b.position)\n .map((message) => message.id);\n }\n }\n\n if (ids.length > 0) {\n ids = ids.filter((id) => id in messages);\n const missing = Object.keys(messages).filter((id) => !ids.includes(id));\n if (missing.length > 0) {\n const sortedMissing = missing.sort(\n (a, b) => (messages[a]?.position ?? 0) - (messages[b]?.position ?? 0),\n );\n ids = [...ids, ...sortedMissing];\n }\n }\n\n // If no schemaVersion, assume pre-versioning data (version 0) and add it\n if (!('schemaVersion' in json)) {\n return {\n ...data,\n schemaVersion: CURRENT_SCHEMA_VERSION,\n ids,\n messages,\n };\n }\n\n // Future: add migration logic between versions here\n return { ...data, ids, messages };\n}\n\n/**\n * Reconstructs a conversation from a JSON object.\n * Automatically migrates data from older schema versions.\n * Validates message positions are contiguous and tool results reference valid calls.\n * Throws a serialization error if validation fails.\n *\n * @param json - The conversation JSON to deserialize (may be from an older version)\n * @returns A Conversation object\n * @throws {SerializationError} If validation fails\n */\nexport function deserializeConversation(json: unknown): Conversation {\n // Migrate to current schema version\n const migrated = migrateConversation(json);\n\n try {\n const orderedMessages = migrated.ids.map((id, index) => {\n const message = migrated.messages[id];\n if (!message) {\n throw createSerializationError(`missing message for id ${id}`);\n }\n if (message.position !== index) {\n throw createInvalidPositionError(index, message.position);\n }\n return message;\n });\n\n orderedMessages.reduce<{ toolUses: ToolUseIndex }>(\n (state, message) => {\n if (message.role === 'tool-use' && message.toolCall) {\n return {\n toolUses: registerToolUse(state.toolUses, message.toolCall),\n };\n }\n\n if (message.role === 'tool-result' && message.toolResult) {\n assertToolReference(state.toolUses, message.toolResult.callId);\n }\n\n return state;\n },\n { toolUses: new Map<string, { name: string }>() },\n );\n\n const messageInstances: Message[] = orderedMessages.map((m) => createMessage(m));\n const conv: Conversation = {\n schemaVersion: migrated.schemaVersion,\n id: migrated.id,\n title: migrated.title,\n status: migrated.status,\n metadata: { ...migrated.metadata },\n ids: orderedMessages.map((message) => message.id),\n messages: toIdRecord(messageInstances),\n createdAt: migrated.createdAt,\n updatedAt: migrated.updatedAt,\n };\n return toReadonly(conv);\n } catch (error) {\n throw createSerializationError(\n `failed to deserialize conversation: ${\n error instanceof Error ? error.message : String(error)\n }`,\n error as Error,\n );\n }\n}\n"
7
+ ],
8
+ "mappings": ";AAMO,IAAM,yBAAyB;;ACgB/B,SAAS,mBAAmB,CAAC,MAA6B;AAAA,EAE/D,IAAI,OAAO,SAAS,YAAY,SAAS,QAAQ,MAAM,QAAQ,IAAI,GAAG;AAAA,IACpE,OAAO;AAAA,MACL,eAAe;AAAA,MACf,IAAI;AAAA,MACJ,QAAQ;AAAA,MACR,UAAU,CAAC;AAAA,MACX,KAAK,CAAC;AAAA,MACN,UAAU,CAAC;AAAA,MACX,WAAW,IAAI,KAAK,EAAE,YAAY;AAAA,MAClC,WAAW,IAAI,KAAK,EAAE,YAAY;AAAA,IACpC;AAAA,EACF;AAAA,EAEA,MAAM,OAAO;AAAA,EACb,MAAM,cAAc,KAAK;AAAA,EAEzB,IAAI,WAAoC,CAAC;AAAA,EACzC,IAAI,MAAgB,CAAC;AAAA,EACrB,MAAM,SAAU,KAA2B;AAAA,EAC3C,MAAM,gBAAgB,CAAC,UACrB,MAAM,QAAQ,KAAK,KAAK,MAAM,MAAM,CAAC,SAAS,OAAO,SAAS,QAAQ;AAAA,EAExE,IAAI,MAAM,QAAQ,WAAW,GAAG;AAAA,IAC9B,MAAM,kBAAkB;AAAA,IACxB,MAAM,gBAAgB,IAAI,CAAC,YAAY,QAAQ,EAAE;AAAA,IACjD,WAAW,OAAO,YAChB,gBAAgB,IAAI,CAAC,YAAY,CAAC,QAAQ,IAAI,OAAO,CAAC,CACxD;AAAA,EACF,EAAO,SAAI,eAAe,OAAO,gBAAgB,UAAU;AAAA,IACzD,WAAW,KAAM,YAAwC;AAAA,IACzD,IAAI,cAAc,MAAM,KAAK,OAAO,SAAS,GAAG;AAAA,MAC9C,MAAM,CAAC,GAAG,MAAM;AAAA,IAClB,EAAO;AAAA,MACL,MAAM,OAAO,OAAO,QAAQ,EACzB,KAAK,CAAC,GAAG,MAAM,EAAE,WAAW,EAAE,QAAQ,EACtC,IAAI,CAAC,YAAY,QAAQ,EAAE;AAAA;AAAA,EAElC;AAAA,EAEA,IAAI,IAAI,SAAS,GAAG;AAAA,IAClB,MAAM,IAAI,OAAO,CAAC,QAAO,MAAM,SAAQ;AAAA,IACvC,MAAM,UAAU,OAAO,KAAK,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,SAAS,EAAE,CAAC;AAAA,IACtE,IAAI,QAAQ,SAAS,GAAG;AAAA,MACtB,MAAM,gBAAgB,QAAQ,KAC5B,CAAC,GAAG,OAAO,SAAS,IAAI,YAAY,MAAM,SAAS,IAAI,YAAY,EACrE;AAAA,MACA,MAAM,CAAC,GAAG,KAAK,GAAG,aAAa;AAAA,IACjC;AAAA,EACF;AAAA,EAGA,IAAI,EAAE,mBAAmB,OAAO;AAAA,IAC9B,OAAO;AAAA,SACF;AAAA,MACH,eAAe;AAAA,MACf;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EAGA,OAAO,KAAK,MAAM,KAAK,SAAS;AAAA;",
9
+ "debugId": "F3F48096769F752764756E2164756E21",
10
+ "names": []
11
+ }
@@ -1,5 +1,5 @@
1
1
  import type { MultiModalContent } from '@lasercat/homogenaize';
2
- import type { Conversation, Message, MessageInput, TokenUsage } from './types';
2
+ import type { Conversation, JSONValue, Message, MessageInput, TokenUsage } from './types';
3
3
  /**
4
4
  * A mutable draft wrapper around a conversation.
5
5
  * Methods return the draft for chaining and mutate the internal state.
@@ -27,31 +27,31 @@ export interface ConversationDraft {
27
27
  * @param content - Text or multi-modal content.
28
28
  * @param metadata - Optional metadata to attach to the message.
29
29
  */
30
- appendUserMessage: (content: MessageInput['content'], metadata?: Record<string, unknown>) => ConversationDraft;
30
+ appendUserMessage: (content: MessageInput['content'], metadata?: Record<string, JSONValue>) => ConversationDraft;
31
31
  /**
32
32
  * Appends an assistant message to the conversation.
33
33
  * @param content - Text or multi-modal content.
34
34
  * @param metadata - Optional metadata to attach to the message.
35
35
  */
36
- appendAssistantMessage: (content: MessageInput['content'], metadata?: Record<string, unknown>) => ConversationDraft;
36
+ appendAssistantMessage: (content: MessageInput['content'], metadata?: Record<string, JSONValue>) => ConversationDraft;
37
37
  /**
38
38
  * Appends a system message to the conversation.
39
39
  * @param content - The system message content.
40
40
  * @param metadata - Optional metadata to attach to the message.
41
41
  */
42
- appendSystemMessage: (content: string, metadata?: Record<string, unknown>) => ConversationDraft;
42
+ appendSystemMessage: (content: string, metadata?: Record<string, JSONValue>) => ConversationDraft;
43
43
  /**
44
44
  * Prepends a system message at position 0, renumbering existing messages.
45
45
  * @param content - The system message content.
46
46
  * @param metadata - Optional metadata to attach to the message.
47
47
  */
48
- prependSystemMessage: (content: string, metadata?: Record<string, unknown>) => ConversationDraft;
48
+ prependSystemMessage: (content: string, metadata?: Record<string, JSONValue>) => ConversationDraft;
49
49
  /**
50
50
  * Replaces the first system message, or prepends if none exists.
51
51
  * @param content - The new system message content.
52
52
  * @param metadata - Optional metadata (uses original if not provided).
53
53
  */
54
- replaceSystemMessage: (content: string, metadata?: Record<string, unknown>) => ConversationDraft;
54
+ replaceSystemMessage: (content: string, metadata?: Record<string, JSONValue>) => ConversationDraft;
55
55
  /**
56
56
  * Collapses all system messages into the first one, deduplicating content.
57
57
  */
@@ -68,7 +68,7 @@ export interface ConversationDraft {
68
68
  * @param role - The role of the streaming message ('assistant' or 'user').
69
69
  * @param metadata - Optional metadata to attach to the message.
70
70
  */
71
- appendStreamingMessage: (role: 'assistant' | 'user', metadata?: Record<string, unknown>) => {
71
+ appendStreamingMessage: (role: 'assistant' | 'user', metadata?: Record<string, JSONValue>) => {
72
72
  draft: ConversationDraft;
73
73
  messageId: string;
74
74
  };
@@ -85,7 +85,7 @@ export interface ConversationDraft {
85
85
  */
86
86
  finalizeStreamingMessage: (messageId: string, options?: {
87
87
  tokenUsage?: TokenUsage;
88
- metadata?: Record<string, unknown>;
88
+ metadata?: Record<string, JSONValue>;
89
89
  }) => ConversationDraft;
90
90
  /**
91
91
  * Cancels a streaming message by removing it from the conversation.
@@ -1 +1 @@
1
- {"version":3,"file":"with-conversation.d.ts","sourceRoot":"","sources":["../src/with-conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAmB/D,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE/E;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAE7B;;;OAGG;IACH,cAAc,EAAE,CAAC,GAAG,MAAM,EAAE,YAAY,EAAE,KAAK,iBAAiB,CAAC;IAEjE;;;;OAIG;IACH,iBAAiB,EAAE,CACjB,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,EAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC/B,iBAAiB,CAAC;IAEvB;;;;OAIG;IACH,sBAAsB,EAAE,CACtB,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,EAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC/B,iBAAiB,CAAC;IAEvB;;;;OAIG;IACH,mBAAmB,EAAE,CACnB,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC/B,iBAAiB,CAAC;IAEvB;;;;OAIG;IACH,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CAAC,CAAA;KAAE,KACxE,iBAAiB,CAAC;IAEvB;;;OAGG;IACH,sBAAsB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,iBAAiB,CAAC;IAEjE;;;;OAIG;IACH,oBAAoB,EAAE,CACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;QAAE,sBAAsB,CAAC,EAAE,OAAO,CAAA;KAAE,KAC3C,iBAAiB,CAAC;IAEvB;;;;;OAKG;IACH,oBAAoB,EAAE,CACpB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;QACR,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAC;QAC9C,sBAAsB,CAAC,EAAE,OAAO,CAAC;QACjC,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,KACE,iBAAiB,CAAC;CACxB;AAoFD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,YAAY,EAC1B,EAAE,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GACrD,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAWtC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,YAAY,EAC1B,GAAG,GAAG,EAAE,KAAK,CAAC,CAAC,YAAY,EAAE,YAAY,KAAK,YAAY,CAAC,GAC1D,YAAY,CAEd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conversationalist",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "A TypeScript library for managing AI conversation state",
5
5
  "keywords": [
6
6
  "conversation",
@@ -25,6 +25,18 @@
25
25
  "types": "./dist/index.d.ts",
26
26
  "import": "./dist/index.js"
27
27
  },
28
+ "./markdown": {
29
+ "types": "./dist/markdown/index.d.ts",
30
+ "import": "./dist/markdown/index.js"
31
+ },
32
+ "./export": {
33
+ "types": "./dist/export/index.d.ts",
34
+ "import": "./dist/export/index.js"
35
+ },
36
+ "./schemas": {
37
+ "types": "./dist/schemas/index.d.ts",
38
+ "import": "./dist/schemas/index.js"
39
+ },
28
40
  "./openai": {
29
41
  "types": "./dist/adapters/openai/index.d.ts",
30
42
  "import": "./dist/adapters/openai/index.js"
@@ -40,6 +52,18 @@
40
52
  "./plugins": {
41
53
  "types": "./dist/plugins/index.d.ts",
42
54
  "import": "./dist/plugins/index.js"
55
+ },
56
+ "./redaction": {
57
+ "types": "./dist/redaction/index.d.ts",
58
+ "import": "./dist/redaction/index.js"
59
+ },
60
+ "./versioning": {
61
+ "types": "./dist/versioning/index.d.ts",
62
+ "import": "./dist/versioning/index.js"
63
+ },
64
+ "./sort": {
65
+ "types": "./dist/sort/index.d.ts",
66
+ "import": "./dist/sort/index.js"
43
67
  }
44
68
  },
45
69
  "main": "./dist/index.js",
@@ -94,6 +118,7 @@
94
118
  "@types/bun": "^1.3.5",
95
119
  "@typescript-eslint/eslint-plugin": "^8.50.0",
96
120
  "@typescript-eslint/parser": "^8.50.0",
121
+ "armorer": "^0.1.0",
97
122
  "chalk": "^5.6.2",
98
123
  "eslint": "^9.39.2",
99
124
  "eslint-config-prettier": "^10.1.8",