aidescribe 0.0.3 → 0.0.5
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 +35 -3
- package/dist/cli.mjs +11 -11
- package/package.json +34 -25
package/README.md
CHANGED
|
@@ -15,19 +15,22 @@
|
|
|
15
15
|
npx aidescribe
|
|
16
16
|
|
|
17
17
|
# or install globally
|
|
18
|
-
|
|
18
|
+
npm i -g aidescribe
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Generate a description:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
#
|
|
25
|
-
# aidescribe <REVSETS>
|
|
24
|
+
# supported `jj` target arguments
|
|
26
25
|
aidescribe
|
|
26
|
+
aidescribe <REVSETS>
|
|
27
27
|
aidescribe -r @-
|
|
28
28
|
aidescribe -r abc123
|
|
29
|
+
aidescribe -rabc123
|
|
29
30
|
```
|
|
30
31
|
|
|
32
|
+
Only inlined `<REVSETS>` and `-r` are forwarded to `jj`.
|
|
33
|
+
|
|
31
34
|
## Requirements
|
|
32
35
|
|
|
33
36
|
- Node.js `>=22`
|
|
@@ -51,4 +54,33 @@ View config:
|
|
|
51
54
|
```bash
|
|
52
55
|
aidescribe config
|
|
53
56
|
aidescribe config get provider
|
|
57
|
+
aidescribe config set variantCount=3
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
aidescribe v0.0.4
|
|
64
|
+
|
|
65
|
+
Generate jj change descriptions with AI
|
|
66
|
+
|
|
67
|
+
Usage:
|
|
68
|
+
aidescribe [flags...]
|
|
69
|
+
aidescribe <command>
|
|
70
|
+
|
|
71
|
+
Commands:
|
|
72
|
+
config View or modify configuration settings
|
|
73
|
+
connect Interactive provider setup wizard
|
|
74
|
+
|
|
75
|
+
Flags:
|
|
76
|
+
--count <number> Generate multiple description variants for this run (default: 1)
|
|
77
|
+
-h, --help Show help
|
|
78
|
+
--locale <string> Override locale for this run (default: en)
|
|
79
|
+
--max-diff-chars <number> Max diff chars sent to AI for this run (default: 40000)
|
|
80
|
+
--max-length <number> Max generated title length for this run (default: 72, its a soft guidance for the
|
|
81
|
+
model, not a local hard cutoff)
|
|
82
|
+
--provider <string> Override provider for this run (supported: openai, anthropic, mistral)
|
|
83
|
+
-t, --type <string> Message format for this run (default: conventional, supports: conventional, plain)
|
|
84
|
+
--verbose Print the exact prompt payload sent to the AI model for this run
|
|
85
|
+
--version Show version
|
|
54
86
|
```
|
package/dist/cli.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var ae=Object.defineProperty;var n=(e,t)=>ae(e,"name",{value:t,configurable:!0});import{command as T,cli as ce}from"cleye";import{intro as N,select as U,isCancel as C,cancel as x,password as pe,text as _,outro as P,spinner as V}from"@clack/prompts";import I from"node:fs/promises";import le from"node:os";import de from"node:path";import{z as p}from"zod";import{createAnthropic as fe}from"@ai-sdk/anthropic";import{createMistral as me}from"@ai-sdk/mistral";import{createOpenAI as ue}from"@ai-sdk/openai";import{generateText as ge}from"ai";import{x as D}from"tinyexec";import he from"update-notifier";let h=!0;const y=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let $=0;if(y.process&&y.process.env&&y.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,NO_COLOR:i,TERM:r,COLORTERM:s}=y.process.env;t||i||e==="0"?h=!1:e==="1"||e==="2"||e==="3"?h=!0:r==="dumb"?h=!1:"CI"in y.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in y.process.env)?h=!0:h=process.stdout.isTTY,h&&(process.platform==="win32"||s&&(s==="truecolor"||s==="24bit")?$=3:r&&(r.endsWith("-256color")||r.endsWith("256"))?$=2:$=1)}let B={enabled:h,supportLevel:$};function F(e,t,i=1){const r=`\x1B[${e}m`,s=`\x1B[${t}m`,o=new RegExp(`\\x1b\\[${t}m`,"g");return a=>B.enabled&&B.supportLevel>=i?r+(""+a).replace(o,r)+s:""+a}n(F,"kolorist");const ve=F(30,39),ye=F(101,49),be=n(async e=>{try{return await I.access(e),!0}catch{return!1}},"fileExists");class d extends Error{static{n(this,"KnownError")}}const S=n(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"),g=["openai","anthropic","mistral"],
|
|
6
|
-
`,"utf8"),await I.rename(
|
|
7
|
-
${
|
|
8
|
-
`):"",
|
|
9
|
-
${
|
|
10
|
-
`),"generatePrompt"),
|
|
5
|
+
`),process.exit(1)},"handleCommandError"),g=["openai","anthropic","mistral"],G={openai:{label:"OpenAI",defaultModel:"gpt-5-mini",defaultBaseURL:"https://api.openai.com/v1",apiMode:"openai-default",createClient:n(({apiKey:e,baseURL:t})=>ue({apiKey:e,baseURL:t}),"createClient")},anthropic:{label:"Anthropic",defaultModel:"claude-haiku-4-5",defaultBaseURL:"https://api.anthropic.com/v1",apiMode:"anthropic-messages",createClient:n(({apiKey:e,baseURL:t})=>fe({apiKey:e,baseURL:t}),"createClient")},mistral:{label:"Mistral",defaultModel:"mistral-small-latest",defaultBaseURL:"https://api.mistral.ai/v1",apiMode:"mistral-chat",createClient:n(({apiKey:e,baseURL:t})=>me({apiKey:e,baseURL:t}),"createClient")}},O=n(e=>G[e],"getProviderDefinition"),j=n(e=>G[e].defaultModel,"getProviderDefaultModel"),z=["apiKey","model","baseURL"],we=g.flatMap(e=>z.map(t=>`providers.${e}.${t}`)),b={provider:"openai",locale:"en",type:"conventional",maxLength:72,maxDiffChars:4e4,variantCount:1,"providers.openai.model":j("openai"),"providers.anthropic.model":j("anthropic"),"providers.mistral.model":j("mistral")},q=["provider","locale","type","maxLength","maxDiffChars","variantCount",...we],Ce=g.map(e=>`providers.${e}.apiKey`),J=n(e=>z.includes(e),"isProviderAliasKey"),Y=n((e,t)=>`providers.${e}.${t}`,"toProviderConfigKey"),L=n(e=>q.includes(e),"isConfigKey"),W=n((e,t)=>({provider:t,apiKey:e[`providers.${t}.apiKey`],model:e[`providers.${t}.model`],baseURL:e[`providers.${t}.baseURL`]}),"getProviderConfig"),w=n(e=>W(e,e.provider),"getActiveProviderConfig"),K=n(()=>de.join(le.homedir(),".aidescribe.json"),"getConfigPath"),xe=n(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isRecord"),k=p.string().transform(e=>e.trim()).pipe(p.string().min(1)),$e=Object.fromEntries(g.flatMap(e=>[[`providers.${e}.apiKey`,k.optional()],[`providers.${e}.model`,k.optional()],[`providers.${e}.baseURL`,k.optional()]])),H=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(),variantCount:p.union([p.number(),p.string().transform(e=>Number(e.trim()))]).pipe(p.number().int().positive({message:"must be a positive integer"})).optional(),...$e}),M=n(e=>{const t=H.safeParse(e),i=t.success?t.data:{},r=i,s=Object.fromEntries(g.flatMap(o=>[[`providers.${o}.model`,r[`providers.${o}.model`]??j(o)],[`providers.${o}.apiKey`,r[`providers.${o}.apiKey`]],[`providers.${o}.baseURL`,r[`providers.${o}.baseURL`]]]));return{provider:i.provider??b.provider,locale:i.locale??b.locale,type:i.type??b.type,maxLength:i.maxLength??b.maxLength,maxDiffChars:i.maxDiffChars??b.maxDiffChars,variantCount:i.variantCount??b.variantCount,...s}},"parseConfig"),Q=n(async()=>{const e=K();if(!await be(e))return{};const i=await I.readFile(e,"utf8");try{const r=JSON.parse(i);if(!xe(r))throw new d(`Invalid config file format at ${e}. Expected a JSON object.`);for(const s of Object.keys(r))if(!L(s))throw new d(`Invalid config key "${s}" in ${e}. Supported keys: ${q.join(", ")}.`);return r}catch(r){throw r instanceof d?r:new d(`Invalid config file format at ${e}. Expected a JSON object.`)}},"readConfigFile"),R=n(async e=>{const t=await Q(),i=e?.cliConfig?Object.fromEntries(Object.entries(e.cliConfig).filter(([s,o])=>o!==void 0)):{},r={...t,...i};return M(r)},"getConfig"),Re=n(e=>{const t=H.safeParse(e);if(!t.success){const i=t.error.issues[0],r=i?.path.join(".")||"config";throw new d(`Invalid ${r}: ${i?.message}`)}},"validateConfig"),Ie=n((e,t)=>L(e)?e:J(e)?Y(t,e):null,"resolveSetKey"),De=n(e=>{if(typeof e!="string")return null;const t=e.trim().toLowerCase();return g.includes(t)?t:null},"normalizeProvider"),Oe=n((e,t)=>e==="provider"||e.endsWith(".apiKey")||e.endsWith(".model")||e.endsWith(".baseURL")?t.trim():t,"normalizeConfigValue"),X=n(async e=>{const t=await Q();let i=M(t).provider;for(const[o,a]of e){const c=Ie(o,i);if(!c)throw new d(`Invalid config property: ${o}`);const l=Oe(c,a);l===""?delete t[c]:t[c]=l,c==="provider"&&(i=De(l)??M(t).provider)}Re(t);const r=K(),s=`${r}.${process.pid}.tmp`;await I.writeFile(s,`${JSON.stringify(t,null,2)}
|
|
6
|
+
`,"utf8"),await I.rename(s,r)},"setConfigs"),je=n(e=>{const t=[];for(let i=0;i<e.length;i+=1){const r=e[i];if(r!=="--"){if(r==="-r"){const s=e[i+1];s&&(t.push(s),i+=1);continue}if(r.startsWith("-r")&&r.length>2){t.push(r.slice(2));continue}r.startsWith("-")||t.push(r)}}return{globalArgs:[],revsets:t}},"parseDescribeArgsForDiff"),Ae=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),Ee={conventional:`Choose a type from the type-to-description JSON below that best describes the git diff:
|
|
7
|
+
${Ae}`,plain:""},Pe={conventional:"<type>[optional (<scope>)]: <commit message>",plain:"<commit message>"},Se=n((e,t,i,r=[])=>["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.",r.length>0?["Current change description(s) for the target revision(s):",...r.slice(0,5).map((s,o)=>`${o+1}. ${s}`),"If one of these is still relevant, edit/improve it. If not relevant, replace it completely."].join(`
|
|
8
|
+
`):"",Ee[i],`The output response must be in format:
|
|
9
|
+
${Pe[i]}`].filter(Boolean).join(`
|
|
10
|
+
`),"generatePrompt"),Le=n((e,t,i)=>{const r=w(e),s=O(e.provider),o=["[aidescribe] AI request payload",`provider=${e.provider}`,`model=${r.model}`];o.push(`baseURL=${r.baseURL??s.defaultBaseURL}`),o.push(`apiMode=${s.apiMode}`),o.push("","[system]",t,"","[prompt]",i,""),process.stderr.write(`${o.join(`
|
|
11
11
|
`)}
|
|
12
|
-
`)},"printVerbosePayload"),
|
|
12
|
+
`)},"printVerbosePayload"),Ke=n((e,t,i)=>{const r=["[aidescribe] AI response payload",`finishReason=${t}`,`warnings=${i?JSON.stringify(i):"[]"}`,"","[response.text]",e||"<empty>",""];process.stderr.write(`${r.join(`
|
|
13
13
|
`)}
|
|
14
|
-
`)},"printVerboseResponse"),
|
|
14
|
+
`)},"printVerboseResponse"),ke=n(e=>e.trim(),"normalizeDescription"),Me=n(e=>{const t=w(e);return O(e.provider).createClient({apiKey:t.apiKey,baseURL:t.baseURL})(t.model)},"resolveModel"),Te=n(async(e,t,i)=>{const r=Me(t),s=await ge({model:r,maxRetries:2,system:i,prompt:e});return{rawText:s.text,finishReason:s.finishReason,warnings:s.warnings,reasoningText:s.reasoningText??""}},"generateWithProvider"),Ne=n(async(e,t,i,r)=>{const s=w(t);let o;try{o=await Te(e,t,i)}catch(c){const l=c instanceof Error?c.message:String(c);throw new d(`AI request failed for provider "${t.provider}" (model "${s.model}"): ${l}`)}r&&Ke(o.rawText,o.finishReason,o.warnings);const a=ke(o.rawText);if(!a)throw new d(`AI returned an empty description (finishReason=${o.finishReason}). Re-run with --verbose to inspect provider output.`);return a},"generateSingleDescription"),Ue=n(async(e,t,i)=>{if(!w(t).apiKey)throw new d("apiKey is required.");const s=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,o=Se(t.locale,t.maxLength,t.type,i?.currentDescriptions??[]);i?.verbose&&Le(t,o,s);const a=await Promise.all(Array.from({length:t.variantCount},()=>Ne(s,t,o,i?.verbose)));return[...new Set(a)]},"generateDescription"),A="aidescribe-git-minimal",_e=["--config",`merge-tools.${A}.program=git`,"--config",`merge-tools.${A}.diff-args=["diff","--no-index","--diff-algorithm=minimal","$left","$right"]`,"--config",`merge-tools.${A}.diff-expected-exit-codes=[0,1]`],Z=n(e=>e.length>0?e.join("|"):"@","getTargetRevsetExpression"),ee=n(e=>{const t=[...e];return e.includes("--no-pager")||t.push("--no-pager"),t},"buildBaseJjArgs"),Ve=n(async()=>{if((await D("jj",["root"])).exitCode!==0)throw new d("The current directory must be inside a jj repository.")},"assertJjRepo"),Be=n(async e=>{const t=e?.globalArgs??[],i=e?.revsets??[],r=ee(t);r.push(..._e,"diff","--tool",A),i.length>0&&r.push("--revisions",Z(i));const{stdout:s}=await D("jj",r,{throwOnError:!0});return s.trim()},"getDiff"),Fe=n(async e=>{const t=e?.globalArgs??[],i=e?.revsets??[],r=ee(t);r.push("log","--no-graph","--revisions",Z(i),"--template",'description.first_line() ++ "\\n"');const{stdout:s}=await D("jj",r,{throwOnError:!0}),o=s.split(`
|
|
17
|
+
`).map(a=>a.trim()).filter(Boolean);return Array.from(new Set(o))},"getCurrentDescriptions"),Ge=n(async(e,t)=>{await D("jj",["describe","-m",e,...t],{nodeOptions:{stdio:"inherit"},throwOnError:!0})},"runJjDescribe"),te=n((e,t)=>{if(!e||!e.trim())return`${t} is required`},"validateRequired"),ie=n(e=>typeof e=="string"?e.trim():"","toTrimmedPromptValue"),re=n(async()=>{const e=await R(),t=await U({message:"Select provider",options:g.map(m=>{const E=O(m);return{value:m,label:E.label,hint:E.defaultModel}})});if(C(t))return x("Cancelled"),!1;const i=t,r=O(i),s=W(e,i),o=!!s.apiKey,a=s.model,c=await pe({message:o?`Enter ${r.label} API key (press enter to keep existing)`:`Enter ${r.label} API key`,validate:n(m=>{if(!(o&&!m?.trim()))return te(m,"API key")},"validate")});if(C(c))return x("Cancelled"),!1;const l=await _({message:"Model",placeholder:r.defaultModel,initialValue:a,validate:n(m=>te(m,"Model"),"validate")});if(C(l))return x("Cancelled"),!1;const u=ie(c),f=ie(l);if(!u&&!o)throw new d("API key is required for first-time provider setup.");if(!f)throw new d("Model is required.");const v=[["provider",i]];return u&&v.push([`providers.${i}.apiKey`,u]),f!==a&&v.push([`providers.${i}.model`,f]),await X(v),P(`Connected ${r.label}. Active model: ${f}`),!0},"runConnectWizard");var ze=T({name:"connect",description:"Interactive provider setup wizard",help:{description:"Interactive provider setup wizard"}},()=>{N("aidescribe connect"),re().catch(S)});const qe=n(async e=>{if(e.length<=1)return e[0]??null;const t=await U({message:"Choose a description",options:e.map(i=>({value:i,label:i}))});return C(t)?null:String(t)},"chooseDescription"),Je=n(async e=>{const t=await _({message:"Edit description",placeholder:e,initialValue:e,validate:n(i=>i&&i.trim().length>0?void 0:"Description cannot be empty","validate")});return C(t)?null:String(t).trim()},"reviewDescription");var Ye=n(async(e,t)=>(async()=>{const i=V(),r=e.verbose?V():null,s={provider:e.provider,locale:e.locale,type:e.type,maxLength:e.maxLength,maxDiffChars:e.maxDiffChars,variantCount:e.count};N(ye(ve(" aidescribe \u2728 "))),r?.start("Checking repository"),await Ve(),r?.stop("Repository detected"),r?.start("Loading configuration");let o=await R({cliConfig:s});if(r?.stop("Configuration loaded"),!w(o).apiKey){if(i.start("No provider configured, launching `aidescribe connect`"),i.stop("No provider configured, launching setup wizard"),!await re())return;r?.start("Reloading configuration"),o=await R({cliConfig:s}),r?.stop("Configuration reloaded")}if(!w(o).apiKey)throw new d(`apiKey is required for provider "${o.provider}". Set it with \`aidescribe config set providers.${o.provider}.apiKey=...\`.`);const a=je(t);r?.start("Reading `jj diff`");const c=await Be(a);if(r?.stop("Diff collected"),!c){P("No changes found in `jj diff`. Skipping description update.");return}r?.start("Reading current description");const l=await Fe(a);r?.stop(l.length>0?"Current description loaded":"No current description found"),i.start("Generating description");const u=await Ue(c,o,{verbose:e.verbose,currentDescriptions:l});i.stop("Description generated");const f=await qe(u);if(!f){x("Cancelled");return}const v=await Je(f);if(!v){x("Cancelled");return}const m=v;r?.start("Running `jj describe`"),await Ge(m,a.revsets),r?.stop("Description applied"),P("Done")})().catch(S),"aidescribeCommand");const We=n((e,t)=>{if(!Ce.includes(e))return String(t);const i=String(t);return i?i.length<=4?`${i}****`:`${i.slice(0,4)}****`:""},"maskValue"),He=g.flatMap(e=>[`providers.${e}.apiKey`,`providers.${e}.model`,`providers.${e}.baseURL`]),Qe=["provider",...He,"locale","type","maxLength","maxDiffChars","variantCount"],Xe=n((e,t)=>e[t],"getConfigValue"),ne=n((e,t,i=t)=>{const r=Xe(e,t);console.log(`${i}=${We(t,r??"")}`)},"printConfigEntry"),Ze=n((e,t)=>L(e)?e:J(e)?Y(t,e):null,"resolveRequestedKey");var et=T({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._:[],[i,...r]=t,s=typeof i=="string"?i:void 0,o=r.filter(a=>typeof a=="string");if(!s){const a=await R();console.log(`Config file: ${K()}`);for(const c of Qe)ne(a,c);return}if(s==="get"){const a=await R();for(const c of o){const l=Ze(c,a.provider);l&&ne(a,l,c)}return}if(s==="set"){const a=o.map(c=>{const l=c.indexOf("=");if(l<0)throw new d(`Invalid key=value pair: ${c}. Use: aidescribe config set key=value`);const u=c.slice(0,l),f=c.slice(l+1);return[u,f]});await X(a);return}throw new d(`Invalid mode: ${s}. Use "get" or "set".`)})().catch(S)}),tt="aidescribe",it="0.0.5",rt="Generate jj change descriptions with AI",nt=["ai","cli","commit","jj","jujutsu","vcs"],ot="https://github.com/pguilbert/aidescribe#readme",st={url:"https://github.com/pguilbert/aidescribe/issues"},at="MIT",ct="Paul Guilbert",pt={type:"git",url:"https://github.com/pguilbert/aidescribe.git"},lt={aidescribe:"dist/cli.mjs"},dt=["dist"],ft="module",mt={build:"pkgroll --minify",ci:"pnpm lint && pnpm fmt:check && pnpm typecheck && pnpm test && pnpm build",changeset:"changeset",typecheck:"tsc",dev:"tsx src/cli.ts",prepack:"pnpm run build",fmt:"oxfmt","fmt:check":"oxfmt --check",lint:"oxlint","lint:fix":"oxlint --fix",release:"pnpm run ci && pnpm exec changeset publish",test:"vitest run","test:watch":"vitest",knip:"knip","version-packages":"changeset version"},ut={"@ai-sdk/anthropic":"^3.0.69","@ai-sdk/mistral":"^3.0.30","@ai-sdk/openai":"^3.0.52","@clack/prompts":"^1.2.0",ai:"^6.0.158",cleye:"^2.3.0",tinyexec:"^1.1.1","update-notifier":"^7.3.1",zod:"^4.3.6"},gt={"@changesets/changelog-github":"^0.6.0","@changesets/cli":"^2.30.0","@types/node":"^25.6.0","@types/update-notifier":"^6.0.8",knip:"^6.4.0",kolorist:"^1.8.0",oxfmt:"^0.35.0",oxlint:"^1.59.0",pkgroll:"^2.27.0",tsx:"^4.21.0",typescript:"^5.9.3",vitest:"^4.1.4"},ht={node:">=22"},oe={name:tt,version:it,description:rt,keywords:nt,homepage:ot,bugs:st,license:at,author:ct,repository:pt,bin:lt,files:dt,type:ft,scripts:mt,dependencies:ut,devDependencies:gt,engines:ht};const{description:vt,version:yt}=oe,se=process.argv.slice(2);he({pkg:oe}).notify({isGlobal:!0}),ce({name:"aidescribe",version:yt,flags:{provider:{type:String,description:"Override provider for this run (supported: openai, anthropic, mistral)"},locale:{type:String,description:"Override locale for this run (default: en)"},type:{type:String,alias:"t",description:"Message format for this run (default: conventional, supports: conventional, plain)"},maxLength:{type:Number,description:"Max generated title length for this run (default: 72, it's a soft guidance for the model, not a local hard cutoff)"},maxDiffChars:{type:Number,description:"Max diff chars sent to AI for this run (default: 40000)"},count:{type:Number,description:"Generate multiple description variants for this run (default: 1)"},verbose:{type:Boolean,description:"Print the exact prompt payload sent to the AI model for this run",default:!1}},commands:[et,ze],help:{description:vt},ignoreArgv:n(e=>e==="unknown-flag"||e==="argument","ignoreArgv")},e=>{Ye(e.flags,se)},se);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aidescribe",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Generate jj change descriptions with AI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -27,39 +27,48 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"type": "module",
|
|
30
|
-
"scripts": {
|
|
31
|
-
"build": "pkgroll --minify",
|
|
32
|
-
"typecheck": "tsc",
|
|
33
|
-
"dev": "tsx src/cli.ts",
|
|
34
|
-
"prepack": "npm run build",
|
|
35
|
-
"fmt": "oxfmt",
|
|
36
|
-
"fmt:check": "oxfmt --check",
|
|
37
|
-
"lint": "oxlint",
|
|
38
|
-
"lint:fix": "oxlint --fix",
|
|
39
|
-
"test": "vitest run",
|
|
40
|
-
"test:watch": "vitest"
|
|
41
|
-
},
|
|
42
30
|
"dependencies": {
|
|
43
|
-
"@ai-sdk/anthropic": "^3.0.
|
|
44
|
-
"@ai-sdk/mistral": "^3.0.
|
|
45
|
-
"@ai-sdk/openai": "^3.0.
|
|
46
|
-
"@clack/prompts": "^1.0
|
|
47
|
-
"ai": "^6.0.
|
|
48
|
-
"cleye": "^2.
|
|
49
|
-
"
|
|
31
|
+
"@ai-sdk/anthropic": "^3.0.69",
|
|
32
|
+
"@ai-sdk/mistral": "^3.0.30",
|
|
33
|
+
"@ai-sdk/openai": "^3.0.52",
|
|
34
|
+
"@clack/prompts": "^1.2.0",
|
|
35
|
+
"ai": "^6.0.158",
|
|
36
|
+
"cleye": "^2.3.0",
|
|
37
|
+
"tinyexec": "^1.1.1",
|
|
38
|
+
"update-notifier": "^7.3.1",
|
|
50
39
|
"zod": "^4.3.6"
|
|
51
40
|
},
|
|
52
41
|
"devDependencies": {
|
|
53
|
-
"@
|
|
42
|
+
"@changesets/changelog-github": "^0.6.0",
|
|
43
|
+
"@changesets/cli": "^2.30.0",
|
|
44
|
+
"@types/node": "^25.6.0",
|
|
45
|
+
"@types/update-notifier": "^6.0.8",
|
|
46
|
+
"knip": "^6.4.0",
|
|
54
47
|
"kolorist": "^1.8.0",
|
|
55
48
|
"oxfmt": "^0.35.0",
|
|
56
|
-
"oxlint": "^1.
|
|
57
|
-
"pkgroll": "^2.
|
|
49
|
+
"oxlint": "^1.59.0",
|
|
50
|
+
"pkgroll": "^2.27.0",
|
|
58
51
|
"tsx": "^4.21.0",
|
|
59
52
|
"typescript": "^5.9.3",
|
|
60
|
-
"vitest": "^4.
|
|
53
|
+
"vitest": "^4.1.4"
|
|
61
54
|
},
|
|
62
55
|
"engines": {
|
|
63
56
|
"node": ">=22"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "pkgroll --minify",
|
|
60
|
+
"ci": "pnpm lint && pnpm fmt:check && pnpm typecheck && pnpm test && pnpm build",
|
|
61
|
+
"changeset": "changeset",
|
|
62
|
+
"typecheck": "tsc",
|
|
63
|
+
"dev": "tsx src/cli.ts",
|
|
64
|
+
"fmt": "oxfmt",
|
|
65
|
+
"fmt:check": "oxfmt --check",
|
|
66
|
+
"lint": "oxlint",
|
|
67
|
+
"lint:fix": "oxlint --fix",
|
|
68
|
+
"release": "pnpm run ci && pnpm exec changeset publish",
|
|
69
|
+
"test": "vitest run",
|
|
70
|
+
"test:watch": "vitest",
|
|
71
|
+
"knip": "knip",
|
|
72
|
+
"version-packages": "changeset version"
|
|
64
73
|
}
|
|
65
|
-
}
|
|
74
|
+
}
|