(function(root){ 'use strict'; const routes = { application: {name:'Application deployment', expected:'The intended application is available on the selected device scope.', observed:'The expected application result is not established.', checks:['Confirm the selected assignment and relevant requirements, filters or exclusions.','Compare available device status with its observation time.','Separate installation evidence from detection and reporting.']}, setup: {name:'Device setup', expected:'The selected device completes the intended setup stage.', observed:'Setup completion is not established.', checks:['Name the setup stage and the expected next step.','Compare the observed message with approved evidence from that stage.','Keep identity, application and configuration hypotheses separate until supported.']}, updates: {name:'Windows updates', expected:'The selected update scope reaches the intended state.', observed:'The current update state is not established.', checks:['Match Windows version and update to the question.','Record how current the status evidence is.','Check official release health without assuming a matching symptom proves the cause.']}, ownership: {name:'Management responsibility', expected:'The selected workload has an understood control path and decision owner.', observed:'Management responsibility needs clarification.', checks:['Identify the selected workload, not the whole environment.','Confirm intended Intune or Configuration Manager responsibility.','Identify who may approve and verify any later change.']} }; const scopes = {one:'One device or task (no identifier)',group:'A selected group or workload (no identifiers)',unknown:'Unknown'}; const evidence = {none:'Not yet checked',older:'An older report only; current state unverified',current:'An observation is available; source and relevance still need review'}; function buildBrief(values){ const route=routes[values.issue]; if(!route || !Object.hasOwn(scopes,values.scope)||!Object.hasOwn(evidence,values.evidence)) throw new Error('Choose the available options.'); const time=values.observedAt==='recorded'?'Record the actual observation time and time zone separately through the agreed evidence channel.':'Unknown'; return ['WINHOVEN ยท WORKING ISSUE BRIEF','Planning aid, not a diagnosis or support submission.','',`Workload: ${route.name}`,`Affected scope: ${scopes[values.scope]}`,'',`Expected behavior: ${route.expected}`,`Observed behavior: ${route.observed}`,`Evidence status: ${evidence[values.evidence]}`,`Observed at: ${time}`,'Last known working state: Unknown','Relevant recent change: Unknown; do not assume causation.','','NEXT EVIDENCE TO CHECK',...route.checks.map((x,i)=>`${i+1}. ${x}`),'','DECISION BOUNDARY','No cause or fix is established by these selections.','No device action, access grant or change is authorized.','Keep names, tenant/device IDs, credentials and logs out of this note.','Agree the evidence channel, recipients and minimum scope before sharing.'].join('\n'); } function convert32(raw, mode){ const text=String(raw).trim(); if(!text || text.length>16) throw new Error('Enter a 32-bit number, not a message or log.'); let value; if(mode==='signed'){ if(!/^[+-]?\d+$/.test(text)) throw new Error('Use a whole signed decimal number, with no trailing text.'); value=BigInt(text); if(value < -2147483648n || value > 2147483647n) throw new Error('Signed decimal must be between -2147483648 and 2147483647.'); if(value<0n)value+=4294967296n; }else if(mode==='unsigned'){ if(!/^\+?\d+$/.test(text)) throw new Error('Use a nonnegative whole decimal number.'); value=BigInt(text); if(value>4294967295n)throw new Error('Unsigned decimal must be between 0 and 4294967295.'); }else if(mode==='hex'){ if(!/^(?:0x)?[0-9a-f]{1,8}$/i.test(text))throw new Error('Use one to eight hexadecimal digits, optionally starting with 0x.'); value=BigInt('0x'+text.replace(/^0x/i,'')); }else throw new Error('Choose a number format.'); return {hex:'0x'+value.toString(16).toUpperCase().padStart(8,'0'),signed:(value>=2147483648n?value-4294967296n:value).toString(),unsigned:value.toString()}; } const api=Object.freeze({buildBrief,convert32,routes}); if(typeof module!=='undefined'&&module.exports)module.exports=api;else root.WinhovenTools=api; })(typeof window!=='undefined'?window:this); // Winhoven offline 32-bit formatting utility. No network, file reads or writes. // Requires an existing Node.js runtime. No packages to install. const [mode, value, ...extra] = process.argv.slice(2); if (mode === '--help' || !mode) { console.log('Usage: node winhoven-convert32.cjs \nExample: node winhoven-convert32.cjs signed -2147024891\nFormatting only. Not an error diagnosis. No cause or fix is inferred.'); } else { try { if (value === undefined || extra.length) throw new Error('Supply one format and one number.'); const r = module.exports.convert32(value, mode); console.log(JSON.stringify(r, null, 2)); } catch (error) { console.error(error.message); process.exitCode = 1; } }