@smartkomm/plexus-cli 0.1.287 → 0.1.288
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
|
@@ -6029,6 +6029,9 @@ apply\` imports them.
|
|
|
6029
6029
|
- Parties: a debtor owes a share (\`several\` or \`joint_and_several\`), the debtors'
|
|
6030
6030
|
shares total 100; the beneficiary owes none. Allocations total 100 per scope
|
|
6031
6031
|
(the contract, or one line). Amounts are euros with at most two decimals.
|
|
6032
|
+
- A mandate's account holder who is not a contract partner is a party with
|
|
6033
|
+
\`role: "accountHolder"\`: owns the payment method, owes nothing, signs nothing,
|
|
6034
|
+
receives no invoice, and is not written as a contract party.
|
|
6032
6035
|
|
|
6033
6036
|
## Steps
|
|
6034
6037
|
|
|
@@ -11338,7 +11341,7 @@ plexus-cli --env prod jobs list --status running # nothing unexpectedly in
|
|
|
11338
11341
|
## Related
|
|
11339
11342
|
- Command reference: \`plexus-cli jobs list --help\`, \`plexus-cli platform workers reap --help\`,
|
|
11340
11343
|
\`plexus-cli platform imports cleanup-orphaned --help\`.
|
|
11341
|
-
`};var Xf="1f4413ee845feb635bd8de186d7b139bd025b5c7e911d986ff0998aee2d06450",iw=hO;var ow=class extends xe{static{s(this,"AgentToolsCommand")}static paths=[["agent","tools"]];static usage=R.Usage({category:"Agents",description:"Show the shared platform/CLI agent tool schemas and skill revision."});async execute(){return this.print({skillHash:Xf,tools:Bl}),0}},sw=class extends xe{static{s(this,"AgentInvokeCommand")}static paths=[["agent","invoke"]];static usage=R.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 n=JSON.parse(await rw(this.context.stdin)),t=await this.context.executePlexusAgentTool(this.tool,n);return this.print(t),0}},gO=[ow,sw];var aw=[{key:"fixture_test",email:"test@example.com",firstName:"Test",lastName:"Bewerber"}],hue=new Set(aw.map(e=>e.key));var Be=["de","en"];function zs(e,n){return Be.every(t=>e[t]===n[t])}s(zs,"sameText");function Dn(e){if(e===null||typeof e!="object"||Array.isArray(e))return"not-localized";let n=e;return Object.keys(n).some(r=>!Be.includes(r))?"not-localized":Be.filter(r=>{let i=n[r];return typeof i!="string"||i.trim()===""})}s(Dn,"missingLocales");function zi(e){let n=Dn(e);return n!=="not-localized"&&n.length===0}s(zi,"isLocalizedText");function Ul(e,n){let t={};for(let r of Be){let i=e.map(o=>o[r]);t[r]=i.every(o=>typeof o=="string"&&o.trim()!=="")?n(i,r):""}return t}s(Ul,"composeTexts");function ep(e){return e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}s(ep,"slugify");var yO="tenant";function wO(e){if(e.length===0||ep(e)!==e)return"must be lowercase a-z/0-9 words joined by single dashes";if(e===yO)return`"${yO}" is reserved for the tenant-wide scope`}s(wO,"unitSlugError");var W1=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function nr(e,n){return`${e}-${n}`}s(nr,"runStorageKey");function kO(e,n){typeof n!="string"&&ae("CONFLICT",{de:`[run/keyNotServed] Das Deployment liefert f\xFCr ein Schuljahr von \u201E${e}\u201C keinen Schl\xFCssel \u2014 es l\xE4uft ein \xE4lteres Release als die CLI. Nach dem n\xE4chsten Release erneut versuchen.`,en:`[run/keyNotServed] The deployment provides no key for a school year of "${e}" \u2014 it runs an older release than the CLI. Try again after the next release.`});let t=`${e}-`;return(!n.startsWith(t)||n.length===t.length)&&ae("CONFLICT",{de:`[run/foreignKey] Der Schl\xFCssel \u201E${n}\u201C des Schuljahrs liegt nicht unter dem Programm \u201E${e}\u201C (erwartet: \u201E${t}<key>\u201C).`,en:`[run/foreignKey] The key "${n}" of the school year is not under the program "${e}" (expected: "${t}<key>").`}),n.slice(t.length)}s(kO,"bareRunKey");function np(e){let n=[],t=new Map;return e.forEach((r,i)=>{let o=Dn(r.name),a=o!=="not-localized"&&!o.includes("de")?r.name.de:void 0,l=`program.runs[${i}]${a!==void 0?` ("${a}")`:""}`;o==="not-localized"||o.length===2?n.push({code:"run/nameMissing",index:i,message:{de:`[run/nameMissing] ${l}: jedes Schuljahr braucht einen \`name\` auf Deutsch und Englisch (\`{ de, en }\`)`,en:`[run/nameMissing] ${l}: every run needs a \`name\` in German and English (\`{ de, en }\`)`}}):o.length>0&&n.push({code:"run/nameUntranslated",index:i,message:{de:`[i18n/missingTranslation] ${l}.name fehlt in: ${o.join(", ")} \u2014 jeder angezeigte Text braucht Deutsch und Englisch.`,en:`[i18n/missingTranslation] ${l}.name is missing in: ${o.join(", ")} \u2014 every displayed text needs German and English.`}});let d=r.key;if(d==null||d===""){n.push({code:"run/keyMissing",index:i,message:{de:`[run/keyMissing] ${l}: jedes Schuljahr braucht einen stabilen \`key\` \u2014 der Name dient nur der Anzeige`,en:`[run/keyMissing] ${l}: every run needs a stable \`key\` \u2014 the name is display only`}});return}if(typeof d!="string"||!W1.test(d)){n.push({code:"run/keyInvalid",index:i,message:{de:`[run/keyInvalid] ${l}: der Schl\xFCssel ${JSON.stringify(d)} muss ein kleingeschriebener Slug sein (a-z, 0-9, einzelnes \u201E-\u201C)`,en:`[run/keyInvalid] ${l}: key ${JSON.stringify(d)} must be a lowercase slug string (a-z, 0-9, single "-")`}});return}let c=t.get(d);if(c!==void 0){n.push({code:"run/duplicateKey",index:i,message:{de:`[run/duplicateKey] ${l}: der Schl\xFCssel \u201E${d}\u201C wird bereits von program.runs[${c}] verwendet`,en:`[run/duplicateKey] ${l}: key "${d}" is already used by program.runs[${c}]`}});return}t.set(d,i)}),n}s(np,"runSpecIssues");var Y1="-stufe-",H1=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function lw(e){return`${e}${Y1}`}s(lw,"stageKeyPrefix");function Ws(e,n){return`${lw(e)}${n}`}s(Ws,"stageStorageKey");function vO(e,n){let t=lw(e);return n.startsWith(t)&&n.length>t.length}s(vO,"isUnderProgram");function Jr(e,n){let t=lw(e);return vO(e,n)||ae("CONFLICT",{de:`[stage/foreignKey] Der Stufenschl\xFCssel \u201E${n}\u201C liegt nicht unter dem Programm \u201E${e}\u201C (erwartet: \u201E${t}<key>\u201C). F\xFChren Sie die Stufe in bundle.yaml unter einem neuen Schl\xFCssel auf; der n\xE4chste Apply archiviert diese Zeile (hinter der Archivsperre) und legt die Stufe mit dem neuen Schl\xFCssel an.`,en:`[stage/foreignKey] The level key "${n}" is not under the program "${e}" (expected: "${t}<key>"). List the level in bundle.yaml under a new key; the next apply archives this row (behind the archive lock) and creates the level with the new key.`}),n.slice(t.length)}s(Jr,"bareStageKey");function tp(e){let n=[],t=new Map;return e.forEach((r,i)=>{let o=Dn(r.name),a=o!=="not-localized"&&!o.includes("de")?r.name.de:void 0,l=`program.stages[${i}]${a!==void 0?` ("${a}")`:""}`;o==="not-localized"||o.length===2?n.push({code:"stage/nameMissing",index:i,message:{de:`[stage/nameMissing] ${l}: jede Klassenstufe braucht einen \`name\` auf Deutsch und Englisch (\`{ de, en }\`)`,en:`[stage/nameMissing] ${l}: every stage needs a \`name\` in German and English (\`{ de, en }\`)`}}):o.length>0&&n.push({code:"stage/nameUntranslated",index:i,message:{de:`[i18n/missingTranslation] ${l}.name fehlt in: ${o.join(", ")} \u2014 jeder angezeigte Text braucht Deutsch und Englisch.`,en:`[i18n/missingTranslation] ${l}.name is missing in: ${o.join(", ")} \u2014 every displayed text needs German and English.`}});let d=r.key;if(d==null||d===""){n.push({code:"stage/keyMissing",index:i,message:{de:`[stage/keyMissing] ${l}: jede Klassenstufe braucht einen stabilen \`key\` \u2014 der Name dient nur der Anzeige`,en:`[stage/keyMissing] ${l}: every stage needs a stable \`key\` \u2014 the name is display only`}});return}if(typeof d!="string"||!H1.test(d)){n.push({code:"stage/keyInvalid",index:i,message:{de:`[stage/keyInvalid] ${l}: der Schl\xFCssel ${JSON.stringify(d)} muss ein kleingeschriebener Slug sein (a-z, 0-9, einzelnes \u201E-\u201C)`,en:`[stage/keyInvalid] ${l}: key ${JSON.stringify(d)} must be a lowercase slug string (a-z, 0-9, single "-")`}});return}let c=t.get(d);if(c!==void 0){n.push({code:"stage/duplicateKey",index:i,message:{de:`[stage/duplicateKey] ${l}: der Schl\xFCssel \u201E${d}\u201C wird bereits von program.stages[${c}] verwendet`,en:`[stage/duplicateKey] ${l}: key "${d}" is already used by program.stages[${c}]`}});return}t.set(d,i)}),n}s(tp,"stageSpecIssues");function bO(e){return{de:e.de.trim(),en:e.en.trim()}}s(bO,"trimmedText");function J1(e,n){let t=[];return e.de!==n.de&&t.push(`"${e.de}" \u2192 "${n.de}"`),e.en!==n.en&&t.push(`en "${e.en}" \u2192 "${n.en}"`),t.join(", ")}s(J1,"describeNameChange");function rp(e,n,t){if(e===null)return n.length>0&&F("planStageReconcile: stages exist but the offer has no program key"),t.map((a,l)=>({op:"insert",key:a.key,name:bO(a.name),...a.gradeLevel!==void 0?{gradeLevel:a.gradeLevel}:{},sequence:l+1}));let r=new Map(n.map(a=>[a.key,a])),i=new Set,o=[];t.forEach(({name:a,...l},d)=>{let c={...l,name:bO(a)},u=Ws(e,c.key);i.add(u);let p=d+1,h=r.get(u);if(h===void 0){o.push({op:"insert",key:c.key,name:c.name,...c.gradeLevel!==void 0?{gradeLevel:c.gradeLevel}:{},sequence:p});return}let y={};zs(h.name,c.name)||(y.name=[h.name,c.name]);let k=h.gradeLevel??null,w=c.gradeLevel??null;k!==w&&(y.gradeLevel=[k,w]),h.sequence!==p&&(y.sequence=[h.sequence,p]),(Object.keys(y).length>0||h.archived)&&o.push({op:"update",key:c.key,stageId:h.stageId,name:c.name,changes:y,unarchive:h.archived})});for(let a of[...n].sort((l,d)=>l.sequence-d.sequence))a.archived||i.has(a.key)||o.push({op:"archive",key:vO(e,a.key)?Jr(e,a.key):a.key,stageId:a.stageId,name:a.name});return o}s(rp,"planStageReconcile");function ip(e){switch(e.op){case"insert":return`+stage ${e.key} (${e.name.de})`;case"archive":{let n=e.occupancy,t=[...n&&n.activeApplications>0?[`REFUSED: ${n.activeApplications} active application(s) \u2014 [stage/hasActiveApplications]`]:[],...n&&n.openLeads>0?[`${n.openLeads} open lead(s)`]:[]];return`-stage ${e.key} (${e.name.de})${t.length>0?` \u2014 ${t.join("; ")}`:""}`}case"update":{let n=[];if(e.unarchive&&n.push("restored"),e.changes.name&&n.push(J1(e.changes.name[0],e.changes.name[1])),e.changes.gradeLevel){let[t,r]=e.changes.gradeLevel;n.push(`grade ${t??"\u2013"} \u2192 ${r??"\u2013"}`)}return e.changes.sequence&&n.push(`position ${e.changes.sequence[0]} \u2192 ${e.changes.sequence[1]}`),`~stage ${e.key} (${n.join(", ")})`}}}s(ip,"describeStageStep");function op(e,n){return n.startsWith(e)&&n.length>e.length?n.slice(e.length):void 0}s(op,"bareUnder");function SO(e,n,t,r){let i=e.flatMap(y=>y.angebote).find(y=>y.offerKey===n);if(i===void 0){let y=e.flatMap(k=>k.angebote.map(w=>w.offerKey));throw new je(`applications start-test: no offer "${n}" (offers: ${y.join(", ")||"none"})`)}if(i.programKey===void 0)throw new je("applications start-test: the deployment does not serve the offer's program key \u2014 it runs an older release than the CLI; try again after the next release");let o=i.programKey;if(o===null)throw new je(`applications start-test: ${n} has no program yet \u2014 no level to start on`);let a=Ws(o,""),l=nr(o,""),d=s(y=>op(a,y)??"(no bundle key)","stageLabel"),c=s(y=>op(l,y)??"(no bundle key)","runLabel"),u=i.stages.find(y=>y.stageKey===Ws(o,r)||y.stageId===r);if(u===void 0){let y=i.stages.map(b=>`${d(b.stageKey)} (${b.stageId})`).join(", "),k=op(a,r),w=k!==void 0&&i.stages.some(b=>b.stageKey===r)?` \u2014 "${r}" is the stored key; the export names it "${k}"`:"";throw new je(`applications start-test: no level "${r}" in ${n}${w} \u2014 name it by its bundle key or id: ${y}`)}let p=d(u.stageKey),h=u.runs.find(y=>y.runKey===nr(o,t)||y.runId===t);if(h===void 0){let y=u.runs.map(b=>`${c(b.runKey)} (${b.runId})`).join(", "),k=op(l,t),w=k!==void 0&&u.runs.some(b=>b.runKey===t)?` \u2014 "${t}" is the stored key; the export names it "${k}"`:"";throw new je(`applications start-test: no school year "${t}" for level ${p}${w} \u2014 name it by its bundle key or id: ${y}`)}if(!h.isOpen)throw new je(`applications start-test: school year ${c(h.runKey)} is closed for level ${p}`);return{programRunId:h.runId,programStageId:u.stageId}}s(SO,"resolveStartTarget");function Q1(e){return e.kind==="named"?e.name:`(${e.standIn??e.fallback})`}s(Q1,"applicantText");function AO(e){return e.map(n=>({id:n.application._id,status:n.deletedAt?`${n.application.status} (gel\xF6scht)`:n.application.status,state:n.currentProcessStateId??"",applicant:Q1(n.applicantName),test:n.application.testMode===!0?"test":""}))}s(AO,"applicationRows");var xO=aw.map(e=>e.email);function EO(e,n,t,r){if(t===void 0&&r===void 0)throw new je("applications start-test: name the applicant \u2014 --party <partyId> or --applicant <email>");if(t!==void 0&&r!==void 0)throw new je("applications start-test: --party or --applicant, not both");if(ew(e,n)&&(r===void 0||!xO.includes(r.trim().toLowerCase())))throw new je(`applications start-test: on prod only for the test account ${xO.join(", ")} (--applicant) \u2014 never a real family's`)}s(EO,"assertStartApplicant");function TO(e){let n={};for(let{address:t,...r}of e.entries)n[t]=r;return{applicationId:e.applicationId,store:n}}s(TO,"processStoreJson");function Z1(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(n=>`${n.partKey}: contract ${n.contractId} \xB7 ${n.revision===null?"keine Fassung":`Fassung ${n.revision.snapshotNumber}`} \xB7 ${n.contractStatus}`).join("; ")}}s(Z1,"refText");function X1(e){return e.state!=="present"?e.reason?.de??"":e.ref!==void 0?Z1(e.ref):JSON.stringify(e.value)}s(X1,"holds");function RO(e){return e.entries.map(n=>({address:n.address,state:n.state,holds:X1(n),producer:n.producer?.label??"",written:n.writtenAt===void 0?"":new Date(n.writtenAt).toISOString()}))}s(RO,"storeRows");function sp(e){let n={},t={};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(t,o))throw new Error(`'${o}' is given twice.`);let a=r.slice(i+1);t[o]=a;try{n[o]=JSON.parse(a)}catch{n[o]=a}}return{values:n,raw:t}}s(sp,"parseKv");var $O="started",ap="submitted",lp="submitted",IO="load-scenario:";var OO="(Bewerbung)";function _O(e){return{nodeId:OO,actions:e.map(n=>({id:n.id,label:{de:`${n.label??n.id}${n.count===void 0?"":` (${n.count})`}`,en:`${n.label??n.id}${n.count===void 0?"":` (${n.count})`}`},...n.disabledReason===void 0?{}:{disabledReason:n.disabledReason}}))}}s(_O,"sharedAsList");function PO(e){return e.disabledReason===void 0?"":e.disabledCount===void 0?e.disabledReason:`${e.disabledReason} (${e.disabledCount})`}s(PO,"disabledText");function NO(e){return e.flatMap(({nodeId:n,actions:t})=>t.map(r=>({node:n,action:r.id,label:r.label.de,disabled:PO(r)})))}s(NO,"actionRows");function CO(e,n,t=[]){let r=e.filter(({actions:d})=>d.some(c=>c.id===n));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 "${n}" (offered: ${d.join(", ")||"nothing"})`)}if(r.length>1)throw new Error(`test-actions run: "${n}" 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===n);if(a.disabledReason!==void 0)throw new Error(`test-actions run: "${n}" on ${i} is disabled: ${PO(a)}`);if(i!==OO)return i;let l=t[0];if(l===void 0)throw new Error(`test-actions run: "${n}" needs a current node \u2014 the application has none`);return l}s(CO,"nodeOfferingAction");function DO(e,n,t){if(e.startsWith(IO)){if(Object.hasOwn(t,"autoSubmit"))throw new Error(`test-actions run: ${e}: a scenario's autoSubmit is set by --auto-submit / --no-auto-submit, not --param`);return{autoSubmit:n,...t}}return Object.keys(t).length===0?void 0:{...t}}s(DO,"runParams");async function e2(e,n){let t=await e.query(x.workflow.getInstance,{applicationId:n});if(t===null)throw new Error(`test-actions: application ${n} has no workflow instance`);return t.instance.currentNodeIds}s(e2,"currentNodeIds");function n2(e,n){switch(n){case"notTestApplication":return`${e} is not a test application`;case"completed":case"aborted":case"deleted":return`${e} is ${n} \u2014 test actions run only on an active application`;case"missingPermission":return"the caller lacks bewerbungsmanagement.testActions.run"}}s(n2,"refusalText");async function dp(e,n,t){let r=await e.query(x.workflow.listSharedTestActions,{applicationId:n});if(!r.permitted)throw new Error(`test-actions: not permitted \u2014 ${n2(n,r.reason)}`);let i=[];for(let o of t){let a=await e.query(x.workflow.listTestActions,{applicationId:n,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,_O(r.actions)]}s(dp,"actionsOf");async function FO(e,n,t){return t!==void 0?[t]:await e2(e,n)}s(FO,"nodesOf");var dw=class extends N{static{s(this,"TestActionsListCommand")}static paths=[["test-actions","list"]];static usage=R.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 n=await this.caller(),t=await dp(n,this.application,await FO(n,this.application,this.node));return this.print(t,NO,["node","action","label","disabled"]),0}},cw=class extends N{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=R.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 n=DO(this.action,this.autoSubmit,sp(this.param??[]).values),t=await this.caller(),r=this.application,i=await FO(t,this.application,this.node),o=CO(await dp(t,r,i),this.action,i);return await t.mutation(x.workflow.runTestAction,{applicationId:r,nodeId:o,actionId:this.action,...n===void 0?{}:{params:n}}),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}},LO=[dw,cw];var Ar=/^[a-z][A-Za-z0-9]*$/;function uw(e){return typeof e=="string"&&Ar.test(e)}s(uw,"isNodeId");function Ys(e,n){uw(e)||F(`[graph/nodeIdFormat] "${e}" cannot name a node: a node id is ${Ar.source}.`);let t=new Set(n);if(!t.has(e))return e;let r=2;for(;t.has(`${e}${r}`);)r++;return`${e}${r}`}s(Ys,"makeNodeId");var Yi="$env";function de(e){if(e.scope==="env")return`${Yi}.${e.key}`;let n=`$${e.scope}.${e.owner}.${e.key}`;return e.path===void 0?n:`${n}.${e.path}`}s(de,"formatAddress");var Wi=/^[a-z][a-zA-Z0-9_]*$/,t2=/^[A-Za-z_][A-Za-z0-9_]*$/;function Do(e){return typeof e=="string"&&e.split(".").every(n=>t2.test(n))}s(Do,"isPath");function fi(e){if(!e.startsWith("$"))return null;let n=e.slice(1).split("."),[t,...r]=n;switch(t){case"env":{let i=r.join(".");return r.length>0&&Do(i)?{scope:"env",key:i}:null}case"node":case"task":{let[i,o,...a]=r;return i===void 0||o===void 0||!Wi.test(o)||(t==="node"?!Ar.test(i):!Wi.test(i))?null:r2({scope:t,owner:i,key:o},a)}default:return null}}s(fi,"tryParseAddress");function r2(e,n){if(n.length===0)return e;let t=n.join(".");return Do(t)?{...e,path:t}:null}s(r2,"withPath");function we(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=e,t=n.scope==="env"?["scope","key"]:["scope","owner","key","path"];if(Object.keys(n).some(r=>!t.includes(r))||n.path!==void 0&&!Do(n.path))return!1;switch(n.scope){case"env":return Do(n.key);case"node":return typeof n.owner=="string"&&Ar.test(n.owner)&&typeof n.key=="string"&&Wi.test(n.key);case"task":return typeof n.owner=="string"&&Wi.test(n.owner)&&typeof n.key=="string"&&Wi.test(n.key);default:return!1}}s(we,"isAddress");var Hi={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"}},Hs=Object.keys(Hi);function Ji(e){return Object.hasOwn(Hi,e)}s(Ji,"isEnvKey");var fw=["self-service","staff"];function MO(e,n){return{kind:"fixed",values:e,labels:n}}s(MO,"fixedSet");var cp={of:"applicant.language",withoutValue:"de"},pi={"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:cp},"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:cp},"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:cp},"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:cp},"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:MO(Be,{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:MO(fw,{staff:{de:"intern",en:"in-house"},"self-service":{de:"online (Familie)",en:"online (family)"}}),nullable:!1,label:{de:"Eingangsweg",en:"Intake channel"}}},up={types:Hi,fields:pi},fp=Hs.flatMap(e=>Object.keys(Hi[e]).map(n=>`${e}.${n}`));function tr(e){return Object.hasOwn(pi,e)}s(tr,"isEnvLeaf");function pp(e){return`${Yi}.${e}`}s(pp,"envIdentifier");function Fo(e){let n=pi[e],[t,r]=e.split("."),i=Hi[t][r];i===void 0&&F(`[env] leaf "${e}" has no type`);let o=n.valueSet;return{leaf:e,type:i,label:n.label,nullable:n.nullable,...n.absent===void 0?{}:{absent:n.absent},...n.nameLanguage===void 0?{}:{nameLanguage:n.nameLanguage},...n.cohortBound===void 0?{}:{cohortBound:n.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(Fo,"envLeaf");var qO="staffInput";var i2=["boolean"],Gl=/^[a-z][A-Za-z0-9]*$/;function mp(e){return e.staffInputs??[]}s(mp,"staffInputsOf");function hp(e){return`${qO}.${e}`}s(hp,"staffInputLeaf");function KO(e){return`${Yi}.${hp(e)}`}s(KO,"staffInputIdentifier");function o2(e){let n=`${qO}.`;return e.startsWith(n)?e.slice(n.length):null}s(o2,"staffInputKeyOfLeaf");function Js(e,n){let t=o2(n);return t===null?void 0:mp(e).find(r=>r.key===t)}s(Js,"declaredStaffInput");function jO(e){return[...mp(e).map(n=>({leaf:hp(n.key),type:n.type,label:n.label,valueSet:{kind:"open"},nullable:!1,cohortBound:!1})),...fp.map(n=>{let t=Fo(n);return{leaf:n,type:t.type,label:t.label,valueSet:pi[n].valueSet,nullable:t.nullable,cohortBound:t.cohortBound===!0}})]}s(jO,"envLeavesFor");function VO(e){return jO(e).filter(n=>!n.cohortBound)}s(VO,"conditionEnvLeaves");function BO(e){return GO(VO(e))}s(BO,"envConditionSchemaFor");function s2(e){return jO(e).map(n=>n.leaf==="stage.key"?{...n,valueSet:{kind:"open"}}:n)}s(s2,"offerConditionEnvLeaves");function UO(e){return GO(s2(e))}s(UO,"offerConditionSchemaFor");function GO(e){let n={},t={};for(let{leaf:r,type:i,valueSet:o,nullable:a}of e){let[l="",d=""]=r.split(".");n[l]={...n[l]??{},[d]:i},t[r]={valueSet:o,nullable:a}}return{types:n,fields:t}}s(GO,"schemaOfLeaves");function zO(e){let n=e.staffInputs;if(n===void 0)return[];if(!Array.isArray(n))return[{path:"staffInputs",reason:{de:"[staffInput/shape] graph.staffInputs muss eine Liste sein.",en:"[staffInput/shape] graph.staffInputs must be a list."}}];let t=[],r=new Set;return n.forEach((i,o)=>{let a=`staffInputs[${o}]`,l=i;if(l===null||typeof l!="object"||typeof l.key!="string"){t.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}"`};Gl.test(l.key)||t.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)&&t.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),i2.includes(l.type)||t.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=Dn(l.label);c==="not-localized"?t.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&&t.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(", ")}.`}})}),t}s(zO,"staffInputIssues");var Sw={required:!0,description:"Offer slug (its offerKey)"},pw=class extends N{static{s(this,"ApplicationsListCommand")}static paths=[["applications","list"]];static usage=R.Usage({category:"Admission",description:"List an offer's applications (id, status, board state, applicant, test)"});offer=f.String("--offer",Sw);testOnly=f.Boolean("--test-only",!1,{description:"Only test applications"});async execute(){let n=await this.caller(),t=await n.query(x.admission.listForAngebot,{client:this.requireTenant(n),offerKey:this.offer}),r=AO(t).filter(i=>!this.testOnly||i.test==="test");return this.print(r,i=>i,["id","status","state","applicant","test"]),0}},mw=class extends N{static{s(this,"ApplicationsCountsCommand")}static paths=[["applications","counts"]];static usage=R.Usage({category:"Admission",description:"Count an offer's applications per list"});offer=f.String("--offer",Sw);async execute(){let n=await this.caller(),t=await n.query(x.admission.getCountsByListForAngebot,{client:this.requireTenant(n),offerKey:this.offer});return this.print(t,r=>[...Object.entries(r.counts).map(([i,o])=>({list:i,count:String(o)})),{list:"total",count:String(r.total)}],["list","count"]),0}},hw=class extends N{static{s(this,"ApplicationsShowCommand")}static paths=[["applications","show"]];static usage=R.Usage({category:"Admission",description:"One application: status, test flag, offer, current workflow nodes"});application=f.String({required:!0});async execute(){let n=await this.caller(),t=this.application,r=await n.query(x.admission.get,{applicationId:t});if(r===null)throw new je(`applications show: no application ${t} (or not visible to you)`);let i=await n.query(x.workflow.getInstance,{applicationId:t});return this.print({application:r,currentNodes:i?.instance.currentNodeIds??[]},o=>[{key:"id",value:t},{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}},gw=class extends N{static{s(this,"ApplicationsStoreCommand")}static paths=[["applications","store"]];static usage=R.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 t=await(await this.caller()).query(x.processStoreView.get,{applicationId:this.application});return this.print(TO(t),()=>RO(t),["address","state","holds","producer","written"]),0}},yw=class extends N{static{s(this,"ApplicationsStartTestCommand")}static paths=[["applications","start-test"]];static usage=R.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",Sw);run=f.String("--run",{required:!0,description:"School year: its bundle key as offer export shows it (program.runs[].key) or id \u2014 never its name"});stage=f.String("--stage",{required:!0,description:"Level: its bundle key as offer export shows it (program.stages[].key) or id \u2014 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 n=await this.caller();EO(this.resolvedTarget(),this.prodUrls(),this.party,this.applicant);let t=this.requireTenant(n),r=SO(await n.query(x.admission.listAdmissionTree,{client:t}),this.offer,this.run,this.stage),i=this.party;if(this.applicant!==void 0){let d=await n.query(x.applicants.partyByEmail,{client:t,email:this.applicant});if(d===null)throw new je(`applications start-test: no applicant account ${this.applicant} at this school (create it in the cockpit first)`);i=d}let o=await n.mutation(x.admission.staffStartApplicationForParty,{client:t,offerKey:this.offer,partyId:i,programRunId:r.programRunId,programStageId:r.programStageId,...this.proxy===void 0?{}:{startInProxy:this.proxy},staffInputs:YO(this.staffInput??[]),testMode:!0,...this.version===void 0?{}:{offerVersionId:this.version}}),a,l;try{let d=await n.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 dp(n,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}},ww=class extends N{static{s(this,"ApplicationsDiscardTestCommand")}static paths=[["applications","discard-test"]];static usage=R.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 je("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 je("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 je("applications discard-test: --all-test takes no application id");if(this.olderThan===void 0)throw new je("applications discard-test --all-test: --older-than <N>d is required");if(this.dryRun&&this.confirm)throw new je("applications discard-test: --dry-run and --confirm exclude each other");let n=a2(this.olderThan),t=await this.caller(),r=this.requireTenant(t),i=[],o=null;for(;;){let c=await t.query(x.admission.testTtlPlan,{client:r,olderThanDays:n,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 je(`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 t.mutation(x.admission.discardExpiredTest,{applicationId:c.applicationId,olderThanDays:n}),c.result="discarded"}catch(u){d++,c.result=`failed: ${u instanceof Error?u.message:String(u)}`}return this.print({olderThanDays:n,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 a2(e){let n=/^(\d+)d$/.exec(e.trim());if(n===null)throw new je(`--older-than "${e}": expected <N>d, e.g. 14d`);return Number(n[1])}s(a2,"parseDays");var kw=class extends N{static{s(this,"ApplicationsSetKeepDemoCommand")}static paths=[["applications","set-keep-demo"]];static usage=R.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},t=>[{key:"application",value:t.application},{key:"keep as demo",value:t.keepAsDemo?"ja":"nein"}]),0}},bw=class extends N{static{s(this,"ApplicationsStaffInputListCommand")}static paths=[["applications","staff-input","list"]];static usage=R.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 t=await(await this.caller()).query(x.admission.staffInputsOfApplication,{applicationId:this.application});return this.print(t,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}},vw=class extends N{static{s(this,"ApplicationsStaffInputSetCommand")}static paths=[["applications","staff-input","set"]];static usage=R.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 n=await this.caller(),[{key:t,value:r}]=YO([this.input]);return await n.mutation(x.admission.correctStaffInput,{applicationId:this.application,key:t,value:r,reason:this.reason}),this.print({application:this.application,key:t,value:r},i=>[{key:"application",value:i.application},{key:i.key,value:String(i.value)}]),0}},xw=class extends N{static{s(this,"ApplicationsPurgeCommand")}static paths=[["platform","applications","purge"]];static usage=R.Usage({category:"Admission",description:"Hard-delete one real application staff started for a colleague and already deleted (plan unless --confirm). Needs _platform.config.manage.",details:"Refused unless all hold: a real application (a test one goes with `applications discard-test`), soft-deleted by staff, started by staff, its applicant an internal staff member of the school (also a switched-off one) whose person existed before, no data about anyone else (only empty drafts the form opened), nothing committed yet, and no contract, signing process, payment or Engage push. Deletes the application and every row it created; the staff member's person stays. Afterwards the responsible person can be deactivated.",examples:[["Plan","plexus-cli --env prod --tenant <slug> platform applications purge <applicationId>"],["Apply","plexus-cli --env prod --tenant <slug> --allow-prod platform applications purge <applicationId> --confirm"]]});application=f.String({required:!0});confirm=f.Boolean("--confirm",!1,{description:"Delete for good (without it, only the checks run)."});async execute(){let n=await this.caller(),t=await n.mutation(x.admission.purgeDeletedStaffApplication,{tenantSlug:this.requireTenant(n),applicationId:this.application,dryRun:!this.confirm});if(this.json)return this.print(t),0;let r=this.context.stdout;return r.write(`${t.applied?"Deleted":"Would delete"} application ${t.applicationId} `),r.write(`(applicant ${t.applicantPartyId}, soft-deleted ${new Date(t.deletedAt).toISOString()})
|
|
11344
|
+
`};var Xf="14fe5a6a2b117fbcb9971928491ac2943177ce7dd6e685984a5219b483d219b1",iw=hO;var ow=class extends xe{static{s(this,"AgentToolsCommand")}static paths=[["agent","tools"]];static usage=R.Usage({category:"Agents",description:"Show the shared platform/CLI agent tool schemas and skill revision."});async execute(){return this.print({skillHash:Xf,tools:Bl}),0}},sw=class extends xe{static{s(this,"AgentInvokeCommand")}static paths=[["agent","invoke"]];static usage=R.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 n=JSON.parse(await rw(this.context.stdin)),t=await this.context.executePlexusAgentTool(this.tool,n);return this.print(t),0}},gO=[ow,sw];var aw=[{key:"fixture_test",email:"test@example.com",firstName:"Test",lastName:"Bewerber"}],hue=new Set(aw.map(e=>e.key));var Be=["de","en"];function zs(e,n){return Be.every(t=>e[t]===n[t])}s(zs,"sameText");function Dn(e){if(e===null||typeof e!="object"||Array.isArray(e))return"not-localized";let n=e;return Object.keys(n).some(r=>!Be.includes(r))?"not-localized":Be.filter(r=>{let i=n[r];return typeof i!="string"||i.trim()===""})}s(Dn,"missingLocales");function zi(e){let n=Dn(e);return n!=="not-localized"&&n.length===0}s(zi,"isLocalizedText");function Ul(e,n){let t={};for(let r of Be){let i=e.map(o=>o[r]);t[r]=i.every(o=>typeof o=="string"&&o.trim()!=="")?n(i,r):""}return t}s(Ul,"composeTexts");function ep(e){return e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}s(ep,"slugify");var yO="tenant";function wO(e){if(e.length===0||ep(e)!==e)return"must be lowercase a-z/0-9 words joined by single dashes";if(e===yO)return`"${yO}" is reserved for the tenant-wide scope`}s(wO,"unitSlugError");var W1=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function nr(e,n){return`${e}-${n}`}s(nr,"runStorageKey");function kO(e,n){typeof n!="string"&&ae("CONFLICT",{de:`[run/keyNotServed] Das Deployment liefert f\xFCr ein Schuljahr von \u201E${e}\u201C keinen Schl\xFCssel \u2014 es l\xE4uft ein \xE4lteres Release als die CLI. Nach dem n\xE4chsten Release erneut versuchen.`,en:`[run/keyNotServed] The deployment provides no key for a school year of "${e}" \u2014 it runs an older release than the CLI. Try again after the next release.`});let t=`${e}-`;return(!n.startsWith(t)||n.length===t.length)&&ae("CONFLICT",{de:`[run/foreignKey] Der Schl\xFCssel \u201E${n}\u201C des Schuljahrs liegt nicht unter dem Programm \u201E${e}\u201C (erwartet: \u201E${t}<key>\u201C).`,en:`[run/foreignKey] The key "${n}" of the school year is not under the program "${e}" (expected: "${t}<key>").`}),n.slice(t.length)}s(kO,"bareRunKey");function np(e){let n=[],t=new Map;return e.forEach((r,i)=>{let o=Dn(r.name),a=o!=="not-localized"&&!o.includes("de")?r.name.de:void 0,l=`program.runs[${i}]${a!==void 0?` ("${a}")`:""}`;o==="not-localized"||o.length===2?n.push({code:"run/nameMissing",index:i,message:{de:`[run/nameMissing] ${l}: jedes Schuljahr braucht einen \`name\` auf Deutsch und Englisch (\`{ de, en }\`)`,en:`[run/nameMissing] ${l}: every run needs a \`name\` in German and English (\`{ de, en }\`)`}}):o.length>0&&n.push({code:"run/nameUntranslated",index:i,message:{de:`[i18n/missingTranslation] ${l}.name fehlt in: ${o.join(", ")} \u2014 jeder angezeigte Text braucht Deutsch und Englisch.`,en:`[i18n/missingTranslation] ${l}.name is missing in: ${o.join(", ")} \u2014 every displayed text needs German and English.`}});let d=r.key;if(d==null||d===""){n.push({code:"run/keyMissing",index:i,message:{de:`[run/keyMissing] ${l}: jedes Schuljahr braucht einen stabilen \`key\` \u2014 der Name dient nur der Anzeige`,en:`[run/keyMissing] ${l}: every run needs a stable \`key\` \u2014 the name is display only`}});return}if(typeof d!="string"||!W1.test(d)){n.push({code:"run/keyInvalid",index:i,message:{de:`[run/keyInvalid] ${l}: der Schl\xFCssel ${JSON.stringify(d)} muss ein kleingeschriebener Slug sein (a-z, 0-9, einzelnes \u201E-\u201C)`,en:`[run/keyInvalid] ${l}: key ${JSON.stringify(d)} must be a lowercase slug string (a-z, 0-9, single "-")`}});return}let c=t.get(d);if(c!==void 0){n.push({code:"run/duplicateKey",index:i,message:{de:`[run/duplicateKey] ${l}: der Schl\xFCssel \u201E${d}\u201C wird bereits von program.runs[${c}] verwendet`,en:`[run/duplicateKey] ${l}: key "${d}" is already used by program.runs[${c}]`}});return}t.set(d,i)}),n}s(np,"runSpecIssues");var Y1="-stufe-",H1=/^[a-z0-9]+(?:-[a-z0-9]+)*$/;function lw(e){return`${e}${Y1}`}s(lw,"stageKeyPrefix");function Ws(e,n){return`${lw(e)}${n}`}s(Ws,"stageStorageKey");function vO(e,n){let t=lw(e);return n.startsWith(t)&&n.length>t.length}s(vO,"isUnderProgram");function Jr(e,n){let t=lw(e);return vO(e,n)||ae("CONFLICT",{de:`[stage/foreignKey] Der Stufenschl\xFCssel \u201E${n}\u201C liegt nicht unter dem Programm \u201E${e}\u201C (erwartet: \u201E${t}<key>\u201C). F\xFChren Sie die Stufe in bundle.yaml unter einem neuen Schl\xFCssel auf; der n\xE4chste Apply archiviert diese Zeile (hinter der Archivsperre) und legt die Stufe mit dem neuen Schl\xFCssel an.`,en:`[stage/foreignKey] The level key "${n}" is not under the program "${e}" (expected: "${t}<key>"). List the level in bundle.yaml under a new key; the next apply archives this row (behind the archive lock) and creates the level with the new key.`}),n.slice(t.length)}s(Jr,"bareStageKey");function tp(e){let n=[],t=new Map;return e.forEach((r,i)=>{let o=Dn(r.name),a=o!=="not-localized"&&!o.includes("de")?r.name.de:void 0,l=`program.stages[${i}]${a!==void 0?` ("${a}")`:""}`;o==="not-localized"||o.length===2?n.push({code:"stage/nameMissing",index:i,message:{de:`[stage/nameMissing] ${l}: jede Klassenstufe braucht einen \`name\` auf Deutsch und Englisch (\`{ de, en }\`)`,en:`[stage/nameMissing] ${l}: every stage needs a \`name\` in German and English (\`{ de, en }\`)`}}):o.length>0&&n.push({code:"stage/nameUntranslated",index:i,message:{de:`[i18n/missingTranslation] ${l}.name fehlt in: ${o.join(", ")} \u2014 jeder angezeigte Text braucht Deutsch und Englisch.`,en:`[i18n/missingTranslation] ${l}.name is missing in: ${o.join(", ")} \u2014 every displayed text needs German and English.`}});let d=r.key;if(d==null||d===""){n.push({code:"stage/keyMissing",index:i,message:{de:`[stage/keyMissing] ${l}: jede Klassenstufe braucht einen stabilen \`key\` \u2014 der Name dient nur der Anzeige`,en:`[stage/keyMissing] ${l}: every stage needs a stable \`key\` \u2014 the name is display only`}});return}if(typeof d!="string"||!H1.test(d)){n.push({code:"stage/keyInvalid",index:i,message:{de:`[stage/keyInvalid] ${l}: der Schl\xFCssel ${JSON.stringify(d)} muss ein kleingeschriebener Slug sein (a-z, 0-9, einzelnes \u201E-\u201C)`,en:`[stage/keyInvalid] ${l}: key ${JSON.stringify(d)} must be a lowercase slug string (a-z, 0-9, single "-")`}});return}let c=t.get(d);if(c!==void 0){n.push({code:"stage/duplicateKey",index:i,message:{de:`[stage/duplicateKey] ${l}: der Schl\xFCssel \u201E${d}\u201C wird bereits von program.stages[${c}] verwendet`,en:`[stage/duplicateKey] ${l}: key "${d}" is already used by program.stages[${c}]`}});return}t.set(d,i)}),n}s(tp,"stageSpecIssues");function bO(e){return{de:e.de.trim(),en:e.en.trim()}}s(bO,"trimmedText");function J1(e,n){let t=[];return e.de!==n.de&&t.push(`"${e.de}" \u2192 "${n.de}"`),e.en!==n.en&&t.push(`en "${e.en}" \u2192 "${n.en}"`),t.join(", ")}s(J1,"describeNameChange");function rp(e,n,t){if(e===null)return n.length>0&&F("planStageReconcile: stages exist but the offer has no program key"),t.map((a,l)=>({op:"insert",key:a.key,name:bO(a.name),...a.gradeLevel!==void 0?{gradeLevel:a.gradeLevel}:{},sequence:l+1}));let r=new Map(n.map(a=>[a.key,a])),i=new Set,o=[];t.forEach(({name:a,...l},d)=>{let c={...l,name:bO(a)},u=Ws(e,c.key);i.add(u);let p=d+1,h=r.get(u);if(h===void 0){o.push({op:"insert",key:c.key,name:c.name,...c.gradeLevel!==void 0?{gradeLevel:c.gradeLevel}:{},sequence:p});return}let y={};zs(h.name,c.name)||(y.name=[h.name,c.name]);let k=h.gradeLevel??null,w=c.gradeLevel??null;k!==w&&(y.gradeLevel=[k,w]),h.sequence!==p&&(y.sequence=[h.sequence,p]),(Object.keys(y).length>0||h.archived)&&o.push({op:"update",key:c.key,stageId:h.stageId,name:c.name,changes:y,unarchive:h.archived})});for(let a of[...n].sort((l,d)=>l.sequence-d.sequence))a.archived||i.has(a.key)||o.push({op:"archive",key:vO(e,a.key)?Jr(e,a.key):a.key,stageId:a.stageId,name:a.name});return o}s(rp,"planStageReconcile");function ip(e){switch(e.op){case"insert":return`+stage ${e.key} (${e.name.de})`;case"archive":{let n=e.occupancy,t=[...n&&n.activeApplications>0?[`REFUSED: ${n.activeApplications} active application(s) \u2014 [stage/hasActiveApplications]`]:[],...n&&n.openLeads>0?[`${n.openLeads} open lead(s)`]:[]];return`-stage ${e.key} (${e.name.de})${t.length>0?` \u2014 ${t.join("; ")}`:""}`}case"update":{let n=[];if(e.unarchive&&n.push("restored"),e.changes.name&&n.push(J1(e.changes.name[0],e.changes.name[1])),e.changes.gradeLevel){let[t,r]=e.changes.gradeLevel;n.push(`grade ${t??"\u2013"} \u2192 ${r??"\u2013"}`)}return e.changes.sequence&&n.push(`position ${e.changes.sequence[0]} \u2192 ${e.changes.sequence[1]}`),`~stage ${e.key} (${n.join(", ")})`}}}s(ip,"describeStageStep");function op(e,n){return n.startsWith(e)&&n.length>e.length?n.slice(e.length):void 0}s(op,"bareUnder");function SO(e,n,t,r){let i=e.flatMap(y=>y.angebote).find(y=>y.offerKey===n);if(i===void 0){let y=e.flatMap(k=>k.angebote.map(w=>w.offerKey));throw new je(`applications start-test: no offer "${n}" (offers: ${y.join(", ")||"none"})`)}if(i.programKey===void 0)throw new je("applications start-test: the deployment does not serve the offer's program key \u2014 it runs an older release than the CLI; try again after the next release");let o=i.programKey;if(o===null)throw new je(`applications start-test: ${n} has no program yet \u2014 no level to start on`);let a=Ws(o,""),l=nr(o,""),d=s(y=>op(a,y)??"(no bundle key)","stageLabel"),c=s(y=>op(l,y)??"(no bundle key)","runLabel"),u=i.stages.find(y=>y.stageKey===Ws(o,r)||y.stageId===r);if(u===void 0){let y=i.stages.map(b=>`${d(b.stageKey)} (${b.stageId})`).join(", "),k=op(a,r),w=k!==void 0&&i.stages.some(b=>b.stageKey===r)?` \u2014 "${r}" is the stored key; the export names it "${k}"`:"";throw new je(`applications start-test: no level "${r}" in ${n}${w} \u2014 name it by its bundle key or id: ${y}`)}let p=d(u.stageKey),h=u.runs.find(y=>y.runKey===nr(o,t)||y.runId===t);if(h===void 0){let y=u.runs.map(b=>`${c(b.runKey)} (${b.runId})`).join(", "),k=op(l,t),w=k!==void 0&&u.runs.some(b=>b.runKey===t)?` \u2014 "${t}" is the stored key; the export names it "${k}"`:"";throw new je(`applications start-test: no school year "${t}" for level ${p}${w} \u2014 name it by its bundle key or id: ${y}`)}if(!h.isOpen)throw new je(`applications start-test: school year ${c(h.runKey)} is closed for level ${p}`);return{programRunId:h.runId,programStageId:u.stageId}}s(SO,"resolveStartTarget");function Q1(e){return e.kind==="named"?e.name:`(${e.standIn??e.fallback})`}s(Q1,"applicantText");function AO(e){return e.map(n=>({id:n.application._id,status:n.deletedAt?`${n.application.status} (gel\xF6scht)`:n.application.status,state:n.currentProcessStateId??"",applicant:Q1(n.applicantName),test:n.application.testMode===!0?"test":""}))}s(AO,"applicationRows");var xO=aw.map(e=>e.email);function EO(e,n,t,r){if(t===void 0&&r===void 0)throw new je("applications start-test: name the applicant \u2014 --party <partyId> or --applicant <email>");if(t!==void 0&&r!==void 0)throw new je("applications start-test: --party or --applicant, not both");if(ew(e,n)&&(r===void 0||!xO.includes(r.trim().toLowerCase())))throw new je(`applications start-test: on prod only for the test account ${xO.join(", ")} (--applicant) \u2014 never a real family's`)}s(EO,"assertStartApplicant");function TO(e){let n={};for(let{address:t,...r}of e.entries)n[t]=r;return{applicationId:e.applicationId,store:n}}s(TO,"processStoreJson");function Z1(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(n=>`${n.partKey}: contract ${n.contractId} \xB7 ${n.revision===null?"keine Fassung":`Fassung ${n.revision.snapshotNumber}`} \xB7 ${n.contractStatus}`).join("; ")}}s(Z1,"refText");function X1(e){return e.state!=="present"?e.reason?.de??"":e.ref!==void 0?Z1(e.ref):JSON.stringify(e.value)}s(X1,"holds");function RO(e){return e.entries.map(n=>({address:n.address,state:n.state,holds:X1(n),producer:n.producer?.label??"",written:n.writtenAt===void 0?"":new Date(n.writtenAt).toISOString()}))}s(RO,"storeRows");function sp(e){let n={},t={};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(t,o))throw new Error(`'${o}' is given twice.`);let a=r.slice(i+1);t[o]=a;try{n[o]=JSON.parse(a)}catch{n[o]=a}}return{values:n,raw:t}}s(sp,"parseKv");var $O="started",ap="submitted",lp="submitted",IO="load-scenario:";var OO="(Bewerbung)";function _O(e){return{nodeId:OO,actions:e.map(n=>({id:n.id,label:{de:`${n.label??n.id}${n.count===void 0?"":` (${n.count})`}`,en:`${n.label??n.id}${n.count===void 0?"":` (${n.count})`}`},...n.disabledReason===void 0?{}:{disabledReason:n.disabledReason}}))}}s(_O,"sharedAsList");function PO(e){return e.disabledReason===void 0?"":e.disabledCount===void 0?e.disabledReason:`${e.disabledReason} (${e.disabledCount})`}s(PO,"disabledText");function NO(e){return e.flatMap(({nodeId:n,actions:t})=>t.map(r=>({node:n,action:r.id,label:r.label.de,disabled:PO(r)})))}s(NO,"actionRows");function CO(e,n,t=[]){let r=e.filter(({actions:d})=>d.some(c=>c.id===n));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 "${n}" (offered: ${d.join(", ")||"nothing"})`)}if(r.length>1)throw new Error(`test-actions run: "${n}" 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===n);if(a.disabledReason!==void 0)throw new Error(`test-actions run: "${n}" on ${i} is disabled: ${PO(a)}`);if(i!==OO)return i;let l=t[0];if(l===void 0)throw new Error(`test-actions run: "${n}" needs a current node \u2014 the application has none`);return l}s(CO,"nodeOfferingAction");function DO(e,n,t){if(e.startsWith(IO)){if(Object.hasOwn(t,"autoSubmit"))throw new Error(`test-actions run: ${e}: a scenario's autoSubmit is set by --auto-submit / --no-auto-submit, not --param`);return{autoSubmit:n,...t}}return Object.keys(t).length===0?void 0:{...t}}s(DO,"runParams");async function e2(e,n){let t=await e.query(x.workflow.getInstance,{applicationId:n});if(t===null)throw new Error(`test-actions: application ${n} has no workflow instance`);return t.instance.currentNodeIds}s(e2,"currentNodeIds");function n2(e,n){switch(n){case"notTestApplication":return`${e} is not a test application`;case"completed":case"aborted":case"deleted":return`${e} is ${n} \u2014 test actions run only on an active application`;case"missingPermission":return"the caller lacks bewerbungsmanagement.testActions.run"}}s(n2,"refusalText");async function dp(e,n,t){let r=await e.query(x.workflow.listSharedTestActions,{applicationId:n});if(!r.permitted)throw new Error(`test-actions: not permitted \u2014 ${n2(n,r.reason)}`);let i=[];for(let o of t){let a=await e.query(x.workflow.listTestActions,{applicationId:n,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,_O(r.actions)]}s(dp,"actionsOf");async function FO(e,n,t){return t!==void 0?[t]:await e2(e,n)}s(FO,"nodesOf");var dw=class extends N{static{s(this,"TestActionsListCommand")}static paths=[["test-actions","list"]];static usage=R.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 n=await this.caller(),t=await dp(n,this.application,await FO(n,this.application,this.node));return this.print(t,NO,["node","action","label","disabled"]),0}},cw=class extends N{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=R.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 n=DO(this.action,this.autoSubmit,sp(this.param??[]).values),t=await this.caller(),r=this.application,i=await FO(t,this.application,this.node),o=CO(await dp(t,r,i),this.action,i);return await t.mutation(x.workflow.runTestAction,{applicationId:r,nodeId:o,actionId:this.action,...n===void 0?{}:{params:n}}),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}},LO=[dw,cw];var Ar=/^[a-z][A-Za-z0-9]*$/;function uw(e){return typeof e=="string"&&Ar.test(e)}s(uw,"isNodeId");function Ys(e,n){uw(e)||F(`[graph/nodeIdFormat] "${e}" cannot name a node: a node id is ${Ar.source}.`);let t=new Set(n);if(!t.has(e))return e;let r=2;for(;t.has(`${e}${r}`);)r++;return`${e}${r}`}s(Ys,"makeNodeId");var Yi="$env";function de(e){if(e.scope==="env")return`${Yi}.${e.key}`;let n=`$${e.scope}.${e.owner}.${e.key}`;return e.path===void 0?n:`${n}.${e.path}`}s(de,"formatAddress");var Wi=/^[a-z][a-zA-Z0-9_]*$/,t2=/^[A-Za-z_][A-Za-z0-9_]*$/;function Do(e){return typeof e=="string"&&e.split(".").every(n=>t2.test(n))}s(Do,"isPath");function fi(e){if(!e.startsWith("$"))return null;let n=e.slice(1).split("."),[t,...r]=n;switch(t){case"env":{let i=r.join(".");return r.length>0&&Do(i)?{scope:"env",key:i}:null}case"node":case"task":{let[i,o,...a]=r;return i===void 0||o===void 0||!Wi.test(o)||(t==="node"?!Ar.test(i):!Wi.test(i))?null:r2({scope:t,owner:i,key:o},a)}default:return null}}s(fi,"tryParseAddress");function r2(e,n){if(n.length===0)return e;let t=n.join(".");return Do(t)?{...e,path:t}:null}s(r2,"withPath");function we(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=e,t=n.scope==="env"?["scope","key"]:["scope","owner","key","path"];if(Object.keys(n).some(r=>!t.includes(r))||n.path!==void 0&&!Do(n.path))return!1;switch(n.scope){case"env":return Do(n.key);case"node":return typeof n.owner=="string"&&Ar.test(n.owner)&&typeof n.key=="string"&&Wi.test(n.key);case"task":return typeof n.owner=="string"&&Wi.test(n.owner)&&typeof n.key=="string"&&Wi.test(n.key);default:return!1}}s(we,"isAddress");var Hi={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"}},Hs=Object.keys(Hi);function Ji(e){return Object.hasOwn(Hi,e)}s(Ji,"isEnvKey");var fw=["self-service","staff"];function MO(e,n){return{kind:"fixed",values:e,labels:n}}s(MO,"fixedSet");var cp={of:"applicant.language",withoutValue:"de"},pi={"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:cp},"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:cp},"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:cp},"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:cp},"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:MO(Be,{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:MO(fw,{staff:{de:"intern",en:"in-house"},"self-service":{de:"online (Familie)",en:"online (family)"}}),nullable:!1,label:{de:"Eingangsweg",en:"Intake channel"}}},up={types:Hi,fields:pi},fp=Hs.flatMap(e=>Object.keys(Hi[e]).map(n=>`${e}.${n}`));function tr(e){return Object.hasOwn(pi,e)}s(tr,"isEnvLeaf");function pp(e){return`${Yi}.${e}`}s(pp,"envIdentifier");function Fo(e){let n=pi[e],[t,r]=e.split("."),i=Hi[t][r];i===void 0&&F(`[env] leaf "${e}" has no type`);let o=n.valueSet;return{leaf:e,type:i,label:n.label,nullable:n.nullable,...n.absent===void 0?{}:{absent:n.absent},...n.nameLanguage===void 0?{}:{nameLanguage:n.nameLanguage},...n.cohortBound===void 0?{}:{cohortBound:n.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(Fo,"envLeaf");var qO="staffInput";var i2=["boolean"],Gl=/^[a-z][A-Za-z0-9]*$/;function mp(e){return e.staffInputs??[]}s(mp,"staffInputsOf");function hp(e){return`${qO}.${e}`}s(hp,"staffInputLeaf");function KO(e){return`${Yi}.${hp(e)}`}s(KO,"staffInputIdentifier");function o2(e){let n=`${qO}.`;return e.startsWith(n)?e.slice(n.length):null}s(o2,"staffInputKeyOfLeaf");function Js(e,n){let t=o2(n);return t===null?void 0:mp(e).find(r=>r.key===t)}s(Js,"declaredStaffInput");function jO(e){return[...mp(e).map(n=>({leaf:hp(n.key),type:n.type,label:n.label,valueSet:{kind:"open"},nullable:!1,cohortBound:!1})),...fp.map(n=>{let t=Fo(n);return{leaf:n,type:t.type,label:t.label,valueSet:pi[n].valueSet,nullable:t.nullable,cohortBound:t.cohortBound===!0}})]}s(jO,"envLeavesFor");function VO(e){return jO(e).filter(n=>!n.cohortBound)}s(VO,"conditionEnvLeaves");function BO(e){return GO(VO(e))}s(BO,"envConditionSchemaFor");function s2(e){return jO(e).map(n=>n.leaf==="stage.key"?{...n,valueSet:{kind:"open"}}:n)}s(s2,"offerConditionEnvLeaves");function UO(e){return GO(s2(e))}s(UO,"offerConditionSchemaFor");function GO(e){let n={},t={};for(let{leaf:r,type:i,valueSet:o,nullable:a}of e){let[l="",d=""]=r.split(".");n[l]={...n[l]??{},[d]:i},t[r]={valueSet:o,nullable:a}}return{types:n,fields:t}}s(GO,"schemaOfLeaves");function zO(e){let n=e.staffInputs;if(n===void 0)return[];if(!Array.isArray(n))return[{path:"staffInputs",reason:{de:"[staffInput/shape] graph.staffInputs muss eine Liste sein.",en:"[staffInput/shape] graph.staffInputs must be a list."}}];let t=[],r=new Set;return n.forEach((i,o)=>{let a=`staffInputs[${o}]`,l=i;if(l===null||typeof l!="object"||typeof l.key!="string"){t.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}"`};Gl.test(l.key)||t.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)&&t.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),i2.includes(l.type)||t.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=Dn(l.label);c==="not-localized"?t.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&&t.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(", ")}.`}})}),t}s(zO,"staffInputIssues");var Sw={required:!0,description:"Offer slug (its offerKey)"},pw=class extends N{static{s(this,"ApplicationsListCommand")}static paths=[["applications","list"]];static usage=R.Usage({category:"Admission",description:"List an offer's applications (id, status, board state, applicant, test)"});offer=f.String("--offer",Sw);testOnly=f.Boolean("--test-only",!1,{description:"Only test applications"});async execute(){let n=await this.caller(),t=await n.query(x.admission.listForAngebot,{client:this.requireTenant(n),offerKey:this.offer}),r=AO(t).filter(i=>!this.testOnly||i.test==="test");return this.print(r,i=>i,["id","status","state","applicant","test"]),0}},mw=class extends N{static{s(this,"ApplicationsCountsCommand")}static paths=[["applications","counts"]];static usage=R.Usage({category:"Admission",description:"Count an offer's applications per list"});offer=f.String("--offer",Sw);async execute(){let n=await this.caller(),t=await n.query(x.admission.getCountsByListForAngebot,{client:this.requireTenant(n),offerKey:this.offer});return this.print(t,r=>[...Object.entries(r.counts).map(([i,o])=>({list:i,count:String(o)})),{list:"total",count:String(r.total)}],["list","count"]),0}},hw=class extends N{static{s(this,"ApplicationsShowCommand")}static paths=[["applications","show"]];static usage=R.Usage({category:"Admission",description:"One application: status, test flag, offer, current workflow nodes"});application=f.String({required:!0});async execute(){let n=await this.caller(),t=this.application,r=await n.query(x.admission.get,{applicationId:t});if(r===null)throw new je(`applications show: no application ${t} (or not visible to you)`);let i=await n.query(x.workflow.getInstance,{applicationId:t});return this.print({application:r,currentNodes:i?.instance.currentNodeIds??[]},o=>[{key:"id",value:t},{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}},gw=class extends N{static{s(this,"ApplicationsStoreCommand")}static paths=[["applications","store"]];static usage=R.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 t=await(await this.caller()).query(x.processStoreView.get,{applicationId:this.application});return this.print(TO(t),()=>RO(t),["address","state","holds","producer","written"]),0}},yw=class extends N{static{s(this,"ApplicationsStartTestCommand")}static paths=[["applications","start-test"]];static usage=R.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",Sw);run=f.String("--run",{required:!0,description:"School year: its bundle key as offer export shows it (program.runs[].key) or id \u2014 never its name"});stage=f.String("--stage",{required:!0,description:"Level: its bundle key as offer export shows it (program.stages[].key) or id \u2014 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 n=await this.caller();EO(this.resolvedTarget(),this.prodUrls(),this.party,this.applicant);let t=this.requireTenant(n),r=SO(await n.query(x.admission.listAdmissionTree,{client:t}),this.offer,this.run,this.stage),i=this.party;if(this.applicant!==void 0){let d=await n.query(x.applicants.partyByEmail,{client:t,email:this.applicant});if(d===null)throw new je(`applications start-test: no applicant account ${this.applicant} at this school (create it in the cockpit first)`);i=d}let o=await n.mutation(x.admission.staffStartApplicationForParty,{client:t,offerKey:this.offer,partyId:i,programRunId:r.programRunId,programStageId:r.programStageId,...this.proxy===void 0?{}:{startInProxy:this.proxy},staffInputs:YO(this.staffInput??[]),testMode:!0,...this.version===void 0?{}:{offerVersionId:this.version}}),a,l;try{let d=await n.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 dp(n,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}},ww=class extends N{static{s(this,"ApplicationsDiscardTestCommand")}static paths=[["applications","discard-test"]];static usage=R.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 je("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 je("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 je("applications discard-test: --all-test takes no application id");if(this.olderThan===void 0)throw new je("applications discard-test --all-test: --older-than <N>d is required");if(this.dryRun&&this.confirm)throw new je("applications discard-test: --dry-run and --confirm exclude each other");let n=a2(this.olderThan),t=await this.caller(),r=this.requireTenant(t),i=[],o=null;for(;;){let c=await t.query(x.admission.testTtlPlan,{client:r,olderThanDays:n,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 je(`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 t.mutation(x.admission.discardExpiredTest,{applicationId:c.applicationId,olderThanDays:n}),c.result="discarded"}catch(u){d++,c.result=`failed: ${u instanceof Error?u.message:String(u)}`}return this.print({olderThanDays:n,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 a2(e){let n=/^(\d+)d$/.exec(e.trim());if(n===null)throw new je(`--older-than "${e}": expected <N>d, e.g. 14d`);return Number(n[1])}s(a2,"parseDays");var kw=class extends N{static{s(this,"ApplicationsSetKeepDemoCommand")}static paths=[["applications","set-keep-demo"]];static usage=R.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},t=>[{key:"application",value:t.application},{key:"keep as demo",value:t.keepAsDemo?"ja":"nein"}]),0}},bw=class extends N{static{s(this,"ApplicationsStaffInputListCommand")}static paths=[["applications","staff-input","list"]];static usage=R.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 t=await(await this.caller()).query(x.admission.staffInputsOfApplication,{applicationId:this.application});return this.print(t,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}},vw=class extends N{static{s(this,"ApplicationsStaffInputSetCommand")}static paths=[["applications","staff-input","set"]];static usage=R.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 n=await this.caller(),[{key:t,value:r}]=YO([this.input]);return await n.mutation(x.admission.correctStaffInput,{applicationId:this.application,key:t,value:r,reason:this.reason}),this.print({application:this.application,key:t,value:r},i=>[{key:"application",value:i.application},{key:i.key,value:String(i.value)}]),0}},xw=class extends N{static{s(this,"ApplicationsPurgeCommand")}static paths=[["platform","applications","purge"]];static usage=R.Usage({category:"Admission",description:"Hard-delete one real application staff started for a colleague and already deleted (plan unless --confirm). Needs _platform.config.manage.",details:"Refused unless all hold: a real application (a test one goes with `applications discard-test`), soft-deleted by staff, started by staff, its applicant an internal staff member of the school (also a switched-off one) whose person existed before, no data about anyone else (only empty drafts the form opened), nothing committed yet, and no contract, signing process, payment or Engage push. Deletes the application and every row it created; the staff member's person stays. Afterwards the responsible person can be deactivated.",examples:[["Plan","plexus-cli --env prod --tenant <slug> platform applications purge <applicationId>"],["Apply","plexus-cli --env prod --tenant <slug> --allow-prod platform applications purge <applicationId> --confirm"]]});application=f.String({required:!0});confirm=f.Boolean("--confirm",!1,{description:"Delete for good (without it, only the checks run)."});async execute(){let n=await this.caller(),t=await n.mutation(x.admission.purgeDeletedStaffApplication,{tenantSlug:this.requireTenant(n),applicationId:this.application,dryRun:!this.confirm});if(this.json)return this.print(t),0;let r=this.context.stdout;return r.write(`${t.applied?"Deleted":"Would delete"} application ${t.applicationId} `),r.write(`(applicant ${t.applicantPartyId}, soft-deleted ${new Date(t.deletedAt).toISOString()})
|
|
11342
11345
|
`),t.applied?(r.write(`Rows deleted: ${t.deleted}${t.continuing?" so far \u2014 the purge goes on in scheduled steps":""}
|
|
11343
11346
|
`),0):(r.write(`Dry run \u2014 every check passed; re-run with --confirm to delete.
|
|
11344
11347
|
`),0)}},WO=[pw,mw,hw,gw,yw,ww,xw,kw,bw,vw];function YO(e){return e.map(n=>{let[t="",r,...i]=n.split("=");if(!Gl.test(t)||r!=="true"&&r!=="false"||i.length>0)throw new je(`--staff-input "${n}": expected key=true or key=false`);return{key:t,value:r==="true"}})}s(YO,"parseStaffInputs");var Qn="contractGenerator",Lo="documentTemplate";function zl(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=e,t=Object.keys(n);return(n.kind==="generator"||n.kind==="package")&&typeof n.key=="string"&&n.key.length>0&&(n.revision===void 0||typeof n.revision=="number"&&Number.isInteger(n.revision)&&n.revision>0)&&t.every(r=>r==="kind"||r==="key"||r==="revision")}s(zl,"isGeneratorRef");function HO(e,n){let t=e.inputs?.[n];return t?.kind==="literal"?t.value:void 0}s(HO,"literalOf");function mi(e){let n=HO(e,Qn);return zl(n)?n:null}s(mi,"generatorRefOfNode");function Er(e){let n=HO(e,Lo);return typeof n=="string"&&n.length>0?n:null}s(Er,"documentTemplateKeyOfNode");function JO(e){return`${e.kind}:${e.key}${e.revision===void 0?"":`@${e.revision}`}`}s(JO,"generatorRefLabel");var l2=["formExports","generatorStamp"];function QO(e,n,t){let r=e.inputs?.[Qn];(r?.kind!=="literal"||!zl(r.value))&&F(`applyGeneratorStamp: the node names no generator in inputs.${Qn} \u2014 a stamp derives from it`),t.freezeRevision&&n.revision!==void 0&&(e.inputs[Qn]={kind:"literal",value:{...r.value,revision:n.revision}}),e.generatorStamp={inputSchema:n.inputSchema,parties:n.parties,schemaDigest:n.schemaDigest,...n.parts===void 0?{}:{parts:n.parts},...n.coverLetter===void 0?{}:{coverLetter:n.coverLetter}}}s(QO,"applyGeneratorStamp");var d2=["reads"];function Qs(e){if(e===null||typeof e!="object")return e;let n={...e};return Array.isArray(n.nodes)&&(n.nodes=n.nodes.map(t=>{if(t===null||typeof t!="object")return t;let r={...t};for(let i of l2)delete r[i];for(let i of d2)Array.isArray(r[i])&&r[i].length===0&&delete r[i];return r})),n}s(Qs,"comparableWorkflowGraph");var Wl={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 gp(e){return e===null||typeof e!="object"||Array.isArray(e)?["manifest: data must be an object"]:Object.keys(e).map(n=>{let t=Wl[n];return t!==void 0?`manifest: \`${n}\` is no longer part of manifest.json (${t.en}). Delete the line.`:`manifest: unknown key \`${n}\` \u2014 manifest.json carries no key.`})}s(gp,"manifestIssues");function c2(e){let n=[],t=e.buses;if(!Array.isArray(t))return n;let r=t.find(i=>!!i&&typeof i=="object"&&i.key==="process");if(!r||!Array.isArray(r.states))return n;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:"?";n.push(`progressLayout: progress state '${a}' is non-terminal but declares no 'external' block (applicant-facing copy) \u2014 resolveStatusPresentation would throw at runtime`)}}return n}s(c2,"validateProgressLayoutExternalCopy");function ZO(e){if(e===null||typeof e!="object")return["progressLayout: the full layout object is required"];let n=e.buses;return!Array.isArray(n)||!n.some(t=>!!t&&typeof t=="object"&&t.key==="process")?["progressLayout: the layout must declare the `process` bus"]:c2(e)}s(ZO,"progressLayoutIssues");var XO=new Set(["nodes","assignmentRules","channels","processStore","staffInputs"]);var u2=new Set(["sections","effects","outcomes","testScenarios","env","views"]),yp={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 e_(e,n){if(e===null||typeof e!="object"||Array.isArray(e))return[{de:`${n}: die Formulardefinition muss ein Objekt sein.`,en:`${n}: the form definition must be an object.`}];let t=[];for(let i of Object.keys(e)){if(u2.has(i))continue;let o=yp[i];t.push(o!==void 0?{de:`${n}: \`${i}\` geh\xF6rt nicht mehr zur Formulardefinition (${o.de}). Die Zeile l\xF6schen.`,en:`${n}: \`${i}\` is no longer part of the form definition (${o.en}). Delete the line.`}:{de:`${n}: unbekannter Schl\xFCssel \`${i}\`.`,en:`${n}: unknown key \`${i}\`.`})}let r=e;for(let i of["sections","effects","outcomes"])Array.isArray(r[i])||t.push({de:`${n}: \`${i}\` muss eine Liste sein.`,en:`${n}: \`${i}\` must be a list.`});return t}s(e_,"smartFormDefinitionShapeIssues");var It=["granted","rejected","waitlisted","other"];function Qi(e){return typeof e=="string"&&It.includes(e)}s(Qi,"isOutcomeSemantic");var rr=["arrival","manual"],n_={arrival:{de:"Nach Eingang",en:"By arrival"},manual:{de:"Von Hand sortiert",en:"Sorted by hand"}};function f2(e,n){let t=e.inputs?.[n];return t?.kind==="literal"?t.value:void 0}s(f2,"literal");function Aw(e){let n=f2(e,"waitlistOrder");return rr.includes(n)?{waitlistOrder:n}:null}s(Aw,"waitlistPolicyOrNull");var wn="responsible",Ew="team:";function wp(e){return`${Ew}${e}`}s(wp,"teamSlot");function kp(e){return e.startsWith(Ew)?e.slice(Ew.length):null}s(kp,"teamKeyOfSlot");function t_(e){return e.kind==="responsible"?wn:wp(e.groupKey)}s(t_,"slotIdOf");function bp(e){if(e===wn)return{kind:"responsible"};let n=kp(e);return n===null||n.length===0?null:{kind:"team",groupKey:n}}s(bp,"slotOfId");var Tw="review",Rw="checkField",r_="reviewed",i_="reviewing",vp=["rejected","waitlisted"];function $w(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s($w,"isObject");var p2=new Set(["decision",Tw]),o_={approved:"granted",accepted:"granted",admitted:"granted",direkt:"granted",rejected:"rejected",absage:"rejected",declined:"rejected",waitlisted:"waitlisted",warteliste:"waitlisted"};function Iw(e){return Object.hasOwn(o_,e)?o_[e]:void 0}s(Iw,"legacySemanticOfId");function m2(e){return e===Tw?It.filter(n=>!vp.includes(n)):It}s(m2,"allowedSemanticsFor");var h2="other";function s_(e){return $w(e)&&p2.has(String(e.type))&&Array.isArray(e.outcomes)?e.outcomes:[]}s(s_,"outcomesOf");function a_(e){return(e?.nodes??[]).some(n=>s_(n).some(t=>$w(t)&&!("semantic"in t)))}s(a_,"needsOutcomeSemantics");function l_(e,n={}){let t=[],r=[],i=[],o=e.nodes.map(a=>{let l=s_(a);if(l.length===0)return a;let d=a,c=String(d.id),u=String(d.type),p=m2(u),h=!1,y=l.map(k=>{if(!$w(k))return k;let w=String(k.id);if("semantic"in k)return Qi(k.semantic)||i.push({nodeId:c,outcomeId:w,value:String(k.semantic)}),k;let b=`${c}.${w}`,T=Object.hasOwn(n,b)?n[b]:void 0;if(T!==void 0)return p.includes(T)?(t.push({nodeId:c,outcomeId:w,semantic:T,source:"answer"}),h=!0,{...k,semantic:T}):(r.push({nodeId:c,nodeType:u,outcomeId:w,allowed:p,answer:T}),k);let E=Iw(w),$=E??h2;return p.includes($)?(t.push({nodeId:c,outcomeId:w,semantic:$,source:E===void 0?"formerDefault":"legacyTable"}),h=!0,{...k,semantic:$}):(r.push({nodeId:c,nodeType:u,outcomeId:w,allowed:p}),k)});return h?{...d,outcomes:y}:a});return t.length===0?{graph:e,written:t,refused:r,invalid:i}:{graph:{...e,nodes:o},written:t,refused:r,invalid:i}}s(l_,"addOutcomeSemantics");var Tr="bewerbungOffen";function Mo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Mo,"isObject");var Ow=["event","effect"];function d_(e){return Mo(e)&&e.type==="eventTrigger"}s(d_,"isTrigger");function c_(e){let n=Mo(e.inputs)?e.inputs:{};return"outcomes"in e||Ow.some(t=>t in e||t in n)}s(c_,"oldShape");function u_(e){return(e?.nodes??[]).some(n=>d_(n)&&c_(n))}s(u_,"needsEventTriggerStartMove");function g2(e){let n=String(e.id),r=(Array.isArray(e.outcomes)?e.outcomes:[]).map(l=>Mo(l)?l.id:void 0);if("outcomes"in e&&!(r.length===1&&r[0]===Tr))return{unmoved:{nodeId:n,reason:"outcomesNotStart"}};let i=Object.keys(Mo(e.next)?e.next:{});if(!(i.length===1&&i[0]===Tr))return{unmoved:{nodeId:n,reason:"nextNotStart"}};let o=Mo(e.inputs)?{...e.inputs}:{};for(let l of Ow){let d=o[l];if(Mo(d)&&d.kind==="binding")return{unmoved:{nodeId:n,reason:"bindingCell"}}}let a={...e};delete a.outcomes;for(let l of Ow)delete a[l],delete o[l];return Mo(e.inputs)&&(Object.keys(o).length>0?a.inputs=o:delete a.inputs),{node:a}}s(g2,"moveNode");function f_(e){let n=[],t=[],r=e.nodes.map(i=>{if(!d_(i)||!c_(i))return i;let o=g2(i);return"unmoved"in o?(t.push(o.unmoved),i):(n.push(String(i.id)),o.node)});return n.length===0?{graph:e,moved:n,unmoved:t}:{graph:{...e,nodes:r},moved:n,unmoved:t}}s(f_,"moveEventTriggerStart");function Yl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(Yl,"isObject");var p_={waitlistOrder:"arrival"};function m_(e){return!Yl(e)||e.type!=="waitlist"?!1:!("waitlistOrder"in(Yl(e.inputs)?e.inputs:{}))}s(m_,"lacksPolicy");function y2(e){return(e?.nodes??[]).some(m_)}s(y2,"needsWaitlistPolicyMove");function _w(e){return Yl(e)&&rr.includes(e.waitlistOrder)}s(_w,"isWaitlistPolicy");function w2(e){if(e===void 0)return{policy:p_,stated:!1};if(!Yl(e))return"malformed";let n=e.waitlistOrder;return n!==void 0&&!rr.includes(n)?"malformed":{policy:{waitlistOrder:n??p_.waitlistOrder},stated:n!==void 0}}s(w2,"policyOfSelection");function h_(e,n,t={}){let r=[],i=[];if(!y2(e))return{graph:e,moved:r,refused:i};let o=w2(n),a=e.nodes.map(l=>{if(!m_(l))return l;let d=l,c=String(d.id),u=Yl(d.inputs)?{...d.inputs}:{},p=Object.hasOwn(t,c)?t[c]:void 0,h,y;if(p!==void 0)h=p,y="answer";else{if(o==="malformed")return i.push({nodeId:c,reason:"selectionMalformed"}),l;h=o.policy,y=o.stated?"manifest":"formerDefault"}return u.waitlistOrder={kind:"literal",value:h.waitlistOrder},r.push({nodeId:c,policy:h,source:y}),{...d,inputs:u}});return r.length===0?{graph:e,moved:r,refused:i}:{graph:{...e,nodes:a},moved:r,refused:i}}s(h_,"moveWaitlistPolicyToInputs");function qo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}s(qo,"isObject");var k2=[Qn,Lo],b2=["inputSchema","parties","schemaDigest","parts"];function g_(e){return qo(e)&&e.type==="governedDocument"&&("resolver"in e||qo(e.template)&&("key"in e.template||"cockpitFields"in e.template))}s(g_,"oldShape");function y_(e){return(e?.nodes??[]).some(g_)}s(y_,"needsGeneratorInputMove");function v2(e){let n=qo(e.inputs)?{...e.inputs}:{},t={...e},r;if("resolver"in e){let i=e.resolver;if(!qo(i))return{unmoved:"resolverNotObject"};if(Qn in n)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((qo(i.inputSchema)&&Array.isArray(i.inputSchema.fields)?i.inputSchema.fields:[]).find(d=>qo(d)&&k2.includes(String(d.key)))!==void 0)return{unmoved:"stampDeclaresReservedKey"};n[Qn]={kind:"literal",value:{kind:i.kind,key:i.key,...i.revision===void 0?{}:{revision:i.revision}}};let l=Object.fromEntries(b2.filter(d=>d in i).map(d=>[d,i[d]]));Object.keys(l).length>0&&(t.generatorStamp=l),r=i.cockpitFields,delete t.resolver}if(qo(e.template)&&("key"in e.template||"cockpitFields"in e.template)){let{key:i,cockpitFields:o,...a}=e.template;if("key"in e.template){if(Lo in n)return{unmoved:"templateInputExists"};if(typeof i!="string"||i.length===0)return{unmoved:"templateKeyInvalid"};n[Lo]={kind:"literal",value:i}}if(o!==void 0){if(r!==void 0)return{unmoved:"cockpitFieldsTwice"};r=o}t.template=a}if(r!==void 0){if("cockpitFields"in e)return{unmoved:"cockpitFieldsExist"};t.cockpitFields=r}return t.inputs=n,{node:t}}s(v2,"moveNode");function w_(e){let n=[],t=[],r=e.nodes.map(i=>{if(!g_(i))return i;let o=v2(i);return"unmoved"in o?(t.push({nodeId:String(i.id),reason:o.unmoved}),i):(n.push(String(i.id)),o.node)});return n.length===0?{graph:e,moved:n,unmoved:t}:{graph:{...e,nodes:r},moved:n,unmoved:t}}s(w_,"moveGeneratorPinsToInputs");var k_=/^\d{4}-\d{2}-\d{2}$/;function Rr(e,n){return{de:e,en:n}}s(Rr,"issue");function Ko(e){if(typeof e!="object"||e===null)return Rr("keine Reduktion","not a reduction");let n=e;if(n.kind==="none")return Object.keys(n).length===1?null:Rr('\u201Ekeine Reduktion" tr\xE4gt keine weiteren Angaben','"no reduction" carries no further details');if(n.kind!=="amount")return Rr(`unbekannte Art ${JSON.stringify(n.kind)}`,`unknown kind ${JSON.stringify(n.kind)}`);let{amount:t,activeFrom:r,activeTo:i}=n;return typeof t!="number"||!Number.isFinite(t)||t<=0?Rr("der Betrag muss gr\xF6\xDFer als 0 \u20AC sein","the amount must be greater than \u20AC0"):Number.isInteger(Number((t*100).toFixed(6)))?typeof r!="string"||!k_.test(r)?Rr("der Beginn fehlt (JJJJ-MM-TT)","the start is missing (YYYY-MM-DD)"):typeof i!="string"||!k_.test(i)?Rr("das Ende fehlt (JJJJ-MM-TT)","the end is missing (YYYY-MM-DD)"):i<r?Rr("das Ende liegt vor dem Beginn","the end is before the start"):n.floorTotal!==void 0&&(typeof n.floorTotal!="number"||!Number.isSafeInteger(n.floorTotal)||n.floorTotal<0)?Rr("die Untergrenze muss ein nichtnegativer Centbetrag sein","the floor must be a non-negative amount in cents"):n.pricePeriod!==void 0&&!["month","year","once","unit"].includes(String(n.pricePeriod))?Rr("ung\xFCltige Preisperiode","invalid price period"):Object.keys(n).some(o=>!["kind","amount","activeFrom","activeTo","floorTotal","pricePeriod"].includes(o))?Rr("unbekannte Angaben","unknown details"):null:Rr("der Betrag hat mehr als zwei Nachkommastellen","the amount has more than two decimal places")}s(Ko,"reductionShapeIssue");function Zi(e){if(typeof e!="object"||e===null)return!1;let n=e;return typeof n.itemKey=="string"&&n.itemKey.length>0&&Array.isArray(n.grantKeys)&&n.grantKeys.every(t=>typeof t=="string"&&t.length>0)&&(n.reduction===void 0||Ko(n.reduction)===null&&n.reduction.kind==="amount")}s(Zi,"isPricedItemValue");var Zs=["freetext","recommendation","choice","pricedItem","record","reduction"],Xs=[...Zs,"appointment"];function v_(e){return typeof e=="string"&&Xs.includes(e)}s(v_,"isTaskResultKind");function ea(e){return typeof e=="string"&&Zs.includes(e)}s(ea,"isRecordedTaskResultKind");function na(e){return ea(e.kind)}s(na,"isRecordedTaskResult");var xp=["number","boolean","enum","text","person","assignment"];function Pw(e){return typeof e=="string"&&xp.includes(e)}s(Pw,"isRecordFieldType");function x_(e){return e==="number"||e==="boolean"||e==="enum"}s(x_,"isSuggestibleFieldType");var Nw=["form","siblingRank"],Sp=500;function x2(e){switch(e.type){case"number":case"boolean":case"enum":return e.type;case"text":return"string";case"person":return e.multiple===!0?"staffUserList":"staffUser";case"assignment":return"taskAssignment"}}s(x2,"recordFieldValueType");var hi={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 Cw(e){return(e.kind==="freetext"||e.kind==="recommendation"||e.kind==="choice")&&e.writes===void 0}s(Cw,"isProseResult");function Ap(e){return e.kind==="record"?(e.fields??[]).filter(n=>typeof n.writes=="string"&&n.writes.length>0&&Pw(n.type)).map(n=>({key:n.writes,valueType:x2(n),field:n})):S2(e)}s(Ap,"draftResultStoreWrites");function S2(e){let n=hi[e.kind].valueType;return e.writes===void 0||n===null?[]:[{key:e.writes,valueType:n}]}s(S2,"singleStoreWrite");var b_="team:";function ta(e){if(e==="all")return{kind:"all"};if(e==="external"||e.length===0)return null;if(e.startsWith(b_)){let n=e.slice(b_.length);return n.length===0?null:{kind:"team",groupKey:n}}return{kind:"channel",channelKey:e}}s(ta,"parseTaskResultChat");var ze={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]",recordText:"[taskResult/recordText]",recordPerson:"[taskResult/recordPerson]",recordAssignment:"[taskResult/recordAssignment]",reductionPrices:"[taskResult/reductionPrices]"};var A2=new Set(["if","else","in","true","false","null"]),E2=new Set(["==","!=","<=",">=","&&","||"]);function T2(e){return e>="0"&&e<="9"}s(T2,"isDigit");function R2(e){return/[a-zA-Z_$]/.test(e)}s(R2,"isIdentStart");function $2(e){return/[a-zA-Z0-9_.$]/.test(e)}s($2,"isIdentCont");function I2(e){let n=[],t=0;for(;t<e.length;){let r=e.charAt(t);if(r===" "||r===" "||r===`
|
|
@@ -11862,6 +11865,6 @@ ${t.length} unusable ${o}:
|
|
|
11862
11865
|
`),r.length>0&&this.context.stdout.write(` ${r.length} linkable \u2014 plexus-cli platform users relink-auth <email>
|
|
11863
11866
|
`),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>
|
|
11864
11867
|
`)}else this.context.stdout.write(`No unusable identities.
|
|
11865
|
-
`);return t.length>0?1:0}},xR=class extends kr{static{s(this,"UsersRelinkAuthCommand")}static paths=[["platform","users","relink-auth"],["users","relink-auth"]];static usage=R.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 t=await(await this.caller()).mutation(x.platformAdmin.relinkAuthAccount,{email:this.email}),r=t.changed?`Relinked ${this.email} to live auth account ${t.authId}.`:`${this.email} already linked to the live auth account (no change).`;return this.report(t,r),0}};function GU(e,n){if(e===n)throw new Error("Pass exactly one of --on or --off.");return e}s(GU,"requireOnOff");var zU=[oR,sR,aR,lR,dR,cR,uR,fR,pR,mR,ju,hR,gR,yR,wR,kR,bR,vR,xR];function WU(e){return e.de??e.en??Object.values(e)[0]??""}s(WU,"titleDe");function Nee(e){return{id:e._id,kind:e.kind,status:e.status,title:WU(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(Nee,"row");var Cee=["id","kind","status","title","assignee","group","outcome"],ER=class extends N{static{s(this,"WorkItemsListCommand")}static paths=[["work-items","list"]];static usage=R.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 n=await this.caller(),t=this.requireTenant(n),r=await n.query(x.workItems.list,{client:t,...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(Nee),Cee),0}},TR=class extends N{static{s(this,"WorkItemsShowCommand")}static paths=[["work-items","show"]];static usage=R.Usage({category:"Work-Items",description:"Show one work-item by id."});workItemId=f.String({required:!0,name:"workItemId"});async execute(){let n=await this.caller(),t=this.requireTenant(n),r=await n.query(x.workItems.get,{client:t,workItemId:this.workItemId});if(r===null)throw new Error(`work-item ${this.workItemId} not found in tenant ${t}.`);return this.print(r,i=>[{field:"id",value:i._id},{field:"kind",value:i.kind},{field:"status",value:i.status},{field:"title",value:WU(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}},RR=class extends N{static{s(this,"WorkItemsCreateCommand")}static paths=[["work-items","create"]];static usage=R.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 n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(x.workItems.createManual,{client:t,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}},$R=class extends N{static{s(this,"WorkItemsCompleteCommand")}static paths=[["work-items","complete"]];static usage=R.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 n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(x.workItems.complete,{client:t,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}},IR=class extends N{static{s(this,"WorkItemsAssignCommand")}static paths=[["work-items","assign"]];static usage=R.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 n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(x.workItems.assign,{client:t,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}},YU=[ER,TR,RR,$R,IR];var Vu=[...gO,...WF,...tL,...a0,...u0,...s0,...L0,...U0,...B0,...BU,...zU,...VU,...RB,...NB,..._F,...N0,...OU,...mO,...WO,...gF,...W0,...z0,...J0,...Q0,..._0,...y0,...YU,...kj,...lV,...EB,...dV,...pU,...vU,...CB,...BB,...zB,...JB,...ZB,...AU,...DU,...LO];for(let e of Vu){let n=e.paths?.[0];n===void 0||!Object.hasOwn(e,"usage")||e.usage===void 0||(e.usage={...e.usage,category:O$(e.usage.category,n.join(" "))})}var HU="0.1.287";function JU(){return Vu.flatMap(e=>(e.paths??[]).map(n=>{let t=n.join(" "),r=T$[Oo(t)];return{path:t,effect:_o(t),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,n)=>e.path.localeCompare(n.path))}s(JU,"plexusCommandCatalog");import Ts from"node:path";function Dee(e){let n=cn()?.workspaceRoot??process.cwd(),t=Ts.resolve(n,e),r=Ts.relative(n,t);if(Ts.isAbsolute(e)||r===".."||r.startsWith(`..${Ts.sep}`))throw new Error("plexus: use a relative path inside the current workspace.");return{absolute:t,relative:r}}s(Dee,"workspacePath");function Fee(e){let{absolute:n,relative:t}=Dee(e.path??".");if(e.operation==="list"){if(!Ae(n))return{files:[]};let r=[],i=s(o=>{for(let a of Kr(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new Error("plexus: workspace symlinks are not supported.");let l=Ts.join(o,a.name);if(a.isDirectory()?i(l):r.push(Ts.relative(n,l)),r.length>200)throw new Error("plexus: the workspace contains too many files. List a subdirectory.")}},"visit");return i(n),{files:r.sort()}}if(!t)throw new Error("plexus: name a workspace file.");if(["read","search","edit"].includes(e.operation)){let r=he(n);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:t,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:t,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 Ye(n,a,"utf8"),{path:t,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 Bn(Ts.dirname(n),{recursive:!0}),Ye(n,e.content,"utf8"),{path:t,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return Os(n),{path:t,removed:!0};throw new Error("plexus: unknown workspace operation.")}s(Fee,"plexusWorkspace");function QU(e){return s(async function(t,r){if(!r||typeof r!="object"||Array.isArray(r))throw new Error("plexus: tool input must be an object.");let i=r,o=Bl[t];if(!o||!Object.hasOwn(Bl,t))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(t==="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(t==="plexus_skill"){if(typeof i.path!="string"||i.path.length>240||!Object.hasOwn(iw,i.path))throw new Error("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:iw[i.path],skillHash:Xf}}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 Fee(i)},"executePlexusAgentTool")}s(QU,"createPlexusAgentToolExecutor");var jg=QU({inspectCommand:XU,executeCommand:eG});function Vg(){let e=new Cs({binaryLabel:"Plexus CLI",binaryName:"plexus-cli",binaryVersion:HU});e.register(Al.HelpCommand),e.register(Al.VersionCommand);for(let t of Vu)e.register(t);async function n(t,r){let i;try{i=e.process(t,r)}catch(o){return(r.stderr??process.stderr).write(e.error(o,{colored:!1})),2}return qee(i,r.stderr??process.stderr),e.run(i,r)}return s(n,"run"),{process(t,r){return e.process(t,r)},run:n,async runExit(t,r){process.exitCode=await n(t,r)}}}s(Vg,"createPlexusCli");function qee(e,n){let t=e.path.join(" "),r=e.constructor.paths?.[0]?.join(" ");r!==void 0&&t!==r&&$l[t]===r&&ln(n,t,r),t in $l&&_o(t)==="confirm"&&!Il(e)&&n.write(`plexus-cli: \`${$l[t]}\` only prints its plan without --confirm \u2014 nothing was changed.
|
|
11868
|
+
`);return t.length>0?1:0}},xR=class extends kr{static{s(this,"UsersRelinkAuthCommand")}static paths=[["platform","users","relink-auth"],["users","relink-auth"]];static usage=R.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 t=await(await this.caller()).mutation(x.platformAdmin.relinkAuthAccount,{email:this.email}),r=t.changed?`Relinked ${this.email} to live auth account ${t.authId}.`:`${this.email} already linked to the live auth account (no change).`;return this.report(t,r),0}};function GU(e,n){if(e===n)throw new Error("Pass exactly one of --on or --off.");return e}s(GU,"requireOnOff");var zU=[oR,sR,aR,lR,dR,cR,uR,fR,pR,mR,ju,hR,gR,yR,wR,kR,bR,vR,xR];function WU(e){return e.de??e.en??Object.values(e)[0]??""}s(WU,"titleDe");function Nee(e){return{id:e._id,kind:e.kind,status:e.status,title:WU(e.title).slice(0,50),assignee:e.assigneeUserId??"",group:e.queueGroupId??"",outcome:e.outcome??""}}s(Nee,"row");var Cee=["id","kind","status","title","assignee","group","outcome"],ER=class extends N{static{s(this,"WorkItemsListCommand")}static paths=[["work-items","list"]];static usage=R.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 n=await this.caller(),t=this.requireTenant(n),r=await n.query(x.workItems.list,{client:t,...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(Nee),Cee),0}},TR=class extends N{static{s(this,"WorkItemsShowCommand")}static paths=[["work-items","show"]];static usage=R.Usage({category:"Work-Items",description:"Show one work-item by id."});workItemId=f.String({required:!0,name:"workItemId"});async execute(){let n=await this.caller(),t=this.requireTenant(n),r=await n.query(x.workItems.get,{client:t,workItemId:this.workItemId});if(r===null)throw new Error(`work-item ${this.workItemId} not found in tenant ${t}.`);return this.print(r,i=>[{field:"id",value:i._id},{field:"kind",value:i.kind},{field:"status",value:i.status},{field:"title",value:WU(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}},RR=class extends N{static{s(this,"WorkItemsCreateCommand")}static paths=[["work-items","create"]];static usage=R.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 n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(x.workItems.createManual,{client:t,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}},$R=class extends N{static{s(this,"WorkItemsCompleteCommand")}static paths=[["work-items","complete"]];static usage=R.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 n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(x.workItems.complete,{client:t,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}},IR=class extends N{static{s(this,"WorkItemsAssignCommand")}static paths=[["work-items","assign"]];static usage=R.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 n=await this.caller(),t=this.requireTenant(n),r=await n.mutation(x.workItems.assign,{client:t,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}},YU=[ER,TR,RR,$R,IR];var Vu=[...gO,...WF,...tL,...a0,...u0,...s0,...L0,...U0,...B0,...BU,...zU,...VU,...RB,...NB,..._F,...N0,...OU,...mO,...WO,...gF,...W0,...z0,...J0,...Q0,..._0,...y0,...YU,...kj,...lV,...EB,...dV,...pU,...vU,...CB,...BB,...zB,...JB,...ZB,...AU,...DU,...LO];for(let e of Vu){let n=e.paths?.[0];n===void 0||!Object.hasOwn(e,"usage")||e.usage===void 0||(e.usage={...e.usage,category:O$(e.usage.category,n.join(" "))})}var HU="0.1.288";function JU(){return Vu.flatMap(e=>(e.paths??[]).map(n=>{let t=n.join(" "),r=T$[Oo(t)];return{path:t,effect:_o(t),host:r===void 0?"shared":"terminal",...r===void 0?{}:{reason:r}}})).sort((e,n)=>e.path.localeCompare(n.path))}s(JU,"plexusCommandCatalog");import Ts from"node:path";function Dee(e){let n=cn()?.workspaceRoot??process.cwd(),t=Ts.resolve(n,e),r=Ts.relative(n,t);if(Ts.isAbsolute(e)||r===".."||r.startsWith(`..${Ts.sep}`))throw new Error("plexus: use a relative path inside the current workspace.");return{absolute:t,relative:r}}s(Dee,"workspacePath");function Fee(e){let{absolute:n,relative:t}=Dee(e.path??".");if(e.operation==="list"){if(!Ae(n))return{files:[]};let r=[],i=s(o=>{for(let a of Kr(o,{withFileTypes:!0})){if(a.isSymbolicLink())throw new Error("plexus: workspace symlinks are not supported.");let l=Ts.join(o,a.name);if(a.isDirectory()?i(l):r.push(Ts.relative(n,l)),r.length>200)throw new Error("plexus: the workspace contains too many files. List a subdirectory.")}},"visit");return i(n),{files:r.sort()}}if(!t)throw new Error("plexus: name a workspace file.");if(["read","search","edit"].includes(e.operation)){let r=he(n);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:t,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:t,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 Ye(n,a,"utf8"),{path:t,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 Bn(Ts.dirname(n),{recursive:!0}),Ye(n,e.content,"utf8"),{path:t,sizeBytes:Buffer.byteLength(e.content)}}if(e.operation==="remove")return Os(n),{path:t,removed:!0};throw new Error("plexus: unknown workspace operation.")}s(Fee,"plexusWorkspace");function QU(e){return s(async function(t,r){if(!r||typeof r!="object"||Array.isArray(r))throw new Error("plexus: tool input must be an object.");let i=r,o=Bl[t];if(!o||!Object.hasOwn(Bl,t))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(t==="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(t==="plexus_skill"){if(typeof i.path!="string"||i.path.length>240||!Object.hasOwn(iw,i.path))throw new Error("plexus: unknown skill reference. Start with SKILL.md.");return{path:i.path,content:iw[i.path],skillHash:Xf}}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 Fee(i)},"executePlexusAgentTool")}s(QU,"createPlexusAgentToolExecutor");var jg=QU({inspectCommand:XU,executeCommand:eG});function Vg(){let e=new Cs({binaryLabel:"Plexus CLI",binaryName:"plexus-cli",binaryVersion:HU});e.register(Al.HelpCommand),e.register(Al.VersionCommand);for(let t of Vu)e.register(t);async function n(t,r){let i;try{i=e.process(t,r)}catch(o){return(r.stderr??process.stderr).write(e.error(o,{colored:!1})),2}return qee(i,r.stderr??process.stderr),e.run(i,r)}return s(n,"run"),{process(t,r){return e.process(t,r)},run:n,async runExit(t,r){process.exitCode=await n(t,r)}}}s(Vg,"createPlexusCli");function qee(e,n){let t=e.path.join(" "),r=e.constructor.paths?.[0]?.join(" ");r!==void 0&&t!==r&&$l[t]===r&&ln(n,t,r),t in $l&&_o(t)==="confirm"&&!Il(e)&&n.write(`plexus-cli: \`${$l[t]}\` only prints its plan without --confirm \u2014 nothing was changed.
|
|
11866
11869
|
`)}s(qee,"noteRetiredPath");function XU(e){let n=Vg().process(hl(e),{executePlexusAgentTool:jg}),t=n.path.join(" ");if(t.startsWith("agent "))throw new Error("plexus: nested agent transports are not allowed.");let r=JU().find(l=>l.path===t);if(!r){if(t===""||t==="--help"||t==="--version")return{path:t,writes:!1,host:"shared"};throw new Error(`plexus: command ${t} has no host classification.`)}let i=n,o=r.effect==="callKind"?hh(Ha(Ja),i.fn??"",i.kind):void 0,a=Sf(t,{confirm:Il(n),callKind:o});return{...r,writes:a}}s(XU,"inspectPlexusCommand");async function eG(e,n){if(n)return _R(n,()=>eG(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 t="",r="",i=Vg();if(cn()){let l=XU(e.argv);if(l.host==="terminal")throw new Error(`plexus: this command requires a local machine. ${l.reason??""}`)}return{exitCode:await i.run(hl(e.argv),{executePlexusAgentTool:jg,stdin:Mee.from(e.stdin===void 0?[]:[e.stdin]),stdout:new ZU({write(l,d,c){t+=String(l),c()}}),stderr:new ZU({write(l,d,c){r+=String(l),c()}})}),stdout:t,stderr:r}}s(eG,"executePlexusCommand");FR({source:Kee.join(import.meta.dirname,"skill")});Vg().runExit(hl(process.argv.slice(2)),{executePlexusAgentTool:jg});
|
|
11867
11870
|
//# sourceMappingURL=cli.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
14fe5a6a2b117fbcb9971928491ac2943177ce7dd6e685984a5219b483d219b1
|
|
@@ -92,6 +92,9 @@ apply` imports them.
|
|
|
92
92
|
- Parties: a debtor owes a share (`several` or `joint_and_several`), the debtors'
|
|
93
93
|
shares total 100; the beneficiary owes none. Allocations total 100 per scope
|
|
94
94
|
(the contract, or one line). Amounts are euros with at most two decimals.
|
|
95
|
+
- A mandate's account holder who is not a contract partner is a party with
|
|
96
|
+
`role: "accountHolder"`: owns the payment method, owes nothing, signs nothing,
|
|
97
|
+
receives no invoice, and is not written as a contract party.
|
|
95
98
|
|
|
96
99
|
## Steps
|
|
97
100
|
|