aidescribe 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -9
- package/dist/cli.mjs +11 -11
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -1,25 +1,54 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# aidescribe
|
|
2
4
|
|
|
3
|
-
CLI that generates [Jujutsu](https://jj-vcs.github.io/jj/) change descriptions with AI
|
|
5
|
+
**CLI that generates [Jujutsu](https://jj-vcs.github.io/jj/) change descriptions with AI.**
|
|
6
|
+
|
|
7
|
+
<img src=".github/image.png" alt="aidescribe demo" width="700" />
|
|
8
|
+
|
|
9
|
+
</div>
|
|
4
10
|
|
|
5
|
-
##
|
|
11
|
+
## Quick Start
|
|
6
12
|
|
|
7
13
|
```bash
|
|
14
|
+
# run without installing
|
|
15
|
+
npx aidescribe
|
|
16
|
+
|
|
17
|
+
# or install globally
|
|
8
18
|
pnpm add -g aidescribe
|
|
9
19
|
```
|
|
10
20
|
|
|
11
|
-
|
|
21
|
+
Generate a description:
|
|
12
22
|
|
|
13
23
|
```bash
|
|
14
|
-
|
|
24
|
+
# same arguments as `jj describe`
|
|
25
|
+
# aidescribe <REVSETS>
|
|
26
|
+
aidescribe
|
|
27
|
+
aidescribe -r @-
|
|
28
|
+
aidescribe -r abc123
|
|
15
29
|
```
|
|
16
30
|
|
|
17
|
-
##
|
|
31
|
+
## Requirements
|
|
32
|
+
|
|
33
|
+
- Node.js `>=22`
|
|
34
|
+
- `jj` installed
|
|
35
|
+
- Run inside a Jujutsu repository
|
|
36
|
+
|
|
37
|
+
## Setup
|
|
38
|
+
|
|
39
|
+
Run the interactive setup once to connect your AI provider and save config:
|
|
18
40
|
|
|
19
41
|
```bash
|
|
20
|
-
|
|
21
|
-
|
|
42
|
+
aidescribe connect
|
|
43
|
+
```
|
|
22
44
|
|
|
23
|
-
|
|
24
|
-
|
|
45
|
+
This saves config to `~/.aidescribe.json`. Currently OpenAI, Anthropic, and Mistral providers are supported.
|
|
46
|
+
|
|
47
|
+
## Config
|
|
48
|
+
|
|
49
|
+
View config:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
aidescribe config
|
|
53
|
+
aidescribe config get provider
|
|
25
54
|
```
|
package/dist/cli.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var pe=Object.defineProperty;var r=(e,t)=>pe(e,"name",{value:t,configurable:!0});import{command as N,cli as de}from"cleye";import{intro as F,select as fe,isCancel as x,cancel as R,password as ue,text as U,outro as j,spinner as V}from"@clack/prompts";import I from"node:fs/promises";import me from"node:os";import ge from"node:path";import{z as p}from"zod";import{createAnthropic as he}from"@ai-sdk/anthropic";import{createMistral as ve}from"@ai-sdk/mistral";import{createOpenAI as ye}from"@ai-sdk/openai";import{generateText as we}from"ai";import{execa as O}from"execa";let h=!0;const y=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let w=0;if(y.process&&y.process.env&&y.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:o,TERM:i,COLORTERM:n}=y.process.env;t||o||e==="0"?h=!1:e==="1"||e==="2"||e==="3"?h=!0:i==="dumb"?h=!1:"CI"in y.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in y.process.env)?h=!0:h=process.stdout.isTTY,h&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?w=3:i&&(i.endsWith("-256color")||i.endsWith("256"))?w=2:w=1)}let k={enabled:h,supportLevel:w};function _(e,t,o=1){const i=`\x1B[${e}m`,n=`\x1B[${t}m`,s=new RegExp(`\\x1b\\[${t}m`,"g");return a=>k.enabled&&k.supportLevel>=o?i+(""+a).replace(s,i)+n:""+a}r(_,"kolorist");const be=_(30,39),Ce=_(101,49),$e=r(async e=>{try{return await I.access(e),!0}catch{return!1}},"fileExists");class d extends Error{static{r(this,"KnownError")}}const E=r(e=>{if(e instanceof d&&(process.stderr.write(`aidescribe: ${e.message}
|
|
3
3
|
`),process.exit(1)),e instanceof Error){const t=e.stack??e.message;process.stderr.write(`aidescribe: ${t}
|
|
4
4
|
`),process.exit(1)}process.stderr.write(`aidescribe: ${String(e)}
|
|
5
|
-
`),process.exit(1)},"handleCommandError"),
|
|
6
|
-
`,"utf8"),await
|
|
7
|
-
${
|
|
8
|
-
`):"",
|
|
9
|
-
${
|
|
10
|
-
`),"generatePrompt"),
|
|
5
|
+
`),process.exit(1)},"handleCommandError"),g=["openai","anthropic","mistral"],B={openai:{label:"OpenAI",defaultModel:"gpt-5-mini",defaultBaseURL:"https://api.openai.com/v1",apiMode:"openai-default",createClient:r(({apiKey:e,baseURL:t})=>ye({apiKey:e,baseURL:t}),"createClient")},anthropic:{label:"Anthropic",defaultModel:"claude-haiku-4-5",defaultBaseURL:"https://api.anthropic.com/v1",apiMode:"anthropic-messages",createClient:r(({apiKey:e,baseURL:t})=>he({apiKey:e,baseURL:t}),"createClient")},mistral:{label:"Mistral",defaultModel:"mistral-small-latest",defaultBaseURL:"https://api.mistral.ai/v1",apiMode:"mistral-chat",createClient:r(({apiKey:e,baseURL:t})=>ve({apiKey:e,baseURL:t}),"createClient")}},S=r(e=>B[e],"getProviderDefinition"),A=r(e=>B[e].defaultModel,"getProviderDefaultModel"),W=["apiKey","model","baseURL"],xe=g.flatMap(e=>W.map(t=>`providers.${e}.${t}`)),b={provider:"openai",locale:"en",type:"conventional",maxLength:72,maxDiffChars:4e4,"providers.openai.model":A("openai"),"providers.anthropic.model":A("anthropic"),"providers.mistral.model":A("mistral")},q=["provider","locale","type","maxLength","maxDiffChars",...xe],Re=g.map(e=>`providers.${e}.apiKey`),z=r(e=>W.includes(e),"isProviderAliasKey"),G=r((e,t)=>`providers.${e}.${t}`,"toProviderConfigKey"),P=r(e=>q.includes(e),"isConfigKey"),J=r((e,t)=>({provider:t,apiKey:e[`providers.${t}.apiKey`],model:e[`providers.${t}.model`],baseURL:e[`providers.${t}.baseURL`]}),"getProviderConfig"),C=r(e=>J(e,e.provider),"getActiveProviderConfig"),K=r(()=>ge.join(me.homedir(),".aidescribe.json"),"getConfigPath"),Ie=r(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isRecord"),M=p.string().transform(e=>e.trim()).pipe(p.string().min(1)),Oe=Object.fromEntries(g.flatMap(e=>[[`providers.${e}.apiKey`,M.optional()],[`providers.${e}.model`,M.optional()],[`providers.${e}.baseURL`,M.optional()]])),Y=p.object({provider:p.string().transform(e=>e.trim().toLowerCase()).pipe(p.enum(g)).optional(),locale:p.string().transform(e=>e.trim()).pipe(p.string().regex(/^[a-z-]+$/i,'must match letters and dashes (e.g. "en")')).optional(),type:p.string().transform(e=>e.trim()).pipe(p.enum(["conventional","plain"])).optional(),maxLength:p.union([p.number(),p.string().transform(e=>Number(e.trim()))]).pipe(p.number().int().positive({message:"must be a positive integer"})).optional(),maxDiffChars:p.union([p.number(),p.string().transform(e=>Number(e.trim()))]).pipe(p.number().int().positive({message:"must be a positive integer"})).optional(),...Oe}),T=r(e=>{const t=Y.safeParse(e),o=t.success?t.data:{},i=o,n=Object.fromEntries(g.flatMap(s=>[[`providers.${s}.model`,i[`providers.${s}.model`]??A(s)],[`providers.${s}.apiKey`,i[`providers.${s}.apiKey`]],[`providers.${s}.baseURL`,i[`providers.${s}.baseURL`]]]));return{provider:o.provider??b.provider,locale:o.locale??b.locale,type:o.type??b.type,maxLength:o.maxLength??b.maxLength,maxDiffChars:o.maxDiffChars??b.maxDiffChars,...n}},"parseConfig"),H=r(async()=>{const e=K();if(!await $e(e))return{};const o=await I.readFile(e,"utf8");try{const i=JSON.parse(o);if(!Ie(i))throw new d(`Invalid config file format at ${e}. Expected a JSON object.`);for(const n of Object.keys(i))if(!P(n))throw new d(`Invalid config key "${n}" in ${e}. Supported keys: ${q.join(", ")}.`);return i}catch(i){throw i instanceof d?i:new d(`Invalid config file format at ${e}. Expected a JSON object.`)}},"readConfigFile"),$=r(async e=>{const t=await H(),o=e?.cliConfig?Object.fromEntries(Object.entries(e.cliConfig).filter(([n,s])=>s!==void 0)):{},i={...t,...o};return T(i)},"getConfig"),Se=r(e=>{const t=Y.safeParse(e);if(!t.success){const o=t.error.issues[0],i=o?.path.join(".")||"config";throw new d(`Invalid ${i}: ${o?.message}`)}},"validateConfig"),Ae=r((e,t)=>P(e)?e:z(e)?G(t,e):null,"resolveSetKey"),De=r(e=>{if(typeof e!="string")return null;const t=e.trim().toLowerCase();return g.includes(t)?t:null},"normalizeProvider"),Le=r((e,t)=>e==="provider"||e.endsWith(".apiKey")||e.endsWith(".model")||e.endsWith(".baseURL")?t.trim():t,"normalizeConfigValue"),Q=r(async e=>{const t=await H();let o=T(t).provider;for(const[s,a]of e){const c=Ae(s,o);if(!c)throw new d(`Invalid config property: ${s}`);const l=Le(c,a);l===""?delete t[c]:t[c]=l,c==="provider"&&(o=De(l)??T(t).provider)}Se(t);const i=K(),n=`${i}.${process.pid}.tmp`;await I.writeFile(n,`${JSON.stringify(t,null,2)}
|
|
6
|
+
`,"utf8"),await I.rename(n,i)},"setConfigs"),X=new Set(["-R","--repository","--at-operation","--at-op","--color","--config","--config-file"]),Z=new Set(["--ignore-working-copy","--ignore-immutable","--debug","--quiet","--no-pager"]),je=new Set(["-m","--message"]),Ee=new Set(["--stdin","--editor"]),ee=new Set(["-r","--revision","--revisions","--revsets"]),Pe=r(e=>{const t=e.indexOf("=");return t<0?null:{key:e.slice(0,t),value:e.slice(t+1)}},"splitLongFlagWithEquals"),Ke=r(e=>{const t=[],o=[];for(let i=0;i<e.length;i+=1){const n=e[i];if(n==="--"){o.push(...e.slice(i+1));break}if(n.startsWith("--")){const s=Pe(n);if(s){const{key:a,value:c}=s;if(ee.has(a)){c&&o.push(c);continue}if(X.has(a)){t.push(n);continue}Z.has(a)&&t.push(a);continue}if(ee.has(n)){const a=e[i+1];a&&(o.push(a),i+=1);continue}if(X.has(n)){const a=e[i+1];a&&(t.push(n,a),i+=1);continue}if(Z.has(n)){t.push(n);continue}if(je.has(n)){i+=1;continue}if(Ee.has(n))continue;continue}if(n.startsWith("-")&&n!=="-"){if(n==="-r"){const s=e[i+1];s&&(o.push(s),i+=1);continue}if(n.startsWith("-r")&&n.length>2){o.push(n.slice(2));continue}if(n==="-R"){const s=e[i+1];s&&(t.push(n,s),i+=1);continue}if(n.startsWith("-R")&&n.length>2){t.push("-R",n.slice(2));continue}if(n==="-m"){i+=1;continue}if(n.startsWith("-m")&&n.length>2)continue;continue}o.push(n)}return{globalArgs:t,revsets:o}},"parseDescribeArgsForDiff"),te=new Set(["--ai-provider","--ai-locale","--ai-type","--ai-max-length","--ai-max-diff-chars"]),ie=new Set(["--verbose"]),Me=r(e=>{const t=[];for(let o=0;o<e.length;o+=1){const i=e[o];if(i==="--"){t.push(...e.slice(o+1));break}const n=i.indexOf("=");if(n>0){const s=i.slice(0,n);if(te.has(s)||ie.has(s))continue}if(te.has(i)){o+=1;continue}ie.has(i)||t.push(i)}return t},"getForwardedJjDescribeArgs"),Te=JSON.stringify({docs:"Documentation only changes",style:"Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",refactor:"A code change that improves code structure without changing functionality (renaming, restructuring classes/methods, extracting functions, etc)",perf:"A code change that improves performance",test:"Adding missing tests or correcting existing tests",build:"Changes that affect the build system or external dependencies",ci:"Changes to our CI configuration files and scripts",chore:"Other changes that don't modify src or test files",revert:"Reverts a previous commit",feat:"A new feature",fix:"A bug fix"},null,2),Ne={conventional:`Choose a type from the type-to-description JSON below that best describes the git diff:
|
|
7
|
+
${Te}`,plain:""},Fe={conventional:"<type>[optional (<scope>)]: <commit message>",plain:"<commit message>"},Ue=r((e,t,o,i=[])=>["Generate a concise git commit message title in present tense that precisely describes the key changes in the following code diff. Focus on what was changed, not just file names. Provide only the title, no description or body.",`Message language: ${e}`,`Commit message must be a maximum of ${t} characters.`,"Exclude anything unnecessary such as translation. Your entire response will be passed directly into jj describe.",`IMPORTANT: Do not include any explanations, introductions, or additional text. Do not wrap the commit message in quotes or any other formatting. The commit message must not exceed ${t} characters. Respond with ONLY the commit message text.`,"Be specific: include concrete details (package names, versions, functionality) rather than generic statements.",i.length>0?["Current change description(s) for the target revision(s):",...i.slice(0,5).map((n,s)=>`${s+1}. ${n}`),"If one of these is still relevant, edit/improve it. If not relevant, replace it completely."].join(`
|
|
8
|
+
`):"",Ne[o],`The output response must be in format:
|
|
9
|
+
${Fe[o]}`].filter(Boolean).join(`
|
|
10
|
+
`),"generatePrompt"),Ve=r((e,t,o)=>{const i=C(e),n=S(e.provider),s=["[aidescribe] AI request payload",`provider=${e.provider}`,`model=${i.model}`];s.push(`baseURL=${i.baseURL??n.defaultBaseURL}`),s.push(`apiMode=${n.apiMode}`),s.push("","[system]",t,"","[prompt]",o,""),process.stderr.write(`${s.join(`
|
|
11
11
|
`)}
|
|
12
|
-
`)},"printVerbosePayload"),
|
|
12
|
+
`)},"printVerbosePayload"),ke=r((e,t,o)=>{const i=["[aidescribe] AI response payload",`finishReason=${t}`,`warnings=${o?JSON.stringify(o):"[]"}`,"","[response.text]",e||"<empty>",""];process.stderr.write(`${i.join(`
|
|
13
13
|
`)}
|
|
14
|
-
`)},"printVerboseResponse"),
|
|
14
|
+
`)},"printVerboseResponse"),_e=r((e,t)=>e.length>t?e.slice(0,t).trim():e,"truncateToLength"),Be=r(e=>{const t=C(e);return S(e.provider).createClient({apiKey:t.apiKey,baseURL:t.baseURL})(t.model)},"resolveModel"),We=r(async(e,t,o)=>{const i=Be(t),n=await we({model:i,maxRetries:2,system:o,prompt:e});return{rawText:n.text,finishReason:n.finishReason,warnings:n.warnings,reasoningText:n.reasoningText??""}},"generateWithProvider"),qe=r(async(e,t,o)=>{const i=C(t);if(!i.apiKey)throw new d("apiKey is required.");const n=e.length>t.maxDiffChars?`${e.slice(-t.maxDiffChars)}
|
|
15
15
|
|
|
16
|
-
[Diff truncated due to size]`:e,
|
|
17
|
-
`).map(a=>a.trim()).filter(Boolean);return Array.from(new Set(
|
|
16
|
+
[Diff truncated due to size]`:e,s=Ue(t.locale,t.maxLength,t.type,o?.currentDescriptions??[]);o?.verbose&&Ve(t,s,n);let a;try{a=await We(n,t,s)}catch(l){const f=l instanceof Error?l.message:String(l);throw new d(`AI request failed for provider "${t.provider}" (model "${i.model}"): ${f}`)}o?.verbose&&ke(a.rawText,a.finishReason,a.warnings);const c=a.rawText.trim();if(!c)throw new d(`AI returned an empty description (finishReason=${a.finishReason}). Re-run with --verbose to inspect provider output.`);return _e(c,t.maxLength)},"generateDescription"),D="aidescribe-git-minimal",ze=["--config",`merge-tools.${D}.program=git`,"--config",`merge-tools.${D}.diff-args=["diff","--no-index","--diff-algorithm=minimal","$left","$right"]`,"--config",`merge-tools.${D}.diff-expected-exit-codes=[0,1]`],oe=r(e=>e.length>0?e.join("|"):"@","getTargetRevsetExpression"),ne=r(e=>{const t=[...e];return e.includes("--no-pager")||t.push("--no-pager"),t},"buildBaseJjArgs"),Ge=r(async()=>{if((await O("jj",["root"],{reject:!1})).failed)throw new d("The current directory must be inside a jj repository.")},"assertJjRepo"),Je=r(async e=>{const t=e?.globalArgs??[],o=e?.revsets??[],i=ne(t);i.push(...ze,"diff","--tool",D),o.length>0&&i.push("--revisions",oe(o));const{stdout:n}=await O("jj",i);return n.trim()},"getDiff"),Ye=r(async e=>{const t=e?.globalArgs??[],o=e?.revsets??[],i=ne(t);i.push("log","--no-graph","--revisions",oe(o),"--template",'description.first_line() ++ "\\n"');const{stdout:n}=await O("jj",i),s=n.split(`
|
|
17
|
+
`).map(a=>a.trim()).filter(Boolean);return Array.from(new Set(s))},"getCurrentDescriptions"),He=r(async(e,t)=>{await O("jj",["describe","-m",e,...t],{stdio:"inherit"})},"runJjDescribe"),se=r((e,t)=>{if(!e||!e.trim())return`${t} is required`},"validateRequired"),re=r(e=>typeof e=="string"?e.trim():"","toTrimmedPromptValue"),ae=r(async()=>{const e=await $(),t=await fe({message:"Select provider",options:g.map(u=>{const L=S(u);return{value:u,label:L.label,hint:L.defaultModel}})});if(x(t))return R("Cancelled"),!1;const o=t,i=S(o),n=J(e,o),s=!!n.apiKey,a=n.model,c=await ue({message:s?`Enter ${i.label} API key (press enter to keep existing)`:`Enter ${i.label} API key`,validate:r(u=>{if(!(s&&!u?.trim()))return se(u,"API key")},"validate")});if(x(c))return R("Cancelled"),!1;const l=await U({message:"Model",placeholder:i.defaultModel,initialValue:a,validate:r(u=>se(u,"Model"),"validate")});if(x(l))return R("Cancelled"),!1;const f=re(c),m=re(l);if(!f&&!s)throw new d("API key is required for first-time provider setup.");if(!m)throw new d("Model is required.");const v=[["provider",o]];return f&&v.push([`providers.${o}.apiKey`,f]),m!==a&&v.push([`providers.${o}.model`,m]),await Q(v),j(`Connected ${i.label}. Active model: ${m}`),!0},"runConnectWizard");var Qe=N({name:"connect",description:"Interactive provider setup wizard",help:{description:"Interactive provider setup wizard"}},()=>{F("aidescribe connect"),ae().catch(E)});const Xe=r(async e=>{const t=await U({message:"Edit description",placeholder:e,initialValue:e,validate:r(o=>o&&o.trim().length>0?void 0:"Description cannot be empty","validate")});return x(t)?null:String(t).trim()},"reviewDescription");var Ze=r(async(e,t)=>(async()=>{const o=V(),i=e.verbose?V():null,n={provider:e.aiProvider,locale:e.aiLocale,type:e.aiType,maxLength:e.aiMaxLength,maxDiffChars:e.aiMaxDiffChars};F(Ce(be(" aidescribe \u2728 "))),i?.start("Checking repository"),await Ge(),i?.stop("Repository detected"),i?.start("Loading configuration");let s=await $({cliConfig:n});if(i?.stop("Configuration loaded"),!C(s).apiKey){if(o.start("No provider configured, launching `aidescribe connect`"),o.stop("No provider configured, launching setup wizard"),!await ae())return;i?.start("Reloading configuration"),s=await $({cliConfig:n}),i?.stop("Configuration reloaded")}if(!C(s).apiKey)throw new d(`apiKey is required for provider "${s.provider}". Set it with \`aidescribe config set providers.${s.provider}.apiKey=...\`.`);const a=Me(t),c=Ke(a);i?.start("Reading `jj diff`");const l=await Je(c);if(i?.stop("Diff collected"),!l){j("No changes found in `jj diff`. Skipping description update.");return}i?.start("Reading current description");const f=await Ye(c);i?.stop(f.length>0?"Current description loaded":"No current description found"),o.start("Generating description");const m=await qe(l,s,{verbose:e.verbose,currentDescriptions:f});o.stop("Description generated");const v=await Xe(m);if(!v){R("Cancelled");return}const u=v;i?.start("Running `jj describe`"),await He(u,a),i?.stop("Description applied"),j("Done")})().catch(E),"aidescribeCommand");const et=r((e,t)=>{if(!Re.includes(e))return String(t);const o=String(t);return o?o.length<=4?`${o}****`:`${o.slice(0,4)}****`:""},"maskValue"),tt=g.flatMap(e=>[`providers.${e}.apiKey`,`providers.${e}.model`,`providers.${e}.baseURL`]),it=["provider",...tt,"locale","type","maxLength","maxDiffChars"],ot=r((e,t)=>e[t],"getConfigValue"),ce=r((e,t,o=t)=>{const i=ot(e,t);console.log(`${o}=${et(t,i??"")}`)},"printConfigEntry"),nt=r((e,t)=>P(e)?e:z(e)?G(t,e):null,"resolveRequestedKey");var st=N({name:"config",description:"View or modify configuration settings",help:{description:"View or modify configuration settings"},parameters:["[mode]","[keyValues...]"]},e=>{(async()=>{const t=Array.isArray(e._)?e._:[],[o,...i]=t,n=typeof o=="string"?o:void 0,s=i.filter(a=>typeof a=="string");if(!n){const a=await $();console.log(`Config file: ${K()}`);for(const c of it)ce(a,c);return}if(n==="get"){const a=await $();for(const c of s){const l=nt(c,a.provider);l&&ce(a,l,c)}return}if(n==="set"){const a=s.map(c=>{const l=c.indexOf("=");if(l<0)throw new d(`Invalid key=value pair: ${c}. Use: aidescribe config set key=value`);const f=c.slice(0,l),m=c.slice(l+1);return[f,m]});await Q(a);return}throw new d(`Invalid mode: ${n}. Use "get" or "set".`)})().catch(E)}),rt="0.0.3",at="Generate jj change descriptions with AI",ct={version:rt,description:at};const{description:lt,version:pt}=ct,le=process.argv.slice(2);de({name:"aidescribe",version:pt,flags:{aiProvider:{type:String,description:"Override provider for this run (supported: openai, anthropic, mistral)"},aiLocale:{type:String,description:"Override locale for this run (default: en)"},aiType:{type:String,description:"Message format for this run (default: conventional, supports: conventional, plain)"},aiMaxLength:{type:Number,description:"Max generated title length for this run (default: 72)"},aiMaxDiffChars:{type:Number,description:"Max diff chars sent to AI for this run (default: 40000)"},verbose:{type:Boolean,description:"Print the exact prompt payload sent to the AI model for this run",default:!1}},commands:[st,Qe],help:{description:lt},ignoreArgv:r(e=>e==="unknown-flag"||e==="argument","ignoreArgv")},e=>{Ze(e.flags,le)},le);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aidescribe",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Generate jj change descriptions with AI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -35,10 +35,13 @@
|
|
|
35
35
|
"fmt": "oxfmt",
|
|
36
36
|
"fmt:check": "oxfmt --check",
|
|
37
37
|
"lint": "oxlint",
|
|
38
|
-
"lint:fix": "oxlint --fix"
|
|
38
|
+
"lint:fix": "oxlint --fix",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"test:watch": "vitest"
|
|
39
41
|
},
|
|
40
42
|
"dependencies": {
|
|
41
43
|
"@ai-sdk/anthropic": "^3.0.46",
|
|
44
|
+
"@ai-sdk/mistral": "^3.0.21",
|
|
42
45
|
"@ai-sdk/openai": "^3.0.31",
|
|
43
46
|
"@clack/prompts": "^1.0.1",
|
|
44
47
|
"ai": "^6.0.97",
|
|
@@ -53,7 +56,8 @@
|
|
|
53
56
|
"oxlint": "^1.50.0",
|
|
54
57
|
"pkgroll": "^2.26.3",
|
|
55
58
|
"tsx": "^4.21.0",
|
|
56
|
-
"typescript": "^5.9.3"
|
|
59
|
+
"typescript": "^5.9.3",
|
|
60
|
+
"vitest": "^4.0.18"
|
|
57
61
|
},
|
|
58
62
|
"engines": {
|
|
59
63
|
"node": ">=22"
|