@tocca-systems/twp-cli 0.114.0 → 0.116.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 (114) hide show
  1. package/CHANGELOG.public.md +18 -0
  2. package/README.md +32 -6
  3. package/command-model/_routes.json +217 -1
  4. package/command-model/advance-payment.json +17 -0
  5. package/command-model/analysis.json +1 -2
  6. package/command-model/announcement.json +2 -1
  7. package/command-model/budget.json +1 -1
  8. package/command-model/cms-tag.json +1 -1
  9. package/command-model/contract.json +2 -2
  10. package/command-model/corporate-document-extraction.json +7 -0
  11. package/command-model/corporate-document.json +10 -0
  12. package/command-model/corporate-establishment-guide.json +7 -0
  13. package/command-model/corporate-management.json +13 -0
  14. package/command-model/corporate-meeting.json +18 -0
  15. package/command-model/corporate-officer.json +12 -0
  16. package/command-model/corporate-procedure-ledger.json +13 -0
  17. package/command-model/corporate-procedure-master.json +12 -0
  18. package/command-model/corporate-procedure.json +7 -0
  19. package/command-model/corporate-right.json +11 -0
  20. package/command-model/corporate-share-register.json +10 -0
  21. package/command-model/corporate-share-round.json +11 -0
  22. package/command-model/corporate-share.json +18 -0
  23. package/command-model/corporate-shareholder-relation.json +14 -0
  24. package/command-model/corporate-stock-option.json +13 -0
  25. package/command-model/department.json +2 -2
  26. package/command-model/dynamo-cms.json +1 -1
  27. package/command-model/employee-change-request.json +8 -0
  28. package/command-model/employee-profile.json +12 -0
  29. package/command-model/estimate-format.json +2 -2
  30. package/command-model/estimate.json +2 -2
  31. package/command-model/expense-receipt-scan.json +6 -0
  32. package/command-model/expense-report.json +4 -2
  33. package/command-model/expense-settings.json +1 -1
  34. package/command-model/fixed-asset.json +13 -0
  35. package/command-model/hr-headcount.json +6 -0
  36. package/command-model/index.json +48 -9
  37. package/command-model/invoice.json +2 -2
  38. package/command-model/master-tenant.json +2 -2
  39. package/command-model/media-file.json +3 -3
  40. package/command-model/meeting.json +4 -2
  41. package/command-model/my-number.json +12 -0
  42. package/command-model/organization-announcement.json +2 -1
  43. package/command-model/payroll-item-definition.json +10 -0
  44. package/command-model/payroll-run.json +14 -0
  45. package/command-model/position.json +2 -2
  46. package/command-model/private-task.json +1 -0
  47. package/command-model/profit-analysis.json +1 -1
  48. package/command-model/project-task-comment.json +1 -1
  49. package/command-model/project-task-detail-bundle.json +6 -0
  50. package/command-model/project-task-status.json +2 -2
  51. package/command-model/purchase.json +2 -2
  52. package/command-model/requirement-doc-ai-edit.json +8 -0
  53. package/command-model/requirement-doc-generation.json +7 -0
  54. package/command-model/requirement-doc-source.json +13 -0
  55. package/command-model/requirement-doc-version.json +9 -0
  56. package/command-model/requirement-doc.json +14 -0
  57. package/command-model/requirement-issue.json +9 -0
  58. package/command-model/requirement-item.json +10 -0
  59. package/command-model/requirement-saved-instruction.json +8 -0
  60. package/command-model/requirement-source-candidate.json +6 -0
  61. package/command-model/requirement-task-proposal.json +7 -0
  62. package/command-model/requirement-template.json +9 -0
  63. package/command-model/requirement-test-spec.json +8 -0
  64. package/command-model/sales.json +3 -3
  65. package/command-model/staff-assignment.json +6 -0
  66. package/command-model/staffing-board-cell.json +1 -1
  67. package/command-model/staffing-board-note.json +1 -1
  68. package/command-model/staffing-board-tentative-assignment.json +1 -1
  69. package/command-model/task-requirement-link.json +7 -0
  70. package/command-model/tenant-settings.json +1 -1
  71. package/command-model/user-api-key.json +2 -2
  72. package/command-model/user-invitation.json +2 -2
  73. package/command-model/user-list-item-order.json +1 -1
  74. package/command-model/user-management.json +2 -2
  75. package/command-model/user.json +4 -0
  76. package/dist/THIRD-PARTY-NOTICES.md +1 -1
  77. package/dist/{agent-loop-PCSEEC5I.js → agent-loop-5SMJG7CB.js} +15 -12
  78. package/dist/{api-command-XRXZLIDF.js → api-command-RXXCI72A.js} +1 -1
  79. package/dist/{app-IGRQAPNH.js → app-MRG7YVO7.js} +1 -1
  80. package/dist/{backlog-MVI3DG5T.js → backlog-3WLFVEBA.js} +61 -29
  81. package/dist/{capacity-list-command-7SR23CXI.js → capacity-list-command-EUU3H5ZE.js} +8 -8
  82. package/dist/{chunk-X7IBNJCH.js → chunk-46OWZRTJ.js} +8 -8
  83. package/dist/chunk-56LNKTKM.js +4 -0
  84. package/dist/{chunk-YW34MBIB.js → chunk-DEPFLEQL.js} +1 -1
  85. package/dist/{chunk-GFLGXGWE.js → chunk-F5QDUPQO.js} +1 -1
  86. package/dist/{chunk-VNQHZHV7.js → chunk-F7LPERJA.js} +1 -1
  87. package/dist/{chunk-THB6NEWD.js → chunk-FFRQGBMA.js} +7 -7
  88. package/dist/{chunk-FMB6FW6J.js → chunk-LEZ576RA.js} +14 -13
  89. package/dist/{chunk-VUXMQWXG.js → chunk-SMOBUQPO.js} +1 -1
  90. package/dist/cli.js +32 -11
  91. package/dist/{commands-FYBNM5KV.js → commands-74PDZH6C.js} +46 -42
  92. package/dist/{commands-F665OECQ.js → commands-P77EIMBU.js} +2 -2
  93. package/dist/{content-FGCZHTIY.js → content-JB6P46IF.js} +51 -45
  94. package/dist/dist-B4FAEXU4.js +120 -0
  95. package/dist/{logout-guard-6SCLP4NT.js → logout-guard-KQLNCNJP.js} +1 -1
  96. package/dist/{media-STTUSAOS.js → media-RI32UZY5.js} +1 -1
  97. package/dist/{outlook-DLEA27PZ.js → outlook-U4XXFMC3.js} +24 -18
  98. package/dist/{plan-submit-HXPVV4DR.js → plan-submit-QQPKYJ3M.js} +1 -1
  99. package/dist/{query-XEOVFI4D.js → query-J76QIXWR.js} +1 -1
  100. package/dist/redmine-GTHXTKKD.js +74 -0
  101. package/dist/{registry-QNFSDORJ.js → registry-7LKI5A35.js} +1 -1
  102. package/dist/{run-OZTTCFUR.js → run-EYQI5JLL.js} +1 -1
  103. package/dist/{runner-command-F65BLHXF.js → runner-command-YVY25WNU.js} +1 -1
  104. package/dist/{server-settings-MQKXV7XS.js → server-settings-DOWTEZGC.js} +1 -1
  105. package/dist/{setup-2Y2EFPOZ.js → setup-3NYVAJKI.js} +1 -1
  106. package/dist/{skill-manage-command-QEZ5SI3A.js → skill-manage-command-HGLXVSJB.js} +2 -2
  107. package/dist/status-command-XGAFTFTW.js +17 -0
  108. package/dist/{task-FLIYESKS.js → task-OHQ7BTOP.js} +21 -23
  109. package/dist/{teams-3ZI6ZY3F.js → teams-HGOGRVEL.js} +41 -18
  110. package/dist/{trigger-command-TQCKGHGL.js → trigger-command-QUWGCSXO.js} +1 -1
  111. package/package.json +1 -1
  112. package/dist/dist-HZIZTJ4O.js +0 -93
  113. package/dist/redmine-ZJ2BQR6H.js +0 -35
  114. package/dist/status-command-GAYY6LQE.js +0 -17
@@ -0,0 +1,120 @@
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 firstEntries=Object.entries(first);const secondKeys=new Set(Object.keys(second));if(firstEntries.length!==secondKeys.size){return false}for(const[key,value]of firstEntries){if(!strictDeepEqual(value,
7
+ second[key])){return false}secondKeys.delete(key)}return secondKeys.size===0}return false};var isFalse=obj=>{if(obj===null||obj===void 0||obj===false){return true}if(typeof obj==="string"){return obj===""}if(typeof obj==="object"){if(Array.isArray(obj)){return obj.length===0}return 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 ch>="a"&&ch<="z"||ch>="A"&&ch<=
8
+ "Z"||ch>="0"&&ch<="9"||ch==="_"};var ensureInteger=value=>{if(!(typeof value==="number")||Math.floor(value)!==value){throw new Error("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(
9
+ "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("not-a-number: divide by zero")}return n};var add=(left,right)=>{ensureNumbers(left,right);return left+right};var sub=(left,right)=>{ensureNumbers(left,right);return left-right};var mul=(left,right)=>{ensureNumbers(left,right);return left*right};var divide=(left,right)=>{ensureNumbers(left,right);return left/notZero(right)};var div=(left,right)=>{ensureNumbers(
10
+ left,right);return Math.floor(left/notZero(right))};var mod=(left,right)=>{ensureNumbers(left,right);return left%right};var basicTokens={"(":"Lparen",")":"Rparen","*":"Star",",":"Comma",".":"Dot",":":"Colon","@":"Current","]":"Rbracket","{":"Lbrace","}":"Rbrace","+":"Plus","%":"Modulo","?":"Question","\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){
11
+ 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;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.
12
+ _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:"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.
13
+ 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]==="["){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=
14
+ 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,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: unkno\
15
+ wn 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])){this._current+=1}return stream.slice(start,this._current)}consumeQuotedIdentifier(stream){const start=this._current;this._current+=1;const maxLength=stream.length;while(stream[this._current]!=='"'&&this._current<maxLength){let current=this._current;if(stream[current]===
16
+ "\\"&&(stream[current+1]==="\\"||stream[current+1]==='"')){current+=2}else{current+=1}this._current=current}this._current+=1;const[value,ok]=this.parseJSON(stream.slice(start,this._current));if(!ok){const error=new Error(`syntax: unexpected end of JSON input`);error.name="LexerError";throw error}return value}consumeRawStringLiteral(stream){const start=this._current;this._current+=1;const maxLength=stream.length;while(stream[this._current]!==`'`&&this._current<maxLength){let current=this._current;
17
+ if(stream[current]==="\\"&&(stream[current+1]==="\\"||stream[current+1]===`'`)){current+=2}else{current+=1}this._current=current}this._current+=1;const literal=stream.slice(start+1,this._current-1);return literal.replace(/\\(['\\])/g,"$1")}consumeNumber(stream){const start=this._current;this._current+=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:"Num\
18
+ ber"}}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){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,
19
+ 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","GTE");case"=":return this.consumeOrElse(stream,"=","Assign","EQ");case"&":return this.consumeOrElse(stream,"&","Expref","And");case"|":return this.consumeOrElse(stream,"|",
20
+ "Pipe","Or");case"/":return this.consumeOrElse(stream,"/","Divide","Div")}}consumeLiteral(stream){this._current+=1;const start=this._current;const maxLength=stream.length;while(stream[this._current]!=="`"&&this._current<maxLength){let current=this._current;if(stream[current]==="\\"&&(stream[current+1]==="\\"||stream[current+1]==="`")){current+=2}else{current+=1}this._current=current}let literalString=stream.slice(start,this._current).trimStart();literalString=literalString.replace("\\`","`");let literal=null;
21
+ let ok=false;if(this.looksLikeJSON(literalString)){[literal,ok]=this.parseJSON(literalString)}if(!ok&&this._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]}`);error.name="LexerError";throw error}this._current+=1;return literal}looksLikeJSON(literalString){const startingChars='[{"';const jsonLiterals=["true","false","null"];const numberLooking="\
22
+ -0123456789";if(literalString===""){return false}if(startingChars.includes(literalString[0])){return true}if(jsonLiterals.includes(literalString)){return true}if(numberLooking.includes(literalString[0])){const[_,ok]=this.parseJSON(literalString);return ok}return false}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,["QuotedIdentifier"]:0,
23
+ ["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 TokenParser=class _TokenParser{index=0;tokens=[];depth=0;maxDepth;nodeCount=0;maxNodes;parse(expression,options){
24
+ this.loadTokens(expression,options||{enable_legacy_literals:false});this.index=0;this.depth=0;this.nodeCount=0;this.maxDepth=options?.maxDepth;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 node count of ${this.maxNodes}`)}
25
+ 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.maxDepth!==void 0&&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]){
26
+ 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\
27
+ 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.
28
+ 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"\
29
+ 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\
30
+ 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);
31
+ 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":{
32
+ 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);
33
+ 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\
34
+ 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\
35
+ 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()}
36
+ 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!=
37
+ "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;
38
+ 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.
39
+ 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){
40
+ 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,
41
+ `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=[];
42
+ 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")}}}this.match("Rbracket");return{type:"MultiSelectList",children:expressions}}parseMultiselectHash(){const pairs=[];const identifierTypes=["UnquotedIdentifier","QuotedIdentifier"];let keyToken;let keyName;let value;for(;;){keyToken=this.lookaheadToken(
43
+ 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)==="Rbrace"){this.match("Rbrace");break}}return{type:"MultiSelectHash",children:pairs}}};var Parser=new TokenParser;var Parser_default=Parser;var findFirst=(subject,sub2,start,end)=>{
44
+ if(!subject||!sub2){return null}const s=Math.max(ensureInteger(start??0),0);const e=Math.min(ensureInteger(end??subject.length),subject.length);const offset=subject.slice(s,e).indexOf(sub2);return offset===-1?null:offset+s};var findLast=(subject,sub2,start,end)=>{if(!subject||!sub2){return null}const s=Math.max(ensureInteger(start??0),0);const e=Math.min(ensureInteger(end??subject.length),subject.length);const offset=subject.slice(s,e).lastIndexOf(sub2);return offset===-1?null:offset+s};var lower=subject=>subject.
45
+ toLowerCase();var ensurePadFuncParams=(name,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);return padding};var padLeft=(subject,width,padding)=>{padding=ensurePadFuncParams("pad_left",width,padding);return subject&&subject.padStart(width,padding)||""};var padRight=(subject,width,padding)=>{padding=ensurePadFuncParams("pad_right",width,padding);return subject&&
46
+ subject.padEnd(width,padding)||""};var replace=(subject,string,by,count)=>{if(count===0){return subject}if(!count){return subject.split(string).join(by)}ensurePositiveInteger(count);while(count-- >0&&subject.includes(string)){subject=subject.replace(string,by)}return subject};var split=(subject,search2,count)=>{if(subject.length==0&&search2.length===0){return[]}if(count===null||count===void 0){return subject.split(search2)}ensurePositiveInteger(count);if(count===0){return[subject]}const split2=subject.
47
+ split(search2);return[...split2.slice(0,count),split2.slice(count).join(search2)]};var trim=(subject,chars)=>{return trimLeft(trimRight(subject,chars),chars)};var trimLeft=(subject,chars)=>{return trimImpl(subject,list=>new RegExp(`^[${list}]*(.*?)`),chars)};var trimRight=(subject,chars)=>{return trimImpl(subject,list=>new RegExp(`(.*?)[${list}]*$`),chars)};var trimImpl=(subject,regExper,chars)=>{const pattern=chars?chars.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"):"\\s\x85";return subject.replace(regExper(
48
+ pattern),"$1")};var upper=subject=>subject.toUpperCase();var Text=class _Text{_text;constructor(text){this._text=text}get string(){return this._text}get length(){let count=0;for(const _ of this._text){count+=1}return count}compareTo(other){return _Text.compare(this,new _Text(other))}static get comparer(){const stringComparer=(left,right)=>{return new _Text(left).compareTo(right)};return stringComparer}static compare(left,right){const leftCp=left.codePoints;const rightCp=right.codePoints;for(let index=0;index<
49
+ Math.min(leftCp.length,rightCp.length);index++){if(leftCp[index]===rightCp[index]){continue}return leftCp[index]-rightCp[index]>0?1:-1}return leftCp.length-rightCp.length>0?1:-1}reverse(){return String.fromCodePoint(...this.codePoints.reverse())}get codePoints(){const array=[...this._text].map(s=>s.codePointAt(0));return array}};var createMathFunction=mathFn=>([value])=>mathFn(value);var createStringFunction=stringFn=>([subject])=>stringFn(subject);var createObjectFunction=objFn=>([obj])=>objFn(
50
+ obj);var ARRAY_SUBTYPES={[8]:0,[10]:4,[9]:2,[11]:3};var Runtime=class{_interpreter;_functionTable;_customFunctions=new Set;TYPE_NAME_TABLE=Object.freeze({[0]:"number",[1]:"any",[2]:"string",[3]:"array",[4]:"object",[5]:"boolean",[6]:"expression",[7]:"null",[8]:"Array<number>",[10]:"Array<object>",[9]:"Array<string>",[11]:"Array<Array<any>>"});constructor(interpreter){this._interpreter=interpreter;this._functionTable=this.buildFunctionTable()}buildFunctionTable(){return{abs:{_func:createMathFunction(
51
+ Math.abs),_signature:[{types:[0]}]},ceil:{_func:createMathFunction(Math.ceil),_signature:[{types:[0]}]},floor:{_func:createMathFunction(Math.floor),_signature:[{types:[0]}]},lower:{_func:createStringFunction(lower),_signature:[{types:[2]}]},upper:{_func:createStringFunction(upper),_signature:[{types:[2]}]},keys:{_func:createObjectFunction(Object.keys),_signature:[{types:[4]}]},values:{_func:createObjectFunction(Object.values),_signature:[{types:[4]}]},avg:{_func:this.functionAvg,_signature:[{types:[
52
+ 8]}]},contains:{_func:this.functionContains,_signature:[{types:[2,3]},{types:[1]}]},ends_with:{_func:this.functionEndsWith,_signature:[{types:[2]},{types:[2]}]},find_first:{_func:this.functionFindFirst,_signature:[{types:[2]},{types:[2]},{types:[0],optional:true},{types:[0],optional:true}]},find_last:{_func:this.functionFindLast,_signature:[{types:[2]},{types:[2]},{types:[0],optional:true},{types:[0],optional:true}]},from_items:{_func:this.functionFromItems,_signature:[{types:[11]}]},group_by:{_func:this.
53
+ functionGroupBy,_signature:[{types:[3]},{types:[6]}]},items:{_func:this.functionItems,_signature:[{types:[4]}]},join:{_func:this.functionJoin,_signature:[{types:[2]},{types:[9]}]},length:{_func:this.functionLength,_signature:[{types:[2,3,4]}]},map:{_func:this.functionMap,_signature:[{types:[6]},{types:[3]}]},max:{_func:this.functionMax,_signature:[{types:[8,9]}]},max_by:{_func:this.functionMaxBy,_signature:[{types:[3]},{types:[6]}]},merge:{_func:this.functionMerge,_signature:[{types:[4],variadic:true}]},
54
+ min:{_func:this.functionMin,_signature:[{types:[8,9]}]},min_by:{_func:this.functionMinBy,_signature:[{types:[3]},{types:[6]}]},not_null:{_func:this.functionNotNull,_signature:[{types:[1],variadic:true}]},pad_left:{_func:this.functionPadLeft,_signature:[{types:[2]},{types:[0]},{types:[2],optional:true}]},pad_right:{_func:this.functionPadRight,_signature:[{types:[2]},{types:[0]},{types:[2],optional:true}]},replace:{_func:this.functionReplace,_signature:[{types:[2]},{types:[2]},{types:[2]},{types:[
55
+ 0],optional:true}]},reverse:{_func:this.functionReverse,_signature:[{types:[2,3]}]},sort:{_func:this.functionSort,_signature:[{types:[9,8]}]},sort_by:{_func:this.functionSortBy,_signature:[{types:[3]},{types:[6]}]},split:{_func:this.functionSplit,_signature:[{types:[2]},{types:[2]},{types:[0],optional:true}]},starts_with:{_func:this.functionStartsWith,_signature:[{types:[2]},{types:[2]}]},sum:{_func:this.functionSum,_signature:[{types:[8]}]},to_array:{_func:this.functionToArray,_signature:[{types:[
56
+ 1]}]},to_number:{_func:this.functionToNumber,_signature:[{types:[1]}]},to_string:{_func:this.functionToString,_signature:[{types:[1]}]},trim:{_func:this.functionTrim,_signature:[{types:[2]},{types:[2],optional:true}]},trim_left:{_func:this.functionTrimLeft,_signature:[{types:[2]},{types:[2],optional:true}]},trim_right:{_func:this.functionTrimRight,_signature:[{types:[2]},{types:[2],optional:true}]},type:{_func:this.functionType,_signature:[{types:[1]}]},zip:{_func:this.functionZip,_signature:[{types:[
57
+ 3],variadic:true}]}}}registerFunction(name,customFunction,signature,options){const result=this._registerInternal(name,customFunction,signature,options);if(!result.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:"\
58
+ invalid-signature",message:error instanceof Error?error.message:"Invalid function signature"}}const{override=false,warn=false}=options;const exists=name in this._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};
59
+ this._customFunctions.add(name);const message=exists?`Function ${name}() overridden successfully`:`Function ${name}() registered successfully`;return{success:true,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(){
60
+ return Object.keys(this._functionTable)}getCustomFunctions(){return Array.from(this._customFunctions)}clearCustomFunctions(){for(const name of this._customFunctions){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){
61
+ for(let i=0;i<signature.length;i+=1){if("variadic"in signature[i]&&i!==signature.length-1){throw new Error(`Invalid arity: ${name}() '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.
62
+ length-1]?.variadic??false;const tooFewArgs=args.length<numberOfRequiredArgs;const tooManyArgs=args.length>signature.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){
63
+ for(let i=0;i<signature.length;i+=1){const currentSpec=signature[i].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}() expected argument ${i+1} to be type (${expected}) but received type ${this.TYPE_NAME_TABLE[actualType]} instead\
64
+ .`)}}}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==="string"){return 2}if(typeof obj==="number"){return 0}if(typeof obj==="boolean"){return 5}if(Array.isArray(
65
+ 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.TYPE_NAME_TABLE[this.getTypeName(current)]}`;throw new Error(msg)}return current};return keyFunc}functionAvg=([
66
+ inputArray])=>{if(!inputArray||inputArray.length==0){return null}let sum=0;for(let i=0;i<inputArray.length;i+=1){sum+=inputArray[i]}return sum/inputArray.length};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 null};functionEndsWith=([searchStr,suffix])=>{return searchStr.endsWith(suffix)};functionFindFirst=this.
67
+ createFindFunction(findFirst);functionFindLast=this.createFindFunction(findLast);createFindFunction(findFn){return resolvedArgs=>{const subject=resolvedArgs[0];const search2=resolvedArgs[1];const start=resolvedArgs.length>2?resolvedArgs[2]:void 0;const end=resolvedArgs.length>3?resolvedArgs[3]:void 0;return findFn(subject,search2,start,end)}}functionFromItems=([array])=>{for(const pair of array){if(pair.length!==2||typeof pair[0]!=="string"){throw new Error("invalid value, each array must contai\
68
+ n two elements, a pair of string and value")}}return Object.fromEntries(array)};functionGroupBy=([array,exprefNode])=>{const keyFunction=this.createKeyFunction(exprefNode,[2]);const groups={};for(const item of array){const key=keyFunction(item);if(!groups[key]){groups[key]=[]}groups[key].push(item)}return groups};functionItems=([inputValue])=>{return Object.entries(inputValue)};functionJoin=resolvedArgs=>{const[joinChar,listJoin]=resolvedArgs;return listJoin.join(joinChar)};functionLength=([inputValue])=>{
69
+ if(typeof inputValue==="string"){return new Text(inputValue).length}if(Array.isArray(inputValue)){return inputValue.length}return Object.keys(inputValue).length};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};functionMax=([inputValue])=>{if(!inputValue.length){return null}const typeName=this.getTypeName(inputValue[0]);
70
+ if(typeName===0){return Math.max(...inputValue)}const elements=inputValue;let maxElement=elements[0];for(let i=1;i<elements.length;i+=1){if(maxElement.localeCompare(elements[i])<0){maxElement=elements[i]}}return maxElement};functionMaxBy=resolvedArgs=>{const exprefNode=resolvedArgs[1];const resolvedArray=resolvedArgs[0];const keyFunction=this.createKeyFunction(exprefNode,[0,2]);let maxNumber=-Infinity;let maxRecord;let current;for(let i=0;i<resolvedArray.length;i+=1){current=keyFunction&&keyFunction(
71
+ resolvedArray[i]);if(current!==void 0&&current>maxNumber){maxNumber=current;maxRecord=resolvedArray[i]}}return maxRecord||null};functionMerge=resolvedArgs=>{return Object.assign({},...resolvedArgs)};functionMin=([inputValue])=>{if(!inputValue.length){return null}const typeName=this.getTypeName(inputValue[0]);if(typeName===0){return Math.min(...inputValue)}const elements=inputValue;let minElement=elements[0];for(let i=1;i<elements.length;i+=1){if(elements[i].localeCompare(minElement)<0){minElement=
72
+ elements[i]}}return minElement};functionMinBy=resolvedArgs=>{const exprefNode=resolvedArgs[1];const resolvedArray=resolvedArgs[0];const keyFunction=this.createKeyFunction(exprefNode,[0,2]);let minNumber=Infinity;let minRecord;let current;for(let i=0;i<resolvedArray.length;i+=1){current=keyFunction&&keyFunction(resolvedArray[i]);if(current!==void 0&&current<minNumber){minNumber=current;minRecord=resolvedArray[i]}}return minRecord||null};functionNotNull=resolvedArgs=>{return resolvedArgs.find(arg=>arg!==
73
+ null)??null};functionPadLeft=this.createPadFunction(padLeft);functionPadRight=this.createPadFunction(padRight);createPadFunction(padFn){return resolvedArgs=>{const subject=resolvedArgs[0];const width=resolvedArgs[1];const padding=resolvedArgs.length>2?resolvedArgs[2]:void 0;return padFn(subject,width,padding)}}functionReplace=resolvedArgs=>{const subject=resolvedArgs[0];const string=resolvedArgs[1];const by=resolvedArgs[2];return replace(subject,string,by,resolvedArgs.length>3?resolvedArgs[3]:void 0)};functionSplit=resolvedArgs=>{
74
+ const subject=resolvedArgs[0];const search2=resolvedArgs[1];return split(subject,search2,resolvedArgs.length>2?resolvedArgs[2]:void 0)};functionReverse=([inputValue])=>{const typeName=this.getTypeName(inputValue);if(typeName===2){return new Text(inputValue).reverse()}const reversedArray=[...inputValue];reversedArray.reverse();return reversedArray};functionSort=([inputValue])=>{if(inputValue.length<=1){return inputValue}if(typeof inputValue[0]==="string"){return[...inputValue].sort(Text.comparer)}
75
+ return[...inputValue].sort()};functionSortBy=resolvedArgs=>{const sortedArray=[...resolvedArgs[0]];if(sortedArray.length<=1){return sortedArray}const interpreter=this._interpreter;const exprefNode=resolvedArgs[1];const requiredType=this.getTypeName(interpreter.visit(exprefNode,sortedArray[0]));if(requiredType!==void 0&&![0,2].includes(requiredType)){throw new Error(`Invalid type: unexpected type (${this.TYPE_NAME_TABLE[requiredType]})`)}function throwInvalidTypeError(rt,item){throw new Error(`In\
76
+ valid type: expected (${rt.TYPE_NAME_TABLE[requiredType]}), received ${rt.TYPE_NAME_TABLE[rt.getTypeName(item)]}`)}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})};functionStartsWith=([searchable,
77
+ searchStr])=>{return searchable.startsWith(searchStr)};functionSum=([inputValue])=>{return inputValue.reduce((x,y)=>x+y,0)};functionToArray=([inputValue])=>{return Array.isArray(inputValue)?inputValue:[inputValue]};functionToNumber=([inputValue])=>{const typeName=this.getTypeName(inputValue);let convertedValue;if(typeName===0){return inputValue}if(typeName===2){convertedValue=+inputValue;if(!isNaN(convertedValue)){return convertedValue}}return null};functionToString=([inputValue])=>{return typeof inputValue===
78
+ "string"?inputValue:JSON.stringify(inputValue)};functionTrim=this.createTrimFunction(trim);functionTrimLeft=this.createTrimFunction(trimLeft);functionTrimRight=this.createTrimFunction(trimRight);createTrimFunction(trimFn){return resolvedArgs=>{const subject=resolvedArgs[0];const chars=resolvedArgs.length>1?resolvedArgs[1]:void 0;return trimFn(subject,chars)}}functionType=([inputValue])=>{const type=this.getTypeName(inputValue);const name=type!==void 0?this.TYPE_NAME_TABLE[type]:void 0;if(!name){
79
+ 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(){return this.data}withScope(data){const outer=new _ScopeChain;outer.inner=this;outer.data=data;return outer}getValue(identifier){if(Object.prototype.hasOwnProperty.call(this.data,identifier)){return this.data[identifier]}if(this.inner){return this.
80
+ inner.getValue(identifier)}return null}};var emptyScopeChain=new ScopeChain;var TreeInterpreter=class _TreeInterpreter{runtime;_rootValue=null;_scope;_options;_depth=0;_deadline=0;constructor(options){this.runtime=new Runtime(this);this._scope=new ScopeChain;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._functionTable=this.runtime._functionTable;
81
+ interpreter._rootValue=this._rootValue;interpreter._scope=this._scope.withScope(scope);interpreter._depth=this._depth;interpreter._deadline=this._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._depth=0;this._deadline=options?.timeoutMs!==void 0?Date.now()+options.
82
+ timeoutMs:0;const result=this.visit(node,value);this.checkOutputSize(result);return result}checkOutputSize(val){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){
83
+ throw new Error(`Output size exceeds maximum allowed size of ${this._options.maxOutputSize}`)}}evaluateProjectionItems(items,right){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}const val=elem[key];if(val!==void 0&&val!==null){this.collect(
84
+ collected,val)}}return collected}if(right.type==="Identity"){for(let i=0;i<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._options){if(this._options.maxDepth!==void 0&&this._depth>=this._options.maxDepth){throw new Error(`Evaluation exceeds maximum allowed depth of ${this._options.maxDepth}`)}
85
+ if(this._deadline>0&&Date.now()>=this._deadline){throw new Error(`Query execution timed out after ${this._options.timeoutMs}ms`)}}this._depth+=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"||
86
+ Array.isArray(value)){return null}return value[identifier]??null;case"LetExpression":{const scope={};for(const binding of node.bindings){Object.assign(scope,this.visit(binding,value))}return this.withScope(scope).visit(node.expression,value)}case"Binding":{const{variable,reference}=node;const result=this.visit(reference,value);return{[variable]:result}}case"Variable":{const variable=node.name;if(!this._scope.getValue(variable)&&!Object.prototype.hasOwnProperty.call(this._scope.currentScopeData,variable)){
87
+ 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]??null}case"Slice":{if(!Array.isArray(value)&&typeof value!==
88
+ "string"){return null}const{start,stop,step}=this.computeSliceParams(value.length,node);const target=typeof value==="string"?[...value]:value;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&&typeof base==="string"){return this.visit(right,base)}
89
+ 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"){const key=right.name;for(let i=0;i<base.length;i++){const elem=base[i];
90
+ if(isFalse(this.visit(condition,elem))){continue}if(!elem||typeof elem!=="object"||Array.isArray(elem)){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,elem)}}return results}for(const elem of base){if(isFalse(this.visit(condition,elem))){continue}const result=this.visit(right,elem);if(result!==
91
+ 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(first,second);case"Div":return div(first,second);default:throw new Error(`Syntax error: unknown arithmetic operator: ${node.operator}`)}}case"\
92
+ 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);switch(node.name){case"EQ":return strictDeepEqual(first,second);case"NE":return!strictDeepEqual(first,second)}if(typeof first!=="number"||
93
+ 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"MultiSelectList":{const collected=[];for(const child of node.children){collected.push(this.visit(child,value))}this.checkOutputSize(collected);
94
+ return collected}case"MultiSelectHash":{const collected={};for(const child of node.children){collected[child.name]=this.visit(child.value,value)}this.checkOutputSize(collected);return collected}case"OrExpression":{const result=this.visit(node.left,value);if(isFalse(result)){return this.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(
95
+ 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._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(
96
+ child,value))}const res=this.runtime.callFunction(node.name,args);this.checkOutputSize(res);return res}case"ExpressionReference":return{expref:true,...node.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,
97
+ step);stop=stop===null?step<0?-1:arrayLength:this.capSliceRange(arrayLength,stop,step);return{start,stop,step}}capSliceRange(arrayLength,actualValue,step){let nextActualValue=actualValue;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,
98
+ 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++]=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 AsyncIte\
99
+ rable, 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();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){
100
+ 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?.parseJson??"auto";const flatten=options?.flattenChunks??true;let buffer="";const textDecoder=typeof TextDecoder!=="undefined"?new TextDecoder:null;for await(const chunk of toAsyncIterable(source)){if(chunk instanceof Uint8Array&&textDecoder){buffer+=textDecoder.decode(chunk,{stream:true});if(buffer.includes(
101
+ "\n")){const lines=buffer.split("\n");buffer=lines.pop()??"";for(const line of lines){const trimmed=line.trim();if(trimmed){yield parseItem(trimmed,parseJson)}}}}else if(typeof chunk==="string"){if(parseJson===false){yield chunk}else{buffer+=chunk;if(buffer.includes("\n")){const lines=buffer.split("\n");buffer=lines.pop()??"";for(const line of lines){const trimmed=line.trim();if(trimmed){yield parseItem(trimmed,parseJson)}}}}}else if(flatten&&Array.isArray(chunk)){if(buffer.trim()){yield parseItem(
102
+ buffer.trim(),parseJson);buffer=""}for(let i=0;i<chunk.length;i++){yield chunk[i]}}else{if(buffer.trim()){yield parseItem(buffer.trim(),parseJson);buffer=""}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.left.type==="IndexExpression"&&node.left.right.type==="Slice"){const slice=node.
103
+ 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.right.type==="Slice"&&(node.left.type==="Identity"||node.left.type==="Current")){const slice=node.right;return(slice.start===null||slice.start>=0)&&(slice.stop===null||slice.stop>=0)&&(slice.step===null||slice.step>0)}return true;case"Field":case"\
104
+ Identity":case"Current":case"Subexpression":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*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 executio\
105
+ n timed out after ${options?.timeoutMs}ms`)}}switch(node.type){case"Projection":{const{left,right}=node;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();
106
+ 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 streamSource){checkDeadline();const res=interpreter.visit(right,item);if(res!==null&&res!==void 0){yield res}}return}case"IndexExpression":{if(node.right.type==="Slice"&&(node.left.type==="Identity"||node.left.type==="Current")){const slice=node.right;const start=slice.start??0;const stop=slice.stop??Infinity;const step=slice.step??1;if(start>=0&&stop>=
107
+ 0&&step>0){let index=0;for await(const item of source){checkDeadline();if(index>=stop){break}if(index>=start&&(index-start)%step===0){yield item}index++;if(index>=stop){break}}return}const collected=[];for await(const item of source){checkDeadline();collected.push(item);if(options?.maxOutputSize!==void 0&&collected.length>options.maxOutputSize){throw new Error(`Output size exceeds maximum allowed size of ${options.maxOutputSize}`)}}const result=interpreter.search(node,collected,options);if(Array.
108
+ isArray(result)){for(const item of result){yield item}}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":{const{condition,right}=node;if(right.type==="Identity"||right.type==="Current"){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();
109
+ 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(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(
110
+ leftStream,node.right,interpreter,options)){yield res}}else{const collected=[];for await(const item of leftStream){checkDeadline();collected.push(item);if(options?.maxOutputSize!==void 0&&collected.length>options.maxOutputSize){throw new Error(`Output size exceeds maximum allowed size of ${options.maxOutputSize}`)}}const result=interpreter.search(node.right,collected,options);if(result!==null&&result!==void 0){yield result}}return}case"Identity":case"Current":{for await(const item of source){checkDeadline();
111
+ 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}const collected=[];for await(const item of source){checkDeadline();collected.push(item);if(options?.maxOutputSize!==
112
+ void 0&&collected.length>options.maxOutputSize){throw new Error(`Output size exceeds maximum allowed size of ${options.maxOutputSize}`)}}const result=interpreter.search(node,collected,options);if(result!==null&&result!==void 0){yield result}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;
113
+ let source;if(typeof sourceOrExpression==="string"||isExpressionNode(sourceOrExpression)){expression=sourceOrExpression;source=expressionOrSource}else{source=sourceOrExpression;expression=expressionOrSource}if(typeof expression!=="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){
114
+ throw new Error(fnError)}}const interpreter=new TreeInterpreter(options);interpreter.runtime._functionTable=TreeInterpreterInstance.runtime._functionTable;const items=normalizeSource(source,options);const results=evaluateStreamNode(items,ast,interpreter,options);const limit=options?.limit;const maxOutputSize=options?.maxOutputSize;let count=0;for await(const result of results){yield result;count++;if(limit!==void 0&&count>=limit){break}if(maxOutputSize!==void 0&&count>maxOutputSize){throw new Error(
115
+ `Output size exceeds maximum allowed size of ${maxOutputSize}`)}}}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;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 fn=function(data){
116
+ return TreeInterpreter_default.search(nodeTree,data,options)};fn.search=data=>TreeInterpreter_default.search(nodeTree,data,options);fn.searchStream=(source,streamOptions)=>searchStream(source,nodeTree,{...options,...streamOptions});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);
117
+ 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,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.
118
+ 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=()=>{return TreeInterpreter_default.runtime.getRegistered()};var getCustomFunctions=()=>{return TreeInterpreter_default.runtime.getCustomFunctions()};var clearCustomFunctions=()=>{TreeInterpreter_default.runtime.clearCustomFunctions()};var MAX_CACHE_SIZE=1e3;
119
+ 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().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;
120
+ var jmespath={compile,compileQuery,searchStream,validate,registerFunction,register,unregisterFunction,isRegistered,getRegisteredFunctions,getCustomFunctions,clearCustomFunctions,search,tokenize,TreeInterpreter:TreeInterpreter2,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{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,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{defaultIsLoopProcess,readLockOwner,sameTwpHome}from"./chunk-3WHC4FSG.js";import{LEGACY_STATE_DIR_NAME,STATE_DIR_NAME,loopStateDir}from"./chunk-FMB6FW6J.js";import"./chunk-S5MDCZEF.js";import"./chunk-VYDPW2YO.js";import"./chunk-TTST7UDR.js";import"./chunk-ZFSWQQH3.js";import"./chunk-6CS5L24D.js";import"./chunk-N2UVRM3Z.js";import"./chunk-RMFLTSOV.js";import"./chunk-PMOUHEJQ.js";import"./chunk-5WGOHFAS.js";import{twpHomeDir}from"./chunk-RZVI6PMW.js";
3
+ import{defaultIsLoopProcess,readLockOwner,sameTwpHome}from"./chunk-3WHC4FSG.js";import{LEGACY_STATE_DIR_NAME,STATE_DIR_NAME,loopStateDir}from"./chunk-LEZ576RA.js";import"./chunk-S5MDCZEF.js";import"./chunk-VYDPW2YO.js";import"./chunk-TTST7UDR.js";import"./chunk-ZFSWQQH3.js";import"./chunk-6CS5L24D.js";import"./chunk-N2UVRM3Z.js";import"./chunk-RMFLTSOV.js";import"./chunk-PMOUHEJQ.js";import"./chunk-5WGOHFAS.js";import{twpHomeDir}from"./chunk-RZVI6PMW.js";
4
4
  import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import fs from"fs";import os from"os";import path from"path";var PIDLESS_GRACE_MS=6e4;function defaultStateDirs(env){const home=os.homedir();const dirs=[loopStateDir(env),path.join(home,STATE_DIR_NAME),path.join(home,LEGACY_STATE_DIR_NAME)].map(d=>path.resolve(d));return[...new Set(dirs)]}function readPidFile(lockDir){try{const raw=fs.readFileSync(path.join(lockDir,"pid"),"utf8").split("\n")[0]?.trim()??"";const n=Number.parseInt(raw,10);return{pid:Number.isInteger(n)&&n>0?n:null,error:null}}catch(err){const code=err.code;return{pid:null,error:code==="ENO\
5
5
  ENT"?null:code??err.message}}}function findLoopsUsingProfile(profileName,deps={}){const env=deps.env??process.env;const now=deps.now??Date.now;const isLoopProcess=deps.isLoopProcess??defaultIsLoopProcess;const myHome=twpHomeDir(env);const result={users:[],undetermined:[]};for(const stateDir of deps.stateDirs??defaultStateDirs(env)){let dirs;try{dirs=fs.readdirSync(stateDir).filter(d=>/^task-loop-.*\.lock\.d$/.test(d))}catch(err){if(err.code==="ENOENT")continue;result.undetermined.push({pid:null,
6
6
  lockDir:stateDir,reason:`\u30ED\u30C3\u30AF\u306E\u7F6E\u304D\u5834\u6240\u3092\u8AAD\u3081\u307E\u305B\u3093\uFF08${err.code??err.message}\uFF09`});continue}for(const dir of dirs){const lockDir=path.join(stateDir,dir);const pidFile=readPidFile(lockDir);if(pidFile.error!==null){result.undetermined.push({pid:null,lockDir,reason:`pid \u3092\u8AAD\u3081\u307E\u305B\u3093\uFF08${pidFile.error}\uFF09`});continue}const owner=readLockOwner(lockDir);let pid=pidFile.pid;if(pid===null){if(owner.ok){pid=owner.
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{checkOutTarget}from"./chunk-VNQHZHV7.js";import"./chunk-X7IBNJCH.js";import"./chunk-GFLGXGWE.js";import"./chunk-P4QSPSOQ.js";import"./chunk-Q3B65OFC.js";import{contentTypeFor,inspectLocalFile}from"./chunk-6H5TPSXU.js";import{checkUploadQuota}from"./chunk-V64CGX7V.js";import{parseWaitOptions,waitUntilTerminal}from"./chunk-WVCEKC7V.js";import"./chunk-RMFLTSOV.js";import{readBody}from"./chunk-HEH3PUW2.js";import"./chunk-W4NLJ2YK.js";
3
+ import{checkOutTarget}from"./chunk-F7LPERJA.js";import"./chunk-46OWZRTJ.js";import"./chunk-F5QDUPQO.js";import"./chunk-P4QSPSOQ.js";import"./chunk-Q3B65OFC.js";import{contentTypeFor,inspectLocalFile}from"./chunk-6H5TPSXU.js";import{checkUploadQuota}from"./chunk-V64CGX7V.js";import{parseWaitOptions,waitUntilTerminal}from"./chunk-WVCEKC7V.js";import"./chunk-RMFLTSOV.js";import{readBody}from"./chunk-HEH3PUW2.js";import"./chunk-W4NLJ2YK.js";
4
4
  import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-VGT2EGH6.js";import"./chunk-A7MM5WSC.js";import{collapsesInUrlPath,isSafePathSegment}from"./chunk-HVZUXLQ4.js";import{ApiError}from"./chunk-JA5A6UJ2.js";import"./chunk-MMVXE2CJ.js";import"./chunk-SBRTBKEZ.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger,readEnvelopeCursor,shellQuote}from"./chunk-MI6HVYR2.js";import{requireResolved,singleRef,withResolved}from"./chunk-PS5QFKHB.js";
5
5
  import{acknowledgement,isRecord,pick}from"./chunk-3ZRMMBP5.js";import{ApiRejectedError,ApiResponseError,NetworkError,UsageError,WaitTimeoutError}from"./chunk-VFPY2A23.js";import"./chunk-KIZIRVW6.js";import"./chunk-XNLIEUAW.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-AAABT3AX.js";import"./chunk-OKATZ4SN.js";import"./chunk-RKBUJKI5.js";import"./chunk-UREA4ZIG.js";import"./chunk-NHYMHCAT.js";
6
6
  import"./chunk-VSJBJXZO.js";import crypto2 from"crypto";import fs2 from"fs";import path from"path";var SCOPE_PERSONAL="personal";var SCOPE_PROJECT="project";var UUID=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;var FORBIDDEN_NAME=/[/\\:*?"<>|]/;var NAME_MAX=255;var ROW_COLUMNS=["id","path","name","file_count","subfolder_count","parent_id","updated_at"];var TRASH_COLUMNS=["id","path","name","file_count","subfolder_count","parent_id","deleted_at"];function folderRows(raw){return raw.map(row=>{const id=row["id"];const name=row["name"];const parentId=row["parent_id"];if(typeof id!==
@@ -59,21 +59,21 @@ k event get <id> \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002"]};var remove=
59
59
  \u4E88\u5B9AID \u306F twp outlook event list \u306E id \u3067\u3059\u3002`,destructive:true,confirmation:CONFIRMATION,flags:[EVENT_FLAG],forbidden:ms365Forbidden,async prepare(input,ctx){const id=eventId(input,"delete");const current=await ctx.resolver.ms365Event(id);return withResolved(input,{eventId:id,audience:audienceOf(current),subject:oneLine(str(current["subject"])??"\uFF08\u4EF6\u540D\u306A\u3057\uFF09"),start:oneLine(dateTimeText(current["start"])??"\uFF08\u958B\u59CB\u3092\u8AAD\u3081\u307E\u305B\u3093\uFF09")})},
60
60
  plan:input=>({method:"DELETE",path:ms365Path(`/calendar/events/${ms365Segment(requireResolved(input,"eventId"),"\u4E88\u5B9AID")}`)}),plannedNotes:input=>[`\u6D88\u3059\u4E88\u5B9A: \u300C${requireResolved(input,"subject")}\u300D\uFF08\u958B\u59CB ${requireResolved(input,"start")}\uFF09 / ${requireResolved(input,"audience")}`],summarize:body=>assertDeleted(body),raw:body=>assertDeleted(body),notes:()=>["\u4E88\u5B9A\u3092\u524A\u9664\u3057\u307E\u3057\u305F\u3002"]};var eventWriteOperations=[create,
61
61
  update,remove];var MAIL_TOP_MAX=1e3;var FOLDER=/^[A-Za-z0-9_=-]+$/;var DATE2=/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/;var MAIL_LIST_COLUMNS=["id","receivedDateTime","from","subject","isRead","hasAttachments","importance"];var MAIL_GET_COLUMNS=["id","receivedDateTime","from","to","cc","subject","importance","isRead","hasAttachments","webLink","body"];var ATTACHMENT_COLUMNS=["id","name","type","contentType","size","isInline"];function attachmentRow(row){const source=isRecord(row)?row:{};const odataType=str(source["@\
62
- odata.type"]);return pick({...source,type:odataType===null?null:odataType.replace(/^#microsoft\.graph\./,"")},ATTACHMENT_COLUMNS)}var EVENT_LIST_COLUMNS=["id","subject","start","end","isAllDay","location","organizer"];var EVENT_GET_COLUMNS=["id","subject","start","end","isAllDay","location","organizer","attendees","isOnlineMeeting","onlineMeetingUrl","webLink","body"];function mailRow(row){const source=isRecord(row)?row:{};return pick({...source,from:emailText(source["from"]),to:recipientsText(source["\
63
- toRecipients"]),cc:recipientsText(source["ccRecipients"]),body:plainText(source["body"])},MAIL_GET_COLUMNS)}function eventRow(row){const source=isRecord(row)?row:{};const location=isRecord(source["location"])?str(source["location"]["displayName"]):null;const attendees=Array.isArray(source["attendees"])?source["attendees"].map(emailText).filter(v=>v!==null).join("\u3001")||null:null;const online=isRecord(source["onlineMeeting"])?str(source["onlineMeeting"]["joinUrl"]):null;return pick({...source,
64
- start:dateTimeText(source["start"]),end:dateTimeText(source["end"]),location,organizer:emailText(source["organizer"]),attendees,onlineMeetingUrl:str(source["onlineMeetingUrl"])??online,body:plainText(source["body"])},EVENT_GET_COLUMNS)}function mailCursorKind(hasSearch){return hasSearch?"skiptoken":"skip"}function joinFilters(parts){const present=parts.filter(p=>p!==void 0);if(present.length===0)return void 0;if(present.length===1)return present[0];return present.map(p=>`(${p})`).join(" and ")}function jstDayStartUtc(raw,flag,addDays=0){
65
- const m=DATE2.exec(raw.trim());const[y,mo,d]=m===null?[NaN,NaN,NaN]:[Number(m[1]),Number(m[2]),Number(m[3])];const date=new Date(Date.UTC(y,mo-1,d+addDays,-9,0,0));const check=new Date(Date.UTC(y,mo-1,d));if(m===null||y<1970||Number.isNaN(date.getTime())||check.getUTCMonth()!==mo-1||check.getUTCDate()!==d){throw new UsageError(`${flag} \u306F yyyy-MM-dd \u306E\u5F62\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${raw}\uFF09`)}return date.toISOString().
66
- slice(0,19)}function messageAndAttachment(input,usage){const slots=[{flag:"--message",label:"\u30E1\u30FC\u30EBID"},{flag:"--attachment",label:"\u6DFB\u4ED8ID"}];const values=new Map;const open=[];for(const slot of slots){const fromFlag=input.flags.get(slot.flag);if(fromFlag===void 0){open.push(slot);continue}if(fromFlag.trim()==="")throw new UsageError(`${slot.flag} \u306B\u5024\u304C\u3042\u308A\u307E\u305B\u3093`,usage);values.set(slot.flag,fromFlag.trim())}const args=input.args.map(arg=>arg.
67
- trim()).filter(arg=>arg!=="");if(args.length>open.length){throw new UsageError(`\u4F4D\u7F6E\u5F15\u6570\u304C\u591A\u3059\u304E\u307E\u3059: ${args.slice(open.length).join(" ")}`,usage)}if(args.length<open.length)throw new UsageError(`${open[args.length]?.label}\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044`,usage);open.forEach((slot,index)=>values.set(slot.flag,args[index]));return{message:assertMs365PathSegment(values.get("--message"),"\u30E1\u30FC\u30EBID"),attachment:assertMs365PathSegment(
68
- values.get("--attachment"),"\u6DFB\u4ED8ID")}}function oneId(input,flag,label,usage){return assertMs365PathSegment(singleRef(input,{flag,label,usage}),label)}var mailResource={name:"mail",summary:"\u30E1\u30FC\u30EB\uFF08\u4E00\u89A7\u30FB\u8A73\u7D30\u30FB\u9001\u4FE1\u30FB\u8FD4\u4FE1\u30FB\u8EE2\u9001\uFF09",operations:[{name:"list",summary:"\u30E1\u30FC\u30EB\u3092\u4E00\u89A7\u3059\u308B\uFF08\u65E2\u5B9A\u306F\u53D7\u4FE1\u30C8\u30EC\u30A4\uFF09",usage:"twp outlook mail list [--folder <\u540D\u524D|\
69
- ID>] [--unread] [--search <\u8A9E>] [--filter <OData>] [--limit <\u4EF6\u6570>] [--all]",description:'\u65E2\u5B9A\u306F\u53D7\u4FE1\u30C8\u30EC\u30A4\uFF08inbox\uFF09\u3092\u65B0\u3057\u3044\u9806\u306B\u8FD4\u3057\u307E\u3059\u3002--folder \u306B\u306F sentitems / drafts / deleteditems /\narchive \u306E\u3088\u3046\u306A\u65E2\u77E5\u306E\u540D\u524D\u304B\u3001\u30D5\u30A9\u30EB\u30C0ID \u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\n\n--search \u306F\u4EF6\u540D\u30FB\u672C\u6587\u30FB\u5DEE\u51FA\u4EBA\u306A\u3069\u306E\u5168\u6587\u691C\u7D22\u3067\u3059\uFF08Microsoft 365 \u306E\u691C\u7D22\u69CB\u6587\uFF09\u3002--search \u306F --filter /\n--unread / --orderby \u3068\u4F75\u7528\u3067\u304D\u307E\u305B\u3093\uFF08Microsoft 365 \u5074\u304C\u53D7\u3051\u4ED8\u3051\u306A\u3044\u305F\u3081\u3001\u9001\u308B\u524D\u306B\u7D42\u4E86\u30B3\u30FC\u30C9 2 \u3067\u6B62\u3081\u307E\u3059\uFF09\u3002\n--filter / --orderby / --select \u306F Microsoft Graph \u306E OData \u69CB\u6587\u3092\u305D\u306E\u307E\u307E\u6E21\u3057\u307E\u3059\n\uFF08\u4F8B: --filter "receivedDateTime ge 2026-09-01T00:00:00Z"\uFF09\u3002\n\n\u8981\u7D04\u5217\u306E body \u306F\u8A73\
70
- \u7D30\uFF08twp outlook mail get\uFF09\u306B\u3060\u3051\u51FA\u307E\u3059\u3002--output json \u306F Graph \u306E\u9805\u76EE\u3092\u3059\u3079\u3066\u51FA\u3057\u307E\u3059\u3002\n\n'+graphPagingHelp(MAIL_TOP_MAX),flags:[{name:"--folder",summary:"\u30E1\u30FC\u30EB\u30D5\u30A9\u30EB\u30C0\uFF08\u65E2\u5B9A inbox\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"},{name:"--unread",summary:"\u672A\u8AAD\u3060\u3051\u306B\u3059\u308B",takesValue:false},{name:"--search",summary:"\u5168\u6587\u691C\u7D22\u306E\u8A9E",
71
- takesValue:true,placeholder:"<\u8A9E>"},{name:"--filter",summary:"OData \u306E $filter\uFF08\u305D\u306E\u307E\u307E\u6E21\u3059\uFF09",takesValue:true,placeholder:"<\u5F0F>"},{name:"--orderby",summary:"OData \u306E $orderby\uFF08\u305D\u306E\u307E\u307E\u6E21\u3059\uFF09",takesValue:true,placeholder:"<\u5F0F>"},{name:"--select",summary:"OData \u306E $select\uFF08\u8FD4\u3059\u9805\u76EE\u3092\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3067\uFF09",takesValue:true,placeholder:"<\u9805\u76EE>"},...graphListFlags(
72
- {limit:true})],forbidden:ms365Forbidden,paging:graphPaging({label:"\u30E1\u30FC\u30EB\u4E00\u89A7",kind:"either",cursorParamFor:plan=>mailCursorKind(plan.query?.["search"]!==void 0)}),plan(input){const folder=nonEmpty(input.flags,"--folder")?.trim();if(folder!==void 0&&!FOLDER.test(folder)){throw new UsageError(`--folder \u306E\u5F62\u5F0F\u304C\u9055\u3044\u307E\u3059: ${folder}`,"inbox / sentitems \u306E\u3088\u3046\u306A\u65E2\u77E5\u306E\u540D\u524D\u304B\u3001\u30D5\u30A9\u30EB\u30C0ID\uFF08\u82F1\u6570\u5B57\u3068 - _ =\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
73
- const search=nonEmpty(input.flags,"--search");if(search!==void 0&&search.includes('"')){throw new UsageError(`--search \u306B " \u306F\u4F7F\u3048\u307E\u305B\u3093\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${search}\uFF09`,"\u8A9E\u3060\u3051\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u5F15\u7528\u7B26\u306F\u3053\u3061\u3089\u3067\u4ED8\u3051\u307E\u3059\uFF09\u3002")}if(search!==void 0){const clash=["--filter","--unread","--orderby"].filter(flag=>input.flags.has(flag));if(clash.
74
- length>0){throw new UsageError(`--search \u306F ${clash.join(" / ")} \u3068\u4F75\u7528\u3067\u304D\u307E\u305B\u3093\uFF08Microsoft 365 \u304C\u53D7\u3051\u4ED8\u3051\u307E\u305B\u3093\uFF09`,"--search \u3092\u5916\u3057\u3066 --filter \u3067\u7D5E\u308B\u304B\u3001--search \u3060\u3051\u3067\u691C\u7D22\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}}const kind=mailCursorKind(search!==void 0);return{method:"GET",path:ms365Path("/outlook/messages"),query:{top:topFlag(input,MAIL_TOP_MAX),folder,search,
75
- filter:joinFilters([nonEmpty(input.flags,"--filter"),input.flags.has("--unread")?"isRead eq false":void 0]),orderby:nonEmpty(input.flags,"--orderby"),select:nonEmpty(input.flags,"--select"),[kind]:cursorFlag(input,kind)}}},summarize:body=>graphValue(body,"\u30E1\u30FC\u30EB\u4E00\u89A7").map(row=>{const source=isRecord(row)?row:{};return pick({...source,from:emailText(source["from"])},MAIL_LIST_COLUMNS)}),raw:body=>graphValue(body,"\u30E1\u30FC\u30EB\u4E00\u89A7"),notes:body=>graphPagingNotes(body,
76
- "\u30E1\u30FC\u30EB\u4E00\u89A7")},{name:"get",summary:"\u30E1\u30FC\u30EB1\u4EF6\u306E\u8A73\u7D30\u3092\u8868\u793A\u3059\u308B\uFF08\u672C\u6587\u3064\u304D\uFF09",usage:"twp outlook mail get <\u30E1\u30FC\u30EBID>",description:"\u30E1\u30FC\u30EBID \u306F twp outlook mail list \u306E id \u3067\u3059\u3002\n\u8981\u7D04\u5217\u306E body \u306F\u672C\u6587\u3092\u30D7\u30EC\u30FC\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u76F4\u3057\u305F\u3082\u306E\u3067\u3059\uFF08HTML \u306E\u672C\u6587\u3082 1\u884C\u306B\u7573\u307F\u307E\u3059\uFF09\u3002\n\u5143\u306E HTML\u30FB\u5B9B\u5148\u306E\u5168\u9805\u76EE\u306F --output json \u3067\u8AAD\u3081\u307E\u3059\u3002\u6DFB\u4ED8\u306F twp outlook attachment list \u3067\u4E00\u89A7\u3067\u304D\u307E\u3059\u3002",
62
+ odata.type"]);return pick({...source,type:odataType===null?null:odataType.replace(/^#microsoft\.graph\./,"")},ATTACHMENT_COLUMNS)}var EVENT_LIST_COLUMNS=["id","subject","start","end","isAllDay","location","organizer"];var EVENT_VIEW_COLUMNS=["id","subject","start","end","isAllDay","location","onlineMeetingUrl","type","seriesMasterId"];var EVENT_GET_COLUMNS=["id","subject","start","end","isAllDay","location","organizer","attendees","isOnlineMeeting","onlineMeetingUrl","webLink","body"];function mailRow(row){
63
+ const source=isRecord(row)?row:{};return pick({...source,from:emailText(source["from"]),to:recipientsText(source["toRecipients"]),cc:recipientsText(source["ccRecipients"]),body:plainText(source["body"])},MAIL_GET_COLUMNS)}function eventRow(row){const source=isRecord(row)?row:{};const location=isRecord(source["location"])?str(source["location"]["displayName"]):null;const attendees=Array.isArray(source["attendees"])?source["attendees"].map(emailText).filter(v=>v!==null).join("\u3001")||null:null;const online=isRecord(
64
+ source["onlineMeeting"])?str(source["onlineMeeting"]["joinUrl"]):null;return pick({...source,start:dateTimeText(source["start"]),end:dateTimeText(source["end"]),location,organizer:emailText(source["organizer"]),attendees,onlineMeetingUrl:str(source["onlineMeetingUrl"])??online,body:plainText(source["body"])},EVENT_GET_COLUMNS)}function mailCursorKind(hasSearch){return hasSearch?"skiptoken":"skip"}function joinFilters(parts){const present=parts.filter(p=>p!==void 0);if(present.length===0)return void 0;
65
+ if(present.length===1)return present[0];return present.map(p=>`(${p})`).join(" and ")}function jstDayStartUtc(raw,flag,addDays=0){const m=DATE2.exec(raw.trim());const[y,mo,d]=m===null?[NaN,NaN,NaN]:[Number(m[1]),Number(m[2]),Number(m[3])];const date=new Date(Date.UTC(y,mo-1,d+addDays,-9,0,0));const check=new Date(Date.UTC(y,mo-1,d));if(m===null||y<1970||Number.isNaN(date.getTime())||check.getUTCMonth()!==mo-1||check.getUTCDate()!==d){throw new UsageError(`${flag} \u306F yyyy-MM-dd \u306E\u5F62\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024:\
66
+ ${raw}\uFF09`)}return date.toISOString().slice(0,19)}function messageAndAttachment(input,usage){const slots=[{flag:"--message",label:"\u30E1\u30FC\u30EBID"},{flag:"--attachment",label:"\u6DFB\u4ED8ID"}];const values=new Map;const open=[];for(const slot of slots){const fromFlag=input.flags.get(slot.flag);if(fromFlag===void 0){open.push(slot);continue}if(fromFlag.trim()==="")throw new UsageError(`${slot.flag} \u306B\u5024\u304C\u3042\u308A\u307E\u305B\u3093`,usage);values.set(slot.flag,fromFlag.trim())}
67
+ const args=input.args.map(arg=>arg.trim()).filter(arg=>arg!=="");if(args.length>open.length){throw new UsageError(`\u4F4D\u7F6E\u5F15\u6570\u304C\u591A\u3059\u304E\u307E\u3059: ${args.slice(open.length).join(" ")}`,usage)}if(args.length<open.length)throw new UsageError(`${open[args.length]?.label}\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044`,usage);open.forEach((slot,index)=>values.set(slot.flag,args[index]));return{message:assertMs365PathSegment(values.get("--message"),"\u30E1\u30FC\u30EBID"),
68
+ attachment:assertMs365PathSegment(values.get("--attachment"),"\u6DFB\u4ED8ID")}}function oneId(input,flag,label,usage){return assertMs365PathSegment(singleRef(input,{flag,label,usage}),label)}var mailResource={name:"mail",summary:"\u30E1\u30FC\u30EB\uFF08\u4E00\u89A7\u30FB\u8A73\u7D30\u30FB\u9001\u4FE1\u30FB\u8FD4\u4FE1\u30FB\u8EE2\u9001\uFF09",operations:[{name:"list",summary:"\u30E1\u30FC\u30EB\u3092\u4E00\u89A7\u3059\u308B\uFF08\u65E2\u5B9A\u306F\u53D7\u4FE1\u30C8\u30EC\u30A4\uFF09",usage:"tw\
69
+ p outlook mail list [--folder <\u540D\u524D|ID>] [--unread] [--search <\u8A9E>] [--filter <OData>] [--limit <\u4EF6\u6570>] [--all]",description:'\u65E2\u5B9A\u306F\u53D7\u4FE1\u30C8\u30EC\u30A4\uFF08inbox\uFF09\u3092\u65B0\u3057\u3044\u9806\u306B\u8FD4\u3057\u307E\u3059\u3002--folder \u306B\u306F sentitems / drafts / deleteditems /\narchive \u306E\u3088\u3046\u306A\u65E2\u77E5\u306E\u540D\u524D\u304B\u3001\u30D5\u30A9\u30EB\u30C0ID \u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\n\n--search \u306F\u4EF6\u540D\u30FB\u672C\u6587\u30FB\u5DEE\u51FA\u4EBA\u306A\u3069\u306E\u5168\u6587\u691C\u7D22\u3067\u3059\uFF08Microsoft 365 \u306E\u691C\u7D22\u69CB\u6587\uFF09\u3002--search \u306F --filter /\n--unread / --orderby \u3068\u4F75\u7528\u3067\u304D\u307E\u305B\u3093\uFF08Microsoft 365 \u5074\u304C\u53D7\u3051\u4ED8\u3051\u306A\u3044\u305F\u3081\u3001\u9001\u308B\u524D\u306B\u7D42\u4E86\u30B3\u30FC\u30C9 2 \u3067\u6B62\u3081\u307E\u3059\uFF09\u3002\n--filter / --orderby / --select \u306F Microsoft Graph \u306E OData \u69CB\u6587\u3092\u305D\u306E\u307E\u307E\u6E21\u3057\u307E\u3059\n\uFF08\u4F8B: --filter "receivedDateT\
70
+ ime ge 2026-09-01T00:00:00Z"\uFF09\u3002\n\n\u8981\u7D04\u5217\u306E body \u306F\u8A73\u7D30\uFF08twp outlook mail get\uFF09\u306B\u3060\u3051\u51FA\u307E\u3059\u3002--output json \u306F Graph \u306E\u9805\u76EE\u3092\u3059\u3079\u3066\u51FA\u3057\u307E\u3059\u3002\n\n'+graphPagingHelp(MAIL_TOP_MAX),flags:[{name:"--folder",summary:"\u30E1\u30FC\u30EB\u30D5\u30A9\u30EB\u30C0\uFF08\u65E2\u5B9A inbox\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"},{name:"--unread",summary:"\u672A\u8AAD\u3060\u3051\u306B\u3059\u308B",
71
+ takesValue:false},{name:"--search",summary:"\u5168\u6587\u691C\u7D22\u306E\u8A9E",takesValue:true,placeholder:"<\u8A9E>"},{name:"--filter",summary:"OData \u306E $filter\uFF08\u305D\u306E\u307E\u307E\u6E21\u3059\uFF09",takesValue:true,placeholder:"<\u5F0F>"},{name:"--orderby",summary:"OData \u306E $orderby\uFF08\u305D\u306E\u307E\u307E\u6E21\u3059\uFF09",takesValue:true,placeholder:"<\u5F0F>"},{name:"--select",summary:"OData \u306E $select\uFF08\u8FD4\u3059\u9805\u76EE\u3092\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3067\uFF09",
72
+ takesValue:true,placeholder:"<\u9805\u76EE>"},...graphListFlags({limit:true})],forbidden:ms365Forbidden,paging:graphPaging({label:"\u30E1\u30FC\u30EB\u4E00\u89A7",kind:"either",cursorParamFor:plan=>mailCursorKind(plan.query?.["search"]!==void 0)}),plan(input){const folder=nonEmpty(input.flags,"--folder")?.trim();if(folder!==void 0&&!FOLDER.test(folder)){throw new UsageError(`--folder \u306E\u5F62\u5F0F\u304C\u9055\u3044\u307E\u3059: ${folder}`,"inbox / sentitems \u306E\u3088\u3046\u306A\u65E2\u77E5\u306E\u540D\u524D\u304B\u3001\u30D5\u30A9\u30EB\u30C0ID\uFF08\u82F1\u6570\u5B57\u3068 - _ =\uFF09\u3092\u6307\u5B9A\u3057\
73
+ \u3066\u304F\u3060\u3055\u3044\u3002")}const search=nonEmpty(input.flags,"--search");if(search!==void 0&&search.includes('"')){throw new UsageError(`--search \u306B " \u306F\u4F7F\u3048\u307E\u305B\u3093\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${search}\uFF09`,"\u8A9E\u3060\u3051\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u5F15\u7528\u7B26\u306F\u3053\u3061\u3089\u3067\u4ED8\u3051\u307E\u3059\uFF09\u3002")}if(search!==void 0){const clash=["--filter","--unread","--orderby"].filter(
74
+ flag=>input.flags.has(flag));if(clash.length>0){throw new UsageError(`--search \u306F ${clash.join(" / ")} \u3068\u4F75\u7528\u3067\u304D\u307E\u305B\u3093\uFF08Microsoft 365 \u304C\u53D7\u3051\u4ED8\u3051\u307E\u305B\u3093\uFF09`,"--search \u3092\u5916\u3057\u3066 --filter \u3067\u7D5E\u308B\u304B\u3001--search \u3060\u3051\u3067\u691C\u7D22\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}}const kind=mailCursorKind(search!==void 0);return{method:"GET",path:ms365Path("/outlook/messages"),query:{top:topFlag(
75
+ input,MAIL_TOP_MAX),folder,search,filter:joinFilters([nonEmpty(input.flags,"--filter"),input.flags.has("--unread")?"isRead eq false":void 0]),orderby:nonEmpty(input.flags,"--orderby"),select:nonEmpty(input.flags,"--select"),[kind]:cursorFlag(input,kind)}}},summarize:body=>graphValue(body,"\u30E1\u30FC\u30EB\u4E00\u89A7").map(row=>{const source=isRecord(row)?row:{};return pick({...source,from:emailText(source["from"])},MAIL_LIST_COLUMNS)}),raw:body=>graphValue(body,"\u30E1\u30FC\u30EB\u4E00\u89A7"),
76
+ notes:body=>graphPagingNotes(body,"\u30E1\u30FC\u30EB\u4E00\u89A7")},{name:"get",summary:"\u30E1\u30FC\u30EB1\u4EF6\u306E\u8A73\u7D30\u3092\u8868\u793A\u3059\u308B\uFF08\u672C\u6587\u3064\u304D\uFF09",usage:"twp outlook mail get <\u30E1\u30FC\u30EBID>",description:"\u30E1\u30FC\u30EBID \u306F twp outlook mail list \u306E id \u3067\u3059\u3002\n\u8981\u7D04\u5217\u306E body \u306F\u672C\u6587\u3092\u30D7\u30EC\u30FC\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u76F4\u3057\u305F\u3082\u306E\u3067\u3059\uFF08HTML \u306E\u672C\u6587\u3082 1\u884C\u306B\u7573\u307F\u307E\u3059\uFF09\u3002\n\u5143\u306E HTML\u30FB\u5B9B\u5148\u306E\u5168\u9805\u76EE\u306F --output json \u3067\u8AAD\u3081\u307E\u3059\u3002\u6DFB\u4ED8\u306F twp outlook attachment list \u3067\u4E00\u89A7\u3067\u304D\u307E\u3059\u3002",
77
77
  flags:[{name:"--message",summary:"\u30E1\u30FC\u30EBID\uFF08\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF09",takesValue:true,placeholder:"<ID>"}],forbidden:ms365Forbidden,async prepare(input){return withResolved(input,{messageId:oneId(input,"--message","\u30E1\u30FC\u30EBID","twp outlook mail get help")})},plan(input){return{method:"GET",path:ms365Path(`/outlook/messages/${ms365Segment(requireResolved(input,"messageId"),"\u30E1\u30FC\u30EBID")}`)}},summarize:body=>mailRow(graphData(
78
78
  body,"\u30E1\u30FC\u30EB\u8A73\u7D30")),raw:body=>graphData(body,"\u30E1\u30FC\u30EB\u8A73\u7D30")},...mailSendOperations]};var attachmentResource={name:"attachment",summary:"\u30E1\u30FC\u30EB\u306E\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\uFF08\u4E00\u89A7\u30FB\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\uFF09",operations:[{name:"list",summary:"\u30E1\u30FC\u30EB\u306E\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u3092\u4E00\u89A7\u3059\u308B",usage:"twp outlook attachment list <\u30E1\u30FC\u30EBID>",description:"\
79
79
  download \u306B\u6E21\u3059 id \u3068\u3001\u843D\u3068\u3059\u524D\u306B\u5927\u304D\u3055\u3092\u5224\u65AD\u3059\u308B\u305F\u3081\u306E size \u3092\u8FD4\u3057\u307E\u3059\uFF08\u672C\u4F53\u306F\u542B\u307F\u307E\u305B\u3093\uFF09\u3002\ntype \u304C fileAttachment \u306E\u3082\u306E\u3060\u3051\u5B9F\u4F53\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3067\u304D\u307E\u3059\uFF08itemAttachment\uFF1D\u6DFB\u4ED8\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30FB\u4E88\u5B9A\u3001\nreferenceAttachment\uFF1DOneDrive \u7B49\u3078\u306E\u30EA\u30F3\u30AF\u306F\u5B9F\u4F53\u3092\u6301\u3061\u307E\u305B\u3093\uFF09\u3002\nsize \u306F Microsoft 365 \u304C\u6570\u3048\u308B\u6DFB\u4ED8\u306E\u5927\u304D\u3055\u3067\u3001\u66F8\u304D\u51FA\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3088\u308A\u6570\u767E\u30D0\u30A4\u30C8\u5927\u304D\u304F\u51FA\u307E\u3059\n\uFF08\u4ED8\u5E2F\u60C5\u5831\u3092\u542B\u3080\u305F\u3081\u30022026-10-01 \u5B9F\u6E2C\u3067 140,793 \u306B\u5BFE\u3057\u5B9F\u4F53 140,399 \u30D0\u30A4\u30C8\uFF09\u3002\n\u3053\u306E API \u306F\u30DA\u30FC\u30B8\u30F3\u30B0\u3092\u6301\u3061\u307E\u305B\u3093\uFF08\u30E1\u30FC\u30EB1\u4EF6\u3076\u3093\u306E\u6DFB\u4ED8\u3092\u3059\u3079\u3066\u8FD4\u3057\u307E\u3059\uFF09\u3002",
@@ -84,11 +84,17 @@ ssage",summary:"\u30E1\u30FC\u30EBID\uFF08\u7B2C1\u4F4D\u7F6E\u5F15\u6570\u3068\
84
84
  \u3092\u4E0A\u66F8\u304D\u3059\u308B",takesValue:false}],forbidden:ms365Forbidden,download:{outFlag:"--out",forceFlag:"--force"},async prepare(input){const refs=messageAndAttachment(input,"twp outlook attachment download help");return withResolved(input,{messageId:refs.message,attachmentId:refs.attachment})},plan(input){const message=ms365Segment(requireResolved(input,"messageId"),"\u30E1\u30FC\u30EBID");const attachment=ms365Segment(requireResolved(input,"attachmentId"),"\u6DFB\u4ED8ID");return{
85
85
  method:"GET",path:ms365Path(`/outlook/messages/${message}/attachments/${attachment}/content`)}},summarize:body=>body,raw:body=>body,notes:body=>isRecord(body)&&body["size"]===0?["\u66F8\u304D\u51FA\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u306F 0 \u30D0\u30A4\u30C8\u3067\u3059\u3002\u6DFB\u4ED8\u3055\u308C\u305F\u30E1\u30FC\u30EB\u30FB\u4E88\u5B9A\uFF08type \u304C itemAttachment\uFF09\u3084\u30EA\u30F3\u30AF\u306E\u6DFB\u4ED8\uFF08referenceAttachment\uFF09\u306F\u5B9F\u4F53\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3067\u304D\u307E\u305B\u3093\uFF08twp outlook attachment list \u306E type \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\uFF09\u3002"]:
86
86
  []}]};var eventResource={name:"event",summary:"\u4E88\u5B9A\u8868\u306E\u4E88\u5B9A\uFF08\u4E00\u89A7\u30FB\u8A73\u7D30\u30FB\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664\uFF09",operations:[{name:"list",summary:"\u4E88\u5B9A\u3092\u4E00\u89A7\u3059\u308B",usage:"twp outlook event list [--from <yyyy-MM-dd>] [--to <yyyy-MM-dd>] [--filter <OData>] [--limit <\u4EF6\u6570>] [--all]",description:'\u81EA\u5206\u306E\u4E88\u5B9A\u8868\u306E\u4E88\u5B9A\u3092\u8FD4\u3057\u307E\u3059\u3002--from / --to \u306F\u65E5\u672C\u6642\u9593\u306E\u65E5\u4ED8\u3067\u3001\u958B\u59CB\u65E5\u6642\u304C\u305D\u306E\u7BC4\u56F2\uFF08\u4E21\u7AEF\u306E\u65E5\u3092\u542B\u3080\uFF09\u306B\n\u3042\u308B\u4E88\u5B9A\u306B\u7D5E\u308A\u307E\u3059\u3002\u65E5\u6642\u306F UTC \u3067\u8FD4\u308A\u307E\u3059\uFF08start / end \u306E\u62EC\u5F27\u5185\u304C\u30BF\u30A4\u30E0\
87
- \u30BE\u30FC\u30F3\uFF09\u3002\n\n\u26A0 \u7E70\u308A\u8FD4\u3057\u306E\u4E88\u5B9A\u306F\u300C\u7CFB\u5217\u300D\u306E1\u4EF6\u3068\u3057\u3066\u8FD4\u308A\u3001\u5404\u56DE\u306B\u306F\u5C55\u958B\u3055\u308C\u307E\u305B\u3093\u3002\u7CFB\u5217\u306E\u958B\u59CB\u65E5\u6642\u3067\u7D5E\u308A\u8FBC\u3080\u305F\u3081\u3001\n --from \u3088\u308A\u524D\u306B\u59CB\u307E\u3063\u305F\u7E70\u308A\u8FD4\u3057\u4E88\u5B9A\u306F\u3001\u7BC4\u56F2\u5185\u306B\u56DE\u304C\u3042\u3063\u3066\u3082\u51FA\u307E\u305B\u3093\u3002\n\n--filter / --orderby / --select \u306F Microsoft Graph \u306E OData \u69CB\u6587\u3092\u305D\u306E\u307E\u307E\u6E21\u3057\u307E\u3059\n\uFF08\u4F8B: --orderby "start/dateTime"\uFF09\u3002--from / --to \u3068 --filter \u306F and \u3067\u3064\u306A\u304E\u307E\u3059\u3002\n\n'+
87
+ \u30BE\u30FC\u30F3\uFF09\u3002\n\n\u26A0 \u7E70\u308A\u8FD4\u3057\u306E\u4E88\u5B9A\u306F\u300C\u7CFB\u5217\u300D\u306E1\u4EF6\u3068\u3057\u3066\u8FD4\u308A\u3001\u5404\u56DE\u306B\u306F\u5C55\u958B\u3055\u308C\u307E\u305B\u3093\u3002\u7CFB\u5217\u306E\u958B\u59CB\u65E5\u6642\u3067\u7D5E\u308A\u8FBC\u3080\u305F\u3081\u3001\n --from \u3088\u308A\u524D\u306B\u59CB\u307E\u3063\u305F\u7E70\u308A\u8FD4\u3057\u4E88\u5B9A\u306F\u3001\u7BC4\u56F2\u5185\u306B\u56DE\u304C\u3042\u3063\u3066\u3082\u51FA\u307E\u305B\u3093\u3002\n \u305D\u306E\u65E5\u30FB\u305D\u306E\u9031\u306E\u4E88\u5B9A\u30921\u56DE\u305A\u3064\u898B\u308B\u3068\u304D\u306F twp outlook event view \u3092\u4F7F\u3044\u307E\u3059\u3002\n\n--filter / --orderby / --select \u306F Microsoft Graph \u306E OData \u69CB\u6587\u3092\u305D\u306E\u307E\u307E\u6E21\u3057\u307E\u3059\n\uFF08\u4F8B: --orderby "start/dateTime"\uFF09\u3002--from / --to \u3068 --filter \u306F and \u3067\u3064\u306A\u304E\u307E\u3059\u3002\n\n'+
88
88
  graphPagingHelp(null),flags:[{name:"--from",summary:"\u3053\u306E\u65E5\uFF08\u65E5\u672C\u6642\u9593\uFF09\u4EE5\u964D\u306B\u59CB\u307E\u308B\u4E88\u5B9A",takesValue:true,placeholder:"<yyyy-MM-dd>"},{name:"--to",summary:"\u3053\u306E\u65E5\uFF08\u65E5\u672C\u6642\u9593\uFF09\u307E\u3067\u306B\u59CB\u307E\u308B\u4E88\u5B9A",takesValue:true,placeholder:"<yyyy-MM-dd>"},{name:"--filter",summary:"OData \u306E $filter\uFF08\u305D\u306E\u307E\u307E\u6E21\u3059\uFF09",takesValue:true,placeholder:"<\u5F0F>"},
89
89
  {name:"--orderby",summary:"OData \u306E $orderby\uFF08\u305D\u306E\u307E\u307E\u6E21\u3059\uFF09",takesValue:true,placeholder:"<\u5F0F>"},{name:"--select",summary:"OData \u306E $select\uFF08\u8FD4\u3059\u9805\u76EE\u3092\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3067\uFF09",takesValue:true,placeholder:"<\u9805\u76EE>"},...graphListFlags({limit:true})],forbidden:ms365Forbidden,paging:graphPaging({label:"\u4E88\u5B9A\u4E00\u89A7",kind:"skip"}),plan(input){const from=input.flags.get("--from");const to=input.
90
90
  flags.get("--to");const fromUtc=from===void 0?void 0:jstDayStartUtc(from,"--from");const toUtc=to===void 0?void 0:jstDayStartUtc(to,"--to",1);if(fromUtc!==void 0&&toUtc!==void 0&&fromUtc>=toUtc){throw new UsageError(`--to \u306F --from \u4EE5\u964D\u306E\u65E5\u4ED8\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08--from ${from} / --to ${to}\uFF09`)}return{method:"GET",path:ms365Path("/calendar/events"),query:{top:topFlag(input,null),filter:joinFilters([nonEmpty(input.flags,"--filter"),
91
- fromUtc===void 0?void 0:`start/dateTime ge '${fromUtc}'`,toUtc===void 0?void 0:`start/dateTime lt '${toUtc}'`]),orderby:nonEmpty(input.flags,"--orderby"),select:nonEmpty(input.flags,"--select"),skip:cursorFlag(input,"skip")}}},summarize:body=>graphValue(body,"\u4E88\u5B9A\u4E00\u89A7").map(row=>{const full=eventRow(row);return pick(full,EVENT_LIST_COLUMNS)}),raw:body=>graphValue(body,"\u4E88\u5B9A\u4E00\u89A7"),notes:body=>graphPagingNotes(body,"\u4E88\u5B9A\u4E00\u89A7")},{name:"get",summary:"\u4E88\
92
- \u5B9A1\u4EF6\u306E\u8A73\u7D30\u3092\u8868\u793A\u3059\u308B\uFF08\u51FA\u5E2D\u8005\u30FB\u672C\u6587\u3064\u304D\uFF09",usage:"twp outlook event get <\u4E88\u5B9AID>",description:"\u4E88\u5B9AID \u306F twp outlook event list \u306E id \u3067\u3059\u3002\u672C\u6587\u306F\u30D7\u30EC\u30FC\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u76F4\u3057\u3066 1\u884C\u306B\u7573\u307F\u307E\u3059\n\uFF08\u5143\u306E HTML\u30FB\u51FA\u5E2D\u8005\u306E\u5FDC\u7B54\u72B6\u6CC1\u306F --output json \u3067\u8AAD\u3081\u307E\u3059\uFF09\u3002",
91
+ fromUtc===void 0?void 0:`start/dateTime ge '${fromUtc}'`,toUtc===void 0?void 0:`start/dateTime lt '${toUtc}'`]),orderby:nonEmpty(input.flags,"--orderby"),select:nonEmpty(input.flags,"--select"),skip:cursorFlag(input,"skip")}}},summarize:body=>graphValue(body,"\u4E88\u5B9A\u4E00\u89A7").map(row=>{const full=eventRow(row);return pick(full,EVENT_LIST_COLUMNS)}),raw:body=>graphValue(body,"\u4E88\u5B9A\u4E00\u89A7"),notes:body=>graphPagingNotes(body,"\u4E88\u5B9A\u4E00\u89A7")},{name:"view",summary:"\
92
+ \u671F\u9593\u5185\u306E\u4E88\u5B9A\u3092\u3001\u7E70\u308A\u8FD4\u3057\u306E\u4E88\u5B9A\u30921\u56DE\u305A\u3064\u306B\u5C55\u958B\u3057\u3066\u4E00\u89A7\u3059\u308B",usage:"twp outlook event view --from <yyyy-MM-dd> [--to <yyyy-MM-dd>] [--limit <\u4EF6\u6570>] [--all]",description:'--from \u304B\u3089 --to \u307E\u3067\uFF08\u65E5\u672C\u6642\u9593\u306E\u65E5\u4ED8\u30FB\u4E21\u7AEF\u306E\u65E5\u3092\u542B\u3080\u3002--to \u3092\u7701\u304F\u3068 --from \u306E1\u65E5\u3060\u3051\uFF09\u306B\u304B\u304B\u308B\u4E88\u5B9A\u3092\u8FD4\u3057\u307E\u3059\u3002\n\u6BCE\u9031\u306E\u5B9A\u4F8B\u306E\u3088\u3046\u306A\u7E70\u308A\u8FD4\u3057\u306E\u4E88\u5B9A\u306F\u3001\u671F\u9593\u5185\u306E\u5404\u56DE\u304C1\u4EF6\u305A\u3064\u51FA\u307E\u3059\uFF08twp outlook event list \u306F\u7CFB\u5217\u306E1\u4EF6\u3060\u3051\uFF09\u3002\n\u671F\u9593\u3068\u306E\u91CD\u306A\u308A\u3067\u7D5E\u308B\u306E\u3067\u3001\u524D\u65E5\u304B\u3089\u7D9A\u304F\u4E88\u5B9A\u30FB\u7D42\u65E5\u306E\u4E88\u5B9A\u3082\u5165\u308A\u307E\u3059\u3002\n\ntype \u306F singleInstance\uFF08\u5358\u767A\uFF09/ occurrence\uFF08\u7E70\u308A\
93
+ \u8FD4\u3057\u306E1\u56DE\uFF09/ exception\uFF08\u65E5\u6642\u306A\u3069\u3092\u5909\u3048\u305F1\u56DE\uFF09\u3001\nseriesMasterId \u306F\u7E70\u308A\u8FD4\u3057\u306E\u7CFB\u5217\u306E id \u3067\u3059\u3002onlineMeetingUrl \u306F\u30AA\u30F3\u30E9\u30A4\u30F3\u4F1A\u8B70\u306E\u53C2\u52A0 URL \u3067\u3059\u3002\n\u65E5\u6642\u306F UTC \u3067\u8FD4\u308A\u307E\u3059\uFF08start / end \u306E\u62EC\u5F27\u5185\u304C\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\uFF09\u3002\n\n--filter / --orderby / --select \u306F Microsoft Graph \u306E OData \u69CB\u6587\u3092\u305D\u306E\u307E\u307E\u6E21\u3057\u307E\u3059\n\uFF08\u4F8B: --orderby "start/dateTime"\uFF09\u3002--select \u3092\u4F7F\u3046\u3068\u304D\u306F\u8981\u7D04\u5217\u306B\u8981\u308B\u9805\u76EE\u3082\u542B\u3081\u3066\u304F\u3060\u3055\u3044\u3002\n\n'+
94
+ graphPagingHelp(null),flags:[{name:"--from",summary:"\u3053\u306E\u65E5\uFF08\u65E5\u672C\u6642\u9593\uFF09\u304B\u3089\uFF08\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<yyyy-MM-dd>"},{name:"--to",summary:"\u3053\u306E\u65E5\uFF08\u65E5\u672C\u6642\u9593\uFF09\u307E\u3067\uFF08\u65E2\u5B9A\u306F --from \u3068\u540C\u3058\u65E5\uFF09",takesValue:true,placeholder:"<yyyy-MM-dd>"},{name:"--filter",summary:"OData \u306E $filter\uFF08\u305D\u306E\u307E\u307E\u6E21\u3059\uFF09",takesValue:true,placeholder:"\
95
+ <\u5F0F>"},{name:"--orderby",summary:"OData \u306E $orderby\uFF08\u305D\u306E\u307E\u307E\u6E21\u3059\uFF09",takesValue:true,placeholder:"<\u5F0F>"},{name:"--select",summary:"OData \u306E $select\uFF08\u8FD4\u3059\u9805\u76EE\u3092\u30AB\u30F3\u30DE\u533A\u5207\u308A\u3067\uFF09",takesValue:true,placeholder:"<\u9805\u76EE>"},...graphListFlags({limit:true})],forbidden:ms365Forbidden,paging:graphPaging({label:"\u4E88\u5B9A\u4E00\u89A7",kind:"skip"}),plan(input){const from=input.flags.get("--from");
96
+ if(from===void 0){throw new UsageError("--from \u3067\u671F\u9593\u306E\u6700\u521D\u306E\u65E5\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044","twp outlook event view help")}const to=input.flags.get("--to")??from;const fromUtc=jstDayStartUtc(from,"--from");const toUtc=jstDayStartUtc(to,input.flags.has("--to")?"--to":"--from",1);if(fromUtc>=toUtc){throw new UsageError(`--to \u306F --from \u4EE5\u964D\u306E\u65E5\u4ED8\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08--from ${from}\
97
+ / --to ${to}\uFF09`)}return{method:"GET",path:ms365Path("/calendar/calendarView"),query:{startDateTime:`${fromUtc}Z`,endDateTime:`${toUtc}Z`,top:topFlag(input,null),filter:nonEmpty(input.flags,"--filter"),orderby:nonEmpty(input.flags,"--orderby"),select:nonEmpty(input.flags,"--select"),skip:cursorFlag(input,"skip")}}},summarize:body=>graphValue(body,"\u4E88\u5B9A\u4E00\u89A7").map(row=>{const source=isRecord(row)?row:{};return pick({...source,...eventRow(row)},EVENT_VIEW_COLUMNS)}),raw:body=>graphValue(
98
+ body,"\u4E88\u5B9A\u4E00\u89A7"),notes:body=>graphPagingNotes(body,"\u4E88\u5B9A\u4E00\u89A7")},{name:"get",summary:"\u4E88\u5B9A1\u4EF6\u306E\u8A73\u7D30\u3092\u8868\u793A\u3059\u308B\uFF08\u51FA\u5E2D\u8005\u30FB\u672C\u6587\u3064\u304D\uFF09",usage:"twp outlook event get <\u4E88\u5B9AID>",description:"\u4E88\u5B9AID \u306F twp outlook event list \u306E id \u3067\u3059\u3002\u672C\u6587\u306F\u30D7\u30EC\u30FC\u30F3\u30C6\u30AD\u30B9\u30C8\u306B\u76F4\u3057\u3066 1\u884C\u306B\u7573\u307F\u307E\u3059\n\uFF08\u5143\u306E HTML\u30FB\u51FA\u5E2D\u8005\u306E\u5FDC\u7B54\u72B6\u6CC1\u306F --output json \u3067\u8AAD\u3081\u307E\u3059\uFF09\u3002",
93
99
  flags:[{name:"--event",summary:"\u4E88\u5B9AID\uFF08\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF09",takesValue:true,placeholder:"<ID>"}],forbidden:ms365Forbidden,async prepare(input){return withResolved(input,{eventId:oneId(input,"--event","\u4E88\u5B9AID","twp outlook event get help")})},plan(input){return{method:"GET",path:ms365Path(`/calendar/events/${ms365Segment(requireResolved(input,"eventId"),"\u4E88\u5B9AID")}`)}},summarize:body=>eventRow(graphData(body,"\u4E88\u5B9A\u8A73\u7D30")),
94
100
  raw:body=>graphData(body,"\u4E88\u5B9A\u8A73\u7D30")},...eventWriteOperations]};var outlookDomain={name:"outlook",summary:"Microsoft 365 \u306E Outlook\uFF08\u30E1\u30FC\u30EB\u30FB\u6DFB\u4ED8\u30FB\u4E88\u5B9A\u8868\uFF09",operations:[],subresources:[mailResource,attachmentResource,eventResource]};export{outlookDomain};
@@ -1,4 +1,4 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{NO_PLAN_SESSION,PLAN_DIR_ENV,PLAN_TOKEN_ENV,checkPlan,fileSkillNames,formatCheck,openPlanSession,runPlanSubmit}from"./chunk-VUXMQWXG.js";import"./chunk-2UTJI3BT.js";import"./chunk-VEEZJNOB.js";import"./chunk-FMB6FW6J.js";import"./chunk-S5MDCZEF.js";import"./chunk-VYDPW2YO.js";import"./chunk-TTST7UDR.js";import"./chunk-ZFSWQQH3.js";import"./chunk-6CS5L24D.js";import"./chunk-N2UVRM3Z.js";import"./chunk-UZUV5FYG.js";import"./chunk-RMFLTSOV.js";
3
+ import{NO_PLAN_SESSION,PLAN_DIR_ENV,PLAN_TOKEN_ENV,checkPlan,fileSkillNames,formatCheck,openPlanSession,runPlanSubmit}from"./chunk-SMOBUQPO.js";import"./chunk-2UTJI3BT.js";import"./chunk-VEEZJNOB.js";import"./chunk-LEZ576RA.js";import"./chunk-S5MDCZEF.js";import"./chunk-VYDPW2YO.js";import"./chunk-TTST7UDR.js";import"./chunk-ZFSWQQH3.js";import"./chunk-6CS5L24D.js";import"./chunk-N2UVRM3Z.js";import"./chunk-UZUV5FYG.js";import"./chunk-RMFLTSOV.js";
4
4
  import"./chunk-BD7O73GK.js";import"./chunk-SBRTBKEZ.js";import"./chunk-PMOUHEJQ.js";import"./chunk-J7QYPKVK.js";import"./chunk-5WGOHFAS.js";import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";export{NO_PLAN_SESSION,PLAN_DIR_ENV,PLAN_TOKEN_ENV,checkPlan,fileSkillNames,formatCheck,openPlanSession,runPlanSubmit};
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{evaluateQuery}from"./chunk-GFLGXGWE.js";import"./chunk-VFPY2A23.js";import"./chunk-VSJBJXZO.js";export{evaluateQuery};
3
+ import{evaluateQuery}from"./chunk-F5QDUPQO.js";import"./chunk-VFPY2A23.js";import"./chunk-VSJBJXZO.js";export{evaluateQuery};
@@ -0,0 +1,74 @@
1
+ import { createRequire as __twpCreateRequire } from 'node:module';
2
+ const require = __twpCreateRequire(import.meta.url);
3
+ import{readBody}from"./chunk-HEH3PUW2.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import{REDMINE_BASE_PATH,isExactNumericId,redmineServerPath}from"./chunk-A7MM5WSC.js";import"./chunk-HVZUXLQ4.js";import"./chunk-JA5A6UJ2.js";import"./chunk-MMVXE2CJ.js";import"./chunk-SBRTBKEZ.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-MI6HVYR2.js";import{requireResolved,singleRef,withResolved}from"./chunk-PS5QFKHB.js";
4
+ import{isRecord,pick}from"./chunk-3ZRMMBP5.js";import{ApiResponseError,UsageError}from"./chunk-VFPY2A23.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var MAX_ID_DIGITS=18;var PROJECT_REF=/^[A-Za-z0-9_-]+$/;var SERVER_COLUMNS=["id","name","base_url"];var PROJECT_COLUMNS=["id","identifier","name","parent","status"];var ISSUE_LIST_COLUMNS=["id","project","tracker","status","priority","subject","assigned_to","updated_on"];var ISSUE_GET_COLUMNS=["id","project","tracker","status","priority","author","assigned_to","subject","description","start_date","due_date","done_ratio","created_on","updated_on","watchers","allowed_statuses","journals","attachme\
5
+ nts"];var MEMBER_COLUMNS=["id","project","user","group","roles"];var USER_COLUMNS=["id","login","firstname","lastname","mail","created_on","last_login_on"];var JOURNAL_COLUMNS=["id","user","created_on","notes","details"];var ATTACHMENT_COLUMNS=["id","filename","filesize","content_type","author","created_on"];var SPACE_FLAG={name:"--space",summary:"Redmine \u63A5\u7D9A\u5148\uFF08ID\u30FB\u8868\u793A\u540D\u30FB\u63A5\u7D9A\u5148URL\u30FB\u30DB\u30B9\u30C8\u540D\u3002\u767B\u9332\u304C1\u4EF6\u306A\u3089\u7701\u7565\u53EF\uFF09",
6
+ takesValue:true,placeholder:"<ID|URL>"};var listPaging=envelopePaging({label:"Redmine \u4E00\u89A7"});function flattenRef(value){if(isRecord(value)&&"name"in value)return value["name"];return value}function summarizeRow(row,columns){const picked=pick(row,columns);for(const[key,value]of Object.entries(picked))picked[key]=flattenRef(value);return picked}function issueObject(body){const issue=isRecord(body)?body["data"]:void 0;if(!isRecord(issue)){throw new ApiResponseError("\u30C1\u30B1\u30C3\u30C8\u8A73\u7D30\u306E\u5FDC\u7B54\u306B data \u304C\u3042\u308A\u307E\u305B\u3093\u3002\
7
+ \u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return issue}function attachmentsOf(body){const attachments=issueObject(body)["attachments"];if(!Array.isArray(attachments)){throw new ApiResponseError("\u30C1\u30B1\u30C3\u30C8\u8A73\u7D30\u306E\u5FDC\u7B54\u306B attachments \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return attachments}function itemsOf(body,label){const value=isRecord(
8
+ body)?body["items"]:void 0;if(!Array.isArray(value)){throw new ApiResponseError(`${label}\u306E\u5FDC\u7B54\u306B items \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return value}function numericRef(value,label,usage){if(!isExactNumericId(value)||value.length>MAX_ID_DIGITS){throw new UsageError(`${label}\u306E\u5F62\u5F0F\u304C\u9055\u3044\u307E\u3059: ${value}`,usage)}return value}async function resolveServer(input,ctx){
9
+ const ref=input.flags.get("--space");if(ref===void 0){const server=await ctx.resolver.redmineDefaultServer();return{id:server.id,defaulted:server.name}}if(ref.trim()===""){throw new UsageError("--space \u306B\u7A7A\u306E\u5024\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093","--space <ID|\u63A5\u7D9A\u5148URL> \u3092\u6307\u5B9A\u3059\u308B\u304B\u3001--space \u3054\u3068\u5916\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return{id:(await ctx.resolver.redmineServer(ref)).id,defaulted:null}}function withServer(input,server){
10
+ return withResolved(input,{serverId:server.id,...server.defaulted!==null?{serverDefaulted:server.defaulted}:{}})}function requireServer(input){return requireResolved(input,"serverId")}function serverNotes(input){const defaulted=input.resolved?.["serverDefaulted"];return defaulted===void 0?[]:[`--space \u3092\u7701\u7565\u3057\u305F\u305F\u3081\u3001\u767B\u9332\u3055\u308C\u3066\u3044\u308B\u552F\u4E00\u306E Redmine \u63A5\u7D9A\u5148 ${defaulted} \u3092\u4F7F\u3044\u307E\u3057\u305F\u3002`]}function noArgs(input,usage){
11
+ if(input.args.length>0){throw new UsageError(`list \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,usage)}}function issueRef(input,usage){const ref=singleRef(input,{flag:"--issue",label:"\u30C1\u30B1\u30C3\u30C8\u756A\u53F7",usage});return numericRef(ref,"\u30C1\u30B1\u30C3\u30C8\u756A\u53F7","Redmine \u306E\u30C1\u30B1\u30C3\u30C8\u756A\u53F7\uFF08\u6570\u5024\u30FB\u4F8B: 97777\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}function statusFilter(raw){
12
+ if(raw===void 0)return void 0;const value=raw.trim();if(value==="open"||value==="closed"||value==="*"||isExactNumericId(value))return value;throw new UsageError(`--status \u306B\u6307\u5B9A\u3067\u304D\u308B\u306E\u306F open / closed / * \u304B\u6570\u5024\u306E\u30B9\u30C6\u30FC\u30BF\u30B9ID \u3067\u3059\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${raw}\uFF09`)}function assigneeFilter(raw){if(raw===void 0)return void 0;const value=raw.trim();if(value==="me"||isExactNumericId(value))return value;
13
+ throw new UsageError(`--assignee \u306B\u6307\u5B9A\u3067\u304D\u308B\u306E\u306F me \u304B\u6570\u5024\u306E\u30E6\u30FC\u30B6\u30FCID \u3067\u3059\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${raw}\uFF09`)}function projectFilter(raw){if(raw===void 0)return void 0;const value=raw.trim();if(!PROJECT_REF.test(value)){throw new UsageError(`--project \u306E\u5F62\u5F0F\u304C\u9055\u3044\u307E\u3059: ${raw}`,"Redmine \u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u8B58\u5225\u5B50\uFF08twp redmine project list \u306E identifier\uFF09\u304B\u6570\u5024 ID \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
14
+ return value}function refList(value){if(!Array.isArray(value))return value??null;return value.map(refLabel)}function refLabel(value){return isRecord(value)&&"name"in value?`${String(value["name"])}(#${String(value["id"])})`:value}function summarizeMember(row){const picked=summarizeRow(row,MEMBER_COLUMNS);if(isRecord(row)){for(const key of["user","group"]){if(key in picked)picked[key]=refLabel(row[key])}}return picked}function summarizeIssue(issue){const row=summarizeRow(issue,ISSUE_GET_COLUMNS);
15
+ row["journals"]=Array.isArray(issue["journals"])?issue["journals"].map(journal=>summarizeRow(journal,JOURNAL_COLUMNS)):issue["journals"]??null;row["attachments"]=Array.isArray(issue["attachments"])?issue["attachments"].map(attachment=>summarizeRow(attachment,ATTACHMENT_COLUMNS)):issue["attachments"]??null;row["watchers"]=refList(issue["watchers"]);row["allowed_statuses"]=refList(issue["allowed_statuses"]);return row}function updatedIssue(body){const issue=issueObject(body);const warning=isRecord(
16
+ body)?body["warning"]:void 0;return typeof warning==="string"?{...issue,warning}:issue}function dataObject(body,label){const data=isRecord(body)?body["data"]:void 0;if(!isRecord(data)){throw new ApiResponseError(`${label}\u306E\u5FDC\u7B54\u306B data \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return data}var CLEAR="none";var NOTES_MAX_CHARS=1e5;var DATE=/^\d{4}-\d{2}-\d{2}$/;function dateValue(raw,flag){const value=raw.
17
+ trim();if(value===CLEAR)return null;const date=new Date(`${value}T00:00:00Z`);if(!DATE.test(value)||Number.isNaN(date.getTime())||date.toISOString().slice(0,10)!==value){throw new UsageError(`${flag} \u306F YYYY-MM-DD \u306E\u65E5\u4ED8\u304B ${CLEAR}\uFF08\u89E3\u9664\uFF09\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${raw}\uFF09`)}return value}function idValue(raw,flag,hint){const value=raw.trim();if(!isExactNumericId(value)||value==="0"){throw new UsageError(
18
+ `${flag} \u306B\u306F\u6570\u5024\u306E ID \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${raw}\uFF09`,hint)}return Number(value)}var EXTERNAL_WRITE_HELP="\u26A0 \u3053\u308C\u306F Redmine\uFF08\u5916\u90E8\uFF09\u3078\u5B9F\u969B\u306B\u66F8\u304F\u64CD\u4F5C\u3067\u3059\u3002\u5909\u66F4\u306F\u53D6\u308A\u6D88\u305B\u305A\u3001\u30A6\u30A9\u30C3\u30C1\u30E3\u30FC\u30FB\u62C5\u5F53\u8005\u3078\u901A\u77E5\u304C\u98DB\u3073\u307E\u3059\u3002\n \uFF08\u4E0A\u306E --yes \u306F\u5BFE\u8A71\u3067\u3082\u8981\u308A\u307E\u3059\u3002\u624B\u5143\u3068\u30EB\u30FC\u30D7\u3067\u8981\u4EF6\u3092\u5909\u3048\u306A\u3044\u305F\u3081\u3067\u3059\u3002\uFF09\n \u9001\u308B\u5185\u5BB9\u306F --dry-run \u3067\u9001\u4FE1\u305B\u305A\u306B\u78BA\u8A8D\u3067\u304D\u307E\u3059\uFF08--dry-run \u306F --yes \u3092\u8981\u308A\u307E\u305B\u3093\uFF09\u3002\n \u5931\u6557\u3057\u3066\u3082\u6A5F\u68B0\u7684\u306B\u518D\u5B9F\u884C\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\u3002Redmine \u306B\u51AA\u7B49\u30AD\u30FC\u306F\u7121\u304F\u3001\u66F4\u65B0\u304C\u5C4A\u3044\u305F\u5F8C\u306B\n \u5FDC\u7B54\u306E\u8AAD\u307F\u53D6\u308A\u3060\u3051\u5931\u6557\u3057\u305F\u5834\u5408\u3001\u518D\u5B9F\u884C\u3059\u308B\u3068\u540C\u3058\u6CE8\u8A18\u304C\u4E8C\u91CD\u306B\u6B8B\u308A\u307E\u3059\n \uFF08twp redmine issue get <\u30C1\u30B1\u30C3\u30C8\u756A\u53F7> \u306E journals \u3067\u5B9F\u7269\u3092\
19
+ \u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\uFF09\u3002";var ISSUE_UPDATE_USAGE="twp redmine issue update help";var ISSUE_UPDATE={name:"update",summary:"Redmine \u30C1\u30B1\u30C3\u30C8\u306B\u6CE8\u8A18\u3092\u4ED8\u3051\u308B\u30FB\u72B6\u614B/\u62C5\u5F53/\u671F\u65E5/\u958B\u59CB\u65E5/\u9032\u6357\u7387\u3092\u5909\u3048\u308B\uFF08--yes \u304C\u5FC5\u8981\uFF09",usage:"twp redmine issue update <\u30C1\u30B1\u30C3\u30C8\u756A\u53F7> [--notes-file <\u30D1\u30B9>] [--status <ID>] [--assignee <ID|none>] [--due-date <YYYY-MM-DD|\
20
+ none>] [--start-date <YYYY-MM-DD|none>] [--done-ratio <0-100>] [--space <ID|URL>] --yes",description:`${EXTERNAL_WRITE_HELP}
21
+
22
+ --notes-file\uFF08--notes\uFF09/ --status / --assignee / --due-date / --start-date / --done-ratio \u306E\u3046\u3061\u3001
23
+ \u5C11\u306A\u304F\u3068\u30821\u3064\u304C\u5FC5\u8981\u3067\u3059\u3002\u6307\u5B9A\u3057\u305F\u9805\u76EE\u3060\u3051\u30921\u56DE\u306E\u30EA\u30AF\u30A8\u30B9\u30C8\u3067\u9001\u308A\u307E\u3059\uFF08\u6307\u5B9A\u3057\u306A\u304B\u3063\u305F\u9805\u76EE\u306F\u5909\u3048\u307E\u305B\u3093\uFF09\u3002
24
+ \u6CE8\u8A18\u3060\u3051\u3092\u9001\u308C\u3070\u300C\u8FD4\u4FE1\u300D\u306B\u306A\u308A\u307E\u3059\u3002
25
+
26
+ --status / --assignee \u306F\u6570\u5024 ID \u3060\u3051\u3092\u53D7\u3051\u307E\u3059\uFF08\u540D\u524D\u3067\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF09\u3002
27
+ \u72B6\u614B\u306E ID: twp redmine issue get <\u30C1\u30B1\u30C3\u30C8\u756A\u53F7> \u306E allowed_statuses\uFF08\u3044\u307E\u9078\u3079\u308B\u72B6\u614B\u3002Redmine 5.0 \u4EE5\u964D\uFF09
28
+ \u62C5\u5F53\u306E ID: twp redmine member list --project <\u8B58\u5225\u5B50> \u306E user.id\u3001\u81EA\u5206\u306F twp redmine user me \u306E id
29
+ --assignee / --due-date / --start-date \u306B none \u3092\u6E21\u3059\u3068\u672A\u8A2D\u5B9A\u306B\u623B\u3057\u307E\u3059\u3002
30
+
31
+ \u6210\u529F\u3059\u308B\u3068\u3001\u66F4\u65B0\u5F8C\u306E\u30C1\u30B1\u30C3\u30C8\uFF08twp redmine issue get \u3068\u540C\u3058\u5F62\uFF09\u3092\u8FD4\u3057\u307E\u3059\u3002
32
+ \u66F4\u65B0\u306F\u5C4A\u3044\u305F\u304C\u8AAD\u307F\u76F4\u305B\u306A\u304B\u3063\u305F\u3068\u304D\u306F\u3001id \u3068 warning \u3060\u3051\u3092\u8FD4\u3057\u307E\u3059\uFF08\u7D42\u4E86\u30B3\u30FC\u30C9 0\u3002\u518D\u5B9F\u884C\u3057\u306A\u3044\u3067\u304F\u3060\u3055\u3044\uFF09\u3002
33
+ \u26A0 Redmine \u306E\u300C\u9032\u6357\u7387\u306E\u7B97\u51FA\u65B9\u6CD5\u300D\u304C\u30B9\u30C6\u30FC\u30BF\u30B9\u9023\u52D5\u306E\u8A2D\u5B9A\u3060\u3068\u3001--done-ratio \u306F Redmine \u306B\u9ED9\u3063\u3066\u7121\u8996\u3055\u308C\u307E\u3059
34
+ \uFF08\u30A8\u30E9\u30FC\u306B\u306F\u306A\u308A\u307E\u305B\u3093\u3002\u8FD4\u3063\u3066\u304D\u305F done_ratio \u3067\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\uFF09\u3002
35
+ Redmine \u304C\u53D7\u3051\u4ED8\u3051\u306A\u304B\u3063\u305F\u5834\u5408\uFF08\u9078\u3079\u306A\u3044\u72B6\u614B\u30FB\u62C5\u5F53\u306B\u3067\u304D\u306A\u3044\u4EBA \u7B49\uFF09\u306F\u3001Redmine \u306E\u7406\u7531\u3092 stderr \u306B\u51FA\u3057\u307E\u3059\u3002
36
+
37
+ \u6CE8\u8A18\u306F --notes-file \u3092\u4E3B\u7D4C\u8DEF\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u30B7\u30A7\u30EB\u306E\u5F15\u6570\u306B\u8F09\u305B\u308B\u3068\u6539\u884C\u30FB\u5F15\u7528\u7B26\u3067\u58CA\u308C\u307E\u3059\u3002
38
+ --notes-file - \u3067\u6A19\u6E96\u5165\u529B\u304B\u3089\u8AAD\u3081\u307E\u3059\uFF08--notes \u306F\u4E00\u884C\u5411\u3051\u3067\u3001\u4F75\u7528\u306F\u30A8\u30E9\u30FC\u3067\u3059\uFF09\u3002
39
+ \u672C\u6587\u306F\u52A0\u5DE5\u3057\u307E\u305B\u3093\u3002\u7A7A\u30FB\u7A7A\u767D\u306E\u307F\u306E\u6CE8\u8A18\u306F\u9001\u308A\u307E\u305B\u3093\uFF08\u7D42\u4E86\u30B3\u30FC\u30C9 2\uFF09\u3002`,destructive:true,flags:[SPACE_FLAG,{name:"--issue",summary:"\u30C1\u30B1\u30C3\u30C8\u756A\u53F7\uFF08\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF09",takesValue:true,placeholder:"<\u756A\u53F7>"},{name:"--notes-file",summary:"\u6CE8\u8A18\uFF08\u30B3\u30E1\u30F3\u30C8\uFF09\u3092\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8AAD\u3080\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09\u3002\u6539\u884C\u30FBMarkdown \u3092\u58CA\u3055\u306A\u3044\u4E3B\u7D4C\u8DEF",
40
+ takesValue:true,placeholder:"<\u30D1\u30B9|->"},{name:"--notes",summary:"\u6CE8\u8A18\u3092\u76F4\u63A5\u6307\u5B9A\u3059\u308B\uFF08\u4E00\u884C\u5411\u3051\u3002--notes-file \u3068\u306E\u4F75\u7528\u306F\u30A8\u30E9\u30FC\uFF09",takesValue:true,placeholder:"<\u6587\u5B57\u5217>"},{name:"--status",summary:"\u72B6\u614B\u306E\u6570\u5024 ID\uFF08issue get \u306E allowed_statuses\uFF09",takesValue:true,placeholder:"<ID>"},{name:"--assignee",summary:"\u62C5\u5F53\u8005\u306E\u6570\u5024 ID\uFF08none \u3067\u89E3\u9664\uFF09",
41
+ takesValue:true,placeholder:"<ID|none>"},{name:"--due-date",summary:"\u671F\u65E5\uFF08YYYY-MM-DD\u3002none \u3067\u89E3\u9664\uFF09",takesValue:true,placeholder:"<\u65E5\u4ED8|none>"},{name:"--start-date",summary:"\u958B\u59CB\u65E5\uFF08YYYY-MM-DD\u3002none \u3067\u89E3\u9664\uFF09",takesValue:true,placeholder:"<\u65E5\u4ED8|none>"},{name:"--done-ratio",summary:"\u9032\u6357\u7387\uFF080\u301C100 \u306E\u6574\u6570\uFF09",takesValue:true,placeholder:"<0-100>"}],async prepare(input,ctx){const ref=issueRef(
42
+ input,ISSUE_UPDATE_USAGE);const body=updateFields(input);const notes=await readBody(input,{flag:"--notes",fileFlag:"--notes-file",label:"\u6CE8\u8A18",maxChars:NOTES_MAX_CHARS,usage:ISSUE_UPDATE_USAGE});if(notes!==void 0)body["notes"]=notes;if(Object.keys(body).length===0){throw new UsageError("\u5909\u66F4\u3059\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093","--notes-file / --status / --assignee / --due-date / --start-date / --done-ratio \u306E\u3046\u3061\u3001\u5C11\u306A\u304F\u3068\u30821\u3064\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
43
+ return withResolved(withServer(input,await resolveServer(input,ctx)),{issueId:ref,body:JSON.stringify(body)})},plan(input){return{method:"PATCH",path:redmineServerPath(requireServer(input),`/issues/${encodeURIComponent(requireResolved(input,"issueId"))}`),body:JSON.parse(requireResolved(input,"body"))}},plannedNotes:serverNotes,summarize:body=>{const issue=updatedIssue(body);const row=summarizeIssue(issue);if(issue["warning"]!==void 0)row["warning"]=issue["warning"];return row},raw:updatedIssue};
44
+ function updateFields(input){const body={};const status=input.flags.get("--status");if(status!==void 0){body["status_id"]=idValue(status,"--status","twp redmine issue get <\u30C1\u30B1\u30C3\u30C8\u756A\u53F7> \u306E allowed_statuses \u304B\u3089\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002")}const assignee=input.flags.get("--assignee");if(assignee!==void 0){body["assigned_to_id"]=assignee.trim()===CLEAR?null:idValue(assignee,"--assignee","twp redmine member list --project <\u8B58\u5225\u5B50> \u306E user.id \u3092\u6307\u5B9A\
45
+ \u3057\u3066\u304F\u3060\u3055\u3044\uFF08none \u3067\u89E3\u9664\uFF09\u3002")}const due=input.flags.get("--due-date");if(due!==void 0)body["due_date"]=dateValue(due,"--due-date");const start=input.flags.get("--start-date");if(start!==void 0)body["start_date"]=dateValue(start,"--start-date");const ratio=input.flags.get("--done-ratio");if(ratio!==void 0){const value=ratio.trim();if(!/^\d{1,3}$/.test(value)||Number(value)>100){throw new UsageError(`--done-ratio \u306F 0\u301C100 \u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${ratio}\
46
+ \uFF09`)}body["done_ratio"]=Number(value)}return body}var userResource={name:"user",summary:"Redmine \u306E\u30E6\u30FC\u30B6\u30FC\uFF08API \u30AD\u30FC\u306E\u6301\u3061\u4E3B\uFF09",operations:[{name:"me",summary:"\u3053\u306E\u63A5\u7D9A\u5148\u306E API \u30AD\u30FC\u306E\u6301\u3061\u4E3B\uFF08\u81EA\u5206\uFF09\u3092\u8FD4\u3059",usage:"twp redmine user me [--space <ID|URL>]",description:"Redmine \u306E /users/current.json \u3092\u8FD4\u3057\u307E\u3059\u3002id \u306F issue update --assignee \u3084 issue list --assignee \u306B\u6E21\u305B\u307E\u3059\u3002\nAPI \u30AD\u30FC\
47
+ \u306F\u8FD4\u308A\u307E\u305B\u3093\uFF08Redmine \u304C\u8FD4\u3057\u3066\u3082 TWP \u304C\u843D\u3068\u3057\u307E\u3059\uFF09\u3002",flags:[SPACE_FLAG],async prepare(input,ctx){if(input.args.length>0){throw new UsageError(`me \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,"twp redmine user me help")}return withServer(input,await resolveServer(input,ctx))},plan(input){return{method:"GET",path:redmineServerPath(requireServer(input),"/users/current")}},
48
+ plannedNotes:serverNotes,summarize:body=>pick(dataObject(body,"Redmine \u30E6\u30FC\u30B6\u30FC"),USER_COLUMNS),raw:body=>dataObject(body,"Redmine \u30E6\u30FC\u30B6\u30FC")}]};var memberResource={name:"member",summary:"Redmine \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30E1\u30F3\u30D0\u30FC",operations:[{name:"list",summary:"Redmine \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30E1\u30F3\u30D0\u30FC\uFF08\u30E6\u30FC\u30B6\u30FC\u30FB\u30B0\u30EB\u30FC\u30D7\u3068\u30ED\u30FC\u30EB\uFF09\u3092\u4E00\u89A7\u3059\u308B",
49
+ usage:"twp redmine member list --project <\u8B58\u5225\u5B50|ID> [--space <ID|URL>] [--all]",description:`user.id \u306F issue update --assignee \u306B\u6E21\u305B\u307E\u3059\u3002\u30B0\u30EB\u30FC\u30D7\u306E\u30E1\u30F3\u30D0\u30FC\u306F group \u306B\u5165\u308A\u307E\u3059\uFF08user \u306F\u7A7A\uFF09\u3002
50
+
51
+ ${LIST_PAGING_HELP}`,flags:[...LIST_FLAGS,SPACE_FLAG,{name:"--project",summary:"\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u8B58\u5225\u5B50\u304B\u6570\u5024 ID\uFF08\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<\u8B58\u5225\u5B50|ID>"}],paging:listPaging,async prepare(input,ctx){noArgs(input,"twp redmine member list help");if(projectFilter(input.flags.get("--project"))===void 0){throw new UsageError("--project \u304C\u5FC5\u8981\u3067\u3059","twp redmine project list \u306E identifier\uFF08\u307E\u305F\u306F id\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\
52
+ \u3044\u3002")}return withServer(input,await resolveServer(input,ctx))},plan(input){const project=projectFilter(input.flags.get("--project"));return{method:"GET",path:redmineServerPath(requireServer(input),`/projects/${encodeURIComponent(project)}/memberships`),query:{limit:positiveInteger(input.flags,"--limit"),cursor:nonEmpty(input.flags,"--cursor")}}},plannedNotes:serverNotes,summarize:body=>listPaging.items(body).map(summarizeMember),raw:body=>listPaging.items(body)}]};var spaceResource={name:"\
53
+ space",summary:"\u767B\u9332\u6E08\u307F\u306E Redmine \u63A5\u7D9A\u5148",operations:[{name:"list",summary:"\u767B\u9332\u6E08\u307F\u306E Redmine \u63A5\u7D9A\u5148\u3092\u4E00\u89A7\u3059\u308B",usage:"twp redmine space list",description:"TWP \u306E\u500B\u4EBA\u8A2D\u5B9A\uFF08\u5916\u90E8\u30B7\u30B9\u30C6\u30E0\u9023\u643A\uFF09\u306B\u767B\u9332\u3055\u308C\u3066\u3044\u308B Redmine \u63A5\u7D9A\u5148\u3092\u4E00\u89A7\u3057\u307E\u3059\u3002\n\u63A5\u7D9A\u5148\u306F**\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u308B\u30E6\u30FC\u30B6\u30FC\u3054\u3068**\u306E\u8A2D\u5B9A\u3067\u3059\uFF08\u30C6\u30CA\u30F3\u30C8\u5171\u901A\u3067\u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002\n\u3053\u3053\u306B\u51FA\u308B id / name / base_url \u306F\u3001\u4ED6\u306E redmine \u30B3\u30DE\u30F3\u30C9\u306E --space \u306B\u305D\u306E\u307E\u307E\u6E21\u305B\u307E\u3059\u3002\nAPI \u30AD\u30FC\u306F\u8FD4\u308A\u307E\u305B\u3093\uFF08api_key_hint \u3082\u51FA\u529B\u6642\u306B\u4F0F\u5B57\u306B\u306A\u308A\u307E\u3059\uFF09\u3002",
54
+ flags:[],plan(input){if(input.args.length>0){throw new UsageError(`list \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,"twp redmine space list help")}return{method:"GET",path:`${REDMINE_BASE_PATH}/servers`}},summarize:body=>itemsOf(body,"Redmine \u63A5\u7D9A\u5148\u4E00\u89A7").map(row=>pick(row,SERVER_COLUMNS)),raw:body=>itemsOf(body,"Redmine \u63A5\u7D9A\u5148\u4E00\u89A7")}]};var projectResource={name:"project",summary:"Redmine \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8",
55
+ operations:[{name:"list",summary:"Redmine \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u4E00\u89A7\u3059\u308B",usage:"twp redmine project list [--space <ID|URL>] [--all]",description:`\u3053\u3053\u306B\u51FA\u308B identifier\uFF08\u307E\u305F\u306F id\uFF09\u306F redmine issue list --project \u306B\u6E21\u305B\u307E\u3059\u3002
56
+
57
+ ${LIST_PAGING_HELP}`,flags:[...LIST_FLAGS,SPACE_FLAG],paging:listPaging,async prepare(input,ctx){noArgs(input,"twp redmine project list help");return withServer(input,await resolveServer(input,ctx))},plan(input){return{method:"GET",path:redmineServerPath(requireServer(input),"/projects"),query:{limit:positiveInteger(input.flags,"--limit"),cursor:nonEmpty(input.flags,"--cursor")}}},plannedNotes:serverNotes,summarize:body=>listPaging.items(body).map(row=>summarizeRow(row,PROJECT_COLUMNS)),raw:body=>listPaging.
58
+ items(body)}]};var issueResource={name:"issue",summary:"Redmine \u30C1\u30B1\u30C3\u30C8\uFF08\u672C\u6587\u30FB\u30B3\u30E1\u30F3\u30C8\u30FB\u6DFB\u4ED8\u4E00\u89A7\uFF09",operations:[{name:"list",summary:"Redmine \u30C1\u30B1\u30C3\u30C8\u3092\u4E00\u89A7\u3059\u308B",usage:"twp redmine issue list [--project <\u8B58\u5225\u5B50|ID>] [--status open|closed|*|<ID>] [--assignee me|<ID>] [--space <ID|URL>] [--all]",description:`\u65E2\u5B9A\u306F Redmine \u3068\u540C\u3058\u304F\u300C\u672A\u5B8C\u4E86\uFF08open\uFF09\u300D\u306E\u30C1\u30B1\u30C3\u30C8\u3060\u3051\u3067\u3001\u66F4\u65B0\u65E5\u6642\u306E\u65B0\u3057\u3044\u9806\u306B\u4E26\u3073\u307E\u3059\u3002
59
+ \u5B8C\u4E86\u6E08\u307F\u3082\u542B\u3081\u308B\u3068\u304D\u306F --status * \u3092\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u3002
60
+ \u672C\u6587\u30FB\u30B3\u30E1\u30F3\u30C8\u306F\u4E00\u89A7\u306B\u542B\u307E\u308C\u307E\u305B\u3093\uFF08twp redmine issue get \u3067\u8AAD\u307F\u307E\u3059\uFF09\u3002
61
+
62
+ ${LIST_PAGING_HELP}`,flags:[...LIST_FLAGS,SPACE_FLAG,{name:"--project",summary:"\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u8B58\u5225\u5B50\u304B\u6570\u5024 ID\uFF08\u5B50\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3082\u542B\u3080\uFF09",takesValue:true,placeholder:"<\u8B58\u5225\u5B50|ID>"},{name:"--status",summary:"open\uFF08\u65E2\u5B9A\uFF09/ closed / * / \u6570\u5024\u306E\u30B9\u30C6\u30FC\u30BF\u30B9ID",takesValue:true,placeholder:"<\u72B6\u614B>"},{name:"--assignee",summary:"\u62C5\u5F53\u8005\uFF08me \u304B\u6570\u5024\u306E\u30E6\u30FC\u30B6\u30FCID\uFF09",
63
+ takesValue:true,placeholder:"<me|ID>"}],paging:listPaging,async prepare(input,ctx){noArgs(input,"twp redmine issue list help");projectFilter(input.flags.get("--project"));statusFilter(input.flags.get("--status"));assigneeFilter(input.flags.get("--assignee"));return withServer(input,await resolveServer(input,ctx))},plan(input){return{method:"GET",path:redmineServerPath(requireServer(input),"/issues"),query:{limit:positiveInteger(input.flags,"--limit"),cursor:nonEmpty(input.flags,"--cursor"),project_id:projectFilter(
64
+ input.flags.get("--project")),status_id:statusFilter(input.flags.get("--status")),assigned_to_id:assigneeFilter(input.flags.get("--assignee"))}}},plannedNotes:serverNotes,summarize:body=>listPaging.items(body).map(row=>summarizeRow(row,ISSUE_LIST_COLUMNS)),raw:body=>listPaging.items(body)},{name:"get",summary:"Redmine \u30C1\u30B1\u30C3\u30C8\u30921\u4EF6\u53D6\u5F97\u3059\u308B\uFF08\u672C\u6587\u30FB\u30B3\u30E1\u30F3\u30C8\u30FB\u6DFB\u4ED8\u4E00\u89A7\u3092\u542B\u3080\uFF09",usage:"twp redm\
65
+ ine issue get <\u30C1\u30B1\u30C3\u30C8\u756A\u53F7> [--space <ID|URL>]",description:"\u672C\u6587\uFF08description\uFF09\u30FB\u30B3\u30E1\u30F3\u30C8\uFF08journals\uFF09\u30FB\u6DFB\u4ED8\u4E00\u89A7\uFF08attachments\uFF09\u30921\u56DE\u3067\u8FD4\u3057\u307E\u3059\u3002\njournals \u306B\u306F\u672C\u6587\u306E\u4ED8\u3044\u305F\u30B3\u30E1\u30F3\u30C8\u3068\u3001\u30B9\u30C6\u30FC\u30BF\u30B9\u30FB\u62C5\u5F53\u306A\u3069\u306E\u5909\u66F4\u5C65\u6B74\uFF08details\uFF09\u306E\u4E21\u65B9\u304C\u5165\u308A\u307E\u3059\u3002\n--output json \u306F Redmine \u306E\u5FDC\u7B54\u3092\u305D\u306E\u307E\u307E\u8FD4\u3057\u307E\u3059\uFF08\u9805\u76EE\u306F Redmine \u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u30FB\u30D7\u30E9\u30B0\u30A4\u30F3\u3067\u5909\u308F\u308A\u307E\u3059\uFF09\u3002",
66
+ flags:[SPACE_FLAG,{name:"--issue",summary:"\u30C1\u30B1\u30C3\u30C8\u756A\u53F7\uFF08\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF09",takesValue:true,placeholder:"<\u756A\u53F7>"}],async prepare(input,ctx){const ref=issueRef(input,"twp redmine issue get help");return withResolved(withServer(input,await resolveServer(input,ctx)),{issueId:ref})},plan(input){return{method:"GET",path:redmineServerPath(requireServer(input),`/issues/${encodeURIComponent(requireResolved(input,"issueId"))}`)}},
67
+ plannedNotes:serverNotes,summarize:body=>summarizeIssue(issueObject(body)),raw:body=>issueObject(body)},ISSUE_UPDATE]};var attachmentResource={name:"attachment",summary:"Redmine \u30C1\u30B1\u30C3\u30C8\u306E\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\uFF08\u4E00\u89A7\u30FB\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\uFF09",operations:[{name:"list",summary:"Redmine \u30C1\u30B1\u30C3\u30C8\u306E\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u3092\u4E00\u89A7\u3059\u308B",usage:"twp redmine attachment list <\u30C1\u30B1\u30C3\u30C8\u756A\u53F7> [--s\
68
+ pace <ID|URL>]",description:"download \u306B\u6E21\u3059 id \u3068\u3001\u843D\u3068\u3059\u524D\u306B\u5927\u304D\u3055\u3092\u5224\u65AD\u3059\u308B\u305F\u3081\u306E filesize \u3092\u8FD4\u3057\u307E\u3059\u3002\n\u4E2D\u8EAB\u306F\u30C1\u30B1\u30C3\u30C8\u8A73\u7D30\uFF08twp redmine issue get\uFF09\u306E attachments \u3068\u540C\u3058\u3067\u3059\uFF08\u5C02\u7528\u306E\u4E00\u89A7 API \u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002",flags:[SPACE_FLAG,{name:"--issue",summary:"\u30C1\u30B1\u30C3\u30C8\u756A\u53F7\uFF08\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\
69
+ \u610F\u5473\uFF09",takesValue:true,placeholder:"<\u756A\u53F7>"}],async prepare(input,ctx){const ref=issueRef(input,"twp redmine attachment list help");return withResolved(withServer(input,await resolveServer(input,ctx)),{issueId:ref})},plan(input){return{method:"GET",path:redmineServerPath(requireServer(input),`/issues/${encodeURIComponent(requireResolved(input,"issueId"))}`)}},plannedNotes:serverNotes,summarize:body=>attachmentsOf(body).map(row=>summarizeRow(row,ATTACHMENT_COLUMNS)),raw:body=>attachmentsOf(
70
+ body)},{name:"download",summary:"Redmine \u306E\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u3092 --out \u3078\u66F8\u304D\u51FA\u3059",usage:"twp redmine attachment download <\u6DFB\u4ED8ID> --out <\u30D1\u30B9> [--force] [--space <ID|URL>]",description:"\u6DFB\u4ED8\u306E\u5B9F\u4F53\u3092 --out \u306E\u30D1\u30B9\u3078\u305D\u306E\u307E\u307E\u66F8\u304D\u307E\u3059\uFF08\u6A19\u6E96\u51FA\u529B\u3078\u306F\u51FA\u3057\u307E\u305B\u3093\uFF09\u3002\n\u6A19\u6E96\u51FA\u529B\u306B\u51FA\u308B\u306E\u306F\u66F8\u3044\u305F\u5834\u6240\u30FB\u30D0\u30A4\u30C8\u6570\u30FBContent-Type \u3060\u3051\u3067\u3001--output json \u3067\u305D\u306E\u307E\u307E\u8AAD\u3081\u307E\u3059\u3002\n\n\u6DFB\u4ED8ID \u306F twp redmine attachment list \u306E id \u3067\u3059\uFF08\u30D5\u30A1\u30A4\u30EB\u540D\u3067\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF09\u3002\n\u65E2\u5B58\u30D5\u30A1\u30A4\u30EB\u306F\u4E0A\u66F8\u304D\u3057\u307E\u305B\u3093\uFF08--force \u3092\u4ED8\u3051\u305F\u3068\u304D\u3060\u3051\u4E0A\u66F8\u304D\u3057\u307E\u3059\uFF09\u3002\n\u66F8\u304D\u51FA\u3057\u5148\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u81EA\u52D5\u3067\u4F5C\u308A\u307E\u305B\u3093\u3002",
71
+ flags:[SPACE_FLAG,{name:"--attachment",summary:"\u6DFB\u4ED8ID\uFF08\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF09",takesValue:true,placeholder:"<ID>"},{name:"--out",summary:"\u66F8\u304D\u51FA\u3057\u5148\u306E\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9\uFF08\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>"},{name:"--force",summary:"\u65E2\u5B58\u30D5\u30A1\u30A4\u30EB\u3092\u4E0A\u66F8\u304D\u3059\u308B",takesValue:false}],download:{outFlag:"--out",forceFlag:"--force"},async prepare(input,ctx){
72
+ const usage="twp redmine attachment download help";const ref=singleRef(input,{flag:"--attachment",label:"\u6DFB\u4ED8ID",usage});const attachmentId=numericRef(ref,"\u6DFB\u4ED8ID","twp redmine attachment list \u306E id\uFF08\u6570\u5024\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u30D5\u30A1\u30A4\u30EB\u540D\u3067\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF09\u3002");return withResolved(withServer(input,await resolveServer(input,ctx)),{attachmentId})},plan(input){return{
73
+ method:"GET",path:redmineServerPath(requireServer(input),`/attachments/${encodeURIComponent(requireResolved(input,"attachmentId"))}`)}},plannedNotes:serverNotes,summarize:body=>body,raw:body=>body}]};var redmineDomain={name:"redmine",summary:"Redmine \u9023\u643A\uFF08\u30C1\u30B1\u30C3\u30C8\u30FB\u30B3\u30E1\u30F3\u30C8\u30FB\u6DFB\u4ED8\u306E\u8AAD\u307F\u53D6\u308A\u3068\u3001\u30C1\u30B1\u30C3\u30C8\u306E\u66F4\u65B0\uFF09",operations:[],subresources:[spaceResource,projectResource,issueResource,
74
+ attachmentResource,userResource,memberResource]};export{redmineDomain};
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{loadDomain}from"./chunk-X7IBNJCH.js";import"./chunk-VSJBJXZO.js";export{loadDomain};
3
+ import{loadDomain}from"./chunk-46OWZRTJ.js";import"./chunk-VSJBJXZO.js";export{loadDomain};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{CURATED_PAGING_VOCABULARY,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain}from"./chunk-VNQHZHV7.js";import"./chunk-X7IBNJCH.js";import"./chunk-GFLGXGWE.js";import"./chunk-P4QSPSOQ.js";import"./chunk-Q3B65OFC.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-VGT2EGH6.js";import"./chunk-A7MM5WSC.js";import"./chunk-HVZUXLQ4.js";import"./chunk-JA5A6UJ2.js";
3
+ import{CURATED_PAGING_VOCABULARY,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain}from"./chunk-F7LPERJA.js";import"./chunk-46OWZRTJ.js";import"./chunk-F5QDUPQO.js";import"./chunk-P4QSPSOQ.js";import"./chunk-Q3B65OFC.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-VGT2EGH6.js";import"./chunk-A7MM5WSC.js";import"./chunk-HVZUXLQ4.js";import"./chunk-JA5A6UJ2.js";
4
4
  import"./chunk-MMVXE2CJ.js";import"./chunk-SBRTBKEZ.js";import"./chunk-MI6HVYR2.js";import"./chunk-3ZRMMBP5.js";import"./chunk-VFPY2A23.js";import"./chunk-KIZIRVW6.js";import"./chunk-XNLIEUAW.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-AAABT3AX.js";import"./chunk-OKATZ4SN.js";import"./chunk-RKBUJKI5.js";import"./chunk-UREA4ZIG.js";import"./chunk-NHYMHCAT.js";
5
5
  import"./chunk-VSJBJXZO.js";export{CURATED_PAGING_VOCABULARY,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain};
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{hasRemovableRunner,parseRunners,removeHint,runRunnerCommand}from"./chunk-THB6NEWD.js";import"./chunk-MYBIPHZ7.js";import"./chunk-A4LFG7MW.js";import"./chunk-VRBI2NPI.js";import"./chunk-VFPY2A23.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";export{hasRemovableRunner,parseRunners,removeHint,runRunnerCommand};
3
+ import{hasRemovableRunner,parseRunners,removeHint,runRunnerCommand}from"./chunk-FFRQGBMA.js";import"./chunk-MYBIPHZ7.js";import"./chunk-A4LFG7MW.js";import"./chunk-VRBI2NPI.js";import"./chunk-VFPY2A23.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";export{hasRemovableRunner,parseRunners,removeHint,runRunnerCommand};