@fui-org/fui-cli 1.3.1 → 1.3.2

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.
@@ -72,7 +72,7 @@ ${t}`,e.severity==="block"?"hard":"soft")}function Da(e,t){let n=ba(t.schema),o=
72
72
  ${u.message}
73
73
  likely the login borrowed from ${a} has no access to this database (other group); pass --borrow-from <project/alias> or use fui db add`)}let l=await qn(e,n,{alias:t.apiName,dbToken:c,apiDomain:o.apiDomain,sqlServer:r.SQLServer,database:r.DatabaseName,userToken:o.userToken,makeDefault:t.makeDefault,test:!1});return{notes:[...o.note?[o.note]:[],...l.notes,`sql server: ${r.SQLServer} database: ${r.DatabaseName} login borrowed from ${a} (not printed)`]}}async function Qa(e,t){let n=await Bn(e),o=await Nr(e.store,n,t),{apiDomain:s,userToken:r}=o.config;return{projectId:n,call:(i,a)=>Ln(s,r,i,a),target:{ModuleID:0,APIName:t??o.alias}}}async function Za(e,t,n){let{projectId:o,call:s,target:r}=await Qa(e,n),a=(await s(t==="system"?"SM_SystemRight_Select":"SM_FunctionRight_Select",r)).data??[];return await xr(e.store.paths,o,r.APIName,t==="system"?{system:a}:{functions:a}),{apiName:r.APIName,rows:a}}async function ec(e,t,n){let{projectId:o,call:s,target:r}=await Qa(e,n),i=t.kind==="system"?"SM_SystemRight_Select":"SM_FunctionRight_Select",a;if(t.kind==="system"){if(t.mode==="new"){let d=((await s(i,r)).data??[]).find((p)=>Number(p.SysRight)===t.sysRight);if(d)throw new m(`SystemRight ${t.sysRight} of "${r.APIName}" is already defined ("${String(d.Note??"")}"); edit: fui right system update ${t.sysRight} --note ...; remove: fui right system delete ${t.sysRight}`)}await s("SM_SystemRight_Update",{...r,SysRight:t.sysRight,Note:t.note??null,Delete:t.mode==="delete"?1:0});let u=`SystemRight ${t.sysRight}${t.note&&t.mode!=="delete"?` (${t.note})`:""}`;a=`ok ${t.mode==="new"?"created":t.mode==="update"?"saved":"deleted"} ${u} of "${r.APIName}"`}else await s("SM_FunctionRight_Update",{...r,FunctionID:t.functionId,FunctionCode:t.functionCode,FunctionName:t.functionName??null,Delete:t.mode==="delete"?1:0}),a=t.mode==="new"?`ok created FunctionRight code ${t.functionCode}${t.functionName?` (${t.functionName})`:""} for "${r.APIName}"`:t.mode==="update"?`ok saved FunctionRight ID ${t.functionId}: code ${t.functionCode}${t.functionName?` (${t.functionName})`:""} for "${r.APIName}"`:`ok deleted FunctionRight ID ${t.functionId} and its user assignments`;let c=await s(i,r).catch(()=>null),l=c?.data??[];if(c)await xr(e.store.paths,o,r.APIName,t.kind==="system"?{system:l}:{functions:l});return{apiName:r.APIName,notes:[a,`current list (${l.length}):`],rows:l}}var ss={"api-domain":{type:"string"},"user-token":{type:"string"},"user-token-env":{type:"string"}};async function is(e){return{apiDomain:f(e.values,"api-domain"),userToken:await Te(f(e.values,"user-token"),f(e.values,"user-token-env"),"--user-token")}}function Jn(e){k(`${e.join(`
74
74
  `)}
75
- `)}var nm={name:"db user-token",mcpName:"db_user_token_set",usage:"fui db user-token [--db ref] (--from <project/alias> | --token - | --token-env VAR) no source: list fingerprints",summary:"Save a userToken (Bearer for spAPI_* calls) into one connection; never prints tokens",options:{from:{type:"string"},token:{type:"string"},"token-env":{type:"string"}},async run(e){let t=await Te(f(e.values,"token"),f(e.values,"token-env"),"--token"),n=f(e.values,"from");if(n&&t)throw new m("pass --from or --token/--token-env, not both");let o=await Ga(await X(e),{db:f(e.values,"db"),userToken:t,tokenSource:n});Jn(o.notes)}},om={name:"db token-rebuild",mcpName:"db_token_rebuild",usage:"fui db token-rebuild [--db ref] --uid <login> (--pwd - | --pwd-env VAR)",summary:"Rebuild a connection's dbToken after a UID/PWD change (sqlServer/database from the saved connection), test, save",options:{uid:{type:"string"},pwd:{type:"string"},"pwd-env":{type:"string"}},async run(e){let t=f(e.values,"uid");if(!t)throw new m("missing --uid");let n=await Te(f(e.values,"pwd"),f(e.values,"pwd-env"),"--pwd");if(!n)throw new m("missing --pwd - or --pwd-env VAR");Jn((await Ka(await X(e),{db:f(e.values,"db"),uid:t,password:n})).notes)}},rm={name:"db alias list",mcpName:"db_alias_list",usage:"fui db alias list [--search text] [--api-domain host] [--user-token-env VAR]",summary:"Databases you may manage on the acc system (APIName, SQLServer, DatabaseName); read-only",options:{search:{type:"string"},...ss},async run(e){let t=await za(await X(e),{...await is(e),search:f(e.values,"search")});for(let n of t.notes)P(`# ${n}`);if(t.rows.length>0)k(Y(t.rows,e.render))}},sm={name:"db alias new",mcpName:"db_alias_new",usage:"fui db alias new <apiName> --module-name N --sql-server S --database D --username U (--password - | --password-env VAR) [--module-id N]",summary:"Register a new database as a tAPI alias on acc (ask the user first; app login, never db_owner)",options:{"module-name":{type:"string"},"sql-server":{type:"string"},database:{type:"string"},username:{type:"string"},password:{type:"string"},"password-env":{type:"string"},"module-id":{type:"string"},...ss},async run(e){let{values:t}=e,n=e.positionals[0],o=f(t,"module-name"),s=f(t,"sql-server"),r=f(t,"database"),i=f(t,"username");if(!n||!o||!s||!r||!i)throw new m("need <apiName>, --module-name, --sql-server, --database and --username");let a=await Te(f(t,"password"),f(t,"password-env"),"--password");if(!a)throw new m("missing --password - or --password-env VAR");let c=f(t,"module-id"),l=c===void 0?void 0:Number(c);if(l!==void 0&&!Number.isInteger(l))throw new m("--module-id must be an integer");let u=await Xa(await X(e),{...await is(e),apiName:n,moduleName:o,sqlServer:s,database:r,username:i,password:a,moduleId:l});Jn(u.notes)}},im={name:"db add-by-name",mcpName:"db_connect_by_name",usage:"fui db add-by-name <apiName> [-p P] [--borrow-from <project/alias>] [--default] [--api-domain host] [--user-token-env VAR]",summary:"Connect by alias: look up SQLServer/Database on acc, borrow a SQL login, test, save, fetch schema",options:{"borrow-from":{type:"string"},default:{type:"boolean"},...ss},async run(e){let t=e.positionals[0];if(!t)throw new m("missing <apiName>; see: fui db alias list");let n=await Ya(await X(e),{...await is(e),apiName:t,borrowFrom:f(e.values,"borrow-from"),makeDefault:e.values.default===!0});Jn(n.notes)}};function oc(e){return e.map((t)=>({sysRight:String(t.SysRight??""),note:String(t.Note??"")}))}function rc(e){return e.map((t)=>({functionId:String(t.FunctionID??""),code:String(t.FunctionCode??""),name:String(t.FunctionName??""),enabled:t.Enable===!1||t.Enable===0?"no":"yes"}))}var sc={"api-name":{type:"string"}};function rs(e,t,n,o){let s=e===void 0?Number.NaN:Number(e);if(!Number.isInteger(s)||!n(s))throw new m(`${t} must be ${o}`);return s}function tc(e,t,n){if(e!==void 0&&e.length>t)throw new m(`${n} is at most ${t} characters`);return e}function nc(e){return{name:`right ${e} list`,mcpName:`right_${e}_list`,usage:`fui right ${e} list [-p P] [--api-name alias]`,summary:e==="system"?"SystemRight levels (0-9, 9 = Project Admin) of a project on acc; refreshes _db/rights.json":"FunctionRight codes of a project on acc (vueData.user.FunctionRight); refreshes _db/rights.json",options:sc,async run(t){let{apiName:n,rows:o}=await Za(await X(t),e,f(t.values,"api-name"));if(P(`# ${e==="system"?"SystemRight":"FunctionRight"} of "${n}": ${o.length}`),o.length===0){P(`# none defined; create one: fui right ${e} new ...`);return}k(Y(e==="system"?oc(o):rc(o),t.render))}}}function ln(e,t){let n=e==="system"?`fui right system ${t} <0-9>${t==="delete"?"":" [--note text]"} [--api-name alias]`:t==="new"?"fui right function new --code N [--name text] [--api-name alias]":t==="update"?"fui right function update <functionId> --code N [--name text] [--api-name alias]":"fui right function delete <functionId> [--code N] [--api-name alias]",o={system:{new:"Define a SystemRight level that does not exist yet (server pre-check; 9 is always Project Admin)",update:"Change the note of an existing SystemRight level",delete:"DELETE a SystemRight level (ask the user first; the server refuses while users hold it)"},function:{new:"Create a FunctionRight code (the server assigns FunctionID; duplicates rejected)",update:"Edit an existing FunctionRight by its FunctionID",delete:"DELETE a FunctionRight and every user assignment of it (ask the user first)"}};return{name:`right ${e} ${t}`,mcpName:`right_${e}_${t}`,usage:n,summary:o[e][t],options:{...sc,note:{type:"string"},code:{type:"string"},name:{type:"string"}},async run(s){let{values:r,positionals:i}=s,a;if(e==="system")a={kind:e,mode:t,sysRight:rs(i[0],"<level>",(l)=>l>=0&&l<=9,"an integer 0-9"),note:t==="delete"?void 0:tc(f(r,"note"),50,"--note")};else{let l=f(r,"code");a={kind:e,mode:t,functionId:t==="new"?0:rs(i[0],"<functionId>",(u)=>u>0,"a positive integer"),functionCode:t==="delete"&&l===void 0?0:rs(l,"--code",()=>!0,"an integer"),functionName:t==="delete"?void 0:tc(f(r,"name"),100,"--name")}}let c=await ec(await X(s),a,f(r,"api-name"));Jn(c.notes),k(Y(e==="system"?oc(c.rows):rc(c.rows),s.render))}}}var ic=[nm,om,rm,sm,im,nc("system"),ln("system","new"),ln("system","update"),ln("system","delete"),nc("function"),ln("function","new"),ln("function","update"),ln("function","delete")];import{mkdir as wm}from"node:fs/promises";import{execFile as cm,spawn as lm}from"node:child_process";import{realpathSync as um}from"node:fs";import{join as ac,sep as St}from"node:path";var de="1.3.1";var No="@fui-org/fui-cli",dm=3600000,pm=5000;function cc(e=process.env){return ac(it(e),"..","update.json")}async function Kn(e=process.env){try{let t=await At(cc(e));if(t&&typeof t==="object"&&!Array.isArray(t))return t}catch{}return{}}async function pt(e,t=process.env){await D(cc(t),`${JSON.stringify(e,null,2)}
75
+ `)}var nm={name:"db user-token",mcpName:"db_user_token_set",usage:"fui db user-token [--db ref] (--from <project/alias> | --token - | --token-env VAR) no source: list fingerprints",summary:"Save a userToken (Bearer for spAPI_* calls) into one connection; never prints tokens",options:{from:{type:"string"},token:{type:"string"},"token-env":{type:"string"}},async run(e){let t=await Te(f(e.values,"token"),f(e.values,"token-env"),"--token"),n=f(e.values,"from");if(n&&t)throw new m("pass --from or --token/--token-env, not both");let o=await Ga(await X(e),{db:f(e.values,"db"),userToken:t,tokenSource:n});Jn(o.notes)}},om={name:"db token-rebuild",mcpName:"db_token_rebuild",usage:"fui db token-rebuild [--db ref] --uid <login> (--pwd - | --pwd-env VAR)",summary:"Rebuild a connection's dbToken after a UID/PWD change (sqlServer/database from the saved connection), test, save",options:{uid:{type:"string"},pwd:{type:"string"},"pwd-env":{type:"string"}},async run(e){let t=f(e.values,"uid");if(!t)throw new m("missing --uid");let n=await Te(f(e.values,"pwd"),f(e.values,"pwd-env"),"--pwd");if(!n)throw new m("missing --pwd - or --pwd-env VAR");Jn((await Ka(await X(e),{db:f(e.values,"db"),uid:t,password:n})).notes)}},rm={name:"db alias list",mcpName:"db_alias_list",usage:"fui db alias list [--search text] [--api-domain host] [--user-token-env VAR]",summary:"Databases you may manage on the acc system (APIName, SQLServer, DatabaseName); read-only",options:{search:{type:"string"},...ss},async run(e){let t=await za(await X(e),{...await is(e),search:f(e.values,"search")});for(let n of t.notes)P(`# ${n}`);if(t.rows.length>0)k(Y(t.rows,e.render))}},sm={name:"db alias new",mcpName:"db_alias_new",usage:"fui db alias new <apiName> --module-name N --sql-server S --database D --username U (--password - | --password-env VAR) [--module-id N]",summary:"Register a new database as a tAPI alias on acc (ask the user first; app login, never db_owner)",options:{"module-name":{type:"string"},"sql-server":{type:"string"},database:{type:"string"},username:{type:"string"},password:{type:"string"},"password-env":{type:"string"},"module-id":{type:"string"},...ss},async run(e){let{values:t}=e,n=e.positionals[0],o=f(t,"module-name"),s=f(t,"sql-server"),r=f(t,"database"),i=f(t,"username");if(!n||!o||!s||!r||!i)throw new m("need <apiName>, --module-name, --sql-server, --database and --username");let a=await Te(f(t,"password"),f(t,"password-env"),"--password");if(!a)throw new m("missing --password - or --password-env VAR");let c=f(t,"module-id"),l=c===void 0?void 0:Number(c);if(l!==void 0&&!Number.isInteger(l))throw new m("--module-id must be an integer");let u=await Xa(await X(e),{...await is(e),apiName:n,moduleName:o,sqlServer:s,database:r,username:i,password:a,moduleId:l});Jn(u.notes)}},im={name:"db add-by-name",mcpName:"db_connect_by_name",usage:"fui db add-by-name <apiName> [-p P] [--borrow-from <project/alias>] [--default] [--api-domain host] [--user-token-env VAR]",summary:"Connect by alias: look up SQLServer/Database on acc, borrow a SQL login, test, save, fetch schema",options:{"borrow-from":{type:"string"},default:{type:"boolean"},...ss},async run(e){let t=e.positionals[0];if(!t)throw new m("missing <apiName>; see: fui db alias list");let n=await Ya(await X(e),{...await is(e),apiName:t,borrowFrom:f(e.values,"borrow-from"),makeDefault:e.values.default===!0});Jn(n.notes)}};function oc(e){return e.map((t)=>({sysRight:String(t.SysRight??""),note:String(t.Note??"")}))}function rc(e){return e.map((t)=>({functionId:String(t.FunctionID??""),code:String(t.FunctionCode??""),name:String(t.FunctionName??""),enabled:t.Enable===!1||t.Enable===0?"no":"yes"}))}var sc={"api-name":{type:"string"}};function rs(e,t,n,o){let s=e===void 0?Number.NaN:Number(e);if(!Number.isInteger(s)||!n(s))throw new m(`${t} must be ${o}`);return s}function tc(e,t,n){if(e!==void 0&&e.length>t)throw new m(`${n} is at most ${t} characters`);return e}function nc(e){return{name:`right ${e} list`,mcpName:`right_${e}_list`,usage:`fui right ${e} list [-p P] [--api-name alias]`,summary:e==="system"?"SystemRight levels (0-9, 9 = Project Admin) of a project on acc; refreshes _db/rights.json":"FunctionRight codes of a project on acc (vueData.user.FunctionRight); refreshes _db/rights.json",options:sc,async run(t){let{apiName:n,rows:o}=await Za(await X(t),e,f(t.values,"api-name"));if(P(`# ${e==="system"?"SystemRight":"FunctionRight"} of "${n}": ${o.length}`),o.length===0){P(`# none defined; create one: fui right ${e} new ...`);return}k(Y(e==="system"?oc(o):rc(o),t.render))}}}function ln(e,t){let n=e==="system"?`fui right system ${t} <0-9>${t==="delete"?"":" [--note text]"} [--api-name alias]`:t==="new"?"fui right function new --code N [--name text] [--api-name alias]":t==="update"?"fui right function update <functionId> --code N [--name text] [--api-name alias]":"fui right function delete <functionId> [--code N] [--api-name alias]",o={system:{new:"Define a SystemRight level that does not exist yet (server pre-check; 9 is always Project Admin)",update:"Change the note of an existing SystemRight level",delete:"DELETE a SystemRight level (ask the user first; the server refuses while users hold it)"},function:{new:"Create a FunctionRight code (the server assigns FunctionID; duplicates rejected)",update:"Edit an existing FunctionRight by its FunctionID",delete:"DELETE a FunctionRight and every user assignment of it (ask the user first)"}};return{name:`right ${e} ${t}`,mcpName:`right_${e}_${t}`,usage:n,summary:o[e][t],options:{...sc,note:{type:"string"},code:{type:"string"},name:{type:"string"}},async run(s){let{values:r,positionals:i}=s,a;if(e==="system")a={kind:e,mode:t,sysRight:rs(i[0],"<level>",(l)=>l>=0&&l<=9,"an integer 0-9"),note:t==="delete"?void 0:tc(f(r,"note"),50,"--note")};else{let l=f(r,"code");a={kind:e,mode:t,functionId:t==="new"?0:rs(i[0],"<functionId>",(u)=>u>0,"a positive integer"),functionCode:t==="delete"&&l===void 0?0:rs(l,"--code",()=>!0,"an integer"),functionName:t==="delete"?void 0:tc(f(r,"name"),100,"--name")}}let c=await ec(await X(s),a,f(r,"api-name"));Jn(c.notes),k(Y(e==="system"?oc(c.rows):rc(c.rows),s.render))}}}var ic=[nm,om,rm,sm,im,nc("system"),ln("system","new"),ln("system","update"),ln("system","delete"),nc("function"),ln("function","new"),ln("function","update"),ln("function","delete")];import{mkdir as wm}from"node:fs/promises";import{execFile as cm,spawn as lm}from"node:child_process";import{realpathSync as um}from"node:fs";import{join as ac,sep as St}from"node:path";var de="1.3.2";var No="@fui-org/fui-cli",dm=3600000,pm=5000;function cc(e=process.env){return ac(it(e),"..","update.json")}async function Kn(e=process.env){try{let t=await At(cc(e));if(t&&typeof t==="object"&&!Array.isArray(t))return t}catch{}return{}}async function pt(e,t=process.env){await D(cc(t),`${JSON.stringify(e,null,2)}
76
76
  `)}var mm=`${St}node_modules${St}@fui-org${St}fui-cli${St}`,hm=[[`${St}install${St}global`,"bun",!1],[`${St}lib`,"npm",!1],[`${St}npm`,"npm",!0]];function xo(e=wt()){let t;try{t=um(e)}catch{return null}for(let[n,o,s]of hm){let r=`${n}${mm}`,i=t.indexOf(r);if(i>=0){let a=t.slice(0,s?i+n.length:i);return{dir:t.slice(0,i+r.length-1),manager:o,prefix:a}}}return null}function Oo(e=wt()){return xo(e)?.dir??null}function Do(e,t){return e==="bun"?`bun add -g ${No}@${t}`:`npm install -g ${No}@${t}`}function as(e,t,n=process.env){return new Promise((o)=>{cm(e,t,{env:n,shell:process.platform==="win32",maxBuffer:16777216,windowsHide:!0},(s,r,i)=>o({ok:!s,output:`${r}${i}`.trim()}))})}async function cs(e=process.env){let t=e.FUI_AUTO_UPDATE?.trim().toLowerCase();if(t)return!["0","off","false","no"].includes(t);try{return(await bt(e))["auto-update"]!=="off"}catch{return!0}}async function ls(e=process.env){let t=(e.FUI_UPDATE_REGISTRY||"https://registry.npmjs.org").replace(/\/+$/,""),n=await fetch(`${t}/${No.replace("/","%2F")}/latest`,{signal:AbortSignal.timeout(pm),headers:{accept:"application/json"}});if(!n.ok)throw Error(`registry answered HTTP ${n.status}`);let o=await n.json();if(typeof o.version!=="string")throw Error("registry answer has no version");return o.version}function us(e,t=de){return Ii(e,t)===1}async function fm(e,t){let n=`${No}@${t}`;if(e.manager==="npm")return as("npm",["install","-g","--prefix",e.prefix,n]);return as("bun",["add","-g",n],{...process.env,BUN_INSTALL:e.prefix})}async function ds(e=process.env){let t=await Kn(e),n=new Date().toISOString(),o;try{o=await ls(e)}catch(i){throw await pt({...t,checkedAt:n,error:i.message},e),i}if(!us(o))return await pt({...t,checkedAt:n,latest:o,error:void 0},e),{latest:o,action:"current"};let s=xo();if(!s)return await pt({...t,checkedAt:n,latest:o,error:void 0},e),{latest:o,action:"manual",detail:`${Do("bun",o)} (or ${Do("npm",o)})`};let r=await fm(s,o);if(!r.ok)return await pt({...t,checkedAt:n,latest:o,error:r.output.slice(-500)},e),{latest:o,action:"failed",detail:r.output};return await pt({checkedAt:n,latest:o,updatedFrom:de,updatedTo:o,noticeShown:!1,skillsVersion:t.skillsVersion,skillsAgents:t.skillsAgents},e),await gm(e),{latest:o,action:"installed"}}async function gm(e){let t=Oo();if(!t)return;await as(process.execPath,[ac(t,"dist","fui.js"),"skill","install"],{...e,FUI_AUTO_SKILLS:"off",FUI_AUTO_UPDATE:"off"})}async function lc(e=process.env){if(!Oo()||!await cs(e))return null;let t=await Kn(e),n=null;if(t.updatedTo===de&&t.noticeShown===!1)n=`# fui updated ${t.updatedFrom} -> ${de}`,t.noticeShown=!0,await pt(t,e);let o=t.checkedAt?Date.parse(t.checkedAt):0;if(Date.now()-o<dm)return n;return await pt({...t,checkedAt:new Date().toISOString()},e),lm(process.execPath,[wt(),"update","--background"],{stdio:"ignore",env:{...e,FUI_AUTO_UPDATE:"off"},detached:!0,windowsHide:!0}).unref(),n}function uc(e){let t=e[0];if(!t)throw new m(`missing <key>; keys: ${wo.join(", ")}`);if(!wo.includes(t))throw new m(`unknown key "${t}"; keys: ${wo.join(", ")}`);return t}async function ym(){let e=await cs(),t=process.env.FUI_AUTO_UPDATE?.trim(),n=(await bt())["auto-update"],o=t?"env":n?"config":"default",s=t?"FUI_AUTO_UPDATE":n?it():"built-in (global bun or npm installs only)";return{key:"auto-update",value:e?"on":"off",source:o,from:s}}var bm={name:"config",usage:"fui config",summary:"Show settings with their effective value and source",async run({workdir:e,render:t}){let{base:n,token:o}=await yo();P(`# config file: ${it()}`),k(Y([{key:"workdir",value:e.path,source:e.source,from:e.detail},{key:"api-base",value:n.value??"",source:n.source,from:n.detail},{key:"api-token",value:o.value?"(set)":"",source:o.source,from:o.detail},await ym()],t))}},km={name:"config set",usage:"fui config set workdir <path> | api-base <url> | api-token - | auto-update on|off",summary:"Save a setting to the fui config file (api-token only from stdin)",async run({positionals:e}){let t=uc(e),n=e[1];if(!n)throw new m(`missing <value> for ${t}`);let o;if(t==="workdir")o=Zt(n),await wm(o,{recursive:!0});else if(t==="auto-update"){if(n!=="on"&&n!=="off")throw new m("auto-update takes on or off");o=n}else if(t==="api-token")o=await Te(n,void 0,"api-token");else o=n.trim().replace(/\/+$/,"");let s=await bt();s[t]=o;let r=await br(s),i={workdir:process.env.FUI_MCP_WORKDIR&&!process.env.FUI_WORKDIR?"FUI_MCP_WORKDIR":"FUI_WORKDIR","api-base":"FUI_API_BASE","api-token":"FUI_API_TOKEN","auto-update":"FUI_AUTO_UPDATE"}[t];if(process.env[i])P(`# note: ${i} is set in this shell and overrides the config file`);k(`set ${t}${t==="api-token"?"":`=${o}`} in ${r}
77
77
  `)}},vm={name:"config unset",usage:"fui config unset <workdir|api-base|api-token|auto-update>",summary:"Remove a setting from the fui config file",async run({positionals:e}){let t=uc(e),n=await bt();delete n[t];let o=await br(n);k(`unset ${t} in ${o}
78
78
  `)}},dc=[bm,km,vm];var Sm={name:"db list",mcpName:"db_config_read",usage:"fui db list [-p project]",summary:"List connections across the workspace (no secrets)",async run({store:e,values:t,render:n}){let o=f(t,"project"),s=o?[Pr(o)]:[...new Set([...await e.listProjects(),...await e.listLegacyProjects()])].sort(),r=[];for(let i of s){let a=await e.load(i),c=await e.loadLegacy(i),l=c?.apiName??"legacy";if(c&&!fe(a,l))r.push({db:`${i}/${l}`,engine:"legacy",default:"",apiDomain:c.apiDomain??"",database:c.database??"",userToken:c.userToken?"yes":"no"}),P(`# ${i}: _db/config.json is the pre-1.4 format and unused; run: fui db import-legacy -p ${i}`);for(let[u,d]of Object.entries(a.connections)){let p="invalid",h=d.database??"";try{if(d.dbToken){let w=vo(d.dbToken);p=w.engine,h||=w.database}}catch{}r.push({db:`${i}/${u}`,engine:p,default:a.default===u?"*":"",apiDomain:d.apiDomain??"",database:h,userToken:d.userToken?"yes":"no"})}}if(r.length===0){P("no connections; add one: fui db add <alias> -p <project> --token -");return}k(Y(r,n))}},$m={name:"db add",mcpName:"db_connect",usage:`fui db add <alias> -p <project> (--token - | --token-env VAR | --conn - | --conn-env VAR)
package/dist/fui.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{enableCompileCache as a}from"node:module";a?.();var{run:e}=await import("./fui-x7kph78r.js");await e();
2
+ import{enableCompileCache as a}from"node:module";a?.();var{run:e}=await import("./fui-y8an39cn.js");await e();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fui-org/fui-cli",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Token-lean CLI for the FUI low-code platform (Node.js), successor to Fui MCP",
5
5
  "keywords": [
6
6
  "ai",
@@ -10,6 +10,10 @@
10
10
  "low-code"
11
11
  ],
12
12
  "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/fui-org/fui-cli.git"
16
+ },
13
17
  "bin": {
14
18
  "fui": "dist/fui.js"
15
19
  },