@smartkomm/plexus-cli 0.1.17 → 0.1.18

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 CHANGED
@@ -187,7 +187,7 @@ This table names each group and the rules its `--help` does not carry.
187
187
  | **retention** | Applications and persons past their retention period, erased by hand only (`--confirm --expect <n>`); nothing erases on a schedule — [erase-due-applications](./playbooks/retention/erase-due-applications.md), [erase-due-parties](./playbooks/retention/erase-due-parties.md). |
188
188
  | **test-actions** | The test-mode popover of a test application (scenarios, `auto-fill-files`, `submit-form`, …); `--param` values are JSON like `call`'s — [drive-a-test-application](./playbooks/test-actions/drive-a-test-application.md). |
189
189
  | **tokens** | Minting needs `_platform.apiTokens.manage` or the tenant right `administration.apiTokens.manage` (every `tenant_admin` holds it); list and revoke your own always work. Minting FOR someone needs `_platform.users.manage` and `_platform.apiTokens.manage` — [cli-access-for-tenant-admin](./playbooks/users/cli-access-for-tenant-admin.md). |
190
- | **users** | `revoke` (the `--tenant` only), `unset-group` and `deactivate` are refused while a `wip` or published workflow's assignment rule names the person (replace them first: „Person ersetzen" in the workflow editor, then publish); `--replace-with <configKey>` hands their active applications over and never rewrites a rule. A password comes only through `--password-stdin` / `--password-file`; `--out <csv>` appends the credential row. See ["Provisioning admins"](#provisioning-admins). |
190
+ | **users** | `revoke` (the `--tenant` only), `unset-group` and `archive` are refused while a `wip` or published workflow's assignment rule names the person (replace them first: „Person ersetzen" in the workflow editor, then publish); `--replace-with <configKey>` hands their active applications over and never rewrites a rule. A password comes only through `--password-stdin` / `--password-file`; `--out <csv>` appends the credential row. See ["Provisioning admins"](#provisioning-admins). |
191
191
  | **platform** | `platform users`, `platform workers`, `workers logs`; `jobs …` for worker jobs — [debug-worker-jobs](./playbooks/worker-ops/debug-worker-jobs.md). |
192
192
  | **persons · leads** | Person search; `persons purge` is the only hard delete of a person (plan unless `--confirm`) — [purge-deleted-person](./playbooks/persons/purge-deleted-person.md); a tenant's open leads (Interessenten) — [list-leads](./playbooks/leads/list-leads.md). |
193
193
  | **admission** | `admission runs list`; `assignment simulate` evaluates an offer bundle's assignment rule offline — [assignment-rule](./playbooks/offer/assignment-rule.md). |
@@ -302,7 +302,7 @@ except where marked **break**:
302
302
  | `feedback tags rename\|recolor\|visibility` | `feedback tags set --name\|--color\|--visibility` |
303
303
  | `users add` | `users grant` |
304
304
  | `users remove` | `users revoke` (the `--tenant`; plan unless `--confirm`) |
305
- | `users delete` | `users deactivate` (plan unless `--confirm`) |
305
+ | `users delete`, `users deactivate` | `users archive` (plan unless `--confirm`) |
306
306
  | `users provision-platform-admin` | `users provision --platform-admin` |
307
307
  | `users provision-platform-user` | `users provision --permission …` |
308
308
  | `--slug` (offer commands) | `--offer` |
@@ -313,7 +313,7 @@ except where marked **break**:
313
313
  | `--password <pw>`, `--engage-password <pw>` | **break**, refused: `--password-stdin` / `--password-file`, `--engage-password-stdin` / `--engage-password-file` / `PLEXUS_ENGAGE_PASSWORD` |
314
314
 
315
315
  Newly plan-by-default (scripts that ran them must add `--confirm`): `files delete`,
316
- `signing connection delete`, `signing void`, `offer delete`, `users deactivate`,
316
+ `signing connection delete`, `signing void`, `offer delete`, `users archive`,
317
317
  `users revoke`, `users grant-all`, `org unit delete`, `org legal-entity delete`,
318
318
  `generator delete-draft`, `generator package delete-draft`, `jobs cancel`,
319
319
  `tokens revoke`, `demo link revoke`, `feedback tags delete`, `imports trigger`,
package/dist/cli.mjs CHANGED
@@ -123,7 +123,7 @@ ${t.map(n=>`
123
123
  `,x.length-X>M&&U>X?ue+=x.slice(X,U)+`
124
124
  `+x.slice(U+1):ue+=x.slice(X),ue.slice(1)}s(de,"foldLine");function Ke(x){let M="",j=0;for(let J=0;J<x.length;j>=65536?J+=2:J++){j=Ve(x,J);let X=oe[j];!X&&zt(j)?(M+=x[J],j>=65536&&(M+=x[J+1])):M+=X||C(j)}return M}s(Ke,"escapeString");function ur(x,M,j){let J="",X=x.tag;for(let ee=0,U=j.length;ee<U;ee+=1){let re=j[ee];x.replacer&&(re=x.replacer.call(j,String(ee),re)),(F(x,M,re,!1,!1)||typeof re>"u"&&F(x,M,null,!1,!1))&&(J!==""&&(J+=","+(x.condenseFlow?"":" ")),J+=x.dump)}x.tag=X,x.dump="["+J+"]"}s(ur,"writeFlowSequence");function Fn(x,M,j,J){let X="",ee=x.tag;for(let U=0,re=j.length;U<re;U+=1){let ue=j[U];x.replacer&&(ue=x.replacer.call(j,String(U),ue)),(F(x,M+1,ue,!0,!0,!1,!0)||typeof ue>"u"&&F(x,M+1,null,!0,!0,!1,!0))&&((!J||X!=="")&&(X+=Ge(x,M)),x.dump&&l===x.dump.charCodeAt(0)?X+="-":X+="- ",X+=x.dump)}x.tag=ee,x.dump=X||"[]"}s(Fn,"writeBlockSequence");function Fr(x,M,j){let J="",X=x.tag,ee=Object.keys(j);for(let U=0,re=ee.length;U<re;U+=1){let ue="";J!==""&&(ue+=", "),x.condenseFlow&&(ue+='"');let ye=ee[U],we=j[ye];x.replacer&&(we=x.replacer.call(j,ye,we)),F(x,M,ye,!1,!1)&&(x.dump.length>1024&&(ue+="? "),ue+=x.dump+(x.condenseFlow?'"':"")+":"+(x.condenseFlow?"":" "),F(x,M,we,!1,!1)&&(ue+=x.dump,J+=ue))}x.tag=X,x.dump="{"+J+"}"}s(Fr,"writeFlowMapping");function Mo(x,M,j,J){let X="",ee=x.tag,U=Object.keys(j);if(x.sortKeys===!0)U.sort();else if(typeof x.sortKeys=="function")U.sort(x.sortKeys);else if(x.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let re=0,ue=U.length;re<ue;re+=1){let ye="";(!J||X!=="")&&(ye+=Ge(x,M));let we=U[re],Ae=j[we];if(x.replacer&&(Ae=x.replacer.call(j,we,Ae)),!F(x,M+1,we,!0,!0,!0))continue;let De=x.tag!==null&&x.tag!=="?"||x.dump&&x.dump.length>1024;De&&(x.dump&&l===x.dump.charCodeAt(0)?ye+="?":ye+="? "),ye+=x.dump,De&&(ye+=Ge(x,M)),F(x,M+1,Ae,!0,De)&&(x.dump&&l===x.dump.charCodeAt(0)?ye+=":":ye+=": ",ye+=x.dump,X+=ye)}x.tag=ee,x.dump=X||"{}"}s(Mo,"writeBlockMapping");function h(x,M,j){let J=j?x.explicitTypes:x.implicitTypes;for(let X=0,ee=J.length;X<ee;X+=1){let U=J[X];if((U.instanceOf||U.predicate)&&(!U.instanceOf||typeof M=="object"&&M instanceof U.instanceOf)&&(!U.predicate||U.predicate(M))){if(j?U.multi&&U.representName?x.tag=U.representName(M):x.tag=U.tag:x.tag="?",U.represent){let re=x.styleMap[U.tag]||U.defaultStyle,ue;if(r.call(U.represent)==="[object Function]")ue=U.represent(M,re);else if(i.call(U.represent,re))ue=U.represent[re](M,re);else throw new t("!<"+U.tag+'> tag resolver accepts not "'+re+'" style');x.dump=ue}return!0}}return!1}s(h,"detectType");function F(x,M,j,J,X,ee,U){x.tag=null,x.dump=j,h(x,j,!1)||h(x,j,!0);let re=r.call(x.dump),ue=J;J&&(J=x.flowLevel<0||x.flowLevel>M);let ye=re==="[object Object]"||re==="[object Array]",we,Ae;if(ye&&(we=x.duplicates.indexOf(j),Ae=we!==-1),(x.tag!==null&&x.tag!=="?"||Ae||x.indent!==2&&M>0)&&(X=!1),Ae&&x.usedDuplicates[we])x.dump="*ref_"+we;else{if(ye&&Ae&&!x.usedDuplicates[we]&&(x.usedDuplicates[we]=!0),re==="[object Object]")J&&Object.keys(x.dump).length!==0?(Mo(x,M,x.dump,X),Ae&&(x.dump="&ref_"+we+x.dump)):(Fr(x,M,x.dump),Ae&&(x.dump="&ref_"+we+" "+x.dump));else if(re==="[object Array]")J&&x.dump.length!==0?(x.noArrayIndent&&!U&&M>0?Fn(x,M-1,x.dump,X):Fn(x,M,x.dump,X),Ae&&(x.dump="&ref_"+we+x.dump)):(ur(x,M,x.dump),Ae&&(x.dump="&ref_"+we+" "+x.dump));else if(re==="[object String]")x.tag!=="?"&&V(x,x.dump,M,ee,ue);else{if(re==="[object Undefined]")return!1;if(x.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+re)}if(x.tag!==null&&x.tag!=="?"){let De=encodeURI(x.tag[0]==="!"?x.tag.slice(1):x.tag).replace(/!/g,"%21");x.tag[0]==="!"?De="!"+De:De.slice(0,18)==="tag:yaml.org,2002:"?De="!!"+De.slice(18):De="!<"+De+">",x.dump=De+" "+x.dump}}return!0}s(F,"writeNode");function G(x,M){let j=[],J=[];z(x,j,J);let X=J.length;for(let ee=0;ee<X;ee+=1)M.duplicates.push(j[J[ee]]);M.usedDuplicates=new Array(X)}s(G,"getDuplicateReferences");function z(x,M,j){if(x!==null&&typeof x=="object"){let J=M.indexOf(x);if(J!==-1)j.indexOf(J)===-1&&j.push(J);else if(M.push(x),Array.isArray(x))for(let X=0,ee=x.length;X<ee;X+=1)z(x[X],M,j);else{let X=Object.keys(x);for(let ee=0,U=X.length;ee<U;ee+=1)z(x[X[ee]],M,j)}}}s(z,"inspectNode");function K(x,M){M=M||{};let j=new ce(M);j.noRefs||G(x,j);let J=x;return j.replacer&&(J=j.replacer.call({"":J},"",J)),F(j,0,J,!0,!0)?j.dump+`
125
125
  `:""}return s(K,"dump2"),Oh.dump=K,Oh}s(fj,"requireDumper");var WE;function pj(){if(WE)return Qt;WE=1;let e=uj(),t=fj();function n(r,i){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+i+" instead, which is now safe by default.")}}return s(n,"renamed"),Qt.Type=rn(),Qt.Schema=HE(),Qt.FAILSAFE_SCHEMA=ZE(),Qt.JSON_SCHEMA=rT(),Qt.CORE_SCHEMA=iT(),Qt.DEFAULT_SCHEMA=Ph(),Qt.load=e.load,Qt.loadAll=e.loadAll,Qt.dump=t.dump,Qt.YAMLException=Ra(),Qt.types={binary:aT(),float:nT(),map:QE(),null:XE(),pairs:dT(),set:cT(),timestamp:oT(),bool:eT(),int:tT(),merge:sT(),omap:lT(),seq:JE(),str:YE()},Qt.safeLoad=n("safeLoad","load"),Qt.safeLoadAll=n("safeLoadAll","loadAll"),Qt.safeDump=n("safeDump","dump"),Qt}s(pj,"requireJsYaml");var mj=pj(),Zi=dj(mj),{Type:A7,Schema:E7,FAILSAFE_SCHEMA:T7,JSON_SCHEMA:$7,CORE_SCHEMA:R7,DEFAULT_SCHEMA:I7,load:O7,loadAll:P7,dump:_7,YAMLException:N7,types:C7,safeLoad:D7,safeLoadAll:F7,safeDump:L7}=Zi;var uT=["default_env","default_tenant","environments"],_h=["convex_url","site_url","token","admin_key"],gj=new Set(["convex_url","site_url"]);function fT(e){return H.join(hj.homedir(),".config","agent-tools",e.configFile)}s(fT,"configPath");function cu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(cu,"isRecord");function Nh(e,t,n){if(typeof e!="string"||e.trim()==="")throw new Re(`config ${n}: ${t} must be a non-empty string.`);return e}s(Nh,"nonEmptyString");function yj(e,t,n){let r;try{r=Zi.load(e)}catch(c){throw new Re(`config ${t}: not valid YAML (${c.message.split(`
126
- `)[0]}).`,{cause:c})}if(!cu(r))throw new Re(`config ${t}: expected a mapping with the top-level key "${n.yamlKey}".`);let i=Object.keys(r).filter(c=>c!==n.yamlKey);if(i.length>0)throw new Re(`config ${t}: unknown top-level key(s) ${i.map(c=>`"${c}"`).join(", ")} \u2014 only "${n.yamlKey}" is allowed.`);let o=r[n.yamlKey];if(!cu(o))throw new Re(`config ${t}: "${n.yamlKey}" must be a mapping.`);let a=Object.keys(o).filter(c=>!uT.includes(c));if(a.length>0)throw new Re(`config ${t}: unknown key(s) ${a.map(c=>`"${n.yamlKey}.${c}"`).join(", ")} \u2014 allowed: ${uT.join(", ")}.`);let l={environments:{}};o.default_env!==void 0&&(l.default_env=Nh(o.default_env,`${n.yamlKey}.default_env`,t)),o.default_tenant!==void 0&&(l.default_tenant=Nh(o.default_tenant,`${n.yamlKey}.default_tenant`,t));let d=o.environments??{};if(!cu(d))throw new Re(`config ${t}: ${n.yamlKey}.environments must be a mapping.`);for(let[c,u]of Object.entries(d)){let f=`${n.yamlKey}.environments.${c}`,m=u??{};if(!cu(m))throw new Re(`config ${t}: ${f} must be a mapping.`);let g=Object.keys(m).filter(y=>!_h.includes(y));if(g.length>0)throw new Re(`config ${t}: unknown key(s) ${g.map(y=>`"${f}.${y}"`).join(", ")} \u2014 allowed: ${_h.join(", ")}.`);let b={};for(let y of _h){if(m[y]===void 0||m[y]===null)continue;let v=Nh(m[y],`${f}.${y}`,t);if(gj.has(y)&&!wj(v))throw new Re(`config ${t}: ${f}.${y} must be an http(s) URL.`);b[y]=v}l.environments[c]=b}return l}s(yj,"parseConfigFile");function wj(e){try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"}catch{return!1}}s(wj,"isHttpUrl");function pT(e){let t=fT(e);return Oe(t)?{file:t,section:yj(ke(t,"utf8"),t,e)}:null}s(pT,"readConfigFile");function uu(e,t={}){let n=e.envPrefix,r=[],i=s(g=>{let b=process.env[`${n}_${g}`];if(!(b===void 0||b===""))return r.push(`${n}_${g}`),b},"fromEnv"),o=pT(e),a=o?.section,l=t.env??i("ENV")??a?.default_env??e.defaultEnv,d={};if(o!==null&&a!==void 0){let g=a.environments[l];if(g===void 0&&l!=="local"){let b=Object.keys(a.environments).join(", ")||"(none)";throw new Re(`${e.name}: unknown environment "${l}" in ${o.file}. Available: ${b}.`)}d=g??{}}let c=i("CONVEX_URL")??d.convex_url,u=i("SITE_URL")??d.site_url,f=i("TOKEN")??d.token,m=t.tenant??i("TENANT")??a?.default_tenant;return{env:l,...c!==void 0?{convexUrl:c}:{},...u!==void 0?{siteUrl:u}:{},...f!==void 0?{token:f}:{},...m!==void 0?{tenant:m}:{},source:o===null?"env":"yaml",fromEnvVars:r}}s(uu,"loadEnvConfig");function Ch(e){try{let t=new URL(e.trim());return t.hostname=t.hostname.replace(/\.$/,""),t.origin.toLowerCase()}catch{return e.trim().toLowerCase().replace(/\/+$/,"")}}s(Ch,"normalizeUrl");function mT(e){let t=Ch,n=new Set,r=pT(e);if(r!==null){let o=r.section.environments.prod;if(!o?.convex_url)throw new Error(`${e.name}: ${r.file} names no environments.prod.convex_url \u2014 a write cannot tell whether its target is production. Add the prod entry.`);return n.add(t(o.convex_url)),n}let i=e.envPrefix;if(process.env[`${i}_ENV`]==="prod"&&process.env[`${i}_CONVEX_URL`])return n.add(t(process.env[`${i}_CONVEX_URL`])),n;throw new Error(`${e.name}: no ${fT(e)} \u2014 a write cannot tell whether its target is production. Create the file with an environments.prod entry.`)}s(mT,"knownProdConvexUrls");import{lookup as bj}from"node:dns/promises";import{isIP as hT}from"node:net";import{networkInterfaces as kj}from"node:os";function gT(e,t){if(e===void 0)throw new Re(`${t} writes \u2014 name the environment with --env local|staging|prod (the configured default is not enough).`)}s(gT,"requireExplicitEnv");function Fh(e,t){return e.env==="prod"?!0:e.convexUrl!==void 0&&t.has(Ch(e.convexUrl))}s(Fh,"isProdTarget");function yT(e,t,n,r){let i=Fh(e,t);if(i&&!n)throw new Re(`${r} writes to PRODUCTION (env "${e.env}" \u2192 ${e.convexUrl??"?"}) \u2014 add --allow-prod if that is really meant.`);if(!i&&n)throw new Re(`${r}: --allow-prod is only for a production target (env "${e.env}" is not one).`)}s(yT,"assertProdAllowed");var vj={async lookup(e){return(await bj(e,{all:!0,verbatim:!0})).map(t=>t.address)},ownAddresses(){let e=new Set;for(let t of Object.values(kj()))for(let n of t??[])e.add(Dh(n.address));return e}};function Dh(e){let t=e.toLowerCase().replace(/%.*$/,"").replace(/^\[|\]$/g,""),n=/^::ffff:(\d+\.\d+\.\d+\.\d+)$/.exec(t);if(n?.[1]!==void 0)return n[1];let r=/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/.exec(t);if(r?.[1]!==void 0&&r[2]!==void 0){let i=parseInt(r[1],16),o=parseInt(r[2],16);return`${i>>8}.${i&255}.${o>>8}.${o&255}`}return t}s(Dh,"normalizeAddress");function xj(e){return e==="::1"||hT(e)===4&&e.startsWith("127.")}s(xj,"isLoopbackAddress");async function Lh(e,t=vj){let n;try{n=new URL(e).hostname}catch{throw new Re(`plexus: env "local" resolved "${e}", which is not a URL \u2014 refusing the local bootstrap.`)}let r=Dh(n),i;try{i=hT(r)!==0?[r]:(await t.lookup(n)).map(Dh)}catch(l){throw new Re(`plexus: env "local" points at ${e}, whose host does not resolve (${l.message}) \u2014 refusing the local bootstrap.`,{cause:l})}let o=t.ownAddresses(),a=i.filter(l=>!xj(l)&&!o.has(l));if(i.length===0||a.length>0)throw new Re(`plexus: env "local" points at ${e} (${a.join(", ")||"no address"}), which is not this machine \u2014 the local admin-key bootstrap runs only against this machine. Use --env staging|prod (with a token) for a remote deployment, or unset PLEXUS_CONVEX_URL.`)}s(Lh,"requireThisMachineForLocalBootstrap");var Xi={name:"plexus",configFile:"plexus.yml",yamlKey:"plexus",envPrefix:"PLEXUS",jwtCachePrefix:"plexus-jwt",defaultEnv:"local"};var Ia=H.resolve(import.meta.dirname,"..","..",".."),Sj="admin@plexus.swop.schule",Aj="plexus-cli (local dev)",bT="plx_configcli_local_0001";function kT(e,t){return Oe(e)?ke(e,"utf8").match(new RegExp(`^${t}=(.+)$`,"m"))?.[1]?.trim():void 0}s(kT,"readEnvValue");var wT="PLEXUS_LOCAL_INSTALL_ROOT";function fu(e=process.cwd()){let t=e;for(let n=0;n<12;n+=1){for(let i of[t,H.join(t,"app")])if(Oe(H.join(i,".env.local"))&&Oe(H.join(i,"convex")))return i;let r=H.dirname(t);if(r===t)break;t=r}if(process.env[wT]==="1")return Ia;throw new Re(`plexus: --env local follows the worktree you stand in, but ${e} is not inside a started one (no app/.env.local next to app/convex). cd into the worktree and run \`pnpm dev\` there, or set ${wT}=1 to use this install's own checkout (${Ia}).`)}s(fu,"resolveLocalAppRoot");function vT(e){if(e.siteUrl)return e.siteUrl;throw new Re(`plexus: env "${e.env}" has no site_url (needed for /cli/token). Set it in plexus.yml (environments.`+e.env+".site_url) or $PLEXUS_SITE_URL.")}s(vT,"resolveRemoteSiteUrl");function xT(e,t){if(e.siteUrl)return e.siteUrl;for(let n of[".env.local",".env.development.local"]){let r=kT(H.join(t(),n),"VITE_CONVEX_SITE_URL");if(r)return r}throw new Error("plexus: could not resolve the local Convex SITE url (for /cli/token). Start local dev with `pnpm dev` (rdu) in this worktree, then retry.")}s(xT,"resolveLocalSiteUrl");function Oa(e){if(e.convexUrl)return e.convexUrl;if(e.env==="local")return kE({cwd:fu()});throw new Re(`plexus: env "${e.env}" has no convex_url. Set it in plexus.yml (environments.${e.env}.convex_url) or $PLEXUS_CONVEX_URL.`)}s(Oa,"resolveTargetConvexUrl");function ST(e){let t=uu(Xi,e);return{env:t.env,convexUrl:Oa(t)}}s(ST,"resolveWriteTarget");async function Pa(e={}){let t=st();if(t){if(e.env!==void 0&&e.env!==t.environment||e.tenant!==void 0&&e.tenant!==t.caller.tenant)throw new Error("plexus: a platform chat cannot switch its environment or tenant.");return t.caller}let n=uu(Xi,e);if(n.env==="local")return Ej(n);if(!n.token)throw new Re(`plexus: env "${n.env}" needs an API token. Mint one in the app under Settings \u2192 API-Token and set it in plexus.yml (token) or $PLEXUS_TOKEN.`);let r=Oa(n),i={kind:"jwt",siteUrl:vT(n),token:n.token,cacheKey:aE(Xi.jwtCachePrefix,n.env,r,n.token)};return ou({convexUrl:r,auth:i,tenant:n.tenant})}s(Pa,"resolveCaller");async function Ej(e){let t=fu(),n=Oa(e);await Lh(n);let r=xT(e,()=>t);await Lh(r);{let i=vE({cwd:t}),o=await ou({convexUrl:n,auth:{kind:"admin",adminKey:i}}),a=xa("apiTokens:devSeedToken"),l={email:Sj,name:Aj,plaintext:bT};await o.mutation(a,l)}return ou({convexUrl:n,auth:Tj(r),tenant:e.tenant})}s(Ej,"resolveLocalCaller");function Tj(e){return{kind:"jwt",siteUrl:e,token:bT}}s(Tj,"localJwtAuth");function AT(e={}){let t=st();if(t)return{env:t.environment,source:"env",convexUrl:t.caller.convexUrl,siteUrl:t.siteUrl,tenant:t.caller.tenant,authMode:"token",fromEnvVars:[]};let n=uu(Xi,e),r=s(i=>{try{return i()}catch(o){return`(unavailable: ${o.message})`}},"safe");if(n.env==="local"){let i;try{i=fu()}catch{i=void 0}return{env:n.env,source:n.source,convexUrl:r(()=>Oa(n)),siteUrl:r(()=>xT(n,()=>i??fu())),tenant:n.tenant,authMode:"local-bootstrap",fromEnvVars:n.fromEnvVars,...i===void 0?{}:{deployment:kT(H.join(i,".env.local"),"CONVEX_DEPLOYMENT")?.replace(/^anonymous:/,"")}}}return{env:n.env,source:n.source,convexUrl:r(()=>Oa(n)),siteUrl:r(()=>vT(n)),tenant:n.tenant,authMode:"token",fromEnvVars:n.fromEnvVars}}s(AT,"describeConnection");var $j={"applications discard-test":"write","applications staff-input set":"write","applications start-test":"write","audit access":"write","branding clear-font":"write","branding clear-logo":"write","branding set-font":"write","branding set-logo":"write","branding set-theme":"write","setup export":"write","setup apply":"write","catalog apply":"write","contract grant add":"write","contract grant add-aggregate":"write","contract grant end":"write","contract grant replace":"write","demo link create":"write","feedback assign":"write","feedback create":"write","feedback link":"write","feedback reassign":"write","feedback reply":"write","feedback set-deadline":"write","feedback set-status":"write","feedback sync":"write","feedback tag":"write","feedback tags create":"write","feedback tags set":"write","feedback to-issue":"write","feedback unlink":"write","feedback untag":"write","files put":"write","notifications chrome set":"write","notifications letters reset":"write","notifications letters set":"write","notifications retry":"write","notifications self-test":"write","offer apply":"write","offer archive":"write","offer capacity set":"write","offer create":"write","offer level add":"write","offer level move":"write","offer level archive":"write","offer level restore":"write","offer level set":"write","offer restore":"write","offer run add":"write","offer run archive":"write","offer run restore":"write","offer run set":"write","offer set":"write","offer unit create":"write","offer unit ensure-pedagogy":"write","org legal-entity create":"write","org legal-entity set":"write","org unit create":"write","org unit set":"write","generator archive":"write","generator scope":"write","generator input-key apply":"write","generator input-key create":"write","generator input-key deprecate":"write","generator package apply":"write","generator package archive":"write","generator package clone":"write","generator package create":"write","generator package seal":"write","generator clone":"write","generator create":"write","generator seal":"write","generator save":"write","generator setup apply":"write","generator source save":"write","generator scenarios approve":"write","signing connection activate":"write","signing connection reseal":"write","signing connection set":"write","signing connection test":"write","signing reconcile":"write","signing resend":"write","signing start":"write","stripe allow":"write","stripe refresh":"write","test-actions run":"write","tokens create":"write","users create":"write","users grant":"write","users provision":"write","users relink-auth":"write","users set-group":"write","users set-password":"write","users set-platform-admin":"write","users set-platform-permission":"write","users unset-group":"write","work-items assign":"write","work-items complete":"write","work-items create":"write","workers reap":"write","config apply":"confirm","config prune-offers":"confirm","config set":"confirm","config wipe":"confirm","demo link delete":"confirm","demo link revoke":"confirm","feedback tags delete":"confirm","files delete":"confirm","generator delete-draft":"confirm","generator package delete-draft":"confirm","imports trigger":"confirm","imports trigger-all":"confirm","jobs cancel":"confirm","offer delete":"confirm","org legal-entity delete":"confirm","org unit delete":"confirm","imports cleanup-orphaned":"confirm","org delete-subtree":"confirm","persons purge":"confirm","retention apply":"confirm","retention parties apply":"confirm","signing connection delete":"confirm","signing void":"confirm","tokens revoke":"confirm","users deactivate":"confirm","users grant-all":"confirm","users groups delete":"confirm","users revoke":"confirm","users set-email":"confirm",call:"callKind","accounts email-changes":"read","admission runs list":"read","applications counts":"read","applications list":"read","applications show":"read","applications staff-input list":"read","applications store":"read","branding show":"read","catalog export":"read","catalog plan":"read","config export":"read","setup plan":"read","setup list":"read","setup diff":"read","config targets":"read","demo link list":"read","demo link stats":"read","demo videos":"read","feedback admins":"read","feedback comments":"read","feedback links":"read","feedback list":"read","feedback screenshot":"read","feedback tags list":"read","files list":"read","imports status":"read","jobs list":"read","jobs logs":"read","jobs show":"read","leads list":"read","notifications chrome show":"read","notifications letters list":"read","notifications letters show":"read","notifications list":"read","notifications show":"read","notifications sweeper-status":"read","offer diff":"read","offer export":"read","offer list":"read","offer plan":"read","offer show":"read","offer status":"read","offer versions":"read","offer workflow restamp-pins":"read","org tree":"read","platform users":"read","platform workers":"read","persons list":"read","generator input-key list":"read","generator input-key plan":"read","generator list":"read","generator package list":"read","generator package plan":"read","generator package show":"read","generator package test":"read","generator setup plan":"read","generator show":"read","generator source export":"read","generator scenarios test":"read","retention plan":"read","retention parties plan":"read","signing connection show":"read","signing status":"read","signing list":"read","signing show":"read","stripe status":"read",tenants:"read","test-actions list":"read","tokens list":"read","users doctor":"read","users groups":"read","users list":"read","users login-trail":"read","users show":"read",whoami:"read","work-items list":"read","work-items show":"read","workers logs":"read","workers reaper-status":"read","agent tools":"read","assignment simulate":"read","config show":"read",describe:"read",functions:"read","offer form list":"read","offer form show":"read","offer role list":"read","offer validate":"read","offer workflow channels list":"read","offer workflow node list":"read","offer workflow node reads":"read","offer workflow show":"read","offer workflow staff-input list":"read","agent invoke":"local-write","config init":"local-write","config legal-entity add":"local-write","config unit add":"local-write","offer form add":"local-write","offer form delete":"local-write","offer form computed delete":"local-write","offer form computed add":"local-write","offer form computed set":"local-write","offer form effect add":"local-write","offer form effect delete":"local-write","offer form effect set":"local-write","offer form env set":"local-write","offer form field add":"local-write","offer form field attach":"local-write","offer form field delete":"local-write","offer form field detach":"local-write","offer form field export":"local-write","offer form field move":"local-write","offer form field set":"local-write","offer form outcome add":"local-write","offer form outcome delete":"local-write","offer form outcome set":"local-write","offer form repeated add":"local-write","offer form repeated delete":"local-write","offer form repeated set":"local-write","offer form scenario add":"local-write","offer form scenario delete":"local-write","offer form scenario set":"local-write","offer form section add":"local-write","offer form section delete":"local-write","offer form section move":"local-write","offer form section set":"local-write","offer form set":"local-write","offer init":"local-write","offer service add":"local-write","offer service delete":"local-write","offer manifest set":"local-write","offer role add":"local-write","offer role delete":"local-write","offer role set":"local-write","offer workflow channels add":"local-write","offer workflow channels delete":"local-write","offer workflow node add":"local-write","offer workflow node add-reads":"local-write","offer workflow node add-requires":"local-write","offer workflow node clear-notification":"local-write","offer workflow node delete":"local-write","offer workflow node optional-action delete":"local-write","offer workflow node optional-action set":"local-write","offer workflow node remove-reads":"local-write","offer workflow node remove-requires":"local-write","offer workflow node set":"local-write","offer workflow node set-cockpit-fields":"local-write","offer workflow node set-engage":"local-write","offer workflow node set-generator":"local-write","offer workflow node set-input":"local-write","offer workflow node set-notification":"local-write","offer workflow node set-reads":"local-write","offer workflow node set-requires":"local-write","offer workflow node task add":"local-write","offer workflow node task delete":"local-write","offer workflow node task set":"local-write","offer workflow restamp-exports":"local-write","offer workflow staff-input delete":"local-write","offer workflow staff-input set":"local-write",seed:"write"},_a={"admission laeufe":"admission runs list","feedback deadline":"feedback set-deadline","feedback tags recolor":"feedback tags set","feedback tags rename":"feedback tags set","feedback tags visibility":"feedback tags set","files remove":"files delete","files rm":"files delete","interessenten list":"leads list","offer form computed rm":"offer form computed delete","offer form effect rm":"offer form effect delete","offer form field rm":"offer form field delete","offer form outcome rm":"offer form outcome delete","offer form repeated rm":"offer form repeated delete","offer form rm":"offer form delete","offer form scenario rm":"offer form scenario delete","offer form section rm":"offer form section delete","offer hard-delete":"offer delete","offer leistung add":"offer service add","offer leistung rm":"offer service delete","offer level remove":"offer level archive","offer level rename":"offer level set","offer role rm":"offer role delete","offer unit delete":"org unit delete","offer workflow channels remove":"offer workflow channels delete","offer workflow channels rm":"offer workflow channels delete","offer workflow node optional-action remove":"offer workflow node optional-action delete","offer workflow node optional-action rm":"offer workflow node optional-action delete","offer workflow node rm":"offer workflow node delete","offer workflow node task remove":"offer workflow node task delete","offer workflow node task rm":"offer workflow node task delete","offer workflow staff-input remove":"offer workflow staff-input delete","offer workflow staff-input rm":"offer workflow staff-input delete","org legal-entity update":"org legal-entity set","org unit update":"org unit set","platform tenants":"tenants","signing connection remove":"signing connection delete","stammdaten persons":"persons list","stammdaten persons purge":"persons purge",units:"org tree","users add":"users grant","users delete":"users deactivate","users provision-platform-admin":"users provision","users provision-platform-user":"users provision","users remove":"users revoke"};function Na(e){return _a[e]??e}s(Na,"canonicalVerb");var Mh={retiredYes:"--yes",retiredExecute:"--execute"};function Ca(e){let t=e;return t.confirm===!0||Object.keys(Mh).some(n=>t[n]===!0)}s(Ca,"confirmGiven");var ET={seed:"Requires the local RDU stack and deployment admin access.","feedback to-issue":"Requires the operator's locally authenticated GitHub CLI.","feedback sync":"Requires the operator's locally authenticated GitHub CLI.","imports trigger":"Reads import-provider credentials from the local environment.","agent invoke":"Tool transport entrypoint; nested transports are not executable commands."};function eo(e){let t=$j[Na(e)];if(t===void 0)throw new Re(`plexus: "${e}" is not classified in plexus/writeVerbs.ts \u2014 add it as read|write|confirm|callKind|local-write.`);return t}s(eo,"commandEffect");function mu(e,t){switch(eo(e)){case"read":case"local-write":return!1;case"write":return!0;case"confirm":return t.confirm===!0;case"callKind":if(t.callKind===void 0)throw new Re(`plexus: "${e}" resolved no call kind before connecting.`);return t.callKind!=="query"}}s(mu,"runWrites");var pu=s(()=>!0,"always"),TT={"config targets":[{fn:"config/api:targets",why:"lists the config targets through an action",when:pu}],"setup plan":[{fn:"setupExport:platformPlanPart",why:"previews the restore server-side (every part as a dry run)",when:pu},{fn:"setupExport:platformPlanPlatformPart",why:"previews the platform restore server-side (a dry run)",when:pu}]},$T={"config apply":[{fn:"config/api:apply",why:"previews the apply server-side",when:s(e=>e.confirm===!1,"when")},{fn:"config/api:applyPlatform",why:"previews the platform apply",when:s(e=>e.confirm===!1,"when")}],"config set":[{fn:"config/api:setField",why:"previews the change",when:s(e=>e.confirm===!1,"when")}],"config wipe":[{fn:"config/api:wipePreview",why:"counts what a wipe would remove",when:pu}],"config prune-offers":[{fn:"config/api:pruneOffers",why:"lists what would be pruned",when:s(e=>e.commit===!1,"when")}],"imports cleanup-orphaned":[{fn:"imports:failOrphanedRuns",why:"lists the orphaned runs",when:s(e=>e.confirm===!1,"when")}],"persons purge":[{fn:"parties:purgeDeletedParty",why:"plans the purge",when:s(e=>e.dryRun===!0,"when")}],"users set-email":[{fn:"platformAdmin:setUserEmail",why:"plans the change",when:s(e=>e.dryRun===!0,"when")}]};function RT(e,t,n=[]){let r=s(i=>(o,a)=>{let l=Zn(o),d=n.find(c=>c.fn===l);if(d===void 0||!d.when(a??{}))throw new Re(`plexus: "${t}" does not write in this run (plexus/writeVerbs.ts) but called the ${i} ${l}`+(d===void 0?"":" without its dry-run argument")+" \u2014 refused before sending. Classify the command as a write, or declare the call in ACTION_READS / DRY_RUN_CALLS.");return e[i](o,a)},"gate");return new Proxy(e,{get(i,o,a){return o==="mutation"?r("mutation"):o==="action"?r("action"):Reflect.get(i,o,a)}})}s(RT,"guardedCaller");function dt(e,t,n){e.write(`plexus-cli: \`${t}\` is deprecated \u2014 use \`${n}\`.
126
+ `)[0]}).`,{cause:c})}if(!cu(r))throw new Re(`config ${t}: expected a mapping with the top-level key "${n.yamlKey}".`);let i=Object.keys(r).filter(c=>c!==n.yamlKey);if(i.length>0)throw new Re(`config ${t}: unknown top-level key(s) ${i.map(c=>`"${c}"`).join(", ")} \u2014 only "${n.yamlKey}" is allowed.`);let o=r[n.yamlKey];if(!cu(o))throw new Re(`config ${t}: "${n.yamlKey}" must be a mapping.`);let a=Object.keys(o).filter(c=>!uT.includes(c));if(a.length>0)throw new Re(`config ${t}: unknown key(s) ${a.map(c=>`"${n.yamlKey}.${c}"`).join(", ")} \u2014 allowed: ${uT.join(", ")}.`);let l={environments:{}};o.default_env!==void 0&&(l.default_env=Nh(o.default_env,`${n.yamlKey}.default_env`,t)),o.default_tenant!==void 0&&(l.default_tenant=Nh(o.default_tenant,`${n.yamlKey}.default_tenant`,t));let d=o.environments??{};if(!cu(d))throw new Re(`config ${t}: ${n.yamlKey}.environments must be a mapping.`);for(let[c,u]of Object.entries(d)){let f=`${n.yamlKey}.environments.${c}`,m=u??{};if(!cu(m))throw new Re(`config ${t}: ${f} must be a mapping.`);let g=Object.keys(m).filter(y=>!_h.includes(y));if(g.length>0)throw new Re(`config ${t}: unknown key(s) ${g.map(y=>`"${f}.${y}"`).join(", ")} \u2014 allowed: ${_h.join(", ")}.`);let b={};for(let y of _h){if(m[y]===void 0||m[y]===null)continue;let v=Nh(m[y],`${f}.${y}`,t);if(gj.has(y)&&!wj(v))throw new Re(`config ${t}: ${f}.${y} must be an http(s) URL.`);b[y]=v}l.environments[c]=b}return l}s(yj,"parseConfigFile");function wj(e){try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"}catch{return!1}}s(wj,"isHttpUrl");function pT(e){let t=fT(e);return Oe(t)?{file:t,section:yj(ke(t,"utf8"),t,e)}:null}s(pT,"readConfigFile");function uu(e,t={}){let n=e.envPrefix,r=[],i=s(g=>{let b=process.env[`${n}_${g}`];if(!(b===void 0||b===""))return r.push(`${n}_${g}`),b},"fromEnv"),o=pT(e),a=o?.section,l=t.env??i("ENV")??a?.default_env??e.defaultEnv,d={};if(o!==null&&a!==void 0){let g=a.environments[l];if(g===void 0&&l!=="local"){let b=Object.keys(a.environments).join(", ")||"(none)";throw new Re(`${e.name}: unknown environment "${l}" in ${o.file}. Available: ${b}.`)}d=g??{}}let c=i("CONVEX_URL")??d.convex_url,u=i("SITE_URL")??d.site_url,f=i("TOKEN")??d.token,m=t.tenant??i("TENANT")??a?.default_tenant;return{env:l,...c!==void 0?{convexUrl:c}:{},...u!==void 0?{siteUrl:u}:{},...f!==void 0?{token:f}:{},...m!==void 0?{tenant:m}:{},source:o===null?"env":"yaml",fromEnvVars:r}}s(uu,"loadEnvConfig");function Ch(e){try{let t=new URL(e.trim());return t.hostname=t.hostname.replace(/\.$/,""),t.origin.toLowerCase()}catch{return e.trim().toLowerCase().replace(/\/+$/,"")}}s(Ch,"normalizeUrl");function mT(e){let t=Ch,n=new Set,r=pT(e);if(r!==null){let o=r.section.environments.prod;if(!o?.convex_url)throw new Error(`${e.name}: ${r.file} names no environments.prod.convex_url \u2014 a write cannot tell whether its target is production. Add the prod entry.`);return n.add(t(o.convex_url)),n}let i=e.envPrefix;if(process.env[`${i}_ENV`]==="prod"&&process.env[`${i}_CONVEX_URL`])return n.add(t(process.env[`${i}_CONVEX_URL`])),n;throw new Error(`${e.name}: no ${fT(e)} \u2014 a write cannot tell whether its target is production. Create the file with an environments.prod entry.`)}s(mT,"knownProdConvexUrls");import{lookup as bj}from"node:dns/promises";import{isIP as hT}from"node:net";import{networkInterfaces as kj}from"node:os";function gT(e,t){if(e===void 0)throw new Re(`${t} writes \u2014 name the environment with --env local|staging|prod (the configured default is not enough).`)}s(gT,"requireExplicitEnv");function Fh(e,t){return e.env==="prod"?!0:e.convexUrl!==void 0&&t.has(Ch(e.convexUrl))}s(Fh,"isProdTarget");function yT(e,t,n,r){let i=Fh(e,t);if(i&&!n)throw new Re(`${r} writes to PRODUCTION (env "${e.env}" \u2192 ${e.convexUrl??"?"}) \u2014 add --allow-prod if that is really meant.`);if(!i&&n)throw new Re(`${r}: --allow-prod is only for a production target (env "${e.env}" is not one).`)}s(yT,"assertProdAllowed");var vj={async lookup(e){return(await bj(e,{all:!0,verbatim:!0})).map(t=>t.address)},ownAddresses(){let e=new Set;for(let t of Object.values(kj()))for(let n of t??[])e.add(Dh(n.address));return e}};function Dh(e){let t=e.toLowerCase().replace(/%.*$/,"").replace(/^\[|\]$/g,""),n=/^::ffff:(\d+\.\d+\.\d+\.\d+)$/.exec(t);if(n?.[1]!==void 0)return n[1];let r=/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/.exec(t);if(r?.[1]!==void 0&&r[2]!==void 0){let i=parseInt(r[1],16),o=parseInt(r[2],16);return`${i>>8}.${i&255}.${o>>8}.${o&255}`}return t}s(Dh,"normalizeAddress");function xj(e){return e==="::1"||hT(e)===4&&e.startsWith("127.")}s(xj,"isLoopbackAddress");async function Lh(e,t=vj){let n;try{n=new URL(e).hostname}catch{throw new Re(`plexus: env "local" resolved "${e}", which is not a URL \u2014 refusing the local bootstrap.`)}let r=Dh(n),i;try{i=hT(r)!==0?[r]:(await t.lookup(n)).map(Dh)}catch(l){throw new Re(`plexus: env "local" points at ${e}, whose host does not resolve (${l.message}) \u2014 refusing the local bootstrap.`,{cause:l})}let o=t.ownAddresses(),a=i.filter(l=>!xj(l)&&!o.has(l));if(i.length===0||a.length>0)throw new Re(`plexus: env "local" points at ${e} (${a.join(", ")||"no address"}), which is not this machine \u2014 the local admin-key bootstrap runs only against this machine. Use --env staging|prod (with a token) for a remote deployment, or unset PLEXUS_CONVEX_URL.`)}s(Lh,"requireThisMachineForLocalBootstrap");var Xi={name:"plexus",configFile:"plexus.yml",yamlKey:"plexus",envPrefix:"PLEXUS",jwtCachePrefix:"plexus-jwt",defaultEnv:"local"};var Ia=H.resolve(import.meta.dirname,"..","..",".."),Sj="admin@plexus.swop.schule",Aj="plexus-cli (local dev)",bT="plx_configcli_local_0001";function kT(e,t){return Oe(e)?ke(e,"utf8").match(new RegExp(`^${t}=(.+)$`,"m"))?.[1]?.trim():void 0}s(kT,"readEnvValue");var wT="PLEXUS_LOCAL_INSTALL_ROOT";function fu(e=process.cwd()){let t=e;for(let n=0;n<12;n+=1){for(let i of[t,H.join(t,"app")])if(Oe(H.join(i,".env.local"))&&Oe(H.join(i,"convex")))return i;let r=H.dirname(t);if(r===t)break;t=r}if(process.env[wT]==="1")return Ia;throw new Re(`plexus: --env local follows the worktree you stand in, but ${e} is not inside a started one (no app/.env.local next to app/convex). cd into the worktree and run \`pnpm dev\` there, or set ${wT}=1 to use this install's own checkout (${Ia}).`)}s(fu,"resolveLocalAppRoot");function vT(e){if(e.siteUrl)return e.siteUrl;throw new Re(`plexus: env "${e.env}" has no site_url (needed for /cli/token). Set it in plexus.yml (environments.`+e.env+".site_url) or $PLEXUS_SITE_URL.")}s(vT,"resolveRemoteSiteUrl");function xT(e,t){if(e.siteUrl)return e.siteUrl;for(let n of[".env.local",".env.development.local"]){let r=kT(H.join(t(),n),"VITE_CONVEX_SITE_URL");if(r)return r}throw new Error("plexus: could not resolve the local Convex SITE url (for /cli/token). Start local dev with `pnpm dev` (rdu) in this worktree, then retry.")}s(xT,"resolveLocalSiteUrl");function Oa(e){if(e.convexUrl)return e.convexUrl;if(e.env==="local")return kE({cwd:fu()});throw new Re(`plexus: env "${e.env}" has no convex_url. Set it in plexus.yml (environments.${e.env}.convex_url) or $PLEXUS_CONVEX_URL.`)}s(Oa,"resolveTargetConvexUrl");function ST(e){let t=uu(Xi,e);return{env:t.env,convexUrl:Oa(t)}}s(ST,"resolveWriteTarget");async function Pa(e={}){let t=st();if(t){if(e.env!==void 0&&e.env!==t.environment||e.tenant!==void 0&&e.tenant!==t.caller.tenant)throw new Error("plexus: a platform chat cannot switch its environment or tenant.");return t.caller}let n=uu(Xi,e);if(n.env==="local")return Ej(n);if(!n.token)throw new Re(`plexus: env "${n.env}" needs an API token. Mint one in the app under Settings \u2192 API-Token and set it in plexus.yml (token) or $PLEXUS_TOKEN.`);let r=Oa(n),i={kind:"jwt",siteUrl:vT(n),token:n.token,cacheKey:aE(Xi.jwtCachePrefix,n.env,r,n.token)};return ou({convexUrl:r,auth:i,tenant:n.tenant})}s(Pa,"resolveCaller");async function Ej(e){let t=fu(),n=Oa(e);await Lh(n);let r=xT(e,()=>t);await Lh(r);{let i=vE({cwd:t}),o=await ou({convexUrl:n,auth:{kind:"admin",adminKey:i}}),a=xa("apiTokens:devSeedToken"),l={email:Sj,name:Aj,plaintext:bT};await o.mutation(a,l)}return ou({convexUrl:n,auth:Tj(r),tenant:e.tenant})}s(Ej,"resolveLocalCaller");function Tj(e){return{kind:"jwt",siteUrl:e,token:bT}}s(Tj,"localJwtAuth");function AT(e={}){let t=st();if(t)return{env:t.environment,source:"env",convexUrl:t.caller.convexUrl,siteUrl:t.siteUrl,tenant:t.caller.tenant,authMode:"token",fromEnvVars:[]};let n=uu(Xi,e),r=s(i=>{try{return i()}catch(o){return`(unavailable: ${o.message})`}},"safe");if(n.env==="local"){let i;try{i=fu()}catch{i=void 0}return{env:n.env,source:n.source,convexUrl:r(()=>Oa(n)),siteUrl:r(()=>xT(n,()=>i??fu())),tenant:n.tenant,authMode:"local-bootstrap",fromEnvVars:n.fromEnvVars,...i===void 0?{}:{deployment:kT(H.join(i,".env.local"),"CONVEX_DEPLOYMENT")?.replace(/^anonymous:/,"")}}}return{env:n.env,source:n.source,convexUrl:r(()=>Oa(n)),siteUrl:r(()=>vT(n)),tenant:n.tenant,authMode:"token",fromEnvVars:n.fromEnvVars}}s(AT,"describeConnection");var $j={"applications discard-test":"write","applications staff-input set":"write","applications start-test":"write","audit access":"write","branding clear-font":"write","branding clear-logo":"write","branding set-font":"write","branding set-logo":"write","branding set-theme":"write","setup export":"write","setup apply":"write","catalog apply":"write","contract grant add":"write","contract grant add-aggregate":"write","contract grant end":"write","contract grant replace":"write","demo link create":"write","feedback assign":"write","feedback create":"write","feedback link":"write","feedback reassign":"write","feedback reply":"write","feedback set-deadline":"write","feedback set-status":"write","feedback sync":"write","feedback tag":"write","feedback tags create":"write","feedback tags set":"write","feedback to-issue":"write","feedback unlink":"write","feedback untag":"write","files put":"write","notifications chrome set":"write","notifications letters reset":"write","notifications letters set":"write","notifications retry":"write","notifications self-test":"write","offer apply":"write","offer archive":"write","offer capacity set":"write","offer create":"write","offer level add":"write","offer level move":"write","offer level archive":"write","offer level restore":"write","offer level set":"write","offer restore":"write","offer run add":"write","offer run archive":"write","offer run restore":"write","offer run set":"write","offer set":"write","offer unit create":"write","offer unit ensure-pedagogy":"write","org legal-entity create":"write","org legal-entity set":"write","org unit create":"write","org unit set":"write","generator archive":"write","generator scope":"write","generator input-key apply":"write","generator input-key create":"write","generator input-key deprecate":"write","generator package apply":"write","generator package archive":"write","generator package clone":"write","generator package create":"write","generator package seal":"write","generator clone":"write","generator create":"write","generator seal":"write","generator save":"write","generator setup apply":"write","generator source save":"write","generator scenarios approve":"write","signing connection activate":"write","signing connection reseal":"write","signing connection set":"write","signing connection test":"write","signing reconcile":"write","signing resend":"write","signing start":"write","stripe allow":"write","stripe refresh":"write","test-actions run":"write","tokens create":"write","users create":"write","users grant":"write","users provision":"write","users relink-auth":"write","users set-group":"write","users set-password":"write","users set-platform-admin":"write","users set-platform-permission":"write","users unset-group":"write","work-items assign":"write","work-items complete":"write","work-items create":"write","workers reap":"write","config apply":"confirm","config prune-offers":"confirm","config set":"confirm","config wipe":"confirm","demo link delete":"confirm","demo link revoke":"confirm","feedback tags delete":"confirm","files delete":"confirm","generator delete-draft":"confirm","generator package delete-draft":"confirm","imports trigger":"confirm","imports trigger-all":"confirm","jobs cancel":"confirm","offer delete":"confirm","org legal-entity delete":"confirm","org unit delete":"confirm","imports cleanup-orphaned":"confirm","org delete-subtree":"confirm","persons purge":"confirm","retention apply":"confirm","retention parties apply":"confirm","signing connection delete":"confirm","signing void":"confirm","tokens revoke":"confirm","users archive":"confirm","users grant-all":"confirm","users groups delete":"confirm","users revoke":"confirm","users set-email":"confirm",call:"callKind","accounts email-changes":"read","admission runs list":"read","applications counts":"read","applications list":"read","applications show":"read","applications staff-input list":"read","applications store":"read","branding show":"read","catalog export":"read","catalog plan":"read","config export":"read","setup plan":"read","setup list":"read","setup diff":"read","config targets":"read","demo link list":"read","demo link stats":"read","demo videos":"read","feedback admins":"read","feedback comments":"read","feedback links":"read","feedback list":"read","feedback screenshot":"read","feedback tags list":"read","files list":"read","imports status":"read","jobs list":"read","jobs logs":"read","jobs show":"read","leads list":"read","notifications chrome show":"read","notifications letters list":"read","notifications letters show":"read","notifications list":"read","notifications show":"read","notifications sweeper-status":"read","offer diff":"read","offer export":"read","offer list":"read","offer plan":"read","offer show":"read","offer status":"read","offer versions":"read","offer workflow restamp-pins":"read","org tree":"read","platform users":"read","platform workers":"read","persons list":"read","generator input-key list":"read","generator input-key plan":"read","generator list":"read","generator package list":"read","generator package plan":"read","generator package show":"read","generator package test":"read","generator setup plan":"read","generator show":"read","generator source export":"read","generator scenarios test":"read","retention plan":"read","retention parties plan":"read","signing connection show":"read","signing status":"read","signing list":"read","signing show":"read","stripe status":"read",tenants:"read","test-actions list":"read","tokens list":"read","users doctor":"read","users groups":"read","users list":"read","users login-trail":"read","users show":"read",whoami:"read","work-items list":"read","work-items show":"read","workers logs":"read","workers reaper-status":"read","agent tools":"read","assignment simulate":"read","config show":"read",describe:"read",functions:"read","offer form list":"read","offer form show":"read","offer role list":"read","offer validate":"read","offer workflow channels list":"read","offer workflow node list":"read","offer workflow node reads":"read","offer workflow show":"read","offer workflow staff-input list":"read","agent invoke":"local-write","config init":"local-write","config legal-entity add":"local-write","config unit add":"local-write","offer form add":"local-write","offer form delete":"local-write","offer form computed delete":"local-write","offer form computed add":"local-write","offer form computed set":"local-write","offer form effect add":"local-write","offer form effect delete":"local-write","offer form effect set":"local-write","offer form env set":"local-write","offer form field add":"local-write","offer form field attach":"local-write","offer form field delete":"local-write","offer form field detach":"local-write","offer form field export":"local-write","offer form field move":"local-write","offer form field set":"local-write","offer form outcome add":"local-write","offer form outcome delete":"local-write","offer form outcome set":"local-write","offer form repeated add":"local-write","offer form repeated delete":"local-write","offer form repeated set":"local-write","offer form scenario add":"local-write","offer form scenario delete":"local-write","offer form scenario set":"local-write","offer form section add":"local-write","offer form section delete":"local-write","offer form section move":"local-write","offer form section set":"local-write","offer form set":"local-write","offer init":"local-write","offer service add":"local-write","offer service delete":"local-write","offer manifest set":"local-write","offer role add":"local-write","offer role delete":"local-write","offer role set":"local-write","offer workflow channels add":"local-write","offer workflow channels delete":"local-write","offer workflow node add":"local-write","offer workflow node add-reads":"local-write","offer workflow node add-requires":"local-write","offer workflow node clear-notification":"local-write","offer workflow node delete":"local-write","offer workflow node optional-action delete":"local-write","offer workflow node optional-action set":"local-write","offer workflow node remove-reads":"local-write","offer workflow node remove-requires":"local-write","offer workflow node set":"local-write","offer workflow node set-cockpit-fields":"local-write","offer workflow node set-engage":"local-write","offer workflow node set-generator":"local-write","offer workflow node set-input":"local-write","offer workflow node set-notification":"local-write","offer workflow node set-reads":"local-write","offer workflow node set-requires":"local-write","offer workflow node task add":"local-write","offer workflow node task delete":"local-write","offer workflow node task set":"local-write","offer workflow restamp-exports":"local-write","offer workflow staff-input delete":"local-write","offer workflow staff-input set":"local-write",seed:"write"},_a={"admission laeufe":"admission runs list","feedback deadline":"feedback set-deadline","feedback tags recolor":"feedback tags set","feedback tags rename":"feedback tags set","feedback tags visibility":"feedback tags set","files remove":"files delete","files rm":"files delete","interessenten list":"leads list","offer form computed rm":"offer form computed delete","offer form effect rm":"offer form effect delete","offer form field rm":"offer form field delete","offer form outcome rm":"offer form outcome delete","offer form repeated rm":"offer form repeated delete","offer form rm":"offer form delete","offer form scenario rm":"offer form scenario delete","offer form section rm":"offer form section delete","offer hard-delete":"offer delete","offer leistung add":"offer service add","offer leistung rm":"offer service delete","offer level remove":"offer level archive","offer level rename":"offer level set","offer role rm":"offer role delete","offer unit delete":"org unit delete","offer workflow channels remove":"offer workflow channels delete","offer workflow channels rm":"offer workflow channels delete","offer workflow node optional-action remove":"offer workflow node optional-action delete","offer workflow node optional-action rm":"offer workflow node optional-action delete","offer workflow node rm":"offer workflow node delete","offer workflow node task remove":"offer workflow node task delete","offer workflow node task rm":"offer workflow node task delete","offer workflow staff-input remove":"offer workflow staff-input delete","offer workflow staff-input rm":"offer workflow staff-input delete","org legal-entity update":"org legal-entity set","org unit update":"org unit set","platform tenants":"tenants","signing connection remove":"signing connection delete","stammdaten persons":"persons list","stammdaten persons purge":"persons purge",units:"org tree","users add":"users grant","users deactivate":"users archive","users delete":"users archive","users provision-platform-admin":"users provision","users provision-platform-user":"users provision","users remove":"users revoke"};function Na(e){return _a[e]??e}s(Na,"canonicalVerb");var Mh={retiredYes:"--yes",retiredExecute:"--execute"};function Ca(e){let t=e;return t.confirm===!0||Object.keys(Mh).some(n=>t[n]===!0)}s(Ca,"confirmGiven");var ET={seed:"Requires the local RDU stack and deployment admin access.","feedback to-issue":"Requires the operator's locally authenticated GitHub CLI.","feedback sync":"Requires the operator's locally authenticated GitHub CLI.","imports trigger":"Reads import-provider credentials from the local environment.","agent invoke":"Tool transport entrypoint; nested transports are not executable commands."};function eo(e){let t=$j[Na(e)];if(t===void 0)throw new Re(`plexus: "${e}" is not classified in plexus/writeVerbs.ts \u2014 add it as read|write|confirm|callKind|local-write.`);return t}s(eo,"commandEffect");function mu(e,t){switch(eo(e)){case"read":case"local-write":return!1;case"write":return!0;case"confirm":return t.confirm===!0;case"callKind":if(t.callKind===void 0)throw new Re(`plexus: "${e}" resolved no call kind before connecting.`);return t.callKind!=="query"}}s(mu,"runWrites");var pu=s(()=>!0,"always"),TT={"config targets":[{fn:"config/api:targets",why:"lists the config targets through an action",when:pu}],"setup plan":[{fn:"setupExport:platformPlanPart",why:"previews the restore server-side (every part as a dry run)",when:pu},{fn:"setupExport:platformPlanPlatformPart",why:"previews the platform restore server-side (a dry run)",when:pu}]},$T={"config apply":[{fn:"config/api:apply",why:"previews the apply server-side",when:s(e=>e.confirm===!1,"when")},{fn:"config/api:applyPlatform",why:"previews the platform apply",when:s(e=>e.confirm===!1,"when")}],"config set":[{fn:"config/api:setField",why:"previews the change",when:s(e=>e.confirm===!1,"when")}],"config wipe":[{fn:"config/api:wipePreview",why:"counts what a wipe would remove",when:pu}],"config prune-offers":[{fn:"config/api:pruneOffers",why:"lists what would be pruned",when:s(e=>e.commit===!1,"when")}],"imports cleanup-orphaned":[{fn:"imports:failOrphanedRuns",why:"lists the orphaned runs",when:s(e=>e.confirm===!1,"when")}],"persons purge":[{fn:"parties:purgeDeletedParty",why:"plans the purge",when:s(e=>e.dryRun===!0,"when")}],"users set-email":[{fn:"platformAdmin:setUserEmail",why:"plans the change",when:s(e=>e.dryRun===!0,"when")}]};function RT(e,t,n=[]){let r=s(i=>(o,a)=>{let l=Zn(o),d=n.find(c=>c.fn===l);if(d===void 0||!d.when(a??{}))throw new Re(`plexus: "${t}" does not write in this run (plexus/writeVerbs.ts) but called the ${i} ${l}`+(d===void 0?"":" without its dry-run argument")+" \u2014 refused before sending. Classify the command as a write, or declare the call in ACTION_READS / DRY_RUN_CALLS.");return e[i](o,a)},"gate");return new Proxy(e,{get(i,o,a){return o==="mutation"?r("mutation"):o==="action"?r("action"):Reflect.get(i,o,a)}})}s(RT,"guardedCaller");function dt(e,t,n){e.write(`plexus-cli: \`${t}\` is deprecated \u2014 use \`${n}\`.
127
127
  `)}s(dt,"warnDeprecated");var pi=class extends Se{static{s(this,"OfflineMutationCommand")}warn(t){for(let n of t)this.context.stderr.write(`warning: [${n.area}] ${n.message}
128
128
  `)}},D=class extends Se{static{s(this,"ClientCommand")}env=p.String("--env",{description:"Target environment (local|staging|prod)"});tenant=p.String("--tenant",{description:"Tenant slug (overrides config default)"});allowProd=p.Boolean("--allow-prod",!1,{description:"Required for a writing run against production"});async caller(){let t=Na(this.path.join(" ")),n={env:this.env,tenant:this.tenant},r=this;if(Ca(this)&&r.confirm!==!0){let a=Object.entries(Mh).find(([l])=>this[l]===!0);a!==void 0&&dt(this.context.stderr,a[1],"--confirm"),r.confirm=!0}if(mu(t,{confirm:r.confirm,callKind:r.effectiveKind}))return gT(this.env,t),yT(this.resolvedTarget(),this.prodUrls(),this.allowProd,t),Pa(n);this.allowProd&&this.context.stderr.write(`note: ${t} does not write in this run \u2014 --allow-prod has no effect.
129
129
  `);let i=await Pa(n),o=eo(t)==="confirm"?$T[t]:TT[t];return RT(i,t,o??[])}async paginate(t,n,r,i={},o="--all"){let{rows:a,truncated:l}=await su(t,n,r,i);return l&&this.context.stderr.write(fE(a.length,o)),a}resolvedTarget(){let t=st();return t?{env:t.environment,convexUrl:t.caller.convexUrl}:ST({env:this.env,tenant:this.tenant})}prodUrls(){let t=st();return t?t.environment==="prod"?new Set([t.caller.convexUrl]):new Set:mT(Xi)}requireTenant(t){if(!t.tenant)throw new Error("plexus: no tenant \u2014 pass --tenant <slug> or set default_tenant in plexus.yml / PLEXUS_TENANT.");return t.tenant}};var S=tu,It=tu,Nee=oh();var qh=class extends D{static{s(this,"AdmissionRunsListCommand")}static paths=[["admission","runs","list"],["admission","laeufe"]];static usage=E.Usage({category:"Admission",description:"List Bewerbungsl\xE4ufe for the active tenant"});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.admission.listBewerbungslaeufe,{tenantSlug:n});return this.print(r),0}},IT=[qh];var Rj={stdin:"--secret-stdin",file:"--secret-file"};async function Kh(e){let t=[];for await(let n of e)t.push(typeof n=="string"?Buffer.from(n):n);return Buffer.concat(t).toString("utf8")}s(Kh,"readStream");var Qo=s(e=>({readStdin:s(()=>Kh(e),"readStdin"),readFile:s(t=>ke(t,"utf8"),"readFile")}),"defaultSecretReaders");async function Zo(e,t,n=Rj){if(e.stdin&&e.file!==void 0)throw new Error(`Give the secret through ${n.stdin} OR ${n.file}, not both.`);if(!e.stdin&&e.file===void 0)throw new Error(`No secret source: pass ${n.stdin} (pipe the value in) or ${n.file} <path>.`);let r;if(e.file!==void 0){let o=H.resolve(e.file);try{r=t.readFile(o)}catch{throw new Error(`Secret file not readable: ${o}`)}}else r=await t.readStdin();let i=r.replace(/\r?\n$/,"");if(i.trim()==="")throw new Error(`The secret from ${e.file!==void 0?n.file:"stdin"} is empty.`);return i}s(Zo,"readSecret");function hu(e,t,n){if(e!==void 0)throw new Re(`${t} is no longer accepted: a secret on the command line lands in shell history, \`ps\` and transcripts. ${n}`)}s(hu,"refuseSecretArgument");var Da={plexus:{description:"Run a Plexus CLI command as the current user. Pass argv, never a shell command. Use functions, describe, and --help to discover commands. For call, put every function argument in argv as key=value (JSON objects are one argv value); call does not read stdin. Read the Plexus skill before changing data. Writes require an explicit environment and a reviewed plan.",inputSchema:{type:"object",additionalProperties:!1,required:["argv"],properties:{argv:{type:"array",minItems:1,maxItems:128,items:{type:"string",maxLength:128e3}},stdin:{type:"string",maxLength:1e6}}}},plexus_skill:{description:"Read the Plexus skill or one of its references. Start with SKILL.md. References are loaded from the same bundle used by the installed Plexus CLI.",inputSchema:{type:"object",additionalProperties:!1,required:["path"],properties:{path:{type:"string",maxLength:240}}}},plexus_workspace:{description:"List, search, read, edit, write or remove files in the current private workspace. Use it to edit exported config and offer bundles before planning and applying the same files. Search locates text in large exports; read supports offset/maxChars; edit replaces one unique oldText with content and refuses ambiguous or stale text.",inputSchema:{type:"object",additionalProperties:!1,required:["operation"],properties:{operation:{type:"string",enum:["list","read","search","edit","write","remove"]},path:{type:"string",maxLength:500},content:{type:"string",maxLength:1e6},query:{type:"string",minLength:1,maxLength:1e3},oldText:{type:"string",minLength:1,maxLength:1e6},offset:{type:"integer",minimum:0},maxChars:{type:"integer",minimum:1,maximum:24e3}}}}};var OT={"SKILL.md":`---
@@ -3527,28 +3527,28 @@ Read the login-address change log (who changed whose login address)
3527
3527
  |---|---|
3528
3528
  | \`--user <value>\` | An address the account holds or held (data-subject request) |
3529
3529
 
3530
- ### \`users create <email>\`
3530
+ ### \`users archive <email>\`
3531
3531
 
3532
- Create a tenant-less identity WITH a login account from just an e-mail (optionally a platform admin). Idempotent: an existing user is left untouched \u2014 no password is rotated. To (re)set a ready-to-log-in account with a name, group or permission set, use \`users provision\`.
3532
+ Archive a user everywhere: archive every school access (groups removed, one history entry per school; a school's last user administrator is refused), end every platform right; the identity and its history stay \u2014 plan unless --confirm.
3533
3533
 
3534
- - **Effect:** write \u2014 needs \`--env\`; on production also \`--allow-prod\`
3534
+ - **Effect:** plan by default \u2014 writes only with \`--confirm\` (and \`--env\`; on production also \`--allow-prod\`)
3535
3535
 
3536
3536
  | Option | Description |
3537
3537
  |---|---|
3538
- | \`--out <value>\` | Append the \`email,password\` row to this CSV file (created with a header; never overwritten). |
3539
- | \`--quiet\` | Do not echo the password to stdout (needs --out). |
3540
- | \`--platform-admin\` | Make the new user a platform admin (full _platform.* set). |
3538
+ | \`--replace-with <value>\` | configKey of the staff member who takes over their active applications \u2014 required while they are responsible for any. A rule naming them refuses regardless: change it first (workflow editor: \u201EPerson ersetzen\u201C, then publish) |
3539
+ | \`--confirm\` | Archive (without it, only the plan is printed). |
3541
3540
 
3542
- ### \`users deactivate <email>\`
3541
+ ### \`users create <email>\`
3543
3542
 
3544
- Deactivate a user everywhere: revoke every tenant access, group membership and platform right; the identity and its history stay \u2014 plan unless --confirm.
3543
+ Create a tenant-less identity WITH a login account from just an e-mail (optionally a platform admin). Idempotent: an existing user is left untouched \u2014 no password is rotated. To (re)set a ready-to-log-in account with a name, group or permission set, use \`users provision\`.
3545
3544
 
3546
- - **Effect:** plan by default \u2014 writes only with \`--confirm\` (and \`--env\`; on production also \`--allow-prod\`)
3545
+ - **Effect:** write \u2014 needs \`--env\`; on production also \`--allow-prod\`
3547
3546
 
3548
3547
  | Option | Description |
3549
3548
  |---|---|
3550
- | \`--replace-with <value>\` | configKey of the staff member who takes over their active applications \u2014 required while they are responsible for any. A rule naming them refuses regardless: change it first (workflow editor: \u201EPerson ersetzen\u201C, then publish) |
3551
- | \`--confirm\` | Deactivate (without it, only the plan is printed). |
3549
+ | \`--out <value>\` | Append the \`email,password\` row to this CSV file (created with a header; never overwritten). |
3550
+ | \`--quiet\` | Do not echo the password to stdout (needs --out). |
3551
+ | \`--platform-admin\` | Make the new user a platform admin (full _platform.* set). |
3552
3552
 
3553
3553
  ### \`users doctor\`
3554
3554
 
@@ -3636,7 +3636,7 @@ Relink a user's identity row to its live Better Auth account (heals an orphan).
3636
3636
 
3637
3637
  ### \`users revoke <email>\`
3638
3638
 
3639
- Revoke a user's access to the active tenant (--tenant) \u2014 plan unless --confirm. Other tenants keep it; \`users deactivate\` revokes everywhere.
3639
+ Revoke a user's access to the active tenant (--tenant) \u2014 plan unless --confirm. Other tenants keep it; \`users archive\` archives everywhere.
3640
3640
 
3641
3641
  - **Effect:** plan by default \u2014 writes only with \`--confirm\` (and \`--env\`; on production also \`--allow-prod\`)
3642
3642
 
@@ -5770,7 +5770,7 @@ a fixed person.
5770
5770
  ## A staff member leaves
5771
5771
 
5772
5772
  A person a rule names \u2014 as a row's person or in a \u201EReihum" pool \u2014 cannot leave the staff (\`users revoke\`, \`users unset-group\`,
5773
- \`users deactivate\`), leave a team whose slot names them, and a team a rule has a slot
5773
+ \`users archive\`), leave a team whose slot names them, and a team a rule has a slot
5774
5774
  for cannot be deleted \u2014 refused (\`[CONFLICT] [assignment/ruleReferences] \u2026\`), naming offer
5775
5775
  (label + status), slot and row. The check reads every \`wip\` and published offer
5776
5776
  version (archived ones only run pinned test starts, which fail loud instead). Order:
@@ -9374,7 +9374,7 @@ plexus-cli --env prod jobs list --status running # nothing unexpectedly in
9374
9374
  ## Related
9375
9375
  - Command reference: \`plexus-cli jobs list --help\`, \`plexus-cli workers reap --help\`,
9376
9376
  \`plexus-cli imports cleanup-orphaned --help\`.
9377
- `};var gu="cb3c97259e64d88091913224a34bd4ff7df83cbc7a0ea8e88514b56a09dbf91d",jh=OT;var Bh=class extends Se{static{s(this,"AgentToolsCommand")}static paths=[["agent","tools"]];static usage=E.Usage({category:"Agents",description:"Show the shared platform/CLI agent tool schemas and skill revision."});async execute(){return this.print({skillHash:gu,tools:Da}),0}},Vh=class extends Se{static{s(this,"AgentInvokeCommand")}static paths=[["agent","invoke"]];static usage=E.Usage({category:"Agents",description:"Invoke a shared agent tool; pipe its JSON input on stdin."});tool=p.String("--tool",{required:!0,description:"plexus|plexus_skill|plexus_workspace"});async execute(){if("isTTY"in this.context.stdin&&this.context.stdin.isTTY===!0)throw new Error("plexus: pipe the tool's JSON input on stdin.");let t=JSON.parse(await Kh(this.context.stdin)),n=await this.context.executePlexusAgentTool(this.tool,t);return this.print(n),0}},PT=[Bh,Vh];var Uh=[{key:"fixture_test",email:"test@example.com",firstName:"Test",lastName:"Bewerber"}],nte=new Set(Uh.map(e=>e.key));function NT(e,t,n,r){let i=e.flatMap(l=>l.angebote).find(l=>l.offerKey===t);if(i===void 0){let l=e.flatMap(d=>d.angebote.map(c=>c.offerKey));throw new Error(`applications start-test: no offer "${t}" (offers: ${l.join(", ")||"none"})`)}let o=i.stages.find(l=>l.stageKey===r||l.stageId===r);if(o===void 0){let l=i.stages.map(d=>`${d.stageKey} (${d.stageId})`);throw new Error(`applications start-test: no level "${r}" in ${t} \u2014 name it by key or id: ${l.join(", ")}`)}let a=o.runs.find(l=>l.runKey===n||l.runId===n);if(a===void 0){let l=o.runs.map(d=>`${d.runKey} (${d.runId})`);throw new Error(`applications start-test: no school year "${n}" for level ${o.stageKey} \u2014 name it by key or id: ${l.join(", ")}`)}if(!a.isOpen)throw new Error(`applications start-test: school year ${a.runKey} is closed for level ${o.stageKey}`);return{programRunId:a.runId,programStageId:o.stageId}}s(NT,"resolveStartTarget");function Oj(e){return e.kind==="named"?e.name:`(${e.standIn??e.fallback})`}s(Oj,"applicantText");function CT(e){return e.map(t=>({id:t.application._id,status:t.deletedAt?`${t.application.status} (gel\xF6scht)`:t.application.status,state:t.currentProcessStateId??"",applicant:Oj(t.applicantName),test:t.application.testMode===!0?"test":""}))}s(CT,"applicationRows");var _T=Uh.map(e=>e.email);function DT(e,t,n,r){if(n===void 0&&r===void 0)throw new Error("applications start-test: name the applicant \u2014 --party <partyId> or --applicant <email>");if(n!==void 0&&r!==void 0)throw new Error("applications start-test: --party or --applicant, not both");if(Fh(e,t)&&(r===void 0||!_T.includes(r.trim().toLowerCase())))throw new Error(`applications start-test: on prod only for the test account ${_T.join(", ")} (--applicant) \u2014 never a real family's`)}s(DT,"assertStartApplicant");function FT(e){let t={};for(let{address:n,...r}of e.entries)t[n]=r;return{applicationId:e.applicationId,store:t}}s(FT,"processStoreJson");function Pj(e){switch(e.kind){case"form":return`form ${e.formInstanceId} (${e.state})`;case"document":return e.file===null?`document ${e.slotKey} (leer)`:`document ${e.slotKey} \xB7 v${e.file.versionNumber} ${e.file.filename??e.file.artifactId}`;case"contract":return`contract ${e.contractId} \xB7 ${e.revision===null?"keine Fassung":`Fassung ${e.revision.revisionNumber}`} \xB7 ${e.contractStatus}`;case"contracts":return e.contracts.map(t=>`${t.partKey}: contract ${t.contractId} \xB7 ${t.revision===null?"keine Fassung":`Fassung ${t.revision.revisionNumber}`} \xB7 ${t.contractStatus}`).join("; ")}}s(Pj,"refText");function _j(e){return e.state!=="present"?e.reason?.de??"":e.ref!==void 0?Pj(e.ref):JSON.stringify(e.value)}s(_j,"holds");function LT(e){return e.entries.map(t=>({address:t.address,state:t.state,holds:_j(t),producer:t.producer?.label??"",written:t.writtenAt===void 0?"":new Date(t.writtenAt).toISOString()}))}s(LT,"storeRows");function yu(e){let t={},n={};for(let r of e){let i=r.indexOf("=");if(i<=0)throw new Error(`Expected key=value, got '${r}'.`);let o=r.slice(0,i);if(Object.hasOwn(n,o))throw new Error(`'${o}' is given twice.`);let a=r.slice(i+1);n[o]=a;try{t[o]=JSON.parse(a)}catch{t[o]=a}}return{values:t,raw:n}}s(yu,"parseKv");var MT="started",wu="submitted",qT="submitted",KT="load-scenario:";var jT="(Bewerbung)";function BT(e){return{nodeId:jT,actions:e.map(t=>({id:t.id,label:{de:`${t.label??t.id}${t.count===void 0?"":` (${t.count})`}`,en:`${t.label??t.id}${t.count===void 0?"":` (${t.count})`}`},...t.disabledReason===void 0?{}:{disabledReason:t.disabledReason}}))}}s(BT,"sharedAsList");function VT(e){return e.disabledReason===void 0?"":e.disabledCount===void 0?e.disabledReason:`${e.disabledReason} (${e.disabledCount})`}s(VT,"disabledText");function UT(e){return e.flatMap(({nodeId:t,actions:n})=>n.map(r=>({node:t,action:r.id,label:r.label.de,disabled:VT(r)})))}s(UT,"actionRows");function GT(e,t,n=[]){let r=e.filter(({actions:d})=>d.some(c=>c.id===t));if(r.length===0){let d=[...new Set(e.flatMap(({actions:c})=>c.map(u=>u.id)))];throw new Error(`test-actions run: no current node offers "${t}" (offered: ${d.join(", ")||"nothing"})`)}if(r.length>1)throw new Error(`test-actions run: "${t}" is offered by ${r.map(d=>d.nodeId).join(", ")} \u2014 pass --node`);let{nodeId:i,actions:o}=r[0],a=o.find(d=>d.id===t);if(a.disabledReason!==void 0)throw new Error(`test-actions run: "${t}" on ${i} is disabled: ${VT(a)}`);if(i!==jT)return i;let l=n[0];if(l===void 0)throw new Error(`test-actions run: "${t}" needs a current node \u2014 the application has none`);return l}s(GT,"nodeOfferingAction");function zT(e,t,n){if(e.startsWith(KT)){if(Object.hasOwn(n,"autoSubmit"))throw new Error(`test-actions run: ${e}: a scenario's autoSubmit is set by --auto-submit / --no-auto-submit, not --param`);return{autoSubmit:t,...n}}return Object.keys(n).length===0?void 0:{...n}}s(zT,"runParams");async function Nj(e,t){let n=await e.query(S.workflow.getInstance,{applicationId:t});if(n===null)throw new Error(`test-actions: application ${t} has no workflow instance`);return n.instance.currentNodeIds}s(Nj,"currentNodeIds");function Cj(e,t){switch(t){case"notTestApplication":return`${e} is not a test application`;case"completed":case"aborted":case"deleted":return`${e} is ${t} \u2014 test actions run only on an active application`;case"missingPermission":return"the caller lacks bewerbungsmanagement.testActions.run"}}s(Cj,"refusalText");async function bu(e,t,n){let r=await e.query(S.workflow.listSharedTestActions,{applicationId:t});if(!r.permitted)throw new Error(`test-actions: not permitted \u2014 ${Cj(t,r.reason)}`);let i=[];for(let o of n){let a=await e.query(S.workflow.listTestActions,{applicationId:t,nodeId:o});if(a===null)throw new Error(`test-actions: node "${o}" is not in this application's workflow (or it has no instance)`);i.push({nodeId:o,actions:a})}return[...i,BT(r.actions)]}s(bu,"actionsOf");async function WT(e,t,n){return n!==void 0?[n]:await Nj(e,t)}s(WT,"nodesOf");var Gh=class extends D{static{s(this,"TestActionsListCommand")}static paths=[["test-actions","list"]];static usage=E.Usage({category:"Admission",description:"List the test-mode actions of the application's current node(s) (scenarios, auto-fill-files, submit, \u2026) and the application-wide ones"});application=p.String("--application",{required:!0,description:"Application id (a test application)"});node=p.String("--node",{description:"Node id (default: the application's current nodes)"});async execute(){let t=await this.caller(),n=await bu(t,this.application,await WT(t,this.application,this.node));return this.print(n,UT,["node","action","label","disabled"]),0}},zh=class extends D{static{s(this,"TestActionsRunCommand")}application=p.String("--application",{required:!0,description:"Application id (a test application)"});node=p.String("--node",{description:"Node id (default: the application's current nodes)"});static paths=[["test-actions","run"]];static usage=E.Usage({category:"Admission",description:"Run one test-mode action; a scenario (load-scenario:<id>) also submits unless --no-auto-submit"});action=p.String("--action",{required:!0,description:"Action id, e.g. load-scenario:standard, auto-fill-files, submit-form"});autoSubmit=p.Boolean("--auto-submit",!0,{description:"Scenario only: stub the file fields and submit after loading (default on; --no-auto-submit only loads)"});param=p.Array("--param",{description:"Action parameter key=value (repeatable; the value is JSON where it parses, else text), e.g. --param confirmed=true for an action that asks a question first (upload-signed-document)"});async execute(){let t=zT(this.action,this.autoSubmit,yu(this.param??[]).values),n=await this.caller(),r=this.application,i=await WT(n,this.application,this.node),o=GT(await bu(n,r,i),this.action,i);return await n.mutation(S.workflow.runTestAction,{applicationId:r,nodeId:o,actionId:this.action,...t===void 0?{}:{params:t}}),this.print({ran:this.action,on:o},a=>[{key:"ran",value:a.ran},{key:"on",value:a.on},{key:"next",value:"test-actions list \u2014 file fills and the submit after them run asynchronously"}]),0}},HT=[Gh,zh];var Je=["de","en"];function Xo(e,t){return Je.every(n=>e[n]===t[n])}s(Xo,"sameText");function wt(e){if(e===null||typeof e!="object"||Array.isArray(e))return"not-localized";let t=e;return Object.keys(t).some(r=>!Je.includes(r))?"not-localized":Je.filter(r=>{let i=t[r];return typeof i!="string"||i.trim()===""})}s(wt,"missingLocales");function mi(e){let t=wt(e);return t!=="not-localized"&&t.length===0}s(mi,"isLocalizedText");function Fa(e,t){let n={};for(let r of Je){let i=e.map(o=>o[r]);n[r]=i.every(o=>typeof o=="string"&&o.trim()!=="")?t(i,r):""}return n}s(Fa,"composeTexts");var er=/^[a-z][A-Za-z0-9]*$/;function Wh(e){return typeof e=="string"&&er.test(e)}s(Wh,"isNodeId");function es(e,t){Wh(e)||_(`[graph/nodeIdFormat] "${e}" cannot name a node: a node id is ${er.source}.`);let n=new Set(t);if(!n.has(e))return e;let r=2;for(;n.has(`${e}${r}`);)r++;return`${e}${r}`}s(es,"makeNodeId");var hi="$env";function se(e){if(e.scope==="env")return`${hi}.${e.key}`;let t=e.scope==="derived"?`$derived.${e.key}`:`$${e.scope}.${e.owner}.${e.key}`;return e.path===void 0?t:`${t}.${e.path}`}s(se,"formatAddress");var wr=/^[a-z][a-zA-Z0-9_]*$/,Dj=/^[A-Za-z_][A-Za-z0-9_]*$/;function to(e){return typeof e=="string"&&e.split(".").every(t=>Dj.test(t))}s(to,"isPath");function qr(e){if(!e.startsWith("$"))return null;let t=e.slice(1).split("."),[n,...r]=t;switch(n){case"env":{let i=r.join(".");return r.length>0&&to(i)?{scope:"env",key:i}:null}case"derived":{let[i,...o]=r;return i===void 0||!wr.test(i)?null:YT({scope:"derived",key:i},o)}case"node":case"task":{let[i,o,...a]=r;return i===void 0||o===void 0||!wr.test(o)||(n==="node"?!er.test(i):!wr.test(i))?null:YT({scope:n,owner:i,key:o},a)}default:return null}}s(qr,"tryParseAddress");function YT(e,t){if(t.length===0)return e;let n=t.join(".");return to(n)?{...e,path:n}:null}s(YT,"withPath");function ve(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=t.scope==="env"?["scope","key"]:t.scope==="derived"?["scope","key","path"]:["scope","owner","key","path"];if(Object.keys(t).some(r=>!n.includes(r))||t.path!==void 0&&!to(t.path))return!1;switch(t.scope){case"env":return to(t.key);case"derived":return typeof t.key=="string"&&wr.test(t.key);case"node":return typeof t.owner=="string"&&er.test(t.owner)&&typeof t.key=="string"&&wr.test(t.key);case"task":return typeof t.owner=="string"&&wr.test(t.owner)&&typeof t.key=="string"&&wr.test(t.key);default:return!1}}s(ve,"isAddress");var Kr={offer:{key:"string",title:"string"},unit:{key:"string",name:"string"},stage:{key:"string",name:"string",gradeLevel:"number"},run:{key:"string",name:"string",startDate:"date"},applicant:{language:"enum",channel:"enum"}},ts=Object.keys(Kr);function ns(e){return Object.hasOwn(Kr,e)}s(ns,"isEnvKey");var Fj=["self-service","staff"];function JT(e,t){return{kind:"fixed",values:e,labels:t}}s(JT,"fixedSet");var ku={of:"applicant.language",withoutValue:"de"},jr={"offer.key":{valueSet:{kind:"live"},nullable:!1,label:{de:"Angebot",en:"Offer"}},"offer.title":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Titel des Angebots",en:"Offer title"},nameLanguage:ku},"unit.key":{valueSet:{kind:"live"},nullable:!1,label:{de:"Einheit",en:"Unit"}},"unit.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name der Einheit",en:"Unit name"},nameLanguage:ku},"stage.key":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Klassenstufe (Schl\xFCssel)",en:"Grade (key)"},cohortBound:!0},"stage.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name der Klassenstufe",en:"Grade name"},cohortBound:!0,nameLanguage:ku},"stage.gradeLevel":{valueSet:{kind:"open"},nullable:!0,absent:{de:"Die Stufe hat keine Klassenstufe (Kindergarten).",en:"The stage has no grade level (Kindergarten)."},label:{de:"Klassenstufe",en:"Grade level"},cohortBound:!0},"run.key":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Schuljahr",en:"School year"},cohortBound:!0},"run.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name des Schuljahrs",en:"School year name"},cohortBound:!0,nameLanguage:ku},"run.startDate":{valueSet:{kind:"open"},nullable:!0,absent:{de:"F\xFCr das Schuljahr ist kein Beginn erfasst.",en:"The school year has no start date."},label:{de:"Beginn des Schuljahrs",en:"School year start"},cohortBound:!0},"applicant.language":{valueSet:JT(Je,{de:{de:"Deutsch",en:"German"},en:{de:"Englisch",en:"English"}}),nullable:!0,absent:{de:"Die Bewerbung hat kein Bewerberkonto (intern angelegt).",en:"The application has no applicant account (started by staff)."},label:{de:"Bewerbersprache",en:"Applicant language"}},"applicant.channel":{valueSet:JT(Fj,{staff:{de:"intern",en:"in-house"},"self-service":{de:"online (Familie)",en:"online (family)"}}),nullable:!1,label:{de:"Eingangsweg",en:"Intake channel"}}},vu={types:Kr,fields:jr},xu=ts.flatMap(e=>Object.keys(Kr[e]).map(t=>`${e}.${t}`));function tr(e){return Object.hasOwn(jr,e)}s(tr,"isEnvLeaf");function Su(e){return`${hi}.${e}`}s(Su,"envIdentifier");function no(e){let t=jr[e],[n,r]=e.split("."),i=Kr[n][r];i===void 0&&_(`[env] leaf "${e}" has no type`);let o=t.valueSet;return{leaf:e,type:i,label:t.label,nullable:t.nullable,...t.absent===void 0?{}:{absent:t.absent},...t.nameLanguage===void 0?{}:{nameLanguage:t.nameLanguage},...t.cohortBound===void 0?{}:{cohortBound:t.cohortBound},...o.kind==="fixed"?{enumOptions:o.values.map(a=>{let l=o.labels[a];return l===void 0&&_(`[env] "${e}" names the value "${a}" without a label`),{value:a,label:l}})}:{}}}s(no,"envLeaf");var QT="staffInput";var Lj=["boolean"],La=/^[a-z][A-Za-z0-9]*$/;function Au(e){return e.staffInputs??[]}s(Au,"staffInputsOf");function Eu(e){return`${QT}.${e}`}s(Eu,"staffInputLeaf");function ZT(e){return`${hi}.${Eu(e)}`}s(ZT,"staffInputIdentifier");function Mj(e){let t=`${QT}.`;return e.startsWith(t)?e.slice(t.length):null}s(Mj,"staffInputKeyOfLeaf");function Ma(e,t){let n=Mj(t);return n===null?void 0:Au(e).find(r=>r.key===n)}s(Ma,"declaredStaffInput");function qj(e){return[...Au(e).map(t=>({leaf:Eu(t.key),type:t.type,label:t.label,valueSet:{kind:"open"},nullable:!1,cohortBound:!1})),...xu.map(t=>{let n=no(t);return{leaf:t,type:n.type,label:n.label,valueSet:jr[t].valueSet,nullable:n.nullable,cohortBound:n.cohortBound===!0}})]}s(qj,"envLeavesFor");function XT(e){return qj(e).filter(t=>!t.cohortBound)}s(XT,"conditionEnvLeaves");function e$(e){let t={},n={};for(let{leaf:r,type:i,valueSet:o,nullable:a}of XT(e)){let[l="",d=""]=r.split(".");t[l]={...t[l]??{},[d]:i},n[r]={valueSet:o,nullable:a}}return{types:t,fields:n}}s(e$,"envConditionSchemaFor");function t$(e){let t=e.staffInputs;if(t===void 0)return[];if(!Array.isArray(t))return[{path:"staffInputs",reason:{de:"[staffInput/shape] graph.staffInputs muss eine Liste sein.",en:"[staffInput/shape] graph.staffInputs must be a list."}}];let n=[],r=new Set;return t.forEach((i,o)=>{let a=`staffInputs[${o}]`,l=i;if(l===null||typeof l!="object"||typeof l.key!="string"){n.push({path:a,reason:{de:"[staffInput/shape] Eine interne Angabe braucht key, type und label ({ de, en }).",en:"[staffInput/shape] An internal entry needs key, type and label ({ de, en })."}});return}let d={de:`Interne Angabe "${l.key}"`,en:`Internal entry "${l.key}"`};La.test(l.key)||n.push({path:`${a}.key`,reason:{de:`[staffInput/keyFormat] ${d.de}: Schl\xFCssel beginnt mit einem Kleinbuchstaben und enth\xE4lt nur Buchstaben und Ziffern.`,en:`[staffInput/keyFormat] ${d.en}: the key starts with a lowercase letter and contains only letters and digits.`}}),r.has(l.key)&&n.push({path:`${a}.key`,reason:{de:`[staffInput/duplicateKey] ${d.de}: Schl\xFCssel ist doppelt vergeben.`,en:`[staffInput/duplicateKey] ${d.en}: the key is used twice.`}}),r.add(l.key),Lj.includes(l.type)||n.push({path:`${a}.type`,reason:{de:`[staffInput/unknownType] ${d.de}: Typ "${String(l.type)}" \u2014 erlaubt ist nur "boolean" (K\xE4stchen).`,en:`[staffInput/unknownType] ${d.en}: type "${String(l.type)}" \u2014 only "boolean" (checkbox) is allowed.`}});let c=wt(l.label);c==="not-localized"?n.push({path:`${a}.label`,reason:{de:`[staffInput/shape] ${d.de}: label muss { de, en } sein.`,en:`[staffInput/shape] ${d.en}: label must be { de, en }.`}}):c.length>0&&n.push({path:`${a}.label`,reason:{de:`[i18n/missingTranslation] ${d.de}: Beschriftung fehlt in ${c.join(", ")}.`,en:`[i18n/missingTranslation] ${d.en}: label is missing in ${c.join(", ")}.`}})}),n}s(t$,"staffInputIssues");var ng={required:!0,description:"Offer slug (its offerKey)"},Hh=class extends D{static{s(this,"ApplicationsListCommand")}static paths=[["applications","list"]];static usage=E.Usage({category:"Admission",description:"List an offer's applications (id, status, board state, applicant, test)"});offer=p.String("--offer",ng);testOnly=p.Boolean("--test-only",!1,{description:"Only test applications"});async execute(){let t=await this.caller(),n=await t.query(S.admission.listForAngebot,{client:this.requireTenant(t),offerKey:this.offer}),r=CT(n).filter(i=>!this.testOnly||i.test==="test");return this.print(r,i=>i,["id","status","state","applicant","test"]),0}},Yh=class extends D{static{s(this,"ApplicationsCountsCommand")}static paths=[["applications","counts"]];static usage=E.Usage({category:"Admission",description:"Count an offer's applications per list"});offer=p.String("--offer",ng);async execute(){let t=await this.caller(),n=await t.query(S.admission.getCountsByListForAngebot,{client:this.requireTenant(t),offerKey:this.offer});return this.print(n,r=>[...Object.entries(r.counts).map(([i,o])=>({list:i,count:String(o)})),{list:"total",count:String(r.total)}],["list","count"]),0}},Jh=class extends D{static{s(this,"ApplicationsShowCommand")}static paths=[["applications","show"]];static usage=E.Usage({category:"Admission",description:"One application: status, test flag, offer, current workflow nodes"});application=p.String({required:!0});async execute(){let t=await this.caller(),n=this.application,r=await t.query(S.admission.get,{applicationId:n});if(r===null)throw new Error(`applications show: no application ${n} (or not visible to you)`);let i=await t.query(S.workflow.getInstance,{applicationId:n});return this.print({application:r,currentNodes:i?.instance.currentNodeIds??[]},o=>[{key:"id",value:n},{key:"status",value:o.application.status},{key:"test",value:o.application.testMode?"ja":"nein"},{key:"offer",value:o.application.offerKey},{key:"current nodes",value:o.currentNodes.join(", ")}]),0}},Qh=class extends D{static{s(this,"ApplicationsStoreCommand")}static paths=[["applications","store"]];static usage=E.Usage({category:"Admission",description:"One application's process store: every address of its pinned graph, resolved (present / pending / absent)",details:"Staff only (applications.manage). --json prints one object keyed by the canonical address ($node\u2026, $task\u2026, $derived\u2026, $env\u2026). Values are shown whatever their audience \u2014 never hand the output to the family. Recipe: playbooks/applications/inspect-process-store.md."});application=p.String({required:!0});async execute(){let n=await(await this.caller()).query(S.processStoreView.get,{applicationId:this.application});return this.print(FT(n),()=>LT(n),["address","state","holds","producer","written"]),0}},Zh=class extends D{static{s(this,"ApplicationsStartTestCommand")}static paths=[["applications","start-test"]];static usage=E.Usage({category:"Admission",description:"Start a TEST application for an applicant (school year and level by key or id) and show what test mode offers next",details:"Always test mode. --applicant names the account by its login address (on prod only the tenant's test account); --party names the applicant party directly. Without --version it runs on the live generation, like the cockpit."});offer=p.String("--offer",ng);run=p.String("--run",{required:!0,description:"School year: its key or id (never its name)"});stage=p.String("--stage",{required:!0,description:"Level: its key or id (never its name)"});party=p.String("--party",{description:"Applicant party id"});applicant=p.String("--applicant",{description:"Applicant account login address (e.g. the test account test@example.com)"});version=p.String("--version",{description:"Offer version id to test (default: the live generation)"});staffInput=p.Array("--staff-input",{description:"A staff input the offer declares, as key=true|false \u2014 repeat it once per input; a staff start must set every one"});proxy=p.Boolean("--proxy",{description:"Start in Stellvertretung (--proxy) or not (--no-proxy); left out, the tenant's default applies, as in the cockpit"});async execute(){let t=await this.caller();DT(this.resolvedTarget(),this.prodUrls(),this.party,this.applicant);let n=this.requireTenant(t),r=NT(await t.query(S.admission.listAdmissionTree,{client:n}),this.offer,this.run,this.stage),i=this.party;if(this.applicant!==void 0){let d=await t.query(S.applicants.partyByEmail,{client:n,email:this.applicant});if(d===null)throw new Error(`applications start-test: no applicant account ${this.applicant} at this school (create it in the cockpit first)`);i=d}let o=await t.mutation(S.admission.staffStartApplicationForParty,{client:n,offerKey:this.offer,partyId:i,programRunId:r.programRunId,programStageId:r.programStageId,...this.proxy===void 0?{}:{startInProxy:this.proxy},staffInputs:r$(this.staffInput??[]),testMode:!0,...this.version===void 0?{}:{offerVersionId:this.version}}),a,l;try{let d=await t.query(S.workflow.getInstance,{applicationId:o.applicationId});if(d===null)throw new Error("the started application has no workflow instance");a=d.instance.currentNodeIds,l=(await bu(t,o.applicationId,a)).flatMap(c=>c.actions.map(u=>u.id))}catch(d){throw new Error(`applications start-test: started ${o.applicationId}, but reading its state failed: ${d instanceof Error?d.message:String(d)}`,{cause:d})}return this.print({applicationId:o.applicationId,currentNodes:a,testActions:l},d=>[{key:"application",value:d.applicationId},{key:"current nodes",value:d.currentNodes.join(", ")},{key:"test actions",value:d.testActions.join(", ")},{key:"next",value:`test-actions run --application ${d.applicationId} --action <id>`}]),0}},Xh=class extends D{static{s(this,"ApplicationsDiscardTestCommand")}static paths=[["applications","discard-test"]];static usage=E.Usage({category:"Admission",description:"Discard a TEST application (the server refuses a real one)"});application=p.String({required:!0});async execute(){return await(await this.caller()).mutation(S.admission.discardTest,{applicationId:this.application}),this.print({discarded:this.application},n=>[{key:"discarded",value:n.discarded}]),0}},eg=class extends D{static{s(this,"ApplicationsStaffInputListCommand")}static paths=[["applications","staff-input","list"]];static usage=E.Usage({category:"Admission",description:"An application's internal inputs (set at the start): value, and why one can no longer be corrected"});application=p.String({required:!0});async execute(){let n=await(await this.caller()).query(S.admission.staffInputsOfApplication,{applicationId:this.application});return this.print(n,r=>r.map(i=>({key:i.key,label:i.label.de,value:String(i.value),correctable:i.block===null?"ja":i.block.de})),["key","label","value","correctable"]),0}},tg=class extends D{static{s(this,"ApplicationsStaffInputSetCommand")}static paths=[["applications","staff-input","set"]];static usage=E.Usage({category:"Admission",description:"Correct one internal input of an application, with a reason \u2014 refused once a node that reads it was entered",examples:[["Untick \u201EKind von Mitarbeitenden\u201C",'plexus-cli --env prod --tenant <t> --allow-prod applications staff-input set <id> --input staffApplication=false --reason "falsch angehakt"']]});application=p.String({required:!0});input=p.String("--input",{required:!0,description:"key=true|false"});reason=p.String("--reason",{required:!0,description:"Why \u2014 recorded on the application's activity feed"});async execute(){let t=await this.caller(),[{key:n,value:r}]=r$([this.input]);return await t.mutation(S.admission.correctStaffInput,{applicationId:this.application,key:n,value:r,reason:this.reason}),this.print({application:this.application,key:n,value:r},i=>[{key:"application",value:i.application},{key:i.key,value:String(i.value)}]),0}},n$=[Hh,Yh,Jh,Qh,Zh,Xh,eg,tg];function r$(e){return e.map(t=>{let[n="",r,...i]=t.split("=");if(!La.test(n)||r!=="true"&&r!=="false"||i.length>0)throw new Error(`--staff-input "${t}": expected key=true or key=false`);return{key:n,value:r==="true"}})}s(r$,"parseStaffInputs");var ig="bundle.yaml",i$="manifest.json",og="smartforms",o$="workflow.json";function rg(e){return JSON.parse(ke(e,"utf8"))}s(rg,"readJson");function Pe(e){return JSON.stringify(sg(e),null,2)+`
9377
+ `};var gu="1ed05b1d6d3b3105aed99411f816d92886682495715074569f573f8bb958f142",jh=OT;var Bh=class extends Se{static{s(this,"AgentToolsCommand")}static paths=[["agent","tools"]];static usage=E.Usage({category:"Agents",description:"Show the shared platform/CLI agent tool schemas and skill revision."});async execute(){return this.print({skillHash:gu,tools:Da}),0}},Vh=class extends Se{static{s(this,"AgentInvokeCommand")}static paths=[["agent","invoke"]];static usage=E.Usage({category:"Agents",description:"Invoke a shared agent tool; pipe its JSON input on stdin."});tool=p.String("--tool",{required:!0,description:"plexus|plexus_skill|plexus_workspace"});async execute(){if("isTTY"in this.context.stdin&&this.context.stdin.isTTY===!0)throw new Error("plexus: pipe the tool's JSON input on stdin.");let t=JSON.parse(await Kh(this.context.stdin)),n=await this.context.executePlexusAgentTool(this.tool,t);return this.print(n),0}},PT=[Bh,Vh];var Uh=[{key:"fixture_test",email:"test@example.com",firstName:"Test",lastName:"Bewerber"}],nte=new Set(Uh.map(e=>e.key));function NT(e,t,n,r){let i=e.flatMap(l=>l.angebote).find(l=>l.offerKey===t);if(i===void 0){let l=e.flatMap(d=>d.angebote.map(c=>c.offerKey));throw new Error(`applications start-test: no offer "${t}" (offers: ${l.join(", ")||"none"})`)}let o=i.stages.find(l=>l.stageKey===r||l.stageId===r);if(o===void 0){let l=i.stages.map(d=>`${d.stageKey} (${d.stageId})`);throw new Error(`applications start-test: no level "${r}" in ${t} \u2014 name it by key or id: ${l.join(", ")}`)}let a=o.runs.find(l=>l.runKey===n||l.runId===n);if(a===void 0){let l=o.runs.map(d=>`${d.runKey} (${d.runId})`);throw new Error(`applications start-test: no school year "${n}" for level ${o.stageKey} \u2014 name it by key or id: ${l.join(", ")}`)}if(!a.isOpen)throw new Error(`applications start-test: school year ${a.runKey} is closed for level ${o.stageKey}`);return{programRunId:a.runId,programStageId:o.stageId}}s(NT,"resolveStartTarget");function Oj(e){return e.kind==="named"?e.name:`(${e.standIn??e.fallback})`}s(Oj,"applicantText");function CT(e){return e.map(t=>({id:t.application._id,status:t.deletedAt?`${t.application.status} (gel\xF6scht)`:t.application.status,state:t.currentProcessStateId??"",applicant:Oj(t.applicantName),test:t.application.testMode===!0?"test":""}))}s(CT,"applicationRows");var _T=Uh.map(e=>e.email);function DT(e,t,n,r){if(n===void 0&&r===void 0)throw new Error("applications start-test: name the applicant \u2014 --party <partyId> or --applicant <email>");if(n!==void 0&&r!==void 0)throw new Error("applications start-test: --party or --applicant, not both");if(Fh(e,t)&&(r===void 0||!_T.includes(r.trim().toLowerCase())))throw new Error(`applications start-test: on prod only for the test account ${_T.join(", ")} (--applicant) \u2014 never a real family's`)}s(DT,"assertStartApplicant");function FT(e){let t={};for(let{address:n,...r}of e.entries)t[n]=r;return{applicationId:e.applicationId,store:t}}s(FT,"processStoreJson");function Pj(e){switch(e.kind){case"form":return`form ${e.formInstanceId} (${e.state})`;case"document":return e.file===null?`document ${e.slotKey} (leer)`:`document ${e.slotKey} \xB7 v${e.file.versionNumber} ${e.file.filename??e.file.artifactId}`;case"contract":return`contract ${e.contractId} \xB7 ${e.revision===null?"keine Fassung":`Fassung ${e.revision.revisionNumber}`} \xB7 ${e.contractStatus}`;case"contracts":return e.contracts.map(t=>`${t.partKey}: contract ${t.contractId} \xB7 ${t.revision===null?"keine Fassung":`Fassung ${t.revision.revisionNumber}`} \xB7 ${t.contractStatus}`).join("; ")}}s(Pj,"refText");function _j(e){return e.state!=="present"?e.reason?.de??"":e.ref!==void 0?Pj(e.ref):JSON.stringify(e.value)}s(_j,"holds");function LT(e){return e.entries.map(t=>({address:t.address,state:t.state,holds:_j(t),producer:t.producer?.label??"",written:t.writtenAt===void 0?"":new Date(t.writtenAt).toISOString()}))}s(LT,"storeRows");function yu(e){let t={},n={};for(let r of e){let i=r.indexOf("=");if(i<=0)throw new Error(`Expected key=value, got '${r}'.`);let o=r.slice(0,i);if(Object.hasOwn(n,o))throw new Error(`'${o}' is given twice.`);let a=r.slice(i+1);n[o]=a;try{t[o]=JSON.parse(a)}catch{t[o]=a}}return{values:t,raw:n}}s(yu,"parseKv");var MT="started",wu="submitted",qT="submitted",KT="load-scenario:";var jT="(Bewerbung)";function BT(e){return{nodeId:jT,actions:e.map(t=>({id:t.id,label:{de:`${t.label??t.id}${t.count===void 0?"":` (${t.count})`}`,en:`${t.label??t.id}${t.count===void 0?"":` (${t.count})`}`},...t.disabledReason===void 0?{}:{disabledReason:t.disabledReason}}))}}s(BT,"sharedAsList");function VT(e){return e.disabledReason===void 0?"":e.disabledCount===void 0?e.disabledReason:`${e.disabledReason} (${e.disabledCount})`}s(VT,"disabledText");function UT(e){return e.flatMap(({nodeId:t,actions:n})=>n.map(r=>({node:t,action:r.id,label:r.label.de,disabled:VT(r)})))}s(UT,"actionRows");function GT(e,t,n=[]){let r=e.filter(({actions:d})=>d.some(c=>c.id===t));if(r.length===0){let d=[...new Set(e.flatMap(({actions:c})=>c.map(u=>u.id)))];throw new Error(`test-actions run: no current node offers "${t}" (offered: ${d.join(", ")||"nothing"})`)}if(r.length>1)throw new Error(`test-actions run: "${t}" is offered by ${r.map(d=>d.nodeId).join(", ")} \u2014 pass --node`);let{nodeId:i,actions:o}=r[0],a=o.find(d=>d.id===t);if(a.disabledReason!==void 0)throw new Error(`test-actions run: "${t}" on ${i} is disabled: ${VT(a)}`);if(i!==jT)return i;let l=n[0];if(l===void 0)throw new Error(`test-actions run: "${t}" needs a current node \u2014 the application has none`);return l}s(GT,"nodeOfferingAction");function zT(e,t,n){if(e.startsWith(KT)){if(Object.hasOwn(n,"autoSubmit"))throw new Error(`test-actions run: ${e}: a scenario's autoSubmit is set by --auto-submit / --no-auto-submit, not --param`);return{autoSubmit:t,...n}}return Object.keys(n).length===0?void 0:{...n}}s(zT,"runParams");async function Nj(e,t){let n=await e.query(S.workflow.getInstance,{applicationId:t});if(n===null)throw new Error(`test-actions: application ${t} has no workflow instance`);return n.instance.currentNodeIds}s(Nj,"currentNodeIds");function Cj(e,t){switch(t){case"notTestApplication":return`${e} is not a test application`;case"completed":case"aborted":case"deleted":return`${e} is ${t} \u2014 test actions run only on an active application`;case"missingPermission":return"the caller lacks bewerbungsmanagement.testActions.run"}}s(Cj,"refusalText");async function bu(e,t,n){let r=await e.query(S.workflow.listSharedTestActions,{applicationId:t});if(!r.permitted)throw new Error(`test-actions: not permitted \u2014 ${Cj(t,r.reason)}`);let i=[];for(let o of n){let a=await e.query(S.workflow.listTestActions,{applicationId:t,nodeId:o});if(a===null)throw new Error(`test-actions: node "${o}" is not in this application's workflow (or it has no instance)`);i.push({nodeId:o,actions:a})}return[...i,BT(r.actions)]}s(bu,"actionsOf");async function WT(e,t,n){return n!==void 0?[n]:await Nj(e,t)}s(WT,"nodesOf");var Gh=class extends D{static{s(this,"TestActionsListCommand")}static paths=[["test-actions","list"]];static usage=E.Usage({category:"Admission",description:"List the test-mode actions of the application's current node(s) (scenarios, auto-fill-files, submit, \u2026) and the application-wide ones"});application=p.String("--application",{required:!0,description:"Application id (a test application)"});node=p.String("--node",{description:"Node id (default: the application's current nodes)"});async execute(){let t=await this.caller(),n=await bu(t,this.application,await WT(t,this.application,this.node));return this.print(n,UT,["node","action","label","disabled"]),0}},zh=class extends D{static{s(this,"TestActionsRunCommand")}application=p.String("--application",{required:!0,description:"Application id (a test application)"});node=p.String("--node",{description:"Node id (default: the application's current nodes)"});static paths=[["test-actions","run"]];static usage=E.Usage({category:"Admission",description:"Run one test-mode action; a scenario (load-scenario:<id>) also submits unless --no-auto-submit"});action=p.String("--action",{required:!0,description:"Action id, e.g. load-scenario:standard, auto-fill-files, submit-form"});autoSubmit=p.Boolean("--auto-submit",!0,{description:"Scenario only: stub the file fields and submit after loading (default on; --no-auto-submit only loads)"});param=p.Array("--param",{description:"Action parameter key=value (repeatable; the value is JSON where it parses, else text), e.g. --param confirmed=true for an action that asks a question first (upload-signed-document)"});async execute(){let t=zT(this.action,this.autoSubmit,yu(this.param??[]).values),n=await this.caller(),r=this.application,i=await WT(n,this.application,this.node),o=GT(await bu(n,r,i),this.action,i);return await n.mutation(S.workflow.runTestAction,{applicationId:r,nodeId:o,actionId:this.action,...t===void 0?{}:{params:t}}),this.print({ran:this.action,on:o},a=>[{key:"ran",value:a.ran},{key:"on",value:a.on},{key:"next",value:"test-actions list \u2014 file fills and the submit after them run asynchronously"}]),0}},HT=[Gh,zh];var Je=["de","en"];function Xo(e,t){return Je.every(n=>e[n]===t[n])}s(Xo,"sameText");function wt(e){if(e===null||typeof e!="object"||Array.isArray(e))return"not-localized";let t=e;return Object.keys(t).some(r=>!Je.includes(r))?"not-localized":Je.filter(r=>{let i=t[r];return typeof i!="string"||i.trim()===""})}s(wt,"missingLocales");function mi(e){let t=wt(e);return t!=="not-localized"&&t.length===0}s(mi,"isLocalizedText");function Fa(e,t){let n={};for(let r of Je){let i=e.map(o=>o[r]);n[r]=i.every(o=>typeof o=="string"&&o.trim()!=="")?t(i,r):""}return n}s(Fa,"composeTexts");var er=/^[a-z][A-Za-z0-9]*$/;function Wh(e){return typeof e=="string"&&er.test(e)}s(Wh,"isNodeId");function es(e,t){Wh(e)||_(`[graph/nodeIdFormat] "${e}" cannot name a node: a node id is ${er.source}.`);let n=new Set(t);if(!n.has(e))return e;let r=2;for(;n.has(`${e}${r}`);)r++;return`${e}${r}`}s(es,"makeNodeId");var hi="$env";function se(e){if(e.scope==="env")return`${hi}.${e.key}`;let t=e.scope==="derived"?`$derived.${e.key}`:`$${e.scope}.${e.owner}.${e.key}`;return e.path===void 0?t:`${t}.${e.path}`}s(se,"formatAddress");var wr=/^[a-z][a-zA-Z0-9_]*$/,Dj=/^[A-Za-z_][A-Za-z0-9_]*$/;function to(e){return typeof e=="string"&&e.split(".").every(t=>Dj.test(t))}s(to,"isPath");function qr(e){if(!e.startsWith("$"))return null;let t=e.slice(1).split("."),[n,...r]=t;switch(n){case"env":{let i=r.join(".");return r.length>0&&to(i)?{scope:"env",key:i}:null}case"derived":{let[i,...o]=r;return i===void 0||!wr.test(i)?null:YT({scope:"derived",key:i},o)}case"node":case"task":{let[i,o,...a]=r;return i===void 0||o===void 0||!wr.test(o)||(n==="node"?!er.test(i):!wr.test(i))?null:YT({scope:n,owner:i,key:o},a)}default:return null}}s(qr,"tryParseAddress");function YT(e,t){if(t.length===0)return e;let n=t.join(".");return to(n)?{...e,path:n}:null}s(YT,"withPath");function ve(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=t.scope==="env"?["scope","key"]:t.scope==="derived"?["scope","key","path"]:["scope","owner","key","path"];if(Object.keys(t).some(r=>!n.includes(r))||t.path!==void 0&&!to(t.path))return!1;switch(t.scope){case"env":return to(t.key);case"derived":return typeof t.key=="string"&&wr.test(t.key);case"node":return typeof t.owner=="string"&&er.test(t.owner)&&typeof t.key=="string"&&wr.test(t.key);case"task":return typeof t.owner=="string"&&wr.test(t.owner)&&typeof t.key=="string"&&wr.test(t.key);default:return!1}}s(ve,"isAddress");var Kr={offer:{key:"string",title:"string"},unit:{key:"string",name:"string"},stage:{key:"string",name:"string",gradeLevel:"number"},run:{key:"string",name:"string",startDate:"date"},applicant:{language:"enum",channel:"enum"}},ts=Object.keys(Kr);function ns(e){return Object.hasOwn(Kr,e)}s(ns,"isEnvKey");var Fj=["self-service","staff"];function JT(e,t){return{kind:"fixed",values:e,labels:t}}s(JT,"fixedSet");var ku={of:"applicant.language",withoutValue:"de"},jr={"offer.key":{valueSet:{kind:"live"},nullable:!1,label:{de:"Angebot",en:"Offer"}},"offer.title":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Titel des Angebots",en:"Offer title"},nameLanguage:ku},"unit.key":{valueSet:{kind:"live"},nullable:!1,label:{de:"Einheit",en:"Unit"}},"unit.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name der Einheit",en:"Unit name"},nameLanguage:ku},"stage.key":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Klassenstufe (Schl\xFCssel)",en:"Grade (key)"},cohortBound:!0},"stage.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name der Klassenstufe",en:"Grade name"},cohortBound:!0,nameLanguage:ku},"stage.gradeLevel":{valueSet:{kind:"open"},nullable:!0,absent:{de:"Die Stufe hat keine Klassenstufe (Kindergarten).",en:"The stage has no grade level (Kindergarten)."},label:{de:"Klassenstufe",en:"Grade level"},cohortBound:!0},"run.key":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Schuljahr",en:"School year"},cohortBound:!0},"run.name":{valueSet:{kind:"unstable"},nullable:!1,label:{de:"Name des Schuljahrs",en:"School year name"},cohortBound:!0,nameLanguage:ku},"run.startDate":{valueSet:{kind:"open"},nullable:!0,absent:{de:"F\xFCr das Schuljahr ist kein Beginn erfasst.",en:"The school year has no start date."},label:{de:"Beginn des Schuljahrs",en:"School year start"},cohortBound:!0},"applicant.language":{valueSet:JT(Je,{de:{de:"Deutsch",en:"German"},en:{de:"Englisch",en:"English"}}),nullable:!0,absent:{de:"Die Bewerbung hat kein Bewerberkonto (intern angelegt).",en:"The application has no applicant account (started by staff)."},label:{de:"Bewerbersprache",en:"Applicant language"}},"applicant.channel":{valueSet:JT(Fj,{staff:{de:"intern",en:"in-house"},"self-service":{de:"online (Familie)",en:"online (family)"}}),nullable:!1,label:{de:"Eingangsweg",en:"Intake channel"}}},vu={types:Kr,fields:jr},xu=ts.flatMap(e=>Object.keys(Kr[e]).map(t=>`${e}.${t}`));function tr(e){return Object.hasOwn(jr,e)}s(tr,"isEnvLeaf");function Su(e){return`${hi}.${e}`}s(Su,"envIdentifier");function no(e){let t=jr[e],[n,r]=e.split("."),i=Kr[n][r];i===void 0&&_(`[env] leaf "${e}" has no type`);let o=t.valueSet;return{leaf:e,type:i,label:t.label,nullable:t.nullable,...t.absent===void 0?{}:{absent:t.absent},...t.nameLanguage===void 0?{}:{nameLanguage:t.nameLanguage},...t.cohortBound===void 0?{}:{cohortBound:t.cohortBound},...o.kind==="fixed"?{enumOptions:o.values.map(a=>{let l=o.labels[a];return l===void 0&&_(`[env] "${e}" names the value "${a}" without a label`),{value:a,label:l}})}:{}}}s(no,"envLeaf");var QT="staffInput";var Lj=["boolean"],La=/^[a-z][A-Za-z0-9]*$/;function Au(e){return e.staffInputs??[]}s(Au,"staffInputsOf");function Eu(e){return`${QT}.${e}`}s(Eu,"staffInputLeaf");function ZT(e){return`${hi}.${Eu(e)}`}s(ZT,"staffInputIdentifier");function Mj(e){let t=`${QT}.`;return e.startsWith(t)?e.slice(t.length):null}s(Mj,"staffInputKeyOfLeaf");function Ma(e,t){let n=Mj(t);return n===null?void 0:Au(e).find(r=>r.key===n)}s(Ma,"declaredStaffInput");function qj(e){return[...Au(e).map(t=>({leaf:Eu(t.key),type:t.type,label:t.label,valueSet:{kind:"open"},nullable:!1,cohortBound:!1})),...xu.map(t=>{let n=no(t);return{leaf:t,type:n.type,label:n.label,valueSet:jr[t].valueSet,nullable:n.nullable,cohortBound:n.cohortBound===!0}})]}s(qj,"envLeavesFor");function XT(e){return qj(e).filter(t=>!t.cohortBound)}s(XT,"conditionEnvLeaves");function e$(e){let t={},n={};for(let{leaf:r,type:i,valueSet:o,nullable:a}of XT(e)){let[l="",d=""]=r.split(".");t[l]={...t[l]??{},[d]:i},n[r]={valueSet:o,nullable:a}}return{types:t,fields:n}}s(e$,"envConditionSchemaFor");function t$(e){let t=e.staffInputs;if(t===void 0)return[];if(!Array.isArray(t))return[{path:"staffInputs",reason:{de:"[staffInput/shape] graph.staffInputs muss eine Liste sein.",en:"[staffInput/shape] graph.staffInputs must be a list."}}];let n=[],r=new Set;return t.forEach((i,o)=>{let a=`staffInputs[${o}]`,l=i;if(l===null||typeof l!="object"||typeof l.key!="string"){n.push({path:a,reason:{de:"[staffInput/shape] Eine interne Angabe braucht key, type und label ({ de, en }).",en:"[staffInput/shape] An internal entry needs key, type and label ({ de, en })."}});return}let d={de:`Interne Angabe "${l.key}"`,en:`Internal entry "${l.key}"`};La.test(l.key)||n.push({path:`${a}.key`,reason:{de:`[staffInput/keyFormat] ${d.de}: Schl\xFCssel beginnt mit einem Kleinbuchstaben und enth\xE4lt nur Buchstaben und Ziffern.`,en:`[staffInput/keyFormat] ${d.en}: the key starts with a lowercase letter and contains only letters and digits.`}}),r.has(l.key)&&n.push({path:`${a}.key`,reason:{de:`[staffInput/duplicateKey] ${d.de}: Schl\xFCssel ist doppelt vergeben.`,en:`[staffInput/duplicateKey] ${d.en}: the key is used twice.`}}),r.add(l.key),Lj.includes(l.type)||n.push({path:`${a}.type`,reason:{de:`[staffInput/unknownType] ${d.de}: Typ "${String(l.type)}" \u2014 erlaubt ist nur "boolean" (K\xE4stchen).`,en:`[staffInput/unknownType] ${d.en}: type "${String(l.type)}" \u2014 only "boolean" (checkbox) is allowed.`}});let c=wt(l.label);c==="not-localized"?n.push({path:`${a}.label`,reason:{de:`[staffInput/shape] ${d.de}: label muss { de, en } sein.`,en:`[staffInput/shape] ${d.en}: label must be { de, en }.`}}):c.length>0&&n.push({path:`${a}.label`,reason:{de:`[i18n/missingTranslation] ${d.de}: Beschriftung fehlt in ${c.join(", ")}.`,en:`[i18n/missingTranslation] ${d.en}: label is missing in ${c.join(", ")}.`}})}),n}s(t$,"staffInputIssues");var ng={required:!0,description:"Offer slug (its offerKey)"},Hh=class extends D{static{s(this,"ApplicationsListCommand")}static paths=[["applications","list"]];static usage=E.Usage({category:"Admission",description:"List an offer's applications (id, status, board state, applicant, test)"});offer=p.String("--offer",ng);testOnly=p.Boolean("--test-only",!1,{description:"Only test applications"});async execute(){let t=await this.caller(),n=await t.query(S.admission.listForAngebot,{client:this.requireTenant(t),offerKey:this.offer}),r=CT(n).filter(i=>!this.testOnly||i.test==="test");return this.print(r,i=>i,["id","status","state","applicant","test"]),0}},Yh=class extends D{static{s(this,"ApplicationsCountsCommand")}static paths=[["applications","counts"]];static usage=E.Usage({category:"Admission",description:"Count an offer's applications per list"});offer=p.String("--offer",ng);async execute(){let t=await this.caller(),n=await t.query(S.admission.getCountsByListForAngebot,{client:this.requireTenant(t),offerKey:this.offer});return this.print(n,r=>[...Object.entries(r.counts).map(([i,o])=>({list:i,count:String(o)})),{list:"total",count:String(r.total)}],["list","count"]),0}},Jh=class extends D{static{s(this,"ApplicationsShowCommand")}static paths=[["applications","show"]];static usage=E.Usage({category:"Admission",description:"One application: status, test flag, offer, current workflow nodes"});application=p.String({required:!0});async execute(){let t=await this.caller(),n=this.application,r=await t.query(S.admission.get,{applicationId:n});if(r===null)throw new Error(`applications show: no application ${n} (or not visible to you)`);let i=await t.query(S.workflow.getInstance,{applicationId:n});return this.print({application:r,currentNodes:i?.instance.currentNodeIds??[]},o=>[{key:"id",value:n},{key:"status",value:o.application.status},{key:"test",value:o.application.testMode?"ja":"nein"},{key:"offer",value:o.application.offerKey},{key:"current nodes",value:o.currentNodes.join(", ")}]),0}},Qh=class extends D{static{s(this,"ApplicationsStoreCommand")}static paths=[["applications","store"]];static usage=E.Usage({category:"Admission",description:"One application's process store: every address of its pinned graph, resolved (present / pending / absent)",details:"Staff only (applications.manage). --json prints one object keyed by the canonical address ($node\u2026, $task\u2026, $derived\u2026, $env\u2026). Values are shown whatever their audience \u2014 never hand the output to the family. Recipe: playbooks/applications/inspect-process-store.md."});application=p.String({required:!0});async execute(){let n=await(await this.caller()).query(S.processStoreView.get,{applicationId:this.application});return this.print(FT(n),()=>LT(n),["address","state","holds","producer","written"]),0}},Zh=class extends D{static{s(this,"ApplicationsStartTestCommand")}static paths=[["applications","start-test"]];static usage=E.Usage({category:"Admission",description:"Start a TEST application for an applicant (school year and level by key or id) and show what test mode offers next",details:"Always test mode. --applicant names the account by its login address (on prod only the tenant's test account); --party names the applicant party directly. Without --version it runs on the live generation, like the cockpit."});offer=p.String("--offer",ng);run=p.String("--run",{required:!0,description:"School year: its key or id (never its name)"});stage=p.String("--stage",{required:!0,description:"Level: its key or id (never its name)"});party=p.String("--party",{description:"Applicant party id"});applicant=p.String("--applicant",{description:"Applicant account login address (e.g. the test account test@example.com)"});version=p.String("--version",{description:"Offer version id to test (default: the live generation)"});staffInput=p.Array("--staff-input",{description:"A staff input the offer declares, as key=true|false \u2014 repeat it once per input; a staff start must set every one"});proxy=p.Boolean("--proxy",{description:"Start in Stellvertretung (--proxy) or not (--no-proxy); left out, the tenant's default applies, as in the cockpit"});async execute(){let t=await this.caller();DT(this.resolvedTarget(),this.prodUrls(),this.party,this.applicant);let n=this.requireTenant(t),r=NT(await t.query(S.admission.listAdmissionTree,{client:n}),this.offer,this.run,this.stage),i=this.party;if(this.applicant!==void 0){let d=await t.query(S.applicants.partyByEmail,{client:n,email:this.applicant});if(d===null)throw new Error(`applications start-test: no applicant account ${this.applicant} at this school (create it in the cockpit first)`);i=d}let o=await t.mutation(S.admission.staffStartApplicationForParty,{client:n,offerKey:this.offer,partyId:i,programRunId:r.programRunId,programStageId:r.programStageId,...this.proxy===void 0?{}:{startInProxy:this.proxy},staffInputs:r$(this.staffInput??[]),testMode:!0,...this.version===void 0?{}:{offerVersionId:this.version}}),a,l;try{let d=await t.query(S.workflow.getInstance,{applicationId:o.applicationId});if(d===null)throw new Error("the started application has no workflow instance");a=d.instance.currentNodeIds,l=(await bu(t,o.applicationId,a)).flatMap(c=>c.actions.map(u=>u.id))}catch(d){throw new Error(`applications start-test: started ${o.applicationId}, but reading its state failed: ${d instanceof Error?d.message:String(d)}`,{cause:d})}return this.print({applicationId:o.applicationId,currentNodes:a,testActions:l},d=>[{key:"application",value:d.applicationId},{key:"current nodes",value:d.currentNodes.join(", ")},{key:"test actions",value:d.testActions.join(", ")},{key:"next",value:`test-actions run --application ${d.applicationId} --action <id>`}]),0}},Xh=class extends D{static{s(this,"ApplicationsDiscardTestCommand")}static paths=[["applications","discard-test"]];static usage=E.Usage({category:"Admission",description:"Discard a TEST application (the server refuses a real one)"});application=p.String({required:!0});async execute(){return await(await this.caller()).mutation(S.admission.discardTest,{applicationId:this.application}),this.print({discarded:this.application},n=>[{key:"discarded",value:n.discarded}]),0}},eg=class extends D{static{s(this,"ApplicationsStaffInputListCommand")}static paths=[["applications","staff-input","list"]];static usage=E.Usage({category:"Admission",description:"An application's internal inputs (set at the start): value, and why one can no longer be corrected"});application=p.String({required:!0});async execute(){let n=await(await this.caller()).query(S.admission.staffInputsOfApplication,{applicationId:this.application});return this.print(n,r=>r.map(i=>({key:i.key,label:i.label.de,value:String(i.value),correctable:i.block===null?"ja":i.block.de})),["key","label","value","correctable"]),0}},tg=class extends D{static{s(this,"ApplicationsStaffInputSetCommand")}static paths=[["applications","staff-input","set"]];static usage=E.Usage({category:"Admission",description:"Correct one internal input of an application, with a reason \u2014 refused once a node that reads it was entered",examples:[["Untick \u201EKind von Mitarbeitenden\u201C",'plexus-cli --env prod --tenant <t> --allow-prod applications staff-input set <id> --input staffApplication=false --reason "falsch angehakt"']]});application=p.String({required:!0});input=p.String("--input",{required:!0,description:"key=true|false"});reason=p.String("--reason",{required:!0,description:"Why \u2014 recorded on the application's activity feed"});async execute(){let t=await this.caller(),[{key:n,value:r}]=r$([this.input]);return await t.mutation(S.admission.correctStaffInput,{applicationId:this.application,key:n,value:r,reason:this.reason}),this.print({application:this.application,key:n,value:r},i=>[{key:"application",value:i.application},{key:i.key,value:String(i.value)}]),0}},n$=[Hh,Yh,Jh,Qh,Zh,Xh,eg,tg];function r$(e){return e.map(t=>{let[n="",r,...i]=t.split("=");if(!La.test(n)||r!=="true"&&r!=="false"||i.length>0)throw new Error(`--staff-input "${t}": expected key=true or key=false`);return{key:n,value:r==="true"}})}s(r$,"parseStaffInputs");var ig="bundle.yaml",i$="manifest.json",og="smartforms",o$="workflow.json";function rg(e){return JSON.parse(ke(e,"utf8"))}s(rg,"readJson");function Pe(e){return JSON.stringify(sg(e),null,2)+`
9378
9378
  `}s(Pe,"canonicalJson");function sg(e){return Array.isArray(e)?e.map(sg):e&&typeof e=="object"?Object.fromEntries(Object.keys(e).sort().map(t=>[t,sg(e[t])])):e}s(sg,"sortKeys");function Ie(e){let t=H.resolve(e),n=H.join(t,ig);if(!Oe(n))throw new Error(`offer: no ${ig} in ${t}`);let r=Zi.load(ke(n,"utf8"));Kj(r,n);let i=H.join(t,o$),o,a=Object.keys(r.smartforms??{});if(a.length>0){o={};for(let l of a){let d=H.join(t,og,`${l}.json`);if(!Oe(d))throw new Error(`offer: bundle.yaml declares smartform "${l}" but ${og}/${l}.json is missing`);o[l]=rg(d)}}return{dir:t,index:r,manifest:rg(H.join(t,i$)),...o?{smartforms:o}:{},...Oe(i)?{workflow:rg(i)}:{}}}s(Ie,"readBundle");function Tu(e,t,n,r){Oe(e)&&Pe(r(ke(e,"utf8")))===Pe(t)||gt(e,n,"utf8")}s(Tu,"writeIfChanged");function Bn(e){if(Wt(e.dir,{recursive:!0}),Tu(H.join(e.dir,ig),e.index,Zi.dump(e.index,{lineWidth:100,sortKeys:!1}),t=>Zi.load(t)),Tu(H.join(e.dir,i$),e.manifest,Pe(e.manifest),JSON.parse),e.smartforms!==void 0){let t=H.join(e.dir,og);Wt(t,{recursive:!0});for(let[n,r]of Object.entries(e.smartforms))Tu(H.join(t,`${n}.json`),r,Pe(r),JSON.parse)}e.workflow!==void 0&&Tu(H.join(e.dir,o$),e.workflow,Pe(e.workflow),JSON.parse)}s(Bn,"writeBundle");function Kj(e,t){let n=[];if(e?.module||n.push("module"),e?.tenant||n.push("tenant"),e?.label||n.push("label"),e?.slugs?.manifest||n.push("slugs.manifest"),n.length>0)throw new Error(`offer: ${t} is missing required keys: ${n.join(", ")}`)}s(Kj,"assertIndex");var jj=new Set(["if","else","in","true","false","null"]),Bj=new Set(["==","!=","<=",">=","&&","||"]);function Vj(e){return e>="0"&&e<="9"}s(Vj,"isDigit");function Uj(e){return/[a-zA-Z_$]/.test(e)}s(Uj,"isIdentStart");function Gj(e){return/[a-zA-Z0-9_.$]/.test(e)}s(Gj,"isIdentCont");function zj(e){let t=[],n=0;for(;n<e.length;){let r=e.charAt(n);if(r===" "||r===" "||r===`
9379
9379
  `||r==="\r"){n++;continue}if(r==="'"){let o=n+1,a="";for(;o<e.length&&e.charAt(o)!=="'";)e.charAt(o)==="\\"&&o+1<e.length?(a+=e.charAt(o+1),o+=2):(a+=e.charAt(o),o++);o>=e.length&&_(`Unterminated string at ${n}`),t.push({t:"str",v:a}),n=o+1;continue}if(Vj(r)){let o=n;for(;o<e.length&&/[0-9.]/.test(e.charAt(o));)o++;t.push({t:"num",v:Number(e.slice(n,o))}),n=o;continue}if(Uj(r)){let o=n;for(;o<e.length&&Gj(e.charAt(o));)o++;let a=e.slice(n,o);jj.has(a)?t.push({t:"kw",v:a}):t.push({t:"ident",v:a}),n=o;continue}let i=e.slice(n,n+2);if(Bj.has(i)){t.push({t:"op",v:i}),n+=2;continue}if("<>!".includes(r)){t.push({t:"op",v:r}),n++;continue}if("()[],".includes(r)){t.push({t:"punct",v:r}),n++;continue}_(`Unexpected char '${r}' at ${n}`)}return t}s(zj,"tokenise");var s$=1e4,a$=128;function rs(e){e.depth++,e.depth>a$&&_(`Expression nesting too deep (> ${a$})`)}s(rs,"enterDepth");function p$(e){return e.pos<e.tokens.length?e.tokens[e.pos]:null}s(p$,"peek");function Dt(e){let t=e.tokens[e.pos];return t||_(`Unexpected end at ${e.pos}`),e.pos++,t}s(Dt,"take");function Ft(e,t,n){let r=p$(e);return!(!r||r.t!==t||n!==void 0&&r.v!==n)}s(Ft,"match");function ro(e,t,n){return Ft(e,t,n)||_(`Expected ${t}${n?`:${n}`:""} at ${e.pos}`),Dt(e)}s(ro,"expect");function Vr(e){rs(e);try{return Ft(e,"kw","if")?Wj(e):Hj(e)}finally{e.depth--}}s(Vr,"parseExpr");function Wj(e){ro(e,"kw","if"),ro(e,"punct","(");let t=Vr(e);ro(e,"punct",")");let n=Vr(e);ro(e,"kw","else");let r=Vr(e);return{kind:"if",cond:t,then:n,else:r}}s(Wj,"parseIf");function Hj(e){let t=l$(e),n=0;try{for(;Ft(e,"op","||");){Dt(e),rs(e),n++;let r=l$(e);t={kind:"binary",op:"||",left:t,right:r}}}finally{e.depth-=n}return t}s(Hj,"parseLogicOr");function l$(e){let t=d$(e),n=0;try{for(;Ft(e,"op","&&");){Dt(e),rs(e),n++;let r=d$(e);t={kind:"binary",op:"&&",left:t,right:r}}}finally{e.depth-=n}return t}s(l$,"parseLogicAnd");function d$(e){let t=c$(e),n=0;try{for(;Ft(e,"op","==")||Ft(e,"op","!=");){let r=Dt(e).v;rs(e),n++;let i=c$(e);t={kind:"binary",op:r,left:t,right:i}}}finally{e.depth-=n}return t}s(d$,"parseEquality");function c$(e){let t=lg(e),n=0;try{for(;Ft(e,"op","<")||Ft(e,"op","<=")||Ft(e,"op",">")||Ft(e,"op",">=")||Ft(e,"kw","in");){let r=Dt(e),i=r.t==="kw"?"in":r.v;rs(e),n++;let o=lg(e);t={kind:"binary",op:i,left:t,right:o}}}finally{e.depth-=n}return t}s(c$,"parseCompare");function lg(e){if(Ft(e,"op","!")){Dt(e),rs(e);try{return{kind:"unary",op:"!",operand:lg(e)}}finally{e.depth--}}return Yj(e)}s(lg,"parseUnary");function Yj(e){let t=p$(e);if(t||_("Unexpected end"),t.t==="num")return Dt(e),{kind:"num",value:t.v};if(t.t==="str")return Dt(e),{kind:"str",value:t.v};if(t.t==="kw"&&t.v==="true")return Dt(e),{kind:"bool",value:!0};if(t.t==="kw"&&t.v==="false")return Dt(e),{kind:"bool",value:!1};if(t.t==="kw"&&t.v==="null")return Dt(e),{kind:"null"};if(t.t==="punct"&&t.v==="("){Dt(e);let n=Vr(e);return ro(e,"punct",")"),n}if(t.t==="punct"&&t.v==="["){Dt(e);let n=[];if(!Ft(e,"punct","]"))for(n.push(Vr(e));Ft(e,"punct",",");)Dt(e),n.push(Vr(e));return ro(e,"punct","]"),{kind:"arr",items:n}}if(t.t==="ident"){let n=t.v;if(Dt(e),Ft(e,"punct","(")){Dt(e);let r=[];if(!Ft(e,"punct",")"))for(r.push(Vr(e));Ft(e,"punct",",");)Dt(e),r.push(Vr(e));return ro(e,"punct",")"),{kind:"call",name:n,args:r}}return{kind:"ident",path:n}}_(`Unexpected token at ${e.pos}`)}s(Yj,"parsePrimary");function Lt(e){e.length>s$&&_(`Expression too long (${e.length} > ${s$})`);let t={tokens:zj(e),pos:0,depth:0},n=Vr(t);return t.pos<t.tokens.length&&_(`Unexpected trailing token at ${t.pos}`),n}s(Lt,"parseExpression");var Jj=new Map([["today",()=>new Date().toISOString().slice(0,10)],["years_between",(e,t)=>{if(typeof e!="string"||typeof t!="string")return null;let n=new Date(e),r=new Date(t);if(isNaN(n.getTime())||isNaN(r.getTime()))return null;let i=r.getFullYear()-n.getFullYear(),o=r.getMonth()-n.getMonth();return(o<0||o===0&&r.getDate()<n.getDate())&&i--,i}],["length",e=>typeof e=="string"||Array.isArray(e)?e.length:0]]);function ht(e,t){switch(e.kind){case"num":return e.value;case"str":return e.value;case"bool":return e.value;case"null":return null;case"ident":{let n=Object.hasOwn(t.values,e.path)?t.values[e.path]:void 0;return n===void 0?null:n}case"arr":return e.items.map(n=>ht(n,t));case"unary":{let n=ht(e.operand,t);return!gi(n)}case"call":{let n=t.functions!==void 0&&Object.hasOwn(t.functions,e.name)?t.functions[e.name]:Jj.get(e.name);n||_(`Unknown function '${e.name}'`);let r=e.args.map(i=>ht(i,t));return n(...r)}case"binary":return Qj(e.op,e.left,e.right,t);case"if":return gi(ht(e.cond,t))?ht(e.then,t):ht(e.else,t)}}s(ht,"evaluate");function Qj(e,t,n,r){if(e==="&&"){let a=ht(t,r);return gi(a)?gi(ht(n,r)):!1}if(e==="||"){let a=ht(t,r);return gi(a)?!0:gi(ht(n,r))}let i=ht(t,r),o=ht(n,r);switch(e){case"==":return ag(i,o);case"!=":return!ag(i,o);case"<":{let[a,l]=$u(i,o);return a!==null&&l!==null&&a<l}case"<=":{let[a,l]=$u(i,o);return a!==null&&l!==null&&a<=l}case">":{let[a,l]=$u(i,o);return a!==null&&l!==null&&a>l}case">=":{let[a,l]=$u(i,o);return a!==null&&l!==null&&a>=l}case"in":return Array.isArray(o)?o.some(a=>ag(a,i)):!1}}s(Qj,"evalBinary");function $u(e,t){return[u$(e),u$(t)]}s($u,"orderedOperands");function u$(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"){if(e.trim()==="")return null;let t=Number(e);return Number.isFinite(t)?t:null}return null}s(u$,"numericOperand");function ag(e,t){return e===t?!0:e==null||t==null?!1:typeof e=="number"&&typeof t=="string"?e===Number(t):typeof e=="string"&&typeof t=="number"?Number(e)===t:!1}s(ag,"looseEq");function gi(e){return!(e==null||e===!1||e===0||e===""||Array.isArray(e)&&e.length===0)}s(gi,"truthy");function bt(e){let t=new Set;return Br(e,t),[...t]}s(bt,"dependencies");function Br(e,t){switch(e.kind){case"ident":t.add(e.path);return;case"call":e.args.forEach(n=>Br(n,t));return;case"arr":e.items.forEach(n=>Br(n,t));return;case"unary":Br(e.operand,t);return;case"binary":Br(e.left,t),Br(e.right,t);return;case"if":Br(e.cond,t),Br(e.then,t),Br(e.else,t);return;default:return}}s(Br,"walk");var f$=new Map;function nr(e){let t=f$.get(e);return t||(t=Lt(e),f$.set(e,t)),t}s(nr,"parseCached");function Zj(e,t){return ht(nr(e),t)}s(Zj,"evalExpression");function m$(e,t){return gi(Zj(e,t))}s(m$,"evalBoolean");var is={team:{label:{de:"Team",en:"Team"},optionSource:"tenantTeams",existence:{check:"generic",catalog:"teamKeys"}},roleKey:{label:{de:"Rolle",en:"Role"},optionSource:"tenantRoles",existence:{check:"node",codes:["roleAssign/unknownRoleKey","completenessCheck/unknownRole"]}},article:{label:{de:"Artikel",en:"Article"},optionSource:"programArticles",existence:{check:"node",codes:["collectPayment/unknownArticle"]}},legalEntity:{label:{de:"Tr\xE4ger",en:"Legal entity"},optionSource:"tenantTraeger",existence:{check:"node",codes:["governedDocument/unknownTraeger","collectPayment/unknownPayee"]}},contractGenerator:{label:{de:"Vertragsgenerator",en:"Contract generator"},optionSource:"tenantGenerators",existence:{check:"publish",by:"admittedGeneratorByKey"}},documentTemplate:{label:{de:"Dokumentvorlage",en:"Document template"},optionSource:"tenantDocumentTemplates",existence:{check:"publish",by:"governedDocument/unknownTemplate"}},smartForm:{label:{de:"Formular",en:"Form"},optionSource:"offerSmartForms",existence:{check:"publish",by:"form/unknownSmartForm"}},unit:{label:{de:"Einrichtung",en:"Unit"},optionSource:"tenantUnits",existence:{check:"generic",catalog:"unitKeys"}},formFlag:{label:{de:"Merkmal im Formular",en:"Flag in the form"},optionSource:"targetFormFlags",existence:{check:"node",codes:["setFlag/unknownFlag"]}}};function Ru(e){return typeof e=="string"&&Object.hasOwn(is,e)}s(Ru,"isResourceType");var fne=Object.keys(is).filter(e=>is[e].existence.check==="generic");var Tn="contractGenerator",dg="documentTemplate";function qa(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=Object.keys(t);return(t.kind==="generator"||t.kind==="package")&&typeof t.key=="string"&&t.key.length>0&&(t.revision===void 0||typeof t.revision=="number"&&Number.isInteger(t.revision)&&t.revision>0)&&n.every(r=>r==="kind"||r==="key"||r==="revision")}s(qa,"isGeneratorRef");function h$(e,t){let n=e.inputs?.[t];return n?.kind==="literal"?n.value:void 0}s(h$,"literalOf");function Ur(e){let t=h$(e,Tn);return qa(t)?t:null}s(Ur,"generatorRefOfNode");function rr(e){let t=h$(e,dg);return typeof t=="string"&&t.length>0?t:null}s(rr,"documentTemplateKeyOfNode");function g$(e){return`${e.kind}:${e.key}${e.revision===void 0?"":`@${e.revision}`}`}s(g$,"generatorRefLabel");var y$=/^\d{4}-\d{2}-\d{2}$/;function ir(e,t){return{de:e,en:t}}s(ir,"issue");function io(e){if(typeof e!="object"||e===null)return ir("keine Reduktion","not a reduction");let t=e;if(t.kind==="none")return Object.keys(t).length===1?null:ir('\u201Ekeine Reduktion" tr\xE4gt keine weiteren Angaben','"no reduction" carries no further details');if(t.kind!=="amount")return ir(`unbekannte Art ${JSON.stringify(t.kind)}`,`unknown kind ${JSON.stringify(t.kind)}`);let{amount:n,activeFrom:r,activeTo:i}=t;return typeof n!="number"||!Number.isFinite(n)||n<=0?ir("der Betrag muss gr\xF6\xDFer als 0 \u20AC sein","the amount must be greater than \u20AC0"):Number.isInteger(Number((n*100).toFixed(6)))?typeof r!="string"||!y$.test(r)?ir("der Beginn fehlt (JJJJ-MM-TT)","the start is missing (YYYY-MM-DD)"):typeof i!="string"||!y$.test(i)?ir("das Ende fehlt (JJJJ-MM-TT)","the end is missing (YYYY-MM-DD)"):i<r?ir("das Ende liegt vor dem Beginn","the end is before the start"):t.floorTotal!==void 0&&(typeof t.floorTotal!="number"||!Number.isSafeInteger(t.floorTotal)||t.floorTotal<0)?ir("die Untergrenze muss ein nichtnegativer Centbetrag sein","the floor must be a non-negative amount in cents"):t.pricePeriod!==void 0&&!["month","year","once","unit"].includes(String(t.pricePeriod))?ir("ung\xFCltige Preisperiode","invalid price period"):Object.keys(t).some(o=>!["kind","amount","activeFrom","activeTo","floorTotal","pricePeriod"].includes(o))?ir("unbekannte Angaben","unknown details"):null:ir("der Betrag hat mehr als zwei Nachkommastellen","the amount has more than two decimal places")}s(io,"reductionShapeIssue");function w$(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.groupKey=="string"&&t.groupKey.length>0&&Array.isArray(t.grantKeys)&&t.grantKeys.every(n=>typeof n=="string"&&n.length>0)&&(t.reduction===void 0||io(t.reduction)===null&&t.reduction.kind==="amount")&&Object.keys(t).every(n=>n==="groupKey"||n==="grantKeys"||n==="reduction")}s(w$,"isPricedGroupValue");var cg=["street","hausnr","plz","ort","land"];function b$(e){return cg.includes(e)}s(b$,"isAddressPart");var Xj=["municipality","municipalityKey","district","districtKey"],ug=[...cg,...Xj],fg={string:"text",email:"text",tel:"text",number:"number",date:"date",boolean:"boolean",enum:"option",address:"composite",docRef:"file",party:"edge",personRef:"edge",personList:"edge",roleKey:"roleKey",pricedItem:"pricedItem",pricedGroup:"pricedGroup",reduction:"reduction",article:"article",legalEntity:"legalEntity",contractGenerator:"contractGenerator",documentTemplate:"documentTemplate",localizedText:"localizedText"},os=Object.keys(fg);function yi(e){return typeof e=="string"&&e in fg}s(yi,"isValueType");function mn(e){return e===void 0?void 0:fg[e]}s(mn,"dataTypeOf");function Iu(e,t){let n=mn(e),r=mn(t);return n!==void 0&&n===r}s(Iu,"valueTypesCompatible");function pg(e){return e===null?"null is not a text in both languages":Ka(e,{type:"localizedText"})}s(pg,"completeLocalizedTextIssue");function Ka(e,t){if(Ru(t.type)&&!yi(t.type))return typeof e=="string"&&e.length>0?null:`${JSON.stringify(e)} is not a ${t.type} key`;let n=mn(t.type),r=JSON.stringify(e),i=`slot type "${t.type}" takes a binding, not a literal`;if(n===void 0||n==="composite"||n==="file"||n==="edge")return i;if(e===null)return null;switch(n){case"text":return typeof e=="string"?null:`${r} is not a text (slot type "${t.type}")`;case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)?null:`${r} is not a date YYYY-MM-DD`;case"number":return typeof e=="number"&&Number.isFinite(e)?null:`${r} is not a number`;case"boolean":return typeof e=="boolean"?null:`${r} is not true/false`;case"option":{if(typeof e!="string")return`${r} is not an option value`;let o=(t.enumOptions??[]).map(a=>a.value);return o.length===0||o.includes(e)?null:`${r} is not one of the options ${o.join(", ")}`}case"pricedItem":{let o=e;return typeof o=="object"&&typeof o.itemKey=="string"&&o.itemKey.length>0&&Array.isArray(o.grantKeys)&&o.grantKeys.every(a=>typeof a=="string")?null:`${r} is not a priced item {"itemKey":\u2026,"grantKeys":[\u2026]}`}case"pricedGroup":return w$(e)?null:`${r} is not a priced group {"groupKey":\u2026,"grantKeys":[\u2026]}`;case"article":return typeof e=="string"&&e.length>0?null:`${r} is not an article key`;case"legalEntity":return typeof e=="string"&&e.length>0?null:`${r} is not a legal entity key`;case"contractGenerator":return qa(e)?null:`${r} is not a contract generator {"kind":"generator"|"package","key":\u2026,"revision"?:n}`;case"documentTemplate":return typeof e=="string"&&e.length>0?null:`${r} is not a document template key`;case"roleKey":return typeof e=="string"&&e.length>0?null:`${r} is not a role key`;case"localizedText":{let o=e,a=s(l=>typeof l=="string"&&l.trim().length>0,"filled");return typeof o=="object"&&Object.keys(o).sort().join(",")==="de,en"&&a(o.de)&&a(o.en)?null:`${r} is not a text in both languages {"de":\u2026,"en":\u2026}`}case"reduction":{let o=io(e);return o===null?null:`${r} is not a reduction \u2014 ${o.en}`}}}s(Ka,"literalTypeIssue");var k$=hi,wi=`${k$}.`,eB=new Set(["text","number","date","boolean","option","edge"]);function Ou(e,t){let n=e[t];return n===void 0&&_(`[env/unknownKey] no environment key '${t}'`),typeof n=="string"?null:Object.keys(n)}s(Ou,"contextFields");function v$(e,t){return Object.hasOwn(e,t)}s(v$,"isContextKey");function x$(e){let t=[];for(let n of Object.keys(e)){let r=Ou(e,n);if(r===null)t.push(n);else for(let i of r)t.push(`${n}.${i}`)}return t}s(x$,"leafPaths");function ja(e,t){let[n="",r,...i]=t.split(".");if(!v$(e,n)||i.length>0)return;let o=e[n];if(typeof o=="string")return r===void 0?o:void 0;if(!(r===void 0||!Object.hasOwn(o,r)))return o[r]}s(ja,"leafType");function S$(e){let t=new Set;for(let n of e){let r=ss(n);r!==null&&t.add(r.split(".")[0])}return[...t]}s(S$,"contextKeysOf");function ss(e){return e.startsWith(wi)?e.slice(wi.length):null}s(ss,"contextPathOf");function Ba(e){return e===k$||e.startsWith(wi)}s(Ba,"isContextIdentifier");function Pu(e,t){let n=ss(t)??"",[r=""]=n.split("."),i=Object.keys(e);if(!v$(e,r))return{code:"env/unknownKey",message:{de:`'${t}' nennt keinen Umgebungsschl\xFCssel \u2014 bekannt: ${i.join(", ")}.`,en:`'${t}' names no environment key \u2014 known: ${i.join(", ")}.`}};if(ja(e,n)!==void 0)return null;let o=Ou(e,r);return{code:"env/unknownKey",message:o===null?{de:`'${t}': der Umgebungsschl\xFCssel '${r}' ist ein einzelner Wert \u2014 lies ihn als '${wi}${r}'.`,en:`'${t}': environment key '${r}' is a single value \u2014 read it as '${wi}${r}'.`}:{de:`'${t}': der Umgebungsschl\xFCssel '${r}' hat die Felder ${o.join(", ")}.`,en:`'${t}': environment key '${r}' has the fields ${o.join(", ")}.`}}}s(Pu,"identifierIssue");function _u(e,t,n=Object.keys(e)){let r={};for(let i of n){let o=Ou(e,i),a=Object.hasOwn(t,i)?t[i]:void 0;if(a===void 0&&_(`[env/missing] context key '${i}' was not supplied`),o===null){r[`${wi}${i}`]=a;continue}for(let l of o){let d=typeof a=="object"&&a!==null&&Object.hasOwn(a,l)?a[l]:void 0;d===void 0&&_(`[env/missing] context key '${i}' carries no '${l}'`),r[`${wi}${i}.${l}`]=d}}return r}s(_u,"flatten");function A$(e,t,n){if(n===void 0)return!1;let r=Ou(e,t);return r===null?!0:typeof n=="object"&&n!==null&&r.every(i=>n[i]!==void 0)}s(A$,"contextValueComplete");function tB(e,t){switch(t){case"number":return typeof e=="number"&&Number.isFinite(e);case"boolean":return typeof e=="boolean";case"date":return typeof e=="string"&&/^\d{4}-\d{2}-\d{2}/.test(e);default:return typeof e=="string"}}s(tB,"valueMatchesDataType");function E$(e,t,n=Object.keys(e.types)){let r=new Set(n);for(let i of x$(e.types)){if(!r.has(i.split(".")[0]))continue;let o=t[`${wi}${i}`];o===void 0&&_(`[env/missing] context path '${i}' was not supplied`);let a=e.fields[i];if(o===null){a.nullable||_(`[env/null] context path '${i}' is not nullable but carries null`);continue}let l=mn(ja(e.types,i));tB(o,l)||_(`[env/type] context path '${i}' expects ${l}, got ${JSON.stringify(o)}`),a.valueSet.kind==="fixed"&&!a.valueSet.values.includes(o)&&_(`[env/value] context path '${i}' carries '${String(o)}', outside ${a.valueSet.values.join(" | ")}`)}}s(E$,"assertContextValues");function nB(e){let t=[],n=x$(e.types);for(let r of n){let i=ja(e.types,r),o=mn(i);if(!yi(i)||o===void 0||!eB.has(o)){t.push(`'${r}' has type '${String(i)}', not a scalar value type`);continue}let a=Object.hasOwn(e.fields,r)?e.fields[r]:void 0;if(a===void 0){t.push(`'${r}' has no field spec (value set + nullability)`);continue}a.valueSet.kind==="fixed"&&(a.valueSet.values.length===0&&t.push(`'${r}' has an empty fixed value set`),o!=="text"&&o!=="option"&&t.push(`'${r}' is ${o}; a fixed value set needs a text or option leaf`))}for(let r of Object.keys(e.fields))n.includes(r)||t.push(`field spec '${r}' names no leaf of the schema`);return t}s(nB,"schemaIssues");function as(e){let t=nB(e);t.length>0&&_(`[env/schema] ${t.join("; ")}`)}s(as,"assertSchema");var Nu={length:{params:["text"],returns:"number"},years_between:{params:["date","date"],returns:"number"}};function bi(e){return JSON.stringify(e)}s(bi,"canonical");function ds(e){return e.kind==="binary"&&e.op==="&&"?[...ds(e.left),...ds(e.right)]:[e]}s(ds,"conjuncts");function R$(e,t){let n;try{n=Lt(e)}catch{return!1}let r=bi(Lt(t));return ds(n).some(i=>bi(i)===r)}s(R$,"hasConjunct");function I$(e,t){try{return bi(Lt(e))===bi(Lt(t))}catch{return!1}}s(I$,"sameCondition");function O$(e){let t=[];for(let n of e)t.push(...bt(nr(n)));return S$(t)}s(O$,"contextKeysRead");function P$(e){try{return bt(Lt(e)).some(Ba)}catch{return!1}}s(P$,"readsContext");var rB=/^\d{4}-\d{2}-\d{2}$/,iB=new Set(["==","!=","<","<=",">",">=","in"]),oB=new Set(["<","<=",">",">="]);function Du(e,t,n=[]){as(t);let r;try{r=Lt(e)}catch(a){let l=a.message;return[Mt("condition/parse",`Bedingung '${e}' ist nicht lesbar: ${l}`,`condition '${e}' does not parse: ${l}`)]}let i=[];for(let a of bt(r)){if(!Ba(a)){i.push(Mt("condition/foreignIdentifier",`'${a}' ist kein Umgebungswert \u2014 Bedingungen lesen nur '$env.*'`,`'${a}' is not a context identifier \u2014 conditions read only '$env.*'`));continue}let l=Pu(t.types,a);l!==null&&i.push(Mt("condition/unknownIdentifier",l.message.de,l.message.en))}if(i.length>0)return i;let o=br(r,t,i);Va(o)||i.push(Mt("condition/notBoolean",`Bedingung '${e}' ist kein Ja/Nein-Ausdruck`,`condition '${e}' is not a yes/no expression`)),dB(r,t,i);for(let{identifier:a,op:l}of gg(r,t))i.push(Mt("condition/unguardedNullable",`'${l}' \xFCber '${a}', das leer sein kann, braucht davor eine Absicherung '${a} != null &&'`,`'${l}' over '${a}', which may be null, needs a guard '${a} != null &&' before it`));return i.push(...sB(r,n)),i}s(Du,"conditionIssues");function sB(e,t){let n=ds(e).map(bi);return t.flatMap(r=>{let i=Lt(r),o=aB(i);return o===null||!n.includes(bi(o))?[]:[{severity:"info",code:"condition/guardForm",message:{de:`[condition/guardForm] eine gespiegelte Absicherung z\xE4hlt nicht \u2014 schreibe sie genau als '${r}'`,en:`[condition/guardForm] a mirrored guard does not count \u2014 write it exactly as '${r}'`}}]})}s(sB,"guardFormHints");function aB(e){if(e.kind!=="binary"||e.op!=="=="&&e.op!=="!=")return null;let t={...e,left:e.right,right:e.left};return bi(t)===bi(e)?null:t}s(aB,"mirror");function Va(e){return e.t==="unknown"||e.t==="data"&&e.dt==="boolean"}s(Va,"isBooleanish");function _$(e){let t=ss(e);return t===null&&_(`[condition/invariant] '${e}' reached a pass that only sees $env identifiers`),t}s(_$,"contextPath");function N$(e,t){let n=ss(t);return n!==null&&e.fields[n]?.nullable===!0}s(N$,"isNullableLeaf");function lB(e,t){let n=mn(ja(e.types,_$(t)));return n===void 0?{t:"unknown"}:{t:"data",dt:n}}s(lB,"identType");function Cu(e,t){return e.t==="unknown"||t.t==="unknown"||e.t==="null"||t.t==="null"?!0:e.t==="array"||t.t==="array"?!1:e.t==="str"&&t.t==="str"?!0:e.t==="str"?T$(e.value,t.dt):t.t==="str"?T$(t.value,e.dt):e.dt===t.dt}s(Cu,"fits");function T$(e,t){return t==="text"||t==="option"||t==="edge"?!0:t==="date"?rB.test(e):!1}s(T$,"strFits");function $$(e){return e.t==="unknown"?"unknown":e.t==="data"&&e.dt==="number"?"number":null}s($$,"orderedCategory");function br(e,t,n){switch(e.kind){case"num":return{t:"data",dt:"number"};case"bool":return{t:"data",dt:"boolean"};case"str":return{t:"str",value:e.value};case"null":return{t:"null"};case"ident":return lB(t,e.path);case"arr":for(let r of e.items)br(r,t,n);return{t:"array"};case"unary":{let r=br(e.operand,t,n);return Va(r)||n.push(Mt("condition/notBoolean","'!' braucht einen Ja/Nein-Operanden","'!' needs a yes/no operand")),{t:"data",dt:"boolean"}}case"call":{let r=Object.hasOwn(Nu,e.name)?Nu[e.name]:void 0,i=e.args.map(l=>br(l,t,n));return r===void 0?(n.push(Mt("condition/functionNotAllowed",`Funktion '${e.name}' ist nicht erlaubt \u2014 erlaubt: ${Object.keys(Nu).join(", ")}`,`function '${e.name}' is not allowed \u2014 allowed: ${Object.keys(Nu).join(", ")}`)),{t:"unknown"}):(i.length===r.params.length&&i.every((l,d)=>l.t!=="null"&&Cu(l,{t:"data",dt:r.params[d]}))||n.push(Mt("condition/typeMismatch",`'${e.name}' nimmt (${r.params.join(", ")})`,`'${e.name}' takes (${r.params.join(", ")})`)),{t:"data",dt:r.returns})}case"if":{let r=br(e.cond,t,n);Va(r)||n.push(Mt("condition/notBoolean","'if' braucht eine Ja/Nein-Bedingung","'if' needs a yes/no condition"));let i=br(e.then,t,n),o=br(e.else,t,n);return Cu(i,o)||n.push(Mt("condition/typeMismatch","die beiden Zweige von 'if' haben verschiedene Typen","the two arms of 'if' differ in type")),i.t==="null"?o:i}case"binary":{let r=br(e.left,t,n),i=br(e.right,t,n);if(e.op==="&&"||e.op==="||")(!Va(r)||!Va(i))&&n.push(Mt("condition/notBoolean",`'${e.op}' braucht Ja/Nein-Operanden`,`'${e.op}' needs yes/no operands`));else if(e.op==="in")e.right.kind!=="arr"?n.push(Mt("condition/inWithoutArray","'in' braucht rechts eine Liste, z. B. ['a', 'b']","'in' needs a list on its right, e.g. ['a', 'b']")):e.right.items.every(o=>Cu(r,br(o,t,[])))||n.push(Mt("condition/typeMismatch","ein Listeneintrag von 'in' passt nicht zum Typ des linken Operanden","a list item of 'in' does not match the left operand's type"));else if(oB.has(e.op)){let o=$$(r),a=$$(i);(o===null||a===null||o!=="unknown"&&a!=="unknown"&&o!==a)&&n.push(Mt("condition/orderedComparison",`'${e.op}' vergleicht nur Zahlen \u2014 f\xFCr Daten years_between(\u2026) verwenden`,`'${e.op}' compares only numbers \u2014 for dates use years_between(\u2026)`))}else Cu(r,i)||n.push(Mt("condition/typeMismatch",`'${e.op}' vergleicht Werte verschiedener Typen`,`'${e.op}' compares values of different types`));return{t:"data",dt:"boolean"}}}}s(br,"typeOf");function mg(e){return e.kind==="str"||e.kind==="num"||e.kind==="bool"}s(mg,"isLiteral");function C$(e){let t=[],n=s(r=>{if(r.kind==="binary"&&iB.has(r.op)){if(r.left.kind==="ident"){let i=r.op==="in"&&r.right.kind==="arr"?r.right.items.filter(mg):mg(r.right)?[r.right]:[];i.length>0&&t.push({ident:r.left.path,literals:i})}r.right.kind==="ident"&&mg(r.left)&&t.push({ident:r.right.path,literals:[r.left]})}D$(r,n)},"visit");return n(e),t}s(C$,"comparedLiterals");function dB(e,t,n){for(let{ident:r,literals:i}of C$(e)){let o=cB(r,i,t);o!==null&&n.push(o)}}s(dB,"literalIssues");function hg(e,t){let n;try{n=Lt(e)}catch{return[]}let r=[];for(let{ident:i,literals:o}of C$(n)){let a=ss(i);if(!(a===null||t.fields[a]?.valueSet.kind!=="live"))for(let l of o)l.kind==="str"&&r.push({path:a,value:l.value})}return r}s(hg,"liveLiterals");function cB(e,t,n){let r=n.fields[_$(e)]?.valueSet;if(r?.kind==="unstable")return Mt("condition/literalOnUnstable",`'${e}' ist nicht \xFCber Umgebungen stabil \u2014 vergleiche ihn mit keinem festen Wert; verzweige stattdessen \xFCber ein stabiles Merkmal`,`'${e}' is not stable across environments \u2014 compare it to no literal; branch on a stable attribute instead`);if(r?.kind!=="fixed")return null;let i=t.flatMap(a=>a.kind==="str"&&!r.values.includes(a.value)?[`'${a.value}'`]:[]);if(i.length===0)return null;let o=r.values.map(a=>`'${a}'`).join(", ");return Mt("condition/literalOutsideSet",`'${e}' kennt nur ${o} \u2014 nicht ${i.join(", ")}`,`'${e}' takes only ${o} \u2014 not ${i.join(", ")}`)}s(cB,"valueSetIssue");function D$(e,t){switch(e.kind){case"binary":t(e.left),t(e.right);return;case"unary":t(e.operand);return;case"call":e.args.forEach(t);return;case"arr":e.items.forEach(t);return;case"if":t(e.cond),t(e.then),t(e.else);return;default:return}}s(D$,"forEachChild");function F$(e){return e.kind==="binary"&&(e.op==="=="||e.op==="!=")&&(e.left.kind==="ident"&&e.right.kind==="null"||e.left.kind==="null"&&e.right.kind==="ident")}s(F$,"isNullTest");function L$(e){return ds(e).flatMap(t=>{let n=M$(t);return n===null?[]:[n]})}s(L$,"guardsOf");function Ua(e,t,n){switch(e.kind){case"ident":return N$(t,e.path)&&!n.has(e.path)?e.path:null;case"call":for(let r of e.args){let i=Ua(r,t,n);if(i!==null)return i}return null;case"if":return Ua(e.then,t,new Set([...n,...L$(e.cond)]))??Ua(e.else,t,n);default:return null}}s(Ua,"unguardedNullSource");function M$(e){return!F$(e)||e.kind!=="binary"||e.op!=="!="?null:e.left.kind==="ident"?e.left.path:e.right.kind==="ident"?e.right.path:null}s(M$,"guardedIdent");function ls(e,t,n,r){if(e.kind==="binary"&&e.op==="&&"){let i=new Set(n);for(let o of ds(e)){ls(o,t,i,r);let a=M$(o);a!==null&&i.add(a)}return}if(e.kind==="if"){ls(e.cond,t,n,r),ls(e.then,t,new Set([...n,...L$(e.cond)]),r),ls(e.else,t,n,r);return}if(e.kind==="binary"&&e.op==="!="&&e.left.kind!=="null"&&e.right.kind!=="null"){let i=Ua(e.left,t,n)??Ua(e.right,t,n);i!==null&&r(i,"!=")}if(e.kind==="unary"&&!F$(e.operand)){let i=bt(e.operand).filter(o=>N$(t,o)&&!n.has(o));i.length>0&&r(i[0],"!")}D$(e,i=>ls(i,t,n,r))}s(ls,"nullableReads");function gg(e,t){as(t);let n=[];return ls(e,t,new Set,(r,i)=>{n.some(o=>o.identifier===r)||n.push({identifier:r,op:i})}),n}s(gg,"unguardedNullableReads");function Mt(e,t,n){return{severity:"error",code:e,message:{de:`[${e}] ${t}`,en:`[${e}] ${n}`}}}s(Mt,"error");function ki(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.itemKey=="string"&&t.itemKey.length>0&&Array.isArray(t.grantKeys)&&t.grantKeys.every(n=>typeof n=="string"&&n.length>0)&&(t.reduction===void 0||io(t.reduction)===null&&t.reduction.kind==="amount")}s(ki,"isPricedItemValue");var cs=["freetext","recommendation","choice","pricedItem","record","reduction"],us=[...cs,"appointment"];function K$(e){return typeof e=="string"&&us.includes(e)}s(K$,"isTaskResultKind");function vi(e){return typeof e=="string"&&cs.includes(e)}s(vi,"isRecordedTaskResultKind");function fs(e){return vi(e.kind)}s(fs,"isRecordedTaskResult");var Fu=["number","boolean","enum"];function yg(e){return typeof e=="string"&&Fu.includes(e)}s(yg,"isRecordFieldType");var wg=["form","siblingRank"];var Gr={freetext:{choiceValueType:null,valueType:null,textValueType:"string",label:{de:"Freitext",en:"Free text"}},recommendation:{choiceValueType:"enum",valueType:null,textValueType:"string",label:{de:"Empfehlung",en:"Recommendation"}},choice:{choiceValueType:"enum",valueType:"enum",textValueType:"string",label:{de:"Auswahl",en:"Choice"}},pricedItem:{choiceValueType:"enum",valueType:"pricedItem",textValueType:"string",label:{de:"Preisposition",en:"Priced item"}},reduction:{choiceValueType:null,valueType:"reduction",textValueType:"string",label:{de:"Reduktion",en:"Reduction"}},record:{choiceValueType:null,valueType:null,textValueType:"string",label:{de:"Erfassung",en:"Record"}},appointment:{choiceValueType:null,valueType:null,textValueType:null,label:{de:"Termin",en:"Appointment"}}};function oo(e){return(e.kind==="freetext"||e.kind==="recommendation"||e.kind==="choice")&&e.writes===void 0}s(oo,"isProseResult");function Lu(e){return e.kind==="record"?(e.fields??[]).filter(t=>typeof t.writes=="string"&&t.writes.length>0&&yg(t.type)).map(t=>({key:t.writes,valueType:t.type,field:t})):uB(e)}s(Lu,"draftResultStoreWrites");function uB(e){let t=Gr[e.kind].valueType;return e.writes===void 0||t===null?[]:[{key:e.writes,valueType:t}]}s(uB,"singleStoreWrite");var q$="team:";function ps(e){if(e==="all")return{kind:"all"};if(e==="external"||e.length===0)return null;if(e.startsWith(q$)){let t=e.slice(q$.length);return t.length===0?null:{kind:"team",groupKey:t}}return{kind:"channel",channelKey:e}}s(ps,"parseTaskResultChat");var We={unknownKind:"[taskResult/unknownKind]",onApproval:"[taskResult/onApproval]",unknownField:"[taskResult/unknownField]",choiceOptions:"[taskResult/choiceOptions]",textRequiredOnFreetext:"[taskResult/textRequiredOnFreetext]",chatMissing:"[taskResult/chatMissing]",chatExternal:"[taskResult/chatExternal]",chatUnknownChannel:"[taskResult/chatUnknownChannel]",appointmentMissingTitle:"[taskResult/appointmentMissingTitle]",pricedItemMissingItem:"[taskResult/pricedItemMissingItem]",pricedItemUnknownItem:"[taskResult/pricedItemUnknownItem]",pricedItemNotInProgram:"[taskResult/pricedItemNotInProgram]",pricedItemOfferWithoutProgram:"[taskResult/pricedItemOfferWithoutProgram]",itemOnNonPricedItem:"[taskResult/itemOnNonPricedItem]",writesOnProse:"[taskResult/writesOnProse]",filesOnKind:"[taskResult/filesOnKind]",labelMissing:"[taskResult/labelMissing]",appointmentInvalidDuration:"[taskResult/appointmentInvalidDuration]",recordFields:"[taskResult/recordFields]",fieldsOnNonRecord:"[taskResult/fieldsOnNonRecord]",recordSuggest:"[taskResult/recordSuggest]",reductionPrices:"[taskResult/reductionPrices]",pricesOnNonReduction:"[taskResult/pricesOnNonReduction]"};var ms={"assign{}":{kind:"team",codec:"key",involves:!0,required:!1,what:{de:"Team der Knoten-Aufgabe",en:"team of the node task"},consequence:{de:"beim Betreten des Knotens entsteht die Aufgabe f\xFCr niemanden",en:"entering the node creates the task for nobody"}},"tasks[].assign.group":{kind:"team",codec:"key",involves:!0,required:!0,what:{de:"Team der Aufgabe",en:"team of the task"},consequence:{de:"die Aufgabe kann nicht angelegt werden, und der Prozess bleibt stehen",en:"the task cannot be created and the process stops"}},"tasks[].params.revisionGroup":{kind:"team",codec:"key",involves:!0,required:!1,what:{de:"Team der \xDCberarbeitung",en:"revision team"},consequence:{de:"eine Ablehnung findet niemanden, der \xFCberarbeitet",en:"a rejection finds nobody to revise"}},"tasks[].result.chat":{kind:"team",codec:"chatTarget",involves:!1,required:!1,what:{de:"Chat des Ergebnisses",en:"chat of the result"},consequence:{de:"das Ergebnis l\xE4sst sich nicht im Chat ablegen",en:"the result cannot be posted to the chat"}},"optionalActions[].trigger":{kind:"team",codec:"key",involves:!1,required:!1,what:{de:"Team, das die Aktion ausl\xF6sen darf",en:"team that may trigger the action"},consequence:{de:"niemand au\xDFer der Prozessverantwortung kann die Aktion ausl\xF6sen",en:"nobody but the process owner can trigger the action"}}},bg=s(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null,"record");function j$(e,t){if(typeof t!="string"||t.length===0)return null;if(e==="key")return t;let n=ps(t);return n?.kind==="team"?n.groupKey:null}s(j$,"decodeKey");function fB(e){let t=/^(tasks|optionalActions)\[\](?:\.([a-zA-Z]+))?\.([a-zA-Z]+)$/.exec(e);return t===null&&_(`[resource] unreadable reference leaf "${e}"`),{list:t[1],field:t[2]??null,key:t[3]}}s(fB,"locate");function Mu(e){let t=[],n=e;for(let[r,i]of Object.entries(bg(n.assign)??{})){let o=j$("key",i);t.push({path:`assign.${r}`,leaf:"assign{}",owner:r,key:o,missing:typeof i!="string"||i.length===0})}for(let r of Object.keys(ms)){if(r==="assign{}")continue;let i=ms[r],{list:o,field:a,key:l}=fB(r);for(let d of Array.isArray(n[o])?n[o]:[]){let c=bg(d);if(c===null||typeof c.key!="string")continue;let f=(a===null?c:bg(c[a]))?.[l];if(f===void 0&&!i.required)continue;let m=typeof f!="string"||f.length===0;t.push({path:`${o}.${c.key}${a===null?"":`.${a}`}.${l}`,leaf:r,owner:c.key,key:j$(i.codec,f),missing:m})}}return t}s(Mu,"nodeResourceReferences");function Ga(e){let t=Array.isArray(e.nodes)?e.nodes:[],n=new Set;for(let r of t)for(let i of Mu(r))i.key!==null&&ms[i.leaf].involves&&n.add(i.key);return n}s(Ga,"declaredGroupKeys");var vt="responsible",kg="team:";function vg(e){return`${kg}${e}`}s(vg,"teamSlot");function xg(e){return e.startsWith(kg)?e.slice(kg.length):null}s(xg,"teamKeyOfSlot");var hs=vu;var pB="unit.key",mB="offer.key";function B$(e,t){return e===pB?t.unitKeys:e===mB?t.offerKeys:null}s(B$,"liveKeyUniverse");function qu(e){return[vt,...[...Ga(e)].sort((t,n)=>t.localeCompare(n)).map(vg)]}s(qu,"requiredSlots");var xi=`${Su("applicant.channel")} == 'staff'`;var Ag=["strict","leastLoaded"];var Sg=2;function V$(e){return e.some(t=>t.length===0)?{de:"nennt einen leeren Personenschl\xFCssel",en:"names an empty person key"}:new Set(e).size!==e.length?{de:"nennt eine Person zweimal",en:"names a person twice"}:e.length<Sg?{de:`braucht mindestens ${Sg} Personen`,en:`needs at least ${Sg} people`}:null}s(V$,"rotationPoolProblem");function hB(e,t){let n=t===null?-1:e.indexOf(t);return[...e.slice(n+1),...e.slice(0,n+1)]}s(hB,"strictOrder");function U$(e){let t=hB(e.pool,e.previous).filter(i=>e.eligible.has(i));if(t.length===0)return null;if(e.mode==="strict")return t[0];let n=e.openCounts;n===void 0&&_("[assignment/rotation] leastLoaded needs the open counts");let r=s(i=>{let o=n.get(i);return o===void 0&&_(`[assignment/rotation] no open count for '${i}'`),o},"load");return t.reduce((i,o)=>r(o)<r(i)?o:i)}s(U$,"pickFromPool");function z$(e,t){let n=e?.assignmentRules;n===void 0&&_(`[assignment/noRules] ${t}: the workflow has no assignment rule`);let r=J$(n);return r.length>0&&_(`${r.join("; ")} (${t})`),n}s(z$,"rulesOfGraph");function gB(e){return e===vt?{slot:e,rules:[{when:xi,assign:{kind:"creator"}},{when:null,assign:{kind:"unassigned"}}]}:{slot:e,rules:[{when:null,assign:{kind:"queue"}}]}}s(gB,"defaultSlotRules");function W$(e,t){let n=new Set(e.map(o=>o.slot)),r=t.filter(o=>!n.has(o)).map(gB);return[...r.filter(o=>o.slot===vt),...e,...r.filter(o=>o.slot!==vt)]}s(W$,"withRequiredSlots");function Tt(e,t){return t===void 0?`slot '${e}'`:`slot '${e}' row #${t+1}`}s(Tt,"where");function $n(e,t){return t===void 0?`Liste '${e}'`:`Liste '${e}', Zeile #${t+1}`}s($n,"whereDe");function hn(e,t,n={},r="error"){return{severity:r,code:e,message:{de:`[${e}] ${t.de}`,en:`[${e}] ${t.en}`},...n}}s(hn,"issue");function G$(e){if(e===vt)return!0;let t=xg(e);return t!==null&&t.length>0}s(G$,"isKnownSlot");function yB(e,t){as(hs);let n=[],r=new Set;e.forEach((o,a)=>{let{slot:l}=o;G$(l)||n.push(hn("assignment/unknownSlot",{de:`'${l}' ist keine Liste \u2014 'responsible' oder 'team:<teamKey>'`,en:`'${l}' is no slot \u2014 'responsible' or 'team:<teamKey>'`},{slot:l})),r.has(l)&&n.push(hn("assignment/duplicateSlot",{de:`${$n(l)} steht zweimal da`,en:`${Tt(l)} is listed twice`},{slot:l})),r.add(l),l===vt&&a!==0&&n.push(hn("assignment/responsibleFirst",{de:`'${vt}' muss die erste Liste sein \u2014 Team-Zeilen \xFCbernehmen sie`,en:`'${vt}' must be the first slot \u2014 team rows copy it`},{slot:l})),n.push(...wB(o))});for(let o of t)r.has(o)||n.push(hn("assignment/slotMissing",{de:`${$n(o)} hat keine Regeln \u2014 der Workflow braucht sie`,en:`${Tt(o)} has no rule list \u2014 the workflow needs it`},{slot:o}));let i=new Set(t);for(let{slot:o}of e)o!==vt&&!i.has(o)&&G$(o)&&n.push(hn("assignment/unusedSlot",{de:`${$n(o)} wird hier nicht gebraucht \u2014 erlaubt, und nicht ausgewertet`,en:`${Tt(o)} is not needed here \u2014 allowed, and not evaluated`},{slot:o},"info"));return n}s(yB,"validateRules");function wB({slot:e,rules:t}){let n=[];return(t.length===0||t[t.length-1].when!==null)&&n.push(hn("assignment/defaultRowMissing",{de:`${$n(e)} muss mit einer Zeile ohne Bedingung enden (\u201Esonst\u201C)`,en:`${Tt(e)} must end with a row without condition ("otherwise")`},{slot:e})),t.forEach((r,i)=>{let o={slot:e,row:i},{when:a,assign:l}=r;if(a===null&&i<t.length-1&&n.push(hn("assignment/ruleAfterDefault",{de:`${$n(e,i)} hat keine Bedingung, aber es folgen Zeilen \u2014 sie treffen nie zu`,en:`${Tt(e,i)} has no condition, but rows follow it \u2014 they can never match`},o)),a!==null){let d=Du(a,hs,[xi]);for(let c of d)n.push({...c,message:{de:`${c.message.de} (${$n(e,i)})`,en:`${c.message.en} (${Tt(e,i)})`},...o});if(d.every(c=>c.severity!=="error")){P$(a)||n.push(hn("assignment/shadowedRule",{de:`${$n(e,i)} liest nichts aus dem Vorgang \u2014 sie gilt immer oder nie`,en:`${Tt(e,i)} reads nothing of the application \u2014 it holds for every application or for none`},o));let c=t.slice(0,i).findIndex(u=>u.when!==null&&I$(u.when,a));c!==-1&&n.push(hn("assignment/shadowedRule",{de:`${$n(e,i)} wiederholt die Bedingung von Zeile #${c+1} \u2014 sie trifft nie zu`,en:`${Tt(e,i)} repeats the condition of row #${c+1} \u2014 it can never match`},o))}}if(e===vt&&l.kind==="slot"&&n.push(hn("assignment/slotForwardRef",{de:`${$n(e,i)} \xFCbernimmt '${l.slot}' \u2014 das darf nur eine Team-Liste nach '${vt}'`,en:`${Tt(e,i)} copies '${l.slot}' \u2014 only a team slot after '${vt}' may`},o)),e===vt&&l.kind==="queue"&&n.push(hn("assignment/queueOnProcessSlot",{de:`${$n(e,i)} weist die Queue zu \u2014 die Prozesszust\xE4ndigkeit ist immer eine Person`,en:`${Tt(e,i)} assigns the queue \u2014 the responsible slot is always a person`},o)),l.kind==="unassigned"&&n.push(hn("assignment/targetMissing",{de:`${$n(e,i)} nennt noch niemanden \u2014 Person w\xE4hlen`,en:`${Tt(e,i)} names no one yet \u2014 choose a person`},o)),l.kind==="rotation"){let d=V$(l.configKeys);d!==null&&n.push(hn("assignment/rotationPool",{de:`${$n(e,i)}: die Reihum-Liste ${d.de}`,en:`${Tt(e,i)} rotates over a pool that ${d.en}`},o))}l.kind==="creator"&&(a===null||!R$(a,xi))&&n.push(hn("assignment/unguardedTarget",{de:`${$n(e,i)} weist die anlegende Person zu \u2014 die gibt es nur, wenn die Bedingung der Zeile '${xi}' ist (oder enth\xE4lt)`,en:`${Tt(e,i)} assigns the creator, which exists only when the row's condition is (or has the conjunct) '${xi}'`},o))}),n}s(wB,"rowIssues");function H$(e,t){for(let r of t)e.some(i=>i.slot===r)||_(`[assignment/slotMissing] ${Tt(r)} has no rule list`);let n=new Set(t);return e.filter(r=>n.has(r.slot))}s(H$,"selectSlots");function bB(e,t){return O$(H$(e,t).flatMap(n=>n.rules.flatMap(r=>r.when===null?[]:[r.when])))}s(bB,"contextKeysOfRules");function Y$(e,t,n,r){as(hs);let i=H$(e,n),o=bB(e,n),a=_u(hs.types,t,o);E$(hs,a,o);let l=[];for(let{slot:d,rules:c}of i){let u=c.findIndex((m,g)=>{if(m.when===null)return!0;for(let b of bt(nr(m.when)))Object.hasOwn(a,b)||_(`[condition/unknownIdentifier] ${Tt(d,g)} reads '${b}', which the context does not carry`);return m$(m.when,{values:a})});u===-1&&_(`[assignment/defaultRowMissing] ${Tt(d)}: no row matched and there is no default row`);let f=c[u].assign;l.push({slot:d,ruleIndex:u,assign:f,value:kB(d,u,f,l,r)})}return l}s(Y$,"evaluateRules");function kB(e,t,n,r,i){switch(n.kind){case"person":return{kind:"value",value:i.person(n.configKey)};case"creator":return{kind:"value",value:i.creator()};case"rotation":return{kind:"value",value:i.rotation(n,{slot:e,row:t})};case"unassigned":return _(`[assignment/targetMissing] ${Tt(e,t)} names no one`);case"queue":return e===vt&&_(`[assignment/queueOnProcessSlot] ${Tt(e,t)} assigns the queue`),{kind:"queue"};case"slot":{let o=e===vt?void 0:r.find(a=>a.slot===n.slot);return o===void 0&&_(`[assignment/slotForwardRef] ${Tt(e,t)} copies '${n.slot}', which is not decided before it`),o.value}}}s(kB,"resolveTarget");var Eg={person:["kind","configKey"],creator:["kind"],slot:["kind","slot"],queue:["kind"],rotation:["kind","configKeys","mode"],unassigned:["kind"]};function J$(e){let t=[],n=s((r,i)=>t.push(`[assignment/shape] ${r}: ${i}`),"bad");return Array.isArray(e)?(e.forEach((r,i)=>{let o=`slots[${i}]`;if(typeof r!="object"||r===null)return n(o,"must be { slot, rules }");let{slot:a,rules:l,...d}=r;if(Object.keys(d).length>0&&n(o,`unknown field(s) ${Object.keys(d).join(", ")}`),typeof a!="string"&&n(o,"slot must be a string"),!Array.isArray(l))return n(o,"rules must be a list");l.forEach((c,u)=>{let f=`${o}.rules[${u}]`;if(typeof c!="object"||c===null)return n(f,"must be { when, assign }");let{when:m,assign:g,...b}=c;Object.keys(b).length>0&&n(f,`unknown field(s) ${Object.keys(b).join(", ")}`),m!==null&&typeof m!="string"&&n(f,"when must be a condition string or null (\u201Esonst\u201C)");let y=g?.kind;if(typeof g!="object"||g===null||typeof y!="string"||!Object.hasOwn(Eg,y))return n(f,`assign must be one of ${Object.keys(Eg).map(O=>`{kind:'${O}'}`).join(", ")}`);let v=Eg[y],T=Object.keys(g);(T.some(O=>!v.includes(O))||v.some(O=>!T.includes(O)))&&n(f,`a '${y}' target has exactly the field(s) ${v.join(", ")}`);let $=g;if(y==="person"&&(typeof $.configKey!="string"||$.configKey.length===0)&&n(f,"a 'person' target needs a non-empty configKey"),y==="rotation"){let O=$.configKeys;(!Array.isArray(O)||O.some(N=>typeof N!="string"))&&n(f,"a 'rotation' target needs configKeys, a list of person keys"),Ag.includes($.mode)||n(f,`a 'rotation' target's mode is one of ${Ag.map(N=>`'${N}'`).join(", ")}`)}y==="slot"&&$.slot!==vt&&n(f,`a 'slot' target copies '${vt}' and nothing else`)})}),t):(n("slots","must be a list of { slot, rules }"),t)}s(J$,"ruleShapeIssues");function Q$(e){let t=e??{},n=[];if(t.teamOwnerBindings!==void 0&&n.push({de:"[assignment/legacyBindings] der Workflow tr\xE4gt noch teamOwnerBindings \u2014 die Zust\xE4ndigkeitsregel ersetzt sie; das Feld entfernen",en:"[assignment/legacyBindings] the workflow still carries teamOwnerBindings \u2014 the assignment rule replaces them; remove the field"}),t.assignmentRules===void 0)return n.push({de:"[assignment/noRules] der Workflow hat keine Zust\xE4ndigkeitsregel (graph.assignmentRules) \u2014 jeder Workflow muss sagen, wer zust\xE4ndig wird",en:"[assignment/noRules] the workflow has no assignment rule (graph.assignmentRules) \u2014 every workflow must say who becomes responsible"}),n;let r=J$(t.assignmentRules);if(r.length>0)return[...n,...r.map(o=>({de:o,en:o}))];let i=qu({nodes:Array.isArray(t.nodes)?t.nodes:[]});for(let o of yB(t.assignmentRules,i))o.severity==="error"&&n.push(o.message);return n}s(Q$,"workflowAssignmentIssues");function Z$(e,t,n={}){let r=new Map;return{slots:Y$(e,t,n.slots??e.map(o=>o.slot),{person:s(o=>`person:${o}`,"person"),creator:s(()=>(n.creator===void 0&&fe("INVALID",{de:"[assignment/noCreator] Die zutreffende Zeile weist die anlegende Person zu, aber es wurde kein --creator angegeben (ein Selbststart hat keine).",en:"[assignment/noCreator] The matching row assigns the creating person, but no --creator was given (a self-start has none)."}),`creator:${n.creator}`),"creator"),rotation:s((o,{slot:a})=>{let l=n.rotationPrevious?.[a]??null,d=U$({pool:o.configKeys,mode:o.mode,previous:l,eligible:new Set(o.configKeys.filter(c=>!(n.left??[]).includes(c))),openCounts:new Map(o.configKeys.map(c=>[c,n.openCounts?.[c]??0]))});return d===null&&fe("INVALID",{de:`[assignment/rotationEmpty] Platz \u201E${a}\u201C: alle aus dem Pool sind ausgeschieden`,en:`[assignment/rotationEmpty] slot '${a}': everyone in the pool has left`}),r.set(a,{pool:[...o.configKeys],mode:o.mode,previous:l,picked:d}),`person:${d}`},"rotation")}).map(o=>{let a=r.get(o.slot);return{slot:o.slot,row:o.ruleIndex+1,assign:o.assign,value:o.value.kind==="queue"?"queue":o.value.value,...a!==void 0?{rotation:a}:{}}})}}s(Z$,"simulateRules");function X$(e,t){let n={};for(let r of t??[]){let i=r.lastIndexOf("=");if(i<=0||i===r.length-1)throw new Error(`assignment simulate: ${e} takes <key>=<value>, got '${r}'`);let o=r.slice(0,i);if(Object.hasOwn(n,o))throw new Error(`assignment simulate: ${e} names '${o}' twice`);n[o]=r.slice(i+1)}return n}s(X$,"parsePairs");function vB(e){let t={};for(let[n,r]of Object.entries(X$("--open",e))){let i=Number(r);if(!Number.isInteger(i)||i<0)throw new Error(`assignment simulate: --open ${n}=${r} is no count`);t[n]=i}return t}s(vB,"parseCounts");function xB(e,t){if(e===void 0==(t===void 0))throw new Error("assignment simulate: pass exactly one of --env-json '<json>' or --env-file <path>");let n=e??ke(t,"utf8"),r=JSON.parse(n);if(typeof r!="object"||r===null||Array.isArray(r))throw new Error("assignment simulate: the environment must be a JSON object");return r}s(xB,"parseEnv");var Tg=class extends Se{static{s(this,"AssignmentSimulateCommand")}static paths=[["assignment","simulate"]];static usage=E.Usage({category:"Admission",description:"Evaluate an offer bundle's assignment rule over an application's environment ($env), offline",details:`
9380
9380
  The environment carries every key the rule reads ($env): offer
@@ -9775,18 +9775,18 @@ At most PLEXUS_SEED_SLOTS (default 2) seeds run at once on this machine, across
9775
9775
  `)}
9776
9776
  `),0}let n=await t.mutation(S.platformAdmin.grantAllTenantUsersAccess,{fromTenantSlug:this.from,toTenantSlug:this.to,permissionGroupKey:this.group});if(this.json)return this.print(n),0;let r=[`Granted ${n.granted}/${n.totalUsers} users of "${n.fromTenantSlug}" access to "${n.toTenantSlug}" (group: ${this.group}).`];for(let i of n.skipped)r.push(` skipped ${i.email}: ${i.reason}`);return this.context.stdout.write(`${r.join(`
9777
9777
  `)}
9778
- `),0}},NS=class extends Sn{static{s(this,"UsersRevokeCommand")}static paths=[["users","revoke"],["users","remove"]];static usage=E.Usage({category:"Users",description:"Revoke a user's access to the active tenant (--tenant) \u2014 plan unless --confirm. Other tenants keep it; `users deactivate` revokes everywhere."});email=p.String({required:!0});replaceWith=p.String("--replace-with",{description:"configKey of the staff member who takes over their active applications \u2014 required while they are responsible for any. A rule naming them refuses regardless: change it first (workflow editor: \u201EPerson ersetzen\u201C, then publish)"});confirm=p.Boolean("--confirm",!1,{description:"Revoke (without it, only the plan is printed)."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t4(t,this.email,n);return this.confirm?(await t.mutation(S.platformAdmin.revokeTenantAccess,{userTenantAccessId:r,...this.replaceWith!==void 0?{replaceWith:this.replaceWith}:{}}),this.report({revoked:r},`Revoked ${this.email}'s access to "${n}".`),0):(this.report({tenant:n,email:this.email,userTenantAccessId:r,revoked:!1},`DRY RUN \u2014 would revoke ${this.email}'s access to "${n}". Re-run with --confirm.`),0)}},CS=class extends Sn{static{s(this,"UsersSetGroupCommand")}static paths=[["users","set-group"]];static usage=E.Usage({category:"Users",description:"Add a user to a permission group in a tenant."});email=p.String({required:!0});group=p.String("--group",{required:!0,description:"Permission group key."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await Am(t,this.email),i=await vc(t,n),o=eM(i,this.group),a=await t.mutation(S.permissions.createMembership,{client:n,userId:r,permissionGroupId:o});return this.report(a,`Added ${this.email} to group "${this.group}" in "${n}".`),0}},DS=class extends Sn{static{s(this,"UsersUnsetGroupCommand")}static paths=[["users","unset-group"]];static usage=E.Usage({category:"Users",description:"Remove a user from a permission group in a tenant."});email=p.String({required:!0});group=p.String("--group",{required:!0,description:"Permission group key."});replaceWith=p.String("--replace-with",{description:"configKey of the staff member who takes over their active applications \u2014 required while they are responsible for any. A rule naming them refuses regardless: change it first (workflow editor: \u201EPerson ersetzen\u201C, then publish)"});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await Am(t,this.email),i=await vc(t,n),o=eM(i,this.group),a=n4(i,r,o);return await t.mutation(S.permissions.deleteMembership,{client:n,id:a,...this.replaceWith!==void 0?{replaceWith:this.replaceWith}:{}}),this.report({removed:a},`Removed ${this.email} from group "${this.group}" in "${n}".`),0}},FS=class extends Sn{static{s(this,"UsersSetPlatformAdminCommand")}static paths=[["users","set-platform-admin"]];static usage=E.Usage({category:"Users",description:"Grant/revoke platform-admin status (--on | --off)."});email=p.String({required:!0});on=p.Boolean("--on",!1,{description:"Grant."});off=p.Boolean("--off",!1,{description:"Revoke."});async execute(){let t=tM(this.on,this.off),n=await this.caller(),r=await Am(n,this.email);await n.mutation(S.platformAdmin.setPlatformAdmin,{userId:r,isPlatformAdmin:t});let i=t?"is now a platform admin":"is no longer a platform admin";return this.report({userId:r,isPlatformAdmin:t},`${this.email} ${i}.`),0}},LS=class extends Sn{static{s(this,"UsersSetPlatformPermissionCommand")}static paths=[["users","set-platform-permission"]];static usage=E.Usage({category:"Users",description:"Grant/revoke a single _platform.* permission (--on | --off)."});email=p.String({required:!0});permission=p.String("--permission",{required:!0,description:"The _platform.* permission."});on=p.Boolean("--on",!1,{description:"Grant."});off=p.Boolean("--off",!1,{description:"Revoke."});async execute(){let t=tM(this.on,this.off);if(!km.includes(this.permission))throw new Error(`Unknown _platform.* permission "${this.permission}". One of: ${km.join(", ")}.`);let n=await this.caller(),r=await Am(n,this.email);await n.mutation(S.platformAdmin.setPlatformPermission,{userId:r,permission:this.permission,enabled:t});let i=t?"granted":"revoked";return this.report({userId:r,permission:this.permission,enabled:t},`${i} ${this.permission} for ${this.email}.`),0}},vm=class extends Sn{static{s(this,"CredentialOutCommand")}out=p.String("--out",{description:"Append the `email,password` row to this CSV file (created with a header; never overwritten)."});retiredOutput=gs();quiet=p.Boolean("--quiet",!1,{description:"Do not echo the password to stdout (needs --out)."});#e;credentialsFile(){if(this.#e===void 0){let t=ys(this);if(this.quiet&&t===void 0)throw new Error("--quiet without --out would lose the password \u2014 it is shown only once.");t!==void 0&&fo(t,"password"),this.#e={file:t}}return this.#e.file}handOver(t,n,r,i){let o=this.credentialsFile();if(o!==void 0&&uf(o,t,n),this.json){this.print({...r,email:t});return}this.context.stdout.write(`${i}${o!==void 0?` \u2192 ${o}`:""}.
9778
+ `),0}},NS=class extends Sn{static{s(this,"UsersRevokeCommand")}static paths=[["users","revoke"],["users","remove"]];static usage=E.Usage({category:"Users",description:"Revoke a user's access to the active tenant (--tenant) \u2014 plan unless --confirm. Other tenants keep it; `users archive` archives everywhere."});email=p.String({required:!0});replaceWith=p.String("--replace-with",{description:"configKey of the staff member who takes over their active applications \u2014 required while they are responsible for any. A rule naming them refuses regardless: change it first (workflow editor: \u201EPerson ersetzen\u201C, then publish)"});confirm=p.Boolean("--confirm",!1,{description:"Revoke (without it, only the plan is printed)."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t4(t,this.email,n);return this.confirm?(await t.mutation(S.platformAdmin.revokeTenantAccess,{userTenantAccessId:r,...this.replaceWith!==void 0?{replaceWith:this.replaceWith}:{}}),this.report({revoked:r},`Revoked ${this.email}'s access to "${n}".`),0):(this.report({tenant:n,email:this.email,userTenantAccessId:r,revoked:!1},`DRY RUN \u2014 would revoke ${this.email}'s access to "${n}". Re-run with --confirm.`),0)}},CS=class extends Sn{static{s(this,"UsersSetGroupCommand")}static paths=[["users","set-group"]];static usage=E.Usage({category:"Users",description:"Add a user to a permission group in a tenant."});email=p.String({required:!0});group=p.String("--group",{required:!0,description:"Permission group key."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await Am(t,this.email),i=await vc(t,n),o=eM(i,this.group),a=await t.mutation(S.permissions.createMembership,{client:n,userId:r,permissionGroupId:o});return this.report(a,`Added ${this.email} to group "${this.group}" in "${n}".`),0}},DS=class extends Sn{static{s(this,"UsersUnsetGroupCommand")}static paths=[["users","unset-group"]];static usage=E.Usage({category:"Users",description:"Remove a user from a permission group in a tenant."});email=p.String({required:!0});group=p.String("--group",{required:!0,description:"Permission group key."});replaceWith=p.String("--replace-with",{description:"configKey of the staff member who takes over their active applications \u2014 required while they are responsible for any. A rule naming them refuses regardless: change it first (workflow editor: \u201EPerson ersetzen\u201C, then publish)"});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await Am(t,this.email),i=await vc(t,n),o=eM(i,this.group),a=n4(i,r,o);return await t.mutation(S.permissions.deleteMembership,{client:n,id:a,...this.replaceWith!==void 0?{replaceWith:this.replaceWith}:{}}),this.report({removed:a},`Removed ${this.email} from group "${this.group}" in "${n}".`),0}},FS=class extends Sn{static{s(this,"UsersSetPlatformAdminCommand")}static paths=[["users","set-platform-admin"]];static usage=E.Usage({category:"Users",description:"Grant/revoke platform-admin status (--on | --off)."});email=p.String({required:!0});on=p.Boolean("--on",!1,{description:"Grant."});off=p.Boolean("--off",!1,{description:"Revoke."});async execute(){let t=tM(this.on,this.off),n=await this.caller(),r=await Am(n,this.email);await n.mutation(S.platformAdmin.setPlatformAdmin,{userId:r,isPlatformAdmin:t});let i=t?"is now a platform admin":"is no longer a platform admin";return this.report({userId:r,isPlatformAdmin:t},`${this.email} ${i}.`),0}},LS=class extends Sn{static{s(this,"UsersSetPlatformPermissionCommand")}static paths=[["users","set-platform-permission"]];static usage=E.Usage({category:"Users",description:"Grant/revoke a single _platform.* permission (--on | --off)."});email=p.String({required:!0});permission=p.String("--permission",{required:!0,description:"The _platform.* permission."});on=p.Boolean("--on",!1,{description:"Grant."});off=p.Boolean("--off",!1,{description:"Revoke."});async execute(){let t=tM(this.on,this.off);if(!km.includes(this.permission))throw new Error(`Unknown _platform.* permission "${this.permission}". One of: ${km.join(", ")}.`);let n=await this.caller(),r=await Am(n,this.email);await n.mutation(S.platformAdmin.setPlatformPermission,{userId:r,permission:this.permission,enabled:t});let i=t?"granted":"revoked";return this.report({userId:r,permission:this.permission,enabled:t},`${i} ${this.permission} for ${this.email}.`),0}},vm=class extends Sn{static{s(this,"CredentialOutCommand")}out=p.String("--out",{description:"Append the `email,password` row to this CSV file (created with a header; never overwritten)."});retiredOutput=gs();quiet=p.Boolean("--quiet",!1,{description:"Do not echo the password to stdout (needs --out)."});#e;credentialsFile(){if(this.#e===void 0){let t=ys(this);if(this.quiet&&t===void 0)throw new Error("--quiet without --out would lose the password \u2014 it is shown only once.");t!==void 0&&fo(t,"password"),this.#e={file:t}}return this.#e.file}handOver(t,n,r,i){let o=this.credentialsFile();if(o!==void 0&&uf(o,t,n),this.json){this.print({...r,email:t});return}this.context.stdout.write(`${i}${o!==void 0?` \u2192 ${o}`:""}.
9779
9779
  `),this.quiet||this.context.stdout.write(` password: ${n}
9780
9780
  `)}},xm=class extends vm{static{s(this,"PasswordSettingCommand")}passwordStdin=p.Boolean("--password-stdin",!1,{description:"Read the password from stdin instead of letting the server generate one."});passwordFile=p.String("--password-file",{description:"Read the password from this file instead of letting the server generate one."});retiredPassword=p.String("--password",{hidden:!0});async chosenPassword(){if(hu(this.retiredPassword,"--password",'Pipe it in with --password-stdin (`printf %s "$PW" | plexus-cli \u2026 --password-stdin`), pass --password-file <path>, or omit both to let the server generate one.'),!(!this.passwordStdin&&this.passwordFile===void 0))return await Zo({stdin:this.passwordStdin,file:this.passwordFile},Qo(this.context.stdin),{stdin:"--password-stdin",file:"--password-file"})}},MS=class extends vm{static{s(this,"UsersCreateCommand")}static paths=[["users","create"]];static usage=E.Usage({category:"Users",description:"Create a tenant-less identity WITH a login account from just an e-mail (optionally a platform admin). Idempotent: an existing user is left untouched \u2014 no password is rotated. To (re)set a ready-to-log-in account with a name, group or permission set, use `users provision`.",details:"The generated password is printed once (use --out/--quiet to keep it out of the terminal)."});email=p.String({required:!0});platformAdmin=p.Boolean("--platform-admin",!1,{description:"Make the new user a platform admin (full _platform.* set)."});async execute(){this.credentialsFile();let n=await(await this.caller()).mutation(S.platformAdmin.createUser,{email:this.email,platformAdmin:this.platformAdmin});return n.password===void 0?(this.report({...n,email:this.email},`${this.email} already exists (no change).`),0):(this.handOver(this.email,n.password,n,`Created ${this.email}${this.platformAdmin?" as a platform admin":""}`),0)}},kc=class extends xm{static{s(this,"UsersProvisionCommand")}static paths=[["users","provision"]];static usage=E.Usage({category:"Users",description:"Create \u2014 or reset \u2014 a ready-to-log-in account with a password (generated, or from --password-stdin / --password-file) and emit the email\u2192password mapping. One of three kinds: a tenant user in a permission group of the active tenant (default), a tenant-less platform admin (--platform-admin), or a tenant-less platform user with an exact _platform.* subset (--permission, repeatable). Re-running rotates the password.",examples:[["A tenant administrator","plexus-cli --env staging --tenant <slug> users provision ada@example.com --name Ada --out /tmp/credentials.csv --quiet"],["A platform admin","plexus-cli --env staging users provision ops@example.com --name Ops --platform-admin"],["A schema-read-only platform user","plexus-cli --env prod users provision ada@example.com --name Ada --permission _platform.schema.read --out /tmp/credentials.csv --quiet --allow-prod"]]});email=p.String({required:!0});name=p.String("--name",{required:!0,description:"Display name for the login."});group=p.String("--group",{description:`Permission group key in the active tenant (tenant user only; default: ${oa}).`});platformAdmin=p.Boolean("--platform-admin",!1,{description:"A tenant-less platform admin holding the full _platform.* set."});permissions=p.Array("--permission",{description:"A tenant-less platform user with exactly this _platform.* permission (repeatable)."});async execute(){let t=[...new Set(this.permissions??[])];if(this.platformAdmin&&t.length>0)throw new Error("Pass --platform-admin (the full set) OR --permission (a subset), not both.");let n=this.platformAdmin||t.length>0;if(n&&this.group!==void 0)throw new Error("--group names a tenant group \u2014 a platform account has none.");if(n&&this.tenant!==void 0)throw new Error("--tenant does not apply: a platform account is tenant-less.");for(let o of t)if(!km.includes(o))throw new Error(`Unknown _platform.* permission "${o}". One of: ${km.join(", ")}.`);let r=await this.chosenPassword();this.credentialsFile();let i=await this.caller();if(this.platformAdmin){let o=await i.mutation(S.platformAdmin.provisionPlatformAdmin,{email:this.email,name:this.name,password:r});this.handOver(this.email,o.password,o,`Provisioned platform admin ${this.email} (${this.name})`)}else if(t.length>0){let o=await i.mutation(S.platformAdmin.provisionPlatformUser,{email:this.email,name:this.name,permissions:t,password:r});this.handOver(this.email,o.password,o,`Provisioned platform user ${this.email} (${this.name}) with ${t.join(", ")}`)}else{let o=this.requireTenant(i),a=this.group??oa,l=await i.mutation(S.platformAdmin.provisionUser,{email:this.email,name:this.name,tenantSlug:o,permissionGroupKey:a,password:r});this.handOver(this.email,l.password,l,`Provisioned ${this.email} in "${o}" (group: ${a})`)}return 0}},qS=class extends kc{static{s(this,"UsersProvisionPlatformAdminCommand")}static paths=[["users","provision-platform-admin"]];static usage=void 0;async execute(){return dt(this.context.stderr,"users provision-platform-admin","users provision --platform-admin"),this.platformAdmin=!0,await super.execute()}},KS=class extends kc{static{s(this,"UsersProvisionPlatformUserCommand")}static paths=[["users","provision-platform-user"]];static usage=void 0;async execute(){if(dt(this.context.stderr,"users provision-platform-user","users provision --permission <p>"),(this.permissions??[]).length===0)throw new Error("Pass at least one --permission.");return await super.execute()}},jS=class extends xm{static{s(this,"UsersSetPasswordCommand")}static paths=[["users","set-password"]];static usage=E.Usage({category:"Users",description:"Set (rotate) an existing user's login password \u2014 tenant user or platform admin. Generated by the server unless --password-stdin / --password-file gives one. Emits the email\u2192password mapping. Creates nothing; fails loud on an unknown or orphaned identity (run `users relink-auth` first)."});email=p.String({required:!0});async execute(){let t=await this.chosenPassword();this.credentialsFile();let r=await(await this.caller()).mutation(S.platformAdmin.setUserPassword,{email:this.email,password:t});return this.handOver(this.email,r.password,r,`Set password for ${this.email}`),0}};function i4(e){return new Date(e).toISOString().replace("T"," ").slice(0,19)+"Z"}s(i4,"stamp");function o4(e){let t=[],n=e.account;t.push(n===null?`${e.email}: kein anmeldef\xE4higes Konto (keine Identit\xE4t oder nie ein Anmeldekonto angelegt) \u2014 die Anmeldeseite sendet dorthin nichts und speichert keine Anfrage.`:`${e.email}: Konto ${n.userId}, Adresse ${n.emailVerified?"best\xE4tigt":"NICHT best\xE4tigt"}`);let r=[...e.refusals.map(i=>({at:i.at,text:`abgelehnt: ${i.reason}`})),...e.letters.map(i=>({at:i.createdAt,text:`Brief ${i.templateId}: ${i.status}${i.errorCode?` (${i.errorCode})`:""}${i.lastSmtpResponse?` \u2014 Relay: ${i.lastSmtpResponse}`:""}`})),...e.sessions.map(i=>({at:i.createdAt,text:`Sitzung von ${i.ipAddress??"?"} \u2014 ${i.userAgent??"?"}`})),...e.passwordSetAt===null?[]:[{at:e.passwordSetAt,text:"Passwort gesetzt (zuletzt)"}]].sort((i,o)=>i.at-o.at);r.length===0&&t.push(" (nichts im Zeitraum)");for(let i of r)t.push(` ${i4(i.at)} ${i.text}`);t.push("Nicht erfasst:");for(let i of e.notRecorded)t.push(` - ${i}`);return t.join(`
9781
9781
  `)}s(o4,"loginTrailText");var BS=class extends D{static{s(this,"UsersLoginTrailCommand")}static paths=[["users","login-trail"]];static usage=E.Usage({category:"Users",description:"Everything the platform still knows about one address's sign-in: login-page refusals, letters with the relay's answer, sessions (when, network, browser), when a password was set (platform-admin).",examples:[["Why did she get no link today?","$0 --env prod users login-trail steffi@schule.example --since 24h"]]});email=p.String({required:!0});since=p.String("--since",{description:"From: 90m, 24h, 2d or an ISO date/time (default 7d)."});async execute(){let n=await(await this.caller()).query(S.loginTrail.forAddress,{email:this.email,since:$f(this.since??"7d")});return this.json?this.print(n):this.context.stdout.write(`${o4(n)}
9782
9782
  `),0}},VS=class extends Sn{static{s(this,"UsersSetEmailCommand")}static paths=[["users","set-email"]];static usage=E.Usage({category:"Users",description:"Change an existing user's login e-mail across all their tenants (plan unless --confirm). Fails loud when the new address is taken.",details:"The password stays. Mailbox proof is reset \u2014 except when the new address is a reserved test address (.test, .example, .invalid, .localhost, example.com/.net/.org), which has no mailbox to prove.",examples:[["Plan moving a test account off a real domain","plexus-cli --env prod users set-email old@example.com --to new@example.com"],["Apply it","plexus-cli --env prod users set-email old@example.com --to new@example.com --confirm --allow-prod"]]});email=p.String({required:!0});to=p.String("--to",{required:!0,description:"The new login e-mail address."});confirm=p.Boolean("--confirm",!1,{description:"Write the change (without it, only the plan is printed)."});async execute(){let n=await(await this.caller()).mutation(S.platformAdmin.setUserEmail,{email:this.email,newEmail:this.to,dryRun:!this.confirm});if(this.json)return this.print(n),0;let r=n.tenants.length>0?n.tenants.join(", "):"no tenant";if(!n.changed)return this.context.stdout.write(`${n.from} is already ${n.to} (no change).
9783
9783
  `),0;let i=n.applied?"Changed":"Would change";return this.context.stdout.write(`${i} ${n.from} \u2192 ${n.to} (${r}); mailbox proof ${n.proof}.
9784
9784
  `),n.applied||this.context.stdout.write(`Dry run \u2014 re-run with --confirm to write.
9785
- `),0}},US=class extends Sn{static{s(this,"UsersDeactivateCommand")}static paths=[["users","deactivate"],["users","delete"]];static usage=E.Usage({category:"Users",description:"Deactivate a user everywhere: revoke every tenant access, group membership and platform right; the identity and its history stay \u2014 plan unless --confirm."});email=p.String({required:!0});replaceWith=p.String("--replace-with",{description:"configKey of the staff member who takes over their active applications \u2014 required while they are responsible for any. A rule naming them refuses regardless: change it first (workflow editor: \u201EPerson ersetzen\u201C, then publish)"});confirm=p.Boolean("--confirm",!1,{description:"Deactivate (without it, only the plan is printed)."});async execute(){let t=await this.caller(),n=await Sm(t,this.email),r=n.userId;if(!this.confirm){let i=n.tenants.map(o=>o.slug);return this.report({userId:r,email:this.email,tenants:i,deactivated:!1},`DRY RUN \u2014 would deactivate ${this.email} (access to ${i.length>0?i.join(", "):"no tenant"} revoked; history kept). Re-run with --confirm.`),0}return await t.mutation(S.platformAdmin.deactivateUserEverywhere,{userId:r,...this.replaceWith!==void 0?{replaceWith:this.replaceWith}:{}}),this.report({userId:r,deactivated:!0},`Deactivated ${this.email} everywhere (access revoked; history kept).`),0}},GS=class extends D{static{s(this,"UsersDoctorCommand")}static paths=[["users","doctor"]];static usage=E.Usage({category:"Users",description:"List identities that cannot log in, with the repair each one needs. Exits non-zero when any are found.",details:"dead-link = stored authId points at no live account \xB7 unlinked = no authId but a live account exists for the address \xB7 no-account = no login account at all. The first two are healed with `users relink-auth`, the third needs `users provision` (there is no first login without an account)."});async execute(){let n=await(await this.caller()).query(S.platformAdmin.listOrphanedUsers,{});if(this.print(n,r=>r.map(i=>({email:i.email,kind:i.kind,repair:i.repair,userId:i.userId,storedAuthId:i.storedAuthId??"\u2014"})),["email","kind","repair","userId","storedAuthId"]),!this.json)if(n.length>0){let r=n.filter(a=>a.repair==="relink-auth"),i=n.filter(a=>a.repair==="provision"),o=n.length===1?"identity":"identities";this.context.stdout.write(`
9785
+ `),0}},US=class extends Sn{static{s(this,"UsersArchiveCommand")}static paths=[["users","archive"],["users","deactivate"],["users","delete"]];static usage=E.Usage({category:"Users",description:"Archive a user everywhere: archive every school access (groups removed, one history entry per school; a school's last user administrator is refused), end every platform right; the identity and its history stay \u2014 plan unless --confirm."});email=p.String({required:!0});replaceWith=p.String("--replace-with",{description:"configKey of the staff member who takes over their active applications \u2014 required while they are responsible for any. A rule naming them refuses regardless: change it first (workflow editor: \u201EPerson ersetzen\u201C, then publish)"});confirm=p.Boolean("--confirm",!1,{description:"Archive (without it, only the plan is printed)."});async execute(){let t=await this.caller(),n=await Sm(t,this.email),r=n.userId;if(!this.confirm){let i=n.tenants.map(o=>o.slug);return this.report({userId:r,email:this.email,tenants:i,archived:!1},`DRY RUN \u2014 would archive ${this.email} everywhere (access to ${i.length>0?i.join(", "):"no tenant"} archived; history kept). Re-run with --confirm.`),0}return await t.mutation(S.platformAdmin.deactivateUserEverywhere,{userId:r,...this.replaceWith!==void 0?{replaceWith:this.replaceWith}:{}}),this.report({userId:r,archived:!0},`Archived ${this.email} everywhere (access archived; history kept).`),0}},GS=class extends D{static{s(this,"UsersDoctorCommand")}static paths=[["users","doctor"]];static usage=E.Usage({category:"Users",description:"List identities that cannot log in, with the repair each one needs. Exits non-zero when any are found.",details:"dead-link = stored authId points at no live account \xB7 unlinked = no authId but a live account exists for the address \xB7 no-account = no login account at all. The first two are healed with `users relink-auth`, the third needs `users provision` (there is no first login without an account)."});async execute(){let n=await(await this.caller()).query(S.platformAdmin.listOrphanedUsers,{});if(this.print(n,r=>r.map(i=>({email:i.email,kind:i.kind,repair:i.repair,userId:i.userId,storedAuthId:i.storedAuthId??"\u2014"})),["email","kind","repair","userId","storedAuthId"]),!this.json)if(n.length>0){let r=n.filter(a=>a.repair==="relink-auth"),i=n.filter(a=>a.repair==="provision"),o=n.length===1?"identity":"identities";this.context.stdout.write(`
9786
9786
  ${n.length} unusable ${o}:
9787
9787
  `),r.length>0&&this.context.stdout.write(` ${r.length} linkable \u2014 plexus-cli users relink-auth <email>
9788
9788
  `),i.length>0&&this.context.stdout.write(` ${i.length} without any login account \u2014 plexus-cli users provision --tenant <slug> --email <email> --name <name>
9789
9789
  `)}else this.context.stdout.write(`No unusable identities.
9790
- `);return n.length>0?1:0}},zS=class extends Sn{static{s(this,"UsersRelinkAuthCommand")}static paths=[["users","relink-auth"]];static usage=E.Usage({category:"Users",description:"Relink a user's identity row to its live Better Auth account (heals an orphan)."});email=p.String({required:!0});async execute(){let n=await(await this.caller()).mutation(S.platformAdmin.relinkAuthAccount,{email:this.email}),r=n.changed?`Relinked ${this.email} to live auth account ${n.authId}.`:`${this.email} already linked to the live auth account (no change).`;return this.report(n,r),0}};function tM(e,t){if(e===t)throw new Error("Pass exactly one of --on or --off.");return e}s(tM,"requireOnOff");var nM=[$S,RS,IS,OS,PS,_S,NS,CS,DS,FS,LS,MS,kc,qS,KS,jS,BS,VS,US,GS,zS];function rM(e){return e.de??e.en??Object.values(e)[0]??""}s(rM,"titleDe");function s4(e){return{id:e._id,kind:e.kind,status:e.status,title:rM(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(s4,"row");var a4=["id","kind","status","title","assignee","group","outcome"],HS=class extends D{static{s(this,"WorkItemsListCommand")}static paths=[["work-items","list"]];static usage=E.Usage({category:"Work-Items",description:"List work-items for the active tenant (filter by --mine/--application/--group)."});mine=p.Boolean("--mine",!1,{description:"Only items assigned to me."});application=p.String("--application",{description:"Filter by application id."});group=p.String("--group",{description:"Filter by team (permission-group) id."});assignee=p.String("--assignee",{description:"Filter by assignee users._id."});openOnly=p.Boolean("--open-only",!1,{description:"Only open items."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.list,{client:n,...this.mine?{mine:!0}:{},...this.application?{applicationId:this.application}:{},...this.group?{queueGroupId:this.group}:{},...this.assignee?{assigneeUserId:this.assignee}:{},...this.openOnly?{openOnly:!0}:{}});return this.print(r,i=>i.map(s4),a4),0}},YS=class extends D{static{s(this,"WorkItemsShowCommand")}static paths=[["work-items","show"]];static usage=E.Usage({category:"Work-Items",description:"Show one work-item by id."});workItemId=p.String({required:!0,name:"workItemId"});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.get,{client:n,workItemId:this.workItemId});if(r===null)throw new Error(`work-item ${this.workItemId} not found in tenant ${n}.`);return this.print(r,i=>[{field:"id",value:i._id},{field:"kind",value:i.kind},{field:"status",value:i.status},{field:"title",value:rM(i.title)},{field:"assignee",value:i.assigneeUserId??""},{field:"group",value:i.queueGroupId??""},{field:"application",value:i.applicationId??""},{field:"node",value:i.nodeId??""},{field:"outcome",value:i.outcome??""}]),0}},JS=class extends D{static{s(this,"WorkItemsCreateCommand")}static paths=[["work-items","create"]];static usage=E.Usage({category:"Work-Items",description:"Create a manual task work-item."});title=p.String("--title",{required:!0,description:"Task title."});description=p.String("--description",{description:"Task description."});application=p.String("--application",{description:"Link to an application id."});group=p.String("--group",{description:"Team (permission-group) id whose queue holds the task."});assignee=p.String("--assignee",{description:"Assignee users._id."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.createManual,{client:n,title:this.title,...this.description?{description:this.description}:{},...this.application?{applicationId:this.application}:{},...this.group?{queueGroupId:this.group}:{},...this.assignee?{assigneeUserId:this.assignee}:{}});return this.print({workItemId:r.workItemId},i=>[{field:"workItemId",value:i.workItemId}]),0}},QS=class extends D{static{s(this,"WorkItemsCompleteCommand")}static paths=[["work-items","complete"]];static usage=E.Usage({category:"Work-Items",description:"Complete a work-item (optionally with an outcome)."});workItemId=p.String({required:!0,name:"workItemId"});outcome=p.String("--outcome",{description:"Outcome id to record."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.complete,{client:n,workItemId:this.workItemId,...this.outcome?{outcome:this.outcome}:{}});return this.print({workItemId:r.workItemId,status:"done"},i=>[{field:"workItemId",value:i.workItemId},{field:"status",value:i.status}]),0}},ZS=class extends D{static{s(this,"WorkItemsAssignCommand")}static paths=[["work-items","assign"]];static usage=E.Usage({category:"Work-Items",description:"Assign a work-item to a user (omit --user to unassign)."});workItemId=p.String({required:!0,name:"workItemId"});user=p.String("--user",{description:"Assignee users._id (omit to clear)."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.assign,{client:n,workItemId:this.workItemId,...this.user?{userId:this.user}:{}});return this.print({workItemId:r.workItemId,assignee:this.user??"(cleared)"},i=>[{field:"workItemId",value:i.workItemId},{field:"assignee",value:i.assignee}]),0}},iM=[HS,YS,JS,QS,ZS];var Em=[...PT,...wR,...KI,...qI,...fO,...EO,...AO,...X0,...nM,...u0,...rR,...lO,...H0,...IT,...n$,...eR,...RO,...$O,...PO,..._O,...sO,...zI,...iM,...uF,...JF,...d0,...QF,...F0,...U0,...f0,...v0,...A0,...W0,...Z0,...HT];var oM="0.1.17";function sM(){return Em.flatMap(e=>(e.paths??[]).map(t=>{let n=t.join(" "),r=ET[Na(n)];return{path:n,effect:eo(n),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,t)=>e.path.localeCompare(t.path))}s(sM,"plexusCommandCatalog");import Fo from"node:path";function l4(e){let t=st()?.workspaceRoot??process.cwd(),n=Fo.resolve(t,e),r=Fo.relative(t,n);if(Fo.isAbsolute(e)||r===".."||r.startsWith(`..${Fo.sep}`))throw new Error("plexus: use a relative path inside the current workspace.");return{absolute:n,relative:r}}s(l4,"workspacePath");function d4(e){let{absolute:t,relative:n}=l4(e.path??".");if(e.operation==="list"){if(!Oe(t))return{files:[]};let r=[],i=s(o=>{for(let a of Vi(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new Error("plexus: workspace symlinks are not supported.");let l=Fo.join(o,a.name);if(a.isDirectory()?i(l):r.push(Fo.relative(t,l)),r.length>200)throw new Error("plexus: the workspace contains too many files. List a subdirectory.")}},"visit");return i(t),{files:r.sort()}}if(!n)throw new Error("plexus: name a workspace file.");if(["read","search","edit"].includes(e.operation)){let r=ke(t);if(r.length>10*1024*1024)throw new Error("plexus: the workspace file exceeds 10 MB.");let i=new TextDecoder("utf-8",{fatal:!0}).decode(r);if(e.operation==="read"){let l=e.offset??0,d=e.maxChars??8e3,c=i.slice(l,l+d);return{path:n,content:c,...l||c.length<i.length?{offset:l,nextOffset:l+c.length<i.length?l+c.length:null,totalCharacters:i.length}:{}}}if(e.operation==="search"){if(!e.query)throw new Error("plexus: search needs a nonempty query.");let l=[],d=e.offset??0;for(;l.length<10;){let c=i.indexOf(e.query,d);if(c<0)break;l.push({offset:c,text:i.slice(Math.max(0,c-160),c+e.query.length+240)}),d=c+e.query.length}return{path:n,matches:l,nextOffset:l.length===10?d:null}}if(!e.oldText||typeof e.content!="string")throw new Error("plexus: edit needs oldText and replacement content.");let o=i.indexOf(e.oldText);if(o<0||o!==i.lastIndexOf(e.oldText))throw new Error("plexus: oldText must match exactly once. Read the current file and choose unique context.");let a=i.slice(0,o)+e.content+i.slice(o+e.oldText.length);if(Buffer.byteLength(a)>10*1024*1024)throw new Error("plexus: the edited file exceeds 10 MB.");return gt(t,a,"utf8"),{path:n,sizeBytes:Buffer.byteLength(a)}}if(e.operation==="write"){if(typeof e.content!="string"||Buffer.byteLength(e.content)>1e6)throw new Error("plexus: file content is missing or too large.");return Wt(Fo.dirname(t),{recursive:!0}),gt(t,e.content,"utf8"),{path:n,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return Ko(t),{path:n,removed:!0};throw new Error("plexus: unknown workspace operation.")}s(d4,"plexusWorkspace");function aM(e){return s(async function(n,r){if(!r||typeof r!="object"||Array.isArray(r))throw new Error("plexus: tool input must be an object.");let i=r,o=Da[n];if(!o||!Object.hasOwn(Da,n))throw new Error("plexus: unknown agent tool.");if(Object.keys(i).some(a=>!Object.hasOwn(o.inputSchema.properties,a)))throw new Error("plexus: unexpected tool argument.");if(n==="plexus"){if(!Array.isArray(i.argv)||i.argv.some(a=>typeof a!="string")||i.stdin!==void 0&&typeof i.stdin!="string")throw new Error("plexus: invalid command input.");return e.inspectCommand(i.argv),e.executeCommand({argv:i.argv,...i.stdin===void 0?{}:{stdin:i.stdin}})}if(n==="plexus_skill"){if(typeof i.path!="string"||i.path.length>240||!Object.hasOwn(jh,i.path))throw new Error("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:jh[i.path],skillHash:gu}}if(typeof i.operation!="string"||!["list","read","search","edit","write","remove"].includes(i.operation)||i.path!==void 0&&(typeof i.path!="string"||i.path.length>500)||i.content!==void 0&&(typeof i.content!="string"||i.content.length>1e6)||i.oldText!==void 0&&(typeof i.oldText!="string"||i.oldText.length>1e6)||i.query!==void 0&&(typeof i.query!="string"||!i.query.length||i.query.length>1e3)||i.offset!==void 0&&(typeof i.offset!="number"||!Number.isSafeInteger(i.offset)||i.offset<0)||i.maxChars!==void 0&&(typeof i.maxChars!="number"||!Number.isSafeInteger(i.maxChars)||i.maxChars<1||i.maxChars>24e3))throw new Error("plexus: invalid workspace input.");return d4(i)},"executePlexusAgentTool")}s(aM,"createPlexusAgentToolExecutor");var Tm=aM({inspectCommand:dM,executeCommand:cM});function $m(){let e=new Uo({binaryLabel:"Plexus CLI",binaryName:"plexus-cli",binaryVersion:oM});e.register(ya.HelpCommand),e.register(ya.VersionCommand);for(let n of Em)e.register(n);async function t(n,r){let i;try{i=e.process(n,r)}catch(o){return(r.stderr??process.stderr).write(e.error(o,{colored:!1})),2}return f4(i,r.stderr??process.stderr),e.run(i,r)}return s(t,"run"),{process(n,r){return e.process(n,r)},run:t,async runExit(n,r){process.exitCode=await t(n,r)}}}s($m,"createPlexusCli");function f4(e,t){let n=e.path.join(" "),r=e.constructor.paths?.[0]?.join(" ");r!==void 0&&n!==r&&_a[n]===r&&dt(t,n,r),n in _a&&eo(n)==="confirm"&&!Ca(e)&&t.write(`plexus-cli: \`${_a[n]}\` only prints its plan without --confirm \u2014 nothing was changed.
9790
+ `);return n.length>0?1:0}},zS=class extends Sn{static{s(this,"UsersRelinkAuthCommand")}static paths=[["users","relink-auth"]];static usage=E.Usage({category:"Users",description:"Relink a user's identity row to its live Better Auth account (heals an orphan)."});email=p.String({required:!0});async execute(){let n=await(await this.caller()).mutation(S.platformAdmin.relinkAuthAccount,{email:this.email}),r=n.changed?`Relinked ${this.email} to live auth account ${n.authId}.`:`${this.email} already linked to the live auth account (no change).`;return this.report(n,r),0}};function tM(e,t){if(e===t)throw new Error("Pass exactly one of --on or --off.");return e}s(tM,"requireOnOff");var nM=[$S,RS,IS,OS,PS,_S,NS,CS,DS,FS,LS,MS,kc,qS,KS,jS,BS,VS,US,GS,zS];function rM(e){return e.de??e.en??Object.values(e)[0]??""}s(rM,"titleDe");function s4(e){return{id:e._id,kind:e.kind,status:e.status,title:rM(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(s4,"row");var a4=["id","kind","status","title","assignee","group","outcome"],HS=class extends D{static{s(this,"WorkItemsListCommand")}static paths=[["work-items","list"]];static usage=E.Usage({category:"Work-Items",description:"List work-items for the active tenant (filter by --mine/--application/--group)."});mine=p.Boolean("--mine",!1,{description:"Only items assigned to me."});application=p.String("--application",{description:"Filter by application id."});group=p.String("--group",{description:"Filter by team (permission-group) id."});assignee=p.String("--assignee",{description:"Filter by assignee users._id."});openOnly=p.Boolean("--open-only",!1,{description:"Only open items."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.list,{client:n,...this.mine?{mine:!0}:{},...this.application?{applicationId:this.application}:{},...this.group?{queueGroupId:this.group}:{},...this.assignee?{assigneeUserId:this.assignee}:{},...this.openOnly?{openOnly:!0}:{}});return this.print(r,i=>i.map(s4),a4),0}},YS=class extends D{static{s(this,"WorkItemsShowCommand")}static paths=[["work-items","show"]];static usage=E.Usage({category:"Work-Items",description:"Show one work-item by id."});workItemId=p.String({required:!0,name:"workItemId"});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(S.workItems.get,{client:n,workItemId:this.workItemId});if(r===null)throw new Error(`work-item ${this.workItemId} not found in tenant ${n}.`);return this.print(r,i=>[{field:"id",value:i._id},{field:"kind",value:i.kind},{field:"status",value:i.status},{field:"title",value:rM(i.title)},{field:"assignee",value:i.assigneeUserId??""},{field:"group",value:i.queueGroupId??""},{field:"application",value:i.applicationId??""},{field:"node",value:i.nodeId??""},{field:"outcome",value:i.outcome??""}]),0}},JS=class extends D{static{s(this,"WorkItemsCreateCommand")}static paths=[["work-items","create"]];static usage=E.Usage({category:"Work-Items",description:"Create a manual task work-item."});title=p.String("--title",{required:!0,description:"Task title."});description=p.String("--description",{description:"Task description."});application=p.String("--application",{description:"Link to an application id."});group=p.String("--group",{description:"Team (permission-group) id whose queue holds the task."});assignee=p.String("--assignee",{description:"Assignee users._id."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.createManual,{client:n,title:this.title,...this.description?{description:this.description}:{},...this.application?{applicationId:this.application}:{},...this.group?{queueGroupId:this.group}:{},...this.assignee?{assigneeUserId:this.assignee}:{}});return this.print({workItemId:r.workItemId},i=>[{field:"workItemId",value:i.workItemId}]),0}},QS=class extends D{static{s(this,"WorkItemsCompleteCommand")}static paths=[["work-items","complete"]];static usage=E.Usage({category:"Work-Items",description:"Complete a work-item (optionally with an outcome)."});workItemId=p.String({required:!0,name:"workItemId"});outcome=p.String("--outcome",{description:"Outcome id to record."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.complete,{client:n,workItemId:this.workItemId,...this.outcome?{outcome:this.outcome}:{}});return this.print({workItemId:r.workItemId,status:"done"},i=>[{field:"workItemId",value:i.workItemId},{field:"status",value:i.status}]),0}},ZS=class extends D{static{s(this,"WorkItemsAssignCommand")}static paths=[["work-items","assign"]];static usage=E.Usage({category:"Work-Items",description:"Assign a work-item to a user (omit --user to unassign)."});workItemId=p.String({required:!0,name:"workItemId"});user=p.String("--user",{description:"Assignee users._id (omit to clear)."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(S.workItems.assign,{client:n,workItemId:this.workItemId,...this.user?{userId:this.user}:{}});return this.print({workItemId:r.workItemId,assignee:this.user??"(cleared)"},i=>[{field:"workItemId",value:i.workItemId},{field:"assignee",value:i.assignee}]),0}},iM=[HS,YS,JS,QS,ZS];var Em=[...PT,...wR,...KI,...qI,...fO,...EO,...AO,...X0,...nM,...u0,...rR,...lO,...H0,...IT,...n$,...eR,...RO,...$O,...PO,..._O,...sO,...zI,...iM,...uF,...JF,...d0,...QF,...F0,...U0,...f0,...v0,...A0,...W0,...Z0,...HT];var oM="0.1.18";function sM(){return Em.flatMap(e=>(e.paths??[]).map(t=>{let n=t.join(" "),r=ET[Na(n)];return{path:n,effect:eo(n),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,t)=>e.path.localeCompare(t.path))}s(sM,"plexusCommandCatalog");import Fo from"node:path";function l4(e){let t=st()?.workspaceRoot??process.cwd(),n=Fo.resolve(t,e),r=Fo.relative(t,n);if(Fo.isAbsolute(e)||r===".."||r.startsWith(`..${Fo.sep}`))throw new Error("plexus: use a relative path inside the current workspace.");return{absolute:n,relative:r}}s(l4,"workspacePath");function d4(e){let{absolute:t,relative:n}=l4(e.path??".");if(e.operation==="list"){if(!Oe(t))return{files:[]};let r=[],i=s(o=>{for(let a of Vi(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new Error("plexus: workspace symlinks are not supported.");let l=Fo.join(o,a.name);if(a.isDirectory()?i(l):r.push(Fo.relative(t,l)),r.length>200)throw new Error("plexus: the workspace contains too many files. List a subdirectory.")}},"visit");return i(t),{files:r.sort()}}if(!n)throw new Error("plexus: name a workspace file.");if(["read","search","edit"].includes(e.operation)){let r=ke(t);if(r.length>10*1024*1024)throw new Error("plexus: the workspace file exceeds 10 MB.");let i=new TextDecoder("utf-8",{fatal:!0}).decode(r);if(e.operation==="read"){let l=e.offset??0,d=e.maxChars??8e3,c=i.slice(l,l+d);return{path:n,content:c,...l||c.length<i.length?{offset:l,nextOffset:l+c.length<i.length?l+c.length:null,totalCharacters:i.length}:{}}}if(e.operation==="search"){if(!e.query)throw new Error("plexus: search needs a nonempty query.");let l=[],d=e.offset??0;for(;l.length<10;){let c=i.indexOf(e.query,d);if(c<0)break;l.push({offset:c,text:i.slice(Math.max(0,c-160),c+e.query.length+240)}),d=c+e.query.length}return{path:n,matches:l,nextOffset:l.length===10?d:null}}if(!e.oldText||typeof e.content!="string")throw new Error("plexus: edit needs oldText and replacement content.");let o=i.indexOf(e.oldText);if(o<0||o!==i.lastIndexOf(e.oldText))throw new Error("plexus: oldText must match exactly once. Read the current file and choose unique context.");let a=i.slice(0,o)+e.content+i.slice(o+e.oldText.length);if(Buffer.byteLength(a)>10*1024*1024)throw new Error("plexus: the edited file exceeds 10 MB.");return gt(t,a,"utf8"),{path:n,sizeBytes:Buffer.byteLength(a)}}if(e.operation==="write"){if(typeof e.content!="string"||Buffer.byteLength(e.content)>1e6)throw new Error("plexus: file content is missing or too large.");return Wt(Fo.dirname(t),{recursive:!0}),gt(t,e.content,"utf8"),{path:n,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return Ko(t),{path:n,removed:!0};throw new Error("plexus: unknown workspace operation.")}s(d4,"plexusWorkspace");function aM(e){return s(async function(n,r){if(!r||typeof r!="object"||Array.isArray(r))throw new Error("plexus: tool input must be an object.");let i=r,o=Da[n];if(!o||!Object.hasOwn(Da,n))throw new Error("plexus: unknown agent tool.");if(Object.keys(i).some(a=>!Object.hasOwn(o.inputSchema.properties,a)))throw new Error("plexus: unexpected tool argument.");if(n==="plexus"){if(!Array.isArray(i.argv)||i.argv.some(a=>typeof a!="string")||i.stdin!==void 0&&typeof i.stdin!="string")throw new Error("plexus: invalid command input.");return e.inspectCommand(i.argv),e.executeCommand({argv:i.argv,...i.stdin===void 0?{}:{stdin:i.stdin}})}if(n==="plexus_skill"){if(typeof i.path!="string"||i.path.length>240||!Object.hasOwn(jh,i.path))throw new Error("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:jh[i.path],skillHash:gu}}if(typeof i.operation!="string"||!["list","read","search","edit","write","remove"].includes(i.operation)||i.path!==void 0&&(typeof i.path!="string"||i.path.length>500)||i.content!==void 0&&(typeof i.content!="string"||i.content.length>1e6)||i.oldText!==void 0&&(typeof i.oldText!="string"||i.oldText.length>1e6)||i.query!==void 0&&(typeof i.query!="string"||!i.query.length||i.query.length>1e3)||i.offset!==void 0&&(typeof i.offset!="number"||!Number.isSafeInteger(i.offset)||i.offset<0)||i.maxChars!==void 0&&(typeof i.maxChars!="number"||!Number.isSafeInteger(i.maxChars)||i.maxChars<1||i.maxChars>24e3))throw new Error("plexus: invalid workspace input.");return d4(i)},"executePlexusAgentTool")}s(aM,"createPlexusAgentToolExecutor");var Tm=aM({inspectCommand:dM,executeCommand:cM});function $m(){let e=new Uo({binaryLabel:"Plexus CLI",binaryName:"plexus-cli",binaryVersion:oM});e.register(ya.HelpCommand),e.register(ya.VersionCommand);for(let n of Em)e.register(n);async function t(n,r){let i;try{i=e.process(n,r)}catch(o){return(r.stderr??process.stderr).write(e.error(o,{colored:!1})),2}return f4(i,r.stderr??process.stderr),e.run(i,r)}return s(t,"run"),{process(n,r){return e.process(n,r)},run:t,async runExit(n,r){process.exitCode=await t(n,r)}}}s($m,"createPlexusCli");function f4(e,t){let n=e.path.join(" "),r=e.constructor.paths?.[0]?.join(" ");r!==void 0&&n!==r&&_a[n]===r&&dt(t,n,r),n in _a&&eo(n)==="confirm"&&!Ca(e)&&t.write(`plexus-cli: \`${_a[n]}\` only prints its plan without --confirm \u2014 nothing was changed.
9791
9791
  `)}s(f4,"noteRetiredPath");function dM(e){let t=$m().process(la(e),{executePlexusAgentTool:Tm}),n=t.path.join(" ");if(n.startsWith("agent "))throw new Error("plexus: nested agent transports are not allowed.");let r=sM().find(l=>l.path===n);if(!r){if(n===""||n==="--help"||n==="--version")return{path:n,writes:!1,host:"shared"};throw new Error(`plexus: command ${n} has no host classification.`)}let i=t,o=r.effect==="callKind"?xf(xs(Ss),i.fn??"",i.kind):void 0,a=mu(n,{confirm:Ca(t),callKind:o});return{...r,writes:a}}s(dM,"inspectPlexusCommand");async function cM(e,t){if(t)return tA(t,()=>cM(e));if(!Array.isArray(e.argv)||e.argv.length===0||e.argv.length>128||e.argv.some(l=>typeof l!="string"||l.length>128e3)||(e.stdin?.length??0)>1e6)throw new Error("plexus: invalid command invocation.");let n="",r="",i=$m();if(st()){let l=dM(e.argv);if(l.host==="terminal")throw new Error(`plexus: this command requires a local machine. ${l.reason??""}`)}return{exitCode:await i.run(la(e.argv),{executePlexusAgentTool:Tm,stdin:u4.from(e.stdin===void 0?[]:[e.stdin]),stdout:new lM({write(l,d,c){n+=String(l),c()}}),stderr:new lM({write(l,d,c){r+=String(l),c()}})}),stdout:n,stderr:r}}s(cM,"executePlexusCommand");sA({source:p4.join(import.meta.dirname,"skill")});$m().runExit(la(process.argv.slice(2)),{executePlexusAgentTool:Tm});
9792
9792
  //# sourceMappingURL=cli.mjs.map
@@ -1 +1 @@
1
- cb3c97259e64d88091913224a34bd4ff7df83cbc7a0ea8e88514b56a09dbf91d
1
+ 1ed05b1d6d3b3105aed99411f816d92886682495715074569f573f8bb958f142
@@ -3158,28 +3158,28 @@ Read the login-address change log (who changed whose login address)
3158
3158
  |---|---|
3159
3159
  | `--user <value>` | An address the account holds or held (data-subject request) |
3160
3160
 
3161
- ### `users create <email>`
3161
+ ### `users archive <email>`
3162
3162
 
3163
- Create a tenant-less identity WITH a login account from just an e-mail (optionally a platform admin). Idempotent: an existing user is left untouched — no password is rotated. To (re)set a ready-to-log-in account with a name, group or permission set, use `users provision`.
3163
+ Archive a user everywhere: archive every school access (groups removed, one history entry per school; a school's last user administrator is refused), end every platform right; the identity and its history stay — plan unless --confirm.
3164
3164
 
3165
- - **Effect:** write — needs `--env`; on production also `--allow-prod`
3165
+ - **Effect:** plan by default — writes only with `--confirm` (and `--env`; on production also `--allow-prod`)
3166
3166
 
3167
3167
  | Option | Description |
3168
3168
  |---|---|
3169
- | `--out <value>` | Append the `email,password` row to this CSV file (created with a header; never overwritten). |
3170
- | `--quiet` | Do not echo the password to stdout (needs --out). |
3171
- | `--platform-admin` | Make the new user a platform admin (full _platform.* set). |
3169
+ | `--replace-with <value>` | configKey of the staff member who takes over their active applications — required while they are responsible for any. A rule naming them refuses regardless: change it first (workflow editor: „Person ersetzen“, then publish) |
3170
+ | `--confirm` | Archive (without it, only the plan is printed). |
3172
3171
 
3173
- ### `users deactivate <email>`
3172
+ ### `users create <email>`
3174
3173
 
3175
- Deactivate a user everywhere: revoke every tenant access, group membership and platform right; the identity and its history stay — plan unless --confirm.
3174
+ Create a tenant-less identity WITH a login account from just an e-mail (optionally a platform admin). Idempotent: an existing user is left untouched — no password is rotated. To (re)set a ready-to-log-in account with a name, group or permission set, use `users provision`.
3176
3175
 
3177
- - **Effect:** plan by default — writes only with `--confirm` (and `--env`; on production also `--allow-prod`)
3176
+ - **Effect:** write — needs `--env`; on production also `--allow-prod`
3178
3177
 
3179
3178
  | Option | Description |
3180
3179
  |---|---|
3181
- | `--replace-with <value>` | configKey of the staff member who takes over their active applications — required while they are responsible for any. A rule naming them refuses regardless: change it first (workflow editor: „Person ersetzen“, then publish) |
3182
- | `--confirm` | Deactivate (without it, only the plan is printed). |
3180
+ | `--out <value>` | Append the `email,password` row to this CSV file (created with a header; never overwritten). |
3181
+ | `--quiet` | Do not echo the password to stdout (needs --out). |
3182
+ | `--platform-admin` | Make the new user a platform admin (full _platform.* set). |
3183
3183
 
3184
3184
  ### `users doctor`
3185
3185
 
@@ -3267,7 +3267,7 @@ Relink a user's identity row to its live Better Auth account (heals an orphan).
3267
3267
 
3268
3268
  ### `users revoke <email>`
3269
3269
 
3270
- Revoke a user's access to the active tenant (--tenant) — plan unless --confirm. Other tenants keep it; `users deactivate` revokes everywhere.
3270
+ Revoke a user's access to the active tenant (--tenant) — plan unless --confirm. Other tenants keep it; `users archive` archives everywhere.
3271
3271
 
3272
3272
  - **Effect:** plan by default — writes only with `--confirm` (and `--env`; on production also `--allow-prod`)
3273
3273
 
@@ -132,7 +132,7 @@ a fixed person.
132
132
  ## A staff member leaves
133
133
 
134
134
  A person a rule names — as a row's person or in a „Reihum" pool — cannot leave the staff (`users revoke`, `users unset-group`,
135
- `users deactivate`), leave a team whose slot names them, and a team a rule has a slot
135
+ `users archive`), leave a team whose slot names them, and a team a rule has a slot
136
136
  for cannot be deleted — refused (`[CONFLICT] [assignment/ruleReferences] …`), naming offer
137
137
  (label + status), slot and row. The check reads every `wip` and published offer
138
138
  version (archived ones only run pinned test starts, which fail loud instead). Order:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartkomm/plexus-cli",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Unified Plexus admin + admission-offer config CLI (Convex backend).",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",