@smartkomm/plexus-cli 0.1.153 → 0.1.154
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/dist/cli.mjs
CHANGED
|
@@ -4472,7 +4472,7 @@ a branch (\`if\` node) and may decide what a contract prints, so it can be corre
|
|
|
4472
4472
|
**until the first step that reads it has been reached**. After that the step has already
|
|
4473
4473
|
decided, charged or printed with the old value: discard the application and start it again.
|
|
4474
4474
|
|
|
4475
|
-
|
|
4475
|
+
The cockpit offers no entry for this correction at the moment; this command is the way.
|
|
4476
4476
|
|
|
4477
4477
|
## Prerequisites
|
|
4478
4478
|
- The permission to manage applications on the tenant (the same one \u201E+ Bewerbung" needs).
|
|
@@ -10958,7 +10958,7 @@ plexus-cli --env prod jobs list --status running # nothing unexpectedly in
|
|
|
10958
10958
|
## Related
|
|
10959
10959
|
- Command reference: \`plexus-cli jobs list --help\`, \`plexus-cli platform workers reap --help\`,
|
|
10960
10960
|
\`plexus-cli platform imports cleanup-orphaned --help\`.
|
|
10961
|
-
`};var Zu="4a0f0029198cee4028548be293fe92da340f93d6a9a1e7fa6fb84ee5118bb322",Gg=_R;var zg=class extends ve{static{s(this,"AgentToolsCommand")}static paths=[["agent","tools"]];static usage=T.Usage({category:"Agents",description:"Show the shared platform/CLI agent tool schemas and skill revision."});async execute(){return this.print({skillHash:Zu,tools:pl}),0}},Wg=class extends ve{static{s(this,"AgentInvokeCommand")}static paths=[["agent","invoke"]];static usage=T.Usage({category:"Agents",description:"Invoke a shared agent tool; pipe its JSON input on stdin."});tool=f.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 Ug(this.context.stdin)),n=await this.context.executePlexusAgentTool(this.tool,t);return this.print(n),0}},NR=[zg,Wg];var Yg=[{key:"fixture_test",email:"test@example.com",firstName:"Test",lastName:"Bewerber"}],Hae=new Set(Yg.map(e=>e.key));function PR(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(PR,"resolveStartTarget");function ZG(e){return e.kind==="named"?e.name:`(${e.standIn??e.fallback})`}s(ZG,"applicantText");function DR(e){return e.map(t=>({id:t.application._id,status:t.deletedAt?`${t.application.status} (gel\xF6scht)`:t.application.status,state:t.currentProcessStateId??"",applicant:ZG(t.applicantName),test:t.application.testMode===!0?"test":""}))}s(DR,"applicationRows");var CR=Yg.map(e=>e.email);function FR(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(jg(e,t)&&(r===void 0||!CR.includes(r.trim().toLowerCase())))throw new Error(`applications start-test: on prod only for the test account ${CR.join(", ")} (--applicant) \u2014 never a real family's`)}s(FR,"assertStartApplicant");function LR(e){let t={};for(let{address:n,...r}of e.entries)t[n]=r;return{applicationId:e.applicationId,store:t}}s(LR,"processStoreJson");function XG(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.snapshotNumber}`} \xB7 ${e.contractStatus}`;case"contracts":return e.contracts.map(t=>`${t.partKey}: contract ${t.contractId} \xB7 ${t.revision===null?"keine Fassung":`Fassung ${t.revision.snapshotNumber}`} \xB7 ${t.contractStatus}`).join("; ")}}s(XG,"refText");function ez(e){return e.state!=="present"?e.reason?.de??"":e.ref!==void 0?XG(e.ref):JSON.stringify(e.value)}s(ez,"holds");function MR(e){return e.entries.map(t=>({address:t.address,state:t.state,holds:ez(t),producer:t.producer?.label??"",written:t.writtenAt===void 0?"":new Date(t.writtenAt).toISOString()}))}s(MR,"storeRows");function Xu(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(Xu,"parseKv");var qR="started",ef="submitted",tf="submitted",KR="load-scenario:";var jR="(Bewerbung)";function VR(e){return{nodeId:jR,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(VR,"sharedAsList");function BR(e){return e.disabledReason===void 0?"":e.disabledCount===void 0?e.disabledReason:`${e.disabledReason} (${e.disabledCount})`}s(BR,"disabledText");function UR(e){return e.flatMap(({nodeId:t,actions:n})=>n.map(r=>({node:t,action:r.id,label:r.label.de,disabled:BR(r)})))}s(UR,"actionRows");function GR(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: ${BR(a)}`);if(i!==jR)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(GR,"nodeOfferingAction");function zR(e,t,n){if(e.startsWith(KR)){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(zR,"runParams");async function tz(e,t){let n=await e.query(x.workflow.getInstance,{applicationId:t});if(n===null)throw new Error(`test-actions: application ${t} has no workflow instance`);return n.instance.currentNodeIds}s(tz,"currentNodeIds");function nz(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(nz,"refusalText");async function nf(e,t,n){let r=await e.query(x.workflow.listSharedTestActions,{applicationId:t});if(!r.permitted)throw new Error(`test-actions: not permitted \u2014 ${nz(t,r.reason)}`);let i=[];for(let o of n){let a=await e.query(x.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,VR(r.actions)]}s(nf,"actionsOf");async function WR(e,t,n){return n!==void 0?[n]:await tz(e,t)}s(WR,"nodesOf");var Hg=class extends D{static{s(this,"TestActionsListCommand")}static paths=[["test-actions","list"]];static usage=T.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=f.String("--application",{required:!0,description:"Application id (a test application)"});node=f.String("--node",{description:"Node id (default: the application's current nodes)"});async execute(){let t=await this.caller(),n=await nf(t,this.application,await WR(t,this.application,this.node));return this.print(n,UR,["node","action","label","disabled"]),0}},Jg=class extends D{static{s(this,"TestActionsRunCommand")}application=f.String("--application",{required:!0,description:"Application id (a test application)"});node=f.String("--node",{description:"Node id (default: the application's current nodes)"});static paths=[["test-actions","run"]];static usage=T.Usage({category:"Admission",description:"Run one test-mode action; a scenario (load-scenario:<id>) also submits unless --no-auto-submit"});action=f.String("--action",{required:!0,description:"Action id, e.g. load-scenario:standard, auto-fill-files, submit-form"});autoSubmit=f.Boolean("--auto-submit",!0,{description:"Scenario only: stub the file fields and submit after loading (default on; --no-auto-submit only loads)"});param=f.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 (its `confirm` in `test-actions list`)"});async execute(){let t=zR(this.action,this.autoSubmit,Xu(this.param??[]).values),n=await this.caller(),r=this.application,i=await WR(n,this.application,this.node),o=GR(await nf(n,r,i),this.action,i);return await n.mutation(x.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}},YR=[Hg,Jg];var ze=["de","en"];function bs(e,t){return ze.every(n=>e[n]===t[n])}s(bs,"sameText");function Tt(e){if(e===null||typeof e!="object"||Array.isArray(e))return"not-localized";let t=e;return Object.keys(t).some(r=>!ze.includes(r))?"not-localized":ze.filter(r=>{let i=t[r];return typeof i!="string"||i.trim()===""})}s(Tt,"missingLocales");function Ti(e){let t=Tt(e);return t!=="not-localized"&&t.length===0}s(Ti,"isLocalizedText");function ml(e,t){let n={};for(let r of ze){let i=e.map(o=>o[r]);n[r]=i.every(o=>typeof o=="string"&&o.trim()!=="")?t(i,r):""}return n}s(ml,"composeTexts");var mr=/^[a-z][A-Za-z0-9]*$/;function Qg(e){return typeof e=="string"&&mr.test(e)}s(Qg,"isNodeId");function vs(e,t){Qg(e)||F(`[graph/nodeIdFormat] "${e}" cannot name a node: a node id is ${mr.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(vs,"makeNodeId");var Ri="$env";function pe(e){if(e.scope==="env")return`${Ri}.${e.key}`;let t=`$${e.scope}.${e.owner}.${e.key}`;return e.path===void 0?t:`${t}.${e.path}`}s(pe,"formatAddress");var $i=/^[a-z][a-zA-Z0-9_]*$/,rz=/^[A-Za-z_][A-Za-z0-9_]*$/;function po(e){return typeof e=="string"&&e.split(".").every(t=>rz.test(t))}s(po,"isPath");function mo(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&&po(i)?{scope:"env",key:i}:null}case"node":case"task":{let[i,o,...a]=r;return i===void 0||o===void 0||!$i.test(o)||(n==="node"?!mr.test(i):!$i.test(i))?null:iz({scope:n,owner:i,key:o},a)}default:return null}}s(mo,"tryParseAddress");function iz(e,t){if(t.length===0)return e;let n=t.join(".");return po(n)?{...e,path:n}:null}s(iz,"withPath");function xe(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=t.scope==="env"?["scope","key"]:["scope","owner","key","path"];if(Object.keys(t).some(r=>!n.includes(r))||t.path!==void 0&&!po(t.path))return!1;switch(t.scope){case"env":return po(t.key);case"node":return typeof t.owner=="string"&&mr.test(t.owner)&&typeof t.key=="string"&&$i.test(t.key);case"task":return typeof t.owner=="string"&&$i.test(t.owner)&&typeof t.key=="string"&&$i.test(t.key);default:return!1}}s(xe,"isAddress");var Yr={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"}},xs=Object.keys(Yr);function Ss(e){return Object.hasOwn(Yr,e)}s(Ss,"isEnvKey");var oz=["self-service","staff"];function HR(e,t){return{kind:"fixed",values:e,labels:t}}s(HR,"fixedSet");var rf={of:"applicant.language",withoutValue:"de"},Hr={"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:rf},"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:rf},"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:rf},"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:rf},"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:HR(ze,{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:HR(oz,{staff:{de:"intern",en:"in-house"},"self-service":{de:"online (Familie)",en:"online (family)"}}),nullable:!1,label:{de:"Eingangsweg",en:"Intake channel"}}},of={types:Yr,fields:Hr},sf=xs.flatMap(e=>Object.keys(Yr[e]).map(t=>`${e}.${t}`));function Yn(e){return Object.hasOwn(Hr,e)}s(Yn,"isEnvLeaf");function af(e){return`${Ri}.${e}`}s(af,"envIdentifier");function ho(e){let t=Hr[e],[n,r]=e.split("."),i=Yr[n][r];i===void 0&&F(`[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&&F(`[env] "${e}" names the value "${a}" without a label`),{value:a,label:l}})}:{}}}s(ho,"envLeaf");var JR="staffInput";var sz=["boolean"],hl=/^[a-z][A-Za-z0-9]*$/;function lf(e){return e.staffInputs??[]}s(lf,"staffInputsOf");function df(e){return`${JR}.${e}`}s(df,"staffInputLeaf");function QR(e){return`${Ri}.${df(e)}`}s(QR,"staffInputIdentifier");function az(e){let t=`${JR}.`;return e.startsWith(t)?e.slice(t.length):null}s(az,"staffInputKeyOfLeaf");function As(e,t){let n=az(t);return n===null?void 0:lf(e).find(r=>r.key===n)}s(As,"declaredStaffInput");function ZR(e){return[...lf(e).map(t=>({leaf:df(t.key),type:t.type,label:t.label,valueSet:{kind:"open"},nullable:!1,cohortBound:!1})),...sf.map(t=>{let n=ho(t);return{leaf:t,type:n.type,label:n.label,valueSet:Hr[t].valueSet,nullable:n.nullable,cohortBound:n.cohortBound===!0}})]}s(ZR,"envLeavesFor");function XR(e){return ZR(e).filter(t=>!t.cohortBound)}s(XR,"conditionEnvLeaves");function eI(e){return nI(XR(e))}s(eI,"envConditionSchemaFor");function lz(e){return ZR(e).map(t=>t.leaf==="stage.key"?{...t,valueSet:{kind:"open"}}:t)}s(lz,"offerConditionEnvLeaves");function tI(e){return nI(lz(e))}s(tI,"offerConditionSchemaFor");function nI(e){let t={},n={};for(let{leaf:r,type:i,valueSet:o,nullable:a}of e){let[l="",d=""]=r.split(".");t[l]={...t[l]??{},[d]:i},n[r]={valueSet:o,nullable:a}}return{types:t,fields:n}}s(nI,"schemaOfLeaves");function rI(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}"`};hl.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),sz.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=Tt(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(rI,"staffInputIssues");var ay={required:!0,description:"Offer slug (its offerKey)"},Zg=class extends D{static{s(this,"ApplicationsListCommand")}static paths=[["applications","list"]];static usage=T.Usage({category:"Admission",description:"List an offer's applications (id, status, board state, applicant, test)"});offer=f.String("--offer",ay);testOnly=f.Boolean("--test-only",!1,{description:"Only test applications"});async execute(){let t=await this.caller(),n=await t.query(x.admission.listForAngebot,{client:this.requireTenant(t),offerKey:this.offer}),r=DR(n).filter(i=>!this.testOnly||i.test==="test");return this.print(r,i=>i,["id","status","state","applicant","test"]),0}},Xg=class extends D{static{s(this,"ApplicationsCountsCommand")}static paths=[["applications","counts"]];static usage=T.Usage({category:"Admission",description:"Count an offer's applications per list"});offer=f.String("--offer",ay);async execute(){let t=await this.caller(),n=await t.query(x.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}},ey=class extends D{static{s(this,"ApplicationsShowCommand")}static paths=[["applications","show"]];static usage=T.Usage({category:"Admission",description:"One application: status, test flag, offer, current workflow nodes"});application=f.String({required:!0});async execute(){let t=await this.caller(),n=this.application,r=await t.query(x.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(x.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.offerId},{key:"current nodes",value:o.currentNodes.join(", ")}]),0}},ty=class extends D{static{s(this,"ApplicationsStoreCommand")}static paths=[["applications","store"]];static usage=T.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, $env\u2026). Values are shown whatever their audience \u2014 never hand the output to the family. Recipe: playbooks/applications/inspect-process-store.md."});application=f.String({required:!0});async execute(){let n=await(await this.caller()).query(x.processStoreView.get,{applicationId:this.application});return this.print(LR(n),()=>MR(n),["address","state","holds","producer","written"]),0}},ny=class extends D{static{s(this,"ApplicationsStartTestCommand")}static paths=[["applications","start-test"]];static usage=T.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=f.String("--offer",ay);run=f.String("--run",{required:!0,description:"School year: its key or id (never its name)"});stage=f.String("--stage",{required:!0,description:"Level: its key or id (never its name)"});party=f.String("--party",{description:"Applicant party id"});applicant=f.String("--applicant",{description:"Applicant account login address (e.g. the test account test@example.com)"});version=f.String("--version",{description:"Offer version id to test (default: the live generation)"});staffInput=f.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=f.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();FR(this.resolvedTarget(),this.prodUrls(),this.party,this.applicant);let n=this.requireTenant(t),r=PR(await t.query(x.admission.listAdmissionTree,{client:n}),this.offer,this.run,this.stage),i=this.party;if(this.applicant!==void 0){let d=await t.query(x.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(x.admission.staffStartApplicationForParty,{client:n,offerKey:this.offer,partyId:i,programRunId:r.programRunId,programStageId:r.programStageId,...this.proxy===void 0?{}:{startInProxy:this.proxy},staffInputs:oI(this.staffInput??[]),testMode:!0,...this.version===void 0?{}:{offerVersionId:this.version}}),a,l;try{let d=await t.query(x.workflow.getInstance,{applicationId:o.applicationId});if(d===null)throw new Error("the started application has no workflow instance");a=d.instance.currentNodeIds,l=(await nf(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}},ry=class extends D{static{s(this,"ApplicationsDiscardTestCommand")}static paths=[["applications","discard-test"]];static usage=T.Usage({category:"Admission",description:"Discard a TEST application (the server refuses a real one), or with --all-test every expired one of the school",details:"With an id: discards that test application. With --all-test --older-than <N>d: lists the school's test applications whose last activity is older than N days (N \u2265 14) and that are not kept as a demo \u2014 a dry run unless --confirm; --confirm discards each expired one the server re-checks, the rest are reported with the reason. Recipe: playbooks/applications/expire-test-applications.md.",examples:[["Dry run","plexus-cli --env prod --tenant <t> applications discard-test --all-test --older-than 14d --dry-run"],["Discard","plexus-cli --env prod --tenant <t> --allow-prod applications discard-test --all-test --older-than 14d --confirm"]]});application=f.String({required:!1});allTest=f.Boolean("--all-test",!1,{description:"Every expired test application of the school instead of one id"});olderThan=f.String("--older-than",{description:"With --all-test: days without activity, as <N>d (N \u2265 14)"});dryRun=f.Boolean("--dry-run",!1,{description:"With --all-test: list only (the default)"});confirm=f.Boolean("--confirm",!1,{description:"With --all-test: discard (else the dry run)"});async execute(){if(!this.allTest){if(this.application===void 0)throw new Error("applications discard-test: name an application id, or use --all-test --older-than <N>d");if(this.olderThan!==void 0||this.dryRun||this.confirm)throw new Error("applications discard-test: --older-than, --dry-run and --confirm belong to --all-test");return await(await this.caller()).mutation(x.admission.discardTest,{applicationId:this.application}),this.print({discarded:this.application},u=>[{key:"discarded",value:u.discarded}]),0}if(this.application!==void 0)throw new Error("applications discard-test: --all-test takes no application id");if(this.olderThan===void 0)throw new Error("applications discard-test --all-test: --older-than <N>d is required");if(this.dryRun&&this.confirm)throw new Error("applications discard-test: --dry-run and --confirm exclude each other");let t=dz(this.olderThan),n=await this.caller(),r=this.requireTenant(n),i=[],o=null;for(;;){let c=await n.query(x.admission.testTtlPlan,{client:r,olderThanDays:t,cursor:o});if(i.push(...c.rows),c.isDone)break;o=c.continueCursor}let a=i.map(c=>({...c,result:c.verdict!=="expired"?"kept":c.block!==null?"blocked":this.confirm?"pending":"would discard"})),l=i.filter(c=>c.verdict==="expired"&&c.protectedDemo).map(c=>c.applicationId);if(this.confirm&&l.length>0)throw new Error(`applications discard-test --all-test: protected demo application(s) in the discard set, nothing discarded: ${l.join(", ")}`);let d=0;if(this.confirm)for(let c of a.filter(u=>u.result==="pending"))try{await n.mutation(x.admission.discardExpiredTest,{applicationId:c.applicationId,olderThanDays:t}),c.result="discarded"}catch(u){d++,c.result=`failed: ${u instanceof Error?u.message:String(u)}`}return this.print({olderThanDays:t,confirm:this.confirm,rows:a},c=>c.rows.map(u=>({id:u.applicationId,lastActivity:new Date(u.lastActivityAt).toISOString().slice(0,10),verdict:u.verdict,block:u.block??"",result:u.result})),["id","lastActivity","verdict","block","result"]),d>0?1:0}};function dz(e){let t=/^(\d+)d$/.exec(e.trim());if(t===null)throw new Error(`--older-than "${e}": expected <N>d, e.g. 14d`);return Number(t[1])}s(dz,"parseDays");var iy=class extends D{static{s(this,"ApplicationsSetKeepDemoCommand")}static paths=[["applications","set-keep-demo"]];static usage=T.Usage({category:"Admission",description:"Mark a TEST application \u201EDemo behalten\u201C (never expires, never discarded), or clear the mark with --off"});application=f.String({required:!0});off=f.Boolean("--off",!1,{description:"Clear the mark"});async execute(){return await(await this.caller()).mutation(x.admission.setKeepAsDemo,{applicationId:this.application,keep:!this.off}),this.print({application:this.application,keepAsDemo:!this.off},n=>[{key:"application",value:n.application},{key:"keep as demo",value:n.keepAsDemo?"ja":"nein"}]),0}},oy=class extends D{static{s(this,"ApplicationsStaffInputListCommand")}static paths=[["applications","staff-input","list"]];static usage=T.Usage({category:"Admission",description:"An application's internal inputs (set at the start): value, and why one can no longer be corrected"});application=f.String({required:!0});async execute(){let n=await(await this.caller()).query(x.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}},sy=class extends D{static{s(this,"ApplicationsStaffInputSetCommand")}static paths=[["applications","staff-input","set"]];static usage=T.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=f.String({required:!0});input=f.String("--input",{required:!0,description:"key=true|false"});reason=f.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}]=oI([this.input]);return await t.mutation(x.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}},iI=[Zg,Xg,ey,ty,ny,ry,iy,oy,sy];function oI(e){return e.map(t=>{let[n="",r,...i]=t.split("=");if(!hl.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(oI,"parseStaffInputs");var jt="contractGenerator",go="documentTemplate";function gl(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(gl,"isGeneratorRef");function sI(e,t){let n=e.inputs?.[t];return n?.kind==="literal"?n.value:void 0}s(sI,"literalOf");function Jr(e){let t=sI(e,jt);return gl(t)?t:null}s(Jr,"generatorRefOfNode");function hr(e){let t=sI(e,go);return typeof t=="string"&&t.length>0?t:null}s(hr,"documentTemplateKeyOfNode");function aI(e){return`${e.kind}:${e.key}${e.revision===void 0?"":`@${e.revision}`}`}s(aI,"generatorRefLabel");var cz=["formExports","generatorStamp"];function lI(e,t,n){let r=e.inputs?.[jt];(r?.kind!=="literal"||!gl(r.value))&&F(`applyGeneratorStamp: the node names no generator in inputs.${jt} \u2014 a stamp derives from it`),n.freezeRevision&&t.revision!==void 0&&(e.inputs[jt]={kind:"literal",value:{...r.value,revision:t.revision}}),e.generatorStamp={inputSchema:t.inputSchema,parties:t.parties,schemaDigest:t.schemaDigest,...t.parts===void 0?{}:{parts:t.parts},...t.coverLetter===void 0?{}:{coverLetter:t.coverLetter}}}s(lI,"applyGeneratorStamp");var uz=["reads"];function Es(e){if(e===null||typeof e!="object")return e;let t={...e};return Array.isArray(t.nodes)&&(t.nodes=t.nodes.map(n=>{if(n===null||typeof n!="object")return n;let r={...n};for(let i of cz)delete r[i];for(let i of uz)Array.isArray(r[i])&&r[i].length===0&&delete r[i];return r})),t}s(Es,"comparableWorkflowGraph");var yl={id:{de:"die Identit\xE4t ist der Slug des Angebots (bundle.yaml slugs.manifest)",en:"the identity is the offer's slug (bundle.yaml slugs.manifest)"},label:{de:"der Titel steht in bundle.yaml `label`",en:"the title is bundle.yaml `label`"},version:{de:"die Revision z\xE4hlt die Datenbank",en:"the database counts the revision"},applicantMode:{de:"von nichts gelesen",en:"read by nothing"},signatureLevel:{de:"von nichts gelesen",en:"read by nothing"},roleInstances:{de:"die Rollen kommen aus den Formular-Effekten",en:"roles come from the form effects"},leistungen:{de:"von nichts gelesen",en:"read by nothing"},capacity:{de:"die Kapazit\xE4t geh\xF6rt der Kohorte (program.runs[].capacities)",en:"capacity belongs to the cohort (program.runs[].capacities)"},progressLayoutId:{de:"von nichts gelesen",en:"read by nothing"},bewerbungsfenster:{de:"die Kohorte besitzt die \xD6ffnung (isOpen / applicationOpensAt)",en:"the cohort owns opening (isOpen / applicationOpensAt)"},selection:{de:"die Reihenfolge ist der Eingang `waitlistOrder` des Wartelistenknotens (automatisches Nachr\xFCcken gibt es nicht mehr; Freigabe-Strategie und Stichtag las nichts)",en:"the order is the waitlist node's input `waitlistOrder` (automatic promotion is gone; release strategy and deadline were read by nothing)"},progressLayout:{de:"das Fortschrittslayout geh\xF6rt zum Workflow: den Block nach workflow.json `progressLayout` verschieben (ohne Workflow l\xF6schen)",en:"the progress layout belongs to the workflow: move the block to workflow.json `progressLayout` (without a workflow: delete it)"}};function cf(e){return e===null||typeof e!="object"||Array.isArray(e)?["manifest: data must be an object"]:Object.keys(e).map(t=>{let n=yl[t];return n!==void 0?`manifest: \`${t}\` is no longer part of manifest.json (${n.en}). Delete the line.`:`manifest: unknown key \`${t}\` \u2014 manifest.json carries no key.`})}s(cf,"manifestIssues");function fz(e){let t=[],n=e.buses;if(!Array.isArray(n))return t;let r=n.find(i=>!!i&&typeof i=="object"&&i.key==="process");if(!r||!Array.isArray(r.states))return t;for(let i of r.states){if(!i||typeof i!="object")continue;let o=i;if(o.terminal!==!0&&(!o.external||typeof o.external!="object")){let a=typeof o.id=="string"?o.id:"?";t.push(`progressLayout: progress state '${a}' is non-terminal but declares no 'external' block (applicant-facing copy) \u2014 resolveStatusPresentation would throw at runtime`)}}return t}s(fz,"validateProgressLayoutExternalCopy");function dI(e){if(e===null||typeof e!="object")return["progressLayout: the full layout object is required"];let t=e.buses;return!Array.isArray(t)||!t.some(n=>!!n&&typeof n=="object"&&n.key==="process")?["progressLayout: the layout must declare the `process` bus"]:fz(e)}s(dI,"progressLayoutIssues");var cI=new Set(["nodes","assignmentRules","channels","processStore","staffInputs"]);var pz=new Set(["sections","effects","outcomes","testScenarios","env","views"]),uf={id:{de:"der Schl\xFCssel des Formulars ist sein Slug",en:"the form's key is its slug"},label:{de:"der Name steht in der Formularzeile (createSmartForm.label)",en:"the name is the form row's (createSmartForm.label)"},outcomeIds:{de:"die Ergebnisse sind die ids von outcomes[]",en:"the outcomes are the ids of outcomes[]"},schoolSlug:{de:"von nichts gelesen",en:"read by nothing"}};function uI(e,t){if(e===null||typeof e!="object"||Array.isArray(e))return[{de:`${t}: die Formulardefinition muss ein Objekt sein.`,en:`${t}: the form definition must be an object.`}];let n=[];for(let i of Object.keys(e)){if(pz.has(i))continue;let o=uf[i];n.push(o!==void 0?{de:`${t}: \`${i}\` geh\xF6rt nicht mehr zur Formulardefinition (${o.de}). Die Zeile l\xF6schen.`,en:`${t}: \`${i}\` is no longer part of the form definition (${o.en}). Delete the line.`}:{de:`${t}: unbekannter Schl\xFCssel \`${i}\`.`,en:`${t}: unknown key \`${i}\`.`})}let r=e;for(let i of["sections","effects","outcomes"])Array.isArray(r[i])||n.push({de:`${t}: \`${i}\` muss eine Liste sein.`,en:`${t}: \`${i}\` must be a list.`});return n}s(uI,"smartFormDefinitionShapeIssues");var wn=["granted","rejected","waitlisted","other"];function Ii(e){return typeof e=="string"&&wn.includes(e)}s(Ii,"isOutcomeSemantic");var Hn=["arrival","manual"],fI={arrival:{de:"Nach Eingang",en:"By arrival"},manual:{de:"Von Hand sortiert",en:"Sorted by hand"}};function mz(e,t){let n=e.inputs?.[t];return n?.kind==="literal"?n.value:void 0}s(mz,"literal");function ly(e){let t=mz(e,"waitlistOrder");return Hn.includes(t)?{waitlistOrder:t}:null}s(ly,"waitlistPolicyOrNull");var ht="responsible",dy="team:";function ff(e){return`${dy}${e}`}s(ff,"teamSlot");function pf(e){return e.startsWith(dy)?e.slice(dy.length):null}s(pf,"teamKeyOfSlot");function pI(e){return e.kind==="responsible"?ht:ff(e.groupKey)}s(pI,"slotIdOf");function mf(e){if(e===ht)return{kind:"responsible"};let t=pf(e);return t===null||t.length===0?null:{kind:"team",groupKey:t}}s(mf,"slotOfId");var cy="review",uy="checkField",mI="reviewed",hI="reviewing",hf=["rejected","waitlisted"];function fy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(fy,"isObject");var hz=new Set(["decision",cy]),gI={approved:"granted",accepted:"granted",admitted:"granted",direkt:"granted",rejected:"rejected",absage:"rejected",declined:"rejected",waitlisted:"waitlisted",warteliste:"waitlisted"};function py(e){return Object.hasOwn(gI,e)?gI[e]:void 0}s(py,"legacySemanticOfId");function gz(e){return e===cy?wn.filter(t=>!hf.includes(t)):wn}s(gz,"allowedSemanticsFor");var yz="other";function yI(e){return fy(e)&&hz.has(String(e.type))&&Array.isArray(e.outcomes)?e.outcomes:[]}s(yI,"outcomesOf");function wI(e){return(e?.nodes??[]).some(t=>yI(t).some(n=>fy(n)&&!("semantic"in n)))}s(wI,"needsOutcomeSemantics");function kI(e,t={}){let n=[],r=[],i=[],o=e.nodes.map(a=>{let l=yI(a);if(l.length===0)return a;let d=a,c=String(d.id),u=String(d.type),p=gz(u),h=!1,w=l.map(k=>{if(!fy(k))return k;let y=String(k.id);if("semantic"in k)return Ii(k.semantic)||i.push({nodeId:c,outcomeId:y,value:String(k.semantic)}),k;let v=`${c}.${y}`,A=Object.hasOwn(t,v)?t[v]:void 0;if(A!==void 0)return p.includes(A)?(n.push({nodeId:c,outcomeId:y,semantic:A,source:"answer"}),h=!0,{...k,semantic:A}):(r.push({nodeId:c,nodeType:u,outcomeId:y,allowed:p,answer:A}),k);let E=py(y),I=E??yz;return p.includes(I)?(n.push({nodeId:c,outcomeId:y,semantic:I,source:E===void 0?"formerDefault":"legacyTable"}),h=!0,{...k,semantic:I}):(r.push({nodeId:c,nodeType:u,outcomeId:y,allowed:p}),k)});return h?{...d,outcomes:w}:a});return n.length===0?{graph:e,written:n,refused:r,invalid:i}:{graph:{...e,nodes:o},written:n,refused:r,invalid:i}}s(kI,"addOutcomeSemantics");var gr="bewerbungOffen";function yo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(yo,"isObject");var my=["event","effect"];function bI(e){return yo(e)&&e.type==="eventTrigger"}s(bI,"isTrigger");function vI(e){let t=yo(e.inputs)?e.inputs:{};return"outcomes"in e||my.some(n=>n in e||n in t)}s(vI,"oldShape");function xI(e){return(e?.nodes??[]).some(t=>bI(t)&&vI(t))}s(xI,"needsEventTriggerStartMove");function wz(e){let t=String(e.id),r=(Array.isArray(e.outcomes)?e.outcomes:[]).map(l=>yo(l)?l.id:void 0);if("outcomes"in e&&!(r.length===1&&r[0]===gr))return{unmoved:{nodeId:t,reason:"outcomesNotStart"}};let i=Object.keys(yo(e.next)?e.next:{});if(!(i.length===1&&i[0]===gr))return{unmoved:{nodeId:t,reason:"nextNotStart"}};let o=yo(e.inputs)?{...e.inputs}:{};for(let l of my){let d=o[l];if(yo(d)&&d.kind==="binding")return{unmoved:{nodeId:t,reason:"bindingCell"}}}let a={...e};delete a.outcomes;for(let l of my)delete a[l],delete o[l];return yo(e.inputs)&&(Object.keys(o).length>0?a.inputs=o:delete a.inputs),{node:a}}s(wz,"moveNode");function SI(e){let t=[],n=[],r=e.nodes.map(i=>{if(!bI(i)||!vI(i))return i;let o=wz(i);return"unmoved"in o?(n.push(o.unmoved),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(SI,"moveEventTriggerStart");function wl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(wl,"isObject");var AI={waitlistOrder:"arrival"};function EI(e){return!wl(e)||e.type!=="waitlist"?!1:!("waitlistOrder"in(wl(e.inputs)?e.inputs:{}))}s(EI,"lacksPolicy");function kz(e){return(e?.nodes??[]).some(EI)}s(kz,"needsWaitlistPolicyMove");function hy(e){return wl(e)&&Hn.includes(e.waitlistOrder)}s(hy,"isWaitlistPolicy");function bz(e){if(e===void 0)return{policy:AI,stated:!1};if(!wl(e))return"malformed";let t=e.waitlistOrder;return t!==void 0&&!Hn.includes(t)?"malformed":{policy:{waitlistOrder:t??AI.waitlistOrder},stated:t!==void 0}}s(bz,"policyOfSelection");function TI(e,t,n={}){let r=[],i=[];if(!kz(e))return{graph:e,moved:r,refused:i};let o=bz(t),a=e.nodes.map(l=>{if(!EI(l))return l;let d=l,c=String(d.id),u=wl(d.inputs)?{...d.inputs}:{},p=Object.hasOwn(n,c)?n[c]:void 0,h,w;if(p!==void 0)h=p,w="answer";else{if(o==="malformed")return i.push({nodeId:c,reason:"selectionMalformed"}),l;h=o.policy,w=o.stated?"manifest":"formerDefault"}return u.waitlistOrder={kind:"literal",value:h.waitlistOrder},r.push({nodeId:c,policy:h,source:w}),{...d,inputs:u}});return r.length===0?{graph:e,moved:r,refused:i}:{graph:{...e,nodes:a},moved:r,refused:i}}s(TI,"moveWaitlistPolicyToInputs");function wo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(wo,"isObject");var vz=[jt,go],xz=["inputSchema","parties","schemaDigest","parts"];function $I(e){return wo(e)&&e.type==="governedDocument"&&("resolver"in e||wo(e.template)&&("key"in e.template||"cockpitFields"in e.template))}s($I,"oldShape");function RI(e){return(e?.nodes??[]).some($I)}s(RI,"needsGeneratorInputMove");function Sz(e){let t=wo(e.inputs)?{...e.inputs}:{},n={...e},r;if("resolver"in e){let i=e.resolver;if(!wo(i))return{unmoved:"resolverNotObject"};if(jt in t)return{unmoved:"generatorInputExists"};if(typeof i.key!="string"||i.key.length===0)return{unmoved:"pinWithoutKey"};if(i.kind!=="generator"&&i.kind!=="package")return{unmoved:"pinWithoutKind"};if(i.revision!==void 0&&!(typeof i.revision=="number"&&Number.isInteger(i.revision)&&i.revision>0))return{unmoved:"pinRevisionInvalid"};if((wo(i.inputSchema)&&Array.isArray(i.inputSchema.fields)?i.inputSchema.fields:[]).find(d=>wo(d)&&vz.includes(String(d.key)))!==void 0)return{unmoved:"stampDeclaresReservedKey"};t[jt]={kind:"literal",value:{kind:i.kind,key:i.key,...i.revision===void 0?{}:{revision:i.revision}}};let l=Object.fromEntries(xz.filter(d=>d in i).map(d=>[d,i[d]]));Object.keys(l).length>0&&(n.generatorStamp=l),r=i.cockpitFields,delete n.resolver}if(wo(e.template)&&("key"in e.template||"cockpitFields"in e.template)){let{key:i,cockpitFields:o,...a}=e.template;if("key"in e.template){if(go in t)return{unmoved:"templateInputExists"};if(typeof i!="string"||i.length===0)return{unmoved:"templateKeyInvalid"};t[go]={kind:"literal",value:i}}if(o!==void 0){if(r!==void 0)return{unmoved:"cockpitFieldsTwice"};r=o}n.template=a}if(r!==void 0){if("cockpitFields"in e)return{unmoved:"cockpitFieldsExist"};n.cockpitFields=r}return n.inputs=t,{node:n}}s(Sz,"moveNode");function II(e){let t=[],n=[],r=e.nodes.map(i=>{if(!$I(i))return i;let o=Sz(i);return"unmoved"in o?(n.push({nodeId:String(i.id),reason:o.unmoved}),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(II,"moveGeneratorPinsToInputs");var OI=/^\d{4}-\d{2}-\d{2}$/;function yr(e,t){return{de:e,en:t}}s(yr,"issue");function ko(e){if(typeof e!="object"||e===null)return yr("keine Reduktion","not a reduction");let t=e;if(t.kind==="none")return Object.keys(t).length===1?null:yr('\u201Ekeine Reduktion" tr\xE4gt keine weiteren Angaben','"no reduction" carries no further details');if(t.kind!=="amount")return yr(`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?yr("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"||!OI.test(r)?yr("der Beginn fehlt (JJJJ-MM-TT)","the start is missing (YYYY-MM-DD)"):typeof i!="string"||!OI.test(i)?yr("das Ende fehlt (JJJJ-MM-TT)","the end is missing (YYYY-MM-DD)"):i<r?yr("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)?yr("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))?yr("ung\xFCltige Preisperiode","invalid price period"):Object.keys(t).some(o=>!["kind","amount","activeFrom","activeTo","floorTotal","pricePeriod"].includes(o))?yr("unbekannte Angaben","unknown details"):null:yr("der Betrag hat mehr als zwei Nachkommastellen","the amount has more than two decimal places")}s(ko,"reductionShapeIssue");function Oi(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||ko(t.reduction)===null&&t.reduction.kind==="amount")}s(Oi,"isPricedItemValue");var Ts=["freetext","recommendation","choice","pricedItem","record","reduction"],$s=[...Ts,"appointment"];function NI(e){return typeof e=="string"&&$s.includes(e)}s(NI,"isTaskResultKind");function _i(e){return typeof e=="string"&&Ts.includes(e)}s(_i,"isRecordedTaskResultKind");function Rs(e){return _i(e.kind)}s(Rs,"isRecordedTaskResult");var gf=["number","boolean","enum"];function gy(e){return typeof e=="string"&&gf.includes(e)}s(gy,"isRecordFieldType");var yy=["form","siblingRank"];var Qr={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 CI(e){return(e.kind==="freetext"||e.kind==="recommendation"||e.kind==="choice")&&e.writes===void 0}s(CI,"isProseResult");function yf(e){return e.kind==="record"?(e.fields??[]).filter(t=>typeof t.writes=="string"&&t.writes.length>0&&gy(t.type)).map(t=>({key:t.writes,valueType:t.type,field:t})):Az(e)}s(yf,"draftResultStoreWrites");function Az(e){let t=Qr[e.kind].valueType;return e.writes===void 0||t===null?[]:[{key:e.writes,valueType:t}]}s(Az,"singleStoreWrite");var _I="team:";function Is(e){if(e==="all")return{kind:"all"};if(e==="external"||e.length===0)return null;if(e.startsWith(_I)){let t=e.slice(_I.length);return t.length===0?null:{kind:"team",groupKey:t}}return{kind:"channel",channelKey:e}}s(Is,"parseTaskResultChat");var tt={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]",labelMissing:"[taskResult/labelMissing]",appointmentInvalidDuration:"[taskResult/appointmentInvalidDuration]",recordFields:"[taskResult/recordFields]",fieldsOnNonRecord:"[taskResult/fieldsOnNonRecord]",recordSuggest:"[taskResult/recordSuggest]",reductionPrices:"[taskResult/reductionPrices]"};var Ez=new Set(["if","else","in","true","false","null"]),Tz=new Set(["==","!=","<=",">=","&&","||"]);function $z(e){return e>="0"&&e<="9"}s($z,"isDigit");function Rz(e){return/[a-zA-Z_$]/.test(e)}s(Rz,"isIdentStart");function Iz(e){return/[a-zA-Z0-9_.$]/.test(e)}s(Iz,"isIdentCont");function Oz(e){let t=[],n=0;for(;n<e.length;){let r=e.charAt(n);if(r===" "||r===" "||r===`
|
|
10961
|
+
`};var Zu="26484e652d6f9b954e37b1bd4682f6f911e8beedbfb53d42b859e32cb6c25166",Gg=_R;var zg=class extends ve{static{s(this,"AgentToolsCommand")}static paths=[["agent","tools"]];static usage=T.Usage({category:"Agents",description:"Show the shared platform/CLI agent tool schemas and skill revision."});async execute(){return this.print({skillHash:Zu,tools:pl}),0}},Wg=class extends ve{static{s(this,"AgentInvokeCommand")}static paths=[["agent","invoke"]];static usage=T.Usage({category:"Agents",description:"Invoke a shared agent tool; pipe its JSON input on stdin."});tool=f.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 Ug(this.context.stdin)),n=await this.context.executePlexusAgentTool(this.tool,t);return this.print(n),0}},NR=[zg,Wg];var Yg=[{key:"fixture_test",email:"test@example.com",firstName:"Test",lastName:"Bewerber"}],Hae=new Set(Yg.map(e=>e.key));function PR(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(PR,"resolveStartTarget");function ZG(e){return e.kind==="named"?e.name:`(${e.standIn??e.fallback})`}s(ZG,"applicantText");function DR(e){return e.map(t=>({id:t.application._id,status:t.deletedAt?`${t.application.status} (gel\xF6scht)`:t.application.status,state:t.currentProcessStateId??"",applicant:ZG(t.applicantName),test:t.application.testMode===!0?"test":""}))}s(DR,"applicationRows");var CR=Yg.map(e=>e.email);function FR(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(jg(e,t)&&(r===void 0||!CR.includes(r.trim().toLowerCase())))throw new Error(`applications start-test: on prod only for the test account ${CR.join(", ")} (--applicant) \u2014 never a real family's`)}s(FR,"assertStartApplicant");function LR(e){let t={};for(let{address:n,...r}of e.entries)t[n]=r;return{applicationId:e.applicationId,store:t}}s(LR,"processStoreJson");function XG(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.snapshotNumber}`} \xB7 ${e.contractStatus}`;case"contracts":return e.contracts.map(t=>`${t.partKey}: contract ${t.contractId} \xB7 ${t.revision===null?"keine Fassung":`Fassung ${t.revision.snapshotNumber}`} \xB7 ${t.contractStatus}`).join("; ")}}s(XG,"refText");function ez(e){return e.state!=="present"?e.reason?.de??"":e.ref!==void 0?XG(e.ref):JSON.stringify(e.value)}s(ez,"holds");function MR(e){return e.entries.map(t=>({address:t.address,state:t.state,holds:ez(t),producer:t.producer?.label??"",written:t.writtenAt===void 0?"":new Date(t.writtenAt).toISOString()}))}s(MR,"storeRows");function Xu(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(Xu,"parseKv");var qR="started",ef="submitted",tf="submitted",KR="load-scenario:";var jR="(Bewerbung)";function VR(e){return{nodeId:jR,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(VR,"sharedAsList");function BR(e){return e.disabledReason===void 0?"":e.disabledCount===void 0?e.disabledReason:`${e.disabledReason} (${e.disabledCount})`}s(BR,"disabledText");function UR(e){return e.flatMap(({nodeId:t,actions:n})=>n.map(r=>({node:t,action:r.id,label:r.label.de,disabled:BR(r)})))}s(UR,"actionRows");function GR(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: ${BR(a)}`);if(i!==jR)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(GR,"nodeOfferingAction");function zR(e,t,n){if(e.startsWith(KR)){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(zR,"runParams");async function tz(e,t){let n=await e.query(x.workflow.getInstance,{applicationId:t});if(n===null)throw new Error(`test-actions: application ${t} has no workflow instance`);return n.instance.currentNodeIds}s(tz,"currentNodeIds");function nz(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(nz,"refusalText");async function nf(e,t,n){let r=await e.query(x.workflow.listSharedTestActions,{applicationId:t});if(!r.permitted)throw new Error(`test-actions: not permitted \u2014 ${nz(t,r.reason)}`);let i=[];for(let o of n){let a=await e.query(x.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,VR(r.actions)]}s(nf,"actionsOf");async function WR(e,t,n){return n!==void 0?[n]:await tz(e,t)}s(WR,"nodesOf");var Hg=class extends D{static{s(this,"TestActionsListCommand")}static paths=[["test-actions","list"]];static usage=T.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=f.String("--application",{required:!0,description:"Application id (a test application)"});node=f.String("--node",{description:"Node id (default: the application's current nodes)"});async execute(){let t=await this.caller(),n=await nf(t,this.application,await WR(t,this.application,this.node));return this.print(n,UR,["node","action","label","disabled"]),0}},Jg=class extends D{static{s(this,"TestActionsRunCommand")}application=f.String("--application",{required:!0,description:"Application id (a test application)"});node=f.String("--node",{description:"Node id (default: the application's current nodes)"});static paths=[["test-actions","run"]];static usage=T.Usage({category:"Admission",description:"Run one test-mode action; a scenario (load-scenario:<id>) also submits unless --no-auto-submit"});action=f.String("--action",{required:!0,description:"Action id, e.g. load-scenario:standard, auto-fill-files, submit-form"});autoSubmit=f.Boolean("--auto-submit",!0,{description:"Scenario only: stub the file fields and submit after loading (default on; --no-auto-submit only loads)"});param=f.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 (its `confirm` in `test-actions list`)"});async execute(){let t=zR(this.action,this.autoSubmit,Xu(this.param??[]).values),n=await this.caller(),r=this.application,i=await WR(n,this.application,this.node),o=GR(await nf(n,r,i),this.action,i);return await n.mutation(x.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}},YR=[Hg,Jg];var ze=["de","en"];function bs(e,t){return ze.every(n=>e[n]===t[n])}s(bs,"sameText");function Tt(e){if(e===null||typeof e!="object"||Array.isArray(e))return"not-localized";let t=e;return Object.keys(t).some(r=>!ze.includes(r))?"not-localized":ze.filter(r=>{let i=t[r];return typeof i!="string"||i.trim()===""})}s(Tt,"missingLocales");function Ti(e){let t=Tt(e);return t!=="not-localized"&&t.length===0}s(Ti,"isLocalizedText");function ml(e,t){let n={};for(let r of ze){let i=e.map(o=>o[r]);n[r]=i.every(o=>typeof o=="string"&&o.trim()!=="")?t(i,r):""}return n}s(ml,"composeTexts");var mr=/^[a-z][A-Za-z0-9]*$/;function Qg(e){return typeof e=="string"&&mr.test(e)}s(Qg,"isNodeId");function vs(e,t){Qg(e)||F(`[graph/nodeIdFormat] "${e}" cannot name a node: a node id is ${mr.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(vs,"makeNodeId");var Ri="$env";function pe(e){if(e.scope==="env")return`${Ri}.${e.key}`;let t=`$${e.scope}.${e.owner}.${e.key}`;return e.path===void 0?t:`${t}.${e.path}`}s(pe,"formatAddress");var $i=/^[a-z][a-zA-Z0-9_]*$/,rz=/^[A-Za-z_][A-Za-z0-9_]*$/;function po(e){return typeof e=="string"&&e.split(".").every(t=>rz.test(t))}s(po,"isPath");function mo(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&&po(i)?{scope:"env",key:i}:null}case"node":case"task":{let[i,o,...a]=r;return i===void 0||o===void 0||!$i.test(o)||(n==="node"?!mr.test(i):!$i.test(i))?null:iz({scope:n,owner:i,key:o},a)}default:return null}}s(mo,"tryParseAddress");function iz(e,t){if(t.length===0)return e;let n=t.join(".");return po(n)?{...e,path:n}:null}s(iz,"withPath");function xe(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=t.scope==="env"?["scope","key"]:["scope","owner","key","path"];if(Object.keys(t).some(r=>!n.includes(r))||t.path!==void 0&&!po(t.path))return!1;switch(t.scope){case"env":return po(t.key);case"node":return typeof t.owner=="string"&&mr.test(t.owner)&&typeof t.key=="string"&&$i.test(t.key);case"task":return typeof t.owner=="string"&&$i.test(t.owner)&&typeof t.key=="string"&&$i.test(t.key);default:return!1}}s(xe,"isAddress");var Yr={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"}},xs=Object.keys(Yr);function Ss(e){return Object.hasOwn(Yr,e)}s(Ss,"isEnvKey");var oz=["self-service","staff"];function HR(e,t){return{kind:"fixed",values:e,labels:t}}s(HR,"fixedSet");var rf={of:"applicant.language",withoutValue:"de"},Hr={"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:rf},"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:rf},"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:rf},"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:rf},"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:HR(ze,{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:HR(oz,{staff:{de:"intern",en:"in-house"},"self-service":{de:"online (Familie)",en:"online (family)"}}),nullable:!1,label:{de:"Eingangsweg",en:"Intake channel"}}},of={types:Yr,fields:Hr},sf=xs.flatMap(e=>Object.keys(Yr[e]).map(t=>`${e}.${t}`));function Yn(e){return Object.hasOwn(Hr,e)}s(Yn,"isEnvLeaf");function af(e){return`${Ri}.${e}`}s(af,"envIdentifier");function ho(e){let t=Hr[e],[n,r]=e.split("."),i=Yr[n][r];i===void 0&&F(`[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&&F(`[env] "${e}" names the value "${a}" without a label`),{value:a,label:l}})}:{}}}s(ho,"envLeaf");var JR="staffInput";var sz=["boolean"],hl=/^[a-z][A-Za-z0-9]*$/;function lf(e){return e.staffInputs??[]}s(lf,"staffInputsOf");function df(e){return`${JR}.${e}`}s(df,"staffInputLeaf");function QR(e){return`${Ri}.${df(e)}`}s(QR,"staffInputIdentifier");function az(e){let t=`${JR}.`;return e.startsWith(t)?e.slice(t.length):null}s(az,"staffInputKeyOfLeaf");function As(e,t){let n=az(t);return n===null?void 0:lf(e).find(r=>r.key===n)}s(As,"declaredStaffInput");function ZR(e){return[...lf(e).map(t=>({leaf:df(t.key),type:t.type,label:t.label,valueSet:{kind:"open"},nullable:!1,cohortBound:!1})),...sf.map(t=>{let n=ho(t);return{leaf:t,type:n.type,label:n.label,valueSet:Hr[t].valueSet,nullable:n.nullable,cohortBound:n.cohortBound===!0}})]}s(ZR,"envLeavesFor");function XR(e){return ZR(e).filter(t=>!t.cohortBound)}s(XR,"conditionEnvLeaves");function eI(e){return nI(XR(e))}s(eI,"envConditionSchemaFor");function lz(e){return ZR(e).map(t=>t.leaf==="stage.key"?{...t,valueSet:{kind:"open"}}:t)}s(lz,"offerConditionEnvLeaves");function tI(e){return nI(lz(e))}s(tI,"offerConditionSchemaFor");function nI(e){let t={},n={};for(let{leaf:r,type:i,valueSet:o,nullable:a}of e){let[l="",d=""]=r.split(".");t[l]={...t[l]??{},[d]:i},n[r]={valueSet:o,nullable:a}}return{types:t,fields:n}}s(nI,"schemaOfLeaves");function rI(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}"`};hl.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),sz.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=Tt(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(rI,"staffInputIssues");var ay={required:!0,description:"Offer slug (its offerKey)"},Zg=class extends D{static{s(this,"ApplicationsListCommand")}static paths=[["applications","list"]];static usage=T.Usage({category:"Admission",description:"List an offer's applications (id, status, board state, applicant, test)"});offer=f.String("--offer",ay);testOnly=f.Boolean("--test-only",!1,{description:"Only test applications"});async execute(){let t=await this.caller(),n=await t.query(x.admission.listForAngebot,{client:this.requireTenant(t),offerKey:this.offer}),r=DR(n).filter(i=>!this.testOnly||i.test==="test");return this.print(r,i=>i,["id","status","state","applicant","test"]),0}},Xg=class extends D{static{s(this,"ApplicationsCountsCommand")}static paths=[["applications","counts"]];static usage=T.Usage({category:"Admission",description:"Count an offer's applications per list"});offer=f.String("--offer",ay);async execute(){let t=await this.caller(),n=await t.query(x.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}},ey=class extends D{static{s(this,"ApplicationsShowCommand")}static paths=[["applications","show"]];static usage=T.Usage({category:"Admission",description:"One application: status, test flag, offer, current workflow nodes"});application=f.String({required:!0});async execute(){let t=await this.caller(),n=this.application,r=await t.query(x.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(x.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.offerId},{key:"current nodes",value:o.currentNodes.join(", ")}]),0}},ty=class extends D{static{s(this,"ApplicationsStoreCommand")}static paths=[["applications","store"]];static usage=T.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, $env\u2026). Values are shown whatever their audience \u2014 never hand the output to the family. Recipe: playbooks/applications/inspect-process-store.md."});application=f.String({required:!0});async execute(){let n=await(await this.caller()).query(x.processStoreView.get,{applicationId:this.application});return this.print(LR(n),()=>MR(n),["address","state","holds","producer","written"]),0}},ny=class extends D{static{s(this,"ApplicationsStartTestCommand")}static paths=[["applications","start-test"]];static usage=T.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=f.String("--offer",ay);run=f.String("--run",{required:!0,description:"School year: its key or id (never its name)"});stage=f.String("--stage",{required:!0,description:"Level: its key or id (never its name)"});party=f.String("--party",{description:"Applicant party id"});applicant=f.String("--applicant",{description:"Applicant account login address (e.g. the test account test@example.com)"});version=f.String("--version",{description:"Offer version id to test (default: the live generation)"});staffInput=f.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=f.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();FR(this.resolvedTarget(),this.prodUrls(),this.party,this.applicant);let n=this.requireTenant(t),r=PR(await t.query(x.admission.listAdmissionTree,{client:n}),this.offer,this.run,this.stage),i=this.party;if(this.applicant!==void 0){let d=await t.query(x.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(x.admission.staffStartApplicationForParty,{client:n,offerKey:this.offer,partyId:i,programRunId:r.programRunId,programStageId:r.programStageId,...this.proxy===void 0?{}:{startInProxy:this.proxy},staffInputs:oI(this.staffInput??[]),testMode:!0,...this.version===void 0?{}:{offerVersionId:this.version}}),a,l;try{let d=await t.query(x.workflow.getInstance,{applicationId:o.applicationId});if(d===null)throw new Error("the started application has no workflow instance");a=d.instance.currentNodeIds,l=(await nf(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}},ry=class extends D{static{s(this,"ApplicationsDiscardTestCommand")}static paths=[["applications","discard-test"]];static usage=T.Usage({category:"Admission",description:"Discard a TEST application (the server refuses a real one), or with --all-test every expired one of the school",details:"With an id: discards that test application. With --all-test --older-than <N>d: lists the school's test applications whose last activity is older than N days (N \u2265 14) and that are not kept as a demo \u2014 a dry run unless --confirm; --confirm discards each expired one the server re-checks, the rest are reported with the reason. Recipe: playbooks/applications/expire-test-applications.md.",examples:[["Dry run","plexus-cli --env prod --tenant <t> applications discard-test --all-test --older-than 14d --dry-run"],["Discard","plexus-cli --env prod --tenant <t> --allow-prod applications discard-test --all-test --older-than 14d --confirm"]]});application=f.String({required:!1});allTest=f.Boolean("--all-test",!1,{description:"Every expired test application of the school instead of one id"});olderThan=f.String("--older-than",{description:"With --all-test: days without activity, as <N>d (N \u2265 14)"});dryRun=f.Boolean("--dry-run",!1,{description:"With --all-test: list only (the default)"});confirm=f.Boolean("--confirm",!1,{description:"With --all-test: discard (else the dry run)"});async execute(){if(!this.allTest){if(this.application===void 0)throw new Error("applications discard-test: name an application id, or use --all-test --older-than <N>d");if(this.olderThan!==void 0||this.dryRun||this.confirm)throw new Error("applications discard-test: --older-than, --dry-run and --confirm belong to --all-test");return await(await this.caller()).mutation(x.admission.discardTest,{applicationId:this.application}),this.print({discarded:this.application},u=>[{key:"discarded",value:u.discarded}]),0}if(this.application!==void 0)throw new Error("applications discard-test: --all-test takes no application id");if(this.olderThan===void 0)throw new Error("applications discard-test --all-test: --older-than <N>d is required");if(this.dryRun&&this.confirm)throw new Error("applications discard-test: --dry-run and --confirm exclude each other");let t=dz(this.olderThan),n=await this.caller(),r=this.requireTenant(n),i=[],o=null;for(;;){let c=await n.query(x.admission.testTtlPlan,{client:r,olderThanDays:t,cursor:o});if(i.push(...c.rows),c.isDone)break;o=c.continueCursor}let a=i.map(c=>({...c,result:c.verdict!=="expired"?"kept":c.block!==null?"blocked":this.confirm?"pending":"would discard"})),l=i.filter(c=>c.verdict==="expired"&&c.protectedDemo).map(c=>c.applicationId);if(this.confirm&&l.length>0)throw new Error(`applications discard-test --all-test: protected demo application(s) in the discard set, nothing discarded: ${l.join(", ")}`);let d=0;if(this.confirm)for(let c of a.filter(u=>u.result==="pending"))try{await n.mutation(x.admission.discardExpiredTest,{applicationId:c.applicationId,olderThanDays:t}),c.result="discarded"}catch(u){d++,c.result=`failed: ${u instanceof Error?u.message:String(u)}`}return this.print({olderThanDays:t,confirm:this.confirm,rows:a},c=>c.rows.map(u=>({id:u.applicationId,lastActivity:new Date(u.lastActivityAt).toISOString().slice(0,10),verdict:u.verdict,block:u.block??"",result:u.result})),["id","lastActivity","verdict","block","result"]),d>0?1:0}};function dz(e){let t=/^(\d+)d$/.exec(e.trim());if(t===null)throw new Error(`--older-than "${e}": expected <N>d, e.g. 14d`);return Number(t[1])}s(dz,"parseDays");var iy=class extends D{static{s(this,"ApplicationsSetKeepDemoCommand")}static paths=[["applications","set-keep-demo"]];static usage=T.Usage({category:"Admission",description:"Mark a TEST application \u201EDemo behalten\u201C (never expires, never discarded), or clear the mark with --off"});application=f.String({required:!0});off=f.Boolean("--off",!1,{description:"Clear the mark"});async execute(){return await(await this.caller()).mutation(x.admission.setKeepAsDemo,{applicationId:this.application,keep:!this.off}),this.print({application:this.application,keepAsDemo:!this.off},n=>[{key:"application",value:n.application},{key:"keep as demo",value:n.keepAsDemo?"ja":"nein"}]),0}},oy=class extends D{static{s(this,"ApplicationsStaffInputListCommand")}static paths=[["applications","staff-input","list"]];static usage=T.Usage({category:"Admission",description:"An application's internal inputs (set at the start): value, and why one can no longer be corrected"});application=f.String({required:!0});async execute(){let n=await(await this.caller()).query(x.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}},sy=class extends D{static{s(this,"ApplicationsStaffInputSetCommand")}static paths=[["applications","staff-input","set"]];static usage=T.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=f.String({required:!0});input=f.String("--input",{required:!0,description:"key=true|false"});reason=f.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}]=oI([this.input]);return await t.mutation(x.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}},iI=[Zg,Xg,ey,ty,ny,ry,iy,oy,sy];function oI(e){return e.map(t=>{let[n="",r,...i]=t.split("=");if(!hl.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(oI,"parseStaffInputs");var jt="contractGenerator",go="documentTemplate";function gl(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(gl,"isGeneratorRef");function sI(e,t){let n=e.inputs?.[t];return n?.kind==="literal"?n.value:void 0}s(sI,"literalOf");function Jr(e){let t=sI(e,jt);return gl(t)?t:null}s(Jr,"generatorRefOfNode");function hr(e){let t=sI(e,go);return typeof t=="string"&&t.length>0?t:null}s(hr,"documentTemplateKeyOfNode");function aI(e){return`${e.kind}:${e.key}${e.revision===void 0?"":`@${e.revision}`}`}s(aI,"generatorRefLabel");var cz=["formExports","generatorStamp"];function lI(e,t,n){let r=e.inputs?.[jt];(r?.kind!=="literal"||!gl(r.value))&&F(`applyGeneratorStamp: the node names no generator in inputs.${jt} \u2014 a stamp derives from it`),n.freezeRevision&&t.revision!==void 0&&(e.inputs[jt]={kind:"literal",value:{...r.value,revision:t.revision}}),e.generatorStamp={inputSchema:t.inputSchema,parties:t.parties,schemaDigest:t.schemaDigest,...t.parts===void 0?{}:{parts:t.parts},...t.coverLetter===void 0?{}:{coverLetter:t.coverLetter}}}s(lI,"applyGeneratorStamp");var uz=["reads"];function Es(e){if(e===null||typeof e!="object")return e;let t={...e};return Array.isArray(t.nodes)&&(t.nodes=t.nodes.map(n=>{if(n===null||typeof n!="object")return n;let r={...n};for(let i of cz)delete r[i];for(let i of uz)Array.isArray(r[i])&&r[i].length===0&&delete r[i];return r})),t}s(Es,"comparableWorkflowGraph");var yl={id:{de:"die Identit\xE4t ist der Slug des Angebots (bundle.yaml slugs.manifest)",en:"the identity is the offer's slug (bundle.yaml slugs.manifest)"},label:{de:"der Titel steht in bundle.yaml `label`",en:"the title is bundle.yaml `label`"},version:{de:"die Revision z\xE4hlt die Datenbank",en:"the database counts the revision"},applicantMode:{de:"von nichts gelesen",en:"read by nothing"},signatureLevel:{de:"von nichts gelesen",en:"read by nothing"},roleInstances:{de:"die Rollen kommen aus den Formular-Effekten",en:"roles come from the form effects"},leistungen:{de:"von nichts gelesen",en:"read by nothing"},capacity:{de:"die Kapazit\xE4t geh\xF6rt der Kohorte (program.runs[].capacities)",en:"capacity belongs to the cohort (program.runs[].capacities)"},progressLayoutId:{de:"von nichts gelesen",en:"read by nothing"},bewerbungsfenster:{de:"die Kohorte besitzt die \xD6ffnung (isOpen / applicationOpensAt)",en:"the cohort owns opening (isOpen / applicationOpensAt)"},selection:{de:"die Reihenfolge ist der Eingang `waitlistOrder` des Wartelistenknotens (automatisches Nachr\xFCcken gibt es nicht mehr; Freigabe-Strategie und Stichtag las nichts)",en:"the order is the waitlist node's input `waitlistOrder` (automatic promotion is gone; release strategy and deadline were read by nothing)"},progressLayout:{de:"das Fortschrittslayout geh\xF6rt zum Workflow: den Block nach workflow.json `progressLayout` verschieben (ohne Workflow l\xF6schen)",en:"the progress layout belongs to the workflow: move the block to workflow.json `progressLayout` (without a workflow: delete it)"}};function cf(e){return e===null||typeof e!="object"||Array.isArray(e)?["manifest: data must be an object"]:Object.keys(e).map(t=>{let n=yl[t];return n!==void 0?`manifest: \`${t}\` is no longer part of manifest.json (${n.en}). Delete the line.`:`manifest: unknown key \`${t}\` \u2014 manifest.json carries no key.`})}s(cf,"manifestIssues");function fz(e){let t=[],n=e.buses;if(!Array.isArray(n))return t;let r=n.find(i=>!!i&&typeof i=="object"&&i.key==="process");if(!r||!Array.isArray(r.states))return t;for(let i of r.states){if(!i||typeof i!="object")continue;let o=i;if(o.terminal!==!0&&(!o.external||typeof o.external!="object")){let a=typeof o.id=="string"?o.id:"?";t.push(`progressLayout: progress state '${a}' is non-terminal but declares no 'external' block (applicant-facing copy) \u2014 resolveStatusPresentation would throw at runtime`)}}return t}s(fz,"validateProgressLayoutExternalCopy");function dI(e){if(e===null||typeof e!="object")return["progressLayout: the full layout object is required"];let t=e.buses;return!Array.isArray(t)||!t.some(n=>!!n&&typeof n=="object"&&n.key==="process")?["progressLayout: the layout must declare the `process` bus"]:fz(e)}s(dI,"progressLayoutIssues");var cI=new Set(["nodes","assignmentRules","channels","processStore","staffInputs"]);var pz=new Set(["sections","effects","outcomes","testScenarios","env","views"]),uf={id:{de:"der Schl\xFCssel des Formulars ist sein Slug",en:"the form's key is its slug"},label:{de:"der Name steht in der Formularzeile (createSmartForm.label)",en:"the name is the form row's (createSmartForm.label)"},outcomeIds:{de:"die Ergebnisse sind die ids von outcomes[]",en:"the outcomes are the ids of outcomes[]"},schoolSlug:{de:"von nichts gelesen",en:"read by nothing"}};function uI(e,t){if(e===null||typeof e!="object"||Array.isArray(e))return[{de:`${t}: die Formulardefinition muss ein Objekt sein.`,en:`${t}: the form definition must be an object.`}];let n=[];for(let i of Object.keys(e)){if(pz.has(i))continue;let o=uf[i];n.push(o!==void 0?{de:`${t}: \`${i}\` geh\xF6rt nicht mehr zur Formulardefinition (${o.de}). Die Zeile l\xF6schen.`,en:`${t}: \`${i}\` is no longer part of the form definition (${o.en}). Delete the line.`}:{de:`${t}: unbekannter Schl\xFCssel \`${i}\`.`,en:`${t}: unknown key \`${i}\`.`})}let r=e;for(let i of["sections","effects","outcomes"])Array.isArray(r[i])||n.push({de:`${t}: \`${i}\` muss eine Liste sein.`,en:`${t}: \`${i}\` must be a list.`});return n}s(uI,"smartFormDefinitionShapeIssues");var wn=["granted","rejected","waitlisted","other"];function Ii(e){return typeof e=="string"&&wn.includes(e)}s(Ii,"isOutcomeSemantic");var Hn=["arrival","manual"],fI={arrival:{de:"Nach Eingang",en:"By arrival"},manual:{de:"Von Hand sortiert",en:"Sorted by hand"}};function mz(e,t){let n=e.inputs?.[t];return n?.kind==="literal"?n.value:void 0}s(mz,"literal");function ly(e){let t=mz(e,"waitlistOrder");return Hn.includes(t)?{waitlistOrder:t}:null}s(ly,"waitlistPolicyOrNull");var ht="responsible",dy="team:";function ff(e){return`${dy}${e}`}s(ff,"teamSlot");function pf(e){return e.startsWith(dy)?e.slice(dy.length):null}s(pf,"teamKeyOfSlot");function pI(e){return e.kind==="responsible"?ht:ff(e.groupKey)}s(pI,"slotIdOf");function mf(e){if(e===ht)return{kind:"responsible"};let t=pf(e);return t===null||t.length===0?null:{kind:"team",groupKey:t}}s(mf,"slotOfId");var cy="review",uy="checkField",mI="reviewed",hI="reviewing",hf=["rejected","waitlisted"];function fy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(fy,"isObject");var hz=new Set(["decision",cy]),gI={approved:"granted",accepted:"granted",admitted:"granted",direkt:"granted",rejected:"rejected",absage:"rejected",declined:"rejected",waitlisted:"waitlisted",warteliste:"waitlisted"};function py(e){return Object.hasOwn(gI,e)?gI[e]:void 0}s(py,"legacySemanticOfId");function gz(e){return e===cy?wn.filter(t=>!hf.includes(t)):wn}s(gz,"allowedSemanticsFor");var yz="other";function yI(e){return fy(e)&&hz.has(String(e.type))&&Array.isArray(e.outcomes)?e.outcomes:[]}s(yI,"outcomesOf");function wI(e){return(e?.nodes??[]).some(t=>yI(t).some(n=>fy(n)&&!("semantic"in n)))}s(wI,"needsOutcomeSemantics");function kI(e,t={}){let n=[],r=[],i=[],o=e.nodes.map(a=>{let l=yI(a);if(l.length===0)return a;let d=a,c=String(d.id),u=String(d.type),p=gz(u),h=!1,w=l.map(k=>{if(!fy(k))return k;let y=String(k.id);if("semantic"in k)return Ii(k.semantic)||i.push({nodeId:c,outcomeId:y,value:String(k.semantic)}),k;let v=`${c}.${y}`,A=Object.hasOwn(t,v)?t[v]:void 0;if(A!==void 0)return p.includes(A)?(n.push({nodeId:c,outcomeId:y,semantic:A,source:"answer"}),h=!0,{...k,semantic:A}):(r.push({nodeId:c,nodeType:u,outcomeId:y,allowed:p,answer:A}),k);let E=py(y),I=E??yz;return p.includes(I)?(n.push({nodeId:c,outcomeId:y,semantic:I,source:E===void 0?"formerDefault":"legacyTable"}),h=!0,{...k,semantic:I}):(r.push({nodeId:c,nodeType:u,outcomeId:y,allowed:p}),k)});return h?{...d,outcomes:w}:a});return n.length===0?{graph:e,written:n,refused:r,invalid:i}:{graph:{...e,nodes:o},written:n,refused:r,invalid:i}}s(kI,"addOutcomeSemantics");var gr="bewerbungOffen";function yo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(yo,"isObject");var my=["event","effect"];function bI(e){return yo(e)&&e.type==="eventTrigger"}s(bI,"isTrigger");function vI(e){let t=yo(e.inputs)?e.inputs:{};return"outcomes"in e||my.some(n=>n in e||n in t)}s(vI,"oldShape");function xI(e){return(e?.nodes??[]).some(t=>bI(t)&&vI(t))}s(xI,"needsEventTriggerStartMove");function wz(e){let t=String(e.id),r=(Array.isArray(e.outcomes)?e.outcomes:[]).map(l=>yo(l)?l.id:void 0);if("outcomes"in e&&!(r.length===1&&r[0]===gr))return{unmoved:{nodeId:t,reason:"outcomesNotStart"}};let i=Object.keys(yo(e.next)?e.next:{});if(!(i.length===1&&i[0]===gr))return{unmoved:{nodeId:t,reason:"nextNotStart"}};let o=yo(e.inputs)?{...e.inputs}:{};for(let l of my){let d=o[l];if(yo(d)&&d.kind==="binding")return{unmoved:{nodeId:t,reason:"bindingCell"}}}let a={...e};delete a.outcomes;for(let l of my)delete a[l],delete o[l];return yo(e.inputs)&&(Object.keys(o).length>0?a.inputs=o:delete a.inputs),{node:a}}s(wz,"moveNode");function SI(e){let t=[],n=[],r=e.nodes.map(i=>{if(!bI(i)||!vI(i))return i;let o=wz(i);return"unmoved"in o?(n.push(o.unmoved),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(SI,"moveEventTriggerStart");function wl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(wl,"isObject");var AI={waitlistOrder:"arrival"};function EI(e){return!wl(e)||e.type!=="waitlist"?!1:!("waitlistOrder"in(wl(e.inputs)?e.inputs:{}))}s(EI,"lacksPolicy");function kz(e){return(e?.nodes??[]).some(EI)}s(kz,"needsWaitlistPolicyMove");function hy(e){return wl(e)&&Hn.includes(e.waitlistOrder)}s(hy,"isWaitlistPolicy");function bz(e){if(e===void 0)return{policy:AI,stated:!1};if(!wl(e))return"malformed";let t=e.waitlistOrder;return t!==void 0&&!Hn.includes(t)?"malformed":{policy:{waitlistOrder:t??AI.waitlistOrder},stated:t!==void 0}}s(bz,"policyOfSelection");function TI(e,t,n={}){let r=[],i=[];if(!kz(e))return{graph:e,moved:r,refused:i};let o=bz(t),a=e.nodes.map(l=>{if(!EI(l))return l;let d=l,c=String(d.id),u=wl(d.inputs)?{...d.inputs}:{},p=Object.hasOwn(n,c)?n[c]:void 0,h,w;if(p!==void 0)h=p,w="answer";else{if(o==="malformed")return i.push({nodeId:c,reason:"selectionMalformed"}),l;h=o.policy,w=o.stated?"manifest":"formerDefault"}return u.waitlistOrder={kind:"literal",value:h.waitlistOrder},r.push({nodeId:c,policy:h,source:w}),{...d,inputs:u}});return r.length===0?{graph:e,moved:r,refused:i}:{graph:{...e,nodes:a},moved:r,refused:i}}s(TI,"moveWaitlistPolicyToInputs");function wo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(wo,"isObject");var vz=[jt,go],xz=["inputSchema","parties","schemaDigest","parts"];function $I(e){return wo(e)&&e.type==="governedDocument"&&("resolver"in e||wo(e.template)&&("key"in e.template||"cockpitFields"in e.template))}s($I,"oldShape");function RI(e){return(e?.nodes??[]).some($I)}s(RI,"needsGeneratorInputMove");function Sz(e){let t=wo(e.inputs)?{...e.inputs}:{},n={...e},r;if("resolver"in e){let i=e.resolver;if(!wo(i))return{unmoved:"resolverNotObject"};if(jt in t)return{unmoved:"generatorInputExists"};if(typeof i.key!="string"||i.key.length===0)return{unmoved:"pinWithoutKey"};if(i.kind!=="generator"&&i.kind!=="package")return{unmoved:"pinWithoutKind"};if(i.revision!==void 0&&!(typeof i.revision=="number"&&Number.isInteger(i.revision)&&i.revision>0))return{unmoved:"pinRevisionInvalid"};if((wo(i.inputSchema)&&Array.isArray(i.inputSchema.fields)?i.inputSchema.fields:[]).find(d=>wo(d)&&vz.includes(String(d.key)))!==void 0)return{unmoved:"stampDeclaresReservedKey"};t[jt]={kind:"literal",value:{kind:i.kind,key:i.key,...i.revision===void 0?{}:{revision:i.revision}}};let l=Object.fromEntries(xz.filter(d=>d in i).map(d=>[d,i[d]]));Object.keys(l).length>0&&(n.generatorStamp=l),r=i.cockpitFields,delete n.resolver}if(wo(e.template)&&("key"in e.template||"cockpitFields"in e.template)){let{key:i,cockpitFields:o,...a}=e.template;if("key"in e.template){if(go in t)return{unmoved:"templateInputExists"};if(typeof i!="string"||i.length===0)return{unmoved:"templateKeyInvalid"};t[go]={kind:"literal",value:i}}if(o!==void 0){if(r!==void 0)return{unmoved:"cockpitFieldsTwice"};r=o}n.template=a}if(r!==void 0){if("cockpitFields"in e)return{unmoved:"cockpitFieldsExist"};n.cockpitFields=r}return n.inputs=t,{node:n}}s(Sz,"moveNode");function II(e){let t=[],n=[],r=e.nodes.map(i=>{if(!$I(i))return i;let o=Sz(i);return"unmoved"in o?(n.push({nodeId:String(i.id),reason:o.unmoved}),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(II,"moveGeneratorPinsToInputs");var OI=/^\d{4}-\d{2}-\d{2}$/;function yr(e,t){return{de:e,en:t}}s(yr,"issue");function ko(e){if(typeof e!="object"||e===null)return yr("keine Reduktion","not a reduction");let t=e;if(t.kind==="none")return Object.keys(t).length===1?null:yr('\u201Ekeine Reduktion" tr\xE4gt keine weiteren Angaben','"no reduction" carries no further details');if(t.kind!=="amount")return yr(`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?yr("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"||!OI.test(r)?yr("der Beginn fehlt (JJJJ-MM-TT)","the start is missing (YYYY-MM-DD)"):typeof i!="string"||!OI.test(i)?yr("das Ende fehlt (JJJJ-MM-TT)","the end is missing (YYYY-MM-DD)"):i<r?yr("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)?yr("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))?yr("ung\xFCltige Preisperiode","invalid price period"):Object.keys(t).some(o=>!["kind","amount","activeFrom","activeTo","floorTotal","pricePeriod"].includes(o))?yr("unbekannte Angaben","unknown details"):null:yr("der Betrag hat mehr als zwei Nachkommastellen","the amount has more than two decimal places")}s(ko,"reductionShapeIssue");function Oi(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||ko(t.reduction)===null&&t.reduction.kind==="amount")}s(Oi,"isPricedItemValue");var Ts=["freetext","recommendation","choice","pricedItem","record","reduction"],$s=[...Ts,"appointment"];function NI(e){return typeof e=="string"&&$s.includes(e)}s(NI,"isTaskResultKind");function _i(e){return typeof e=="string"&&Ts.includes(e)}s(_i,"isRecordedTaskResultKind");function Rs(e){return _i(e.kind)}s(Rs,"isRecordedTaskResult");var gf=["number","boolean","enum"];function gy(e){return typeof e=="string"&&gf.includes(e)}s(gy,"isRecordFieldType");var yy=["form","siblingRank"];var Qr={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 CI(e){return(e.kind==="freetext"||e.kind==="recommendation"||e.kind==="choice")&&e.writes===void 0}s(CI,"isProseResult");function yf(e){return e.kind==="record"?(e.fields??[]).filter(t=>typeof t.writes=="string"&&t.writes.length>0&&gy(t.type)).map(t=>({key:t.writes,valueType:t.type,field:t})):Az(e)}s(yf,"draftResultStoreWrites");function Az(e){let t=Qr[e.kind].valueType;return e.writes===void 0||t===null?[]:[{key:e.writes,valueType:t}]}s(Az,"singleStoreWrite");var _I="team:";function Is(e){if(e==="all")return{kind:"all"};if(e==="external"||e.length===0)return null;if(e.startsWith(_I)){let t=e.slice(_I.length);return t.length===0?null:{kind:"team",groupKey:t}}return{kind:"channel",channelKey:e}}s(Is,"parseTaskResultChat");var tt={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]",labelMissing:"[taskResult/labelMissing]",appointmentInvalidDuration:"[taskResult/appointmentInvalidDuration]",recordFields:"[taskResult/recordFields]",fieldsOnNonRecord:"[taskResult/fieldsOnNonRecord]",recordSuggest:"[taskResult/recordSuggest]",reductionPrices:"[taskResult/reductionPrices]"};var Ez=new Set(["if","else","in","true","false","null"]),Tz=new Set(["==","!=","<=",">=","&&","||"]);function $z(e){return e>="0"&&e<="9"}s($z,"isDigit");function Rz(e){return/[a-zA-Z_$]/.test(e)}s(Rz,"isIdentStart");function Iz(e){return/[a-zA-Z0-9_.$]/.test(e)}s(Iz,"isIdentCont");function Oz(e){let t=[],n=0;for(;n<e.length;){let r=e.charAt(n);if(r===" "||r===" "||r===`
|
|
10962
10962
|
`||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&&F(`Unterminated string at ${n}`),t.push({t:"str",v:a}),n=o+1;continue}if($z(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(Rz(r)){let o=n;for(;o<e.length&&Iz(e.charAt(o));)o++;let a=e.slice(n,o);Ez.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(Tz.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}F(`Unexpected char '${r}' at ${n}`)}return t}s(Oz,"tokenise");var PI=1e4,DI=128;function Os(e){e.depth++,e.depth>DI&&F(`Expression nesting too deep (> ${DI})`)}s(Os,"enterDepth");function jI(e){return e.pos<e.tokens.length?e.tokens[e.pos]:null}s(jI,"peek");function Vt(e){let t=e.tokens[e.pos];return t||F(`Unexpected end at ${e.pos}`),e.pos++,t}s(Vt,"take");function Bt(e,t,n){let r=jI(e);return!(!r||r.t!==t||n!==void 0&&r.v!==n)}s(Bt,"match");function bo(e,t,n){return Bt(e,t,n)||F(`Expected ${t}${n?`:${n}`:""} at ${e.pos}`),Vt(e)}s(bo,"expect");function Xr(e){Os(e);try{return Bt(e,"kw","if")?_z(e):Nz(e)}finally{e.depth--}}s(Xr,"parseExpr");function _z(e){bo(e,"kw","if"),bo(e,"punct","(");let t=Xr(e);bo(e,"punct",")");let n=Xr(e);bo(e,"kw","else");let r=Xr(e);return{kind:"if",cond:t,then:n,else:r}}s(_z,"parseIf");function Nz(e){let t=FI(e),n=0;try{for(;Bt(e,"op","||");){Vt(e),Os(e),n++;let r=FI(e);t={kind:"binary",op:"||",left:t,right:r}}}finally{e.depth-=n}return t}s(Nz,"parseLogicOr");function FI(e){let t=LI(e),n=0;try{for(;Bt(e,"op","&&");){Vt(e),Os(e),n++;let r=LI(e);t={kind:"binary",op:"&&",left:t,right:r}}}finally{e.depth-=n}return t}s(FI,"parseLogicAnd");function LI(e){let t=MI(e),n=0;try{for(;Bt(e,"op","==")||Bt(e,"op","!=");){let r=Vt(e).v;Os(e),n++;let i=MI(e);t={kind:"binary",op:r,left:t,right:i}}}finally{e.depth-=n}return t}s(LI,"parseEquality");function MI(e){let t=ky(e),n=0;try{for(;Bt(e,"op","<")||Bt(e,"op","<=")||Bt(e,"op",">")||Bt(e,"op",">=")||Bt(e,"kw","in");){let r=Vt(e),i=r.t==="kw"?"in":r.v;Os(e),n++;let o=ky(e);t={kind:"binary",op:i,left:t,right:o}}}finally{e.depth-=n}return t}s(MI,"parseCompare");function ky(e){if(Bt(e,"op","!")){Vt(e),Os(e);try{return{kind:"unary",op:"!",operand:ky(e)}}finally{e.depth--}}return Cz(e)}s(ky,"parseUnary");function Cz(e){let t=jI(e);if(t||F("Unexpected end"),t.t==="num")return Vt(e),{kind:"num",value:t.v};if(t.t==="str")return Vt(e),{kind:"str",value:t.v};if(t.t==="kw"&&t.v==="true")return Vt(e),{kind:"bool",value:!0};if(t.t==="kw"&&t.v==="false")return Vt(e),{kind:"bool",value:!1};if(t.t==="kw"&&t.v==="null")return Vt(e),{kind:"null"};if(t.t==="punct"&&t.v==="("){Vt(e);let n=Xr(e);return bo(e,"punct",")"),n}if(t.t==="punct"&&t.v==="["){Vt(e);let n=[];if(!Bt(e,"punct","]"))for(n.push(Xr(e));Bt(e,"punct",",");)Vt(e),n.push(Xr(e));return bo(e,"punct","]"),{kind:"arr",items:n}}if(t.t==="ident"){let n=t.v;if(Vt(e),Bt(e,"punct","(")){Vt(e);let r=[];if(!Bt(e,"punct",")"))for(r.push(Xr(e));Bt(e,"punct",",");)Vt(e),r.push(Xr(e));return bo(e,"punct",")"),{kind:"call",name:n,args:r}}return{kind:"ident",path:n}}F(`Unexpected token at ${e.pos}`)}s(Cz,"parsePrimary");function $t(e){e.length>PI&&F(`Expression too long (${e.length} > ${PI})`);let t={tokens:Oz(e),pos:0,depth:0},n=Xr(t);return t.pos<t.tokens.length&&F(`Unexpected trailing token at ${t.pos}`),n}s($t,"parseExpression");var Pz=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 gt(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=>gt(n,t));case"unary":{let n=gt(e.operand,t);return!vo(n)}case"call":{let n=t.functions!==void 0&&Object.hasOwn(t.functions,e.name)?t.functions[e.name]:Pz.get(e.name);n||F(`Unknown function '${e.name}'`);let r=e.args.map(i=>gt(i,t));return n(...r)}case"binary":return Dz(e.op,e.left,e.right,t);case"if":return vo(gt(e.cond,t))?gt(e.then,t):gt(e.else,t)}}s(gt,"evaluate");function Dz(e,t,n,r){if(e==="&&"){let a=gt(t,r);return vo(a)?vo(gt(n,r)):!1}if(e==="||"){let a=gt(t,r);return vo(a)?!0:vo(gt(n,r))}let i=gt(t,r),o=gt(n,r);switch(e){case"==":return wy(i,o);case"!=":return!wy(i,o);case"<":{let[a,l]=wf(i,o);return a!==null&&l!==null&&a<l}case"<=":{let[a,l]=wf(i,o);return a!==null&&l!==null&&a<=l}case">":{let[a,l]=wf(i,o);return a!==null&&l!==null&&a>l}case">=":{let[a,l]=wf(i,o);return a!==null&&l!==null&&a>=l}case"in":return Array.isArray(o)?o.some(a=>wy(a,i)):!1}}s(Dz,"evalBinary");function wf(e,t){return[qI(e),qI(t)]}s(wf,"orderedOperands");function qI(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(qI,"numericOperand");function wy(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(wy,"looseEq");function vo(e){return!(e==null||e===!1||e===0||e===""||Array.isArray(e)&&e.length===0)}s(vo,"truthy");function Rt(e){let t=new Set;return Zr(e,t),[...t]}s(Rt,"dependencies");function Zr(e,t){switch(e.kind){case"ident":t.add(e.path);return;case"call":e.args.forEach(n=>Zr(n,t));return;case"arr":e.items.forEach(n=>Zr(n,t));return;case"unary":Zr(e.operand,t);return;case"binary":Zr(e.left,t),Zr(e.right,t);return;case"if":Zr(e.cond,t),Zr(e.then,t),Zr(e.else,t);return;default:return}}s(Zr,"walk");var KI=new Map;function ei(e){let t=KI.get(e);return t||(t=$t(e),KI.set(e,t)),t}s(ei,"parseCached");function Fz(e,t){return gt(ei(e),t)}s(Fz,"evalExpression");function VI(e,t){return vo(Fz(e,t))}s(VI,"evalBoolean");function BI(e,t){t!==null&&(typeof t=="object"||typeof t=="function")&&Object.hasOwn(t,"exports")&&F(`[workflow/registry] node type "${e}": custom spec.exports is unsupported; use artifact-slot exports.`)}s(BI,"assertNoCustomNodeExports");var by=null;function UI(e){for(let[t,n]of Object.entries(e))BI(t,n);by=e}s(UI,"setSpecs");function GI(){return by||F("[workflow/registry] Specs not initialised. Import convex/model/admission/specs before calling specFor()."),by}s(GI,"requireSpecs");function Ye(e){let t=GI(),n=t[e.type];return n===void 0&&ae("INVALID",{de:`[workflow/registry] Unbekannter Knotentyp "${String(e.type)}" (Knoten "${String(e.id)}"). Registrierte Typen: ${Object.keys(t).sort().join(", ")}.`,en:`[workflow/registry] Unknown node type "${String(e.type)}" (node "${String(e.id)}"). Registered types: ${Object.keys(t).sort().join(", ")}.`}),n}s(Ye,"specFor");function zI(){return Object.keys(GI()).sort()}s(zI,"registeredNodeTypes");var WI=sf.filter(e=>Hr[e].cohortBound!==!0);function vy(e){return Yn(e)&&Hr[e].cohortBound!==!0}s(vy,"isEnvAddressLeaf");function xy(e){return ho(e).type}s(xy,"envType");function Sy(e){return ho(e).label}s(Sy,"envLabel");function Ay(e){if(e.scope==="env"||e.path===void 0)return e;switch(e.scope){case"node":return{scope:"node",owner:e.owner,key:e.key};case"task":return{scope:"task",owner:e.owner,key:e.key}}}s(Ay,"addressBase");function wr(e){return e.scope==="node"&&e.key===en&&e.path===void 0}s(wr,"isInstanceAddress");function ct(e){return xe(e)&&e.scope==="node"&&e.key===en&&e.path!==void 0}s(ct,"isFormFieldAddress");function YI(e){return ct(e)?{owner:e.owner,path:e.path}:null}s(YI,"formFieldOf");function Lz(e){return Rt(ei(e)).map(t=>{if(!t.startsWith("$"))return{identifier:t,address:null,reason:"bareIdentifier"};let n=mo(t);return n===null?{identifier:t,address:null,reason:"shape"}:{identifier:t,address:n}})}s(Lz,"expressionAddresses");var en="admission",kl="document",_s="contract",Ns="contracts",HI="payment",Ey=new Set(["adoptForm","setFlagTarget","form","familyRequestFrom"]);var an={id:"identity",type:"identity",label:"display",sublabel:"display",library:"display",outcomes:"control",outputLabels:"display",inputs:"input",next:"control",tasks:"config",assign:"reference",actionTeams:"reference",optionalActions:"config",artifacts:"config",notifications:"config"},ice={join:{...an},end:{...an},eventTrigger:{...an},form:{...an,adoptForm:"address",formExports:"stamp"},roleAssign:{...an},setFlag:{...an},if:{...an,condition:"address"},countersign:{...an,contract:"address",titles:"display",signing:"config"},engagePush:{...an,engage:"tenantRef",form:"address",contract:"address",payment:"address"},decision:{...an,commentRequired:"config",decisionAsTask:"config",reads:"address",formView:"config",requiresOneOf:"config"},review:{...an,form:"address",commentRequired:"config",decisionAsTask:"config"},waitlist:{...an},completenessCheck:{...an,requires:"address",deadline:"config"},collectPayment:{...an},governedDocument:{...an,production:"config",form:"address",generatorStamp:"stamp",templateStamp:"stamp",approval:"config",confirmBeforeIssue:"config",confirmContractTerms:"config",contractTermsQuestionText:"display",responseStrategy:"config",titles:"display",responseLabels:"display",reads:"address"}};function Ni(e){return Array.isArray(e)?e:[]}s(Ni,"listOf");function Nn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null}s(Nn,"record");function JI(e){switch(e.type){case"countersign":return["contract"];case"engagePush":return["form","contract","payment"];case"governedDocument":return e.production==="resolver"?["form"]:[];case"review":return["form"];default:return[]}}s(JI,"dataSourceFieldsOf");function QI(e){return e.type==="review"?[]:e.type==="engagePush"?["form"]:JI(e)}s(QI,"requiredDataSourceFields");var Mz={setFlag:{target:"setFlagTarget"}};function bl(e,t={}){let n=[],r=e,i=`nodes.${e.id}`,o=s((d,c,u,p={})=>{n.push({kind:d,at:c,nodeId:e.id,value:u,judgedTogether:null,...p})},"field"),a=new Map(t.slotTypes===!1?[]:(Ye(e).inputs?.(e)??[]).map(d=>[d.id,d.type])),l=Mz[e.type]??{};for(let[d,c]of Object.entries(Nn(r.inputs)??{})){let u=Nn(c);if(u?.kind!=="binding")continue;let p="address"in u?u.address:u.path,h=l[d];if(h!==void 0){o(h,`${i}.inputs.${d}`,p);continue}let w=a.get(d);o("binding",`${i}.inputs.${d}`,p,w!==void 0?{expectedType:w}:{})}for(let[d,c]of Ni(r.reads).entries())o("nodeReads",`${i}.reads.${d}`,c,{judgedTogether:`${i}.reads`});for(let[d,c]of Ni(r.requires).entries())o("requires",`${i}.requires.${d}`,c,{judgedTogether:`${i}.requires`});e.type==="form"&&r.adoptForm!==void 0&&o("adoptForm",`${i}.adoptForm`,r.adoptForm);for(let d of JI(e))r[d]!==void 0&&o(d,`${i}.${d}`,r[d]);e.type==="if"&&r.condition!==void 0&&o("condition",`${i}.condition`,r.condition);for(let[d,c]of Ni(r.tasks).entries())n.push(...ZI(e.id,c,d));for(let[d,c]of Ni(r.optionalActions).entries()){let u=Nn(c);u?.when!==void 0&&o("optionalActionWhen",qz(e.id,typeof u.key=="string"?u.key:String(d)),u.when)}return n}s(bl,"nodeAddressFields");function qz(e,t){return`nodes.${e}.optionalActions.${t}.when`}s(qz,"optionalActionWhenPath");function ZI(e,t,n){let r=Nn(t);if(r===null)return[];let i=[],o=typeof r.key=="string"?r.key:String(n),a=`nodes.${e}.tasks.${o}`,l=s((p,h,w,k={})=>{i.push({kind:p,at:h,nodeId:e,taskKey:o,value:w,judgedTogether:null,...k})},"field"),d=`${a}.evidence`;r.when!==void 0&&l("taskWhen",`${a}.when`,r.when,{expectedType:"boolean",judgedTogether:d});for(let[p,h]of Ni(r.reads).entries())l("taskReads",`${a}.reads.${p}`,h,{judgedTogether:d});for(let[p,h]of Ni(r.documents).entries()){let w=Nn(h);w===null||w.kind==="artifact"||l("taskDocument",`${a}.documents.${p}`,"address"in w?w.address:w.key)}let c=Nn(r.familyRequest);if(c!==null){for(let[p,h]of Ni(c.fields).entries())l("familyRequestFields",`${a}.familyRequest.fields.${p}`,h,{judgedTogether:`${a}.familyRequest.fields`});c.from!==void 0&&l("familyRequestFrom",`${a}.familyRequest.from`,c.from)}let u=Nn(r.result);if(u?.kind==="record")for(let[p,h]of Ni(u.fields).entries()){let w=Nn(Nn(h)?.suggest);if(w?.kind!=="form")continue;let k=Nn(h)?.type;l("suggest",`${a}.result.fields.${p}.suggest`,"address"in w?w.address:w.key,typeof k=="string"?{expectedType:k}:{})}return i}s(ZI,"taskAddressFields");function Cs(e){return Ty(e)?($y(e.value)??[]).flatMap(t=>t.address===null?[]:[t.address]):xe(e.value)?[e.value]:[]}s(Cs,"addressesInField");function Ty(e){return e.kind==="condition"||e.kind==="optionalActionWhen"}s(Ty,"isExpressionField");function $y(e){if(typeof e!="string"||e.trim().length===0)return null;try{ei(e)}catch{return null}return Lz(e)}s($y,"conditionAddresses");function kn(e){return e.type==="form"&&e.adoptForm!==void 0&&e.adoptForm!==!1}s(kn,"adoptsForm");function XI(e){if(e.type!=="form"||kn({type:e.type,adoptForm:e.adoptForm}))return;let t=e.inputs?.smartForm;return t?.kind==="literal"&&typeof t.value=="string"&&t.value!==""?t.value:void 0}s(XI,"createdSmartFormSlug");function Kz(e,t){return e.type!=="governedDocument"||e.production!=="resolver"||t!==kl?t:e.generatorStamp?.parts!==void 0?Ns:_s}s(Kz,"addressKeyOfPort");function eO(e){let t=e.result;return t===void 0||!Rs(t)?[]:yf(t).map(n=>n.key)}s(eO,"storeWritesOf");function Ry(e,t){return(Array.isArray(e.processStore)?e.processStore:[]).find(n=>n.key===t)}s(Ry,"declaredKey");function Pr(e,t){let n=[];if(!kn(t))for(let r of Ye(t).outputs?.(t)??[])n.push({address:{scope:"node",owner:t.id,key:Kz(t,r.name)},type:r.type,...r.label!==void 0?{label:r.label}:{},nodeId:t.id,nodePort:r});for(let r of Array.isArray(t.tasks)?t.tasks:[])for(let i of eO(r)){let o=Ry(e,i);n.push({address:{scope:"task",owner:r.key,key:i},type:o?.type??"unknown",...o!==void 0?{label:o.label}:{},nodeId:t.id})}return n}s(Pr,"producedAddresses");function tO(e,t,n){for(let r of e.nodes)for(let i of Array.isArray(r.tasks)?r.tasks:[])if(i.key===t&&eO(i).includes(n))return{nodeId:r.id,template:i};return null}s(tO,"taskWriter");function ti(e,t,n){return tO(e,t,n)?.nodeId??null}s(ti,"taskOwnerNode");function jz(e){return bl(e,{slotTypes:!1}).flatMap(t=>Cs(t).map(n=>({address:n,field:t})))}s(jz,"writtenAddressesOf");function xo(e,t){let n=[],r=new Set,i=s((a,l,d,c)=>{let u=`${pe(a)}|${l}|${d.at}|${c===void 0?"":pe(c)}`;r.has(u)||(r.add(u),n.push({address:a,origin:l,field:d,...c!==void 0?{via:c}:{}}))},"push"),o=s((a,l)=>{if(a.scope!=="task")return;let d=tO(e,a.owner,a.key);if(d!==null){for(let c of ZI(d.nodeId,d.template))if(!(c.kind!=="taskWhen"&&c.kind!=="taskReads"))for(let u of Cs(c))i(u,"evidence",l,a)}},"carried");for(let{address:a,field:l}of jz(t))i(a,"written",l),o(a,l);return n}s(xo,"addressReadsOf");function Iy(e,t){switch(t.scope){case"env":return Yn(t.key)?xy(t.key):As(e,t.key)?.type;case"task":return t.path!==void 0||ti(e,t.owner,t.key)===null?void 0:Ry(e,t.key)?.type;case"node":{let n=e.nodes.find(i=>i.id===t.owner);if(n===void 0)return;let r=Pr(e,n).find(i=>i.address.scope==="node"&&i.address.key===t.key);return r===void 0?void 0:t.path===void 0?r.type:r.nodePort?.schema?.find(i=>i.key===t.path)?.type}}}s(Iy,"addressType");function kf(e,t){let n=Nn(e)?.[t];return typeof n=="string"&&n.length>0?n:void 0}s(kf,"labelText");function Oe(e,t,n){let r=e.nodes.find(i=>i.id===t);return kf(r?.label,n)??t}s(Oe,"nodeDisplayName");function So(e,t,n){for(let r of e.nodes){let i=(Array.isArray(r.tasks)?r.tasks:[]).find(o=>o.key===t);if(i!==void 0)return kf(i.title,n)??t}return t}s(So,"taskDisplayName");function je(e,t,n){let r=[];switch(t.scope){case"env":r.push(Yn(t.key)?Sy(t.key)[n]:As(e,t.key)?.label[n]??t.key);break;case"task":r.push(So(e,t.owner,n),kf(Ry(e,t.key)?.label,n)??t.key);break;case"node":{r.push(Oe(e,t.owner,n));let i=e.nodes.find(a=>a.id===t.owner),o=i===void 0?void 0:Pr(e,i).find(a=>a.address.scope==="node"&&a.address.key===t.key);r.push(kf(o?.label,n)??t.key);break}}return t.scope!=="env"&&t.path!==void 0&&r.push(t.path),`${r.join(" \u203A ")} (${pe(t)})`}s(je,"displayAddress");var vl=["beneficiary","signers"];function nO(e,t){return Array.isArray(e.artifacts)&&e.artifacts.some(n=>n?.key===t)}s(nO,"ownsSlot");function xl(e){let t=[];for(let[n,r]of Object.entries(Nn(e.inputs)??{})){let i=Nn(r);i?.kind==="binding"&&xe(i.address)&&t.push({slot:n,address:i.address})}return t}s(xl,"bindingAddresses");function rO(e,t){return xl(e).find(n=>n.slot===t)?.address??null}s(rO,"bindingAddressAt");function iO(e,t){let n=s(i=>i.scope==="node"&&i.owner===t||i.scope==="task"&&ti(e,i.owner,i.key)===t,"names");return e.nodes.filter(i=>i.id!==t).flatMap(i=>bl(i,{slotTypes:!1})).flatMap(i=>Cs(i).filter(n).map(o=>({at:i.at,nodeId:i.nodeId,address:o})))}s(iO,"addressesNaming");var It={target:"target",flagKey:"flagKey",value:"value"};function Vz(e){return rO(e,It.target)}s(Vz,"setFlagTarget");function oO(e){let t=Vz(e);return t!==null&&wr(t)?t.owner:null}s(oO,"setFlagTargetOwner");function bf(e){let t=e.inputs?.[It.flagKey];return t?.kind==="literal"&&typeof t.value=="string"&&t.value.length>0?t.value:null}s(bf,"setFlagKey");function sO(e){let t=e.inputs?.[It.value];if(t===void 0||t.kind==="unset")return!0;if(t.kind==="literal"&&typeof t.value=="boolean")return t.value;F(`[setFlag/valueType] setFlag node "${String(e.id)}": \`${It.value}\` is no yes/no literal \u2014 publish refuses that`)}s(sO,"setFlagValue");function aO(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(aO,"isObject");var lO=["target","flagKey","value"];function dO(e){return aO(e)&&e.type==="setFlag"&&lO.some(t=>t in e)}s(dO,"oldShape");function cO(e){return(e?.nodes??[]).some(dO)}s(cO,"needsSetFlagInputMove");function Bz(e){let t=aO(e.inputs)?{...e.inputs}:{};if(lO.some(a=>a in e&&It[a]in t))return{unmoved:"inputExists"};if("target"in e&&!xe(e.target))return{unmoved:"targetNotAddress"};if("flagKey"in e&&typeof e.flagKey!="string")return{unmoved:"flagKeyNotString"};if("value"in e&&typeof e.value!="boolean")return{unmoved:"valueNotBoolean"};let{target:n,flagKey:r,value:i,...o}=e;return n!==void 0&&(t[It.target]={kind:"binding",address:n}),typeof r=="string"&&r.length>0&&(t[It.flagKey]={kind:"literal",value:r}),i!==void 0&&(t[It.value]={kind:"literal",value:i}),{node:{...o,inputs:t}}}s(Bz,"moveNode");function uO(e){let t=[],n=[],r=e.nodes.map(i=>{if(!dO(i))return i;let o=Bz(i);return"unmoved"in o?(n.push({nodeId:String(i.id),reason:o.unmoved}),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(uO,"moveSetFlagConfigToInputs");function fO(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(fO,"isObject");var Oy={countersign:{dueInDays:"number"},decision:{allowSkipInTest:"boolean"},completenessCheck:{guestRole:"string"},governedDocument:{responseDueInDays:"number"}},_y={review:["allowSkipInTest"]};function pO(e){return Oy[String(e)]??{}}s(pO,"movesOf");function mO(e){return _y[String(e)]??[]}s(mO,"deadOf");function hO(e){return fO(e)&&[...Object.keys(pO(e.type)),...mO(e.type)].some(t=>t in e)}s(hO,"oldShape");function gO(e){return(e?.nodes??[]).some(hO)}s(gO,"needsScalarInputMove");function Uz(e,t){return t==="number"?typeof e=="number"&&Number.isInteger(e)&&e>=1:typeof e===t}s(Uz,"wellTyped");function Gz(e){let t=fO(e.inputs)?{...e.inputs}:{},n={...e};for(let[r,i]of Object.entries(pO(e.type))){if(!(r in e))continue;let o=e[r];if(r in t)return{unmoved:{nodeId:String(e.id),key:r,reason:"inputExists"}};if(!(i==="string"&&o==="")&&!Uz(o,i))return{unmoved:{nodeId:String(e.id),key:r,reason:"valueWrongType"}};o!==""&&(t[r]={kind:"literal",value:o}),delete n[r]}for(let r of mO(e.type))delete n[r];return n.inputs=t,{node:n}}s(Gz,"moveNode");function yO(e){let t=[],n=[],r=e.nodes.map(i=>{if(!hO(i))return i;let o=Gz(i);return"unmoved"in o?(n.push(o.unmoved),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(yO,"moveScalarConfigToInputs");var Ps={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 vf(e){return typeof e=="string"&&Object.hasOwn(Ps,e)}s(vf,"isResourceType");var kce=Object.keys(Ps).filter(e=>Ps[e].existence.check==="generic");function wO(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||ko(t.reduction)===null&&t.reduction.kind==="amount")&&Object.keys(t).every(n=>n==="groupKey"||n==="grantKeys"||n==="reduction")}s(wO,"isPricedGroupValue");var Ny=["street","hausnr","plz","ort","land"];function kO(e){return Ny.includes(e)}s(kO,"isAddressPart");var zz=["municipality","municipalityKey","district","districtKey"],Cy=[...Ny,...zz],Py={string:"text",email:"text",tel:"text",number:"number",date:"date",boolean:"boolean",consent:"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"},Ds=Object.keys(Py);function Ci(e){return typeof e=="string"&&e in Py}s(Ci,"isValueType");function bn(e){return e===void 0?void 0:Py[e]}s(bn,"dataTypeOf");function xf(e,t){let n=bn(e),r=bn(t);return n!==void 0&&n===r}s(xf,"valueTypesCompatible");function Sf(e){return e===null?"null is not a text in both languages":Sl(e,{type:"localizedText"})}s(Sf,"completeLocalizedTextIssue");function Sl(e,t){if(vf(t.type)&&!Ci(t.type))return typeof e=="string"&&e.length>0?null:`${JSON.stringify(e)} is not a ${t.type} key`;let n=bn(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 wO(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 gl(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=ko(e);return o===null?null:`${r} is not a reduction \u2014 ${o.en}`}}}s(Sl,"literalTypeIssue");function bO(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(bO,"isObject");var Wz={collectPayment:{reason:"reason"}},Yz={governedDocument:["mockAutoProduce"]},vO={collectPayment:{reason:{de:"`reason` gibt es als Knoteneigenschaft nicht mehr \u2014 der Hinweis f\xFCr die Familie ist der Eingang `inputs.reason` (ein fester Text auf Deutsch und Englisch im Parameter-Bereich).",en:"`reason` no longer exists as a node property \u2014 the note for the family is the input `inputs.reason` (a fixed text in German and English among the parameters)."}},governedDocument:{template:{de:"`template` gibt es am Knoten nicht mehr \u2014 die Parameter geh\xF6ren der Vorlage (ihr Datensatz, `plexus-cli catalog` documentTemplates[].parameters) und werden beim Speichern und Ver\xF6ffentlichen als `templateStamp` \xFCbernommen.",en:"`template` no longer exists on the node \u2014 the parameters belong to the template (its record, `plexus-cli catalog` documentTemplates[].parameters) and are stamped as `templateStamp` on save and publish."},cockpitFields:{de:'`cockpitFields` gibt es nicht mehr \u2014 ein Parameter, der im Cockpit erg\xE4nzt wird, ist sein Eingang `{ kind: "cockpit" }` (im Parameter-Bereich \u201Eim Cockpit erg\xE4nzen").',en:'`cockpitFields` no longer exists \u2014 a parameter completed in the cockpit is its input `{ kind: "cockpit" }` ("complete in the cockpit" among the parameters).'},mockAutoProduce:{de:"`mockAutoProduce` gibt es nicht mehr \u2014 das Muster-Dokument, das ein Upload-Knoten beim Eintritt selbst einstellte, ist entfernt; das Dokument kommt aus einem Upload.",en:"`mockAutoProduce` no longer exists \u2014 the sample document an upload node put on its slot by itself on entry is removed; the document comes from an upload."}}};function Dy(e){return Wz[String(e)]??{}}s(Dy,"movesOf");function xO(e){return Yz[String(e)]??[]}s(xO,"deadOf");function SO(e){return bO(e)&&[...Object.keys(Dy(e.type)),...xO(e.type)].some(t=>t in e)}s(SO,"oldShape");function AO(e){return(e?.nodes??[]).some(SO)}s(AO,"needsNodeConfigInputMove");function Hz(e){return Sf(e)===null}s(Hz,"isCompleteText");function Jz(e){let t=bO(e.inputs)?{...e.inputs}:{},n={...e};for(let[r,i]of Object.entries(Dy(e.type)))if(r in e){if(i in t)return{unmoved:{nodeId:String(e.id),key:r,reason:"inputExists"}};if(!Hz(e[r]))return{unmoved:{nodeId:String(e.id),key:r,reason:"valueNotLocalized"}};t[i]={kind:"literal",value:e[r]},delete n[r]}for(let r of xO(e.type))delete n[r];return Object.keys(Dy(e.type)).some(r=>r in e)&&(n.inputs=t),{node:n}}s(Jz,"moveNode");function EO(e){let t=[],n=[],r=e.nodes.map(i=>{if(!SO(i))return i;let o=Jz(i);return"unmoved"in o?(n.push(o.unmoved),i):(t.push(String(i.id)),o.node)});return t.length===0?{graph:e,moved:t,unmoved:n}:{graph:{...e,nodes:r},moved:t,unmoved:n}}s(EO,"moveNodeConfigToInputs");var Fy="collectPayment",Fs=["online","separate"];function Af(e){return Fs.includes(e)}s(Af,"isCollectPaymentSettlement");var Ao="paid",Ly="skipPayment",My="confirmPayment",Pi="article",Jn="settlement",Di="reason",Qn="payee",qy=["one_time"];function Ef(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Ef,"isObject");function TO(e){if(!Ef(e)||e.type!==Fy)return!1;let t=Ef(e.inputs)?e.inputs:{},n=t[Jn];return!Ef(n)||n.kind!=="literal"||n.value!=="online"?!1:!(Qn in t)}s(TO,"isOnlinePaymentWithoutPayee");function $O(e){return(e?.nodes??[]).some(TO)}s($O,"needsPayee");function RO(e,t={}){let n=[],r=[],i=e.nodes.map(o=>{if(!TO(o))return o;let a=String(o.id),l=Object.hasOwn(t,a)?t[a]:void 0;if(l===void 0||l==="")return r.push(a),o;n.push({nodeId:a,payee:l});let d=Ef(o.inputs)?o.inputs:{};return{...o,inputs:{...d,[Qn]:{kind:"literal",value:l}}}});return n.length===0?{graph:e,set:n,refused:r}:{graph:{...e,nodes:i},set:n,refused:r}}s(RO,"setPayeeOnOnlinePayments");function Tf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Tf,"isObject");function Ky(e){return Tf(e)&&Tf(e.assign)&&"userId"in e.assign}s(Ky,"namesUser");function $f(e){return(e?.nodes??[]).flatMap(t=>Tf(t)&&Array.isArray(t.tasks)?t.tasks.filter(Ky).map(n=>({nodeId:String(t.id),taskKey:String(n.key),hasTeam:typeof n.assign.group=="string"&&n.assign.group.length>0})):[])}s($f,"taskUserAssignments");function IO(e){let t=$f(e);if(t.length===0)return{graph:e,dropped:t};let n=e.nodes.map(r=>{if(!Tf(r)||!Array.isArray(r.tasks)||!r.tasks.some(Ky))return r;let i=r.tasks.map(o=>{if(!Ky(o))return o;let{userId:a,...l}=o.assign,{assign:d,...c}=o;return Object.keys(l).length===0?c:{...c,assign:l}});return{...r,tasks:i}});return{graph:{...e,nodes:n},dropped:t}}s(IO,"dropTaskAssignUserIds");var Ls={"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"}},"actionTeams{}":{kind:"team",codec:"key",involves:!1,required:!1,what:{de:"Team, das die Knoten-Aktion ausf\xFChren darf",en:"team that may perform the node action"},consequence:{de:"au\xDFer der zust\xE4ndigen Person darf niemand die Aktion ausf\xFChren",en:"nobody but the responsible person may perform the action"}},"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"}}},jy=s(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:null,"record");function OO(e,t){if(typeof t!="string"||t.length===0)return null;if(e==="key")return t;let n=Is(t);return n?.kind==="team"?n.groupKey:null}s(OO,"decodeKey");var _O={"assign{}":"assign","actionTeams{}":"actionTeams"},Qz=s(e=>e in _O,"isMapLeaf");function Zz(e){let t=/^(tasks|optionalActions)\[\](?:\.([a-zA-Z]+))?\.([a-zA-Z]+)$/.exec(e);return t===null&&F(`[resource] unreadable reference leaf "${e}"`),{list:t[1],field:t[2]??null,key:t[3]}}s(Zz,"locate");function Rf(e){let t=[],n=e;for(let[r,i]of Object.entries(_O))for(let[o,a]of Object.entries(jy(n[i])??{}))t.push({path:`${i}.${o}`,leaf:r,owner:o,key:OO("key",a),missing:typeof a!="string"||a.length===0});for(let r of Object.keys(Ls)){if(Qz(r))continue;let i=Ls[r],{list:o,field:a,key:l}=Zz(r);for(let d of Array.isArray(n[o])?n[o]:[]){let c=jy(d);if(c===null||typeof c.key!="string")continue;let p=(a===null?c:jy(c[a]))?.[l];if(p===void 0&&!i.required)continue;let h=typeof p!="string"||p.length===0;t.push({path:`${o}.${c.key}${a===null?"":`.${a}`}.${l}`,leaf:r,owner:c.key,key:OO(i.codec,p),missing:h})}}return t}s(Rf,"nodeResourceReferences");var NO=s(e=>(e??[]).map(t=>`\u201E${t}\u201C`).join(", "),"list"),CO=s(e=>(e??[]).map(t=>`"${t}"`).join(", "),"listEn"),Xz={"address/shape":{de:s(e=>({problem:`${e.where}: \u201E${e.address}\u201C ist keine g\xFCltige Adresse.`,remedy:"W\xE4hle die Adresse in der Auswahl neu."}),"de"),en:s(e=>({problem:`${e.where}: "${e.address}" is not a valid address.`,remedy:"Choose the address again from the picker."}),"en")},"address/missing":{de:s(e=>({problem:`${e.where}: Hier fehlt die Adresse, ohne die dieser Schritt nicht arbeiten kann.`,remedy:"W\xE4hle sie in der Auswahl."}),"de"),en:s(e=>({problem:`${e.where}: The address this step cannot work without is missing.`,remedy:"Choose it from the picker."}),"en")},"address/bareIdentifier":{de:s(e=>({problem:`${e.where}: \u201E${e.address}\u201C nennt nur einen Schl\xFCssel, nicht, wer ihn erzeugt.`,remedy:"W\xE4hle in der Auswahl die volle Adresse, z. B. das Feld aus dem Formular, das es erfasst."}),"de"),en:s(e=>({problem:`${e.where}: "${e.address}" names a key only, not who produces it.`,remedy:"Choose the full address from the picker, e.g. the field from the form that collects it."}),"en")},"address/unknownOwner":{de:s(e=>({problem:`${e.where}: ${e.address} nennt einen Knoten oder eine Aufgabe, die es im Ablauf nicht gibt.`,remedy:"W\xE4hle eine Adresse aus der Auswahl."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} names a node or task the workflow does not have.`,remedy:"Choose an address from the picker."}),"en")},"address/unknownKey":{de:s(e=>({problem:`${e.where}: ${e.producer??"der Erzeuger"} erzeugt ${e.address} nicht.`,remedy:"W\xE4hle einen Wert, den der Erzeuger tats\xE4chlich liefert."}),"de"),en:s(e=>({problem:`${e.where}: ${e.producer??"the producer"} does not produce ${e.address}.`,remedy:"Choose a value the producer actually delivers."}),"en")},"address/envCohortBound":{de:s(e=>({problem:`${e.where}: ${e.address} \xE4ndert sich, wenn Stufe oder Schuljahr gewechselt werden \u2014 ein Dokument, das den Wert druckt, w\xFCrde das nicht bemerken.`,remedy:"Lies den Wert \xFCber ein Formularfeld, das ihn berechnet (z. B. \u201EKlassenstufe\u201C): ein Wechsel friert es neu ein und h\xE4lt ein gedrucktes Dokument an."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} changes when the application's stage or school year is changed \u2014 a document printing it would not notice.`,remedy:'Read it through a form field that computes it (e.g. "Grade"): a change re-freezes it and holds a printed document.'}),"en")},"address/staffInputConditionOnly":{de:s(e=>({problem:`${e.where}: ${e.address} ist eine interne Angabe beim Anlegen \u2014 sie lenkt eine Weiche (\u201EWenn\u201C-Knoten) oder f\xFCllt einen Parameter eines Knotens.`,remedy:"Lies sie in der Bedingung eines \u201EWenn\u201C-Knotens oder binde einen Parameter des Knotens daran (z. B. im Vertrag); Formulare, Aufgaben und Regeln lesen sie nicht."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} is a staff input set at the start \u2014 it steers a branch (an "If" node) or fills a node's parameter.`,remedy:'Read it in the condition of an "If" node or bind a node parameter to it (e.g. in the contract); forms, tasks and rules do not read it.'}),"en")},"address/ownerNotWriter":{de:s(e=>({problem:`${e.where}: Die Aufgabe \u201E${e.producer}\u201C schreibt ${e.address} nicht.`,remedy:"W\xE4hle den Wert \xFCber seinen Schl\xFCssel; die schreibende Aufgabe folgt daraus."}),"de"),en:s(e=>({problem:`${e.where}: The task "${e.producer}" does not write ${e.address}.`,remedy:"Choose the value by its key; the writing task follows from it."}),"en")},"address/taskOwnerTaken":{de:s(e=>({problem:`${e.where}: Den Aufgaben-Schl\xFCssel gibt es mehrfach (${NO(e.names)}), und eine dieser Aufgaben schreibt Prozesswerte.`,remedy:"Gib der schreibenden Aufgabe einen Schl\xFCssel, den keine andere Aufgabe tr\xE4gt."}),"de"),en:s(e=>({problem:`${e.where}: The task key is used more than once (${CO(e.names)}), and one of these tasks writes process values.`,remedy:"Give the writing task a key no other task carries."}),"en")},"address/notVisible":{de:s(e=>({problem:e.producerNode!==void 0&&e.producerNode!==e.producer?`${e.where}: ${e.address} \u2014 \u201E${e.producer}\u201C h\xE4ngt an \u201E${e.producerNode}\u201C, das nicht auf jedem Weg vor \u201E${e.reader}\u201C liegt.`:`${e.where}: ${e.address} \u2014 \u201E${e.producer}\u201C liegt nicht auf jedem Weg vor \u201E${e.reader}\u201C.`,remedy:`Lies nur, was auf jedem Weg vor \u201E${e.reader}\u201C entsteht, oder ordne die Schritte so, dass der Erzeuger immer vorher l\xE4uft.`}),"de"),en:s(e=>({problem:e.producerNode!==void 0&&e.producerNode!==e.producer?`${e.where}: ${e.address} \u2014 "${e.producer}" hangs on "${e.producerNode}", which does not lie before "${e.reader}" on every path.`:`${e.where}: ${e.address} \u2014 "${e.producer}" does not lie before "${e.reader}" on every path.`,remedy:`Read only what is produced before "${e.reader}" on every path, or order the steps so the producer always runs first.`}),"en")},"address/pathNotInTarget":{de:s(e=>({problem:`${e.where}: ${e.address} \u2014 ${e.producer??"der Erzeuger"} hat dieses Feld nicht.`,remedy:"W\xE4hle ein Feld, das es dort gibt."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} \u2014 ${e.producer??"the producer"} has no such field.`,remedy:"Choose a field that exists there."}),"en")},"address/typeMismatch":{de:s(e=>({problem:`${e.where}: erwartet ${e.expected}, ${e.address} ist ${e.actual}.`,remedy:`W\xE4hle einen Wert vom Typ ${e.expected}.`}),"de"),en:s(e=>({problem:`${e.where}: expects ${e.expected}, ${e.address} is ${e.actual}.`,remedy:`Choose a value of type ${e.expected}.`}),"en")},"address/notFormInstance":{de:s(e=>({problem:`${e.where}: ${e.address} ist kein ganzes Formular.`,remedy:"W\xE4hle das Formular des Knotens, der es anlegt \u2014 ohne Feld, nicht den Knoten, der es \xFCbernimmt."}),"de"),en:s(e=>({problem:`${e.where}: ${e.address} is not a whole form.`,remedy:"Choose the form of the node that creates it \u2014 without a field, not the node that continues it."}),"en")},"address/mixedForms":{de:s(e=>({problem:`${e.where}: Die Liste liest Felder aus mehreren Formularen (${NO(e.names)}), beurteilt wird sie aber an einem Formular.`,remedy:"W\xE4hle alle Felder dieser Liste aus demselben Formular."}),"de"),en:s(e=>({problem:`${e.where}: The list reads fields of several forms (${CO(e.names)}) but is judged on one.`,remedy:"Choose every field of this list from the same form."}),"en")},"workItems/keyFormat":{de:s(e=>({problem:`${e.where}: Der Aufgaben-Schl\xFCssel \u201E${e.address}\u201C hat nicht die Form ^[a-z][a-zA-Z0-9_]*$.`,remedy:"Benenne die Aufgabe in camelCase um, z. B. \u201EgeschwisterRang\u201C."}),"de"),en:s(e=>({problem:`${e.where}: The task key "${e.address}" does not match ^[a-z][a-zA-Z0-9_]*$.`,remedy:'Rename the task in camelCase, e.g. "siblingRank".'}),"en")}};function Ms(e,t,n){let{problem:r,remedy:i}=Xz[e][n](t);return`[${e}] ${r} ${i}`}s(Ms,"addressMessage");function Zn(e){let t=[];for(let n of e){let r=n.next;if(r)for(let[i,o]of Object.entries(r))t.push({id:`${n.id}|${i}`,source:n.id,target:o.to,sourceBranchId:i})}return t}s(Zn,"derivedEdges");function Vy(e){let t=new Map;for(let n of Zn(e.nodes)){let r=t.get(n.source)??[];r.push(n.target),t.set(n.source,r)}return t}s(Vy,"successorsOf");function If(e,t,n){if(t===n)return!0;let r=Vy(e),i=new Set([...r.values()].flat()),o=e.nodes.filter(l=>!i.has(l.id)&&l.id!==t).map(l=>l.id),a=new Set(o);for(;o.length>0;){let l=o.shift();if(l===n)return!1;for(let d of r.get(l)??[])d===t||a.has(d)||(a.add(d),o.push(d))}return!0}s(If,"dominates");function PO(e,t,n){if(t===n)return!0;let r=Vy(e),i=[t],o=new Set(i);for(;i.length>0;){let a=i.shift();for(let l of r.get(a)??[]){if(l===n)return!0;o.has(l)||(o.add(l),i.push(l))}}return!1}s(PO,"reaches");function DO(e,t,n,r){let i=new Map(e.nodes.map(d=>[d.id,d])),o=Vy(e),a=[t],l=new Set(a);for(;a.length>0;){let d=a.shift();for(let c of o.get(d)??[]){if(l.has(c)||n.has(c))continue;l.add(c);let u=i.get(c);if(u!==void 0&&r(u))return c;a.push(c)}}return null}s(DO,"reachedAvoiding");function By(e,t){let n=[],r=s(i=>({address:i.address,type:i.type,...i.label!==void 0?{label:i.label}:{},nodeId:i.nodeId}),"toVisible");for(let i of e.nodes)if(If(e,i.id,t))for(let o of Pr(e,i))n.push(r(o));for(let i of WI)n.push({address:{scope:"env",key:i},type:xy(i),label:Sy(i),nodeId:null});for(let i of lf(e))n.push({address:{scope:"env",key:df(i.key)},type:i.type,label:i.label,nodeId:null});return n}s(By,"visibleAddressesAt");function ni(e,t){let n=e?.readinessFormFieldsByFormNode?.get(t.owner);if(n!==void 0)return n.get(t.path)??null}s(ni,"formFieldEntryOf");var FO={binding:{de:"Eingang",en:"Input"},condition:{de:"Bedingung",en:"Condition"},nodeReads:{de:"Gelesene Felder",en:"Fields read"},requires:{de:"Geforderte Felder",en:"Required fields"},adoptForm:{de:"\xDCbernommenes Formular",en:"Continued form"},setFlagTarget:{de:"Freizuschaltendes Formular",en:"Form to unlock"},form:{de:"Formular",en:"Form"},contract:{de:"Vertrag",en:"Contract"},payment:{de:"Zahlung",en:"Payment"},taskWhen:{de:"Bedingung",en:"Condition"},optionalActionWhen:{de:"Bedingung der optionalen Aktion",en:"Condition of the optional action"},taskReads:{de:"Gelesene Felder der Aufgabe",en:"Fields the task reads"},taskDocument:{de:"Dokumente",en:"Documents"},familyRequestFields:{de:"Nachforderbare Felder",en:"Requestable fields"},familyRequestFrom:{de:"Nachforderung aus",en:"Request from"},suggest:{de:"Vorschlag",en:"Suggestion"}},eW=new Set(["nodeReads","requires","taskReads","taskDocument","familyRequestFields"]);function tW(e,t,n){let r=[];t.taskKey!==void 0&&r.push(`${n==="de"?"Aufgabe":"task"} \u201E${So(e,t.taskKey,n)}\u201C`);let i=t.kind==="binding"?` \u201E${t.at.split(".").pop()}\u201C`:"";return r.push(`${FO[t.kind][n]}${i}`),r.join(" \u203A ")}s(tW,"addressFieldWhere");function Al(e,t,n){let r=tW(e,t,n);return`\u201E${Oe(e,t.nodeId,n)}\u201C \u203A ${r}`}s(Al,"whereOf");function LO(e,t,n){if(t.scope==="node")return Oe(e,t.owner,n);if(t.scope==="task")return So(e,t.owner,n)}s(LO,"producerName");function MO(e,t){let n=[],r=new Set,i=s((l,d,c)=>{let u={de:Ms(l,c("de"),"de"),en:Ms(l,c("en"),"en")},p=`${d}|${u.de}`;r.has(p)||(r.add(p),n.push({layer:"GRAPH",kind:"nodeRule",path:d,reason:u,severity:"error"}))},"report"),o=new Map(e.nodes.map(l=>[l.id,l])),a=[...e.nodes.flatMap(l=>bl(l))];for(let l of a){let d=s(c=>Al(e,l,c),"where");for(let c of nW(e,l,i))iW(e,l,c,i)&&(sW(e,l,c,t,i),Ey.has(l.kind)&&!lW(o,c)&&i("address/notFormInstance",l.at,u=>({where:d(u),address:je(e,c,u)})))}return dW(e,i),cW(e,a,i),mW(e,i),gW(e,i),n}s(MO,"checkAddresses");function nW(e,t,n){let r=s(i=>Al(e,t,i),"where");if(Ty(t)){let i=$y(t.value)??[];for(let o of i)o.address===null&&n(o.reason==="bareIdentifier"?"address/bareIdentifier":"address/shape",t.at,a=>({where:r(a),address:o.identifier}));return Cs(t)}return typeof t.value=="string"?(n("address/bareIdentifier",t.at,i=>({where:r(i),address:t.value})),[]):xe(t.value)?[t.value]:(n("address/shape",t.at,i=>({where:r(i),address:JSON.stringify(t.value)??"undefined"})),[])}s(nW,"checkFieldShape");function qO(e,t,n,r){let i=LO(e,n,r);return{where:Al(e,t,r),address:je(e,n,r),...i!==void 0?{producer:i}:{}}}s(qO,"addressParams");function rW(e,t,n){return vy(t)||n==="optionalActionWhen"&&(As(e,t)!==void 0||Yn(t))?null:As(e,t)!==void 0?n==="condition"||n==="binding"?null:"address/staffInputConditionOnly":Yn(t)?"address/envCohortBound":"address/unknownKey"}s(rW,"envAddressRefusal");function iW(e,t,n,r){let i=s(o=>qO(e,t,n,o),"params");switch(n.scope){case"env":{let o=rW(e,n.key,t.kind);return o===null?!0:(r(o,t.at,i),!1)}case"task":return e.nodes.some(a=>(a.tasks??[]).some(l=>l.key===n.owner))?(e.processStore??[]).some(a=>a.key===n.key)?ti(e,n.owner,n.key)===null?(r("address/ownerNotWriter",t.at,i),!1):!0:(r("address/unknownKey",t.at,i),!1):(r("address/unknownOwner",t.at,i),!1);case"node":{let o=e.nodes.find(a=>a.id===n.owner);return o===void 0?(r("address/unknownOwner",t.at,i),!1):Pr(e,o).some(a=>a.address.scope==="node"&&a.address.key===n.key)?!0:(r(Ey.has(t.kind)&&kn(o)?"address/notFormInstance":"address/unknownKey",t.at,i),!1)}}}s(iW,"resolves");function oW(e,t){return e===void 0||t===void 0||bn(t)===void 0?!0:bn(e)!==void 0&&xf(e,t)}s(oW,"addressTypeFits");function sW(e,t,n,r,i){let o=s(l=>qO(e,t,n,l),"params");if(n.scope!=="env"&&n.path!==void 0&&!aW(e,t,n,r)){i("address/pathNotInTarget",t.at,o);return}if(t.expectedType===void 0)return;let a=Iy(e,n);oW(a,t.expectedType)||i("address/typeMismatch",t.at,l=>({...o(l),expected:t.expectedType,actual:a}))}s(sW,"checkPathAndType");function aW(e,t,n,r){if(n.scope!=="node")return!1;if(Iy(e,n)!==void 0)return!0;if(n.key!==en)return!1;if(!eW.has(t.kind))return e.nodes.find(o=>o.id===n.owner)?.formExports===void 0;let i=r?.readinessFormFieldsByFormNode?.get(n.owner);return i===void 0||i.has(n.path)}s(aW,"pathExists");function lW(e,t){if(!wr(t))return!1;let n=e.get(t.owner);return n!==void 0&&n.type==="form"&&!kn(n)}s(lW,"isCreatingFormInstance");function dW(e,t){for(let n of e.nodes){let r=new Set(bl(n).map(i=>i.kind));for(let i of QI(n))r.has(i)||t("address/missing",`nodes.${n.id}.${i}`,o=>({where:`\u201E${Oe(e,n.id,o)}\u201C \u203A ${FO[i][o]}`}))}}s(dW,"checkRequiredFields");function cW(e,t,n){let r=new Map;for(let i of t)if(i.judgedTogether!==null)for(let o of Cs(i)){if(o.scope!=="node"||o.key!==en)continue;let a=r.get(i.judgedTogether)??[];a.push({field:i,owner:o.owner}),r.set(i.judgedTogether,a)}for(let[i,o]of r){let a=[...new Set(o.map(l=>l.owner))];a.length<2||n("address/mixedForms",i,l=>({where:Al(e,o[0].field,l),names:a.map(d=>Oe(e,d,l))}))}}s(cW,"checkMixedForms");function uW(e,t){return e.type==="engagePush"&&t.kind==="payment"}s(uW,"readSkipsAbsentProducer");function fW(e,t,n){return t!==n&&PO(e,t,n)}s(fW,"precedesOnSomePath");function pW(e,t,n,r){let i=Ay(n.address);return r.has(pe(i))||!hW(e,i)?!0:n.origin==="written"&&i.scope==="node"&&uW(t,n.field)&&fW(e,i.owner,t.id)}s(pW,"readPassesVisibility");function mW(e,t){for(let n of e.nodes){let r=xo(e,n);if(r.length===0)continue;let i=new Set(By(e,n.id).map(o=>pe(o.address)));for(let o of r){let a=Ay(o.address);if(pW(e,n,o,i))continue;let l=a.scope==="task"?ti(e,a.owner,a.key):a.scope==="node"?a.owner:null;t("address/notVisible",o.field.at,d=>({where:Al(e,o.field,d),address:je(e,o.address,d),producer:LO(e,a,d)??je(e,a,d),...l!==null?{producerNode:Oe(e,l,d)}:{},reader:Oe(e,n.id,d)}))}}}s(mW,"checkVisibility");function hW(e,t){if(t.scope==="env")return vy(t.key);let n=pe(t);return e.nodes.some(r=>Pr(e,r).some(i=>pe(i.address)===n))}s(hW,"producedSomewhere");function gW(e,t){let n=new Map;for(let r of e.nodes){let i=new Set(Pr(e,r).flatMap(o=>o.address.scope==="task"?[o.address.owner]:[]));for(let[o,a]of(r.tasks??[]).entries()){let l=a.key;if(typeof l!="string"||!$i.test(l)){t("workItems/keyFormat",`nodes.${r.id}.tasks.${o}.key`,c=>({where:`\u201E${Oe(e,r.id,c)}\u201C`,address:String(l)}));continue}let d=n.get(l)??[];d.push({nodeId:r.id,writes:i.has(l)}),n.set(l,d)}}for(let[r,i]of n)if(!(i.length<2||!i.some(o=>o.writes)))for(let o of i)t("address/taskOwnerTaken",`nodes.${o.nodeId}.tasks.${r}`,a=>({where:`\u201E${Oe(e,o.nodeId,a)}\u201C \u203A ${a==="de"?"Aufgabe":"task"} \u201E${So(e,r,a)}\u201C`,names:i.map(l=>Oe(e,l.nodeId,a))}))}s(gW,"checkTaskKeys");function Of(e,t){return e.label[t]??""}s(Of,"wordingIn");function Fi(e,t){let n=KO(e,t),r=Of(e.qualifier,t);return n===""||r===""&&Of(e.qualifier,"de")!==""?"":r===""?n:`${r} \xB7 ${n}`}s(Fi,"fieldLabelIn");function KO(e,t){return Of(e,t)}s(KO,"fieldOwnLabelIn");function qs(e){return{key:e.key,kind:e.kind,type:e.kind==="entered"?e.type:null,repeated:e.kind==="entered"&&e.repeated,reviewRequired:e.kind==="entered"&&e.reviewRequired,name:{de:Fi(e,"de"),en:Fi(e,"en")}}}s(qs,"catalogField");function Ks(e,t){switch(e){case"nodeReads":return t.repeated?"repeated":null;case"requires":return t.repeated?"repeated":t.kind==="computed"?"computed":t.name.en===""?"untranslated":null;case"taskDocument":return t.repeated?"repeated":t.kind==="entered"&&t.type==="docRef"?null:"notDocument";case"taskReads":case"familyRequestFields":return null}}s(Ks,"catalogFieldRefusal");function _f(e,t){let n=e.buses.find(r=>r.key===t);return n||F(`[progress] layout '${e.id}' has no bus '${t}'`),n}s(_f,"progressBus");function El(e,t){return e.states.some(n=>n.id===t)}s(El,"isBusState");function jO(e,t){let n=e.terminalSemantics?.[t];return n||F(`[progress] no terminal semantics for state '${t}' on bus '${e.key}'`),n}s(jO,"terminalSemantics");function Nf(e,t){return!!e.terminalSemantics&&Object.prototype.hasOwnProperty.call(e.terminalSemantics,t)}s(Nf,"hasTerminalSemantics");function yW(e,t){return(e.boards??[]).find(n=>n.audience===t||n.audience==="both")??null}s(yW,"boardForAudience");function VO(e){return yW(_f(e,"process"),"internal")}s(VO,"internalProcessBoard");function js(e,t,n){let r=null;for(let i of e.mappings)if(i.event===n)if("nodeId"in i.match){if(i.match.nodeId===t.id)return{bus:i.bus,state:i.state}}else i.match.nodeType===t.type&&(r=i);return r?{bus:r.bus,state:r.state}:null}s(js,"resolveProgressEvent");var Vs={approved:"enrolled",rejected:"declined",withdrawn:"declined",expired:"declined"},ri=Object.keys(Vs);function Eo(e){return Object.hasOwn(Vs,e)}s(Eo,"isEndNodeOutcome");var Uy={approved:{de:"Angenommen",en:"Admitted"},rejected:{de:"Abgelehnt",en:"Rejected"},withdrawn:{de:"Zur\xFCckgezogen",en:"Withdrawn"},expired:{de:"Abgelaufen",en:"Expired"}};var Li=["commit","discard"],gue=m.union(...Li.map(e=>m.literal(e)));function Cf(e){return typeof e=="string"&&Li.includes(e)}s(Cf,"isApplicationDataDecision");function Ft(e){return Object.keys(e)}s(Ft,"progressEventsOf");var ne=s((e,t)=>({de:e,en:t}),"lt"),Ze=s((e,t,n,r,i=null,o=null)=>({chipLabel:e,tone:t,nextAction:i,affordance:o,title:n,body:r}),"ex"),BO={key:"eingeschrieben",label:ne("Eingeschrieben","Enrolled"),scope:"global",defaultCollapsed:!0},Pf={key:"abgesagt",label:ne("Abgesagt","Declined"),scope:"global",track:"exit",defaultCollapsed:!0},UO={key:"abgelehnt",label:ne("Abgelehnt","Rejected"),scope:"global",track:"exit",defaultCollapsed:!0};var GO={enrolled:{label:ne("Eingeschrieben","Enrolled"),tone:"green",terminal:{lifecycleStatus:"completed",outcome:"approved"},phase:BO,external:Ze(ne("Eingeschrieben","Enrolled"),"green",ne("Sie sind eingeschrieben!","You are enrolled!"),ne("Ihre Anmeldung ist abgeschlossen und Ihr Platz ist gesichert. Wir freuen uns auf Sie.","Your enrolment is complete and your place is secured. We look forward to welcoming you."))},declined:{label:ne("Abgesagt","Declined"),tone:"red",terminal:{lifecycleStatus:"completed",outcome:"rejected"},phase:Pf,external:Ze(ne("Abgesagt","Declined"),"red",ne("Die Bewerbung wurde beendet","The application has ended"),ne("Ihre Bewerbung wurde nicht fortgef\xFChrt.","Your application was not continued."))}},zO={role:"effect",effect:"pure",progressDefaults:GO,progressEvents:Ft(GO),inputs:s(()=>[{id:"applicationOutcome",label:{de:"Ergebnis",en:"Outcome"},type:"enum",required:!0,inspector:"literal-only",optionSource:"declared",enumOptions:ri.map(e=>({value:e,label:Uy[e]}))},{id:"dataDecision",label:{de:"Erfasste Daten",en:"Captured data"},type:"enum",required:!0,inspector:"literal-only",optionSource:"declared",enumOptions:[{value:"commit",label:{de:"\xDCbernehmen",en:"Keep"}},{value:"discard",label:{de:"Verwerfen",en:"Discard"}}]}],"inputs"),notificationEvents:s(()=>[{id:"reached",label:{de:"Verfahren abgeschlossen",en:"Process completed"},audience:"external",args:[{key:"applicationId",type:"string",required:!0},{key:"outcome",type:"string",required:!0}]}],"notificationEvents"),validate:s(e=>[...wW(e),...kW(e),...bW(e)],"validate")},Bs=s((e,t,n,r)=>({layer:"GRAPH",kind:"nodeRule",path:`node.${e.id}.inputs.${t}`,reason:{de:n,en:r},severity:"error"}),"nodeIssue");function To(e){let t=e.inputs?.applicationOutcome;return t?.kind==="literal"&&t.value!=null?String(t.value):null}s(To,"literalOutcome");function wW(e){if(e.type!=="end")return[];let t=e.inputs?.applicationOutcome;if(t===void 0||t.kind==="unset")return[];let n=To(e);return n===null?[Bs(e,"applicationOutcome",`[end/applicationOutcome] ${e.label.de}: das Ergebnis ist kein fester Wert \u2014 die Engine kann den Abschluss nicht ableiten`,`[end/applicationOutcome] ${e.label.en}: the application outcome is no fixed value \u2014 the engine cannot derive the terminal`)]:Eo(n)?[]:[Bs(e,"applicationOutcome",`[end/applicationOutcome] ${e.label.de}: '${n}' ist kein Ausgang eines Endknotens (${ri.join("|")}) \u2014 die Warteliste endet \xFCber das closed-Outcome ihres Wartelistenknotens`,`[end/applicationOutcome] ${e.label.en}: '${n}' is not an outcome of an end node (${ri.join("|")}) \u2014 the waitlist ends through the closed outcome of its waitlist node`)]}s(wW,"checkEndApplicationOutcome");function kW(e){if(e.type!=="end")return[];let t=e.inputs?.dataDecision;return!t||t.kind!=="literal"||t.value==null?[Bs(e,"dataDecision",`[end/dataDecision] ${e.label.de}: dataDecision fehlt \u2014 der Endknoten muss festlegen, ob die erfassten Daten \xFCbernommen (commit) oder verworfen (discard) werden`,`[end/dataDecision] ${e.label.en}: dataDecision is missing \u2014 the end node must decide whether the collected data is kept (commit) or discarded (discard)`)]:Cf(t.value)?[]:[Bs(e,"dataDecision",`[end/dataDecision] ${e.label.de}: dataDecision '${String(t.value)}' ist ung\xFCltig (${Li.join("|")})`,`[end/dataDecision] ${e.label.en}: dataDecision '${String(t.value)}' is invalid (${Li.join("|")})`)]}s(kW,"checkEndDataDecision");function bW(e){if(e.type!=="end")return[];let t=To(e);if(t===null||!Eo(t)||t==="approved")return[];let n=e.inputs?.dataDecision;if(n?.kind!=="literal"||n.value!=="commit")return[];let r=Uy[t];return[{...Bs(e,"dataDecision",`[end/commitWithoutApproval] ${e.label.de}: Ende ohne Zusage \xFCbernimmt die erfassten Daten (commit) \u2014 Personen und Beziehungen bleiben nach dem Ergebnis \u201E${r.de}" bestehen. Gewollt? Sonst discard.`,`[end/commitWithoutApproval] ${e.label.en}: end without admission keeps the captured data (commit) \u2014 persons and relationships remain after the outcome "${r.en}". Intended? Otherwise discard.`),severity:"warning"}]}s(bW,"checkEndCommitWithoutApproval");function WO(e,t){if(!t?.layout||!t.wiring)return[];let n=[];for(let r of e.nodes){if(r.type!=="end")continue;let i=To(r);if(i===null||!Eo(i))continue;let o=Vs[i],a=js(t.wiring,r,o);if(a===null)continue;let l=t.layout.buses.find(c=>c.key===a.bus);if(l===void 0||!Nf(l,a.state))continue;let d=jO(l,a.state).outcome;d!==i&&n.push(Bs(r,"applicationOutcome",`[end/outcomeMismatch] ${r.label.de}: das Ergebnis \u201E${i}" passt nicht zum Endzustand \u201E${a.state}" (Bus ${a.bus}), der \u201E${String(d)}" besiegelt \u2014 Ergebnis oder Verdrahtung angleichen.`,`[end/outcomeMismatch] ${r.label.en}: the outcome "${i}" does not match the final state "${a.state}" (bus ${a.bus}), which seals "${String(d)}" \u2014 align the outcome or the wiring.`))}return n}s(WO,"checkEndOutcomeMatchesTerminal");function Us(e){let t=Ye(e);return typeof t.inputs=="function"?t.inputs(e):[]}s(Us,"inputSlots");function vW(e,t){return Us(e).find(n=>n.id===t)}s(vW,"findInputSlot");function xW(e,t){let n=vW(e,t);if(!n)return{source:"missing",spec:{id:t,label:{de:t,en:t},type:"string"},unknownSlot:!0};let r=e.inputs?.[t]??{kind:"unset"};return r.kind==="binding"&&xe(r.address)?{source:"binding",spec:n,address:r.address}:r.kind==="literal"?{source:"literal",spec:n,value:r.value}:r.kind==="cockpit"&&n.deferrable===!0?{source:"cockpit",spec:n}:n.defaultValue!==void 0?{source:"default",spec:n,value:n.defaultValue}:n.required?{source:"missing",spec:n}:{source:"optional",spec:n}}s(xW,"resolveInput");function YO(e){return Us(e).filter(t=>xW(e,t.id).source==="missing")}s(YO,"missingRequiredInputs");var SW=["personRef","formRef","documentRef","docRef"];function AW(e){let t=Ye(e);return typeof t.inputs!="function"?[]:t.inputs(e).map(n=>({id:n.id,type:n.type}))}s(AW,"listInputs");function HO(e){let t=[];for(let n of e.nodes)for(let r of AW(n))!SW.includes(r.type)||n.inputs?.[r.id]?.kind!=="literal"||t.push({layer:"GRAPH",kind:"modelError",path:`node.${n.id}.param.${r.id}`,reason:{de:`${n.label.de}: Literal f\xFCr referenztypisierten Slot "${r.id}" ist verboten \u2014 der Slot wird an eine Adresse gebunden`,en:`${n.label.en}: A literal for the reference-typed slot "${r.id}" is not allowed \u2014 the slot is bound to an address`},severity:"error"});return t}s(HO,"findParamValueRefSlotErrors");function JO(e){let t=[];for(let n of e.nodes){let r=Ye(n);if(typeof r.inputs=="function")for(let i of r.inputs(n)){let o=n.inputs?.[i.id];if(o?.kind==="cockpit"&&i.deferrable!==!0){t.push({layer:"GRAPH",kind:"modelError",path:`nodes.${n.id}.inputs.${i.id}`,reason:{de:`[inputs/notDeferrable] ${n.label.de}: Parameter \u201E${i.label.de}\u201C l\xE4sst sich nicht im Cockpit erg\xE4nzen \u2014 nur Parameter eines Generators oder einer Vorlage.`,en:`[inputs/notDeferrable] ${n.label.en}: Parameter "${i.label.en}" cannot be completed in the cockpit \u2014 only parameters of a generator or a template can.`},severity:"error"});continue}(i.inspector==="literal-only"&&o?.kind==="binding"||i.inspector==="binding-only"&&o?.kind==="literal")&&t.push({layer:"GRAPH",kind:"modelError",path:`nodes.${n.id}.inputs.${i.id}`,reason:i.inspector==="literal-only"?{de:`[inputs/inspectorKind] ${n.label.de}: Parameter \u201E${i.label.de}\u201C ist ein fester Wert \u2014 eine Bindung an eine Adresse ist hier nicht m\xF6glich.`,en:`[inputs/inspectorKind] ${n.label.en}: Parameter "${i.label.en}" is a fixed value \u2014 it cannot be bound to an address.`}:{de:`[inputs/inspectorKind] ${n.label.de}: Parameter \u201E${i.label.de}\u201C wird an eine Adresse gebunden \u2014 ein fester Wert ist hier nicht m\xF6glich.`,en:`[inputs/inspectorKind] ${n.label.en}: Parameter "${i.label.en}" is bound to an address \u2014 a fixed value is not possible here.`},severity:"error"})}}return t}s(JO,"findInspectorKindErrors");function QO(e){let t=[];for(let n of e.nodes)for(let r of YO(n))t.push({layer:"GRAPH",kind:"contractGap",path:`node.${n.id}.input.${r.id}`,reason:{de:`${n.label.de}: Pflicht-Slot "${r.label.de}" nicht gesetzt`,en:`${n.label.en}: Required slot "${r.label.en}" is not set`},severity:"error"});return t}s(QO,"findMissingRequiredInputs");function Df(e){let t=e.processStore;return t===void 0?[]:(Array.isArray(t)||F("graph.processStore must be an array \u2014 the graph validator refuses anything else"),t)}s(Df,"processStoreKeys");function ZO(e){let t=[];for(let n of e.tasks??[]){let r=n.result;if(!(r===void 0||!Rs(r)))for(let i of yf(r))t.push({key:i.key,nodeId:e.id,taskKey:n.key,template:n,result:r,valueType:i.valueType,...i.field!==void 0?{fieldKey:i.field.key}:{}})}return t}s(ZO,"storeWritersOn");function XO(e){let t=new Map;for(let n of e.nodes)for(let r of ZO(n)){let i=t.get(r.key)??[];i.push(r),t.set(r.key,i)}return t}s(XO,"processStoreWriters");function EW(e,t,n){for(let r of e.nodes){let i=ZO(r).find(o=>o.taskKey===t&&o.key===n);if(i!==void 0)return i}return null}s(EW,"writerAt");function TW(e,t,n){(t.scope!=="task"||t.path!==void 0)&&F(`[process] ${n}: ${pe(t)} is no task value`);let r=EW(e,t.owner,t.key);return r===null&&F(`[address/ownerNotWriter] ${n}: task "${t.owner}" writes no "${t.key}" \u2014 publish refuses that`),{key:t.key,nodeId:r.nodeId,taskKey:r.taskKey,...r.fieldKey!==void 0?{fieldKey:r.fieldKey}:{}}}s(TW,"sourceOfAddress");function e_(e,t){(t.scope!=="task"||t.path!==void 0)&&F(`[process] ${pe(t)} is no store address`);let n=Df(e).find(r=>r.key===t.key);return n===void 0&&F(`[address/unknownKey] ${pe(t)}: "${t.key}" is not declared in processStore`),{key:n.key,type:n.type,label:n.label,audience:n.audience,source:TW(e,t,pe(t))}}s(e_,"processLeafOf");var Gy=new Set(["enum","pricedItem","number","boolean","reduction"]),ln={invalidKey:"[process/invalidKey]",unknownKey:"[process/unknownKey]",secondWriter:"[process/secondWriter]",noWriter:"[process/noWriter]",writerTypeMismatch:"[process/writerTypeMismatch]",pricedItemWritesNothing:"[process/pricedItemWritesNothing]",internalInDocument:"[process/internalInDocument]",writerMustBlock:"[process/writerMustBlock]",absentWithoutDefault:"[process/absentWithoutDefault]",defaultItemMismatch:"[process/defaultItemMismatch]"};function dn(e,t,n,r){return{layer:"GRAPH",kind:"contractGap",path:e,reason:{de:`${t} ${n}`,en:`${t} ${r}`},severity:"error"}}s(dn,"err");function n_(e){let t=[],n=Df(e),r=new Map(n.map(l=>[l.key,l])),i=new Set;for(let[l,d]of n.entries()){let c=`processStore[${l}]`;if(typeof d.key!="string"||!/^[a-z][a-zA-Z0-9_]*$/.test(d.key)){t.push(dn(c,ln.invalidKey,`Vorgangs-Schl\xFCssel ${JSON.stringify(d.key)} \u2014 erlaubt sind Buchstaben, Ziffern und _, beginnend mit einem Kleinbuchstaben.`,`Process key ${JSON.stringify(d.key)} \u2014 letters, digits and _ are allowed, starting with a lowercase letter.`));continue}i.has(d.key)&&t.push(dn(c,ln.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}" ist doppelt deklariert.`,`Process key "${d.key}" is declared twice.`)),i.add(d.key),Gy.has(d.type)||t.push(dn(c,ln.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}" hat den Typ "${d.type}" \u2014 der Vorgang speichert nur Ergebnisse mit Wert: ${[...Gy].join(", ")}.`,`Process key "${d.key}" has the type "${d.type}" \u2014 the process only stores results with a value: ${[...Gy].join(", ")}.`)),(!d.label?.de?.trim()||!d.label?.en?.trim())&&t.push(dn(c,ln.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}" braucht ein Label in beiden Sprachen.`,`Process key "${d.key}" needs a label in both languages.`)),d.audience!=="internal"&&d.audience!=="printable"&&t.push(dn(c,ln.invalidKey,`Vorgangs-Schl\xFCssel "${d.key}": audience muss 'internal' oder 'printable' sein.`,`Process key "${d.key}": audience must be 'internal' or 'printable'.`))}let o=XO(e);for(let l of e.nodes)for(let d of l.tasks??[]){let c=d.result;c?.kind==="pricedItem"&&c.writes===void 0&&t.push(dn(`node.${l.id}.tasks.${d.key}.result.writes`,ln.pricedItemWritesNothing,`Aufgabe "${d.key}" (Knoten "${l.id}") bepreist einen Artikel, schreibt das Ergebnis aber in keinen Vorgangs-Schl\xFCssel ('result.writes') \u2014 niemand k\xF6nnte den Preis lesen.`,`Task "${d.key}" (node "${l.id}") prices an article but writes the result to no process key ('result.writes') \u2014 nobody could read the price.`))}for(let[l,d]of o){let c=r.get(l);for(let u of d){let p=u.fieldKey===void 0?`node.${u.nodeId}.tasks.${u.taskKey}.result.writes`:`node.${u.nodeId}.tasks.${u.taskKey}.result.fields.${u.fieldKey}.writes`;if(c===void 0){t.push(dn(p,ln.unknownKey,`${u.fieldKey===void 0?"":`Feld "${u.fieldKey}" der `}Aufgabe "${u.taskKey}" schreibt "${l}", aber der Workflow deklariert keinen solchen Vorgangs-Schl\xFCssel (graph.processStore).`,`${u.fieldKey===void 0?"Task":`Field "${u.fieldKey}" of task`} "${u.taskKey}" writes "${l}", but the workflow declares no such process key (graph.processStore).`));continue}if(u.valueType!==c.type){let h=u.fieldKey===void 0?`Aufgabe "${u.taskKey}"`:`Feld "${u.fieldKey}" der Aufgabe "${u.taskKey}"`,w=u.fieldKey===void 0?`Task "${u.taskKey}"`:`Field "${u.fieldKey}" of task "${u.taskKey}"`;t.push(dn(p,ln.writerTypeMismatch,`${h} liefert ${u.valueType}, der Vorgangs-Schl\xFCssel "${l}" ist aber als ${c.type} deklariert.`,`${w} delivers ${u.valueType}, but the process key "${l}" is declared as ${c.type}.`))}}if(d.length>1){let u=d.map(p=>`${p.nodeId}/${p.taskKey}${p.fieldKey===void 0?"":`.${p.fieldKey}`}`).join(", ");t.push(dn(`processStore.${l}`,ln.secondWriter,`Vorgangs-Schl\xFCssel "${l}" wird ${d.length}-mal geschrieben (${u}) \u2014 genau ein Schreiber je Schl\xFCssel.`,`Process key "${l}" is written ${d.length} times (${u}) \u2014 exactly one writer per key.`))}}for(let l of n)o.has(l.key)||t.push(dn(`processStore.${l.key}`,ln.noWriter,`Vorgangs-Schl\xFCssel "${l.key}" ist deklariert, aber keine Aufgabe schreibt ihn ('result.writes').`,`Process key "${l.key}" is declared, but no task writes it ('result.writes').`));let a=new Map;for(let l of e.nodes){let d=Ye(l),c=typeof d.inputs=="function"?d.inputs(l):[];for(let u of c){let p=l.inputs?.[u.id];if(p?.kind!=="binding")continue;let h=$W(e,p.address);if(h===null)continue;let w=`node.${l.id}.input.${u.id}`,k=pe(p.address),y=a.get(h.source.key)??new Set;y.add(l.id),a.set(h.source.key,y),h.audience==="internal"&&t.push(dn(w,ln.internalInDocument,`${l.label.de}: "${u.id}" liest den internen Vorgangs-Schl\xFCssel "${h.key}" \u2014 ein Dokument dieses Knotens geht an die Familie; nur 'printable'-Schl\xFCssel d\xFCrfen hinein.`,`${l.label.en}: "${u.id}" reads the internal process key "${h.key}" \u2014 a document of this node goes to the family; only 'printable' keys may go in.`));let v=RW(o,h.source.key,h.source.taskKey);if(v.template.when!==void 0&&u.required===!0&&u.defaultValue===void 0&&t.push(dn(w,ln.absentWithoutDefault,`${l.label.de}: "${u.id}" ist Pflicht und an ${k} gebunden, aber die schreibende Aufgabe entsteht nur unter einer Bedingung (when: ${t_(v.template.when)}) \u2014 ohne Vorgabewert bliebe das Feld dann f\xFCr immer leer.`,`${l.label.en}: "${u.id}" is required and bound to ${k}, but the writing task only exists under a condition (when: ${t_(v.template.when)}) \u2014 without a default value the field would stay empty forever.`)),v.result.kind==="pricedItem"&&u.defaultValue!==void 0){let A=u.defaultValue;(!Oi(A)||A.itemKey!==v.result.item||A.grantKeys.length>0)&&t.push(dn(w,ln.defaultItemMismatch,`${l.label.de}: der Vorgabewert von "${u.id}" muss der Artikel der schreibenden Aufgabe ohne Erm\xE4\xDFigung sein ({ itemKey: '${v.result.item??"?"}', grantKeys: [] }) \u2014 sonst rechnete die Familie ohne Antrag einen anderen Artikel als mit.`,`${l.label.en}: the default value of "${u.id}" must be the article of the writing task without a reduction ({ itemKey: '${v.result.item??"?"}', grantKeys: [] }) \u2014 otherwise the family would be charged a different article without an application than with one.`))}}}for(let[l,d]of a){let c=o.get(l)[0],u=c.template.blocks,p=u===void 0?void 0:u.node??c.nodeId,h=p!==void 0&&(()=>{let k=e.nodes.find(y=>y.id===p);return k!==void 0&&Ye(k).processHoldTemplate?.(k)===u.templateKey})(),w=`node.${c.nodeId}.tasks.${c.taskKey}.blocks`;if(!h){let k=[...d][0],y=e.nodes.find(A=>A.id===k),v=Ye(y).processHoldTemplate?.(y)??"?";t.push(dn(w,ln.writerMustBlock,`Die Aufgabe "${c.taskKey}" schreibt "${l}", h\xE4lt aber keinen der lesenden Knoten (${[...d].join(", ")}) zur\xFCck \u2014 sie muss den ersten blockieren, z. B. blocks: { ${k===c.nodeId?"":`node: '${k}', `}templateKey: '${v}' }, sonst arbeitet er, bevor der Wert existiert.`,`The task "${c.taskKey}" writes "${l}" but holds back none of the reading nodes (${[...d].join(", ")}) \u2014 it must block the first one, e.g. blocks: { ${k===c.nodeId?"":`node: '${k}', `}templateKey: '${v}' }, otherwise it works before the value exists.`));continue}for(let k of d)k===p||If(e,p,k)||t.push(dn(w,ln.writerMustBlock,`"${k}" liest "${l}", liegt aber nicht hinter dem zur\xFCckgehaltenen Knoten "${p}" \u2014 auf einem Weg an ihm vorbei l\xE4se er den Wert, bevor er feststeht.`,`"${k}" reads "${l}" but does not lie behind the held-back node "${p}" \u2014 on a path past it, it would read the value before it is settled.`))}return t}s(n_,"processBindingIssues");function $W(e,t){return!xe(t)||t.scope!=="task"||t.path!==void 0||!Df(e).some(n=>n.key===t.key)||ti(e,t.owner,t.key)===null?null:e_(e,t)}s($W,"draftLeafOf");function RW(e,t,n){let r=e.get(t)?.find(i=>i.taskKey===n);return r===void 0&&F(`[process] the leaf of "${t}" names task "${n}", which does not write it`),r}s(RW,"writerOf");function t_(e){return xe(e)?pe(e):JSON.stringify(e)}s(t_,"shown");function zy(e){let t=Ye(e);return e.outcomes&&e.outcomes.length>0?[...e.outcomes]:t.outcomes&&t.outcomes.length>0?[...t.outcomes]:null}s(zy,"nodeOutcomes");var IW=["documentChangeRequested","documentReturned","coverLetterConfirmed","coverLetterRevisionRequested"];function r_(e){return IW.includes(e)}s(r_,"isNonAdvancingExternalEvent");var Gs=["offer","contract"];function Ff(e){return typeof e=="string"&&Gs.includes(e)}s(Ff,"isArtifactSlotType");var i_="open",zs="done";function Wy(e){let t={};for(let n of ze)t[n]=e(n);return t}s(Wy,"localized");var o_=[{key:"tenantSlug",type:"string"}];var OW=/^(\d{4})-(\d{2})-(\d{2})$/;function _W(e){return e>=1900&&e<=2100}s(_W,"isSupportedYear");function NW(e,t,n){let r=new Date(Date.UTC(e,t-1,n));return r.getUTCFullYear()===e&&r.getUTCMonth()===t-1&&r.getUTCDate()===n}s(NW,"isRealDate");function Yy(e){if(typeof e!="string")return null;let t=OW.exec(e);if(t===null)return null;let[,n,r,i]=t;return n===void 0||r===void 0||i===void 0||!_W(Number(n))||!NW(Number(n),Number(r),Number(i))?null:{year:n,month:r,day:i}}s(Yy,"isoDateParts");var CW="Europe/Berlin";function a_(){return CW}s(a_,"tenantTimeZone");var s_=new Map;function PW(e){let t=s_.get(e);if(t)return t;let n;try{n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{ae("INVALID",{de:`Unbekannte Zeitzone "${e}".`,en:`Unknown time zone "${e}".`})}return s_.set(e,n),n}s(PW,"formatterFor");function DW(e,t){let n=new Map(PW(e).formatToParts(new Date(t)).map(a=>[a.type,a.value])),r=s(a=>{let l=n.get(a);return l===void 0&&F(`Zeitzone "${e}" liefert kein Feld ${a}.`),Number(l)},"read"),i=r("hour")%24;return Date.UTC(r("year"),r("month")-1,r("day"),i,r("minute"),r("second"))-Math.floor(t/1e3)*1e3}s(DW,"zoneOffsetAt");function Hy(e,t){let n=e+DW(t,e);return{wallClock:new Date(n).toISOString().slice(0,19),timeZone:t}}s(Hy,"instantToLocalDateTime");var Jy=3;function l_(e){return Hy(e,a_()).wallClock.slice(0,10)}s(l_,"localIsoDate");var Lf=["login","security","admission","tasks","deadlines","schoolMessages","staffTasks","staffFeedback","staffAppointments","staffDeadlines","staffWaitlist","familyMessages","mentions"],d_=m.union(...Lf.map(e=>m.literal(e)));var $fe=m.union(m.literal("admission"),m.literal("tasks"),m.literal("staff"),m.literal("chat")),Qy=["loginOnly","all"],Rfe=m.union(m.literal("loginOnly"),m.literal("all"));function c_(e){return typeof e=="string"&&Qy.includes(e)}s(c_,"isMailLevel");var Tl="subject";function u_(e){return e.category==="login"}s(u_,"isSignInLetter");var lt={key:"schoolName",label:"Name der Schule"},f_={de:"Zu Ihren Bewerbungen",en:"View your applications"},bt={key:"portalLink",label:"Link zum Bewerberportal",required:!0,link:!0,actionLabel:f_},Zy={key:bt.key,label:bt.label,link:!0,actionLabel:f_},p_={key:"authorName",label:"Name der schreibenden Person"},Ws={key:"applicationLink",label:"Link zur Bewerbung",required:!0,link:!0,actionLabel:{de:"Bewerbung \xF6ffnen",en:"Open application"}},$l={key:"anmeldeLink",label:"Anmeldelink",required:!0,link:!0,actionLabel:{de:"Jetzt anmelden",en:"Sign in now"},previewValue:{de:"https://beispiel.plexus.schule/anmelden?token=BEISPIEL",en:"https://beispiel.plexus.schule/anmelden?token=BEISPIEL"}},LW={key:"passwortLink",label:"Link zum neuen Passwort",required:!0,link:!0,actionLabel:{de:"Neues Passwort festlegen",en:"Set a new password"},previewValue:{de:"https://beispiel.plexus.schule/login/reset?token=BEISPIEL",en:"https://beispiel.plexus.schule/login/reset?token=BEISPIEL"}},m_={key:"bestaetigungsLink",label:"Best\xE4tigungslink",required:!0,link:!0,actionLabel:{de:"E-Mail best\xE4tigen",en:"Confirm email address"},previewValue:{de:"https://beispiel.plexus.schule/bestaetigen?token=BEISPIEL",en:"https://beispiel.plexus.schule/bestaetigen?token=BEISPIEL"}},Rl={key:"gueltigkeit",label:"G\xFCltigkeitsdauer des Links",previewValue:{de:"15 Minuten",en:"15 minutes"}},h_={key:"gueltigkeit",label:"G\xFCltigkeitsdauer des Links",previewValue:{de:"24 Stunden",en:"24 hours"}},MW={key:"gueltigkeit",label:"G\xFCltigkeitsdauer des Links",previewValue:{de:"60 Minuten",en:"60 minutes"}};function _e(e){return{key:Tl,label:"Betreff",default:e}}s(_e,"subjectSlot");var Mi=m.object({de:m.string(),en:m.string()}),Ot={tenantSlug:m.string(),applicationId:m.id("applications")},qW=m.object({tenantSlug:m.string()}),KW={id:"applicant.welcome",category:"admission",label:"Willkommen",occasion:{de:"Sobald f\xFCr eine Familie ein Zugang angelegt wurde",en:"As soon as an account has been created for a family"},audience:"external",frame:"letter",timeline:"correspondence",paramsValidator:qW,channels:["email"],portalVisible:!0,placeholders:[lt,bt],slots:[_e({de:"Willkommen \u2014 Ihre Bewerbung bei uns",en:"Welcome \u2014 your application"}),{key:"intro",label:"Einleitung",multiline:!0,default:{de:`vielen Dank f\xFCr Ihre Registrierung bei {{schoolName}}. \xDCber den folgenden Link k\xF6nnen Sie jederzeit Ihre Bewerbungen einsehen und fortsetzen:
|
|
10963
10963
|
|
|
10964
10964
|
{{portalLink}}`,en:`Thank you for registering with {{schoolName}}. You can view and continue your applications at any time using the link below:
|
|
@@ -11465,6 +11465,6 @@ ${n.length} unusable ${o}:
|
|
|
11465
11465
|
`),r.length>0&&this.context.stdout.write(` ${r.length} linkable \u2014 plexus-cli platform users relink-auth <email>
|
|
11466
11466
|
`),i.length>0&&this.context.stdout.write(` ${i.length} without any login account \u2014 plexus-cli platform users provision --tenant <slug> --email <email> --name <name>
|
|
11467
11467
|
`)}else this.context.stdout.write(`No unusable identities.
|
|
11468
|
-
`);return n.length>0?1:0}},GE=class extends cr{static{s(this,"UsersRelinkAuthCommand")}static paths=[["platform","users","relink-auth"],["users","relink-auth"]];static usage=T.Usage({category:"Users",description:"Relink a user's identity row to its live Better Auth account (heals an orphan)."});email=f.String({required:!0});async execute(){let n=await(await this.caller()).mutation(x.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 bV(e,t){if(e===t)throw new Error("Pass exactly one of --on or --off.");return e}s(bV,"requireOnOff");var vV=[RE,IE,OE,_E,NE,CE,PE,DE,FE,LE,ru,ME,qE,KE,jE,VE,BE,UE,GE];function xV(e){return e.de??e.en??Object.values(e)[0]??""}s(xV,"titleDe");function JZ(e){return{id:e._id,kind:e.kind,status:e.status,title:xV(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(JZ,"row");var QZ=["id","kind","status","title","assignee","group","outcome"],YE=class extends D{static{s(this,"WorkItemsListCommand")}static paths=[["work-items","list"]];static usage=T.Usage({category:"Work-Items",description:"List work-items for the active tenant (filter by --mine/--application/--group)."});mine=f.Boolean("--mine",!1,{description:"Only items assigned to me."});application=f.String("--application",{description:"Filter by application id."});group=f.String("--group",{description:"Filter by team (permission-group) id."});assignee=f.String("--assignee",{description:"Filter by assignee users._id."});openOnly=f.Boolean("--open-only",!1,{description:"Only open items."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(x.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(JZ),QZ),0}},HE=class extends D{static{s(this,"WorkItemsShowCommand")}static paths=[["work-items","show"]];static usage=T.Usage({category:"Work-Items",description:"Show one work-item by id."});workItemId=f.String({required:!0,name:"workItemId"});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(x.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:xV(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}},JE=class extends D{static{s(this,"WorkItemsCreateCommand")}static paths=[["work-items","create"]];static usage=T.Usage({category:"Work-Items",description:"Create a manual task work-item."});title=f.String("--title",{required:!0,description:"Task title."});description=f.String("--description",{description:"Task description."});application=f.String("--application",{description:"Link to an application id."});group=f.String("--group",{description:"Team (permission-group) id whose queue holds the task."});assignee=f.String("--assignee",{description:"Assignee users._id."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(x.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}},QE=class extends D{static{s(this,"WorkItemsCompleteCommand")}static paths=[["work-items","complete"]];static usage=T.Usage({category:"Work-Items",description:"Complete a work-item (optionally with an outcome)."});workItemId=f.String({required:!0,name:"workItemId"});outcome=f.String("--outcome",{description:"Outcome id to record."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(x.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}},ZE=class extends D{static{s(this,"WorkItemsAssignCommand")}static paths=[["work-items","assign"]];static usage=T.Usage({category:"Work-Items",description:"Assign a work-item to a user (omit --user to unassign)."});workItemId=f.String({required:!0,name:"workItemId"});user=f.String("--user",{description:"Assignee users._id (omit to clear)."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(x.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}},SV=[YE,HE,JE,QE,ZE];var iu=[...NR,...OP,...jP,...BD,...VD,...hF,...xF,...vF,...wV,...vV,...yV,...rj,...dj,...mP,...uF,...sV,...OR,...iI,...XC,...EF,...AF,...RF,...IF,...dF,...HD,...SV,...ZM,...jq,...tj,...Vq,...Bj,...Qj,...cj,...kj,...xj,...Tj,...Rj,...eV,...cV,...YR];for(let e of iu){let t=e.paths?.[0];t===void 0||!Object.hasOwn(e,"usage")||e.usage===void 0||(e.usage={...e.usage,category:XT(e.usage.category,t.join(" "))})}var AV="0.1.153";function EV(){return iu.flatMap(e=>(e.paths??[]).map(t=>{let n=t.join(" "),r=HT[so(n)];return{path:n,effect:ao(n),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,t)=>e.path.localeCompare(t.path))}s(EV,"plexusCommandCatalog");import rs from"node:path";function ZZ(e){let t=at()?.workspaceRoot??process.cwd(),n=rs.resolve(t,e),r=rs.relative(t,n);if(rs.isAbsolute(e)||r===".."||r.startsWith(`..${rs.sep}`))throw new Error("plexus: use a relative path inside the current workspace.");return{absolute:n,relative:r}}s(ZZ,"workspacePath");function XZ(e){let{absolute:t,relative:n}=ZZ(e.path??".");if(e.operation==="list"){if(!Ae(t))return{files:[]};let r=[],i=s(o=>{for(let a of Rr(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new Error("plexus: workspace symlinks are not supported.");let l=rs.join(o,a.name);if(a.isDirectory()?i(l):r.push(rs.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=he(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 Ge(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 Dt(rs.dirname(t),{recursive:!0}),Ge(t,e.content,"utf8"),{path:n,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return as(t),{path:n,removed:!0};throw new Error("plexus: unknown workspace operation.")}s(XZ,"plexusWorkspace");function TV(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=pl[n];if(!o||!Object.hasOwn(pl,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(Gg,i.path))throw new Error("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:Gg[i.path],skillHash:Zu}}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 XZ(i)},"executePlexusAgentTool")}s(TV,"createPlexusAgentToolExecutor");var Oh=TV({inspectCommand:RV,executeCommand:IV});function _h(){let e=new us({binaryLabel:"Plexus CLI",binaryName:"plexus-cli",binaryVersion:AV});e.register(Ja.HelpCommand),e.register(Ja.VersionCommand);for(let n of iu)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 n9(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(_h,"createPlexusCli");function n9(e,t){let n=e.path.join(" "),r=e.constructor.paths?.[0]?.join(" ");r!==void 0&&n!==r&&tl[n]===r&&ot(t,n,r),n in tl&&ao(n)==="confirm"&&!nl(e)&&t.write(`plexus-cli: \`${tl[n]}\` only prints its plan without --confirm \u2014 nothing was changed.
|
|
11468
|
+
`);return n.length>0?1:0}},GE=class extends cr{static{s(this,"UsersRelinkAuthCommand")}static paths=[["platform","users","relink-auth"],["users","relink-auth"]];static usage=T.Usage({category:"Users",description:"Relink a user's identity row to its live Better Auth account (heals an orphan)."});email=f.String({required:!0});async execute(){let n=await(await this.caller()).mutation(x.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 bV(e,t){if(e===t)throw new Error("Pass exactly one of --on or --off.");return e}s(bV,"requireOnOff");var vV=[RE,IE,OE,_E,NE,CE,PE,DE,FE,LE,ru,ME,qE,KE,jE,VE,BE,UE,GE];function xV(e){return e.de??e.en??Object.values(e)[0]??""}s(xV,"titleDe");function JZ(e){return{id:e._id,kind:e.kind,status:e.status,title:xV(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(JZ,"row");var QZ=["id","kind","status","title","assignee","group","outcome"],YE=class extends D{static{s(this,"WorkItemsListCommand")}static paths=[["work-items","list"]];static usage=T.Usage({category:"Work-Items",description:"List work-items for the active tenant (filter by --mine/--application/--group)."});mine=f.Boolean("--mine",!1,{description:"Only items assigned to me."});application=f.String("--application",{description:"Filter by application id."});group=f.String("--group",{description:"Filter by team (permission-group) id."});assignee=f.String("--assignee",{description:"Filter by assignee users._id."});openOnly=f.Boolean("--open-only",!1,{description:"Only open items."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(x.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(JZ),QZ),0}},HE=class extends D{static{s(this,"WorkItemsShowCommand")}static paths=[["work-items","show"]];static usage=T.Usage({category:"Work-Items",description:"Show one work-item by id."});workItemId=f.String({required:!0,name:"workItemId"});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.query(x.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:xV(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}},JE=class extends D{static{s(this,"WorkItemsCreateCommand")}static paths=[["work-items","create"]];static usage=T.Usage({category:"Work-Items",description:"Create a manual task work-item."});title=f.String("--title",{required:!0,description:"Task title."});description=f.String("--description",{description:"Task description."});application=f.String("--application",{description:"Link to an application id."});group=f.String("--group",{description:"Team (permission-group) id whose queue holds the task."});assignee=f.String("--assignee",{description:"Assignee users._id."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(x.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}},QE=class extends D{static{s(this,"WorkItemsCompleteCommand")}static paths=[["work-items","complete"]];static usage=T.Usage({category:"Work-Items",description:"Complete a work-item (optionally with an outcome)."});workItemId=f.String({required:!0,name:"workItemId"});outcome=f.String("--outcome",{description:"Outcome id to record."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(x.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}},ZE=class extends D{static{s(this,"WorkItemsAssignCommand")}static paths=[["work-items","assign"]];static usage=T.Usage({category:"Work-Items",description:"Assign a work-item to a user (omit --user to unassign)."});workItemId=f.String({required:!0,name:"workItemId"});user=f.String("--user",{description:"Assignee users._id (omit to clear)."});async execute(){let t=await this.caller(),n=this.requireTenant(t),r=await t.mutation(x.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}},SV=[YE,HE,JE,QE,ZE];var iu=[...NR,...OP,...jP,...BD,...VD,...hF,...xF,...vF,...wV,...vV,...yV,...rj,...dj,...mP,...uF,...sV,...OR,...iI,...XC,...EF,...AF,...RF,...IF,...dF,...HD,...SV,...ZM,...jq,...tj,...Vq,...Bj,...Qj,...cj,...kj,...xj,...Tj,...Rj,...eV,...cV,...YR];for(let e of iu){let t=e.paths?.[0];t===void 0||!Object.hasOwn(e,"usage")||e.usage===void 0||(e.usage={...e.usage,category:XT(e.usage.category,t.join(" "))})}var AV="0.1.154";function EV(){return iu.flatMap(e=>(e.paths??[]).map(t=>{let n=t.join(" "),r=HT[so(n)];return{path:n,effect:ao(n),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,t)=>e.path.localeCompare(t.path))}s(EV,"plexusCommandCatalog");import rs from"node:path";function ZZ(e){let t=at()?.workspaceRoot??process.cwd(),n=rs.resolve(t,e),r=rs.relative(t,n);if(rs.isAbsolute(e)||r===".."||r.startsWith(`..${rs.sep}`))throw new Error("plexus: use a relative path inside the current workspace.");return{absolute:n,relative:r}}s(ZZ,"workspacePath");function XZ(e){let{absolute:t,relative:n}=ZZ(e.path??".");if(e.operation==="list"){if(!Ae(t))return{files:[]};let r=[],i=s(o=>{for(let a of Rr(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new Error("plexus: workspace symlinks are not supported.");let l=rs.join(o,a.name);if(a.isDirectory()?i(l):r.push(rs.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=he(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 Ge(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 Dt(rs.dirname(t),{recursive:!0}),Ge(t,e.content,"utf8"),{path:n,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return as(t),{path:n,removed:!0};throw new Error("plexus: unknown workspace operation.")}s(XZ,"plexusWorkspace");function TV(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=pl[n];if(!o||!Object.hasOwn(pl,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(Gg,i.path))throw new Error("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:Gg[i.path],skillHash:Zu}}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 XZ(i)},"executePlexusAgentTool")}s(TV,"createPlexusAgentToolExecutor");var Oh=TV({inspectCommand:RV,executeCommand:IV});function _h(){let e=new us({binaryLabel:"Plexus CLI",binaryName:"plexus-cli",binaryVersion:AV});e.register(Ja.HelpCommand),e.register(Ja.VersionCommand);for(let n of iu)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 n9(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(_h,"createPlexusCli");function n9(e,t){let n=e.path.join(" "),r=e.constructor.paths?.[0]?.join(" ");r!==void 0&&n!==r&&tl[n]===r&&ot(t,n,r),n in tl&&ao(n)==="confirm"&&!nl(e)&&t.write(`plexus-cli: \`${tl[n]}\` only prints its plan without --confirm \u2014 nothing was changed.
|
|
11469
11469
|
`)}s(n9,"noteRetiredPath");function RV(e){let t=_h().process(ja(e),{executePlexusAgentTool:Oh}),n=t.path.join(" ");if(n.startsWith("agent "))throw new Error("plexus: nested agent transports are not allowed.");let r=EV().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"?tm(ba(va),i.fn??"",i.kind):void 0,a=qu(n,{confirm:nl(t),callKind:o});return{...r,writes:a}}s(RV,"inspectPlexusCommand");async function IV(e,t){if(t)return tT(t,()=>IV(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=_h();if(at()){let l=RV(e.argv);if(l.host==="terminal")throw new Error(`plexus: this command requires a local machine. ${l.reason??""}`)}return{exitCode:await i.run(ja(e.argv),{executePlexusAgentTool:Oh,stdin:t9.from(e.stdin===void 0?[]:[e.stdin]),stdout:new $V({write(l,d,c){n+=String(l),c()}}),stderr:new $V({write(l,d,c){r+=String(l),c()}})}),stdout:n,stderr:r}}s(IV,"executePlexusCommand");sT({source:r9.join(import.meta.dirname,"skill")});_h().runExit(ja(process.argv.slice(2)),{executePlexusAgentTool:Oh});
|
|
11470
11470
|
//# sourceMappingURL=cli.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
26484e652d6f9b954e37b1bd4682f6f911e8beedbfb53d42b859e32cb6c25166
|
|
@@ -6,7 +6,7 @@ a branch (`if` node) and may decide what a contract prints, so it can be correct
|
|
|
6
6
|
**until the first step that reads it has been reached**. After that the step has already
|
|
7
7
|
decided, charged or printed with the old value: discard the application and start it again.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
The cockpit offers no entry for this correction at the moment; this command is the way.
|
|
10
10
|
|
|
11
11
|
## Prerequisites
|
|
12
12
|
- The permission to manage applications on the tenant (the same one „+ Bewerbung" needs).
|