feat: add tags to headless (#957)
This commit is contained in:
@@ -73,6 +73,8 @@ export interface CreateAgentOptions {
|
||||
>;
|
||||
/** Override values for preset blocks (label → value) */
|
||||
blockValues?: Record<string, string>;
|
||||
/** Tags to organize and categorize the agent */
|
||||
tags?: string[];
|
||||
}
|
||||
|
||||
export async function createAgent(
|
||||
@@ -290,6 +292,9 @@ export async function createAgent(
|
||||
if (isSubagent) {
|
||||
tags.push("role:subagent");
|
||||
}
|
||||
if (options.tags && Array.isArray(options.tags)) {
|
||||
tags.push(...options.tags);
|
||||
}
|
||||
|
||||
const agentDescription =
|
||||
options.description ?? `Letta Code agent created in ${process.cwd()}`;
|
||||
|
||||
@@ -124,6 +124,7 @@ export async function handleHeadlessCommand(
|
||||
"init-blocks": { type: "string" },
|
||||
"base-tools": { type: "string" },
|
||||
"from-af": { type: "string" },
|
||||
tags: { type: "string" },
|
||||
|
||||
memfs: { type: "boolean" },
|
||||
"no-memfs": { type: "boolean" },
|
||||
@@ -268,6 +269,7 @@ export async function handleHeadlessCommand(
|
||||
const fromAfFile = values["from-af"] as string | undefined;
|
||||
const preLoadSkillsRaw = values["pre-load-skills"] as string | undefined;
|
||||
const maxTurnsRaw = values["max-turns"] as string | undefined;
|
||||
const tags = values["tags"] as string[] | undefined;
|
||||
|
||||
// Parse and validate max-turns if provided
|
||||
let maxTurns: number | undefined;
|
||||
@@ -581,6 +583,7 @@ export async function handleHeadlessCommand(
|
||||
baseTools,
|
||||
memoryBlocks,
|
||||
blockValues,
|
||||
tags,
|
||||
};
|
||||
const result = await createAgent(createOptions);
|
||||
agent = result.agent;
|
||||
|
||||
@@ -439,6 +439,7 @@ async function main(): Promise<void> {
|
||||
"pre-load-skills": { type: "string" },
|
||||
"from-af": { type: "string" },
|
||||
import: { type: "string" },
|
||||
tags: { type: "string" },
|
||||
|
||||
memfs: { type: "boolean" },
|
||||
"no-memfs": { type: "boolean" },
|
||||
|
||||
Reference in New Issue
Block a user