用途:本技能面向 Agentforce 智能体开发,核心是 Agent Script(Salesforce 面向 AI 智能体的脚本语言)。需注意 Agent Script 并非 AppleScript、JavaScript、Python 或其他语言,语法语义不可混用。智能体由 AiAuthoringBundle 元数据定义:.agent 文件描述行为,bundle-meta.xml 提供元数据;动作可由 invocable Apex、autolaunched Flow、Prompt Template 等实现。
主要能力:覆盖全生命周期——设计智能体、编写 Agent Script、校验与调试、部署与发布、测试;也支持理解他人编写的既有智能体(反向生成 Agent Spec、导出子智能体关系图、按需注释源码)。参考文件按任务域组织,如 CLI 命令、核心语言、设计与 Spec、姿势与确定性、校验与调试等。
使用方式:按任务描述识别意图,动手前先读对应参考文件。常用命令包括:sf agent generate authoring-bundle --json --no-spec --name "<Label>" --api-name <Developer_Name>;sf agent validate authoring-bundle --json --api-name <Developer_Name>;预览用 sf agent preview start --json --use-live-actions --authoring-bundle <Developer_Name>,发送语句用 sf agent preview send --json --authoring-bundle <Developer_Name> --session-id <ID> -u "<message>";发布用 sf agent publish authoring-bundle --json --api-name <Developer_Name>,激活用 sf agent activate --json --api-name <Developer_Name>。
限制与规则:所有 sf CLI 命令始终加 --json,不通过 jq 或 2>/dev/null 处理,直接读取完整 JSON。交互前用 sf config get target-org --json 确认目标组织,未设置则请用户执行 sf config set target-org <alias>。修 bug 前先用 --use-live-actions 预览并读取 session trace 定位行为。Agent Spec 审批为硬性关卡,未获批准不得继续。默认停留在草稿迭代,发布与激活是显式发布动作,需用户确认。动作实现方式由用户决定,默认先放 NEEDS STUB 占位。Agent Script 仅支持扁平 if/else,无 else if、不可嵌套 if/else,多分支用顺序 if 或复合条件。资料未提供具体收费与价格信息。