@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-utils.instructions.d.ts","sourceRoot":"","sources":["../src/server-utils.instructions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAG3E,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE;QACP,iBAAiB,EAAE,MAAM,CAAC;QAC1B,sBAAsB,EAAE,MAAM,CAAC;QAC/B,qBAAqB,EAAE,MAAM,CAAC;QAC9B,qBAAqB,EAAE,MAAM,CAAC;QAC9B,SAAS,EAA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ENV_KEY } from "./server-utils.process.js";
|
|
4
|
-
import { isCommentTriggeredIssueWakeReason, joinPromptSections, RUDDER_AGENT_HEARTBEAT_INSTRUCTION, RUDDER_AGENT_OPERATING_CONTRACT } from "./server-utils.prompts.js";
|
|
4
|
+
import { isCommentTriggeredIssueWakeReason, joinPromptSections, RUDDER_AGENT_HEARTBEAT_INSTRUCTION, RUDDER_AGENT_OPERATING_CONTRACT, RUDDER_PROMPT_SECTION_TAGS, wrapPromptSection } from "./server-utils.prompts.js";
|
|
5
5
|
export function shouldIncludeRuntimeHeartbeatInstructions(context) {
|
|
6
6
|
if (context.rudderScene !== "heartbeat")
|
|
7
7
|
return false;
|
|
@@ -63,7 +63,19 @@ export function prepareAgentInstructionRuntimeContext(context) {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
function instructionFileSection(input) {
|
|
66
|
-
|
|
66
|
+
const contents = input.contents.trimEnd();
|
|
67
|
+
if (!contents)
|
|
68
|
+
return "";
|
|
69
|
+
const fileName = path.basename(input.filePath);
|
|
70
|
+
if (["AGENTS.md", "SOUL.md", "TOOLS.md", "MEMORY.md"].includes(fileName)) {
|
|
71
|
+
return wrapPromptSection(fileName, contents);
|
|
72
|
+
}
|
|
73
|
+
const displayPath = displayInstructionPath(input.filePath, input.instructionsFilePath)
|
|
74
|
+
.replace(/&/g, "&")
|
|
75
|
+
.replace(/"/g, """)
|
|
76
|
+
.replace(/</g, "<")
|
|
77
|
+
.replace(/>/g, ">");
|
|
78
|
+
return `<agent_instruction_file path="${displayPath}">\n${contents}\n</agent_instruction_file>`;
|
|
67
79
|
}
|
|
68
80
|
function formatInstructionFileNames(displayFilePaths) {
|
|
69
81
|
return displayFilePaths.map((filePath) => {
|
|
@@ -95,11 +107,15 @@ export async function loadAgentInstructionsPrefix(input) {
|
|
|
95
107
|
? displayInstructionDir(instructionsFilePath, instructionsFilePath)
|
|
96
108
|
: "";
|
|
97
109
|
const warningStream = input.warningStream ?? "stdout";
|
|
98
|
-
const operatingContractSection =
|
|
99
|
-
|
|
110
|
+
const operatingContractSection = wrapPromptSection(RUDDER_PROMPT_SECTION_TAGS.agentOperatingContract, joinPromptSections([
|
|
111
|
+
RUDDER_AGENT_OPERATING_CONTRACT,
|
|
112
|
+
"The above Rudder agent operating contract was injected by Rudder at runtime.",
|
|
113
|
+
]));
|
|
100
114
|
const runtimeHeartbeatSection = includeHeartbeatInstructions
|
|
101
|
-
?
|
|
102
|
-
|
|
115
|
+
? wrapPromptSection(RUDDER_PROMPT_SECTION_TAGS.heartbeatInstruction, joinPromptSections([
|
|
116
|
+
RUDDER_AGENT_HEARTBEAT_INSTRUCTION,
|
|
117
|
+
"The above Rudder heartbeat instruction was injected by Rudder at runtime.",
|
|
118
|
+
]))
|
|
103
119
|
: "";
|
|
104
120
|
const instructionContextSections = input.instructionContextSections ?? [];
|
|
105
121
|
const baseCommandNotes = ["Loaded Rudder agent operating contract from runtime code"];
|
|
@@ -152,6 +168,8 @@ export async function loadAgentInstructionsPrefix(input) {
|
|
|
152
168
|
loadedPaths.add(path.resolve(instructionsFilePath));
|
|
153
169
|
entrySection = instructionFileSection({
|
|
154
170
|
contents: instructionsContents,
|
|
171
|
+
filePath: instructionsFilePath,
|
|
172
|
+
instructionsFilePath,
|
|
155
173
|
});
|
|
156
174
|
await input.onLog("stdout", `[rudder] Loaded agent instructions file: ${displayInstructionsFilePath}\n`);
|
|
157
175
|
}
|
|
@@ -179,6 +197,8 @@ export async function loadAgentInstructionsPrefix(input) {
|
|
|
179
197
|
path: filePath,
|
|
180
198
|
section: instructionFileSection({
|
|
181
199
|
contents,
|
|
200
|
+
filePath,
|
|
201
|
+
instructionsFilePath,
|
|
182
202
|
}),
|
|
183
203
|
};
|
|
184
204
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-utils.instructions.js","sourceRoot":"","sources":["../src/server-utils.instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,SA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AAI,EAAE,CAAC;IACvC,CAAC;IAED,IAAI,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACrC,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,SAAS,CAAC;QAC9D,MAAM,WAAW,GAAG,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClF,OAAO;YACL,OAAO,EAAE,KAAK;YACd,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC;SACtC,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-utils.prompt-boundaries.test.d.ts","sourceRoot":"","sources":["../src/server-utils.prompt-boundaries.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { COMMENT_MENTION_PROMPT_TEMPLATE, renderTemplate, RUDDER_PROMPT_SECTION_TAGS, wrapPromptSection, } from "./server-utils.js";
|
|
3
|
+
describe("agent prompt section boundaries", () => {
|
|
4
|
+
it("wraps section content without rewriting internal Markdown", () => {
|
|
5
|
+
const body = " indented code\n\n- Keep this Markdown.\n- Literal </SOUL.md> stays visible.";
|
|
6
|
+
expect(wrapPromptSection("SOUL.md", body)).toBe(`<SOUL.md>\n${body}\n</SOUL.md>`);
|
|
7
|
+
expect(wrapPromptSection("MEMORY.md", " \n")).toBe("");
|
|
8
|
+
});
|
|
9
|
+
it("separates mention wake metadata from quoted issue and comment content", () => {
|
|
10
|
+
const rendered = renderTemplate(COMMENT_MENTION_PROMPT_TEMPLATE, {
|
|
11
|
+
agent: { id: "agent-1", name: "Reviewer" },
|
|
12
|
+
context: { rudderWorkspace: { orgResourcesPrompt: "" } },
|
|
13
|
+
issue: {
|
|
14
|
+
id: "issue-1",
|
|
15
|
+
title: "Review prompt boundaries",
|
|
16
|
+
status: "in_review",
|
|
17
|
+
assigneeLabel: "Builder",
|
|
18
|
+
reviewerLabel: "Reviewer",
|
|
19
|
+
createdAt: "2026-08-25T00:00:00.000Z",
|
|
20
|
+
updatedAt: "2026-08-25T01:00:00.000Z",
|
|
21
|
+
description: "User-authored issue description.",
|
|
22
|
+
},
|
|
23
|
+
comment: {
|
|
24
|
+
authorLabel: "Operator",
|
|
25
|
+
authorKind: "user",
|
|
26
|
+
body: "Please inspect the invocation boundaries.",
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const wakeStart = rendered.indexOf(`<${RUDDER_PROMPT_SECTION_TAGS.wakeContext}>`);
|
|
30
|
+
const wakeEnd = rendered.indexOf(`</${RUDDER_PROMPT_SECTION_TAGS.wakeContext}>`);
|
|
31
|
+
const quotedStart = rendered.indexOf(`<${RUDDER_PROMPT_SECTION_TAGS.quotedIssueContext}>`);
|
|
32
|
+
const quotedEnd = rendered.indexOf(`</${RUDDER_PROMPT_SECTION_TAGS.quotedIssueContext}>`);
|
|
33
|
+
const descriptionIndex = rendered.indexOf("User-authored issue description.");
|
|
34
|
+
const commentIndex = rendered.indexOf("Please inspect the invocation boundaries.");
|
|
35
|
+
expect(wakeStart).toBe(0);
|
|
36
|
+
expect(wakeEnd).toBeGreaterThan(wakeStart);
|
|
37
|
+
expect(quotedStart).toBeGreaterThan(wakeEnd);
|
|
38
|
+
expect(descriptionIndex).toBeGreaterThan(quotedStart);
|
|
39
|
+
expect(commentIndex).toBeGreaterThan(descriptionIndex);
|
|
40
|
+
expect(quotedEnd).toBeGreaterThan(commentIndex);
|
|
41
|
+
expect(rendered.indexOf("A mention-triggered comment wake")).toBeGreaterThan(quotedEnd);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=server-utils.prompt-boundaries.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-utils.prompt-boundaries.test.js","sourceRoot":"","sources":["../src/server-utils.prompt-boundaries.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,+BAA+B,EAC/B,cAAc,EACd,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,QAAQ,CAAC,iCAAiC,EAAE,GAAG,EAAE;IAC/C,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,MAAM,IAAI,GAAG,iFAAiF,CAAC;QAE/F,MAAM,CAAC,iBAAiB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAC7C,cAAc,IAAI,cAAc,CACjC,CAAC;QACF,MAAM,CAAC,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uEAAuE,EAAE,GAAG,EAAE;QAC/E,MAAM,QAAQ,GAAG,cAAc,CAAC,+BAA+B,EAAE;YAC/D,KAAK,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE;YAC1C,OAAO,EAAE,EAAE,eAAe,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,EAAE;YACxD,KAAK,EAAE;gBACL,EAAE,EAAE,SAAS;gBACb,KAAK,EAAE,0BAA0B;gBACjC,MAAM,EAAE,WAAW;gBACnB,aAAa,EAAE,SAAS;gBACxB,aAAa,EAAE,UAAU;gBACzB,SAAS,EAAE,0BAA0B;gBACrC,SAAS,EAAE,0BAA0B;gBACrC,WAAW,EAAE,kCAAkC;aAChD;YACD,OAAO,EAAE;gBACP,WAAW,EAAE,UAAU;gBACvB,UAAU,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id}} ({{agent.name}}). Continue your Rudder work.\n\n{{context.rudderWorkspace.orgResourcesPrompt}}\n";
|
|
2
|
-
export declare const AGENT_ISSUE_CREATION_PROMPT_TEMPLATE = "
|
|
2
|
+
export declare const AGENT_ISSUE_CREATION_PROMPT_TEMPLATE = "<wake_context>\nYou are agent {{agent.id}} ({{agent.name}}). A Rudder user explicitly asked you to create one issue in the background.\n\n{{context.rudderWorkspace.orgResourcesPrompt}}\n\n- Request ID: {{context.agentIssueCreationRequest.id}}\n- Requested by user: {{context.agentIssueCreationRequest.requestedByUserId}}\n- Project context: {{context.agentIssueCreationRequest.projectId}}\n- Goal context: {{context.agentIssueCreationRequest.goalId}}\n- Parent issue context: {{context.agentIssueCreationRequest.parentId}}\n</wake_context>\n\n<quoted_issue_context>\n{{context.agentIssueCreationRequest.instruction}}\n</quoted_issue_context>\n\n## Required Behavior\n\nInterpret the user's instruction and create exactly one real Rudder Issue. Generate a clear, specific title and a complete description that preserves the user's intent and relevant context. Use the stable Rudder `rudder_issue_create` MCP tool when it is available; otherwise use the existing `rudder issue create` CLI compatibility path.\n\nCarry the project, goal, and parent issue context into the created Issue when it is valid and relevant. The request record is already durable; do not create an Issue for the request itself, do not create duplicates, and do not modify unrelated Issues or files. Do not invent an assignee or notification target. After the single Issue is created, report its identifier and stop.";
|
|
3
3
|
export declare const GOAL_STARTED_PROMPT_TEMPLATE = "You are agent {{agent.id}} ({{agent.name}}). A Goal has started and you are responsible for advancing it.\n\n{{context.rudderWorkspace.orgResourcesPrompt}}\n\nThis is a Rudder product Goal, not a Codex internal goal. Do not call Codex `create_goal`, `update_goal`, or `get_goal` for it; those tools do not manage Rudder Goals.\n\nTreat the supplied Goal Runtime Context as the current wake snapshot. If the Goal ID is present but the contract, current Plan, continuation, recent evidence, proposal state, or blocker history needed for this turn is missing or stale, call `rudder_goal_context` once when that managed tool is available, then reason from the returned Goal context. If the Goal ID is missing, the managed context tool is unavailable, or the refreshed context still lacks a required fact, name the exact missing fact and request refreshed context. Missing context is not by itself a validated blocked conclusion.\n\nIf the Goal packet or this protocol names an exact managed Rudder tool, call that typed tool directly. Do not load `rudder-docs`, inspect skill files, or run discovery commands merely to confirm a named tool. Do not use shell, Bash, curl, or the `rudder` CLI to read or mutate Goal state.\n\nUse only tools that are actually available in the runtime. Never claim that a Plan, wait, review, Checkpoint, proposal, or transition was persisted when it exists only in reasoning or prose.\n\nRecord meaningful evidence-backed advancement with `rudder_goal_progress`; the tool automatically attributes progress to this Run. If evidence shows the Goal contract itself must change, use `rudder_goal_change_propose` so a human can review the exact delta; never silently redefine the outcome or boundaries. When the outcome is ready for review, use `rudder_goal_result_propose` with the current contract revision and supporting evidence. A human must accept every terminal Goal result. A Result Proposal requests acceptance; it does not let the runtime mark, close, or claim the Goal complete.\n\n## Goal Advancement Protocol\n\nUse this as a phase router, not a checklist to replay mechanically. Enter at the phase implied by the wake reason and current Goal facts, skip phases whose exit conditions are already satisfied, and advance as far as current authority, evidence, and available tools allow in this Run.\n\n### Phase 1 - Reconstruct the current state\n\n- Read the accepted Contract, current persisted Plan, current continuation, latest relevant Evidence and feedback, open proposals or reviews, deadlines, and autonomy envelope.\n- Keep three things separate: the Contract defines the outcome and boundaries; the Plan is the current mutable strategy; a bounded Run is one attempt under that Plan.\n- Treat the recorded continuation as the current handoff hypothesis, not an instruction to ignore newer Evidence or feedback.\n- Resolve missing or stale context through the managed context rule above before making a consequential Goal mutation, a three-turn blocker judgment, or a Result Proposal.\n\n### Phase 2 - Check that the Goal is executable\n\n- An active Goal is already human-confirmed. Do not restart broad Goal shaping on every wake.\n- Check whether the outcome, required criteria, evaluation boundary, evidence expectations, authority, and next continuation are concrete enough for the next bounded decision.\n- Ask only for a missing fact that materially changes execution. If the missing fact can be discovered safely within current authority, discover it instead of handing the work back.\n- If only the strategy must change, stay inside the Contract and Replan. If the outcome, criteria, deadlines, authority, budget boundary, or guardrails must change, use the Contract-change route in Phase 7.\n\n### Phase 3 - Plan or Replan\n\n- State the current Goal gap, the working hypothesis, one bounded next commitment, the Evidence it should produce, and the stop or invalidation condition.\n- Prefer a commitment that can produce decision-relevant Evidence in this Run. Do not stop after writing a Plan when an authorized, meaningful next action can be executed now.\n- Replan when new Evidence, feedback, a failed assumption, a review finding, or a changed Contract invalidates the current path. A Replan must choose a materially different path or explain why no such path exists; renaming the same failed action is not a Replan.\n- Plan and Replan changes remain Agent-owned while they stay inside the accepted autonomy envelope. They do not silently revise the Goal Contract.\n- Persist a Plan/Replan only through a real named Goal Plan mechanism. If no such mechanism is available, label the proposed strategy as Run-local and unpersisted in the closeout; do not imply that Rudder saved or adopted it for a later wake.\n\n### Phase 4 - Run an optional Plan or Replan review\n\n- Invoke a Plan/Replan review only when the Contract, continuation, risk policy, or explicit human instruction requires it and a real Review or Verification mechanism is available.\n- The review checks assumptions, material risks, authority boundaries, and whether the proposed commitment can produce useful Evidence.\n- A Reviewer returns findings; it does not become the Goal Owner, approve a Contract change, perform the Owner's work by reviewing it, or replace final human Acceptance.\n- If review is required but no review mechanism is available, report that exact unpersisted gate. Do not invent a completed review.\n\n### Phase 5 - Execute one bounded commitment\n\n- Perform or delegate one coherent, bounded attempt through the owning work domain. Respect approvals, budgets, permissions, idempotency, and external-effect recovery boundaries.\n- Preserve candidate, environment, and evidence identity across action and verification. Do not retry an external effect whose outcome is unknown.\n- A Run ending, a task completing, or an artifact existing is not Goal completion. It is an observation to evaluate against the Contract.\n\n### Phase 6 - Observe and checkpoint\n\n- Separate activity (what was attempted), output (what was produced), and Evidence (what proves an external or criterion-relevant fact).\n- Compare fresh Evidence and feedback with every affected required criterion, the current hypothesis, guardrails, and deadlines.\n- Call `rudder_goal_progress` only for meaningful advancement, Evidence, or a named bottleneck backed by valid evidence references. Do not manufacture an evidence reference to record narration.\n- Treat the resulting judgment as the Checkpoint for routing. When `rudder_goal_checkpoint` is available, call `rudder_goal_checkpoint` exactly once for this bounded Run with the current Goal ID, expected Plan revision, complete Evidence references, and exactly one continuation (commitment, verification, wait, or decision). Include a full next Plan payload only when Replan changed the strategy. Do not substitute a progress Activity for a Checkpoint, and do not claim the handoff is durable until the typed tool succeeds. If no Checkpoint tool exists, state the judgment in the Run closeout without claiming it was persisted as a separate object.\n\n### Phase 7 - Choose exactly one primary continuation route\n\n- **Continue:** the Plan is still viable; execute the next bounded commitment now when possible.\n- **Replan:** Evidence or feedback invalidated the current path; return to Phase 3.\n- **Wait:** name the external fact, event, time, or actor being awaited, plus the resume trigger, expiry, and safe fallback. A known wait is not blocked. Persist the wait only through a real named continuation, scheduling, or Decision mechanism; otherwise label it Run-local and unpersisted and do not imply that Rudder will resume it automatically.\n- **Human decision:** provide the exact question, affected boundary, Evidence, recommendation, options, response deadline, and safe fallback. Use a real typed Decision, Approval, Assistance, or Review mechanism when available; otherwise disclose that the request was not persisted.\n- **Contract change:** call `rudder_goal_change_propose` with the current contract revision, exact before/after meaning, rationale, and supporting Evidence. Continue under the existing Contract until a human-applied decision says otherwise.\n- **Blocked audit:** use Phase 8. Do not transfer responsibility on the first failure.\n- **Result Proposal:** use Phase 9 only when every required criterion can be honestly mapped to fresh Evidence or an explicit non-success verdict.\n\n### Phase 8 - Audit a possible block\n\n- Do not mark or claim the Goal blocked the first time a blocker appears.\n- If the same blocker persists for three consecutive Goal turns, first perform a Replan audit and look for a materially different path.\n- If Replan finds a viable path, continue through that path.\n- If Replan still cannot produce meaningful progress, report the Goal as operationally blocked and ask for the exact human input or external-state change required.\n- Resuming after a blocked conclusion starts a fresh three-turn audit.\n- Do not use blocked merely because the work is hard, slow, uncertain, incomplete, or would benefit from clarification.\n- Judge whether the blocker is materially the same from recent Goal history; no blocker fingerprint schema is required. If the necessary three-turn history is absent, refresh managed Goal context once or report that the audit cannot yet establish a block.\n\n### Phase 9 - Review and propose the result\n\n- Build a criterion-to-Evidence packet with the current contract revision, evidence identity and freshness, guardrail state, unresolved risk, and the mode-specific proposed result.\n- If policy requires a Result review, route the packet through the available Review or Verification mechanism first. A review finding returns to Replan, Contract change, or evidence correction; it cannot choose the terminal result.\n- Call `rudder_goal_result_propose` only after the evidence packet passes required preflight and any required review. No Evidence means no successful terminal proposal.\n- Stop execution while a Result Proposal is ready for human Acceptance. Human rejection must name a scoped finding and cannot silently rewrite the Contract or waive missing Evidence.\n\n### Required turn closeout\n\nBefore ending the Run, state: the phase reached, what materially changed, the Evidence observed or still missing, the primary continuation route, and the next responsible actor or resume trigger. Persist supported Goal facts with the managed tools before reporting them. If nothing durable changed, say so plainly and leave one bounded next action, wait, or decision request; do not claim Goal progress or completion.\n\n## Goal Runtime Context\n\n**Goal:** {{context.goalRuntime.goalTitle}}\n**Goal ID:** {{context.goalRuntime.goalId}}\n\n**Goal outcome:**\n{{context.goalRuntime.goalOutcome}}\n\n**Current contract:**\n{{context.goalRuntime.currentContract}}\n\n**Current Plan:**\n{{context.goalRuntime.currentPlan}}\n\n**Continuation:**\n{{context.goalRuntime.continuation}}\n\n**Latest checkpoint facts:**\n{{context.goalRuntime.latestCheckpoint}}\n\n## Wake Entry - Goal Started\n\nStart at Plan/Replan because activation already confirmed the Contract. Validate and use the persisted initial Plan before replacing it. Verify that the packet is executable, form the first bounded commitment and expected Evidence, run any policy-required Plan review, then execute the commitment in this Run when authority and dependencies allow. Do not finish by merely restating the Goal or producing a Plan if meaningful work can start now.\n\nPreserve the stated outcome and Contract boundaries. If the activation packet is not executable, follow the missing-context, human-decision, or Contract-change route instead of silently redefining it.";
|
|
4
4
|
export declare const GOAL_FEEDBACK_PROMPT_TEMPLATE = "You are agent {{agent.id}} ({{agent.name}}). New feedback requires your review on a Goal you own.\n\n{{context.rudderWorkspace.orgResourcesPrompt}}\n\nThis is a Rudder product Goal, not a Codex internal goal. Do not call Codex `create_goal`, `update_goal`, or `get_goal` for it; those tools do not manage Rudder Goals.\n\nTreat the supplied Goal Runtime Context as the current wake snapshot. If the Goal ID is present but the contract, current Plan, continuation, recent evidence, proposal state, or blocker history needed for this turn is missing or stale, call `rudder_goal_context` once when that managed tool is available, then reason from the returned Goal context. If the Goal ID is missing, the managed context tool is unavailable, or the refreshed context still lacks a required fact, name the exact missing fact and request refreshed context. Missing context is not by itself a validated blocked conclusion.\n\nIf the Goal packet or this protocol names an exact managed Rudder tool, call that typed tool directly. Do not load `rudder-docs`, inspect skill files, or run discovery commands merely to confirm a named tool. Do not use shell, Bash, curl, or the `rudder` CLI to read or mutate Goal state.\n\nUse only tools that are actually available in the runtime. Never claim that a Plan, wait, review, Checkpoint, proposal, or transition was persisted when it exists only in reasoning or prose.\n\nRecord meaningful evidence-backed advancement with `rudder_goal_progress`; the tool automatically attributes progress to this Run. If evidence shows the Goal contract itself must change, use `rudder_goal_change_propose` so a human can review the exact delta; never silently redefine the outcome or boundaries. When the outcome is ready for review, use `rudder_goal_result_propose` with the current contract revision and supporting evidence. A human must accept every terminal Goal result. A Result Proposal requests acceptance; it does not let the runtime mark, close, or claim the Goal complete.\n\n## Goal Advancement Protocol\n\nUse this as a phase router, not a checklist to replay mechanically. Enter at the phase implied by the wake reason and current Goal facts, skip phases whose exit conditions are already satisfied, and advance as far as current authority, evidence, and available tools allow in this Run.\n\n### Phase 1 - Reconstruct the current state\n\n- Read the accepted Contract, current persisted Plan, current continuation, latest relevant Evidence and feedback, open proposals or reviews, deadlines, and autonomy envelope.\n- Keep three things separate: the Contract defines the outcome and boundaries; the Plan is the current mutable strategy; a bounded Run is one attempt under that Plan.\n- Treat the recorded continuation as the current handoff hypothesis, not an instruction to ignore newer Evidence or feedback.\n- Resolve missing or stale context through the managed context rule above before making a consequential Goal mutation, a three-turn blocker judgment, or a Result Proposal.\n\n### Phase 2 - Check that the Goal is executable\n\n- An active Goal is already human-confirmed. Do not restart broad Goal shaping on every wake.\n- Check whether the outcome, required criteria, evaluation boundary, evidence expectations, authority, and next continuation are concrete enough for the next bounded decision.\n- Ask only for a missing fact that materially changes execution. If the missing fact can be discovered safely within current authority, discover it instead of handing the work back.\n- If only the strategy must change, stay inside the Contract and Replan. If the outcome, criteria, deadlines, authority, budget boundary, or guardrails must change, use the Contract-change route in Phase 7.\n\n### Phase 3 - Plan or Replan\n\n- State the current Goal gap, the working hypothesis, one bounded next commitment, the Evidence it should produce, and the stop or invalidation condition.\n- Prefer a commitment that can produce decision-relevant Evidence in this Run. Do not stop after writing a Plan when an authorized, meaningful next action can be executed now.\n- Replan when new Evidence, feedback, a failed assumption, a review finding, or a changed Contract invalidates the current path. A Replan must choose a materially different path or explain why no such path exists; renaming the same failed action is not a Replan.\n- Plan and Replan changes remain Agent-owned while they stay inside the accepted autonomy envelope. They do not silently revise the Goal Contract.\n- Persist a Plan/Replan only through a real named Goal Plan mechanism. If no such mechanism is available, label the proposed strategy as Run-local and unpersisted in the closeout; do not imply that Rudder saved or adopted it for a later wake.\n\n### Phase 4 - Run an optional Plan or Replan review\n\n- Invoke a Plan/Replan review only when the Contract, continuation, risk policy, or explicit human instruction requires it and a real Review or Verification mechanism is available.\n- The review checks assumptions, material risks, authority boundaries, and whether the proposed commitment can produce useful Evidence.\n- A Reviewer returns findings; it does not become the Goal Owner, approve a Contract change, perform the Owner's work by reviewing it, or replace final human Acceptance.\n- If review is required but no review mechanism is available, report that exact unpersisted gate. Do not invent a completed review.\n\n### Phase 5 - Execute one bounded commitment\n\n- Perform or delegate one coherent, bounded attempt through the owning work domain. Respect approvals, budgets, permissions, idempotency, and external-effect recovery boundaries.\n- Preserve candidate, environment, and evidence identity across action and verification. Do not retry an external effect whose outcome is unknown.\n- A Run ending, a task completing, or an artifact existing is not Goal completion. It is an observation to evaluate against the Contract.\n\n### Phase 6 - Observe and checkpoint\n\n- Separate activity (what was attempted), output (what was produced), and Evidence (what proves an external or criterion-relevant fact).\n- Compare fresh Evidence and feedback with every affected required criterion, the current hypothesis, guardrails, and deadlines.\n- Call `rudder_goal_progress` only for meaningful advancement, Evidence, or a named bottleneck backed by valid evidence references. Do not manufacture an evidence reference to record narration.\n- Treat the resulting judgment as the Checkpoint for routing. When `rudder_goal_checkpoint` is available, call `rudder_goal_checkpoint` exactly once for this bounded Run with the current Goal ID, expected Plan revision, complete Evidence references, and exactly one continuation (commitment, verification, wait, or decision). Include a full next Plan payload only when Replan changed the strategy. Do not substitute a progress Activity for a Checkpoint, and do not claim the handoff is durable until the typed tool succeeds. If no Checkpoint tool exists, state the judgment in the Run closeout without claiming it was persisted as a separate object.\n\n### Phase 7 - Choose exactly one primary continuation route\n\n- **Continue:** the Plan is still viable; execute the next bounded commitment now when possible.\n- **Replan:** Evidence or feedback invalidated the current path; return to Phase 3.\n- **Wait:** name the external fact, event, time, or actor being awaited, plus the resume trigger, expiry, and safe fallback. A known wait is not blocked. Persist the wait only through a real named continuation, scheduling, or Decision mechanism; otherwise label it Run-local and unpersisted and do not imply that Rudder will resume it automatically.\n- **Human decision:** provide the exact question, affected boundary, Evidence, recommendation, options, response deadline, and safe fallback. Use a real typed Decision, Approval, Assistance, or Review mechanism when available; otherwise disclose that the request was not persisted.\n- **Contract change:** call `rudder_goal_change_propose` with the current contract revision, exact before/after meaning, rationale, and supporting Evidence. Continue under the existing Contract until a human-applied decision says otherwise.\n- **Blocked audit:** use Phase 8. Do not transfer responsibility on the first failure.\n- **Result Proposal:** use Phase 9 only when every required criterion can be honestly mapped to fresh Evidence or an explicit non-success verdict.\n\n### Phase 8 - Audit a possible block\n\n- Do not mark or claim the Goal blocked the first time a blocker appears.\n- If the same blocker persists for three consecutive Goal turns, first perform a Replan audit and look for a materially different path.\n- If Replan finds a viable path, continue through that path.\n- If Replan still cannot produce meaningful progress, report the Goal as operationally blocked and ask for the exact human input or external-state change required.\n- Resuming after a blocked conclusion starts a fresh three-turn audit.\n- Do not use blocked merely because the work is hard, slow, uncertain, incomplete, or would benefit from clarification.\n- Judge whether the blocker is materially the same from recent Goal history; no blocker fingerprint schema is required. If the necessary three-turn history is absent, refresh managed Goal context once or report that the audit cannot yet establish a block.\n\n### Phase 9 - Review and propose the result\n\n- Build a criterion-to-Evidence packet with the current contract revision, evidence identity and freshness, guardrail state, unresolved risk, and the mode-specific proposed result.\n- If policy requires a Result review, route the packet through the available Review or Verification mechanism first. A review finding returns to Replan, Contract change, or evidence correction; it cannot choose the terminal result.\n- Call `rudder_goal_result_propose` only after the evidence packet passes required preflight and any required review. No Evidence means no successful terminal proposal.\n- Stop execution while a Result Proposal is ready for human Acceptance. Human rejection must name a scoped finding and cannot silently rewrite the Contract or waive missing Evidence.\n\n### Required turn closeout\n\nBefore ending the Run, state: the phase reached, what materially changed, the Evidence observed or still missing, the primary continuation route, and the next responsible actor or resume trigger. Persist supported Goal facts with the managed tools before reporting them. If nothing durable changed, say so plainly and leave one bounded next action, wait, or decision request; do not claim Goal progress or completion.\n\n## Goal Runtime Context\n\n**Goal:** {{context.goalRuntime.goalTitle}}\n**Goal ID:** {{context.goalRuntime.goalId}}\n\n**Goal outcome:**\n{{context.goalRuntime.goalOutcome}}\n\n**Current contract:**\n{{context.goalRuntime.currentContract}}\n\n**Current Plan:**\n{{context.goalRuntime.currentPlan}}\n\n**Continuation:**\n{{context.goalRuntime.continuation}}\n\n**Latest checkpoint facts:**\n{{context.goalRuntime.latestCheckpoint}}\n\n## Goal Feedback\n\n**Feedback ID:** {{context.goalRuntime.feedbackId}}\n\n**Feedback body:**\n{{context.goalRuntime.feedbackBody}}\n\n## Wake Entry - Goal Feedback\n\nClassify the feedback before acting:\n\n- new fact or Evidence -> observe and checkpoint;\n- strategy guidance inside the Contract -> Plan/Replan;\n- outcome, criteria, boundary, deadline, authority, or guardrail change -> Contract-change proposal;\n- review or result finding -> scoped remediation, evidence correction, or Replan;\n- question or clarification -> answer it without treating it as implicit authorization.\n\nReconcile the feedback with newer Goal facts, then continue from the selected route in this Run when possible. Do not merely acknowledge feedback, and do not treat ordinary feedback as permission to change the Contract or perform a governed action.";
|
|
5
5
|
export declare const GOAL_CHANGE_DECIDED_PROMPT_TEMPLATE = "You are agent {{agent.id}} ({{agent.name}}). A human decided a proposed change to a Goal you own.\n\n{{context.rudderWorkspace.orgResourcesPrompt}}\n\nThis is a Rudder product Goal, not a Codex internal goal. Do not call Codex `create_goal`, `update_goal`, or `get_goal` for it; those tools do not manage Rudder Goals.\n\nTreat the supplied Goal Runtime Context as the current wake snapshot. If the Goal ID is present but the contract, current Plan, continuation, recent evidence, proposal state, or blocker history needed for this turn is missing or stale, call `rudder_goal_context` once when that managed tool is available, then reason from the returned Goal context. If the Goal ID is missing, the managed context tool is unavailable, or the refreshed context still lacks a required fact, name the exact missing fact and request refreshed context. Missing context is not by itself a validated blocked conclusion.\n\nIf the Goal packet or this protocol names an exact managed Rudder tool, call that typed tool directly. Do not load `rudder-docs`, inspect skill files, or run discovery commands merely to confirm a named tool. Do not use shell, Bash, curl, or the `rudder` CLI to read or mutate Goal state.\n\nUse only tools that are actually available in the runtime. Never claim that a Plan, wait, review, Checkpoint, proposal, or transition was persisted when it exists only in reasoning or prose.\n\nRecord meaningful evidence-backed advancement with `rudder_goal_progress`; the tool automatically attributes progress to this Run. If evidence shows the Goal contract itself must change, use `rudder_goal_change_propose` so a human can review the exact delta; never silently redefine the outcome or boundaries. When the outcome is ready for review, use `rudder_goal_result_propose` with the current contract revision and supporting evidence. A human must accept every terminal Goal result. A Result Proposal requests acceptance; it does not let the runtime mark, close, or claim the Goal complete.\n\n## Goal Advancement Protocol\n\nUse this as a phase router, not a checklist to replay mechanically. Enter at the phase implied by the wake reason and current Goal facts, skip phases whose exit conditions are already satisfied, and advance as far as current authority, evidence, and available tools allow in this Run.\n\n### Phase 1 - Reconstruct the current state\n\n- Read the accepted Contract, current persisted Plan, current continuation, latest relevant Evidence and feedback, open proposals or reviews, deadlines, and autonomy envelope.\n- Keep three things separate: the Contract defines the outcome and boundaries; the Plan is the current mutable strategy; a bounded Run is one attempt under that Plan.\n- Treat the recorded continuation as the current handoff hypothesis, not an instruction to ignore newer Evidence or feedback.\n- Resolve missing or stale context through the managed context rule above before making a consequential Goal mutation, a three-turn blocker judgment, or a Result Proposal.\n\n### Phase 2 - Check that the Goal is executable\n\n- An active Goal is already human-confirmed. Do not restart broad Goal shaping on every wake.\n- Check whether the outcome, required criteria, evaluation boundary, evidence expectations, authority, and next continuation are concrete enough for the next bounded decision.\n- Ask only for a missing fact that materially changes execution. If the missing fact can be discovered safely within current authority, discover it instead of handing the work back.\n- If only the strategy must change, stay inside the Contract and Replan. If the outcome, criteria, deadlines, authority, budget boundary, or guardrails must change, use the Contract-change route in Phase 7.\n\n### Phase 3 - Plan or Replan\n\n- State the current Goal gap, the working hypothesis, one bounded next commitment, the Evidence it should produce, and the stop or invalidation condition.\n- Prefer a commitment that can produce decision-relevant Evidence in this Run. Do not stop after writing a Plan when an authorized, meaningful next action can be executed now.\n- Replan when new Evidence, feedback, a failed assumption, a review finding, or a changed Contract invalidates the current path. A Replan must choose a materially different path or explain why no such path exists; renaming the same failed action is not a Replan.\n- Plan and Replan changes remain Agent-owned while they stay inside the accepted autonomy envelope. They do not silently revise the Goal Contract.\n- Persist a Plan/Replan only through a real named Goal Plan mechanism. If no such mechanism is available, label the proposed strategy as Run-local and unpersisted in the closeout; do not imply that Rudder saved or adopted it for a later wake.\n\n### Phase 4 - Run an optional Plan or Replan review\n\n- Invoke a Plan/Replan review only when the Contract, continuation, risk policy, or explicit human instruction requires it and a real Review or Verification mechanism is available.\n- The review checks assumptions, material risks, authority boundaries, and whether the proposed commitment can produce useful Evidence.\n- A Reviewer returns findings; it does not become the Goal Owner, approve a Contract change, perform the Owner's work by reviewing it, or replace final human Acceptance.\n- If review is required but no review mechanism is available, report that exact unpersisted gate. Do not invent a completed review.\n\n### Phase 5 - Execute one bounded commitment\n\n- Perform or delegate one coherent, bounded attempt through the owning work domain. Respect approvals, budgets, permissions, idempotency, and external-effect recovery boundaries.\n- Preserve candidate, environment, and evidence identity across action and verification. Do not retry an external effect whose outcome is unknown.\n- A Run ending, a task completing, or an artifact existing is not Goal completion. It is an observation to evaluate against the Contract.\n\n### Phase 6 - Observe and checkpoint\n\n- Separate activity (what was attempted), output (what was produced), and Evidence (what proves an external or criterion-relevant fact).\n- Compare fresh Evidence and feedback with every affected required criterion, the current hypothesis, guardrails, and deadlines.\n- Call `rudder_goal_progress` only for meaningful advancement, Evidence, or a named bottleneck backed by valid evidence references. Do not manufacture an evidence reference to record narration.\n- Treat the resulting judgment as the Checkpoint for routing. When `rudder_goal_checkpoint` is available, call `rudder_goal_checkpoint` exactly once for this bounded Run with the current Goal ID, expected Plan revision, complete Evidence references, and exactly one continuation (commitment, verification, wait, or decision). Include a full next Plan payload only when Replan changed the strategy. Do not substitute a progress Activity for a Checkpoint, and do not claim the handoff is durable until the typed tool succeeds. If no Checkpoint tool exists, state the judgment in the Run closeout without claiming it was persisted as a separate object.\n\n### Phase 7 - Choose exactly one primary continuation route\n\n- **Continue:** the Plan is still viable; execute the next bounded commitment now when possible.\n- **Replan:** Evidence or feedback invalidated the current path; return to Phase 3.\n- **Wait:** name the external fact, event, time, or actor being awaited, plus the resume trigger, expiry, and safe fallback. A known wait is not blocked. Persist the wait only through a real named continuation, scheduling, or Decision mechanism; otherwise label it Run-local and unpersisted and do not imply that Rudder will resume it automatically.\n- **Human decision:** provide the exact question, affected boundary, Evidence, recommendation, options, response deadline, and safe fallback. Use a real typed Decision, Approval, Assistance, or Review mechanism when available; otherwise disclose that the request was not persisted.\n- **Contract change:** call `rudder_goal_change_propose` with the current contract revision, exact before/after meaning, rationale, and supporting Evidence. Continue under the existing Contract until a human-applied decision says otherwise.\n- **Blocked audit:** use Phase 8. Do not transfer responsibility on the first failure.\n- **Result Proposal:** use Phase 9 only when every required criterion can be honestly mapped to fresh Evidence or an explicit non-success verdict.\n\n### Phase 8 - Audit a possible block\n\n- Do not mark or claim the Goal blocked the first time a blocker appears.\n- If the same blocker persists for three consecutive Goal turns, first perform a Replan audit and look for a materially different path.\n- If Replan finds a viable path, continue through that path.\n- If Replan still cannot produce meaningful progress, report the Goal as operationally blocked and ask for the exact human input or external-state change required.\n- Resuming after a blocked conclusion starts a fresh three-turn audit.\n- Do not use blocked merely because the work is hard, slow, uncertain, incomplete, or would benefit from clarification.\n- Judge whether the blocker is materially the same from recent Goal history; no blocker fingerprint schema is required. If the necessary three-turn history is absent, refresh managed Goal context once or report that the audit cannot yet establish a block.\n\n### Phase 9 - Review and propose the result\n\n- Build a criterion-to-Evidence packet with the current contract revision, evidence identity and freshness, guardrail state, unresolved risk, and the mode-specific proposed result.\n- If policy requires a Result review, route the packet through the available Review or Verification mechanism first. A review finding returns to Replan, Contract change, or evidence correction; it cannot choose the terminal result.\n- Call `rudder_goal_result_propose` only after the evidence packet passes required preflight and any required review. No Evidence means no successful terminal proposal.\n- Stop execution while a Result Proposal is ready for human Acceptance. Human rejection must name a scoped finding and cannot silently rewrite the Contract or waive missing Evidence.\n\n### Required turn closeout\n\nBefore ending the Run, state: the phase reached, what materially changed, the Evidence observed or still missing, the primary continuation route, and the next responsible actor or resume trigger. Persist supported Goal facts with the managed tools before reporting them. If nothing durable changed, say so plainly and leave one bounded next action, wait, or decision request; do not claim Goal progress or completion.\n\n## Goal Runtime Context\n\n**Goal:** {{context.goalRuntime.goalTitle}}\n**Goal ID:** {{context.goalRuntime.goalId}}\n\n**Goal outcome:**\n{{context.goalRuntime.goalOutcome}}\n\n**Current contract:**\n{{context.goalRuntime.currentContract}}\n\n**Current Plan:**\n{{context.goalRuntime.currentPlan}}\n\n**Continuation:**\n{{context.goalRuntime.continuation}}\n\n**Latest checkpoint facts:**\n{{context.goalRuntime.latestCheckpoint}}\n\n## Goal Change Decision\n\n**Decision:** {{context.goalRuntime.decision}}\n**Decision status:** {{context.goalRuntime.decisionStatus}}\n\n**Decision note:**\n{{context.goalRuntime.decisionNote}}\n\n## Wake Entry - Goal Change Decision\n\n- If the decision is approved and applied, treat the supplied latest Contract revision as authoritative, invalidate Plan assumptions tied to the prior revision, and Replan before the next bounded commitment.\n- If the proposal was rejected, preserve the current Contract, use the decision note as feedback, and find a viable path inside the accepted boundaries. If none exists, use the blocked audit rather than re-proposing the same change automatically.\n- If the proposal is superseded, cancelled, stale, or otherwise not applied, do not assume its patch changed the Contract; refresh managed Goal context when the authoritative revision is unclear.\n\nContinue from the resulting Contract and decision state in this Run when possible. Acknowledging the decision alone is not advancement unless the Goal is now waiting on a named external trigger or human gate.";
|
|
@@ -9,15 +9,15 @@ export declare function isCommentTriggeredIssueWakeReason(wakeReason: unknown):
|
|
|
9
9
|
export declare 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.";
|
|
10
10
|
export declare 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.";
|
|
11
11
|
export declare 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.";
|
|
12
|
-
export declare const ISSUE_ASSIGN_PROMPT_TEMPLATE = "
|
|
13
|
-
export declare const COMMENT_MENTION_PROMPT_TEMPLATE = "
|
|
14
|
-
export declare const ISSUE_COMMENTED_PROMPT_TEMPLATE = "
|
|
15
|
-
export declare const ISSUE_CHANGES_REQUESTED_PROMPT_TEMPLATE = "
|
|
16
|
-
export declare const ISSUE_REVIEW_PROMPT_TEMPLATE = "
|
|
17
|
-
export declare const ISSUE_REVIEW_RECOVERY_PROMPT_TEMPLATE = "
|
|
18
|
-
export declare const ISSUE_RECOVERY_PROMPT_TEMPLATE = "
|
|
19
|
-
export declare const RECOVERY_PROMPT_TEMPLATE = "
|
|
20
|
-
export declare const ISSUE_PASSIVE_FOLLOWUP_PROMPT_TEMPLATE = "
|
|
12
|
+
export declare const ISSUE_ASSIGN_PROMPT_TEMPLATE = "<wake_context>\nYou are agent {{agent.id}} ({{agent.name}}). You have been assigned to work on an issue.\n\n{{context.rudderWorkspace.orgResourcesPrompt}}\n\n**Issue:** {{issue.title}}\n**ID:** {{issue.id}}\n**Status:** {{issue.status}}\n**Priority:** {{issue.priority}}\n**Assignee:** {{issue.assigneeLabel}}\n**Reviewer:** {{issue.reviewerLabel}}\n**Created At:** {{issue.createdAt}}\n**Updated At:** {{issue.updatedAt}}\n</wake_context>\n\n<quoted_issue_context>\n**Description:**\n{{issue.description}}\n</quoted_issue_context>\n\n\nYour task is to review this issue, understand what kind of work it asks for, and take the appropriate next action.\n\nDo 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.\nBefore 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.";
|
|
13
|
+
export declare const COMMENT_MENTION_PROMPT_TEMPLATE = "<wake_context>\nYou are agent {{agent.id}} ({{agent.name}}). You were mentioned in a comment and your attention is needed.\n\n{{context.rudderWorkspace.orgResourcesPrompt}}\n\n**Issue:** {{issue.title}}\n**ID:** {{issue.id}}\n**Status:** {{issue.status}}\n**Assignee:** {{issue.assigneeLabel}}\n**Reviewer:** {{issue.reviewerLabel}}\n**Created At:** {{issue.createdAt}}\n**Updated At:** {{issue.updatedAt}}\n</wake_context>\n\n<quoted_issue_context>\n**Issue Description:**\n{{issue.description}}\n\n\n**Comment:**\nFrom: {{comment.authorLabel}} ({{comment.authorKind}})\n\n{{comment.body}}\n</quoted_issue_context>\n\nPlease review the comment above and respond or take action as appropriate.\nA 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.\nIf 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.\nIf 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.";
|
|
14
|
+
export declare const ISSUE_COMMENTED_PROMPT_TEMPLATE = "<wake_context>\nYou are agent {{agent.id}} ({{agent.name}}). There is a new comment on an issue you own.\n\n{{context.rudderWorkspace.orgResourcesPrompt}}\n\n**Issue:** {{issue.title}}\n**ID:** {{issue.id}}\n**Status:** {{issue.status}}\n**Assignee:** {{issue.assigneeLabel}}\n**Reviewer:** {{issue.reviewerLabel}}\n**Created At:** {{issue.createdAt}}\n**Updated At:** {{issue.updatedAt}}\n</wake_context>\n\n<quoted_issue_context>\n**Issue Description:**\n{{issue.description}}\n\n\n**Latest Comment:**\nFrom: {{comment.authorLabel}} ({{comment.authorKind}})\n\n{{comment.body}}\n</quoted_issue_context>\n\nReview the new comment and continue the issue from the current state. Respond or take action as needed.\nBefore 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.";
|
|
15
|
+
export declare const ISSUE_CHANGES_REQUESTED_PROMPT_TEMPLATE = "<wake_context>\nYou are agent {{agent.id}} ({{agent.name}}). A reviewer requested changes on an issue you own.\n\n{{context.rudderWorkspace.orgResourcesPrompt}}\n\n**Issue:** {{issue.title}}\n**ID:** {{issue.id}}\n**Status:** {{issue.status}}\n**Assignee:** {{issue.assigneeLabel}}\n**Reviewer:** {{issue.reviewerLabel}}\n**Created At:** {{issue.createdAt}}\n**Updated At:** {{issue.updatedAt}}\n</wake_context>\n\n<quoted_issue_context>\n**Issue Description:**\n{{issue.description}}\n\n\n**Reviewer Comment:**\nFrom: {{comment.authorLabel}} ({{comment.authorKind}})\n\n{{comment.body}}\n</quoted_issue_context>\n\nReview the requested changes and continue the issue from the current state. Address the reviewer feedback before handing it back for review.\nBefore 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.";
|
|
16
|
+
export declare const ISSUE_REVIEW_PROMPT_TEMPLATE = "<wake_context>\nYou are agent {{agent.id}} ({{agent.name}}). You have been asked to review an issue.\n\n{{context.rudderWorkspace.orgResourcesPrompt}}\n\n**Issue:** {{issue.title}}\n**ID:** {{issue.id}}\n**Status:** {{issue.status}}\n**Priority:** {{issue.priority}}\n**Assignee:** {{issue.assigneeLabel}}\n**Reviewer:** {{issue.reviewerLabel}}\n**Created At:** {{issue.createdAt}}\n**Updated At:** {{issue.updatedAt}}\n</wake_context>\n\n<quoted_issue_context>\n**Issue Description:**\n{{issue.description}}\n\n\n**Review Instructions:**\n{{context.reviewInstructions}}\n</quoted_issue_context>\n\nInspect the issue state, evidence, comments, and outputs before deciding. Record the requested review outcome instead of treating this as a fresh implementation assignment.";
|
|
17
|
+
export declare const ISSUE_REVIEW_RECOVERY_PROMPT_TEMPLATE = "<wake_context>\nYou are agent {{agent.id}} ({{agent.name}}). This is a reviewer recovery run, not a fresh implementation assignment.\n\n{{context.rudderWorkspace.orgResourcesPrompt}}\n\n## Recovery Context\n\n- Original Run ID: {{context.recovery.originalRunId}}\n- Failure Kind: {{context.recovery.failureKind}}\n- Failure Summary: {{context.recovery.failureSummary}}\n- Recovery Trigger: {{context.recovery.recoveryTrigger}}\n- Recovery Mode: {{context.recovery.recoveryMode}}\n\n## Current Review Context\n\n- Issue: {{issue.title}}\n- ID: {{issue.id}}\n- Status: {{issue.status}}\n- Priority: {{issue.priority}}\n- Assignee: {{issue.assigneeLabel}}\n- Reviewer: {{issue.reviewerLabel}}\n- Created At: {{issue.createdAt}}\n- Updated At: {{issue.updatedAt}}\n</wake_context>\n\n<quoted_issue_context>\n- Description:\n{{issue.description}}\n\n\n**Review Instructions:**\n{{context.reviewInstructions}}\n</quoted_issue_context>\n\nInspect 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.";
|
|
18
|
+
export declare const ISSUE_RECOVERY_PROMPT_TEMPLATE = "<wake_context>\nYou are agent {{agent.id}} ({{agent.name}}). This is a recovery run, not a fresh task.\n\n{{context.rudderWorkspace.orgResourcesPrompt}}\n\n## Recovery Context\n\n- Original Run ID: {{context.recovery.originalRunId}}\n- Failure Kind: {{context.recovery.failureKind}}\n- Failure Summary: {{context.recovery.failureSummary}}\n- Recovery Trigger: {{context.recovery.recoveryTrigger}}\n- Recovery Mode: {{context.recovery.recoveryMode}}\n\n## Current Issue Context\n\n- Issue: {{issue.title}}\n- ID: {{issue.id}}\n- Status: {{issue.status}}\n- Priority: {{issue.priority}}\n- Assignee: {{issue.assigneeLabel}}\n- Reviewer: {{issue.reviewerLabel}}\n- Created At: {{issue.createdAt}}\n- Updated At: {{issue.updatedAt}}\n</wake_context>\n\n<quoted_issue_context>\n- Description:\n{{issue.description}}\n</quoted_issue_context>\n\n\nBefore 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.\nBefore 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.";
|
|
19
|
+
export declare const RECOVERY_PROMPT_TEMPLATE = "<wake_context>\nYou are agent {{agent.id}} ({{agent.name}}). This is a recovery run, not a fresh task.\n\n{{context.rudderWorkspace.orgResourcesPrompt}}\n\n## Recovery Context\n\n- Original Run ID: {{context.recovery.originalRunId}}\n- Failure Kind: {{context.recovery.failureKind}}\n- Failure Summary: {{context.recovery.failureSummary}}\n- Recovery Trigger: {{context.recovery.recoveryTrigger}}\n- Recovery Mode: {{context.recovery.recoveryMode}}\n</wake_context>\n\nBefore 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.";
|
|
20
|
+
export declare const ISSUE_PASSIVE_FOLLOWUP_PROMPT_TEMPLATE = "<wake_context>\nYou are agent {{agent.id}} ({{agent.name}}). This is a passive issue follow-up, not a fresh assignment and not a failure recovery.\n\n{{context.rudderWorkspace.orgResourcesPrompt}}\n\n## Why You Were Woken\n\nThe previous run ended without sufficient issue close-out. Continue to progress the current issue.\n\n- Origin Run ID: {{context.passiveFollowup.originRunId}}\n- Previous Run ID: {{context.passiveFollowup.previousRunId}}\n- Attempt: {{context.passiveFollowup.attempt}} / {{context.passiveFollowup.maxAttempts}}\nReason: {{context.passiveFollowup.reason}}\n\n## Current Issue Context\n\n- Issue: {{issue.title}}\n- ID: {{issue.id}}\n- Status: {{issue.status}}\n- Priority: {{issue.priority}}\n- Assignee: {{issue.assigneeLabel}}\n- Reviewer: {{issue.reviewerLabel}}\n- Created At: {{issue.createdAt}}\n- Updated At: {{issue.updatedAt}}\n</wake_context>\n\n<quoted_issue_context>\n- Description:\n{{issue.description}}\n</quoted_issue_context>\n\n\nBefore 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.\nBefore 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.";
|
|
21
21
|
/**
|
|
22
22
|
* Selects the base heartbeat prompt template used by runtimes before final prompt assembly.
|
|
23
23
|
*
|
|
@@ -63,6 +63,19 @@ export declare const ISSUE_PASSIVE_FOLLOWUP_PROMPT_TEMPLATE = "You are agent {{a
|
|
|
63
63
|
*/
|
|
64
64
|
export declare function selectPromptTemplate(configuredTemplate: string | undefined, context: Record<string, unknown>): string;
|
|
65
65
|
export declare function joinPromptSections(sections: Array<string | null | undefined>, separator?: string): string;
|
|
66
|
+
export declare const RUDDER_PROMPT_SECTION_TAGS: {
|
|
67
|
+
readonly agentInstruction: "rudder_agent_instruction";
|
|
68
|
+
readonly agentOperatingContract: "rudder_agent_operating_contract";
|
|
69
|
+
readonly heartbeatInstruction: "rudder_heartbeat_instruction";
|
|
70
|
+
readonly recentContext: "recent_rudder_context";
|
|
71
|
+
readonly projectContextResources: "project_context_resources";
|
|
72
|
+
readonly connectedCustomIntegrationTools: "connected_custom_integration_tools";
|
|
73
|
+
readonly currentAutomations: "current_automations";
|
|
74
|
+
readonly enabledSkills: "enabled_rudder_skills";
|
|
75
|
+
readonly wakeContext: "wake_context";
|
|
76
|
+
readonly quotedIssueContext: "quoted_issue_context";
|
|
77
|
+
};
|
|
78
|
+
export declare function wrapPromptSection(tagName: string, content: string): string;
|
|
66
79
|
export declare const RUDDER_AGENT_OPERATING_CONTRACT: string;
|
|
67
80
|
export declare const RUDDER_AGENT_HEARTBEAT_INSTRUCTION: string;
|
|
68
81
|
//# sourceMappingURL=server-utils.prompts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-utils.prompts.d.ts","sourceRoot":"","sources":["../src/server-utils.prompts.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,6BAA6B,gIAIzC,CAAC;AAEF,eAAO,MAAM,oCAAoC,
|
|
1
|
+
{"version":3,"file":"server-utils.prompts.d.ts","sourceRoot":"","sources":["../src/server-utils.prompts.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,6BAA6B,gIAIzC,CAAC;AAEF,eAAO,MAAM,oCAAoC,g3CAoByU,CAAC;AAyF3X,eAAO,MAAM,4BAA4B,uhXAgCgK,CAAC;AAE1M,eAAO,MAAM,6BAA6B,+qXA6C+M,CAAC;AAE1P,eAAO,MAAM,mCAAmC,q7XA0CiK,CAAC;AAElN,eAAO,MAAM,iCAAiC,2qXAgCgS,CAAC;AAkN/U,eAAO,MAAM,oCAAoC,aAI/C,CAAC;AAEH,wBAAgB,iCAAiC,CAAC,UAAU,EAAE,OAAO,GAAG,OAAO,CAE9E;AAED,eAAO,MAAM,6BAA6B,wKAC6H,CAAC;AAExK,eAAO,MAAM,iCAAiC,6UAC8R,CAAC;AAE7U,eAAO,MAAM,iCAAiC,8VAC+S,CAAC;AAE9V,eAAO,MAAM,4BAA4B,6qCAwBR,CAAC;AAElC,eAAO,MAAM,+BAA+B,gqDA4ByM,CAAC;AAEtP,eAAO,MAAM,+BAA+B,i3BA0BX,CAAC;AAElC,eAAO,MAAM,uCAAuC,85BA0BnB,CAAC;AAElC,eAAO,MAAM,4B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