feat: Agentforce Scorers Authoring Command#456
Conversation
…inition authoring
…inition authoring
…inition authoring
|
Thanks for the contribution! It looks like @nabilnaffar-sf is an internal user so signing the CLA is not required. However, we need to confirm this. |
|
Command shape looks great and the interview + spec YAML flow is a nice touch. However, I ran the branch locally and hit several issues that I think should block merge. Highlights: the unit-test suite doesn't Blocking
Error: Parsing --spec The command declares spec: Flags.file({ exists: true }) (src/commands/agent/scorer/create.ts:225), so oclif runs a real fs.stat() before esmock can intercept node:fs. Tests pass fake paths ('test.yaml', GitHub CI on this PR shows only SAST + CLA checks — the unit-test job never ran, so this went undetected. Fix options: drop exists: true and validate in code, or refactor tests to write to a real tmp dir. Note that writtenFiles assertions can't observe writes inside @salesforce/agents/lib/agentScorer.js either,
$ sf agent scorer create --spec-schema target-org: Flags.requiredOrg() is unconditional. --spec-schema shouldn't need auth (it's a static file dump), and --preview shouldn't either unless --agent-api-name is missing. The first example in
sf agent scorer create --api-name Expert_Analysis --data-type Text Running this triggers ExitPromptError — inquirer still prompts for description (create.ts:324), semanticType (:330), agent-association inputScope (:458), and Text outputEnumValues (:402). The jsonEnabled() gate Should fix
Nice-to-have
|
What does this PR do?
Adds a new
sf agent scorer createcommand that generatesAiAgentScorerDefinitionmetadata XML files for Agentforce scorers. The command supports:--spec) — reads a YAML file for repeatable/automated scorer creation--preview) — outputs generated XML without writing to diskWhat issues does this PR fix or reference?
no issues, this is a new feature