@oh-my-pi/pi-coding-agent 15.0.2 → 15.1.1

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.
Files changed (138) hide show
  1. package/CHANGELOG.md +56 -1
  2. package/examples/custom-tools/README.md +11 -7
  3. package/examples/custom-tools/hello/index.ts +2 -2
  4. package/examples/extensions/README.md +19 -8
  5. package/examples/extensions/api-demo.ts +15 -19
  6. package/examples/extensions/hello.ts +5 -6
  7. package/examples/extensions/plan-mode.ts +1 -1
  8. package/examples/extensions/reload-runtime.ts +4 -3
  9. package/examples/extensions/with-deps/index.ts +4 -3
  10. package/examples/sdk/06-extensions.ts +4 -2
  11. package/package.json +7 -17
  12. package/src/autoresearch/tools/init-experiment.ts +38 -41
  13. package/src/autoresearch/tools/log-experiment.ts +32 -41
  14. package/src/autoresearch/tools/run-experiment.ts +3 -3
  15. package/src/autoresearch/tools/update-notes.ts +11 -11
  16. package/src/commit/agentic/tools/analyze-file.ts +4 -4
  17. package/src/commit/agentic/tools/git-file-diff.ts +4 -4
  18. package/src/commit/agentic/tools/git-hunk.ts +5 -5
  19. package/src/commit/agentic/tools/git-overview.ts +4 -4
  20. package/src/commit/agentic/tools/propose-changelog.ts +13 -13
  21. package/src/commit/agentic/tools/propose-commit.ts +6 -6
  22. package/src/commit/agentic/tools/recent-commits.ts +3 -3
  23. package/src/commit/agentic/tools/schemas.ts +28 -28
  24. package/src/commit/agentic/tools/split-commit.ts +22 -21
  25. package/src/commit/analysis/summary.ts +4 -4
  26. package/src/commit/changelog/generate.ts +7 -11
  27. package/src/commit/shared-llm.ts +22 -34
  28. package/src/config/config-file.ts +35 -13
  29. package/src/config/model-registry.ts +9 -190
  30. package/src/config/models-config-schema.ts +166 -0
  31. package/src/config/settings-schema.ts +18 -0
  32. package/src/edit/index.ts +2 -2
  33. package/src/edit/modes/apply-patch.ts +7 -6
  34. package/src/edit/modes/patch.ts +18 -25
  35. package/src/edit/modes/replace.ts +18 -20
  36. package/src/eval/js/shared/rewrite-imports.ts +131 -10
  37. package/src/eval/py/executor.ts +233 -623
  38. package/src/eval/py/kernel.ts +27 -2
  39. package/src/exa/factory.ts +5 -4
  40. package/src/exa/mcp-client.ts +1 -1
  41. package/src/exa/researcher.ts +9 -20
  42. package/src/exa/search.ts +26 -52
  43. package/src/exa/types.ts +1 -1
  44. package/src/exa/websets.ts +54 -53
  45. package/src/exec/bash-executor.ts +2 -1
  46. package/src/extensibility/custom-commands/loader.ts +5 -3
  47. package/src/extensibility/custom-commands/types.ts +4 -2
  48. package/src/extensibility/custom-tools/loader.ts +5 -3
  49. package/src/extensibility/custom-tools/types.ts +7 -6
  50. package/src/extensibility/custom-tools/wrapper.ts +1 -1
  51. package/src/extensibility/extensions/loader.ts +7 -3
  52. package/src/extensibility/extensions/types.ts +9 -5
  53. package/src/extensibility/extensions/wrapper.ts +1 -2
  54. package/src/extensibility/hooks/loader.ts +3 -1
  55. package/src/extensibility/hooks/tool-wrapper.ts +1 -1
  56. package/src/extensibility/hooks/types.ts +4 -2
  57. package/src/extensibility/plugins/legacy-pi-compat.ts +30 -0
  58. package/src/extensibility/shared-events.ts +1 -1
  59. package/src/extensibility/typebox.ts +391 -0
  60. package/src/goals/tools/goal-tool.ts +6 -12
  61. package/src/hashline/types.ts +4 -4
  62. package/src/hindsight/state.ts +2 -2
  63. package/src/index.ts +0 -2
  64. package/src/internal-urls/docs-index.generated.ts +7 -7
  65. package/src/lsp/types.ts +30 -38
  66. package/src/mcp/manager.ts +1 -1
  67. package/src/mcp/tool-bridge.ts +1 -1
  68. package/src/modes/components/session-observer-overlay.ts +12 -1
  69. package/src/modes/components/status-line/segments.ts +2 -1
  70. package/src/modes/controllers/command-controller.ts +27 -2
  71. package/src/modes/controllers/event-controller.ts +3 -4
  72. package/src/modes/interactive-mode.ts +1 -1
  73. package/src/modes/rpc/host-tools.ts +1 -1
  74. package/src/modes/rpc/rpc-client.ts +1 -1
  75. package/src/modes/rpc/rpc-types.ts +1 -1
  76. package/src/modes/theme/theme.ts +111 -117
  77. package/src/modes/types.ts +1 -1
  78. package/src/modes/utils/context-usage.ts +2 -2
  79. package/src/sdk.ts +31 -8
  80. package/src/session/agent-session.ts +74 -104
  81. package/src/session/messages.ts +16 -51
  82. package/src/session/session-manager.ts +22 -2
  83. package/src/session/streaming-output.ts +16 -6
  84. package/src/task/executor.ts +208 -86
  85. package/src/task/index.ts +15 -11
  86. package/src/task/render.ts +32 -5
  87. package/src/task/types.ts +54 -39
  88. package/src/tools/ask.ts +12 -12
  89. package/src/tools/ast-edit.ts +11 -15
  90. package/src/tools/ast-grep.ts +9 -10
  91. package/src/tools/bash.ts +9 -23
  92. package/src/tools/browser.ts +39 -53
  93. package/src/tools/calculator.ts +12 -11
  94. package/src/tools/checkpoint.ts +7 -7
  95. package/src/tools/debug.ts +40 -43
  96. package/src/tools/eval.ts +6 -8
  97. package/src/tools/find.ts +10 -13
  98. package/src/tools/gh.ts +71 -128
  99. package/src/tools/hindsight-recall.ts +4 -6
  100. package/src/tools/hindsight-reflect.ts +5 -5
  101. package/src/tools/hindsight-retain.ts +15 -17
  102. package/src/tools/image-gen.ts +32 -82
  103. package/src/tools/index.ts +4 -1
  104. package/src/tools/inspect-image.ts +8 -9
  105. package/src/tools/irc.ts +15 -27
  106. package/src/tools/job.ts +14 -21
  107. package/src/tools/read.ts +7 -8
  108. package/src/tools/recipe/index.ts +7 -9
  109. package/src/tools/render-mermaid.ts +12 -12
  110. package/src/tools/report-tool-issue.ts +4 -4
  111. package/src/tools/resolve.ts +11 -11
  112. package/src/tools/review.ts +14 -26
  113. package/src/tools/search-tool-bm25.ts +7 -9
  114. package/src/tools/search.ts +19 -22
  115. package/src/tools/ssh.ts +7 -7
  116. package/src/tools/todo-write.ts +26 -34
  117. package/src/tools/vim.ts +10 -26
  118. package/src/tools/write.ts +5 -5
  119. package/src/tools/yield.ts +100 -54
  120. package/src/web/search/index.ts +9 -24
  121. package/src/prompts/compaction/branch-summary-context.md +0 -5
  122. package/src/prompts/compaction/branch-summary-preamble.md +0 -2
  123. package/src/prompts/compaction/branch-summary.md +0 -30
  124. package/src/prompts/compaction/compaction-short-summary.md +0 -9
  125. package/src/prompts/compaction/compaction-summary-context.md +0 -5
  126. package/src/prompts/compaction/compaction-summary.md +0 -38
  127. package/src/prompts/compaction/compaction-turn-prefix.md +0 -17
  128. package/src/prompts/compaction/compaction-update-summary.md +0 -45
  129. package/src/prompts/system/auto-handoff-threshold-focus.md +0 -1
  130. package/src/prompts/system/file-operations.md +0 -10
  131. package/src/prompts/system/handoff-document.md +0 -49
  132. package/src/prompts/system/summarization-system.md +0 -3
  133. package/src/session/compaction/branch-summarization.ts +0 -324
  134. package/src/session/compaction/compaction.ts +0 -1420
  135. package/src/session/compaction/errors.ts +0 -31
  136. package/src/session/compaction/index.ts +0 -8
  137. package/src/session/compaction/pruning.ts +0 -91
  138. package/src/session/compaction/utils.ts +0 -184
@@ -4,10 +4,15 @@
4
4
  * Subagents must call this tool to finish and return structured JSON output.
5
5
  */
6
6
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
7
- import { dereferenceJsonSchema, sanitizeSchemaForStrictMode } from "@oh-my-pi/pi-ai/utils/schema";
8
- import type { Static, TSchema } from "@sinclair/typebox";
9
- import { Type } from "@sinclair/typebox";
10
- import Ajv, { type ErrorObject, type ValidateFunction } from "ajv";
7
+ import type { TSchema } from "@oh-my-pi/pi-ai/types";
8
+ import {
9
+ dereferenceJsonSchema,
10
+ isValidJsonSchema,
11
+ type JsonSchemaValidationIssue,
12
+ type JsonSchemaValidationResult,
13
+ sanitizeSchemaForStrictMode,
14
+ validateJsonSchemaValue,
15
+ } from "@oh-my-pi/pi-ai/utils/schema";
11
16
  import { subprocessToolRegistry } from "../task/subprocess-tool-registry";
12
17
  import type { ToolSession } from ".";
13
18
  import { jtdToJsonSchema, normalizeSchema } from "./jtd-to-json-schema";
@@ -18,8 +23,6 @@ export interface YieldDetails {
18
23
  error?: string;
19
24
  }
20
25
 
21
- const ajv = new Ajv({ allErrors: true, strict: false, logger: false });
22
-
23
26
  function formatSchema(schema: unknown): string {
24
27
  if (schema === undefined) return "No schema provided.";
25
28
  if (typeof schema === "string") return schema;
@@ -30,16 +33,72 @@ function formatSchema(schema: unknown): string {
30
33
  }
31
34
  }
32
35
 
33
- function formatAjvErrors(errors: ErrorObject[] | null | undefined): string {
34
- if (!errors || errors.length === 0) return "Unknown schema validation error.";
35
- return errors
36
- .map(err => {
37
- const path = err.instancePath ? `${err.instancePath}: ` : "";
38
- return `${path}${err.message ?? "invalid"}`;
36
+ function formatJsonSchemaIssues(issues: ReadonlyArray<JsonSchemaValidationIssue> | undefined): string {
37
+ if (!issues || issues.length === 0) return "Unknown schema validation error.";
38
+ return issues
39
+ .map(issue => {
40
+ const path = issue.path.length === 0 ? "" : `${issue.path.map(seg => String(seg)).join("/")}: `;
41
+ return `${path}${issue.message}`;
39
42
  })
40
43
  .join("; ");
41
44
  }
42
45
 
46
+ function looseRecordSchema(description: string): Record<string, unknown> {
47
+ return {
48
+ type: "object",
49
+ additionalProperties: true,
50
+ description,
51
+ };
52
+ }
53
+
54
+ function hasUnresolvedRefs(schema: unknown): boolean {
55
+ if (schema == null) return false;
56
+ if (Array.isArray(schema)) {
57
+ for (const item of schema) {
58
+ if (hasUnresolvedRefs(item)) return true;
59
+ }
60
+ return false;
61
+ }
62
+ if (typeof schema !== "object") return false;
63
+ const record = schema as Record<string, unknown>;
64
+ if (typeof record.$ref === "string") return true;
65
+ for (const key in record) {
66
+ if (key === "const" || key === "default" || key === "enum" || key === "examples") continue;
67
+ if (hasUnresolvedRefs(record[key])) return true;
68
+ }
69
+ return false;
70
+ }
71
+
72
+ function wrapYieldParameters(dataSchema: Record<string, unknown>): Record<string, unknown> {
73
+ return {
74
+ type: "object",
75
+ additionalProperties: false,
76
+ description: "submit data or error",
77
+ properties: {
78
+ result: {
79
+ anyOf: [
80
+ {
81
+ type: "object",
82
+ additionalProperties: false,
83
+ description: "task succeeded",
84
+ properties: { data: dataSchema },
85
+ required: ["data"],
86
+ },
87
+ {
88
+ type: "object",
89
+ additionalProperties: false,
90
+ properties: {
91
+ error: { type: "string", description: "error message" },
92
+ },
93
+ required: ["error"],
94
+ },
95
+ ],
96
+ },
97
+ },
98
+ required: ["result"],
99
+ };
100
+ }
101
+
43
102
  export class YieldTool implements AgentTool<TSchema, YieldDetails> {
44
103
  readonly name = "yield";
45
104
  readonly label = "Submit Result";
@@ -52,33 +111,15 @@ export class YieldTool implements AgentTool<TSchema, YieldDetails> {
52
111
  readonly intent = "omit" as const;
53
112
  lenientArgValidation = true;
54
113
 
55
- readonly #validate?: ValidateFunction;
114
+ readonly #validate?: (value: unknown) => JsonSchemaValidationResult;
56
115
  #schemaValidationFailures = 0;
57
116
 
58
117
  constructor(session: ToolSession) {
59
- const createParameters = (dataSchema: TSchema): TSchema =>
60
- Type.Object(
61
- {
62
- result: Type.Union([
63
- Type.Object({ data: dataSchema }, { description: "task succeeded" }),
64
- Type.Object({
65
- error: Type.String({ description: "error message" }),
66
- }),
67
- ]),
68
- },
69
- {
70
- additionalProperties: false,
71
- description: "submit data or error",
72
- },
73
- ) as TSchema;
74
-
75
- let validate: ValidateFunction | undefined;
76
- let dataSchema: TSchema;
118
+ let validate: ((value: unknown) => JsonSchemaValidationResult) | undefined;
77
119
  let parameters: TSchema;
78
120
 
79
121
  try {
80
122
  const schemaResult = normalizeSchema(session.outputSchema);
81
- // Convert JTD to JSON Schema if needed (auto-detected)
82
123
  const normalizedSchema =
83
124
  schemaResult.normalized !== undefined ? jtdToJsonSchema(schemaResult.normalized) : undefined;
84
125
  let schemaError = schemaResult.error;
@@ -88,10 +129,10 @@ export class YieldTool implements AgentTool<TSchema, YieldDetails> {
88
129
  }
89
130
 
90
131
  if (normalizedSchema !== undefined && normalizedSchema !== false && !schemaError) {
91
- try {
92
- validate = ajv.compile(normalizedSchema as Record<string, unknown> | boolean);
93
- } catch (err) {
94
- schemaError = err instanceof Error ? err.message : String(err);
132
+ if (!isValidJsonSchema(normalizedSchema)) {
133
+ schemaError = "invalid JSON schema";
134
+ } else {
135
+ validate = value => validateJsonSchemaValue(normalizedSchema, value);
95
136
  }
96
137
  }
97
138
 
@@ -109,27 +150,29 @@ export class YieldTool implements AgentTool<TSchema, YieldDetails> {
109
150
  ? {}
110
151
  : undefined;
111
152
 
153
+ let dataSchema: Record<string, unknown>;
112
154
  if (sanitizedSchema !== undefined) {
113
155
  const resolved = dereferenceJsonSchema({
114
156
  ...sanitizedSchema,
115
157
  description: schemaDescription,
116
- });
117
- dataSchema = Type.Unsafe(resolved as Record<string, unknown>);
158
+ }) as Record<string, unknown>;
159
+ if (hasUnresolvedRefs(resolved)) {
160
+ throw new Error("schema contains unresolved $ref after dereferencing");
161
+ }
162
+ dataSchema = resolved;
118
163
  } else {
119
- dataSchema = Type.Record(Type.String(), Type.Any(), {
120
- description: schemaError ? schemaDescription : "Structured JSON output (no schema specified)",
121
- });
164
+ dataSchema = looseRecordSchema(
165
+ schemaError ? schemaDescription : "Structured JSON output (no schema specified)",
166
+ );
122
167
  }
123
- parameters = createParameters(dataSchema);
168
+ parameters = wrapYieldParameters(dataSchema);
124
169
  JSON.stringify(parameters);
125
- // Verify the final parameters compile with AJV (catches unresolved $ref, etc.)
126
- ajv.compile(parameters as Record<string, unknown>);
170
+ if (!isValidJsonSchema(parameters)) throw new Error("yield parameters schema is invalid");
127
171
  } catch (err) {
128
172
  const errorMsg = err instanceof Error ? err.message : String(err);
129
- dataSchema = Type.Record(Type.String(), Type.Any(), {
130
- description: `Structured JSON output (schema processing failed: ${errorMsg})`,
131
- });
132
- parameters = createParameters(dataSchema);
173
+ parameters = wrapYieldParameters(
174
+ looseRecordSchema(`Structured JSON output (schema processing failed: ${errorMsg})`),
175
+ );
133
176
  validate = undefined;
134
177
  this.strict = false;
135
178
  }
@@ -140,7 +183,7 @@ export class YieldTool implements AgentTool<TSchema, YieldDetails> {
140
183
 
141
184
  async execute(
142
185
  _toolCallId: string,
143
- params: Static<TSchema>,
186
+ params: unknown,
144
187
  _signal?: AbortSignal,
145
188
  _onUpdate?: AgentToolUpdateCallback<YieldDetails>,
146
189
  _context?: AgentToolContext,
@@ -170,12 +213,15 @@ export class YieldTool implements AgentTool<TSchema, YieldDetails> {
170
213
  if (data === undefined || data === null) {
171
214
  throw new Error("data is required when yield indicates success");
172
215
  }
173
- if (this.#validate && !this.#validate(data)) {
174
- this.#schemaValidationFailures++;
175
- if (this.#schemaValidationFailures <= 1) {
176
- throw new Error(`Output does not match schema: ${formatAjvErrors(this.#validate.errors)}`);
216
+ if (this.#validate) {
217
+ const parsed = this.#validate(data);
218
+ if (!parsed.success) {
219
+ this.#schemaValidationFailures++;
220
+ if (this.#schemaValidationFailures <= 1) {
221
+ throw new Error(`Output does not match schema: ${formatJsonSchemaIssues(parsed.issues)}`);
222
+ }
223
+ schemaValidationOverridden = true;
177
224
  }
178
- schemaValidationOverridden = true;
179
225
  }
180
226
  }
181
227
 
@@ -6,9 +6,8 @@
6
6
  *
7
7
  */
8
8
  import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
9
- import { StringEnum } from "@oh-my-pi/pi-ai";
10
9
  import { prompt } from "@oh-my-pi/pi-utils";
11
- import { Type } from "@sinclair/typebox";
10
+ import * as z from "zod/v4";
12
11
  import type { CustomTool, CustomToolContext, RenderResultOptions } from "../../extensibility/custom-tools/types";
13
12
  import type { Theme } from "../../modes/theme/theme";
14
13
  import webSearchSystemPrompt from "../../prompts/system/web-search.md" with { type: "text" };
@@ -21,30 +20,16 @@ import type { SearchProviderId, SearchResponse } from "./types";
21
20
  import { SearchProviderError } from "./types";
22
21
 
23
22
  /** Web search tool parameters schema */
24
- export const webSearchSchema = Type.Object({
25
- query: Type.String({ description: "Search query" }),
26
- recency: Type.Optional(
27
- StringEnum(["day", "week", "month", "year"], {
28
- description: "Recency filter (Brave, Perplexity)",
29
- }),
30
- ),
31
- limit: Type.Optional(Type.Number({ description: "Max results to return" })),
32
- max_tokens: Type.Optional(Type.Number({ description: "Maximum output tokens" })),
33
- temperature: Type.Optional(Type.Number({ description: "Sampling temperature" })),
34
- num_search_results: Type.Optional(Type.Number({ description: "Number of search results to retrieve" })),
23
+ export const webSearchSchema = z.object({
24
+ query: z.string().describe("Search query"),
25
+ recency: z.enum(["day", "week", "month", "year"]).describe("Recency filter (Brave, Perplexity)").optional(),
26
+ limit: z.number().describe("Max results to return").optional(),
27
+ max_tokens: z.number().describe("Maximum output tokens").optional(),
28
+ temperature: z.number().describe("Sampling temperature").optional(),
29
+ num_search_results: z.number().describe("Number of search results to retrieve").optional(),
35
30
  });
36
31
 
37
- export type SearchToolParams = {
38
- query: string;
39
- recency?: "day" | "week" | "month" | "year";
40
- limit?: number;
41
- /** Maximum output tokens. Defaults to 4096. */
42
- max_tokens?: number;
43
- /** Sampling temperature (0–1). Lower = more focused/factual. Defaults to 0.2. */
44
- temperature?: number;
45
- /** Number of search results to retrieve. Defaults to 10. */
46
- num_search_results?: number;
47
- };
32
+ export type SearchToolParams = z.infer<typeof webSearchSchema>;
48
33
 
49
34
  export interface SearchQueryParams extends SearchToolParams {
50
35
  provider?: SearchProviderId | "auto";
@@ -1,5 +0,0 @@
1
- The following is a summary of a branch that this conversation came back from:
2
-
3
- <summary>
4
- {{summary}}
5
- </summary>
@@ -1,2 +0,0 @@
1
- The user explored a different conversation branch before returning here.
2
- Summary of that exploration:
@@ -1,30 +0,0 @@
1
- You MUST create a structured summary of the conversation branch for context when returning.
2
-
3
- You MUST use EXACT format:
4
-
5
- ## Goal
6
-
7
- [What user trying to accomplish in this branch?]
8
-
9
- ## Constraints & Preferences
10
- - [Constraints, preferences, requirements mentioned]
11
- - [(none) if none mentioned]
12
-
13
- ## Progress
14
-
15
- ### Done
16
- - [x] [Completed tasks/changes]
17
-
18
- ### In Progress
19
- - [ ] [Work started but not finished]
20
-
21
- ### Blocked
22
- - [Issues preventing progress]
23
-
24
- ## Key Decisions
25
- - **[Decision]**: [Brief rationale]
26
-
27
- ## Next Steps
28
- 1. [What should happen next to continue]
29
-
30
- Sections MUST be kept concise. You MUST preserve exact file paths, function names, error messages.
@@ -1,9 +0,0 @@
1
- You MUST summarize what was done in this conversation, written like a pull request description.
2
-
3
- Rules:
4
- - MUST be 2-3 sentences max
5
- - MUST describe the changes made, not the process
6
- - NEVER mention running tests, builds, or other validation steps
7
- - NEVER explain what the user asked for
8
- - MUST write in first person (I added…, I fixed…)
9
- - NEVER ask questions
@@ -1,5 +0,0 @@
1
- Another language model started to solve this problem and produced a summary of its thinking process. You also have access to the state of the tools that were used by that language model. You MUST use this to build on the work that has already been done and NEVER duplicate work. Here is the summary produced by the other language model; you MUST use the information in this summary to assist with your own analysis:
2
-
3
- <summary>
4
- {{summary}}
5
- </summary>
@@ -1,38 +0,0 @@
1
- You MUST summarize the conversation above into a structured context checkpoint handoff summary for another LLM to resume task.
2
-
3
- IMPORTANT: If conversation ends with unanswered question to user or imperative/request awaiting user response (e.g., "Please run command and paste output"), you MUST preserve that exact question/request.
4
-
5
- You MUST use this format (sections can be omitted if not applicable):
6
-
7
- ## Goal
8
- [User goals; list multiple if session covers different tasks.]
9
-
10
- ## Constraints & Preferences
11
- - [Constraints or requirements mentioned]
12
-
13
- ## Progress
14
-
15
- ### Done
16
- - [x] [Completed tasks/changes]
17
-
18
- ### In Progress
19
- - [ ] [Current work]
20
-
21
- ### Blocked
22
- - [Issues preventing progress]
23
-
24
- ## Key Decisions
25
- - **[Decision]**: [Brief rationale]
26
-
27
- ## Next Steps
28
- 1. [Ordered list of next actions]
29
-
30
- ## Critical Context
31
- - [Important data, pending questions, references]
32
-
33
- ## Additional Notes
34
- [Anything else important not covered above]
35
-
36
- You MUST output only the structured summary; you NEVER include extra text.
37
-
38
- Sections MUST be kept concise. You MUST preserve exact file paths, function names, error messages, and relevant tool outputs or command results. You MUST include repository state changes (branch, uncommitted changes) if mentioned.
@@ -1,17 +0,0 @@
1
- This is the PREFIX of a turn that was too large to keep. The SUFFIX (recent work) is retained.
2
-
3
- You MUST summarize the prefix to provide context for the retained suffix:
4
-
5
- ## Original Request
6
-
7
- [What did the user ask for in this turn?]
8
-
9
- ## Early Progress
10
- - [Key decisions and work done in the prefix]
11
-
12
- ## Context for Suffix
13
- - [Information needed to understand the retained recent work]
14
-
15
- You MUST output only the structured summary. You NEVER include extra text.
16
-
17
- You MUST be concise. You MUST preserve exact file paths, function names, error messages, and relevant tool outputs or command results if they appear. You MUST focus on what's needed to understand the kept suffix.
@@ -1,45 +0,0 @@
1
- You MUST incorporate new messages above into the existing handoff summary in <previous-summary> tags, used by another LLM to resume task.
2
- RULES:
3
- - MUST preserve all information from previous summary
4
- - MUST add new progress, decisions, and context from new messages
5
- - MUST update Progress: move items from "In Progress" to "Done" when completed
6
- - MUST update "Next Steps" based on what was accomplished
7
- - MUST preserve exact file paths, function names, and error messages
8
- - You MAY remove anything no longer relevant
9
-
10
- IMPORTANT: If new messages end with unanswered question or request to user, you MUST add it to Critical Context (replacing any previous pending question if answered).
11
-
12
- You MUST use this format (omit sections if not applicable):
13
-
14
- ## Goal
15
- [Preserve existing goals; add new ones if task expanded]
16
-
17
- ## Constraints & Preferences
18
- - [Preserve existing; add new ones discovered]
19
-
20
- ## Progress
21
-
22
- ### Done
23
- - [x] [Include previously done and newly completed items]
24
-
25
- ### In Progress
26
- - [ ] [Current work—update based on progress]
27
-
28
- ### Blocked
29
- - [Current blockers—remove if resolved]
30
-
31
- ## Key Decisions
32
- - **[Decision]**: [Brief rationale] (preserve all previous, add new)
33
-
34
- ## Next Steps
35
- 1. [Update based on current state]
36
-
37
- ## Critical Context
38
- - [Preserve important context; add new if needed]
39
-
40
- ## Additional Notes
41
- [Other important info not fitting above]
42
-
43
- You MUST output only the structured summary; you NEVER include extra text.
44
-
45
- Sections MUST be kept concise. You MUST preserve relevant tool outputs/command results. You MUST include repository state changes (branch, uncommitted changes) if mentioned.
@@ -1 +0,0 @@
1
- Threshold-triggered maintenance: preserve critical implementation state and immediate next actions.
@@ -1,10 +0,0 @@
1
- {{#if readFiles.length}}
2
- {{#xml "read-files"}}
3
- {{join readFiles "\n"}}
4
- {{/xml}}
5
- {{/if}}
6
- {{#if modifiedFiles.length}}
7
- {{#xml "modified-files"}}
8
- {{join modifiedFiles "\n"}}
9
- {{/xml}}
10
- {{/if}}
@@ -1,49 +0,0 @@
1
- <critical>
2
- Write a handoff document for another instance of yourself.
3
- The handoff MUST be sufficient for seamless continuation without access to this conversation.
4
- Output ONLY the handoff document. No preamble, no commentary, no wrapper text.
5
- </critical>
6
-
7
- <instruction>
8
- Capture exact technical state, not abstractions.
9
- - File paths, symbol names, commands run
10
- - Test results, observed failures
11
- - Decisions made
12
- - Partial work affecting the next step
13
- </instruction>
14
-
15
- <output>
16
- Use exactly this structure:
17
-
18
- ## Goal
19
- [What the user is trying to accomplish]
20
-
21
- ## Constraints & Preferences
22
- - [Any constraints, preferences, or requirements mentioned]
23
-
24
- ## Progress
25
- ### Done
26
- - [x] [Completed tasks with specifics]
27
-
28
- ### In Progress
29
- - [ ] [Current work if any]
30
-
31
- ### Pending
32
- - [ ] [Tasks mentioned but not started]
33
-
34
- ## Key Decisions
35
- - **[Decision]**: [Rationale]
36
-
37
- ## Critical Context
38
- - Code snippets, file paths, function/type names, error messages, data essential to continue
39
- - Repository state if relevant
40
-
41
- ## Next Steps
42
- 1. [What should happen next]
43
- </output>
44
-
45
- {{#if additionalFocus}}
46
- <instruction>
47
- Additional focus: {{additionalFocus}}
48
- </instruction>
49
- {{/if}}
@@ -1,3 +0,0 @@
1
- Summarize conversations between users and AI coding assistants. Produce structured summaries in the exact specified format.
2
-
3
- Do NOT continue the conversation. Do NOT respond to questions in the conversation. Output ONLY the structured summary.