@tocca-systems/twp-cli 0.138.0 → 0.140.0

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.
Files changed (139) hide show
  1. package/CHANGELOG.public.md +20 -0
  2. package/README.md +18 -0
  3. package/dist/THIRD-PARTY-NOTICES.md +1 -1
  4. package/dist/{agent-YX3LZM4C.js → agent-WSX4UXMB.js} +2 -2
  5. package/dist/{agent-loop-JJUNRUK3.js → agent-loop-JXFNC73Q.js} +1 -1
  6. package/dist/{analysis-7FRIHGYL.js → analysis-IW4IJO64.js} +2 -2
  7. package/dist/{announcement-LD5GYBDF.js → announcement-XOQ4HNBF.js} +2 -2
  8. package/dist/{api-command-YT33DV4C.js → api-command-FP65KALP.js} +3 -3
  9. package/dist/{api-key-TRKGA3AK.js → api-key-OU2PJYDR.js} +1 -1
  10. package/dist/{app-OAWMTXZ3.js → app-QQ5PGW2Y.js} +3 -3
  11. package/dist/{attendance-correct-MM2FNL7H.js → attendance-correct-F74NW54G.js} +2 -2
  12. package/dist/{attendance-lists-34VZSGKG.js → attendance-lists-FVMCEM6D.js} +2 -2
  13. package/dist/{audit-log-DLRQGPIX.js → audit-log-63IQEXXV.js} +1 -1
  14. package/dist/{backlog-GXWI4TBK.js → backlog-QY4WNJ2M.js} +2 -2
  15. package/dist/{brief-CG74AOQD.js → brief-UFZW7XJY.js} +3 -3
  16. package/dist/{budget-JFNAK6EF.js → budget-GBKUNWOX.js} +2 -2
  17. package/dist/{capacity-list-command-W6SYFB77.js → capacity-list-command-FMHDYKA6.js} +1 -1
  18. package/dist/{chunk-PXSZZRPJ.js → chunk-255NYOB2.js} +1 -1
  19. package/dist/{chunk-KMZCAOSR.js → chunk-2BZNAALS.js} +5 -5
  20. package/dist/{chunk-W6627PAC.js → chunk-4H4CZMJF.js} +1 -1
  21. package/dist/{chunk-E6KLOTR2.js → chunk-5T4CRNJH.js} +1 -1
  22. package/dist/{chunk-FDECUPTW.js → chunk-5ZCVKAD5.js} +6 -5
  23. package/dist/{chunk-3I4XAJ2T.js → chunk-6GJL7P63.js} +1 -1
  24. package/dist/{chunk-SH2YLLVL.js → chunk-6JPXLXKW.js} +2 -2
  25. package/dist/{chunk-EAIDN2BE.js → chunk-7TC4UY6G.js} +1 -1
  26. package/dist/{chunk-5E7S5INB.js → chunk-7TOESGFP.js} +3 -17
  27. package/dist/{chunk-LGRZABOT.js → chunk-B6ANN3GB.js} +1 -1
  28. package/dist/{chunk-LQKHOOAV.js → chunk-B6ZG4XRL.js} +2 -2
  29. package/dist/{chunk-YFRU7RQJ.js → chunk-BZD5DDI3.js} +2 -2
  30. package/dist/{chunk-ROAZEXMJ.js → chunk-C6XEVTO7.js} +1 -1
  31. package/dist/chunk-CJRU2ZUR.js +20 -0
  32. package/dist/{chunk-IQVHUTF7.js → chunk-EW5VJ73G.js} +1 -1
  33. package/dist/{chunk-EQGZF4C4.js → chunk-EXJFLOJE.js} +20 -11
  34. package/dist/{chunk-EMDCSBXV.js → chunk-F4KTMDKL.js} +5 -4
  35. package/dist/{chunk-VLTRRD4T.js → chunk-F7QOV6OD.js} +17 -13
  36. package/dist/{chunk-WMHAJNKY.js → chunk-FCEQ7HPO.js} +2 -2
  37. package/dist/chunk-IF7322ZE.js +24 -0
  38. package/dist/{chunk-SOLVG2XL.js → chunk-JQ3VQZ2F.js} +2 -2
  39. package/dist/{chunk-KOL4P7LC.js → chunk-L6FXTX6Q.js} +1 -1
  40. package/dist/{chunk-EHHY34NR.js → chunk-LUMZ6MH4.js} +1 -1
  41. package/dist/{chunk-LJWU23D2.js → chunk-N7OULHAG.js} +1 -1
  42. package/dist/{chunk-D3RGSH6B.js → chunk-OA6RLG7O.js} +1 -1
  43. package/dist/{chunk-K2TO4DFJ.js → chunk-OR75SYIF.js} +1 -1
  44. package/dist/chunk-OXJTO55T.js +14 -0
  45. package/dist/{chunk-LXFLA3PZ.js → chunk-PAJAEUPA.js} +1 -1
  46. package/dist/{chunk-DYT22FTA.js → chunk-PMTQFMJS.js} +3 -2
  47. package/dist/{chunk-QJ7TUEDB.js → chunk-POKCUHCX.js} +1 -1
  48. package/dist/{chunk-UZVBQV4W.js → chunk-SMC6PSW3.js} +1 -1
  49. package/dist/{chunk-EXNQYSFO.js → chunk-TSVDOXFW.js} +2 -2
  50. package/dist/{chunk-OGCATVOP.js → chunk-UC3GBUZX.js} +1 -1
  51. package/dist/{chunk-ERLQA262.js → chunk-W4W2WB2Q.js} +1 -1
  52. package/dist/{chunk-4UVHLNUA.js → chunk-W6ZRUNED.js} +1 -1
  53. package/dist/{chunk-JHLJSHJ7.js → chunk-WVB7DLOS.js} +1 -1
  54. package/dist/{chunk-RJZS2CNP.js → chunk-XXCJJF7D.js} +1 -1
  55. package/dist/{chunk-DWZC3652.js → chunk-Y3UJGIRG.js} +2 -2
  56. package/dist/{chunk-4ATCY3BS.js → chunk-YBARKKEA.js} +2 -2
  57. package/dist/{chunk-T7Z6XJ3U.js → chunk-YN5SQ2S3.js} +1 -1
  58. package/dist/{chunk-MKNJHDF4.js → chunk-Z5HWW7IA.js} +1 -1
  59. package/dist/{chunk-X3FDKKVS.js → chunk-ZDIX7CXB.js} +1 -1
  60. package/dist/{chunk-R46Y2ODA.js → chunk-ZTRVHQBN.js} +1 -1
  61. package/dist/cli.js +18 -10
  62. package/dist/{commands-VAXOJGSE.js → commands-7JQ3Q7LQ.js} +3 -3
  63. package/dist/{commands-VAY4M4MI.js → commands-MYXURQSH.js} +14 -14
  64. package/dist/{commands-OKU5OXD5.js → commands-TXXFAYLK.js} +3 -3
  65. package/dist/{company-QLJ2IIJZ.js → company-ZXYLKF2D.js} +3 -3
  66. package/dist/{console-public-K5CP7KZJ.js → console-public-VFONCV4P.js} +1 -1
  67. package/dist/{content-ZC3O7XXZ.js → content-64NF5UTE.js} +2 -2
  68. package/dist/{contract-TO7G4MI3.js → contract-27KXCULT.js} +2 -2
  69. package/dist/{corporate-VRU5NXIJ.js → corporate-ENVDAAC6.js} +44 -29
  70. package/dist/{department-ILF3UVH6.js → department-4YXN7NH5.js} +1 -1
  71. package/dist/{deposit-OXXZTOJ2.js → deposit-IFAGVJM2.js} +2 -2
  72. package/dist/dist-6JBU3TAO.js +118 -0
  73. package/dist/{domain-knowledge-OXULU7MG.js → domain-knowledge-7BCNNJ2W.js} +2 -2
  74. package/dist/{estimate-YN4JKFJ2.js → estimate-LS4O2K52.js} +3 -3
  75. package/dist/{evaluation-7N52GMJE.js → evaluation-EOINCIYM.js} +2 -2
  76. package/dist/{expense-BG5K4MZV.js → expense-U7CKTSUZ.js} +2 -2
  77. package/dist/{faq-6SJJUW7K.js → faq-WPJUFQ2H.js} +2 -2
  78. package/dist/{fiscal-year-WXUZ3PFZ.js → fiscal-year-OPI3BJB4.js} +1 -1
  79. package/dist/{github-NYUKDMA7.js → github-UEMUGLTB.js} +6 -4
  80. package/dist/{github-git-ATC7VIW6.js → github-git-NOS7UF6U.js} +2 -2
  81. package/dist/{holiday-RF4VPQX3.js → holiday-33KSMBSC.js} +2 -2
  82. package/dist/{inquiry-4RVYKSRI.js → inquiry-YHNPURO7.js} +1 -1
  83. package/dist/{invoice-LOM6EYMA.js → invoice-MW6S2AAA.js} +3 -3
  84. package/dist/job-title-MDCVFN5Q.js +9 -0
  85. package/dist/{journal-DCKH6PAR.js → journal-77ZMS7HY.js} +1 -1
  86. package/dist/{knowledge-UUTQOVQX.js → knowledge-COASK7NE.js} +2 -2
  87. package/dist/{leave-2PH6MAPU.js → leave-5WOF2DDA.js} +2 -2
  88. package/dist/{license-WD2VND3X.js → license-RMADVMIV.js} +1 -1
  89. package/dist/{login-history-3ZLCYSBI.js → login-history-QRH2YPC4.js} +1 -1
  90. package/dist/{media-2COUCISC.js → media-2H5WKVSD.js} +2 -2
  91. package/dist/{note-ZG6PFBKY.js → note-JFYYSZU5.js} +2 -2
  92. package/dist/{notification-CALNSJ3C.js → notification-IXH4O6GP.js} +1 -1
  93. package/dist/{ojt-KIBELG5D.js → ojt-K3FTJQGX.js} +1 -1
  94. package/dist/{onedrive-NYRDUBIQ.js → onedrive-XEKSGQGW.js} +1 -1
  95. package/dist/{oneshot-CGOYLWED.js → oneshot-5HKU2WOQ.js} +1 -1
  96. package/dist/{outlook-IKZR2BEU.js → outlook-F7KOUSKF.js} +1 -1
  97. package/dist/{position-OG6O2OX5.js → position-3DTX5RHQ.js} +1 -1
  98. package/dist/project-DYEIEBOJ.js +5 -0
  99. package/dist/{prospect-ECQEHHXJ.js → prospect-A2SLAKFH.js} +2 -2
  100. package/dist/{purchase-KUIKNVP7.js → purchase-7M7MCIG6.js} +3 -3
  101. package/dist/{query-E22FS2XX.js → query-NHJP3NF2.js} +1 -1
  102. package/dist/{receivable-7EH4HZKF.js → receivable-VSMYUNZG.js} +2 -2
  103. package/dist/{redmine-HYXBVLBI.js → redmine-YRL464LU.js} +1 -1
  104. package/dist/{registry-MDZXZUVK.js → registry-QTB2R65J.js} +1 -1
  105. package/dist/report-O6NFPGDM.js +4 -0
  106. package/dist/{run-5VFEV3BR.js → run-O7MEIOHN.js} +2 -2
  107. package/dist/{runner-command-BQJ3WONI.js → runner-command-LUVEXFEQ.js} +1 -1
  108. package/dist/{sales-ai-review-7T4IUOQS.js → sales-ai-review-4TRFFU5S.js} +2 -2
  109. package/dist/{sales-master-HROKFBDJ.js → sales-master-KR4EIRV4.js} +2 -2
  110. package/dist/{sales-numbering-R4SEUE5Q.js → sales-numbering-3CU6SR3L.js} +2 -2
  111. package/dist/{schedule-command-QUJJ2KAZ.js → schedule-command-L6HKBRWO.js} +1 -1
  112. package/dist/schedule-def-command-C3LRTAB5.js +3 -0
  113. package/dist/{search-C3V45WZ7.js → search-VD65RZAT.js} +1 -1
  114. package/dist/{secret-57ZPEBCJ.js → secret-E2RB4DQC.js} +1 -1
  115. package/dist/{segment-5SZUWKND.js → segment-YMCTFOB6.js} +1 -1
  116. package/dist/{skill-MOMCYET5.js → skill-TNIRXSI6.js} +2 -2
  117. package/dist/{skill-check-GRJAEOGD.js → skill-check-2KWF7Z46.js} +2 -2
  118. package/dist/{skill-manage-command-5EPL2VZA.js → skill-manage-command-2QW3BA5K.js} +2 -2
  119. package/dist/{slack-PS5ACRYL.js → slack-FVTCEU7O.js} +1 -1
  120. package/dist/{sns-ING5W2OI.js → sns-O2OEFJFH.js} +10 -10
  121. package/dist/{staffing-board-QHMO4JCU.js → staffing-board-Y5IODSUA.js} +2 -2
  122. package/dist/{status-command-5HBUAGWX.js → status-command-XC7KWLLW.js} +2 -2
  123. package/dist/{supplier-payment-UCGCVGO2.js → supplier-payment-ETHK2FRP.js} +2 -2
  124. package/dist/{support-2FPYYMBI.js → support-6CZHQQWJ.js} +1 -1
  125. package/dist/{task-7VN5I6XX.js → task-VVSKXMBF.js} +34 -21
  126. package/dist/{teams-5FS7HVDE.js → teams-ZU74ECX2.js} +1 -1
  127. package/dist/{trigger-command-JXPPZBKT.js → trigger-command-UAPIZSYB.js} +2 -2
  128. package/dist/{user-DVI5ELJJ.js → user-XSHRNOFJ.js} +4 -4
  129. package/dist/{user-contract-type-N7U3IODP.js → user-contract-type-W5SINMOA.js} +1 -1
  130. package/dist/{user-group-3SZHZKQS.js → user-group-FSIJMVEE.js} +1 -1
  131. package/dist/{worker-agent-427IM4GL.js → worker-agent-BM2NK54B.js} +1 -1
  132. package/dist/{workflow-IMYQZ3KD.js → workflow-ZHLMKRHV.js} +2 -2
  133. package/package.json +1 -1
  134. package/dist/chunk-K54OB2BX.js +0 -14
  135. package/dist/dist-B4FAEXU4.js +0 -120
  136. package/dist/job-title-V72OVSVN.js +0 -8
  137. package/dist/project-OFJOODDU.js +0 -5
  138. package/dist/report-TU5CHEQB.js +0 -4
  139. package/dist/schedule-def-command-GOBV2HBH.js +0 -3
@@ -0,0 +1,118 @@
1
+ import { createRequire as __twpCreateRequire } from 'node:module';
2
+ const require = __twpCreateRequire(import.meta.url);
3
+ import"./chunk-VSJBJXZO.js";var CHILD_PROPS=["left","right","condition","child","operand","trueExpr","falseExpr","expression"];function pushChildren(node,stack){const n=node;for(const prop of CHILD_PROPS){const val=n[prop];if(val&&typeof val==="object"&&"type"in val){stack.push(val)}}if(Array.isArray(n.children)){for(const item of n.children){if(!item){continue}stack.push(item);if(item.type==="KeyValuePair"&&item.value){stack.push(item.value)}}}if(Array.isArray(n.bindings)){for(const item of n.bindings){if(!item){continue}
4
+ stack.push(item);if(item.reference){stack.push(item.reference)}}}}function forEachNode(root,visitor){const stack=[root];while(stack.length>0){const current=stack.pop();if(!current){break}if(visitor(current)===false){return}pushChildren(current,stack)}}function countNodes(root){let count=0;forEachNode(root,()=>{count+=1;return true});return count}function findDisallowedFunction(root,options){const{allowedFunctions,disallowedFunctions}=options;if(!allowedFunctions&&!disallowedFunctions){return null}
5
+ let violation=null;forEachNode(root,node=>{if(node.type!=="Function"){return true}const name=node.name;if(allowedFunctions&&!allowedFunctions.includes(name)){violation=`Function '${name}' is not allowed`;return false}if(disallowedFunctions&&disallowedFunctions.includes(name)){violation=`Function '${name}' is disallowed`;return false}return true});return violation}var isObject=obj=>{return obj!==null&&Object.prototype.toString.call(obj)==="[object Object]"};var strictDeepEqual=(first,second)=>{if(first===
6
+ second){return true}if(typeof first!==typeof second){return false}if(Array.isArray(first)&&Array.isArray(second)){if(first.length!==second.length){return false}for(let i=0;i<first.length;i+=1){if(!strictDeepEqual(first[i],second[i])){return false}}return true}if(isObject(first)&&isObject(second)){const keys=Object.keys(first);if(keys.length!==Object.keys(second).length){return false}return keys.every(key=>Object.prototype.hasOwnProperty.call(second,key)&&strictDeepEqual(first[key],second[key]))}
7
+ return false};var isFalse=obj=>{if(obj==null||obj===false){return true}if(typeof obj==="string"){return obj===""}if(typeof obj==="object"){return Array.isArray(obj)?obj.length===0:Object.keys(obj).length===0}return false};var isAlpha=ch=>{return ch>="a"&&ch<="z"||ch>="A"&&ch<="Z"||ch==="_"};var isNum=ch=>{return ch>="0"&&ch<="9"||ch==="-"};var isAlphaNum=ch=>{return isAlpha(ch)||ch>="0"&&ch<="9"};var ensureInteger=value=>{if(!(typeof value==="number")||Math.floor(value)!==value){throw new Error(
8
+ "invalid-value: expecting an integer.")}return value};var ensurePositiveInteger=value=>{if(!(typeof value==="number")||value<0||Math.floor(value)!==value){throw new Error("invalid-value: expecting a non-negative integer.")}return value};var ensureNumbers=(...operands)=>{for(let i=0;i<operands.length;i++){if(operands[i]===null||operands[i]===void 0){throw new Error("not-a-number: undefined")}if(typeof operands[i]!=="number"){throw new Error("not-a-number")}}};var notZero=n=>{n=+n;if(!n){throw new Error(
9
+ "not-a-number: divide by zero")}return n};var binOp=fn=>(left,right)=>{ensureNumbers(left,right);return fn(left,right)};var add=binOp((a,b)=>a+b);var sub=binOp((a,b)=>a-b);var mul=binOp((a,b)=>a*b);var divide=binOp((a,b)=>a/notZero(b));var div=binOp((a,b)=>Math.floor(a/notZero(b)));var mod=binOp((a,b)=>a%notZero(b));var basicTokens={"(":"Lparen",")":"Rparen","*":"Star",",":"Comma",".":"Dot",":":"Colon","@":"Current","]":"Rbracket","{":"Lbrace","}":"Rbrace","+":"Plus","%":"Modulo","?":"Question",
10
+ "\u2212":"Minus","\xD7":"Multiply","\xF7":"Divide"};var operatorStartToken={"!":true,"<":true,"=":true,">":true,"&":true,"|":true,"/":true};var skipChars={" ":true,"\n":true,"\r":true," ":true};var StreamLexer=class{_current=0;_enable_legacy_literals=false;tokenize(stream,options){const tokens=[];this._current=0;this._enable_legacy_literals=options?.enable_legacy_literals||false;let start;let identifier;let token;while(this._current<stream.length){if(isAlpha(stream[this._current])){start=this._current;
11
+ identifier=this.consumeUnquotedIdentifier(stream);tokens.push({start,type:"UnquotedIdentifier",value:identifier})}else if(basicTokens[stream[this._current]]!==void 0){tokens.push({start:this._current,type:basicTokens[stream[this._current]],value:stream[this._current]});this._current+=1}else if(stream[this._current]==="$"){start=this._current;if(this._current+1<stream.length&&isAlpha(stream[this._current+1])){this._current+=1;identifier=this.consumeUnquotedIdentifier(stream);tokens.push({start,type:"\
12
+ Variable",value:identifier})}else{tokens.push({start,type:"Root",value:stream[this._current]});this._current+=1}}else if(stream[this._current]==="-"){if(this._current+1<stream.length&&isNum(stream[this._current+1])){const token2=this.consumeNumber(stream);token2&&tokens.push(token2)}else{const token2={start:this._current,type:"Minus",value:"-"};tokens.push(token2);this._current+=1}}else if(isNum(stream[this._current])){token=this.consumeNumber(stream);tokens.push(token)}else if(stream[this._current]===
13
+ "["){token=this.consumeLBracket(stream);tokens.push(token)}else if(stream[this._current]==='"'){start=this._current;identifier=this.consumeQuotedIdentifier(stream);tokens.push({start,type:"QuotedIdentifier",value:identifier})}else if(stream[this._current]===`'`){start=this._current;identifier=this.consumeRawStringLiteral(stream);tokens.push({start,type:"Literal",value:identifier})}else if(stream[this._current]==="`"){start=this._current;const literal=this.consumeLiteral(stream);tokens.push({start,
14
+ type:"Literal",value:literal})}else if(operatorStartToken[stream[this._current]]!==void 0){token=this.consumeOperator(stream);token&&tokens.push(token)}else if(skipChars[stream[this._current]]!==void 0){this._current+=1}else{const error=new Error(`Syntax error: unknown character: ${stream[this._current]}`);error.name="LexerError";throw error}}return tokens}consumeUnquotedIdentifier(stream){const start=this._current;this._current+=1;while(this._current<stream.length&&isAlphaNum(stream[this._current])){
15
+ this._current+=1}return stream.slice(start,this._current)}consumeUntil(stream,delimiter){const start=this._current;this._current+=1;const len=stream.length;while(this._current<len&&stream[this._current]!==delimiter){if(stream[this._current]==="\\"&&(stream[this._current+1]==="\\"||stream[this._current+1]===delimiter)){this._current+=2}else{this._current+=1}}if(this._current<len){this._current+=1}return stream.slice(start,this._current)}consumeQuotedIdentifier(stream){const raw=this.consumeUntil(
16
+ stream,'"');const[value,ok]=this.parseJSON(raw);if(!ok){const error=new Error("syntax: unexpected end of JSON input");error.name="LexerError";throw error}return value}consumeRawStringLiteral(stream){const raw=this.consumeUntil(stream,"'");if(!raw.endsWith("'")||raw.length<2){const error=new Error("Syntax error: unclosed single quote");error.name="LexerError";throw error}const content=raw.slice(1,-1);return content.replace(/\\(['\\])/g,"$1")}consumeNumber(stream){const start=this._current;this._current+=
17
+ 1;const maxLength=stream.length;while(isNum(stream[this._current])&&this._current<maxLength){this._current+=1}const value=parseInt(stream.slice(start,this._current),10);return{start,value,type:"Number"}}consumeLBracket(stream){const start=this._current;this._current+=1;if(stream[this._current]==="?"){this._current+=1;return{start,type:"Filter",value:"[?"}}if(stream[this._current]==="]"){this._current+=1;return{start,type:"Flatten",value:"[]"}}return{start,type:"Lbracket",value:"["}}consumeOrElse(stream,peek,token,orElse){
18
+ const start=this._current;this._current+=1;if(this._current<stream.length&&stream[this._current]===peek){this._current+=1;return{start,type:orElse,value:stream.slice(start,this._current)}}return{start,type:token,value:stream[start]}}consumeOperator(stream){const start=this._current;const startingChar=stream[start];switch(startingChar){case"!":return this.consumeOrElse(stream,"=","Not","NE");case"<":return this.consumeOrElse(stream,"=","LT","LTE");case">":return this.consumeOrElse(stream,"=","GT",
19
+ "GTE");case"=":return this.consumeOrElse(stream,"=","Assign","EQ");case"&":return this.consumeOrElse(stream,"&","Expref","And");case"|":return this.consumeOrElse(stream,"|","Pipe","Or");case"/":return this.consumeOrElse(stream,"/","Divide","Div")}}consumeLiteral(stream){const raw=this.consumeUntil(stream,"`");const inner=raw.endsWith("`")&&raw.length>1?raw.slice(1,-1):raw.slice(1);const literalString=inner.trimStart().replace("\\`","`");let[literal,ok]=this.parseJSON(literalString);if(!ok&&this.
20
+ _enable_legacy_literals){[literal,ok]=this.parseJSON(`"${literalString}"`)}if(!ok){const error=new Error(`Syntax error: unexpected end of JSON input or invalid format for a JSON literal: ${stream[this._current-1]??""}`);error.name="LexerError";throw error}return literal}parseJSON(text){try{const json=JSON.parse(text);return[json,true]}catch{return[null,false]}}};var Lexer=new StreamLexer;var Lexer_default=Lexer;var bindingPower={["EOF"]:0,["Variable"]:0,["UnquotedIdentifier"]:0,["QuotedIdentifie\
21
+ r"]:0,["Rbracket"]:0,["Rparen"]:0,["Comma"]:0,["Rbrace"]:0,["Number"]:0,["Current"]:0,["Expref"]:0,["Root"]:0,["Assign"]:1,["Pipe"]:1,["Question"]:2,["Or"]:3,["And"]:4,["EQ"]:5,["GT"]:5,["LT"]:5,["GTE"]:5,["LTE"]:5,["NE"]:5,["Minus"]:6,["Plus"]:6,["Div"]:7,["Divide"]:7,["Modulo"]:7,["Multiply"]:7,["Flatten"]:9,["Star"]:20,["Filter"]:21,["Dot"]:40,["Not"]:45,["Lbrace"]:50,["Lbracket"]:55,["Lparen"]:60};var DEFAULT_MAX_DEPTH=1e3;var TokenParser=class _TokenParser{index=0;tokens=[];depth=0;maxDepth=DEFAULT_MAX_DEPTH;nodeCount=0;maxNodes;parse(expression,options){
22
+ this.loadTokens(expression,options||{enable_legacy_literals:false});this.index=0;this.depth=0;this.nodeCount=0;this.maxDepth=options?.maxDepth??DEFAULT_MAX_DEPTH;this.maxNodes=options?.maxNodes;const ast=this.expression(0);if(this.lookahead(0)!=="EOF"){const token=this.lookaheadToken(0);this.errorToken(token,`Syntax error: unexpected token type: ${token.type}, value: ${token.value}`)}if(this.maxNodes!==void 0&&countNodes(ast)>this.maxNodes){throw new Error(`Expression exceeds maximum allowed nod\
23
+ e count of ${this.maxNodes}`)}return ast}loadTokens(expression,options){this.tokens=Lexer_default.tokenize(expression,options);this.tokens.push({type:"EOF",value:"",start:expression.length})}expression(rbp){if(this.depth>=this.maxDepth){throw new Error(`Expression exceeds maximum allowed depth of ${this.maxDepth}`)}this.depth+=1;this.trackNode();try{const leftToken=this.lookaheadToken(0);this.advance();let left=this.nud(leftToken);let currentTokenType=this.lookahead(0);while(rbp<bindingPower[currentTokenType]){
24
+ this.trackNode();this.advance();left=this.led(currentTokenType,left);currentTokenType=this.lookahead(0)}return left}finally{this.depth-=1}}trackNode(){this.nodeCount+=1;if(this.maxNodes!==void 0&&this.nodeCount>this.maxNodes){throw new Error(`Expression exceeds maximum allowed node count of ${this.maxNodes}`)}}lookahead(offset){return this.tokens[this.index+offset].type}lookaheadToken(offset){return this.tokens[this.index+offset]}advance(){this.index+=1}nud(token){switch(token.type){case"Variabl\
25
+ e":return{type:"Variable",name:token.value};case"Literal":return{type:"Literal",value:token.value};case"UnquotedIdentifier":{if(_TokenParser.isKeyword(token,"let")&&this.lookahead(0)==="Variable"){return this.parseLetExpression()}else{return{type:"Field",name:token.value}}}case"QuotedIdentifier":if(this.lookahead(0)==="Lparen"){throw new Error("Syntax error: quoted identifier not allowed for function names.")}else{return{type:"Field",name:token.value}}case"Not":{const child=this.expression(bindingPower.
26
+ Not);return{type:"NotExpression",child}}case"Minus":{const child=this.expression(bindingPower.Minus);return{type:"Unary",operator:token.type,operand:child}}case"Plus":{const child=this.expression(bindingPower.Plus);return{type:"Unary",operator:token.type,operand:child}}case"Star":{const left={type:"Identity"};return{type:"ValueProjection",left,right:this.parseProjectionRHS(bindingPower.Star)}}case"Filter":return this.led(token.type,{type:"Identity"});case"Lbrace":return this.parseMultiselectHash();case"\
27
+ Flatten":{const left={type:"Flatten",child:{type:"Identity"}};const right=this.parseProjectionRHS(bindingPower.Flatten);return{type:"Projection",left,right}}case"Lbracket":{if(this.lookahead(0)==="Number"||this.lookahead(0)==="Colon"){const right=this.parseIndexExpression();return this.projectIfSlice({type:"Identity"},right)}if(this.lookahead(0)==="Star"&&this.lookahead(1)==="Rbracket"){this.advance();this.advance();const right=this.parseProjectionRHS(bindingPower.Star);return{left:{type:"Identi\
28
+ ty"},right,type:"Projection"}}return this.parseMultiselectList()}case"Current":return{type:"Current"};case"Root":return{type:"Root"};case"Expref":{const child=this.expression(bindingPower.Expref);return{type:"ExpressionReference",child}}case"Lparen":{const expression=this.expression(0);this.match("Rparen");return expression}default:this.errorToken(token)}}led(tokenName,left){switch(tokenName){case"Question":{const trueExpr=this.expression(0);this.match("Colon");const falseExpr=this.expression(0);
29
+ return{type:"Ternary",condition:left,trueExpr,falseExpr}}case"Dot":{const rbp=bindingPower.Dot;if(this.lookahead(0)!=="Star"){const right2=this.parseDotRHS(rbp);return{type:"Subexpression",left,right:right2}}this.advance();const right=this.parseProjectionRHS(rbp);return{type:"ValueProjection",left,right}}case"Pipe":{const right=this.expression(bindingPower.Pipe);return{type:"Pipe",left,right}}case"Or":{const right=this.expression(bindingPower.Or);return{type:"OrExpression",left,right}}case"And":{
30
+ const right=this.expression(bindingPower.And);return{type:"AndExpression",left,right}}case"Lparen":{if(left.type!=="Field"){throw new Error("Syntax error: expected a Field node")}const name=left.name;const args=this.parseCommaSeparatedExpressionsUntilToken("Rparen");const node={name,type:"Function",children:args};return node}case"Filter":{const condition=this.expression(0);this.match("Rbracket");const right=this.lookahead(0)==="Flatten"?{type:"Identity"}:this.parseProjectionRHS(bindingPower.Filter);
31
+ return{type:"FilterProjection",left,right,condition}}case"Flatten":{const leftNode={type:"Flatten",child:left};const right=this.parseProjectionRHS(bindingPower.Flatten);return{type:"Projection",left:leftNode,right}}case"Assign":{const leftNode=left;const right=this.expression(0);return{type:"Binding",variable:leftNode.name,reference:right}}case"EQ":case"NE":case"GT":case"GTE":case"LT":case"LTE":return this.parseComparator(left,tokenName);case"Plus":case"Minus":case"Multiply":case"Star":case"Divi\
32
+ de":case"Modulo":case"Div":return this.parseArithmetic(left,tokenName);case"Lbracket":{const token=this.lookaheadToken(0);if(token.type==="Number"||token.type==="Colon"){const right2=this.parseIndexExpression();return this.projectIfSlice(left,right2)}this.match("Star");this.match("Rbracket");const right=this.parseProjectionRHS(bindingPower.Star);return{type:"Projection",left,right}}default:return this.errorToken(this.lookaheadToken(0))}}static isKeyword(token,keyword){return token.type==="Unquot\
33
+ edIdentifier"&&token.value===keyword}match(tokenType){if(this.lookahead(0)===tokenType){this.advance();return}else{const token=this.lookaheadToken(0);this.errorToken(token,`Syntax error: expected ${tokenType}, got: ${token.type}`)}}errorToken(token,message=""){const error=new Error(message||`Syntax error: invalid token (${token.type}): "${token.value}"`);error.name="ParserError";throw error}parseIndexExpression(){if(this.lookahead(0)==="Colon"||this.lookahead(1)==="Colon"){return this.parseSliceExpression()}
34
+ const value=Number(this.lookaheadToken(0).value);this.advance();this.match("Rbracket");return{type:"Index",value}}projectIfSlice(left,right){const indexExpr={type:"IndexExpression",left,right};if(right.type==="Slice"){const rhs=this.parseProjectionRHS(bindingPower.Star);if(rhs.type==="Identity"){return indexExpr}return{left:indexExpr,right:rhs,type:"Projection"}}return indexExpr}parseSliceExpression(){const parts=[null,null,null];let index=0;let current=this.lookaheadToken(0);while(current.type!=
35
+ "Rbracket"&&index<3){if(current.type==="Colon"){index++;if(index===3){this.errorToken(this.lookaheadToken(0),"Syntax error, too many colons in slice expression")}this.advance()}else if(current.type==="Number"&&parts[index]===null){const part=this.lookaheadToken(0).value;parts[index]=part;this.advance()}else{const next=this.lookaheadToken(0);this.errorToken(next,`Syntax error, unexpected token: ${next.value}(${next.type})`)}current=this.lookaheadToken(0)}this.match("Rbracket");const[start,stop,step]=parts;
36
+ return{type:"Slice",start,stop,step}}parseLetExpression(){const separated=this.parseCommaSeparatedExpressionsUntilKeyword("in");const expression=this.expression(0);const bindings=separated.map(binding=>binding);return{type:"LetExpression",bindings,expression}}parseCommaSeparatedExpressionsUntilKeyword(keyword){return this.parseCommaSeparatedExpressionsUntil(()=>{return _TokenParser.isKeyword(this.lookaheadToken(0),keyword)},()=>{this.advance()})}parseCommaSeparatedExpressionsUntilToken(token){return this.
37
+ parseCommaSeparatedExpressionsUntil(()=>{return this.lookahead(0)===token},()=>{return this.match(token)})}parseCommaSeparatedExpressionsUntil(isEndToken,matchEndToken){const args=[];let expression;while(!isEndToken()){expression=this.expression(0);if(this.lookahead(0)==="Comma"){this.match("Comma")}args.push(expression)}matchEndToken();return args}parseComparator(left,comparator){const right=this.expression(bindingPower[comparator]);return{type:"Comparator",name:comparator,left,right}}parseArithmetic(left,operator){
38
+ const right=this.expression(bindingPower[operator]);return{type:"Arithmetic",operator,left,right}}parseDotRHS(rbp){const lookahead=this.lookahead(0);const exprTokens=["UnquotedIdentifier","QuotedIdentifier","Star"];if(exprTokens.includes(lookahead)){return this.expression(rbp)}if(lookahead==="Lbracket"){this.match("Lbracket");return this.parseMultiselectList()}if(lookahead==="Lbrace"){this.match("Lbrace");return this.parseMultiselectHash()}const token=this.lookaheadToken(0);this.errorToken(token,
39
+ `Syntax error, unexpected token: ${token.value}(${token.type})`)}parseProjectionRHS(rbp){if(bindingPower[this.lookahead(0)]<10){return{type:"Identity"}}if(this.lookahead(0)==="Lbracket"){return this.expression(rbp)}if(this.lookahead(0)==="Filter"){return this.expression(rbp)}if(this.lookahead(0)==="Dot"){this.match("Dot");return this.parseDotRHS(rbp)}const token=this.lookaheadToken(0);this.errorToken(token,`Syntax error, unexpected token: ${token.value}(${token.type})`)}parseMultiselectList(){const expressions=[];
40
+ while(this.lookahead(0)!=="Rbracket"){const expression=this.expression(0);expressions.push(expression);if(this.lookahead(0)==="Comma"){this.match("Comma");if(this.lookahead(0)==="Rbracket"){throw new Error("Syntax error: unexpected token Rbracket")}}else if(this.lookahead(0)!=="Rbracket"){const token=this.lookaheadToken(0);this.errorToken(token,`Syntax error: unexpected token: ${token.value}(${token.type})`)}}this.match("Rbracket");return{type:"MultiSelectList",children:expressions}}parseMultiselectHash(){
41
+ const pairs=[];const identifierTypes=["UnquotedIdentifier","QuotedIdentifier"];let keyToken;let keyName;let value;for(;;){keyToken=this.lookaheadToken(0);if(!identifierTypes.includes(keyToken.type)){throw new Error(`Syntax error: expecting an identifier token, got: ${keyToken.type}`)}keyName=keyToken.value;this.advance();this.match("Colon");value=this.expression(0);pairs.push({value,type:"KeyValuePair",name:keyName});if(this.lookahead(0)==="Comma"){this.match("Comma")}else if(this.lookahead(0)===
42
+ "Rbrace"){this.match("Rbrace");break}else{const token=this.lookaheadToken(0);this.errorToken(token,`Syntax error: unexpected token: ${token.value}(${token.type})`)}}return{type:"MultiSelectHash",children:pairs}}};var Parser=new TokenParser;var Parser_default=Parser;var normalizeBounds=(len,start,end)=>{let s2=ensureInteger(start??0);if(s2<0){s2=Math.max(0,len+s2)}let e=ensureInteger(end??len);if(e<0){e=Math.max(0,len+e)}return[s2,Math.min(len,e)]};var findFirst=(subject,sub2,start,end)=>{if(!subject||
43
+ !sub2){return null}const chars=[...subject];const[s2,e]=normalizeBounds(chars.length,start,end);const target=chars.slice(s2,e).join("");const idx=target.indexOf(sub2);return idx===-1?null:[...target.slice(0,idx)].length+s2};var findLast=(subject,sub2,start,end)=>{if(!subject||!sub2){return null}const chars=[...subject];const[s2,e]=normalizeBounds(chars.length,start,end);const target=chars.slice(s2,e).join("");const idx=target.lastIndexOf(sub2);return idx===-1?null:[...target.slice(0,idx)].length+
44
+ s2};var createPad=(isLeft,name)=>(subject,width,padding=" ")=>{if([...padding].length!==1){throw new Error(`invalid value, ${name} expects its 'pad' parameter to be a valid string with a single codepoint`)}ensurePositiveInteger(width);if(!subject){return""}const padLen=width-[...subject].length;if(padLen<=0){return subject}const pad=padding.repeat(padLen);return isLeft?pad+subject:subject+pad};var padLeft=createPad(true,"pad_left");var padRight=createPad(false,"pad_right");var replace=(subject,string,by,count)=>{
45
+ if(count===0){return subject}const parts=subject.split(string);if(count===null||count===void 0){return parts.join(by)}ensurePositiveInteger(count);const head=parts.slice(0,count+1).join(by);const tail=parts.slice(count+1).join(string);return tail.length>0?head+string+tail:head};var split=(subject,search2,count)=>{if(subject.length===0&&search2.length===0){return[]}if(count!==null&&count!==void 0){ensurePositiveInteger(count);if(count===0){return[subject]}}const parts=search2===""?[...subject]:subject.
46
+ split(search2);if(count===null||count===void 0){return parts}return[...parts.slice(0,count),parts.slice(count).join(search2)]};var trimImpl=(subject,pattern,chars)=>{const charClass=chars?chars.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"):"\\s\x85";return subject.replace(new RegExp(pattern.replace("%s",charClass),"u"),"")};var trimLeft=(subject,chars)=>trimImpl(subject,"^[%s]+",chars);var trimRight=(subject,chars)=>trimImpl(subject,"[%s]+$",chars);var trim=(subject,chars)=>trimLeft(trimRight(subject,
47
+ chars),chars);var compareStrings=(a,b)=>{if(a===b){return 0}const itA=a[Symbol.iterator]();const itB=b[Symbol.iterator]();while(true){const nextA=itA.next();const nextB=itB.next();if(nextA.done||nextB.done){return nextA.done&&nextB.done?0:nextA.done?-1:1}if(nextA.value!==nextB.value){return nextA.value.codePointAt(0)>nextB.value.codePointAt(0)?1:-1}}};var Text=class{constructor(string){this.string=string}get length(){return[...this.string].length}compareTo(other){return compareStrings(this.string,
48
+ other)}static comparer=compareStrings;static compareStrings=compareStrings};var InputArgument=(InputArgument2=>{InputArgument2[InputArgument2["TYPE_NUMBER"]=0]="TYPE_NUMBER";InputArgument2[InputArgument2["TYPE_ANY"]=1]="TYPE_ANY";InputArgument2[InputArgument2["TYPE_STRING"]=2]="TYPE_STRING";InputArgument2[InputArgument2["TYPE_ARRAY"]=3]="TYPE_ARRAY";InputArgument2[InputArgument2["TYPE_OBJECT"]=4]="TYPE_OBJECT";InputArgument2[InputArgument2["TYPE_BOOLEAN"]=5]="TYPE_BOOLEAN";InputArgument2[InputArgument2["\
49
+ TYPE_EXPREF"]=6]="TYPE_EXPREF";InputArgument2[InputArgument2["TYPE_NULL"]=7]="TYPE_NULL";InputArgument2[InputArgument2["TYPE_ARRAY_NUMBER"]=8]="TYPE_ARRAY_NUMBER";InputArgument2[InputArgument2["TYPE_ARRAY_STRING"]=9]="TYPE_ARRAY_STRING";InputArgument2[InputArgument2["TYPE_ARRAY_OBJECT"]=10]="TYPE_ARRAY_OBJECT";InputArgument2[InputArgument2["TYPE_ARRAY_ARRAY"]=11]="TYPE_ARRAY_ARRAY";return InputArgument2})(InputArgument||{});var ARRAY_SUBTYPES={[8]:0,[10]:4,[9]:2,[11]:3};var JSON_NUMBER_REGEX=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
50
+ var s=(...types)=>types.map(t=>({types:Array.isArray(t)?t:[t]}));var opt=(...types)=>types.map(t=>({types:Array.isArray(t)?t:[t],optional:true}));var variadic=(...types)=>types.map(t=>({types:Array.isArray(t)?t:[t],variadic:true}));var optVariadic=(...types)=>types.map(t=>({types:Array.isArray(t)?t:[t],variadic:true,optional:true}));var{TYPE_NUMBER:NUM,TYPE_ANY:ANY,TYPE_STRING:STR,TYPE_ARRAY:ARR,TYPE_OBJECT:OBJ,TYPE_EXPREF:EXP,TYPE_ARRAY_NUMBER:ARR_NUM,TYPE_ARRAY_STRING:ARR_STR,TYPE_ARRAY_ARRAY:ARR_ARR}=InputArgument;
51
+ var Runtime=class{_interpreter;_functionTable;_customFunctions=new Set;TYPE_NAME_TABLE=Object.freeze(["number","any","string","array","object","boolean","expression","null","Array<number>","Array<string>","Array<object>","Array<Array<any>>"]);constructor(interpreter){this._interpreter=interpreter;this._functionTable=this.buildFunctionTable()}buildFunctionTable(){return{abs:{_func:([v])=>Math.abs(v),_signature:s(NUM)},ceil:{_func:([v])=>Math.ceil(v),_signature:s(NUM)},floor:{_func:([v])=>Math.floor(
52
+ v),_signature:s(NUM)},lower:{_func:([s2])=>s2.toLowerCase(),_signature:s(STR)},upper:{_func:([s2])=>s2.toUpperCase(),_signature:s(STR)},keys:{_func:([o])=>Object.keys(o),_signature:s(OBJ)},values:{_func:([o])=>Object.values(o),_signature:s(OBJ)},avg:{_func:([arr])=>arr&&arr.length?arr.reduce((a,b)=>a+b,0)/arr.length:null,_signature:s(ARR_NUM)},contains:{_func:this.functionContains,_signature:s([STR,ARR],ANY)},ends_with:{_func:([str,suf])=>str.endsWith(suf),_signature:s(STR,STR)},find_first:{_func:([
53
+ s2,sub2,st,en])=>findFirst(s2,sub2,st,en),_signature:[...s(STR,STR),...opt(NUM,NUM)]},find_last:{_func:([s2,sub2,st,en])=>findLast(s2,sub2,st,en),_signature:[...s(STR,STR),...opt(NUM,NUM)]},from_items:{_func:this.functionFromItems,_signature:s(ARR_ARR)},group_by:{_func:this.functionGroupBy,_signature:s(ARR,EXP)},items:{_func:([o])=>Object.entries(o),_signature:s(OBJ)},join:{_func:([sep,arr])=>arr.join(sep),_signature:s(STR,ARR_STR)},length:{_func:([v])=>typeof v==="string"?[...v].length:Array.isArray(
54
+ v)?v.length:Object.keys(v).length,_signature:s([STR,ARR,OBJ])},map:{_func:this.functionMap,_signature:s(EXP,ARR)},max:{_func:([v])=>this.findExtreme(v,cmp=>cmp>0,Math.max),_signature:s([ARR_NUM,ARR_STR])},max_by:{_func:args=>this.findExtremeBy(args,cmp=>cmp>0),_signature:s(ARR,EXP)},merge:{_func:args=>Object.assign({},...args),_signature:optVariadic(OBJ)},min:{_func:([v])=>this.findExtreme(v,cmp=>cmp<0,Math.min),_signature:s([ARR_NUM,ARR_STR])},min_by:{_func:args=>this.findExtremeBy(args,cmp=>cmp<
55
+ 0),_signature:s(ARR,EXP)},not_null:{_func:args=>args.find(arg=>arg!==null)??null,_signature:variadic(ANY)},pad_left:{_func:([s2,w,p])=>padLeft(s2,w,p),_signature:[...s(STR,NUM),...opt(STR)]},pad_right:{_func:([s2,w,p])=>padRight(s2,w,p),_signature:[...s(STR,NUM),...opt(STR)]},replace:{_func:([s2,str,by,c])=>replace(s2,str,by,c),_signature:[...s(STR,STR,STR),...opt(NUM)]},reverse:{_func:([v])=>typeof v==="string"?[...v].reverse().join(""):[...v].reverse(),_signature:s([STR,ARR])},sort:{_func:this.
56
+ functionSort,_signature:s([ARR_STR,ARR_NUM])},sort_by:{_func:this.functionSortBy,_signature:s(ARR,EXP)},split:{_func:([s2,sub2,c])=>split(s2,sub2,c),_signature:[...s(STR,STR),...opt(NUM)]},starts_with:{_func:([str,pre])=>str.startsWith(pre),_signature:s(STR,STR)},sum:{_func:([arr])=>arr.reduce((x,y)=>x+y,0),_signature:s(ARR_NUM)},to_array:{_func:([v])=>Array.isArray(v)?v:[v],_signature:s(ANY)},to_number:{_func:this.functionToNumber,_signature:s(ANY)},to_string:{_func:([v])=>typeof v==="string"?v:
57
+ JSON.stringify(v),_signature:s(ANY)},trim:{_func:([s2,c])=>trim(s2,c),_signature:[...s(STR),...opt(STR)]},trim_left:{_func:([s2,c])=>trimLeft(s2,c),_signature:[...s(STR),...opt(STR)]},trim_right:{_func:([s2,c])=>trimRight(s2,c),_signature:[...s(STR),...opt(STR)]},type:{_func:this.functionType,_signature:s(ANY)},zip:{_func:this.functionZip,_signature:variadic(ARR)}}}registerFunction(name,customFunction,signature,options){const result=this._registerInternal(name,customFunction,signature,options);if(!result.
58
+ success){throw new Error(result.message)}}_registerInternal(name,customFunction,signature,options={}){if(!name||typeof name!=="string"||name.trim()===""){return{success:false,reason:"invalid-name",message:"Function name must be a non-empty string"}}try{this.validateInputSignatures(name,signature)}catch(error){return{success:false,reason:"invalid-signature",message:error instanceof Error?error.message:"Invalid function signature"}}const{override=false,warn=false}=options;const exists=name in this.
59
+ _functionTable;if(exists&&!override){return{success:false,reason:"already-exists",message:`Function already defined: ${name}(). Use { override: true } to replace it.`}}if(exists&&override&&warn){console.warn(`Warning: Overriding existing function: ${name}()`)}this._functionTable[name]={_func:customFunction.bind(this),_signature:signature};this._customFunctions.add(name);const message=exists?`Function ${name}() overridden successfully`:`Function ${name}() registered successfully`;return{success:true,
60
+ message}}register(name,customFunction,signature,options={}){return this._registerInternal(name,customFunction,signature,options)}unregister(name){if(!this._customFunctions.has(name)){return false}delete this._functionTable[name];this._customFunctions.delete(name);return true}isRegistered(name){return name in this._functionTable}getRegistered(){return Object.keys(this._functionTable)}getCustomFunctions(){return Array.from(this._customFunctions)}clearCustomFunctions(){for(const name of this._customFunctions){
61
+ delete this._functionTable[name]}this._customFunctions.clear()}callFunction(name,resolvedArgs){const functionEntry=this._functionTable[name];if(functionEntry===void 0){throw new Error(`Unknown function: ${name}()`)}this.validateArgs(name,resolvedArgs,functionEntry._signature);return functionEntry._func.call(this,resolvedArgs)}validateInputSignatures(name,signature){for(let i=0;i<signature.length;i+=1){if("variadic"in signature[i]&&i!==signature.length-1){throw new Error(`Invalid arity: ${name}()\
62
+ 'variadic' argument ${i+1} must occur last`)}}}validateArgs(name,args,signature){this.validateInputSignatures(name,signature);this.validateArity(name,args,signature);this.validateTypes(name,args,signature)}validateArity(name,args,signature){const numberOfRequiredArgs=signature.filter(argSignature=>!(argSignature.optional??false)).length;const lastArgIsVariadic=signature[signature.length-1]?.variadic??false;const tooFewArgs=args.length<numberOfRequiredArgs;const tooManyArgs=args.length>signature.
63
+ length;if(lastArgIsVariadic&&tooFewArgs||!lastArgIsVariadic&&(tooFewArgs||tooManyArgs)){const tooFewModifier=tooFewArgs&&(!lastArgIsVariadic&&numberOfRequiredArgs>1||lastArgIsVariadic)?"at least ":"";const pluralized=signature.length>1;throw new Error(`Invalid arity: ${name}() takes ${tooFewModifier}${numberOfRequiredArgs} argument${pluralized&&"s"||""} but received ${args.length}`)}}validateTypes(name,args,signature){const lastSigIndex=signature.length-1;const isVariadic=signature[lastSigIndex]?.
64
+ variadic??false;for(let i=0;i<args.length;i+=1){const sig=i<signature.length?signature[i]:isVariadic?signature[lastSigIndex]:void 0;if(!sig){continue}const currentSpec=sig.types;const actualType=this.getTypeName(args[i]);if(actualType===void 0){continue}const typeMatched=currentSpec.some(expectedType=>this.typeMatches(actualType,expectedType,args[i]));if(!typeMatched){const expected=currentSpec.map(typeId=>this.TYPE_NAME_TABLE[typeId]).join(" | ");throw new Error(`Invalid type: ${name}() expecte\
65
+ d argument ${i+1} to be type (${expected}) but received type ${this.TYPE_NAME_TABLE[actualType]} instead.`)}}}typeMatches(actual,expected,argValue){if(expected===1){return true}const subtype=ARRAY_SUBTYPES[expected];if(subtype!==void 0){if(actual!==3){return false}const array=argValue;return array.every(item=>{const typeName=this.getTypeName(item);return typeName===void 0||this.typeMatches(typeName,subtype,item)})}return actual===expected}getTypeName(obj){if(obj===null){return 7}if(typeof obj===
66
+ "string"){return 2}if(typeof obj==="number"){return 0}if(typeof obj==="boolean"){return 5}if(Array.isArray(obj)){return 3}if(typeof obj==="object"){if(obj.expref){return 6}return 4}return}createKeyFunction(exprefNode,allowedTypes){const interpreter=this._interpreter;const keyFunc=x=>{const current=interpreter.visit(exprefNode,x);if(!allowedTypes.includes(this.getTypeName(current))){const msg=`Invalid type: expected one of (${allowedTypes.map(t=>this.TYPE_NAME_TABLE[t]).join(" | ")}), received ${this.
67
+ TYPE_NAME_TABLE[this.getTypeName(current)]}`;throw new Error(msg)}return current};return keyFunc}functionContains=([searchable,searchValue])=>{if(Array.isArray(searchable)){const array=searchable;return array.includes(searchValue)}if(typeof searchable==="string"){const text=searchable;if(typeof searchValue==="string"){return text.includes(searchValue)}return false}return null};functionFromItems=([array])=>{for(const pair of array){if(pair.length!==2||typeof pair[0]!=="string"){throw new Error("i\
68
+ nvalid value, each array must contain two elements, a pair of string and value")}}return Object.fromEntries(array)};functionGroupBy=([array,exprefNode])=>{const interpreter=this._interpreter;if(!interpreter){return{}}const groups=new Map;for(const item of array){const raw=interpreter.visit(exprefNode,item);if(raw===null||raw===void 0){continue}if(typeof raw!=="string"){const type=this.getTypeName(raw);throw new Error(`Invalid type: expected one of (${this.TYPE_NAME_TABLE[2]}), received ${this.TYPE_NAME_TABLE[type]}`)}
69
+ let group=groups.get(raw);if(!group){group=[];groups.set(raw,group)}group.push(item)}return Object.fromEntries(groups)};functionMap=([exprefNode,elements])=>{if(!this._interpreter){return[]}const mapped=[];const interpreter=this._interpreter;for(let i=0;i<elements.length;i+=1){mapped.push(interpreter.visit(exprefNode,elements[i]))}return mapped};findExtreme(inputValue,isBetter,mathFn){if(!inputValue.length){return null}if(this.getTypeName(inputValue[0])===0){return mathFn(...inputValue)}const elements=inputValue;
70
+ let extreme=elements[0];for(let i=1;i<elements.length;i+=1){if(isBetter(Text.comparer(elements[i],extreme))){extreme=elements[i]}}return extreme}findExtremeBy(resolvedArgs,isBetter){const resolvedArray=resolvedArgs[0];if(!resolvedArray.length){return null}const exprefNode=resolvedArgs[1];const interpreter=this._interpreter;if(!interpreter){return null}const firstKey=interpreter.visit(exprefNode,resolvedArray[0]);const firstType=this.getTypeName(firstKey);if(firstType!==0&&firstType!==2){throw new Error(
71
+ `Invalid type: expected one of (${this.TYPE_NAME_TABLE[0]} | ${this.TYPE_NAME_TABLE[2]}), received ${this.TYPE_NAME_TABLE[firstType]}`)}let extremeRecord=resolvedArray[0];let extremeKey=firstKey;for(let i=1;i<resolvedArray.length;i+=1){const currentKey=interpreter.visit(exprefNode,resolvedArray[i]);const currentType=this.getTypeName(currentKey);if(currentType!==firstType){throw new Error(`Invalid type: expected (${this.TYPE_NAME_TABLE[firstType]}), received ${this.TYPE_NAME_TABLE[currentType]}`)}
72
+ const cmp=firstType===0?currentKey-extremeKey:Text.comparer(currentKey,extremeKey);if(isBetter(cmp)){extremeKey=currentKey;extremeRecord=resolvedArray[i]}}return extremeRecord}functionSort=([inputValue])=>inputValue.length<=1?inputValue:typeof inputValue[0]==="string"?[...inputValue].sort(Text.comparer):[...inputValue].sort((a,b)=>a-b);functionSortBy=resolvedArgs=>{const sortedArray=[...resolvedArgs[0]];if(sortedArray.length===0){return sortedArray}const interpreter=this._interpreter;const exprefNode=resolvedArgs[1];
73
+ const requiredType=this.getTypeName(interpreter.visit(exprefNode,sortedArray[0]));if(requiredType===void 0||![0,2].includes(requiredType)){const typeName=requiredType!==void 0?this.TYPE_NAME_TABLE[requiredType]:"undefined";throw new Error(`Invalid type: unexpected type (${typeName})`)}if(sortedArray.length===1){return sortedArray}function throwInvalidTypeError(rt,item){throw new Error(`Invalid type: expected (${rt.TYPE_NAME_TABLE[requiredType]}), received ${rt.TYPE_NAME_TABLE[rt.getTypeName(item)]}`)}
74
+ return sortedArray.sort((a,b)=>{const exprA=interpreter.visit(exprefNode,a);const exprB=interpreter.visit(exprefNode,b);if(this.getTypeName(exprA)!==requiredType){throwInvalidTypeError(this,exprA)}else if(this.getTypeName(exprB)!==requiredType){throwInvalidTypeError(this,exprB)}if(requiredType===2){return Text.comparer(exprA,exprB)}return exprA-exprB})};functionToNumber=([inputValue])=>{const typeName=this.getTypeName(inputValue);if(typeName===0){return inputValue}if(typeName===2){const str=inputValue;
75
+ if(JSON_NUMBER_REGEX.test(str)){const convertedValue=Number(str);if(!isNaN(convertedValue)){return convertedValue}}}return null};functionType=([inputValue])=>{const type=this.getTypeName(inputValue);const name=type!==void 0?this.TYPE_NAME_TABLE[type]:void 0;if(!name){throw new Error("invalid-type")}return name};functionZip=array=>{const length=Math.min(...array.map(arr=>arr.length));return Array.from({length},(_,index)=>array.map(arr=>arr[index]))}};var ScopeChain=class _ScopeChain{inner=void 0;data={};get currentScopeData(){
76
+ return this.data}withScope(data){const outer=new _ScopeChain;outer.inner=this;outer.data=data;return outer}hasValue(identifier){if(Object.prototype.hasOwnProperty.call(this.data,identifier)){return true}if(this.inner){return this.inner.hasValue(identifier)}return false}getValue(identifier){if(Object.prototype.hasOwnProperty.call(this.data,identifier)){return this.data[identifier]}if(this.inner){return this.inner.getValue(identifier)}return null}};var emptyScopeChain=new ScopeChain;var TreeInterpreter=class _TreeInterpreter{runtime;_rootValue=null;_scope;_options;_depth=0;_maxDepth=DEFAULT_MAX_DEPTH;_deadline=0;constructor(options){
77
+ this.runtime=new Runtime(this);this._scope=new ScopeChain;this._maxDepth=options?.maxDepth??DEFAULT_MAX_DEPTH;if(options){this._options=options;this._deadline=options.timeoutMs!==void 0?Date.now()+options.timeoutMs:0}}withScope(scope){const interpreter=new _TreeInterpreter(this._options);interpreter.runtime=this.runtime;interpreter._rootValue=this._rootValue;interpreter._scope=this._scope.withScope(scope);interpreter._depth=this._depth;interpreter._maxDepth=this._maxDepth;interpreter._deadline=this.
78
+ _deadline;return interpreter}search(node,value,options){if(options?.maxNodes!==void 0&&countNodes(node)>options.maxNodes){throw new Error(`Expression exceeds maximum allowed node count of ${options.maxNodes}`)}this._rootValue=value;this._scope=emptyScopeChain;this._options=options;this._maxDepth=options?.maxDepth??DEFAULT_MAX_DEPTH;this._depth=0;this._deadline=options?.timeoutMs!==void 0?Date.now()+options.timeoutMs:0;const result=this.visit(node,value);this.checkOutputSize(result);return result}checkOutputSize(val){
79
+ const max=this._options?.maxOutputSize;if(max===void 0||val==null){return}const size=Array.isArray(val)||typeof val==="string"?val.length:typeof val==="object"?Object.keys(val).length:0;if(size>max){throw new Error(`Output size exceeds maximum allowed size of ${max}`)}}collect(target,item){target.push(item);if(this._options?.maxOutputSize!==void 0&&target.length>this._options.maxOutputSize){throw new Error(`Output size exceeds maximum allowed size of ${this._options.maxOutputSize}`)}}evaluateProjectionItems(items,right){
80
+ const collected=[];if(right.type==="Field"){const key=right.name;for(let i=0;i<items.length;i++){if(this._deadline>0&&Date.now()>=this._deadline){throw new Error(`Query execution timed out after ${this._options?.timeoutMs}ms`)}const elem=items[i];if(!elem||typeof elem!=="object"||Array.isArray(elem)){continue}if(!Object.prototype.hasOwnProperty.call(elem,key)){continue}const val=elem[key];if(val!==void 0&&val!==null){this.collect(collected,val)}}return collected}if(right.type==="Identity"){for(let i=0;i<
81
+ items.length;i++){const elem=items[i];if(elem!==null){this.collect(collected,elem)}}return collected}for(const elem of items){const current=this.visit(right,elem);if(current!==null){this.collect(collected,current)}}return collected}visit(node,value){if(this._deadline>0&&Date.now()>=this._deadline){throw new Error(`Query execution timed out after ${this._options?.timeoutMs}ms`)}if(this._depth>=this._maxDepth){throw new Error(`Evaluation exceeds maximum allowed depth of ${this._maxDepth}`)}this._depth+=
82
+ 1;try{return this.evaluateNode(node,value)}finally{this._depth-=1}}evaluateNode(node,value){switch(node.type){case"Ternary":{const condition=this.visit(node.condition,value);if(!isFalse(condition)){return this.visit(node.trueExpr,value)}return this.visit(node.falseExpr,value)}case"Field":const identifier=node.name;if(value===null||typeof value!=="object"||Array.isArray(value)){return null}return Object.prototype.hasOwnProperty.call(value,identifier)?value[identifier]??null:null;case"LetExpressio\
83
+ n":{const scope={};for(const binding of node.bindings){const bound=this.visit(binding,value);for(const key of Object.keys(bound)){Object.defineProperty(scope,key,{value:bound[key],enumerable:true,writable:true,configurable:true})}}return this.withScope(scope).visit(node.expression,value)}case"Binding":{const{variable,reference}=node;const result=this.visit(reference,value);const binding={};Object.defineProperty(binding,variable,{value:result,enumerable:true,writable:true,configurable:true});return binding}case"\
84
+ Variable":{const variable=node.name;if(!this._scope.hasValue(variable)){throw new Error(`Error referencing undefined variable ${variable}`)}return this._scope.getValue(variable)}case"IndexExpression":return this.visit(node.right,this.visit(node.left,value));case"Subexpression":{const result=this.visit(node.left,value);return result!=null?this.visit(node.right,result)??null:null}case"Index":{if(!Array.isArray(value)){return null}const index=node.value<0?value.length+node.value:node.value;return value[index]??
85
+ null}case"Slice":{if(!Array.isArray(value)&&typeof value!=="string"){return null}const target=typeof value==="string"?[...value]:value;const{start,stop,step}=this.computeSliceParams(target.length,node);const sliced=this.slice(target,start,stop,step);const res=typeof value==="string"?sliced.join(""):sliced;this.checkOutputSize(res);return res}case"Projection":{const{left,right}=node;const allowString=left.type==="IndexExpression"&&left.right.type==="Slice";const base=this.visit(left,value);if(allowString&&
86
+ typeof base==="string"){return this.visit(right,base)}return Array.isArray(base)?this.evaluateProjectionItems(base,right):null}case"ValueProjection":{const base=this.visit(node.left,value);if(base===null||typeof base!=="object"||Array.isArray(base)){return null}return this.evaluateProjectionItems(Object.values(base),node.right)}case"FilterProjection":{const{left,right,condition}=node;const base=this.visit(left,value);if(!Array.isArray(base)){return null}const results=[];if(right.type==="Field"){
87
+ const key=right.name;for(let i=0;i<base.length;i++){const elem=base[i];if(isFalse(this.visit(condition,elem))){continue}if(!elem||typeof elem!=="object"||Array.isArray(elem)){continue}if(!Object.prototype.hasOwnProperty.call(elem,key)){continue}const val=elem[key];if(val!==void 0&&val!==null){this.collect(results,val)}}return results}if(right.type==="Identity"){for(let i=0;i<base.length;i++){const elem=base[i];if(isFalse(this.visit(condition,elem))){continue}if(elem!==null){this.collect(results,
88
+ elem)}}return results}for(const elem of base){if(isFalse(this.visit(condition,elem))){continue}const result=this.visit(right,elem);if(result!==null){this.collect(results,result)}}return results}case"Arithmetic":{const first=this.visit(node.left,value);const second=this.visit(node.right,value);switch(node.operator){case"Plus":return add(first,second);case"Minus":return sub(first,second);case"Multiply":case"Star":return mul(first,second);case"Divide":return divide(first,second);case"Modulo":return mod(
89
+ first,second);case"Div":return div(first,second);default:throw new Error(`Syntax error: unknown arithmetic operator: ${node.operator}`)}}case"Unary":{const operand=this.visit(node.operand,value);switch(node.operator){case"Plus":ensureNumbers(operand);return operand;case"Minus":ensureNumbers(operand);return-operand;default:throw new Error(`Syntax error: unknown arithmetic operator: ${node.operator}`)}}case"Comparator":{const first=this.visit(node.left,value);const second=this.visit(node.right,value);
90
+ switch(node.name){case"EQ":return strictDeepEqual(first,second);case"NE":return!strictDeepEqual(first,second)}if(typeof first!=="number"||typeof second!=="number"){return null}switch(node.name){case"GT":return first>second;case"GTE":return first>=second;case"LT":return first<second;case"LTE":return first<=second}}case"Flatten":{const original=this.visit(node.child,value);const res=Array.isArray(original)?original.flat():null;this.checkOutputSize(res);return res}case"Root":return this._rootValue;case"\
91
+ MultiSelectList":{const collected=[];for(const child of node.children){collected.push(this.visit(child,value))}this.checkOutputSize(collected);return collected}case"MultiSelectHash":{const collected={};for(const child of node.children){Object.defineProperty(collected,child.name,{value:this.visit(child.value,value),enumerable:true,writable:true,configurable:true})}this.checkOutputSize(collected);return collected}case"OrExpression":{const result=this.visit(node.left,value);if(isFalse(result)){return this.
92
+ visit(node.right,value)}return result}case"AndExpression":{const result=this.visit(node.left,value);if(isFalse(result)){return result}return this.visit(node.right,value)}case"NotExpression":return isFalse(this.visit(node.child,value));case"Literal":return node.value;case"Pipe":return this.visit(node.right,this.visit(node.left,value));case"Function":{if(this._options?.allowedFunctions&&!this._options.allowedFunctions.includes(node.name)){throw new Error(`Function '${node.name}' is not allowed`)}if(this.
93
+ _options?.disallowedFunctions&&this._options.disallowedFunctions.includes(node.name)){throw new Error(`Function '${node.name}' is disallowed`)}const args=[];for(const child of node.children){args.push(this.visit(child,value))}const prevInterpreter=this.runtime._interpreter;this.runtime._interpreter=this;try{const res=this.runtime.callFunction(node.name,args);this.checkOutputSize(res);return res}finally{this.runtime._interpreter=prevInterpreter}}case"ExpressionReference":return{expref:true,...node.
94
+ child};case"Current":case"Identity":return value}}computeSliceParams(arrayLength,sliceNode){let{start,stop,step}=sliceNode;if(step===null){step=1}else if(step===0){const error=new Error("Invalid value: slice step cannot be 0");error.name="RuntimeError";throw error}start=start===null?step<0?arrayLength-1:0:this.capSliceRange(arrayLength,start,step);stop=stop===null?step<0?-1:arrayLength:this.capSliceRange(arrayLength,stop,step);return{start,stop,step}}capSliceRange(arrayLength,actualValue,step){let nextActualValue=actualValue;
95
+ if(nextActualValue<0){nextActualValue+=arrayLength;if(nextActualValue<0){nextActualValue=step<0?-1:0}}else if(nextActualValue>=arrayLength){nextActualValue=step<0?arrayLength-1:arrayLength}return nextActualValue}slice(collection,start,end,step){if(step===1){return collection.slice(start,end)}const len=Math.max(0,Math.ceil((end-start)/step));const result=new Array(len);let idx=0;if(step>0){for(let i=start;i<end;i+=step){result[idx++]=collection[i]}}else{for(let i=start;i>end;i+=step){result[idx++]=
96
+ collection[i]}}return result}};var TreeInterpreterInstance=new TreeInterpreter;var TreeInterpreter_default=TreeInterpreterInstance;async function*toAsyncIterable(source){if(source==null){return}if(typeof source!=="object"&&typeof source!=="function"){throw new TypeError("Invalid stream source: expected AsyncIterable, Iterable, or ReadableStream")}if(Symbol.asyncIterator in source){for await(const chunk of source){yield chunk}return}if(typeof source.getReader==="function"){const reader=source.getReader();
97
+ try{while(true){const{done,value}=await reader.read();if(done){break}yield value}}finally{reader.releaseLock()}return}if(Symbol.iterator in source){for(const chunk of source){yield chunk}return}throw new TypeError("Invalid stream source: expected AsyncIterable, Iterable, or ReadableStream")}function parseItem(str,parseJson){if(parseJson===true){return JSON.parse(str)}if(parseJson==="auto"){try{return JSON.parse(str)}catch{return str}}return str}async function*normalizeSource(source,options){const parseJson=options?.
98
+ parseJson??"auto";const flatten=options?.flattenChunks??true;let buffer="";const textDecoder=typeof TextDecoder!=="undefined"?new TextDecoder:null;for await(const chunk of toAsyncIterable(source)){const str=chunk instanceof Uint8Array&&textDecoder?textDecoder.decode(chunk,{stream:true}):typeof chunk==="string"?chunk:null;if(str!==null){if(parseJson===false&&typeof chunk==="string"){yield chunk}else{buffer+=str;if(buffer.includes("\n")){const lines=buffer.split("\n");buffer=lines.pop()??"";for(const line of lines){
99
+ const trimmed=line.trim();if(trimmed){yield parseItem(trimmed,parseJson)}}}}}else{if(buffer.trim()){yield parseItem(buffer.trim(),parseJson);buffer=""}if(flatten&&Array.isArray(chunk)){for(const item of chunk){yield item}}else{yield chunk}}}if(textDecoder&&buffer){buffer+=textDecoder.decode()}if(buffer.trim()){yield parseItem(buffer.trim(),parseJson)}}function isStreamableNode(node){switch(node.type){case"Projection":if(node.left.type==="Identity"||node.left.type==="Current"){return true}if(node.
100
+ left.type==="IndexExpression"&&node.left.right.type==="Slice"){const slice=node.left.right;return(slice.start===null||slice.start>=0)&&(slice.stop===null||slice.stop>=0)&&(slice.step===null||slice.step>0)}return false;case"FilterProjection":return node.left.type==="Identity"||node.left.type==="Current";case"IndexExpression":if(node.left.type==="Identity"||node.left.type==="Current"){if(node.right.type==="Slice"){const slice=node.right;return(slice.start===null||slice.start>=0)&&(slice.stop===null||
101
+ slice.stop>=0)&&(slice.step===null||slice.step>0)}return false}return isStreamableNode(node.left);case"Field":case"Identity":case"Current":return true;case"Subexpression":return isStreamableNode(node.left)&&isStreamableNode(node.right);case"MultiSelectHash":case"MultiSelectList":case"Ternary":case"Comparator":case"Arithmetic":case"NotExpression":return true;case"Pipe":return isStreamableNode(node.left)&&isStreamableNode(node.right);default:return false}}async function drainStream(source,checkDeadline,maxOutputSize){
102
+ const collected=[];for await(const item of source){checkDeadline();collected.push(item);if(maxOutputSize!==void 0&&collected.length>maxOutputSize){throw new Error(`Output size exceeds maximum allowed size of ${maxOutputSize}`)}}return collected}async function*drainAndEvaluate(source,node,interpreter,checkDeadline,options){const collected=await drainStream(source,checkDeadline,options?.maxOutputSize);const result=interpreter.search(node,collected,options);if(Array.isArray(result)){for(const item of result){
103
+ yield item}}else if(result!==null&&result!==void 0){yield result}}async function*evaluateStreamNode(source,node,interpreter,options){const deadline=options?.timeoutMs!==void 0?Date.now()+options.timeoutMs:0;function checkDeadline(){if(deadline>0&&Date.now()>=deadline){throw new Error(`Query execution timed out after ${options?.timeoutMs}ms`)}}switch(node.type){case"Projection":{if(!isStreamableNode(node)){yield*drainAndEvaluate(source,node,interpreter,checkDeadline,options);return}const{left,right}=node;
104
+ let streamSource=source;if(left.type==="IndexExpression"&&left.right.type==="Slice"){streamSource=evaluateStreamNode(source,left,interpreter,options)}if(right.type==="Identity"||right.type==="Current"){for await(const item of streamSource){checkDeadline();if(item!==null&&item!==void 0){yield item}}return}if(right.type==="Field"){const key=right.name;for await(const item of streamSource){checkDeadline();if(item&&typeof item==="object"&&!Array.isArray(item)){const val=item[key];if(val!==void 0&&val!==
105
+ null){yield val}}}return}for await(const item of streamSource){checkDeadline();const res=interpreter.visit(right,item);if(res!==null&&res!==void 0){yield res}}return}case"IndexExpression":{if(node.left.type==="Identity"||node.left.type==="Current"){if(node.right.type==="Slice"){const slice=node.right;const start=slice.start??0;const stop=slice.stop??Infinity;const step=slice.step??1;if(start>=0&&stop>=0&&step>0){let index=0;for await(const item of source){checkDeadline();if(index>=stop){break}if(index>=
106
+ start&&(index-start)%step===0){yield item}index++;if(index>=stop){break}}return}}yield*drainAndEvaluate(source,node,interpreter,checkDeadline,options);return}for await(const item of source){checkDeadline();const res=interpreter.visit(node,item);if(res!==null&&res!==void 0){yield res}}return}case"FilterProjection":{if(!isStreamableNode(node)){yield*drainAndEvaluate(source,node,interpreter,checkDeadline,options);return}const{condition,right}=node;if(right.type==="Identity"||right.type==="Current"){
107
+ for await(const item of source){checkDeadline();if(!isFalse(interpreter.visit(condition,item))){yield item}}return}if(right.type==="Field"){const key=right.name;for await(const item of source){checkDeadline();if(!isFalse(interpreter.visit(condition,item))){if(item&&typeof item==="object"&&!Array.isArray(item)){const val=item[key];if(val!==void 0&&val!==null){yield val}}}}return}for await(const item of source){checkDeadline();if(!isFalse(interpreter.visit(condition,item))){const res=interpreter.visit(
108
+ right,item);if(res!==null&&res!==void 0){yield res}}}return}case"Pipe":{const leftStream=evaluateStreamNode(source,node.left,interpreter,options);if(isStreamableNode(node.right)){for await(const res of evaluateStreamNode(leftStream,node.right,interpreter,options)){yield res}}else{const collected=await drainStream(leftStream,checkDeadline,options?.maxOutputSize);const result=interpreter.search(node.right,collected,options);if(result!==null&&result!==void 0){yield result}}return}case"Identity":case"\
109
+ Current":{for await(const item of source){checkDeadline();yield item}return}case"Field":{const key=node.name;for await(const item of source){checkDeadline();if(item&&typeof item==="object"&&!Array.isArray(item)){const val=item[key];if(val!==void 0&&val!==null){yield val}}}return}default:{if(isStreamableNode(node)){for await(const item of source){checkDeadline();const res=interpreter.visit(node,item);if(res!==null&&res!==void 0){yield res}}return}yield*drainAndEvaluate(source,node,interpreter,checkDeadline,
110
+ options);return}}}function isExpressionNode(val){return typeof val==="object"&&val!==null&&"type"in val&&typeof val.type==="string"&&!(Symbol.iterator in val)&&!(Symbol.asyncIterator in val)}async function*searchStream(sourceOrExpression,expressionOrSource,options){let expression;let source;if(typeof sourceOrExpression==="string"||isExpressionNode(sourceOrExpression)){expression=sourceOrExpression;source=expressionOrSource}else{source=sourceOrExpression;expression=expressionOrSource}if(typeof expression!==
111
+ "string"&&!isExpressionNode(expression)){throw new TypeError("Expression must be a string or AST ExpressionNode")}const ast=typeof expression==="string"?Parser_default.parse(expression,options):expression;if(options){const fnError=findDisallowedFunction(ast,options);if(fnError){throw new Error(fnError)}}const interpreter=new TreeInterpreter(options);interpreter.runtime._functionTable=TreeInterpreterInstance.runtime._functionTable;const items=normalizeSource(source,options);const results=evaluateStreamNode(
112
+ items,ast,interpreter,options);const limit=options?.limit;const maxOutputSize=options?.maxOutputSize;let count=0;if(limit!==void 0&&limit<=0){return}for await(const result of results){if(maxOutputSize!==void 0&&count>=maxOutputSize){throw new Error(`Output size exceeds maximum allowed size of ${maxOutputSize}`)}yield result;count++;if(limit!==void 0&&count>=limit){break}}}var TYPE_ANY=1;var TYPE_ARRAY=3;var TYPE_ARRAY_ARRAY=11;var TYPE_ARRAY_NUMBER=8;var TYPE_ARRAY_OBJECT=10;var TYPE_ARRAY_STRING=9;
113
+ var TYPE_BOOLEAN=5;var TYPE_EXPREF=6;var TYPE_NULL=7;var TYPE_NUMBER=0;var TYPE_OBJECT=4;var TYPE_STRING=2;function compile(expression,options){return Parser_default.parse(expression,options)}function compileQuery(expression,options){const nodeTree=Parser_default.parse(expression,options);const searchFn=data=>TreeInterpreter_default.search(nodeTree,data,options);const fn=searchFn;fn.search=searchFn;fn.searchStream=(source,streamOptions)=>searchStream(source,nodeTree,{...options,...streamOptions});
114
+ fn.ast=nodeTree;return fn}function validate(expression,options){if(typeof expression!=="string"){return{valid:false,error:"Expression must be a string"}}try{const ast=Parser_default.parse(expression,options);if(options){const fnError=findDisallowedFunction(ast,options);if(fnError){return{valid:false,error:fnError}}}return{valid:true,ast}}catch(err){return{valid:false,error:err instanceof Error?err.message:String(err)}}}function tokenize(expression,options){return Lexer_default.tokenize(expression,
115
+ options)}var registerFunction=(functionName,customFunction,signature,options)=>{TreeInterpreter_default.runtime.registerFunction(functionName,customFunction,signature,options)};var register=(name,customFunction,signature,options)=>{return TreeInterpreter_default.runtime.register(name,customFunction,signature,options)};var unregisterFunction=name=>{return TreeInterpreter_default.runtime.unregister(name)};var isRegistered=name=>{return TreeInterpreter_default.runtime.isRegistered(name)};var getRegisteredFunctions=()=>{
116
+ return TreeInterpreter_default.runtime.getRegistered()};var getCustomFunctions=()=>{return TreeInterpreter_default.runtime.getCustomFunctions()};var clearCustomFunctions=()=>{TreeInterpreter_default.runtime.clearCustomFunctions()};var MAX_CACHE_SIZE=1e3;var astCache=new Map;function search(data,expression,options){let nodeTree;if(!options){nodeTree=astCache.get(expression);if(!nodeTree){nodeTree=Parser_default.parse(expression);if(astCache.size>=MAX_CACHE_SIZE){const firstKey=astCache.keys().next().
117
+ value;if(firstKey!==void 0){astCache.delete(firstKey)}}astCache.set(expression,nodeTree)}}else{nodeTree=Parser_default.parse(expression,options)}return TreeInterpreter_default.search(nodeTree,data,options)}function Scope(){return new ScopeChain}var TreeInterpreter2=TreeInterpreter_default;var jmespath={compile,compileQuery,searchStream,validate,registerFunction,register,unregisterFunction,isRegistered,getRegisteredFunctions,getCustomFunctions,clearCustomFunctions,search,tokenize,TreeInterpreter:TreeInterpreter2,
118
+ DEFAULT_MAX_DEPTH,TYPE_ANY,TYPE_ARRAY_NUMBER,TYPE_ARRAY_STRING,TYPE_ARRAY,TYPE_BOOLEAN,TYPE_EXPREF,TYPE_NULL,TYPE_NUMBER,TYPE_OBJECT,TYPE_STRING,TYPE_ARRAY_ARRAY,TYPE_ARRAY_OBJECT,Scope};var index_default=jmespath;export{DEFAULT_MAX_DEPTH,Scope,TYPE_ANY,TYPE_ARRAY,TYPE_ARRAY_ARRAY,TYPE_ARRAY_NUMBER,TYPE_ARRAY_OBJECT,TYPE_ARRAY_STRING,TYPE_BOOLEAN,TYPE_EXPREF,TYPE_NULL,TYPE_NUMBER,TYPE_OBJECT,TYPE_STRING,TreeInterpreter2 as TreeInterpreter,clearCustomFunctions,compile,compileQuery,index_default as default,getCustomFunctions,getRegisteredFunctions,isRegistered,jmespath,register,registerFunction,search,searchStream,tokenize,unregisterFunction,validate};
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{composeDocument,metaLine}from"./chunk-62GRAKUD.js";import{charCount,readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-6NHLWYI2.js";import{DOMAIN_KNOWLEDGES_PATH,DOMAIN_KNOWLEDGE_SLUG_RE}from"./chunk-UZVBQV4W.js";import"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";
4
- import{nonEmpty,positiveInteger}from"./chunk-DYT22FTA.js";import{requireResolved,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiRejectedError,ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var KB_LABEL="\u30CA\u30EC\u30C3\u30B8\u30D9\u30FC\u30B9";var DOC_LABEL="\u8A18\u4E8B";var ACCESS_LEVELS=["tenant","authenticated","public"];var KB_STATUSES=["draft","active","archived"];var KB_NAME_MAX_CHARS=255;var KB_DESCRIPTION_MAX_CHARS=2e3;var DOC_TITLE_MAX_CHARS=255;var DOC_SUMMARY_MAX_CHARS=2e3;var DOC_TAGS_MAX=30;var DOC_TAG_MAX_CHARS=64;var PATH_SEGMENT_RE=/^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/;var PATH_MAX_BYTES=512;var DOC_BODY_MAX_BYTES=300*1024;var DOC_DEPTH_MAX=20;var KB_LIST_COLUMNS=[
3
+ import{composeDocument,metaLine}from"./chunk-62GRAKUD.js";import{charCount,readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-6NHLWYI2.js";import{DOMAIN_KNOWLEDGES_PATH,DOMAIN_KNOWLEDGE_SLUG_RE}from"./chunk-SMC6PSW3.js";import"./chunk-6JPXLXKW.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";
4
+ import{nonEmpty,positiveInteger}from"./chunk-PMTQFMJS.js";import{requireResolved,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiRejectedError,ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var KB_LABEL="\u30CA\u30EC\u30C3\u30B8\u30D9\u30FC\u30B9";var DOC_LABEL="\u8A18\u4E8B";var ACCESS_LEVELS=["tenant","authenticated","public"];var KB_STATUSES=["draft","active","archived"];var KB_NAME_MAX_CHARS=255;var KB_DESCRIPTION_MAX_CHARS=2e3;var DOC_TITLE_MAX_CHARS=255;var DOC_SUMMARY_MAX_CHARS=2e3;var DOC_TAGS_MAX=30;var DOC_TAG_MAX_CHARS=64;var PATH_SEGMENT_RE=/^[A-Za-z0-9][A-Za-z0-9._-]{0,99}$/;var PATH_MAX_BYTES=512;var DOC_BODY_MAX_BYTES=300*1024;var DOC_DEPTH_MAX=20;var KB_LIST_COLUMNS=[
5
5
  "id","slug","name","status","access_level","updated_at"];var KB_GET_COLUMNS=["id","slug","name","status","access_level","description","revision","updated_at","updated_by"];var DOC_LIST_COLUMNS=["path","title","depth","size_bytes","updated_at"];var DOC_GET_COLUMNS=["path","title","summary","tags","revision","size_bytes","updated_at","updated_by"];var KB_ARG="<KB>";var KB_ARG_HELP="<KB> \u306F\u30CA\u30EC\u30C3\u30B8\u30D9\u30FC\u30B9\u306E ID \u304B slug \u3067\u3059\uFF08twp knowledge list \u306E id / slug \u5217\uFF09\u3002";
6
6
  function positional(input,names,usage){const values=input.args.map(arg=>arg.trim());if(values.length<names.length){throw new UsageError(`${names[values.length]}\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044`,usage)}if(values.length>names.length){throw new UsageError(`\u4F4D\u7F6E\u5F15\u6570\u304C\u591A\u3059\u304E\u307E\u3059: ${input.args.slice(names.length).join(" ")}`,usage)}return values}function oneOf(input,flag,allowed){const raw=nonEmpty(input.flags,flag);if(raw===void 0)return void 0;
7
7
  const value=raw.trim();if(!allowed.includes(value)){throw new UsageError(`${flag} \u306B\u6307\u5B9A\u3067\u304D\u306A\u3044\u5024\u3067\u3059: ${raw}`,`\u6307\u5B9A\u3067\u304D\u308B\u5024: ${allowed.join(" / ")}`)}return value}function boundedFlag(input,flag,max){const raw=input.flags.get(flag);if(raw===void 0)return void 0;if(raw.trim()==="")throw new UsageError(`${flag} \u304C\u7A7A\u3067\u3059`,`${flag} \u306B\u5024\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);const count=charCount(
@@ -1,8 +1,8 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{estimateCaseDocumentResource}from"./chunk-R46Y2ODA.js";import{estimateNoRuleResource}from"./chunk-4ATCY3BS.js";import{salesAdminForbidden}from"./chunk-EXNQYSFO.js";import"./chunk-WMHAJNKY.js";import"./chunk-SOLVG2XL.js";import{contentTypeFor,inspectLocalFile,issued}from"./chunk-D3RGSH6B.js";import{checkUploadQuota}from"./chunk-GNSZOYBQ.js";import"./chunk-OMW6BBAY.js";import"./chunk-RMFLTSOV.js";import{estimateAiReviewResources}from"./chunk-3I4XAJ2T.js";
4
- import{estimatePdfOperation}from"./chunk-IQVHUTF7.js";import{estimateReadOperations,featureLicenseGuidance,licenseForbidden}from"./chunk-OGCATVOP.js";import"./chunk-PXSZZRPJ.js";import"./chunk-CHT6EP5C.js";import{charCount,readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-6NHLWYI2.js";import{SALES_ESTIMATES_PATH,SALES_ESTIMATE_FORMATS_PATH,SALES_ESTIMATE_NO_RULES_PATH,SALES_INVOICE_NO_RULES_PATH,
5
- isExactNumericId}from"./chunk-UZVBQV4W.js";import{ApiError}from"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import{isSafePathSegment}from"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{LIST_PAGING_HELP,PAGE_NUMBER_LIST_FLAGS,nonEmpty,pageNumberPaging,pageNumberQuery,pageRangeNotes}from"./chunk-DYT22FTA.js";import{requireResolved,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";
3
+ import{estimateCaseDocumentResource}from"./chunk-ZTRVHQBN.js";import{estimateNoRuleResource}from"./chunk-YBARKKEA.js";import{salesAdminForbidden}from"./chunk-TSVDOXFW.js";import"./chunk-FCEQ7HPO.js";import"./chunk-JQ3VQZ2F.js";import{contentTypeFor,inspectLocalFile,issued}from"./chunk-OA6RLG7O.js";import{checkUploadQuota}from"./chunk-GNSZOYBQ.js";import"./chunk-OMW6BBAY.js";import"./chunk-RMFLTSOV.js";import{estimateAiReviewResources}from"./chunk-6GJL7P63.js";
4
+ import{estimatePdfOperation}from"./chunk-EW5VJ73G.js";import{estimateReadOperations,featureLicenseGuidance,licenseForbidden}from"./chunk-UC3GBUZX.js";import"./chunk-255NYOB2.js";import"./chunk-CHT6EP5C.js";import{charCount,readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-6NHLWYI2.js";import{SALES_ESTIMATES_PATH,SALES_ESTIMATE_FORMATS_PATH,SALES_ESTIMATE_NO_RULES_PATH,SALES_INVOICE_NO_RULES_PATH,
5
+ isExactNumericId}from"./chunk-SMC6PSW3.js";import{ApiError}from"./chunk-6JPXLXKW.js";import"./chunk-CJFIIGSH.js";import{isSafePathSegment}from"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{LIST_PAGING_HELP,PAGE_NUMBER_LIST_FLAGS,nonEmpty,pageNumberPaging,pageNumberQuery,pageRangeNotes}from"./chunk-PMTQFMJS.js";import{requireResolved,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";
6
6
  import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-ITFO5GPX.js";import"./chunk-GWVREACM.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var PATH=SALES_ESTIMATE_FORMATS_PATH;var LABEL="\u898B\u7A4D\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8";var CONTENT_KEYS=["format_name","start_date","end_date","default_unit","default_tax_rate","default_business_place_id","default_seal_impression_id","default_estimate_no_id","default_invoice_no_id","default_payee_id","default_terms","default_invoice_memo","default_purchase_terms","default_purchase_acceptance_terms","estimate_workflow_id","contract_workflow_id","invoice_workflow_id","purchase_workflow_\
7
7
  id","description","estimate_manage_content","contract_manage_content","invoice_manage_content","sort_order"];var FIELD_NOTES=[["format_name","\u4F5C\u6210\u3067\u5FC5\u9808\u3002\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8\u540D\uFF08255 \u6587\u5B57\u307E\u3067\uFF09"],["default_unit","\u4F5C\u6210\u3067\u5FC5\u9808\u3002\u660E\u7D30\u306E\u65E2\u5B9A\u306E\u5358\u4F4D\uFF08set / item / unit / hour / day / month / person / person_month / person_day\uFF09"],["default_tax_rate",'\u4F5C\u6210\u3067\u5FC5\u9808\u3002\u65E2\u5B9A\u306E\u7A0E\u7387\uFF08"10" / "8" / \
8
8
  "0"\uFF09'],["default_estimate_no_id","\u4F5C\u6210\u3067\u5FC5\u9808\u3002\u898B\u7A4D\u756A\u53F7\u30EB\u30FC\u30EB\u306E ID\uFF08\u6574\u6570\u3002twp estimate no-rule list \u306E id\uFF09"],["default_invoice_no_id","\u4F5C\u6210\u3067\u5FC5\u9808\u3002\u8ACB\u6C42\u756A\u53F7\u30EB\u30FC\u30EB\u306E ID\uFF08\u6574\u6570\u3002twp invoice no-rule list \u306E id\uFF09"],["start_date / end_date","\u6709\u52B9\u671F\u9593\uFF08YYYY-MM-DD\u3002\u7D42\u4E86\u306F\u958B\u59CB\u4EE5\u964D\u3002null \u3067\u671F\u9650\u306A\u3057\uFF09"],
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{EVALUATIONS_PATH,EVALUATION_FORBIDDEN,GOAL_SHEETS_PATH,GOAL_SHEET_FORBIDDEN,ORG,PERIODS_PATH,SENSITIVE,envelope,feedbackWriteOperations,forbiddenOnly,goalSheetWriteOperations,objectOf,singleId,stepResource}from"./chunk-E6KLOTR2.js";import"./chunk-O756DX6D.js";import{booleanQuery,createFlags,fieldBody,updateFlags}from"./chunk-PXSZZRPJ.js";import"./chunk-CHT6EP5C.js";import"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";
4
- import{repeatedValues}from"./chunk-6NHLWYI2.js";import"./chunk-UZVBQV4W.js";import"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{PAGE_NUMBER_LIST_FLAGS,envelopePaging,nonEmpty,positiveInteger}from"./chunk-DYT22FTA.js";import{requireResolved,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{
3
+ import{EVALUATIONS_PATH,EVALUATION_FORBIDDEN,GOAL_SHEETS_PATH,GOAL_SHEET_FORBIDDEN,ORG,PERIODS_PATH,SENSITIVE,envelope,feedbackWriteOperations,forbiddenOnly,goalSheetWriteOperations,objectOf,singleId,stepResource}from"./chunk-5T4CRNJH.js";import"./chunk-O756DX6D.js";import{booleanQuery,createFlags,fieldBody,updateFlags}from"./chunk-255NYOB2.js";import"./chunk-CHT6EP5C.js";import"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";
4
+ import{repeatedValues}from"./chunk-6NHLWYI2.js";import"./chunk-SMC6PSW3.js";import"./chunk-6JPXLXKW.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{PAGE_NUMBER_LIST_FLAGS,envelopePaging,nonEmpty,positiveInteger}from"./chunk-PMTQFMJS.js";import{requireResolved,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{
5
5
  ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import fs from"fs";var GOAL_SHEET_STATUSES=["draft","submitted","approved"];var EVALUATION_STATUSES=["in_progress","completed","feedback_ready","feedback_sent"];var PERIOD_FLAG={name:"--period",summary:"\u8A55\u4FA1\u671F\u9593\u306E ID\uFF08twp evaluation period list / current \u3067\u78BA\u8A8D\u3067\u304D\u308B\uFF09",takesValue:true,placeholder:"<\u8A55\u4FA1\u671F\u9593ID>"};var READ_SCOPE_HELP="\u4E00\u89A7\u306B\u51FA\u308B\u306E\u306F\u3001\u3042\u306A\u305F\u304C\u898B\u3066\u3088\u3044\u5206\u3060\u3051\u3067\u3059\uFF08\u4EBA\u4E8B\u7BA1\u7406\u306E\u7BA1\u7406\u8005\u306F\u5168\u54E1\u5206\u3001\u305D\u308C\u4EE5\u5916\u306F\u8A55\u4FA1\u671F\u9593\u6642\u70B9\u306E\u90E8\u4E0B\u306E\u5206\uFF1D\u81EA\u5206\u81EA\u8EAB\u306E\u5206\u306F\u51FA\u307E\u305B\u3093\uFF09\u3002\n\u6A29\u9650\u304C\u7121\u3044\u4EBA\u306E\u5206\u306F 403 \u3067\u306F\u306A\u304F\u300C\u51FA\u3066\u3053\u306A\u3044\u300D\u306E\u3067\u30010\u4EF6\u3067\u3082\u300C\u305D\u306E\u4EBA\u306E\u5206\u304C\u7121\u3044\u300D\u3068\u306F\u9650\u308A\u307E\u305B\u3093\
6
6
  \u3002";var EVALUATION_PAGING_HELP=" \u26A0 \u3053\u306E\u4E00\u89A7\u306F\u30DA\u30FC\u30B8\u756A\u53F7\u3067\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\uFF08--cursor \u306F\u30DA\u30FC\u30B8\u756A\u53F7\u3067\u3059\uFF09\u3002\n \u30B5\u30FC\u30D0\u306F\u4E26\u3073\u9806\u3092\u56FA\u5B9A\u3057\u3066\u3044\u306A\u3044\u306E\u3067\u3001\u8FBF\u3063\u3066\u3044\u308B\u6700\u4E2D\u306B\u30C7\u30FC\u30BF\u304C\u5897\u6E1B\u3059\u308B\u3068\u53D6\u308A\u3053\u307C\u3057\u30FB\u91CD\u8907\u304C\u8D77\u3053\u308A\u5F97\u307E\u3059\u3002";
7
7
  function noArgs(input,command){if(input.args.length>0){throw new UsageError(`${command} \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,`twp ${command} help`)}}function periodId(input,required,command){const raw=nonEmpty(input.flags,PERIOD_FLAG.name)?.trim();if(raw===void 0||raw===""){if(required){throw new UsageError(`${command} \u306B\u306F --period\uFF08\u8A55\u4FA1\u671F\u9593\u306E ID\uFF09\u304C\u8981\u308A\u307E\u3059`,"\u8A55\u4FA1\u671F\u9593\u306E ID \u306F twp evaluatio\
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{featureLicenseGuidance}from"./chunk-OGCATVOP.js";import{monthFlag}from"./chunk-YLF4S4MC.js";import"./chunk-CHT6EP5C.js";import{readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";import"./chunk-UZVBQV4W.js";import"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import{UUID_RE,isSafePathSegment}from"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";
4
- import"./chunk-DYT22FTA.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var BASE="/api/v2/expense/commuting";var WORKFLOW_CATEGORY="commuting_expenses";var LIST_LIMIT_MAX=100;var DEFAULT_LIST_LIMIT=24;var COMMENT_MAX=1e3;var CONTENT_MAX_CHARS=2e4;var STATUSES=["draft","pending","approved","rejected"];var ENTRY_VALUES=["round_trip","one_way",""];var CONTENT_KEYS=["daily_entries","comment"];var LIST_COLUMNS=["id","year_month","status","total_round_trips","total_one_ways","total_amount","updated_at"];var ADMIN_LIST_COLUMNS=["id","user_name","year_month","status","total\
3
+ import{featureLicenseGuidance}from"./chunk-UC3GBUZX.js";import{monthFlag}from"./chunk-YLF4S4MC.js";import"./chunk-CHT6EP5C.js";import{readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";import"./chunk-SMC6PSW3.js";import"./chunk-6JPXLXKW.js";import"./chunk-CJFIIGSH.js";import{UUID_RE,isSafePathSegment}from"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";
4
+ import"./chunk-PMTQFMJS.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var BASE="/api/v2/expense/commuting";var WORKFLOW_CATEGORY="commuting_expenses";var LIST_LIMIT_MAX=100;var DEFAULT_LIST_LIMIT=24;var COMMENT_MAX=1e3;var CONTENT_MAX_CHARS=2e4;var STATUSES=["draft","pending","approved","rejected"];var ENTRY_VALUES=["round_trip","one_way",""];var CONTENT_KEYS=["daily_entries","comment"];var LIST_COLUMNS=["id","year_month","status","total_round_trips","total_one_ways","total_amount","updated_at"];var ADMIN_LIST_COLUMNS=["id","user_name","year_month","status","total\
5
5
  _round_trips","total_one_ways","total_amount","updated_at"];var GET_COLUMNS=["id","year_month","status","commuting_facilities","commuting_route","commuting_cost_one_way","total_round_trips","total_one_ways","total_amount","workflow_instance_id","comment"];var LICENSE=featureLicenseGuidance("\u7D4C\u8CBB\u7BA1\u7406");var USER_FORBIDDEN=body=>body?.error==="permission_denied"?LICENSE:"\u3053\u306E\u901A\u52E4\u4EA4\u901A\u8CBB\u3092\u64CD\u4F5C\u3059\u308B\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093\uFF08\u81EA\u5206\u306E\u5206\u304B\u3001\u7D4C\u8CBB\u306E\u7BA1\u7406\u8005\u3060\u3051\u304C\u6271\u3048\u307E\u3059\uFF09";
6
6
  var ADMIN_FORBIDDEN=body=>body?.error==="permission_denied"?LICENSE:"\u7D4C\u8CBB\u306E\u7BA1\u7406\u8005\u306E\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\uFF08\u30C6\u30CA\u30F3\u30C8\u306E\u7BA1\u7406\u8005\u304B\u3001\u7D4C\u8CBB\u306E\u6A29\u9650\u304C\u300C\u7BA1\u7406\u8005\u300D\u306E\u4EBA\u3060\u3051\u304C\u4F7F\u3048\u307E\u3059\uFF09\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044";var MONTH_FLAG={name:"--month",summary:"\u5BFE\u8C61\u306E\u5E74\u6708\uFF08YYYY-\
7
7
  MM\uFF09",takesValue:true,placeholder:"<YYYY-MM>"};var ID_FLAG={name:"--id",summary:"\u5BFE\u8C61\u306E\u901A\u52E4\u4EA4\u901A\u8CBB\u306E ID\uFF08\u4F4D\u7F6E\u5F15\u6570\u306E\u4EE3\u308F\u308A\u306B\u4F7F\u3048\u308B\uFF09",takesValue:true,placeholder:"<ID>"};var COMMENT_FLAG={name:"--comment",summary:`\u7533\u8ACB\u306E\u30B3\u30E1\u30F3\u30C8\uFF08${String(COMMENT_MAX)} \u6587\u5B57\u4EE5\u5185\uFF09`,takesValue:true,placeholder:"<\u30B3\u30E1\u30F3\u30C8>"};var OUT_FLAG={name:"--out",summary:"\
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{contentTypeFor,inspectLocalFile,issued}from"./chunk-D3RGSH6B.js";import{checkUploadQuota}from"./chunk-GNSZOYBQ.js";import{parseWaitOptions,waitUntilTerminal}from"./chunk-3EFJQDC4.js";import"./chunk-RMFLTSOV.js";import{composeDocument,htmlToText,metaLine}from"./chunk-62GRAKUD.js";import{boundedText}from"./chunk-CHT6EP5C.js";import{readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-6NHLWYI2.js";
4
- import{FAQS_PATH}from"./chunk-UZVBQV4W.js";import{MultipartBody}from"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import{isSafePathSegment}from"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{positiveInteger}from"./chunk-DYT22FTA.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiRejectedError,ApiResponseError,
3
+ import{contentTypeFor,inspectLocalFile,issued}from"./chunk-OA6RLG7O.js";import{checkUploadQuota}from"./chunk-GNSZOYBQ.js";import{parseWaitOptions,waitUntilTerminal}from"./chunk-3EFJQDC4.js";import"./chunk-RMFLTSOV.js";import{composeDocument,htmlToText,metaLine}from"./chunk-62GRAKUD.js";import{boundedText}from"./chunk-CHT6EP5C.js";import{readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-6NHLWYI2.js";
4
+ import{FAQS_PATH}from"./chunk-SMC6PSW3.js";import{MultipartBody}from"./chunk-6JPXLXKW.js";import"./chunk-CJFIIGSH.js";import{isSafePathSegment}from"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{positiveInteger}from"./chunk-PMTQFMJS.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiRejectedError,ApiResponseError,
5
5
  UsageError,WaitTimeoutError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import fs2 from"fs";import path2 from"path";import fs from"fs";import path from"path";var TARGET_TYPES=["all","admin_only","user_only","department","department_position","project","user","contract_type"];var TARGET_TYPES_WITHOUT_ID=["all","admin_only","user_only"];var TARGET_KEYS=["target_type","target_id","target_name","min_position_rank","min_position_name"];var DERIVED_TARGET_KEYS=["target_key"];var TARGETS_HELP=`--targets-file \u306F\u516C\u958B\u5BFE\u8C61\u306E JSON \u914D\u5217\u3067\u3059\u3002\u4F8B: [{"target_type":"department","target_id":"<\u90E8\u7F72ID>"},{"target_type":"user","target_id":"<\u30E6\u30FC\u30B6\u30FCID>"}]
6
6
  target_type \u306F ${TARGET_TYPES.join(" / ")}\uFF08${TARGET_TYPES_WITHOUT_ID.join(" / ")} \u4EE5\u5916\u306F target_id \u304C\u8981\u308B\uFF09\u3002\u90E8\u7F72\xD7\u8077\u4F4D\u306F min_position_rank \u3082\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\u3044\u307E\u306E\u516C\u958B\u5BFE\u8C61\u306F twp faq get <ID> --output json \u306E visibility_targets \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002`;function parseTargets(text,file,flag="--targets-file",help=TARGETS_HELP){let parsed;try{parsed=
7
7
  JSON.parse(text.replace(/^\uFEFF/,""))}catch(error){throw new UsageError(`${flag} \u304C JSON \u3068\u3057\u3066\u8AAD\u3081\u307E\u305B\u3093: ${file}\uFF08${error.message}\uFF09`,help)}if(!Array.isArray(parsed)||parsed.length===0)throw new UsageError(`${flag} \u306F\u516C\u958B\u5BFE\u8C61\u306E\u914D\u5217\uFF081\u4EF6\u4EE5\u4E0A\uFF09\u306B\u3057\u3066\u304F\u3060\u3055\u3044: ${file}`,help);if(parsed.length>200)throw new UsageError(`\u516C\u958B\u5BFE\u8C61\u306F 200 \u4EF6\u307E\u3067\u3067\u3059\uFF08${parsed.
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{createFlags,fieldBody,hasAnyField,updateFlags}from"./chunk-PXSZZRPJ.js";import"./chunk-CHT6EP5C.js";import{FISCAL_YEAR_SETTINGS_PATH}from"./chunk-UZVBQV4W.js";import"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import"./chunk-DYT22FTA.js";import{singleRef}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";
3
+ import{createFlags,fieldBody,hasAnyField,updateFlags}from"./chunk-255NYOB2.js";import"./chunk-CHT6EP5C.js";import{FISCAL_YEAR_SETTINGS_PATH}from"./chunk-SMC6PSW3.js";import"./chunk-6JPXLXKW.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import"./chunk-PMTQFMJS.js";import{singleRef}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";
4
4
  import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var NAME="fiscal-year";var LABEL="\u4E8B\u696D\u5E74\u5EA6\u8A2D\u5B9A";var YEAR_RE=/^\d{4}$/;var FIELDS=[{kind:"number",flag:"--indirect-cost-rate",key:"default_indirect_cost_rate",label:"\u9593\u63A5\u8CBB\u7387",min:0,max:100,summary:"\u9593\u63A5\u8CBB\u7387\u306E\u65E2\u5B9A\uFF08%\u30FB0\u301C100\u30FB\u5C0F\u6570\u53EF\uFF09"},{kind:"number",flag:"--target-profit-rate",key:"default_target_profit_rate",label:"\u76EE\u6A19\u5229\u76CA\u7387",min:0,max:100,summary:"\u76EE\u6A19\u5229\u76CA\u7387\u306E\u65E2\u5B9A\uFF08%\u30FB0\u301C100\u30FB\u5C0F\u6570\u53EF\uFF09"},
5
5
  {kind:"text",flag:"--description",key:"description",label:"\u8AAC\u660E",maxChars:1e3,summary:"\u8AAC\u660E"}];var COLUMNS=["fiscal_year","default_indirect_cost_rate","default_target_profit_rate","description"];var YEAR_FLAG={name:"--fiscal-year",summary:"\u5BFE\u8C61\u306E\u5E74\u5EA6\uFF08\u4F4D\u7F6E\u5F15\u6570\u306E\u4EE3\u308F\u308A\u306B\u4F7F\u3048\u308B\uFF09",takesValue:true,placeholder:"<YYYY>"};var FORBIDDEN=`\u7BA1\u7406\u8005\u306E\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\u3002${LABEL}\
6
6
  \u306E\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664\u306F\u7BA1\u7406\u8005\u3060\u3051\u304C\u884C\u3048\u307E\u3059`;function fiscalYear(input,usage){const year=singleRef(input,{flag:YEAR_FLAG.name,label:"\u5E74\u5EA6",usage});if(!YEAR_RE.test(year)){throw new UsageError(`\u5E74\u5EA6\u306F4\u6841\u306E\u6570\u5B57\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${year}`,`\u4F8B: twp ${NAME} get 2026`)}return year}function rows(body){const list=isRecord(body)?body["list"]:void 0;if(!Array.
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{secretReason}from"./chunk-XCU3PDQV.js";import{JsonBodyWithView}from"./chunk-Q3B65OFC.js";import{containsRedactedMarker,readBody}from"./chunk-V5WDGX4S.js";import{ALLOW_REDACTED_FLAG}from"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{GITHUB_BASE_PATH,githubAccountPath,githubRepoPath,isExactNumericId,parseRepoRef}from"./chunk-UZVBQV4W.js";import{ApiError}from"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";
4
- import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-DYT22FTA.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiResponseError,ConflictError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";
3
+ import{secretReason}from"./chunk-XCU3PDQV.js";import{JsonBodyWithView}from"./chunk-Q3B65OFC.js";import{containsRedactedMarker,readBody}from"./chunk-V5WDGX4S.js";import{ALLOW_REDACTED_FLAG}from"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{GITHUB_BASE_PATH,githubAccountPath,githubRepoPath,isExactNumericId,parseRepoRef}from"./chunk-SMC6PSW3.js";import{ApiError}from"./chunk-6JPXLXKW.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";
4
+ import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-PMTQFMJS.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiResponseError,ConflictError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";
5
5
  import"./chunk-VSJBJXZO.js";import fs from"fs";import path from"path";var MAX_NUMBER_DIGITS=18;var ACCOUNT_COLUMNS=["id","host","username"];var REPO_COLUMNS=["full_name","private","language","open_issues_count","updated_at","description"];var ISSUE_LIST_COLUMNS=["repository","number","title","state","user","is_pull_request","draft","comments","labels","updated_at"];var ISSUE_GET_COLUMNS=["repository","number","title","state","user","is_pull_request","draft","labels","comments","created_at","updated_at","closed_at","html_url","body"];var PR_LIST_COLUMNS=["number","\
6
6
  title","state","draft","user","requested_reviewers","merged_at","labels","updated_at"];var PR_GET_COLUMNS=["number","title","state","draft","merged","user","requested_reviewers","head","base","additions","deletions","changed_files","labels","created_at","updated_at","merged_at","html_url","body"];var USER_COLUMNS=["login","id","name","type","html_url"];var ORG_COLUMNS=["login","id","description"];var COMMENT_COLUMNS=["id","user","created_at","updated_at","body"];var REVIEW_COLUMNS=["id","user","\
7
7
  state","submitted_at","commit_id","body"];var REVIEW_COMMENT_COLUMNS=["id","review_id","in_reply_to_id","user","path","line","side","created_at","body"];var BRANCH_COLUMNS=["name","sha","protected"];var COMMIT_COLUMNS=["sha","author","author_name","authored_at","message"];var CODE_COLUMNS=["repository","path","name","sha"];var TREE_ENTRY_COLUMNS=["path","type","size","sha"];var ACCOUNT_FLAG={name:"--account",summary:"GitHub \u30A2\u30AB\u30A6\u30F3\u30C8\uFF08ID\u30FBusername@host\u30FBusername\u30FBhost\u3002\u767B\u9332\u304C1\u4EF6\u306A\u3089\u7701\u7565\u53EF\uFF09",
@@ -97,8 +97,10 @@ change.content=content;if(encoding==="utf-8"||encoding==="base64")change.encodin
97
97
  \uFF09\u3002--no-redact \u3067\u8AAD\u307F\u76F4\u3057\u305F\u672C\u6587\u3092\u4F7F\u3046\u304B\u3001\u305D\u306E\u307E\u307E\u9001\u308B\u306A\u3089 ${ALLOW_REDACTED_FLAG.name} \u3092\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044`)}changes.push(change)});const base64=changes.filter(c=>c.encoding==="base64").length;if(base64>COMMIT_BASE64_LIMIT){errors.push(`base64 \u3067\u9001\u308B\u5909\u66F4\uFF08content_file \u306E\u30D0\u30A4\u30CA\u30EA\u3092\u542B\u3080\uFF09\u304C ${base64} \u4EF6\u3042\u308A\u307E\u3059\u30021\u30B3\u30DF\u30C3\u30C8 ${COMMIT_BASE64_LIMIT}\
98
98
  \u4EF6\u307E\u3067\u306A\u306E\u3067\u5206\u3051\u3066\u304F\u3060\u3055\u3044`)}if(errors.length>0){throw new UsageError(`--changes-file \u306B\u8AA4\u308A\u304C\u3042\u308B\u305F\u3081\u30011\u4EF6\u3082\u9001\u308A\u307E\u305B\u3093:
99
99
  ${errors.join("\n ")}`,COMMIT_USAGE)}return changes}function readChangesFile(file,allowRedacted){const bytes=readFileBytes(file,"--changes-file");let parsed;try{parsed=JSON.parse(bytes.toString("utf8").replace(/^\uFEFF/,""))}catch{throw new UsageError(`--changes-file \u3092 JSON \u3068\u3057\u3066\u8AAD\u3081\u307E\u305B\u3093: ${file}`,COMMIT_USAGE)}return parseCommitChanges(parsed,path.dirname(path.resolve(file)),allowRedacted)}function commitView(body,changes){return{...body,changes:changes.
100
- map(c=>({path:c.path,action:c.action,...c.content===void 0?{}:{content:`\uFF08${c.encoding??"utf-8"}\u30FB${c.content.length} \u6587\u5B57\uFF09`},...c.mode===void 0?{}:{mode:c.mode}}))}}async function sendCommit(ctx,plan){try{return await ctx.send(plan)}catch(error){if(error instanceof ApiError&&error.status===409&&error.body?.error==="branch_moved"){const head=error.body["current_head_sha"];const current=typeof head==="string"?head:"";throw new ConflictError(`\u30D6\u30E9\u30F3\u30C1\u304C\u5148\u306B\u9032\u3093\u3067\u3044\u308B\u305F\u3081\u3001\u30B3\u30DF\u30C3\u30C8\u3092\u4F5C\u308A\u307E\u305B\u3093\u3067\u3057\u305F\uFF08409 b\
101
- ranch_moved${current===""?"":`\u30FB\u3044\u307E\u306E\u5148\u982D ${current}`}\uFF09\u3002`,409,current===""?{}:{current_head_sha:current},"\u53D6\u308A\u8FBC\u307F\u76F4\u3057\u3066\u304B\u3089\u9001\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF08twp github compare get --base <\u624B\u5143\u306E\u8D77\u70B9> --head <\u30D6\u30E9\u30F3\u30C1> \u3067\u5DEE\u5206\u3092\u78BA\u304B\u3081\u3001\u5909\u66F4\u3092\u4F5C\u308A\u76F4\u3057\u3066 --expected-head <\u3044\u307E\u306E\u5148\u982D> \u3067\u9001\u308B\uFF09\u3002\u540C\u3058\u5185\u5BB9\u306E\u307E\u307E\u6253\u3061\u76F4\u3057\u3066\u3082\u901A\u308A\u307E\u305B\u3093\u3002")}
100
+ map(c=>({path:c.path,action:c.action,...c.content===void 0?{}:{content:`\uFF08${c.encoding??"utf-8"}\u30FB${c.content.length} \u6587\u5B57\uFF09`},...c.mode===void 0?{}:{mode:c.mode}}))}}var COMMIT_FORBIDDEN_HINT="GitHub \u304C\u66F8\u304D\u8FBC\u307F\u3092\u62D2\u5426\u3057\u307E\u3057\u305F\u3002\u9023\u643A\u306B\u767B\u9332\u3057\u305F\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\u3092\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044: (1) \u66F8\u304D\u8FBC\u307F\u6A29\u9650\u304C\u3042\u308B\u304B\uFF08fine-grained \u30C8\u30FC\u30AF\u30F3\u306F\u300CContents: Read and write\u300D\u3001classic \u30C8\u30FC\u30AF\u30F3\u306F repo \u30B9\u30B3\u30FC\u30D7\uFF09 (2) \u5BFE\u8C61\u30EA\u30DD\u30B8\u30C8\u30EA\u304C\u30C8\u30FC\u30AF\u30F3\u306E\u8A31\u53EF\u7BC4\u56F2\uFF08Repository access\u30FBOrganization \u306E\u627F\u8A8D\uFF09\u306B\u5165\u3063\u3066\u3044\u308B\u304B\u3002\u76F4\u3059\u306B\u306F\u3001\u6A29\u9650\u3092\u4ED8\u3051\u305F\u30C8\u30FC\u30AF\u30F3\u3092\u767A\u884C\u3057\u3001TWP \u306E\u300C\u500B\u4EBA\u8A2D\u5B9A > \u5916\u90E8\u30B7\u30B9\u30C6\u30E0\u9023\u643A\u300D\uFF08/v1/profile/settings/external-integrations\uFF09\u306E\u300CGi\
101
+ tHub \u30A2\u30AB\u30A6\u30F3\u30C8\u300D\u30BF\u30D6\u3067\u5BFE\u8C61\u30A2\u30AB\u30A6\u30F3\u30C8\u306E\u300C\u7DE8\u96C6\u300D\u304B\u3089\u30A2\u30AF\u30BB\u30B9\u30C8\u30FC\u30AF\u30F3\u3092\u5DEE\u3057\u66FF\u3048\u3066\u304F\u3060\u3055\u3044\uFF08\u300C\u63A5\u7D9A\u30C6\u30B9\u30C8\u300D\u3067\u78BA\u304B\u3081\u3089\u308C\u307E\u3059\uFF09\u3002";async function sendCommit(ctx,plan){try{return await ctx.send(plan)}catch(error){if(error instanceof ApiError&&error.status===403&&error.body?.
102
+ error==="api_error"){throw new ApiError(error.status,error.body,plan.method,plan.path,error.retryAfterSeconds,COMMIT_FORBIDDEN_HINT)}if(error instanceof ApiError&&error.status===409&&error.body?.error==="branch_moved"){const head=error.body["current_head_sha"];const current=typeof head==="string"?head:"";throw new ConflictError(`\u30D6\u30E9\u30F3\u30C1\u304C\u5148\u306B\u9032\u3093\u3067\u3044\u308B\u305F\u3081\u3001\u30B3\u30DF\u30C3\u30C8\u3092\u4F5C\u308A\u307E\u305B\u3093\u3067\u3057\u305F\uFF08409 branch_moved${current===
103
+ ""?"":`\u30FB\u3044\u307E\u306E\u5148\u982D ${current}`}\uFF09\u3002`,409,current===""?{}:{current_head_sha:current},"\u53D6\u308A\u8FBC\u307F\u76F4\u3057\u3066\u304B\u3089\u9001\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF08twp github compare get --base <\u624B\u5143\u306E\u8D77\u70B9> --head <\u30D6\u30E9\u30F3\u30C1> \u3067\u5DEE\u5206\u3092\u78BA\u304B\u3081\u3001\u5909\u66F4\u3092\u4F5C\u308A\u76F4\u3057\u3066 --expected-head <\u3044\u307E\u306E\u5148\u982D> \u3067\u9001\u308B\uFF09\u3002\u540C\u3058\u5185\u5BB9\u306E\u307E\u307E\u6253\u3061\u76F4\u3057\u3066\u3082\u901A\u308A\u307E\u305B\u3093\u3002")}
102
104
  throw error}}var commitCreate={name:"create",summary:"\u8907\u6570\u30D5\u30A1\u30A4\u30EB\u306E\u8FFD\u52A0\u30FB\u5909\u66F4\u30FB\u524A\u9664\u30921\u30B3\u30DF\u30C3\u30C8\u306B\u3057\u3066\u30D6\u30E9\u30F3\u30C1\u3078\u7A4D\u3080\uFF08--yes \u304C\u8981\u308B\uFF09",destructive:true,confirmation:"GitHub \u306E\u30D6\u30E9\u30F3\u30C1\u3078\u30B3\u30DF\u30C3\u30C8\u3092\u7A4D\u3080\uFF08\u53D6\u308A\u6D88\u305B\u306A\u3044\uFF09\u64CD\u4F5C",usage:"twp github commit create --repo <owner/rep\
103
105
  o> --branch <\u30D6\u30E9\u30F3\u30C1> (--message <\u6587> | --message-file <\u30D1\u30B9>) --changes-file <JSON> [--expected-head <SHA>] [--account <ID|username>] --yes",description:'GitHub \u3078\u5B9F\u969B\u306B\u66F8\u304F\u64CD\u4F5C\u306A\u306E\u3067 --yes \u304C\u8981\u308A\u307E\u3059\u3002--dry-run \u3067\u9001\u308B\u5185\u5BB9\uFF08\u672C\u6587\u306F\u5927\u304D\u3055\u3060\u3051\uFF09\u3092\u78BA\u304B\u3081\u3089\u308C\u307E\u3059\u3002\n--changes-file \u306F\u5909\u66F4\u306E\u914D\u5217\uFF08\u307E\u305F\u306F {"changes": [...]}\uFF09\u306E JSON \u3067\u30011\u4EF6\u306F\u6B21\u306E\u5F62\u3067\u3059\uFF08\u6700\u5927 1000 \u4EF6\uFF09:\n {"path": "src/a.ts", "action": "put", "content": "\u2026", "encoding": "utf-8", "mode": "100644"}\n {"path": "docs/b.png", "action": "put", "content_file": "./b.png"} # \u624B\u5143\u306E\u30D5\u30A1\u30A4\u30EB\
104
106
  \u3092\u8AAD\u3080\uFF08\u76F8\u5BFE\u30D1\u30B9\u306F JSON \u306E\u5834\u6240\u304B\u3089\uFF09\n {"path": "old.txt", "action": "delete"}\nencoding \u306F utf-8\uFF08\u65E2\u5B9A\uFF09\u304B base64\u3001mode \u306F 100644\uFF08\u65E2\u5B9A\uFF09\u304B 100755 \u3067\u3059\u3002content_file \u306F UTF-8 \u306A\u3089 utf-8\u3001\u305D\u3046\u3067\u306A\u3051\u308C\u3070 base64 \u3067\u9001\u308A\u307E\u3059\u3002\n1\u4EF6\u3067\u3082\u4E0D\u6B63\u306A\u5909\u66F4\u304C\u3042\u308C\u30701\u4EF6\u3082\u9001\u308A\u307E\u305B\u3093\u3002\n\n\u25A0 \u4E0A\u66F8\u304D\u3057\u306A\u3044\n--expected-head \u3092\u4ED8\u3051\u308B\u3068\u3001\u30D6\u30E9\u30F3\u30C1\u306E\u5148\u982D\u304C\u305D\u308C\u3068\u9055\u3048\u3070\u4F55\u3082\u4F5C\u308A\u307E\u305B\u3093\u3002\u4ED8\u3051\u306A\u304F\u3066\u3082\u3001\u4F5C\u696D\u4E2D\u306B\u30D6\u30E9\u30F3\u30C1\u304C\u9032\u3093\u3060\u3089\u4F5C\u308A\u307E\u305B\u3093\u3002\n\u3069\u3061\u3089\u3082\u7D42\u4E86\u30B3\u30FC\u30C9 7 \u3067\u7D42\u308F\u308A\u3001\u3044\u307E\u306E\u5148\u982D\u3092 current_head_sha\uFF08--output json\uFF09\u3067\u8FD4\u3057\u307E\u3059\u3002\u53D6\u308A\u8FBC\u307F\u76F4\u3057\u3066\u304B\u3089\u9001\u308A\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\u5909\u66F4\u306E\u7D50\u679C\u304C\u4ECA\u306E\u30D6\u30E9\u30F3\u30C1\u3068\u540C\u3058\u306A\u3089\u3001\u30B3\u30DF\u30C3\u30C8\u3092\u4F5C\u3089\u305A unchanged: true \u3092\u8FD4\u3057\u307E\u3059\uFF08\u7A7A\u306E\u30B3\u30DF\u30C3\u30C8\u3092\u7A4D\u307F\u307E\u305B\u3093\uFF09\u3002',
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{redactSecrets}from"./chunk-BD7O73GK.js";import{Resolver,githubAccountPath,parseRepoRef}from"./chunk-UZVBQV4W.js";import{TwpApiClient}from"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{EXIT_OK,UsageError}from"./chunk-STILP3Z6.js";import{AuthSession}from"./chunk-ITFO5GPX.js";import{loadCredentials}from"./chunk-GWVREACM.js";import{httpFetch}from"./chunk-J7QYPKVK.js";
3
+ import{redactSecrets}from"./chunk-BD7O73GK.js";import{Resolver,githubAccountPath,parseRepoRef}from"./chunk-SMC6PSW3.js";import{TwpApiClient}from"./chunk-6JPXLXKW.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{EXIT_OK,UsageError}from"./chunk-STILP3Z6.js";import{AuthSession}from"./chunk-ITFO5GPX.js";import{loadCredentials}from"./chunk-GWVREACM.js";import{httpFetch}from"./chunk-J7QYPKVK.js";
4
4
  import{effectiveApiUrl,loadUserConfig,resolveProfile}from"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import{splitFlagToken}from"./chunk-OKATZ4SN.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var GIT_TOKEN_MARGIN_MS=5*6e4;var GIT_USERNAME="twp";var RELAY_PATH="api/v2/integrations/github/";var REMOTE_USAGE="twp github git-remote <owner>/<repo> [--account <ID|username>] [--profile <\u540D\u524D>]";var CREDENTIAL_USAGE="twp github git-credential <get|store|erase> [--profile <\u540D\u524D>]";var REMOTE_HELP=`\u4F7F\u3044\u65B9: ${REMOTE_USAGE}
5
5
 
6
6
  GitHub \u306E\u975E\u516C\u958B\u30EA\u30DD\u30B8\u30C8\u30EA\u3092 TWP \u7D4C\u7531\u3067 git \u306E\u307E\u307E\u8AAD\u3080\u305F\u3081\u306E remote URL \u30921\u884C\u51FA\u3057\u307E\u3059\uFF08\u8AAD\u307F\u53D6\u308A\u5C02\u7528\u30FBpush \u306F 403\uFF09\u3002
@@ -37,4 +37,4 @@ REMOTE_USAGE)}const account=args.account!==void 0?await resolver.githubAccount(a
37
37
  `);if(deps.hint??process.stderr.isTTY===true){const origin=new URL(ctx.apiUrl).origin;err(`\u8A8D\u8A3C\u306F credential helper \u3067\u6E21\u3057\u307E\u3059\uFF08\u672A\u8A2D\u5B9A\u306A\u30891\u56DE\u3060\u3051\u30021\u884C\u76EE\u306F\u65E2\u5B58\u306E\u6C4E\u7528 helper \u3092\u5916\u3059\uFF09:
38
38
  git config --global credential.${origin}.helper ''
39
39
  git config --global --add credential.${origin}.helper '!twp github git-credential${args.profile!==void 0?` --profile ${args.profile}`:""}'
40
- `)}return EXIT_OK}async function runGithubGit(sub,argv,deps={}){try{return sub==="git-remote"?await runRemote(argv,deps):await runCredential(argv,deps)}catch(e){const{exitCodeFor,reportError}=await import("./run-5VFEV3BR.js");const code=exitCodeFor(e);reportError(e,null,code,deps.err??writeStderr);return code}}export{GIT_TOKEN_MARGIN_MS,GIT_USERNAME,isRelayTarget,parseCredentialInput,runGithubGit};
40
+ `)}return EXIT_OK}async function runGithubGit(sub,argv,deps={}){try{return sub==="git-remote"?await runRemote(argv,deps):await runCredential(argv,deps)}catch(e){const{exitCodeFor,reportError}=await import("./run-O7MEIOHN.js");const code=exitCodeFor(e);reportError(e,null,code,deps.err??writeStderr);return code}}export{GIT_TOKEN_MARGIN_MS,GIT_USERNAME,isRelayTarget,parseCredentialInput,runGithubGit};
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{parseCsvRecords}from"./chunk-EHHY34NR.js";import{importRejection}from"./chunk-ERLQA262.js";import{decodeCsvText}from"./chunk-OMW6BBAY.js";import"./chunk-KMZCAOSR.js";import"./chunk-YFRU7RQJ.js";import"./chunk-O756DX6D.js";import"./chunk-PXSZZRPJ.js";import"./chunk-YLF4S4MC.js";import"./chunk-CHT6EP5C.js";import"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";
4
- import"./chunk-UZVBQV4W.js";import{ApiError,MultipartBody}from"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{nonEmpty}from"./chunk-DYT22FTA.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";
3
+ import{parseCsvRecords}from"./chunk-LUMZ6MH4.js";import{importRejection}from"./chunk-W4W2WB2Q.js";import{decodeCsvText}from"./chunk-OMW6BBAY.js";import"./chunk-2BZNAALS.js";import"./chunk-BZD5DDI3.js";import"./chunk-O756DX6D.js";import"./chunk-255NYOB2.js";import"./chunk-YLF4S4MC.js";import"./chunk-CHT6EP5C.js";import"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";
4
+ import"./chunk-SMC6PSW3.js";import{ApiError,MultipartBody}from"./chunk-6JPXLXKW.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{nonEmpty}from"./chunk-PMTQFMJS.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";
5
5
  import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import fs from"fs";import path from"path";var NAME="holiday";var LABEL="\u795D\u65E5";var READ_PATH="/api/v2/holidays";var ADMIN_PATH="/api/v2/admin/tenant/holidays";var DATE_RE=/^\d{4}-\d{2}-\d{2}$/;var YEAR_RE=/^\d{4}$/;var NAME_MAX=100;var IMPORT_MAX_BYTES=1024*1024;var SHOWN_DIFF=30;var COLUMNS=["date","name"];var IMPACT="\u795D\u65E5\u306F\u52E4\u6020\u306E\u96C6\u8A08\uFF08\u4F11\u65E5\u52B4\u50CD\u30FB\u6240\u5B9A\u65E5\u6570\uFF09\u3068\u55B6\u696D\u65E5\u6570\u306E\u8A08\u7B97\u306B\u52B9\u304D\u307E\u3059\u3002\u7DE0\u3081\u6E08\u307F\u306E\u6708\u306E\u795D\u65E5\u3092\u5909\u3048\u3066\u3082\u3001\u7DE0\u3081\u305F\u96C6\u8A08\u306F\u81EA\u52D5\u3067\u306F\u76F4\u308A\u307E\u305B\u3093\u3002";
6
6
  var FORBIDDEN=`\u7BA1\u7406\u8005\u306E\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\u3002${LABEL}\u306E\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664\u30FBCSV \u306E\u51FA\u3057\u5165\u308C\u306F\u7BA1\u7406\u8005\u3060\u3051\u304C\u884C\u3048\u307E\u3059`;var DATE_FLAG={name:"--date",summary:"\u5BFE\u8C61\u306E\u65E5\u4ED8\uFF08\u4F4D\u7F6E\u5F15\u6570\u306E\u4EE3\u308F\u308A\u306B\u4F7F\u3048\u308B\uFF09",takesValue:true,placeholder:"<YYYY-MM-DD>"};var NAME_FLAG={name:"--name",summary:`\u795D\u65E5\u540D\uFF08${NAME_MAX}\
7
7
  \u6587\u5B57\u4EE5\u5185\u30FB\u5FC5\u9808\uFF09`,takesValue:true,placeholder:"<\u795D\u65E5\u540D>"};var YEAR_FLAG={name:"--year",summary:"\u5BFE\u8C61\u306E\u5E74\uFF08YYYY\uFF09",takesValue:true,placeholder:"<YYYY>"};var OUT_FLAG={name:"--out",summary:"\u66F8\u304D\u51FA\u3057\u5148\u306E\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9\uFF08\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>"};var FORCE_FLAG={name:"--force",summary:"\u65E2\u5B58\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u4E0A\u66F8\u304D\u3059\u308B",
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{booleanText,boundedText}from"./chunk-CHT6EP5C.js";import{repeatedValues}from"./chunk-6NHLWYI2.js";import{INQUIRY_CATEGORIES_PATH}from"./chunk-UZVBQV4W.js";import"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import{UUID_RE,isSafePathSegment}from"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{isRecord,pick}from"./chunk-HCTPCUST.js";
3
+ import{booleanText,boundedText}from"./chunk-CHT6EP5C.js";import{repeatedValues}from"./chunk-6NHLWYI2.js";import{INQUIRY_CATEGORIES_PATH}from"./chunk-SMC6PSW3.js";import"./chunk-6JPXLXKW.js";import"./chunk-CJFIIGSH.js";import{UUID_RE,isSafePathSegment}from"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{isRecord,pick}from"./chunk-HCTPCUST.js";
4
4
  import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var LABEL="\u554F\u3044\u5408\u308F\u305B\u30AB\u30C6\u30B4\u30EA";var LIST_COLUMNS=["id","category_code","title","sort","is_active","notification_user_count"];var GET_COLUMNS=["id","category_code","title","description","sort","is_active","notification_users"];var FORBIDDEN=`\u7BA1\u7406\u8005\u306E\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\u3002${LABEL}\u306E\u8A73\u7D30\u30FB\u4F5C\u6210\u30FB\u66F4\u65B0\u306F\u554F\u3044\u5408\u308F\u305B\u6A5F\u80FD\u306E\u7BA1\u7406\u8005\u3060\u3051\u304C\u884C\u3048\u307E\u3059`;
5
5
  var SORT_LAST="last";var CODE_RE=/^[a-zA-Z0-9_-]+$/;var REF_HELP="<\u30AB\u30C6\u30B4\u30EA> \u306F\u30AB\u30C6\u30B4\u30EA\u30B3\u30FC\u30C9\u30FB\u540D\u524D\uFF08title\uFF09\u30FBID \u306E\u3069\u308C\u3067\u3082\u6307\u5B9A\u3067\u304D\u307E\u3059\uFF08\u540D\u524D\u304C\u8907\u6570\u306B\u4E00\u81F4\u3059\u308C\u3070\u5019\u88DC\u3092\u51FA\u3057\u3066\u6B62\u307E\u308A\u307E\u3059\uFF09\u3002\nID \u4EE5\u5916\u306F\u30AB\u30C6\u30B4\u30EA\u4E00\u89A7\uFF08\u65E2\u5B9A10\u5206\u30AD\u30E3\u30C3\u30B7\u30E5\u30FB--refresh \u3067\u53D6\u308A\u76F4\u3057\uFF09\u3068\u7167\u5408\u3057\u307E\u3059\u3002";
6
6
  var NOTIFY_HELP="--notify \u306F\u901A\u77E5\u5148\u306E\u30E6\u30FC\u30B6\u30FC\u3067\u3001\u8907\u6570\u56DE\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\u30E6\u30FC\u30B6\u30FC\u306F ID\u30FB\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u30FB\u793E\u54E1\u756A\u53F7\u30FB\u6C0F\u540D\u3067\u6307\u5B9A\u3067\u304D\u307E\u3059\n\uFF08ID \u4EE5\u5916\u306F\u30C6\u30CA\u30F3\u30C8\u306E\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u3068\u7167\u5408\u3057\u307E\u3059\u3002\u7D44\u7E54\u7BA1\u7406\u8005\u3067\u306A\u3044\u5834\u5408\u306F ID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09\u3002";
@@ -1,8 +1,8 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{invoiceNoRuleResource}from"./chunk-4ATCY3BS.js";import"./chunk-EXNQYSFO.js";import"./chunk-OMW6BBAY.js";import{invoiceAiReviewResources}from"./chunk-3I4XAJ2T.js";import{invoicePdfOperation}from"./chunk-IQVHUTF7.js";import{featureLicenseGuidance,invoiceFilters,invoiceReadOperations,licenseForbidden}from"./chunk-OGCATVOP.js";import{booleanText,isoDate}from"./chunk-CHT6EP5C.js";import{readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";
4
- import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-6NHLWYI2.js";import{SALES_INVOICES_PATH,SALES_INVOICE_AUTO_TEMPLATES_PATH,isExactNumericId,resolveNamed}from"./chunk-UZVBQV4W.js";import{ApiError}from"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{LIST_PAGING_HELP,PAGE_NUMBER_LIST_FLAGS,PAGE_NUMBER_PAGING_HELP,STABLE_PAGE_ORDER,nonEmpty,pageNumberPaging,
5
- pageNumberQuery,pageRangeNotes}from"./chunk-DYT22FTA.js";import{requireResolved,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-ITFO5GPX.js";import"./chunk-GWVREACM.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";
3
+ import{invoiceNoRuleResource}from"./chunk-YBARKKEA.js";import"./chunk-TSVDOXFW.js";import"./chunk-OMW6BBAY.js";import{invoiceAiReviewResources}from"./chunk-6GJL7P63.js";import{invoicePdfOperation}from"./chunk-EW5VJ73G.js";import{featureLicenseGuidance,invoiceFilters,invoiceReadOperations,licenseForbidden}from"./chunk-UC3GBUZX.js";import{booleanText,isoDate}from"./chunk-CHT6EP5C.js";import{readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";
4
+ import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-6NHLWYI2.js";import{SALES_INVOICES_PATH,SALES_INVOICE_AUTO_TEMPLATES_PATH,isExactNumericId,resolveNamed}from"./chunk-SMC6PSW3.js";import{ApiError}from"./chunk-6JPXLXKW.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{LIST_PAGING_HELP,PAGE_NUMBER_LIST_FLAGS,PAGE_NUMBER_PAGING_HELP,STABLE_PAGE_ORDER,nonEmpty,pageNumberPaging,
5
+ pageNumberQuery,pageRangeNotes}from"./chunk-PMTQFMJS.js";import{requireResolved,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-ITFO5GPX.js";import"./chunk-GWVREACM.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";
6
6
  import"./chunk-VSJBJXZO.js";var PATH=SALES_INVOICE_AUTO_TEMPLATES_PATH;var HISTORY_SEARCH_PATH="/api/v2/sales/invoice-auto-issue-histories";var FORMATS_PATH="/api/v2/sales/estimate-formats";function adminForbidden(body){return body?.error==="permission_denied"?featureLicenseGuidance("\u8CA9\u58F2\u7BA1\u7406"):"\u81EA\u52D5\u8ACB\u6C42\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3068\u767A\u884C\u5C65\u6B74\u306F\u3001\u8CA9\u58F2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7BA1\u7406\u8005\u300D\u306E\u4EBA\u3060\u3051\u304C\u6271\u3048\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}
7
7
  var CONTENT_KEYS=["template_name","estimate_format_id","interval_months","next_issue_date","period_start_date","period_end_date","payment_term_months","payment_term_day","estimate_expiration_months","estimate_expiration_day","order_acceptance_months","order_acceptance_day","invoice_date_months","invoice_date_day","estimate_business_place_id","estimate_seal_impression_id","invoice_business_place_id","invoice_seal_impression_id","company_id","project_id","payee_id","estimate_user_id","invoice_user\
8
8
  _id","detail","memo","template_memo","notification_user_ids","estimate_manage_content","invoice_manage_content","is_active"];var DETAIL_KEYS=["list"];var DETAIL_ROW_KEYS=["title","price","quantity","unit","tax","delivery_date"];var NOT_SAVED_KEYS=["period_start_months","period_start_day","period_end_months","period_end_day"];var FIELD_NOTES=[["template_name","\u4F5C\u6210\u3067\u5FC5\u9808\u3002\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u540D\uFF08255 \u6587\u5B57\u307E\u3067\uFF09"],["estimate_format\
@@ -0,0 +1,9 @@
1
+ import { createRequire as __twpCreateRequire } from 'node:module';
2
+ const require = __twpCreateRequire(import.meta.url);
3
+ import{STATUS_VALUES,flatMasterDomain}from"./chunk-255NYOB2.js";import"./chunk-CHT6EP5C.js";import{JOB_TITLES_PATH}from"./chunk-SMC6PSW3.js";import"./chunk-6JPXLXKW.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import"./chunk-PMTQFMJS.js";import"./chunk-7DCWZ2NF.js";import"./chunk-HCTPCUST.js";import"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";
4
+ import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var jobTitleDomain=flatMasterDomain({name:"job-title",label:"\u8077\u4F4D",path:JOB_TITLES_PATH,itemKey:"job_title",summary:"\u8077\u4F4D\u30DE\u30B9\u30BF\uFF08\u4E00\u89A7\u30FB\u53D6\u5F97\u30FB\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664\uFF09",listColumns:["id","code","name","sort_order","status","position_id","base_selling_price","base_cost_price","exclude_from_project_labor_cost"],getColumns:["id","code","name","name_short","sort_order","status","position_id","base_selling_price","bas\
5
+ e_cost_price","exclude_from_project_labor_cost","description"],fields:[{kind:"text",flag:"--name-short",key:"name_short",label:"\u7565\u79F0",maxChars:50,summary:"\u7565\u79F0"},{kind:"integer",flag:"--sort-order",key:"sort_order",label:"\u8868\u793A\u9806",min:0,max:9999,summary:"\u8868\u793A\u9806\uFF080\u301C9999\uFF09"},{kind:"enum",flag:"--status",key:"status",values:STATUS_VALUES,summary:"\u72B6\u614B\uFF08active: \u6709\u52B9 / inactive: \u7121\u52B9\uFF09"},{kind:"text",flag:"--descripti\
6
+ on",key:"description",label:"\u8AAC\u660E",maxChars:1e3,summary:"\u8AAC\u660E"},{kind:"integer",flag:"--base-selling-price",key:"base_selling_price",label:"\u57FA\u6E96\u58F2\u4FA1",min:0,summary:"\u57FA\u6E96\u58F2\u4FA1\uFF080\u4EE5\u4E0A\u306E\u6574\u6570\uFF09"},{kind:"integer",flag:"--base-cost-price",key:"base_cost_price",label:"\u57FA\u6E96\u539F\u4FA1",min:0,summary:"\u57FA\u6E96\u539F\u4FA1\uFF080\u4EE5\u4E0A\u306E\u6574\u6570\uFF09"},{kind:"boolean",flag:"--exclude-from-project-labor-c\
7
+ ost",key:"exclude_from_project_labor_cost",summary:"\u4EBA\u4EF6\u8CBB\u3092\u6848\u4EF6\u539F\u4FA1\u306B\u542B\u3081\u306A\u3044\u304B\uFF08true \u306B\u3059\u308B\u3068\u3053\u306E\u8077\u4F4D\u306E\u4EBA\u4EF6\u8CBB\u306F\u6848\u4EF6\u539F\u4FA1\u3067\u306F\u306A\u304F\u8CA9\u7BA1\u8CBB\u3068\u3057\u3066\u6271\u3046\u3002true / false\uFF09"},{kind:"text",flag:"--skill-requirements",key:"skill_requirements",label:"\u30B9\u30AD\u30EB\u8981\u4EF6",maxChars:5e3,summary:"\u30B9\u30AD\u30EB\u8981\u4EF6"},
8
+ {kind:"ref",flag:"--position",key:"position_id",summary:"\u7D10\u3065\u3051\u308B\u5F79\u8077\uFF08\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID\uFF09",placeholder:"<\u5F79\u8077>",clearFlag:"--no-position",clearSummary:"\u5F79\u8077\u3068\u306E\u7D10\u3065\u3051\u3092\u5916\u3059",resolve:(ctx,ref,flag)=>ctx.resolver.position(ref,flag)}],resolve:(ctx,ref,flag)=>ctx.resolver.jobTitle(ref,flag),deleteGuidance:"\u4ECA\u5F8C\u4F7F\u308F\u306A\u3044\u8077\u4F4D\u306F\u3001\u524A\u9664\u305B\u305A\u306B\u7121\u52B9\u5316\u3057\u3066\u304F\u3060\u3055\u3044: twp job-title update <\u8077\u4F4D> --status inactive\n\uFF08\u904E\u53BB\u306E\u6240\u5C5E\u306E\u8A18\u9332\u306F\u305D\u306E\u307E\u307E\u6B8B\u308A\u307E\u3059\
9
+ \uFF09"});export{jobTitleDomain};
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-DYT22FTA.js";import{requireResolved,withResolved}from"./chunk-7DCWZ2NF.js";import{isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var BASE="/api/v2/accounting/ledgers";var SUB_BY=["sub_account","partner"];var DIMENSIONS=["department","project"];var FORBIDDEN="\u4F1A\u8A08\u306E\u5E33\u7C3F\u3092\u53C2\u7167\u3059\u308B\u6A29\u9650\uFF08\u4F1A\u8A08: \u53C2\u7167\uFF09\u304C\u5FC5\u8981\u3067\u3059\u3002\u4F1A\u8A08\u306E\u6A5F\u80FD\u304C\u30C6\u30CA\u30F3\u30C8\u3067\u6709\u52B9\u306B\u306A\u3063\u3066\u3044\u308B\u3053\u3068\u3082\u5FC5\u8981\u3067\u3059";var ACCOUNT_COLUMNS=["account_title_id","code","name","category"];
3
+ import{readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-PMTQFMJS.js";import{requireResolved,withResolved}from"./chunk-7DCWZ2NF.js";import{isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var BASE="/api/v2/accounting/ledgers";var SUB_BY=["sub_account","partner"];var DIMENSIONS=["department","project"];var FORBIDDEN="\u4F1A\u8A08\u306E\u5E33\u7C3F\u3092\u53C2\u7167\u3059\u308B\u6A29\u9650\uFF08\u4F1A\u8A08: \u53C2\u7167\uFF09\u304C\u5FC5\u8981\u3067\u3059\u3002\u4F1A\u8A08\u306E\u6A5F\u80FD\u304C\u30C6\u30CA\u30F3\u30C8\u3067\u6709\u52B9\u306B\u306A\u3063\u3066\u3044\u308B\u3053\u3068\u3082\u5FC5\u8981\u3067\u3059";var ACCOUNT_COLUMNS=["account_title_id","code","name","category"];
4
4
  var BALANCE_COLUMNS=["opening","debit","credit","closing"];var GENERAL_COLUMNS=["posting_date","entry_number","entry_type","description","counter_account","sub_account_name","partner_name","debit","credit","balance"];var SUB_COLUMNS={sub_account:["sub_account_title_id","sub_account_name",...BALANCE_COLUMNS],partner:["partner_id","partner_name",...BALANCE_COLUMNS]};var SEGMENT_COLUMNS=["segment_id","segment_name","revenue","expense","profit"];var FISCAL_YEAR_FLAG={name:"--fiscal-year",summary:"\u4F1A\u8A08\
5
5
  \u5E74\u5EA6\uFF08\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<YYYY>"};var FROM_FLAG={name:"--from",summary:"\u3053\u306E\u8A08\u4E0A\u65E5\u4EE5\u964D\uFF08\u4F1A\u8A08\u5E74\u5EA6\u306E\u4E2D\u30FB\u7701\u7565\u6642\u306F\u671F\u9996\uFF09",takesValue:true,placeholder:"<YYYY-MM-DD>"};var TO_FLAG={name:"--to",summary:"\u3053\u306E\u8A08\u4E0A\u65E5\u4EE5\u524D\uFF08\u4F1A\u8A08\u5E74\u5EA6\u306E\u4E2D\u30FB\u7701\u7565\u6642\u306F\u671F\u672B\uFF09",takesValue:true,placeholder:"<YYYY-MM-DD\
6
6
  >"};var PERIOD_FLAGS=[FISCAL_YEAR_FLAG,FROM_FLAG,TO_FLAG];var GENERAL_FILTER_FLAGS=[{name:"--sub-account",summary:"\u3053\u306E\u88DC\u52A9\u79D1\u76EE\u306E\u884C\u3060\u3051",takesValue:true,placeholder:"<\u88DC\u52A9\u79D1\u76EEID>"},{name:"--no-sub-account",summary:"\u88DC\u52A9\u79D1\u76EE\u304C\u7121\u3044\u884C\u3060\u3051",takesValue:false},{name:"--partner-id",summary:"\u3053\u306E\u53D6\u5F15\u5148 ID \u306E\u884C\u3060\u3051",takesValue:true,placeholder:"<\u53D6\u5F15\u5148ID>"},{name:"\
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{CONTENT_FILE_FLAG,NOTES_PATH,NOTE_GET_COLUMNS,NOTE_LABEL,NOTE_STATUSES,NOTE_VISIBILITIES,TEXT_OUTPUT_HELP,WIKI_CONTENT_FORMATS,WIKI_FORMAT_BY_EXTENSION,digestSummary,envelopeRows,fitDigest,meetingDomain,noArgs,noteGet,noteList,oneOf,pageLimit,record,resolveWikiPath,scanTruncatedNote,singleId,wikiDomain}from"./chunk-LQKHOOAV.js";import"./chunk-VRBI2NPI.js";import"./chunk-RMFLTSOV.js";import"./chunk-YLF4S4MC.js";import"./chunk-62GRAKUD.js";import"./chunk-CHT6EP5C.js";
4
- import"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";import"./chunk-UZVBQV4W.js";import"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import"./chunk-DYT22FTA.js";import"./chunk-7DCWZ2NF.js";import"./chunk-HCTPCUST.js";import"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";
3
+ import{CONTENT_FILE_FLAG,NOTES_PATH,NOTE_GET_COLUMNS,NOTE_LABEL,NOTE_STATUSES,NOTE_VISIBILITIES,TEXT_OUTPUT_HELP,WIKI_CONTENT_FORMATS,WIKI_FORMAT_BY_EXTENSION,digestSummary,envelopeRows,fitDigest,meetingDomain,noArgs,noteGet,noteList,oneOf,pageLimit,record,resolveWikiPath,scanTruncatedNote,singleId,wikiDomain}from"./chunk-B6ZG4XRL.js";import"./chunk-VRBI2NPI.js";import"./chunk-RMFLTSOV.js";import"./chunk-YLF4S4MC.js";import"./chunk-62GRAKUD.js";import"./chunk-CHT6EP5C.js";
4
+ import"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";import"./chunk-SMC6PSW3.js";import"./chunk-6JPXLXKW.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import"./chunk-PMTQFMJS.js";import"./chunk-7DCWZ2NF.js";import"./chunk-HCTPCUST.js";import"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";
5
5
  import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";export{CONTENT_FILE_FLAG,NOTES_PATH,NOTE_GET_COLUMNS,NOTE_LABEL,NOTE_STATUSES,NOTE_VISIBILITIES,TEXT_OUTPUT_HELP,WIKI_CONTENT_FORMATS,WIKI_FORMAT_BY_EXTENSION,digestSummary,envelopeRows,fitDigest,meetingDomain,noArgs,noteGet,noteList,oneOf,pageLimit,record,resolveWikiPath,scanTruncatedNote,singleId,wikiDomain};
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{applyInstancePlan,createInstancePlan,formColumns,writtenInstance}from"./chunk-QJ7TUEDB.js";import"./chunk-3I4XAJ2T.js";import"./chunk-IQVHUTF7.js";import"./chunk-OGCATVOP.js";import{assertMonthsOpen}from"./chunk-YFRU7RQJ.js";import{USER_REF_FLAG,USER_REF_HELP,userPath}from"./chunk-O756DX6D.js";import"./chunk-PXSZZRPJ.js";import{dateFlag}from"./chunk-YLF4S4MC.js";import"./chunk-CHT6EP5C.js";import"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";
4
- import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";import"./chunk-UZVBQV4W.js";import{ApiError}from"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import{UUID_RE}from"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import"./chunk-DYT22FTA.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiRejectedError,ApiResponseError,
3
+ import{applyInstancePlan,createInstancePlan,formColumns,writtenInstance}from"./chunk-POKCUHCX.js";import"./chunk-6GJL7P63.js";import"./chunk-EW5VJ73G.js";import"./chunk-UC3GBUZX.js";import{assertMonthsOpen}from"./chunk-BZD5DDI3.js";import{USER_REF_FLAG,USER_REF_HELP,userPath}from"./chunk-O756DX6D.js";import"./chunk-255NYOB2.js";import{dateFlag}from"./chunk-YLF4S4MC.js";import"./chunk-CHT6EP5C.js";import"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";
4
+ import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";import"./chunk-SMC6PSW3.js";import{ApiError}from"./chunk-6JPXLXKW.js";import"./chunk-CJFIIGSH.js";import{UUID_RE}from"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import"./chunk-PMTQFMJS.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiRejectedError,ApiResponseError,
5
5
  UsageError}from"./chunk-STILP3Z6.js";import{NotLoggedInError,SessionExpiredError}from"./chunk-ITFO5GPX.js";import"./chunk-GWVREACM.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var LIST_USAGE="twp leave list";var GRANTS_USAGE="twp leave grants [<\u30E6\u30FC\u30B6\u30FC> | --user <\u30E6\u30FC\u30B6\u30FC>]";var USAGE_COLUMNS=["used_date","type_label","days","hours","status_label","reason","is_post_application","id"];var GRANT_COLUMNS=["grant_date","type_label","days","remaining_days","remaining_hours","expiry_date","status_label","reason","id"];function noArgs(input,operation){if(input.args.length>0){throw new UsageError(`${operation} \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D7\u3051\u53D6\u308A\u307E\u305B\u3093: ${input.
6
6
  args.join(" ")}`,`twp leave ${operation} help`)}}function summaryBody(body){if(!isRecord(body)||!isRecord(body["summary"])){throw new ApiResponseError("\u6709\u7D66\u30B5\u30DE\u30EA\u306E\u5FDC\u7B54\u306B summary \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return body}function usagesBody(body){if(!isRecord(body)||!Array.isArray(body["usages"])){throw new ApiResponseError("\u6709\u7D66\u306E\u53D6\u5F97\u5C65\u6B74\u306E\u5FDC\u7B54\u306B usages \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
7
7
  return body}function grantsBody(body){if(!isRecord(body)||!Array.isArray(body["grants"])){throw new ApiResponseError("\u6709\u7D66\u306E\u4ED8\u4E0E\u5C65\u6B74\u306E\u5FDC\u7B54\u306B grants \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return body}function listBody(body){const combined=isRecord(body)?body:{};return{summary:summaryBody(combined["summary"]),usages:usagesBody(combined["usages"])}}async function list(input,ctx){