@gajae-code/agent-core 0.11.5 → 0.11.7
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/CHANGELOG.md
CHANGED
|
@@ -235,6 +235,12 @@ export interface HandoffOptions {
|
|
|
235
235
|
/** Live agent tool list — same purpose. Forced to `toolChoice: "none"`. */
|
|
236
236
|
tools?: AgentTool<any>[];
|
|
237
237
|
customInstructions?: string;
|
|
238
|
+
/**
|
|
239
|
+
* Optional user-configured extension appended to the base handoff prompt.
|
|
240
|
+
* It SUPPLEMENTS the immutable base (safety/continuity structure); it never
|
|
241
|
+
* replaces `HANDOFF_DOCUMENT_PROMPT`.
|
|
242
|
+
*/
|
|
243
|
+
promptExtension?: string;
|
|
238
244
|
convertToLlm?: ConvertToLlm;
|
|
239
245
|
initiatorOverride?: MessageAttribution;
|
|
240
246
|
metadata?: Record<string, unknown>;
|
|
@@ -254,7 +260,7 @@ export interface HandoffOptions {
|
|
|
254
260
|
/** Hint that websocket transport should be preferred when supported by the provider implementation. */
|
|
255
261
|
preferWebsockets?: boolean;
|
|
256
262
|
}
|
|
257
|
-
export declare function renderHandoffPrompt(customInstructions?: string): string;
|
|
263
|
+
export declare function renderHandoffPrompt(customInstructions?: string, promptExtension?: string): string;
|
|
258
264
|
export declare function generateHandoff(messages: AgentMessage[], model: Model, apiKey: string, options: HandoffOptions, signal?: AbortSignal): Promise<string>;
|
|
259
265
|
export interface CompactionPreparation {
|
|
260
266
|
/** UUID of first entry to keep */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@gajae-code/agent-core",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.7",
|
|
5
5
|
"description": "General-purpose agent with transport abstraction, state management, and attachment support",
|
|
6
6
|
"homepage": "https://gajae-code.com",
|
|
7
7
|
"author": "Yeachan-Heo and Gajae Code Contributors",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"fmt": "biome format --write ."
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@gajae-code/ai": "0.11.
|
|
36
|
-
"@gajae-code/natives": "0.11.
|
|
37
|
-
"@gajae-code/utils": "0.11.
|
|
35
|
+
"@gajae-code/ai": "0.11.7",
|
|
36
|
+
"@gajae-code/natives": "0.11.7",
|
|
37
|
+
"@gajae-code/utils": "0.11.7",
|
|
38
38
|
"@opentelemetry/api": "^1.9.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
@@ -973,6 +973,12 @@ export interface HandoffOptions {
|
|
|
973
973
|
/** Live agent tool list — same purpose. Forced to `toolChoice: "none"`. */
|
|
974
974
|
tools?: AgentTool<any>[];
|
|
975
975
|
customInstructions?: string;
|
|
976
|
+
/**
|
|
977
|
+
* Optional user-configured extension appended to the base handoff prompt.
|
|
978
|
+
* It SUPPLEMENTS the immutable base (safety/continuity structure); it never
|
|
979
|
+
* replaces `HANDOFF_DOCUMENT_PROMPT`.
|
|
980
|
+
*/
|
|
981
|
+
promptExtension?: string;
|
|
976
982
|
convertToLlm?: ConvertToLlm;
|
|
977
983
|
initiatorOverride?: MessageAttribution;
|
|
978
984
|
metadata?: Record<string, unknown>;
|
|
@@ -993,10 +999,11 @@ export interface HandoffOptions {
|
|
|
993
999
|
preferWebsockets?: boolean;
|
|
994
1000
|
}
|
|
995
1001
|
|
|
996
|
-
export function renderHandoffPrompt(customInstructions?: string): string {
|
|
997
|
-
if (!customInstructions) return HANDOFF_DOCUMENT_PROMPT;
|
|
1002
|
+
export function renderHandoffPrompt(customInstructions?: string, promptExtension?: string): string {
|
|
1003
|
+
if (!customInstructions && !promptExtension) return HANDOFF_DOCUMENT_PROMPT;
|
|
998
1004
|
return prompt.render(handoffDocumentPrompt, {
|
|
999
1005
|
additionalFocus: customInstructions,
|
|
1006
|
+
promptExtension,
|
|
1000
1007
|
});
|
|
1001
1008
|
}
|
|
1002
1009
|
|
|
@@ -1012,7 +1019,7 @@ export async function generateHandoff(
|
|
|
1012
1019
|
...llmMessages,
|
|
1013
1020
|
{
|
|
1014
1021
|
role: "user",
|
|
1015
|
-
content: [{ type: "text", text: renderHandoffPrompt(options.customInstructions) }],
|
|
1022
|
+
content: [{ type: "text", text: renderHandoffPrompt(options.customInstructions, options.promptExtension) }],
|
|
1016
1023
|
attribution: "agent",
|
|
1017
1024
|
timestamp: Date.now(),
|
|
1018
1025
|
},
|
|
@@ -42,6 +42,13 @@ Use exactly this structure:
|
|
|
42
42
|
1. [What should happen next]
|
|
43
43
|
</output>
|
|
44
44
|
|
|
45
|
+
{{#if promptExtension}}
|
|
46
|
+
<instruction>
|
|
47
|
+
Additional handoff guidance (supplements — does not replace — the required structure and critical rules above):
|
|
48
|
+
{{promptExtension}}
|
|
49
|
+
</instruction>
|
|
50
|
+
{{/if}}
|
|
51
|
+
|
|
45
52
|
{{#if additionalFocus}}
|
|
46
53
|
<instruction>
|
|
47
54
|
Additional focus: {{additionalFocus}}
|