{"record":{"id":"d65a84632646893c","repo":"jackwener/OpenCLI","slug":"kind","errorCode":null,"errorMessage":"kind","messagePattern":"kind","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"warning","filePath":"clis/antigravity/audit-extras.js","lineNumber":82,"sourceCode":"  })()`;\n}\n\n// -------- react --------\ncli({\n    site: 'antigravity',\n    name: 'react',\n    access: 'write',\n    description: 'Click \"Good response\" or \"Bad response\" on the LAST assistant message.',\n    domain: '127.0.0.1',\n    strategy: Strategy.UI,\n    browser: true,\n    args: [\n        { name: 'kind', positional: true, required: true, help: 'good or bad' },\n    ],\n    columns: ['Status', 'Reaction'],\n    func: async (page, kwargs) => {\n        const kind = String(kwargs?.kind || '').trim().toLowerCase();\n        if (kind !== 'good' && kind !== 'bad') throw new ArgumentError('kind', 'must be \"good\" or \"bad\"');\n        const label = kind === 'good' ? 'Good response' : 'Bad response';\n        const res = unwrapEvaluateResult(await page.evaluate(clickLastScript([`button[aria-label=\"${label}\"]`])));\n        if (!res?.ok) throw new CommandExecutionError(res?.reason || `${label} click failed`, '');\n        return [{ Status: 'clicked', Reaction: kind }];\n    },\n});\n\n// -------- copy-message --------\ncli({\n    site: 'antigravity',\n    name: 'copy-message',\n    access: 'write',\n    description: 'Return the text of the last assistant message (best-effort: walks up from the last visible Copy button).',\n    domain: '127.0.0.1',\n    strategy: Strategy.UI,\n    browser: true,\n    args: [\n        { name: 'click-button', type: 'boolean', default: false, help: 'Also click the in-UI Copy button' },","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/antigravity/audit-extras.js#L64-L100","documentation":"The antigravity 'good'/'bad' reaction command validates its required positional 'kind' argument and throws ArgumentError (src/errors.ts:128, code 'ARGUMENT', exit code USAGE_ERROR) when the value is anything other than 'good' or 'bad' after trimming and lowercasing. This library throws it up-front to fail fast with a usage hint instead of attempting a doomed page click. It is a caller-input error, not a browser or page problem.","triggerScenarios":"Running the command with kind set to anything besides 'good' or 'bad': e.g. `like`, `thumbs-up`, `Good!`, an empty string, or a shell-mangled value like 'goo d'. The check is `kind !== 'good' && kind !== 'bad'` after `String(kwargs?.kind || '').trim().toLowerCase()`.","commonSituations":"Users guessing the accepted vocabulary (typing 'up'/'down' or 'positive'/'negative'); scripts interpolating empty variables so kind becomes ''; automation passing display labels like 'Good response' instead of the bare token 'good'; shell quoting stripping or splitting the argument.","solutions":["Re-run with exactly 'good' or 'bad' as the positional argument (case and surrounding whitespace do not matter).","Quote the argument in your shell: antigravity <cmd> \"good\" to avoid splitting or interpolation.","If driven by a script, assert the variable is non-empty and one of the two tokens before invoking the command.","Check `help` output for the command to confirm the accepted values ('good or bad')."],"exampleFix":"// before\nantigravity react thumbs-up\n\n// after\nantigravity react good","handlingStrategy":"validation","validationCode":"const kind = String(process.argv[3] || '').trim().toLowerCase();\nif (kind !== 'good' && kind !== 'bad') {\n  throw new Error(`kind must be \"good\" or \"bad\", got: ${JSON.stringify(kind)}`);\n}","typeGuard":"function isReactionKind(v) {\n  return typeof v === 'string' && ['good', 'bad'].includes(v.trim().toLowerCase());\n}","tryCatchPattern":"try {\n  await runCmd('antigravity react', kind);\n} catch (e) {\n  if (e.code === 'ARGUMENT') {\n    console.error(`Usage: pass \"good\" or \"bad\" (got \"${kind}\")`);\n    process.exitCode = 2;\n  } else throw e;\n}","preventionTips":["Whitelist allowed values at the script boundary before invoking the CLI.","Always quote positional args in shell wrappers to prevent empty/split values.","Trim and lowercase input the same way the command does before comparing.","Read the command's help text to confirm accepted tokens."],"tags":["argument-validation","cli-usage","input-error"],"backgroundTag":"invalid-cli-argument","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}