@coffer-org/plugin-orchestrator 2.1.1 → 2.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/dist/runtime/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export { buildPolicy, loadGatePolicy } from './config.ts';
|
|
|
5
5
|
export { makeLiveChannel, plainRender } from './live-message.ts';
|
|
6
6
|
export type { LiveChannelOps, LiveChannelOpts, RenderFn } from './live-message.ts';
|
|
7
7
|
export { chunk } from './format.ts';
|
|
8
|
-
export type { Connector, IncomingConversation, GatePolicy, ReplyContext, ReplyPayload, ReplyChannel, ConvMessage, SystemLayer, AgentRequest, AgentResult, } from './types.ts';
|
|
8
|
+
export type { Connector, IncomingConversation, GatePolicy, ReplyContext, ReplyPayload, ReplyChannel, AttachmentRef, ConvMessage, SystemLayer, AgentRequest, AgentResult, } from './types.ts';
|
|
9
9
|
export declare const serverHooks: PluginHooks;
|
package/dist/runtime/pipeline.js
CHANGED
|
@@ -71,11 +71,18 @@ export async function handleIncoming(connector, conversation, deps) {
|
|
|
71
71
|
if (policy.triggerPrefix && !last.content.toLowerCase().startsWith(policy.triggerPrefix.toLowerCase()))
|
|
72
72
|
return;
|
|
73
73
|
const queryText = policy.triggerPrefix ? last.content.slice(policy.triggerPrefix.length).trim() : last.content.trim();
|
|
74
|
-
if (!queryText)
|
|
74
|
+
if (!queryText) {
|
|
75
|
+
if (conversation.prepareAttachments && !policy.triggerPrefix) {
|
|
76
|
+
await safeCall(conversation.prepareAttachments, messages, 'prepareAttachments');
|
|
77
|
+
}
|
|
75
78
|
return;
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
}
|
|
80
|
+
const preparedMessages = conversation.prepareAttachments
|
|
81
|
+
? await safeCall(conversation.prepareAttachments, messages, 'prepareAttachments')
|
|
78
82
|
: messages;
|
|
83
|
+
const agentMessages = policy.triggerPrefix
|
|
84
|
+
? preparedMessages.map((m, i) => (i === preparedMessages.length - 1 ? { ...m, content: queryText } : m))
|
|
85
|
+
: preparedMessages;
|
|
79
86
|
const base = await agentBase();
|
|
80
87
|
const system = buildSystem({
|
|
81
88
|
base,
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ConvMessage, SystemLayer, AgentRequest, AgentResult } from '@coffer-org/plugin-claude-agent/runtime';
|
|
1
|
+
export type { AttachmentRef, ConvMessage, SystemLayer, AgentRequest, AgentResult } from '@coffer-org/plugin-claude-agent/runtime';
|
|
2
2
|
import type { ConvMessage } from '@coffer-org/plugin-claude-agent/runtime';
|
|
3
3
|
export interface IncomingConversation {
|
|
4
4
|
connectorId: string;
|
|
@@ -10,6 +10,7 @@ export interface IncomingConversation {
|
|
|
10
10
|
displayName?: string;
|
|
11
11
|
};
|
|
12
12
|
messages: ConvMessage[];
|
|
13
|
+
prepareAttachments?: () => Promise<ConvMessage[]>;
|
|
13
14
|
}
|
|
14
15
|
export interface ReplyContext {
|
|
15
16
|
parentMsgId: string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coffer-org/plugin-orchestrator",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=24"
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@coffer-org/sdk": "^2.1.1",
|
|
29
|
-
"@coffer-org/server": "^2.
|
|
30
|
-
"@coffer-org/plugin-claude-agent": "^2.
|
|
29
|
+
"@coffer-org/server": "^2.3.0",
|
|
30
|
+
"@coffer-org/plugin-claude-agent": "^2.5.0"
|
|
31
31
|
},
|
|
32
32
|
"coffer": {
|
|
33
33
|
"schema": "dist/schema.js"
|