@hachej/boring-agent 0.4.34 → 0.4.35
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/conversations.d.ts +1 -1
- package/dist/conversations.js +9 -2
- package/package.json +3 -3
package/dist/conversations.d.ts
CHANGED
|
@@ -96,7 +96,7 @@ export interface Conversations {
|
|
|
96
96
|
/** Stop observing commits (after `flush`). Never closes the Harness. */
|
|
97
97
|
readonly dispose: () => Promise<void>;
|
|
98
98
|
}
|
|
99
|
-
/** The visible text of a user or assistant message: text parts only, never the `<file>` blocks mentions add. */
|
|
99
|
+
/** The visible text of a user or assistant message: text parts only, never the `<file>` blocks mentions add nor a leading `<target>` block. */
|
|
100
100
|
export declare function messageText(message: Message): string | undefined;
|
|
101
101
|
/** A conversation's title as the list shows it: the first user message, clipped to `maxLength` characters. Undefined: no user message yet. */
|
|
102
102
|
export type ConversationTitleCache = {
|
package/dist/conversations.js
CHANGED
|
@@ -7,13 +7,20 @@ export const conversationMetadata = defineDoc({
|
|
|
7
7
|
initial: () => ({ owner: '', title: null, createdAt: 0, updatedAt: 0, lastMessage: null, archived: false, deletedAt: null }),
|
|
8
8
|
});
|
|
9
9
|
const managed = (meta, owner) => meta !== undefined && meta.owner !== '' && meta.deletedAt === null && (owner === undefined || meta.owner === owner);
|
|
10
|
+
/** What the person said: a leading `<target>{…}</target>` block (point-and-speak context) never becomes a title or a preview. */
|
|
11
|
+
const spoken = (text) => {
|
|
12
|
+
if (!text?.startsWith('<target>'))
|
|
13
|
+
return text;
|
|
14
|
+
const end = text.indexOf('</target>');
|
|
15
|
+
return end < 0 ? undefined : text.slice(end + 9).trim() || undefined;
|
|
16
|
+
};
|
|
10
17
|
const clip = (text, max) => { const flat = text.replace(/\s+/g, ' ').trim(); return flat.length > max ? `${flat.slice(0, max - 1)}…` : flat; };
|
|
11
|
-
/** The visible text of a user or assistant message: text parts only, never the `<file>` blocks mentions add. */
|
|
18
|
+
/** The visible text of a user or assistant message: text parts only, never the `<file>` blocks mentions add nor a leading `<target>` block. */
|
|
12
19
|
export function messageText(message) {
|
|
13
20
|
if (message.role === 'user') {
|
|
14
21
|
const text = typeof message.content === 'string' ? message.content
|
|
15
22
|
: message.content.map(part => part.type === 'text' && !part.text.startsWith(MENTION_FILE_PREFIX) ? part.text : '').join(' ');
|
|
16
|
-
return text.trim() ? text : undefined;
|
|
23
|
+
return text.trim() ? spoken(text) : undefined;
|
|
17
24
|
}
|
|
18
25
|
if (message.role === 'assistant') {
|
|
19
26
|
const text = message.content.map(part => part.type === 'text' ? part.text : '').join(' ');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hachej/boring-agent",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.35",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -180,8 +180,8 @@
|
|
|
180
180
|
"@earendil-works/pi-durable": "~1.4.0",
|
|
181
181
|
"@earendil-works/pi-ai": "~1.4.0",
|
|
182
182
|
"@earendil-works/chord": "~1.4.0",
|
|
183
|
-
"@hachej/boring-files": "^0.4.
|
|
184
|
-
"@hachej/boring-ui-kit": "^0.4.
|
|
183
|
+
"@hachej/boring-files": "^0.4.35",
|
|
184
|
+
"@hachej/boring-ui-kit": "^0.4.35",
|
|
185
185
|
"typebox": "1.3.27",
|
|
186
186
|
"xlsx": "^0.20.3"
|
|
187
187
|
},
|