Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tall-rules-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@plotday/sdk": patch
---

Changed: Generate agent-guide.ts from AGENT.template.md
2 changes: 2 additions & 0 deletions sdk/cli/templates/AGENTS.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ try {
6. **Clean up callbacks and stored state** - Delete callbacks and Store entries when no longer needed.
7. **Handle missing auth gracefully** - Check for stored auth before operations.
8. **Batch size matters** - Process enough items per batch to be efficient, but few enough to stay under time limits.
9. **Processing self-created activities** - Other users may change an Activity created by the agent, resulting in an \`activity\` call. Be sure to check the \`changes === null\` and/or \`activity.author.id !== this.id\` to avoid re-processing.
10. Activity with type ActivityType.Note typically do not have a start or end set, unless they're a note about a specific day or time that shouldn't be shown until then.

## Type Patterns

Expand Down
20 changes: 20 additions & 0 deletions sdk/prebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,24 @@ export default llmDocs;
const indexPath = join(llmDocsDir, "index.ts");
writeFileSync(indexPath, indexContent, "utf-8");

// Generate agents-guide-template.ts from AGENTS.template.md
const agentsTemplatePath = join(__dirname, "cli", "templates", "AGENTS.template.md");
if (existsSync(agentsTemplatePath)) {
const agentsTemplateContent = readFileSync(agentsTemplatePath, "utf-8");
const agentsGuideContent = `/**
* Generated agents guide template
*
* This file is auto-generated during build. Do not edit manually.
* Generated from: cli/templates/AGENTS.template.md
*/

export default ${JSON.stringify(agentsTemplateContent)};
`;
const agentsGuideOutputPath = join(llmDocsDir, "agents-guide-template.ts");
writeFileSync(agentsGuideOutputPath, agentsGuideContent, "utf-8");
console.log(`✓ Generated agents-guide-template.ts from AGENTS.template.md`);
} else {
console.warn(`Warning: AGENTS.template.md not found at ${agentsTemplatePath}`);
}

console.log(`✓ Generated ${typeFiles.length} LLM documentation files in src/llm-docs/`);
Loading