@rudderhq/agent-runtime-utils 0.7.13 → 0.7.14
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/server-utils.instructions.d.ts.map +1 -1
- package/dist/server-utils.instructions.js +26 -6
- package/dist/server-utils.instructions.js.map +1 -1
- package/dist/server-utils.prompt-boundaries.test.d.ts +2 -0
- package/dist/server-utils.prompt-boundaries.test.d.ts.map +1 -0
- package/dist/server-utils.prompt-boundaries.test.js +44 -0
- package/dist/server-utils.prompt-boundaries.test.js.map +1 -0
- package/dist/server-utils.prompts.d.ts +23 -10
- package/dist/server-utils.prompts.d.ts.map +1 -1
- package/dist/server-utils.prompts.js +65 -27
- package/dist/server-utils.prompts.js.map +1 -1
- package/dist/server-utils.test.js +65 -19
- package/dist/server-utils.test.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,20 +2,21 @@ export const DEFAULT_AGENT_PROMPT_TEMPLATE = `You are agent {{agent.id}} ({{agen
|
|
|
2
2
|
|
|
3
3
|
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
4
4
|
`;
|
|
5
|
-
export const AGENT_ISSUE_CREATION_PROMPT_TEMPLATE =
|
|
5
|
+
export const AGENT_ISSUE_CREATION_PROMPT_TEMPLATE = `<wake_context>
|
|
6
|
+
You are agent {{agent.id}} ({{agent.name}}). A Rudder user explicitly asked you to create one issue in the background.
|
|
6
7
|
|
|
7
8
|
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
8
9
|
|
|
9
|
-
## Agent Issue Creation Request
|
|
10
|
-
|
|
11
10
|
- Request ID: {{context.agentIssueCreationRequest.id}}
|
|
12
11
|
- Requested by user: {{context.agentIssueCreationRequest.requestedByUserId}}
|
|
13
12
|
- Project context: {{context.agentIssueCreationRequest.projectId}}
|
|
14
13
|
- Goal context: {{context.agentIssueCreationRequest.goalId}}
|
|
15
14
|
- Parent issue context: {{context.agentIssueCreationRequest.parentId}}
|
|
15
|
+
</wake_context>
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
<quoted_issue_context>
|
|
18
18
|
{{context.agentIssueCreationRequest.instruction}}
|
|
19
|
+
</quoted_issue_context>
|
|
19
20
|
|
|
20
21
|
## Required Behavior
|
|
21
22
|
|
|
@@ -402,12 +403,11 @@ export function isCommentTriggeredIssueWakeReason(wakeReason) {
|
|
|
402
403
|
export const ISSUE_ASSIGNEE_EXECUTION_RAIL = "Before doing issue-scoped execution as the assignee, check out the assigned issue. If checkout returns `409`, do not retry; stop and report the ownership conflict.";
|
|
403
404
|
export const ISSUE_ASSIGNEE_EXPLICIT_WORK_RAIL = "You are the issue's current assignee. This explicit request is authorized by that relationship regardless of the issue's current status. This run already holds the issue execution lease: do not check out the issue, do not change assignment, and preserve its current status unless the user explicitly requests a lifecycle change.";
|
|
404
405
|
export const ISSUE_REVIEWER_EXPLICIT_WORK_RAIL = "You are the issue's current reviewer. This explicit request is authorized by that relationship regardless of the issue's current status. This run already holds the issue execution lease: do not check out the issue, do not take over the assignee's ownership, and preserve its current status unless the user explicitly requests a lifecycle change.";
|
|
405
|
-
export const ISSUE_ASSIGN_PROMPT_TEMPLATE =
|
|
406
|
+
export const ISSUE_ASSIGN_PROMPT_TEMPLATE = `<wake_context>
|
|
407
|
+
You are agent {{agent.id}} ({{agent.name}}). You have been assigned to work on an issue.
|
|
406
408
|
|
|
407
409
|
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
408
410
|
|
|
409
|
-
## Task Context
|
|
410
|
-
|
|
411
411
|
**Issue:** {{issue.title}}
|
|
412
412
|
**ID:** {{issue.id}}
|
|
413
413
|
**Status:** {{issue.status}}
|
|
@@ -416,21 +416,23 @@ export const ISSUE_ASSIGN_PROMPT_TEMPLATE = `You are agent {{agent.id}} ({{agent
|
|
|
416
416
|
**Reviewer:** {{issue.reviewerLabel}}
|
|
417
417
|
**Created At:** {{issue.createdAt}}
|
|
418
418
|
**Updated At:** {{issue.updatedAt}}
|
|
419
|
+
</wake_context>
|
|
419
420
|
|
|
421
|
+
<quoted_issue_context>
|
|
420
422
|
**Description:**
|
|
421
423
|
{{issue.description}}
|
|
424
|
+
</quoted_issue_context>
|
|
422
425
|
|
|
423
426
|
|
|
424
427
|
Your task is to review this issue, understand what kind of work it asks for, and take the appropriate next action.
|
|
425
428
|
|
|
426
429
|
Do not assume every issue is a codebase task. If the issue is a question, screenshot check, review, planning request, coordination task, or another non-code request, answer or handle that request directly. Inspect the codebase and implement a change only when the issue actually asks for engineering work or when the relevant project resources make code changes necessary.
|
|
427
430
|
${ISSUE_ASSIGNEE_EXECUTION_RAIL}`;
|
|
428
|
-
export const COMMENT_MENTION_PROMPT_TEMPLATE =
|
|
431
|
+
export const COMMENT_MENTION_PROMPT_TEMPLATE = `<wake_context>
|
|
432
|
+
You are agent {{agent.id}} ({{agent.name}}). You were mentioned in a comment and your attention is needed.
|
|
429
433
|
|
|
430
434
|
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
431
435
|
|
|
432
|
-
## Context
|
|
433
|
-
|
|
434
436
|
**Issue:** {{issue.title}}
|
|
435
437
|
**ID:** {{issue.id}}
|
|
436
438
|
**Status:** {{issue.status}}
|
|
@@ -438,7 +440,9 @@ export const COMMENT_MENTION_PROMPT_TEMPLATE = `You are agent {{agent.id}} ({{ag
|
|
|
438
440
|
**Reviewer:** {{issue.reviewerLabel}}
|
|
439
441
|
**Created At:** {{issue.createdAt}}
|
|
440
442
|
**Updated At:** {{issue.updatedAt}}
|
|
443
|
+
</wake_context>
|
|
441
444
|
|
|
445
|
+
<quoted_issue_context>
|
|
442
446
|
**Issue Description:**
|
|
443
447
|
{{issue.description}}
|
|
444
448
|
|
|
@@ -447,17 +451,17 @@ export const COMMENT_MENTION_PROMPT_TEMPLATE = `You are agent {{agent.id}} ({{ag
|
|
|
447
451
|
From: {{comment.authorLabel}} ({{comment.authorKind}})
|
|
448
452
|
|
|
449
453
|
{{comment.body}}
|
|
454
|
+
</quoted_issue_context>
|
|
450
455
|
|
|
451
456
|
Please review the comment above and respond or take action as appropriate.
|
|
452
457
|
A mention-triggered comment wake is a request for attention or collaboration, not an automatic transfer of issue ownership. Plain structured agent links such as \`agent://agent-id\` are reference-only. Only checkout or self-assign when the comment explicitly asks you to take ownership and the normal issue workflow allows it.
|
|
453
458
|
If the issue is not assigned to you, including user-owned or unassigned issues, and the comment does not explicitly ask you to implement, modify files, close the issue, or take ownership, strictly respond to the comment's content instead of broadening the wake into issue execution. For example, answer questions, acknowledge corrections, explain status, or handle only the narrow action explicitly requested by the comment.
|
|
454
459
|
If the issue has related attachments, such as images or articles, please ensure you have thoroughly researched and read these resources before proceeding with the next action. It's important to read all the attachments before taking any action.`;
|
|
455
|
-
export const ISSUE_COMMENTED_PROMPT_TEMPLATE =
|
|
460
|
+
export const ISSUE_COMMENTED_PROMPT_TEMPLATE = `<wake_context>
|
|
461
|
+
You are agent {{agent.id}} ({{agent.name}}). There is a new comment on an issue you own.
|
|
456
462
|
|
|
457
463
|
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
458
464
|
|
|
459
|
-
## Context
|
|
460
|
-
|
|
461
465
|
**Issue:** {{issue.title}}
|
|
462
466
|
**ID:** {{issue.id}}
|
|
463
467
|
**Status:** {{issue.status}}
|
|
@@ -465,7 +469,9 @@ export const ISSUE_COMMENTED_PROMPT_TEMPLATE = `You are agent {{agent.id}} ({{ag
|
|
|
465
469
|
**Reviewer:** {{issue.reviewerLabel}}
|
|
466
470
|
**Created At:** {{issue.createdAt}}
|
|
467
471
|
**Updated At:** {{issue.updatedAt}}
|
|
472
|
+
</wake_context>
|
|
468
473
|
|
|
474
|
+
<quoted_issue_context>
|
|
469
475
|
**Issue Description:**
|
|
470
476
|
{{issue.description}}
|
|
471
477
|
|
|
@@ -474,15 +480,15 @@ export const ISSUE_COMMENTED_PROMPT_TEMPLATE = `You are agent {{agent.id}} ({{ag
|
|
|
474
480
|
From: {{comment.authorLabel}} ({{comment.authorKind}})
|
|
475
481
|
|
|
476
482
|
{{comment.body}}
|
|
483
|
+
</quoted_issue_context>
|
|
477
484
|
|
|
478
485
|
Review the new comment and continue the issue from the current state. Respond or take action as needed.
|
|
479
486
|
${ISSUE_ASSIGNEE_EXECUTION_RAIL}`;
|
|
480
|
-
export const ISSUE_CHANGES_REQUESTED_PROMPT_TEMPLATE =
|
|
487
|
+
export const ISSUE_CHANGES_REQUESTED_PROMPT_TEMPLATE = `<wake_context>
|
|
488
|
+
You are agent {{agent.id}} ({{agent.name}}). A reviewer requested changes on an issue you own.
|
|
481
489
|
|
|
482
490
|
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
483
491
|
|
|
484
|
-
## Context
|
|
485
|
-
|
|
486
492
|
**Issue:** {{issue.title}}
|
|
487
493
|
**ID:** {{issue.id}}
|
|
488
494
|
**Status:** {{issue.status}}
|
|
@@ -490,7 +496,9 @@ export const ISSUE_CHANGES_REQUESTED_PROMPT_TEMPLATE = `You are agent {{agent.id
|
|
|
490
496
|
**Reviewer:** {{issue.reviewerLabel}}
|
|
491
497
|
**Created At:** {{issue.createdAt}}
|
|
492
498
|
**Updated At:** {{issue.updatedAt}}
|
|
499
|
+
</wake_context>
|
|
493
500
|
|
|
501
|
+
<quoted_issue_context>
|
|
494
502
|
**Issue Description:**
|
|
495
503
|
{{issue.description}}
|
|
496
504
|
|
|
@@ -499,15 +507,15 @@ export const ISSUE_CHANGES_REQUESTED_PROMPT_TEMPLATE = `You are agent {{agent.id
|
|
|
499
507
|
From: {{comment.authorLabel}} ({{comment.authorKind}})
|
|
500
508
|
|
|
501
509
|
{{comment.body}}
|
|
510
|
+
</quoted_issue_context>
|
|
502
511
|
|
|
503
512
|
Review the requested changes and continue the issue from the current state. Address the reviewer feedback before handing it back for review.
|
|
504
513
|
${ISSUE_ASSIGNEE_EXECUTION_RAIL}`;
|
|
505
|
-
export const ISSUE_REVIEW_PROMPT_TEMPLATE =
|
|
514
|
+
export const ISSUE_REVIEW_PROMPT_TEMPLATE = `<wake_context>
|
|
515
|
+
You are agent {{agent.id}} ({{agent.name}}). You have been asked to review an issue.
|
|
506
516
|
|
|
507
517
|
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
508
518
|
|
|
509
|
-
## Review Context
|
|
510
|
-
|
|
511
519
|
**Issue:** {{issue.title}}
|
|
512
520
|
**ID:** {{issue.id}}
|
|
513
521
|
**Status:** {{issue.status}}
|
|
@@ -516,16 +524,20 @@ export const ISSUE_REVIEW_PROMPT_TEMPLATE = `You are agent {{agent.id}} ({{agent
|
|
|
516
524
|
**Reviewer:** {{issue.reviewerLabel}}
|
|
517
525
|
**Created At:** {{issue.createdAt}}
|
|
518
526
|
**Updated At:** {{issue.updatedAt}}
|
|
527
|
+
</wake_context>
|
|
519
528
|
|
|
529
|
+
<quoted_issue_context>
|
|
520
530
|
**Issue Description:**
|
|
521
531
|
{{issue.description}}
|
|
522
532
|
|
|
523
533
|
|
|
524
534
|
**Review Instructions:**
|
|
525
535
|
{{context.reviewInstructions}}
|
|
536
|
+
</quoted_issue_context>
|
|
526
537
|
|
|
527
538
|
Inspect the issue state, evidence, comments, and outputs before deciding. Record the requested review outcome instead of treating this as a fresh implementation assignment.`;
|
|
528
|
-
export const ISSUE_REVIEW_RECOVERY_PROMPT_TEMPLATE =
|
|
539
|
+
export const ISSUE_REVIEW_RECOVERY_PROMPT_TEMPLATE = `<wake_context>
|
|
540
|
+
You are agent {{agent.id}} ({{agent.name}}). This is a reviewer recovery run, not a fresh implementation assignment.
|
|
529
541
|
|
|
530
542
|
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
531
543
|
|
|
@@ -547,16 +559,20 @@ export const ISSUE_REVIEW_RECOVERY_PROMPT_TEMPLATE = `You are agent {{agent.id}}
|
|
|
547
559
|
- Reviewer: {{issue.reviewerLabel}}
|
|
548
560
|
- Created At: {{issue.createdAt}}
|
|
549
561
|
- Updated At: {{issue.updatedAt}}
|
|
562
|
+
</wake_context>
|
|
550
563
|
|
|
564
|
+
<quoted_issue_context>
|
|
551
565
|
- Description:
|
|
552
566
|
{{issue.description}}
|
|
553
567
|
|
|
554
568
|
|
|
555
569
|
**Review Instructions:**
|
|
556
570
|
{{context.reviewInstructions}}
|
|
571
|
+
</quoted_issue_context>
|
|
557
572
|
|
|
558
573
|
Inspect what the previous reviewer run already completed, then continue the review from the current state. Record the requested structured reviewer decision; do not take over the assignee's implementation.`;
|
|
559
|
-
export const ISSUE_RECOVERY_PROMPT_TEMPLATE =
|
|
574
|
+
export const ISSUE_RECOVERY_PROMPT_TEMPLATE = `<wake_context>
|
|
575
|
+
You are agent {{agent.id}} ({{agent.name}}). This is a recovery run, not a fresh task.
|
|
560
576
|
|
|
561
577
|
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
562
578
|
|
|
@@ -578,14 +594,18 @@ export const ISSUE_RECOVERY_PROMPT_TEMPLATE = `You are agent {{agent.id}} ({{age
|
|
|
578
594
|
- Reviewer: {{issue.reviewerLabel}}
|
|
579
595
|
- Created At: {{issue.createdAt}}
|
|
580
596
|
- Updated At: {{issue.updatedAt}}
|
|
597
|
+
</wake_context>
|
|
581
598
|
|
|
599
|
+
<quoted_issue_context>
|
|
582
600
|
- Description:
|
|
583
601
|
{{issue.description}}
|
|
602
|
+
</quoted_issue_context>
|
|
584
603
|
|
|
585
604
|
|
|
586
605
|
Before doing anything else, inspect what the previous run already completed and any side effects it may have caused. Continue the remaining work from the current state. Avoid blindly re-running the whole task.
|
|
587
606
|
${ISSUE_ASSIGNEE_EXECUTION_RAIL}`;
|
|
588
|
-
export const RECOVERY_PROMPT_TEMPLATE =
|
|
607
|
+
export const RECOVERY_PROMPT_TEMPLATE = `<wake_context>
|
|
608
|
+
You are agent {{agent.id}} ({{agent.name}}). This is a recovery run, not a fresh task.
|
|
589
609
|
|
|
590
610
|
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
591
611
|
|
|
@@ -596,9 +616,11 @@ export const RECOVERY_PROMPT_TEMPLATE = `You are agent {{agent.id}} ({{agent.nam
|
|
|
596
616
|
- Failure Summary: {{context.recovery.failureSummary}}
|
|
597
617
|
- Recovery Trigger: {{context.recovery.recoveryTrigger}}
|
|
598
618
|
- Recovery Mode: {{context.recovery.recoveryMode}}
|
|
619
|
+
</wake_context>
|
|
599
620
|
|
|
600
621
|
Before doing anything else, inspect what the previous run already completed and any side effects it may have caused. Continue the remaining work from the current state. Avoid blindly re-running the whole task.`;
|
|
601
|
-
export const ISSUE_PASSIVE_FOLLOWUP_PROMPT_TEMPLATE =
|
|
622
|
+
export const ISSUE_PASSIVE_FOLLOWUP_PROMPT_TEMPLATE = `<wake_context>
|
|
623
|
+
You are agent {{agent.id}} ({{agent.name}}). This is a passive issue follow-up, not a fresh assignment and not a failure recovery.
|
|
602
624
|
|
|
603
625
|
{{context.rudderWorkspace.orgResourcesPrompt}}
|
|
604
626
|
|
|
@@ -621,9 +643,12 @@ Reason: {{context.passiveFollowup.reason}}
|
|
|
621
643
|
- Reviewer: {{issue.reviewerLabel}}
|
|
622
644
|
- Created At: {{issue.createdAt}}
|
|
623
645
|
- Updated At: {{issue.updatedAt}}
|
|
646
|
+
</wake_context>
|
|
624
647
|
|
|
648
|
+
<quoted_issue_context>
|
|
625
649
|
- Description:
|
|
626
650
|
{{issue.description}}
|
|
651
|
+
</quoted_issue_context>
|
|
627
652
|
|
|
628
653
|
|
|
629
654
|
Before changing the issue, continue to progress the current issue, then inspect the current issue state and any side effects from the previous run. Finally, do exactly one close-out action: add a progress comment, mark the issue done, block it with a reason, or hand it off explicitly with explanation.
|
|
@@ -762,9 +787,24 @@ export function joinPromptSections(sections, separator = "\n\n") {
|
|
|
762
787
|
.filter(Boolean)
|
|
763
788
|
.join(separator);
|
|
764
789
|
}
|
|
790
|
+
export const RUDDER_PROMPT_SECTION_TAGS = {
|
|
791
|
+
agentInstruction: "rudder_agent_instruction",
|
|
792
|
+
agentOperatingContract: "rudder_agent_operating_contract",
|
|
793
|
+
heartbeatInstruction: "rudder_heartbeat_instruction",
|
|
794
|
+
recentContext: "recent_rudder_context",
|
|
795
|
+
projectContextResources: "project_context_resources",
|
|
796
|
+
connectedCustomIntegrationTools: "connected_custom_integration_tools",
|
|
797
|
+
currentAutomations: "current_automations",
|
|
798
|
+
enabledSkills: "enabled_rudder_skills",
|
|
799
|
+
wakeContext: "wake_context",
|
|
800
|
+
quotedIssueContext: "quoted_issue_context",
|
|
801
|
+
};
|
|
802
|
+
export function wrapPromptSection(tagName, content) {
|
|
803
|
+
if (!content.trim())
|
|
804
|
+
return "";
|
|
805
|
+
return `<${tagName}>\n${content}\n</${tagName}>`;
|
|
806
|
+
}
|
|
765
807
|
export const RUDDER_AGENT_OPERATING_CONTRACT = [
|
|
766
|
-
"# Rudder Agent Operating Contract",
|
|
767
|
-
"",
|
|
768
808
|
"You are a helpful assistant running inside Rudder. Your home directory is `$AGENT_HOME`. Everything personal to you -- life, memory, knowledge -- lives there. Other agents may have their own folders and you may update them when necessary.",
|
|
769
809
|
"",
|
|
770
810
|
"Read Rudder mcp tools to firstly.",
|
|
@@ -825,8 +865,6 @@ export const RUDDER_AGENT_OPERATING_CONTRACT = [
|
|
|
825
865
|
"- When the user explicitly mentions previously handled issue, tasks or conversations, you need to retrieve the relevant tasks first before proceeding with the next action."
|
|
826
866
|
].join("\n");
|
|
827
867
|
export const RUDDER_AGENT_HEARTBEAT_INSTRUCTION = [
|
|
828
|
-
"# Rudder Heartbeat Instruction",
|
|
829
|
-
"",
|
|
830
868
|
"This section is injected by Rudder only for heartbeat scene runs. It is the platform-owned heartbeat/self-check pipeline.",
|
|
831
869
|
"",
|
|
832
870
|
"## Heartbeat Pipeline",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-utils.prompts.js","sourceRoot":"","sources":["../src/server-utils.prompts.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,6BAA6B,GACxC;;;CAGD,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAAG;;;;;;;;;;;;;;;;;;;0XAmBsU,CAAC;AAE3X,MAAM,4BAA4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AAoL;IACpL,6fAA6f;IAC7f,iiBAAiiB;IACjiB,gUAAgU;IAChU,0KAA0K;IAC1K,8NAA8N;IAC9N,EAAE;IACF,mWAAmW;IACnW,uIAAuI;IACvI,EAAE;IACF,iLAAiL;IACjL,wYAAwY;IACxY,EAAE;IACF,4BAA4B;IAC5B,EAAE;IACF,8NAA8N;IAC9N,EAAE;IACF,uGAAuG;IACvG,kNAAkN;IAClN,wFAAwF;IACxF,4EAA4E;IAC5E,4FAA4F;IAC5F,+OAA+O;IAC/O,kYAAkY;IAClY,EAAE;IACF,8HAA8H;IAC9H,EAAE;IACF,2nCAA2nC;IAC3nC,EAAE;IACF,yOAAyO;IACzO,EAAE;IACF,iCAAiC;IACjC,EAAE;IACF,8YAA8Y;IAC9Y,EAAE;IACF,uVAAuV;IACvV,EAAE;IACF,0EAA0E;IAC1E,EAAE;IACF,UAAU;IACV,oSAAoS;IACpS,6KAA6K;CAC9K,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,2HAA2H;IAC3H,EAAE;IACF,uBAAuB;IACvB,EAAE;IACF,mKAAmK;IACnK,0BAA0B;IAC1B,KAAK;IACL,2KAA2K;IAC3K,iFAAiF;IACjF,+CAA+C;IAC/C,KAAK;IACL,6HAA6H;IAC7H,yKAAyK;IACzK,8ZAA8Z;IAC9Z,oFAAoF;IACpF,gbAAgb;IAChb,wEAAwE;IACxE,kHAAkH;IAClH,EAAE;IACF,8YAA8Y;CAC/Y,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -918,7 +918,9 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
918
918
|
instructionsFilePath: "",
|
|
919
919
|
onLog: async () => { },
|
|
920
920
|
});
|
|
921
|
-
expect(loaded.prefix).toContain("
|
|
921
|
+
expect(loaded.prefix).toContain("<rudder_agent_operating_contract>");
|
|
922
|
+
expect(loaded.prefix).toContain("</rudder_agent_operating_contract>");
|
|
923
|
+
expect(loaded.prefix).not.toContain("# Rudder Agent Operating Contract");
|
|
922
924
|
expect(loaded.prefix).toContain(RUDDER_AGENT_OPERATING_CONTRACT);
|
|
923
925
|
expect(loaded.prefix).toContain("installed but not enabled");
|
|
924
926
|
expect(loaded.prefix).toContain("library:projects/<project-key>/");
|
|
@@ -971,7 +973,8 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
971
973
|
includeHeartbeatInstructions: true,
|
|
972
974
|
onLog: async () => { },
|
|
973
975
|
});
|
|
974
|
-
expect(loaded.prefix).toContain("
|
|
976
|
+
expect(loaded.prefix).toContain("<rudder_agent_operating_contract>");
|
|
977
|
+
expect(loaded.prefix).toContain("<rudder_heartbeat_instruction>");
|
|
975
978
|
expect(loaded.prefix).toContain(RUDDER_AGENT_HEARTBEAT_INSTRUCTION);
|
|
976
979
|
expect(loaded.prefix).toContain("platform-owned heartbeat/self-check pipeline");
|
|
977
980
|
expect(loaded.commandNotes).toEqual([
|
|
@@ -1006,8 +1009,9 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
1006
1009
|
logs.push({ stream, chunk });
|
|
1007
1010
|
},
|
|
1008
1011
|
});
|
|
1009
|
-
expect(loaded.prefix).toContain("
|
|
1012
|
+
expect(loaded.prefix).toContain("<rudder_agent_operating_contract>");
|
|
1010
1013
|
expect(loaded.prefix).toContain("# Agent Instructions");
|
|
1014
|
+
expect(loaded.prefix).toContain("<AGENTS.md>\n# Agent Instructions\n</AGENTS.md>");
|
|
1011
1015
|
expect(loaded.prefix).toContain("The above AGENTS.md instruction file was loaded from $AGENT_HOME/instructions.");
|
|
1012
1016
|
expect(loaded.prefix).toContain("relative file references from $AGENT_HOME/instructions/");
|
|
1013
1017
|
expect(loaded.prefix).not.toContain("Tacit Memory");
|
|
@@ -1030,6 +1034,41 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
1030
1034
|
await fs.rm(root, { recursive: true, force: true });
|
|
1031
1035
|
}
|
|
1032
1036
|
});
|
|
1037
|
+
it("uses a stable escaped wrapper for a non-canonical configured entry file", async () => {
|
|
1038
|
+
const root = await fs.mkdtemp(path.join(os.tmpdir(), "rudder-load-agent-instructions-custom-entry-"));
|
|
1039
|
+
const instructionsPath = path.join(root, "instructions", "custom role.md");
|
|
1040
|
+
const contents = " generic entry code block\n\nKeep <angle brackets> and Markdown unchanged.\n";
|
|
1041
|
+
await fs.mkdir(path.dirname(instructionsPath), { recursive: true });
|
|
1042
|
+
await fs.writeFile(instructionsPath, contents, "utf8");
|
|
1043
|
+
try {
|
|
1044
|
+
const loaded = await loadAgentInstructionsPrefix({
|
|
1045
|
+
instructionsFilePath: instructionsPath,
|
|
1046
|
+
onLog: async () => { },
|
|
1047
|
+
});
|
|
1048
|
+
expect(loaded.prefix).toContain(`<agent_instruction_file path="$AGENT_HOME/instructions/custom role.md">\n${contents.trimEnd()}\n</agent_instruction_file>`);
|
|
1049
|
+
expect(loaded.prefix).not.toContain("<custom role.md>");
|
|
1050
|
+
}
|
|
1051
|
+
finally {
|
|
1052
|
+
await fs.rm(root, { recursive: true, force: true });
|
|
1053
|
+
}
|
|
1054
|
+
});
|
|
1055
|
+
it("preserves leading blank lines and indented Markdown in canonical instruction files", async () => {
|
|
1056
|
+
const root = await fs.mkdtemp(path.join(os.tmpdir(), "rudder-load-agent-instructions-leading-markdown-"));
|
|
1057
|
+
const instructionsPath = path.join(root, "instructions", "SOUL.md");
|
|
1058
|
+
const contents = "\n canonical code block\n\nKeep the leading bytes.\n";
|
|
1059
|
+
await fs.mkdir(path.dirname(instructionsPath), { recursive: true });
|
|
1060
|
+
await fs.writeFile(instructionsPath, contents, "utf8");
|
|
1061
|
+
try {
|
|
1062
|
+
const loaded = await loadAgentInstructionsPrefix({
|
|
1063
|
+
instructionsFilePath: instructionsPath,
|
|
1064
|
+
onLog: async () => { },
|
|
1065
|
+
});
|
|
1066
|
+
expect(loaded.prefix).toContain(`<SOUL.md>\n${contents.trimEnd()}\n</SOUL.md>`);
|
|
1067
|
+
}
|
|
1068
|
+
finally {
|
|
1069
|
+
await fs.rm(root, { recursive: true, force: true });
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1033
1072
|
it("loads the entry instructions file plus sibling SOUL.md, TOOLS.md, and MEMORY.md", async () => {
|
|
1034
1073
|
const root = await fs.mkdtemp(path.join(os.tmpdir(), "rudder-load-agent-instructions-memory-"));
|
|
1035
1074
|
const instructionsPath = path.join(root, "instructions", "AGENTS.md");
|
|
@@ -1052,6 +1091,10 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
1052
1091
|
expect(loaded.prefix).toContain("# Persona");
|
|
1053
1092
|
expect(loaded.prefix).toContain("# Tools");
|
|
1054
1093
|
expect(loaded.prefix).toContain("# Tacit Memory");
|
|
1094
|
+
expect(loaded.prefix).toContain("<AGENTS.md>\n# Agent Instructions\n</AGENTS.md>");
|
|
1095
|
+
expect(loaded.prefix).toContain("<SOUL.md>\n# Persona\n\nYou are QA.\n</SOUL.md>");
|
|
1096
|
+
expect(loaded.prefix).toContain("<TOOLS.md>\n# Tools\n\n- Use rudder.\n</TOOLS.md>");
|
|
1097
|
+
expect(loaded.prefix).toContain("<MEMORY.md>\n# Tacit Memory\n\n- Prefer concise updates.\n</MEMORY.md>");
|
|
1055
1098
|
expect(loaded.prefix).not.toContain("# Heartbeat");
|
|
1056
1099
|
expect(loaded.prefix).not.toContain("## Current Time");
|
|
1057
1100
|
expect(loaded.prefix).toContain("The above AGENTS.md, SOUL.md, TOOLS.md, MEMORY.md instruction files were loaded from $AGENT_HOME/instructions.");
|
|
@@ -1091,15 +1134,15 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
1091
1134
|
const loaded = await loadAgentInstructionsPrefix({
|
|
1092
1135
|
instructionsFilePath: instructionsPath,
|
|
1093
1136
|
includeHeartbeatInstructions: true,
|
|
1094
|
-
instructionContextSections: ["
|
|
1137
|
+
instructionContextSections: ["<recent_rudder_context>\n#### today memory: 2026-06-21.md\n- Calibrate prompt stack\n</recent_rudder_context>"],
|
|
1095
1138
|
onLog: async () => { },
|
|
1096
1139
|
});
|
|
1097
|
-
const operatingContractIndex = loaded.prefix.indexOf("
|
|
1140
|
+
const operatingContractIndex = loaded.prefix.indexOf("<rudder_agent_operating_contract>");
|
|
1098
1141
|
const soulIndex = loaded.prefix.indexOf("# Persona");
|
|
1099
1142
|
const toolsIndex = loaded.prefix.indexOf("# Tool Notes");
|
|
1100
1143
|
const memoryIndex = loaded.prefix.indexOf("# Memory Notes");
|
|
1101
|
-
const recentContextIndex = loaded.prefix.indexOf("
|
|
1102
|
-
const heartbeatIndex = loaded.prefix.indexOf("
|
|
1144
|
+
const recentContextIndex = loaded.prefix.indexOf("<recent_rudder_context>");
|
|
1145
|
+
const heartbeatIndex = loaded.prefix.indexOf("<rudder_heartbeat_instruction>");
|
|
1103
1146
|
expect(operatingContractIndex).toBeGreaterThanOrEqual(0);
|
|
1104
1147
|
expect(soulIndex).toBeGreaterThan(operatingContractIndex);
|
|
1105
1148
|
expect(toolsIndex).toBeGreaterThan(soulIndex);
|
|
@@ -1110,6 +1153,9 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
1110
1153
|
expect(loaded.prefix).toContain("# Persona");
|
|
1111
1154
|
expect(loaded.prefix).toContain("# Tool Notes");
|
|
1112
1155
|
expect(loaded.prefix).toContain("# Memory Notes");
|
|
1156
|
+
expect(loaded.prefix).toContain("<SOUL.md>\n# Persona");
|
|
1157
|
+
expect(loaded.prefix).toContain("<TOOLS.md>\n# Tool Notes");
|
|
1158
|
+
expect(loaded.prefix).toContain("<MEMORY.md>\n# Memory Notes");
|
|
1113
1159
|
expect(loaded.prefix).not.toContain("## Agent Instruction:");
|
|
1114
1160
|
expect(loaded.prefix).not.toContain("Agent Instruction: SOUL.md");
|
|
1115
1161
|
expect(loaded.prefix).not.toContain("The above SOUL.md content was loaded");
|
|
@@ -1135,7 +1181,7 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
1135
1181
|
onLog: async () => { },
|
|
1136
1182
|
});
|
|
1137
1183
|
expect(loaded.prefix).toContain("# Persona");
|
|
1138
|
-
expect(loaded.prefix).toContain("
|
|
1184
|
+
expect(loaded.prefix).toContain("<rudder_heartbeat_instruction>");
|
|
1139
1185
|
expect(loaded.prefix).not.toContain("# Heartbeat\n\n- Check assignments.");
|
|
1140
1186
|
expect(loaded.commandNotes).toContain("Loaded Rudder heartbeat instructions from runtime code");
|
|
1141
1187
|
expect(loaded.commandNotes).not.toContain("Loaded supplemental agent heartbeat notes from $AGENT_HOME/instructions/HEARTBEAT.md");
|
|
@@ -1159,8 +1205,8 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
1159
1205
|
try {
|
|
1160
1206
|
const instructionContext = prepareAgentInstructionRuntimeContext({
|
|
1161
1207
|
rudderWorkspace: {
|
|
1162
|
-
orgResourcesPrompt: "
|
|
1163
|
-
resourcesPrompt: "
|
|
1208
|
+
orgResourcesPrompt: "<current_automations>\n- Morning review\n</current_automations>",
|
|
1209
|
+
resourcesPrompt: "<current_automations>\n- Morning review\n</current_automations>",
|
|
1164
1210
|
},
|
|
1165
1211
|
});
|
|
1166
1212
|
const loaded = await loadAgentInstructionsPrefix({
|
|
@@ -1169,13 +1215,13 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
1169
1215
|
instructionContextSections: instructionContext.instructionContextSections,
|
|
1170
1216
|
onLog: async () => { },
|
|
1171
1217
|
});
|
|
1172
|
-
const operatingContractIndex = loaded.prefix.indexOf("
|
|
1218
|
+
const operatingContractIndex = loaded.prefix.indexOf("<rudder_agent_operating_contract>");
|
|
1173
1219
|
const agentContractIndex = loaded.prefix.indexOf("# Agent Contract");
|
|
1174
1220
|
const soulIndex = loaded.prefix.indexOf("# Agent Soul");
|
|
1175
1221
|
const toolsIndex = loaded.prefix.indexOf("# Agent Tools");
|
|
1176
1222
|
const memoryIndex = loaded.prefix.indexOf("# Agent Memory");
|
|
1177
|
-
const automationsIndex = loaded.prefix.indexOf("
|
|
1178
|
-
const heartbeatIndex = loaded.prefix.indexOf("
|
|
1223
|
+
const automationsIndex = loaded.prefix.indexOf("<current_automations>");
|
|
1224
|
+
const heartbeatIndex = loaded.prefix.indexOf("<rudder_heartbeat_instruction>");
|
|
1179
1225
|
expect(operatingContractIndex).toBeGreaterThanOrEqual(0);
|
|
1180
1226
|
expect(agentContractIndex).toBeGreaterThan(operatingContractIndex);
|
|
1181
1227
|
expect(soulIndex).toBeGreaterThan(agentContractIndex);
|
|
@@ -1184,7 +1230,7 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
1184
1230
|
expect(automationsIndex).toBeGreaterThan(memoryIndex);
|
|
1185
1231
|
expect(heartbeatIndex).toBeGreaterThan(automationsIndex);
|
|
1186
1232
|
expect(loaded.prefix).not.toContain("## Current Time");
|
|
1187
|
-
expect(loaded.prefix).toMatch(
|
|
1233
|
+
expect(loaded.prefix).toMatch(/<rudder_heartbeat_instruction>[\s\S]*runtime\.\n<\/rudder_heartbeat_instruction>$/);
|
|
1188
1234
|
expect(renderTemplate("{{context.rudderWorkspace.orgResourcesPrompt}}", { context: instructionContext.promptContext })).toBe("");
|
|
1189
1235
|
}
|
|
1190
1236
|
finally {
|
|
@@ -1192,7 +1238,7 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
1192
1238
|
}
|
|
1193
1239
|
});
|
|
1194
1240
|
it("moves all documented resource prompt aliases into the stable instruction stack", async () => {
|
|
1195
|
-
const canonicalPrompt = "
|
|
1241
|
+
const canonicalPrompt = "<current_automations>\n- Canonical\n</current_automations>";
|
|
1196
1242
|
const topLevelOnly = prepareAgentInstructionRuntimeContext({
|
|
1197
1243
|
rudderResourcesPrompt: canonicalPrompt,
|
|
1198
1244
|
});
|
|
@@ -1214,7 +1260,7 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
1214
1260
|
expect(renderTemplate("{{context.rudderWorkspace.orgResourcesPrompt}}", { context: legacyOnly.promptContext })).toBe("");
|
|
1215
1261
|
});
|
|
1216
1262
|
it("prefers canonical resourcesPrompt and only clears matching resource prompt aliases", async () => {
|
|
1217
|
-
const canonicalPrompt = "
|
|
1263
|
+
const canonicalPrompt = "<project_context_resources>\n- Canonical library context\n</project_context_resources>";
|
|
1218
1264
|
const legacyPrompt = "## Legacy Resources\n\n- Legacy fallback";
|
|
1219
1265
|
const prepared = prepareAgentInstructionRuntimeContext({
|
|
1220
1266
|
rudderResourcesPrompt: canonicalPrompt,
|
|
@@ -1241,7 +1287,7 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
1241
1287
|
logs.push({ stream, chunk });
|
|
1242
1288
|
},
|
|
1243
1289
|
});
|
|
1244
|
-
expect(loaded.prefix).toContain("
|
|
1290
|
+
expect(loaded.prefix).toContain("<rudder_agent_operating_contract>");
|
|
1245
1291
|
expect(loaded.prefix).not.toContain("# Heartbeat");
|
|
1246
1292
|
expect(loaded.commandNotes).toContain("Ignored legacy HEARTBEAT.md instructions file: $AGENT_HOME/instructions/HEARTBEAT.md");
|
|
1247
1293
|
expect(loaded.heartbeatFilePath).toBeNull();
|
|
@@ -1270,7 +1316,7 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
1270
1316
|
includeHeartbeatInstructions: true,
|
|
1271
1317
|
onLog: async () => { },
|
|
1272
1318
|
});
|
|
1273
|
-
expect(loaded.prefix).toContain("
|
|
1319
|
+
expect(loaded.prefix).toContain("<rudder_heartbeat_instruction>");
|
|
1274
1320
|
expect(loaded.prefix).not.toContain("# Heartbeat\n\n- Check assignments.");
|
|
1275
1321
|
expect(loaded.commandNotes).toContain("Loaded Rudder heartbeat instructions from runtime code");
|
|
1276
1322
|
expect(loaded.commandNotes).toContain("Ignored legacy HEARTBEAT.md instructions file: $AGENT_HOME/instructions/HEARTBEAT.md");
|
|
@@ -1296,7 +1342,7 @@ describe("loadAgentInstructionsPrefix", () => {
|
|
|
1296
1342
|
logs.push({ stream, chunk });
|
|
1297
1343
|
},
|
|
1298
1344
|
});
|
|
1299
|
-
expect(loaded.prefix).toContain("
|
|
1345
|
+
expect(loaded.prefix).toContain("<rudder_agent_operating_contract>");
|
|
1300
1346
|
expect(loaded.prefix).not.toContain("# Agent Instructions");
|
|
1301
1347
|
expect(loaded.readFailed).toBe(true);
|
|
1302
1348
|
expect(loaded.commandNotes).toContain("Configured instructionsFilePath $AGENT_HOME/instructions/AGENTS.md, but file could not be read; continuing without injected instructions.");
|