@tocca-systems/twp-cli 0.50.0 → 0.51.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.
- package/CHANGELOG.public.md +18 -0
- package/README.md +155 -5
- package/dist/agent-LHNDQMT5.js +100 -0
- package/dist/{agent-loop-EBIXJ4EH.js → agent-loop-QP6UHX4R.js} +1 -1
- package/dist/{ai-dispatch-2FL2AFL7.js → ai-dispatch-VDNMECKK.js} +1 -1
- package/dist/analysis-RFO4E4ZS.js +4 -0
- package/dist/{announcement-R76XDLW7.js → announcement-HQ7CQYFI.js} +2 -2
- package/dist/{api-command-VFFV7BD4.js → api-command-ZZFN3T2G.js} +4 -4
- package/dist/{app-PNDIA4NV.js → app-WX4B5MQ3.js} +5 -5
- package/dist/{attendance-correct-SN2KYGOE.js → attendance-correct-CRRR4EKL.js} +3 -3
- package/dist/{attendance-lists-6S62D2UV.js → attendance-lists-XPCU25OJ.js} +2 -1
- package/dist/{auto-update-PS5HUWVH.js → auto-update-YMI3F44R.js} +1 -1
- package/dist/{auto-update-worker-ZKODJ45K.js → auto-update-worker-VG77U4UA.js} +2 -2
- package/dist/{backlog-5XSCJGPJ.js → backlog-NU5HHXN2.js} +2 -2
- package/dist/{budget-PIGBJ5N7.js → budget-AM7JJ5YP.js} +2 -2
- package/dist/{chunk-FANDYQCM.js → chunk-22OIKHMN.js} +1 -1
- package/dist/{chunk-IRHKFHJZ.js → chunk-2NP3BLPI.js} +2 -2
- package/dist/chunk-3744RCNM.js +58 -0
- package/dist/{chunk-6QOT7CHX.js → chunk-5WTFZJT7.js} +1 -1
- package/dist/chunk-6A2JSS76.js +4 -0
- package/dist/{chunk-V2BB5EWS.js → chunk-6JB4MSDX.js} +1 -1
- package/dist/{chunk-DQCHLRSB.js → chunk-74WGU5BM.js} +2 -2
- package/dist/{chunk-LKS7GANP.js → chunk-7GJFKKOJ.js} +3 -2
- package/dist/{chunk-342WUEV4.js → chunk-AKLQMTMW.js} +61 -27
- package/dist/{chunk-CF3ZZKCZ.js → chunk-B6WIFZF2.js} +1 -1
- package/dist/chunk-DBCF4H3V.js +141 -0
- package/dist/{chunk-CUPPIHSJ.js → chunk-F53TSCRD.js} +1 -1
- package/dist/{chunk-ELEOYXLD.js → chunk-FACNRXN7.js} +2 -2
- package/dist/chunk-FEJDU42E.js +138 -0
- package/dist/{chunk-IF2K4PM5.js → chunk-JA5A6UJ2.js} +6 -4
- package/dist/{chunk-ZY6LEKWR.js → chunk-LXGYOKDY.js} +3 -3
- package/dist/{chunk-NK53AFVE.js → chunk-MKQDUQQ2.js} +1 -1
- package/dist/{chunk-BVXUORXE.js → chunk-NGY4K5VW.js} +1 -1
- package/dist/{chunk-YM7TKMNO.js → chunk-NWI2TBO6.js} +1 -1
- package/dist/chunk-PFY5QJKO.js +10 -0
- package/dist/{chunk-LNZTJI64.js → chunk-RQEX2WC5.js} +1 -1
- package/dist/{chunk-7UB4I3JF.js → chunk-RX5HWI4L.js} +1 -1
- package/dist/{chunk-NN6LAZRA.js → chunk-S36LGDG2.js} +2 -2
- package/dist/{chunk-ONAMXPTE.js → chunk-SDNASQZL.js} +1 -1
- package/dist/{chunk-4S7SNE2M.js → chunk-VOMCTG6N.js} +1 -1
- package/dist/{chunk-5JL26BPU.js → chunk-XWJVDNYE.js} +1 -1
- package/dist/{chunk-SECVO7RQ.js → chunk-XZU53BUV.js} +2 -2
- package/dist/{chunk-S3A24B2C.js → chunk-Z4UT367H.js} +16 -15
- package/dist/{chunk-FMJUPLDG.js → chunk-ZVEMJWRR.js} +1 -1
- package/dist/cli.js +123 -10
- package/dist/{commands-CA22R7VD.js → commands-BXU44JWS.js} +5 -5
- package/dist/{commands-ZZGY6P3B.js → commands-TYUK7MV4.js} +2 -2
- package/dist/{company-CQYSBKTQ.js → company-BKULUHIU.js} +3 -4
- package/dist/{completion-3F2GJNGC.js → completion-RWWCIR6G.js} +1 -1
- package/dist/{configure-XH33RB27.js → configure-QU6JK65I.js} +1 -1
- package/dist/{contract-A2FGGVOR.js → contract-376FE7VC.js} +3 -3
- package/dist/{department-6BILJZG7.js → department-YKBPBPU6.js} +2 -2
- package/dist/deposit-CY5K3ZTM.js +4 -0
- package/dist/{estimate-5PSXHHNT.js → estimate-GPNG6YOJ.js} +4 -4
- package/dist/evaluation-VRLMQV32.js +61 -0
- package/dist/expense-3MT6WHTG.js +75 -0
- package/dist/{inquiry-NMOT4JSX.js → inquiry-YV433Q7V.js} +2 -2
- package/dist/{invoice-TXEJT6I6.js → invoice-OSAO4PIO.js} +3 -3
- package/dist/{job-title-NSYPQMEX.js → job-title-FITZHBR4.js} +1 -1
- package/dist/{knowledge-5DX6EMHZ.js → knowledge-YEEAKLQJ.js} +2 -2
- package/dist/{leave-DEGAZKVH.js → leave-MWYAL66X.js} +3 -2
- package/dist/{media-RJCTHFK6.js → media-VQ74YPWV.js} +110 -30
- package/dist/{notification-NG4J6N2D.js → notification-EAEKDN54.js} +2 -2
- package/dist/{onedrive-YPJCILR2.js → onedrive-UBSHXVYS.js} +1 -1
- package/dist/{oneshot-RA65DTXP.js → oneshot-62DOJWOH.js} +2 -2
- package/dist/{outlook-MNOVX6QS.js → outlook-ODZD27J5.js} +2 -2
- package/dist/{position-OZBQYKZS.js → position-ZKYGVAAK.js} +1 -1
- package/dist/project-5MHCPDVC.js +4 -0
- package/dist/{prospect-TQ2FFWEZ.js → prospect-ASQA5QVD.js} +3 -3
- package/dist/{purchase-WOUWIZHO.js → purchase-WLJJSMM6.js} +4 -4
- package/dist/receivable-FBPROHOV.js +4 -0
- package/dist/{registry-H4NP4HUQ.js → registry-HEGYZVX6.js} +1 -1
- package/dist/{report-EFE43ZVI.js → report-HK2NZXHC.js} +2 -2
- package/dist/run-HYQQIOVW.js +4 -0
- package/dist/sales-ai-review-IEISLBIH.js +4 -0
- package/dist/{sales-master-Q5BJ7RNG.js → sales-master-S3YTUE7J.js} +3 -3
- package/dist/sales-numbering-M4KUZAM7.js +4 -0
- package/dist/skill-45FBIGC5.js +4 -0
- package/dist/{supplier-payment-FWGQR3Z3.js → supplier-payment-MS6YMIT4.js} +3 -3
- package/dist/{support-TVTQJFRE.js → support-VSDMFUTY.js} +2 -2
- package/dist/{task-IDQKPRYS.js → task-BTYFJRSC.js} +4 -4
- package/dist/{teams-IO6UQNYP.js → teams-GPXJPXNC.js} +2 -2
- package/dist/update-NCAVUXSX.js +3 -0
- package/dist/{user-B6KW6HA2.js → user-VFJGLZDR.js} +23 -6
- package/dist/{worker-agent-PEFBLL56.js → worker-agent-YX2KPVQG.js} +2 -2
- package/dist/workflow-OPZYCSDL.js +4 -0
- package/package.json +1 -1
- package/dist/analysis-2SWIQ4AI.js +0 -4
- package/dist/chunk-3YCVR7X4.js +0 -5
- package/dist/chunk-GXZOFRZH.js +0 -9
- package/dist/chunk-IU5P6MY5.js +0 -47
- package/dist/chunk-Q2KIETMB.js +0 -132
- package/dist/chunk-ZGHEF45T.js +0 -4
- package/dist/deposit-OAGRJMZ4.js +0 -4
- package/dist/project-5YFBRM32.js +0 -4
- package/dist/receivable-RFZT6PY3.js +0 -4
- package/dist/run-TNFPATQF.js +0 -4
- package/dist/sales-ai-review-FSA4J2J2.js +0 -4
- package/dist/sales-numbering-ITDBMODV.js +0 -4
- package/dist/update-EYFT7STE.js +0 -3
- package/dist/workflow-SYWZKWWB.js +0 -4
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import"./chunk-
|
|
3
|
+
import{RESIDENT_TOKEN_CAP,activateModeFiles,activatePermissionSettings,buildResidentSet,buildSystemPrompt,createAuditLogger,createTwpToolkit,currentBranch,describeAuditLog,describeToolCatalog,displayCwd,executeTool,findProjectTwpSubdir,localTools,lstatOrNull,parseFrontMatter,parseRule,persistProjectAllow,projectPermissionsPath,projectRootFor,readFileTool,residentInputs,resolveGitExecutable,runTurn,secretReason}from"./chunk-7GJFKKOJ.js";import"./chunk-NZ7WI4RZ.js";import{buildDiffLines,
|
|
4
|
+
diffStat}from"./chunk-VRBI2NPI.js";import"./chunk-AUAZP2G7.js";import"./chunk-N2UVRM3Z.js";import"./chunk-FEJDU42E.js";import"./chunk-GMBJTG6A.js";import"./chunk-JA5A6UJ2.js";import"./chunk-QBGEYQ2I.js";import"./chunk-II5RVJQN.js";import"./chunk-VFPY2A23.js";import{RelayError,builtinCatalog,createRuntime,loadCachedCatalog,modelLabel,pickModel,toModelInfos}from"./chunk-5WTFZJT7.js";import"./chunk-D233KKXW.js";import"./chunk-PMOUHEJQ.js";
|
|
5
|
+
import"./chunk-XNLIEUAW.js";import{proxyDiagnostics}from"./chunk-J7QYPKVK.js";import{checkMinSupportedVersion,isBelowMinSupported,minSupportedBlockMessage}from"./chunk-DXXFUNYN.js";import"./chunk-4VZKNEVN.js";import{configReadDirs,twpHomeDir}from"./chunk-RZVI6PMW.js";import{parseArgv}from"./chunk-ZVEMJWRR.js";import{applyPermissionMode,checkPermission,describePermissionMode,getMode,isModeId,modeSource,nextMode}from"./chunk-NAUH75MM.js";import"./chunk-6A2JSS76.js";
|
|
6
|
+
import"./chunk-QQRJLH6B.js";import{isFullWidth,isWide,stringWidth,stripAnsi}from"./chunk-WVS4W5FY.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import{require_fuzzysort}from"./chunk-DIMZRTLE.js";import{__commonJS,__export,__require,__toESM}from"./chunk-VSJBJXZO.js";var require_react_production=__commonJS({"node_modules/react/cjs/react.production.js"(exports){"use strict";var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element");var REACT_PORTAL_TYPE=Symbol.for("react.portal");var REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");var REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode");var REACT_PROFILER_TYPE=Symbol.for("react.profiler");var REACT_CONSUMER_TYPE=Symbol.for("react.consumer");var REACT_CONTEXT_TYPE=Symbol.for("react.context");var REACT_FORWARD_REF_TYPE=Symbol.
|
|
7
7
|
for("react.forward_ref");var REACT_SUSPENSE_TYPE=Symbol.for("react.suspense");var REACT_MEMO_TYPE=Symbol.for("react.memo");var REACT_LAZY_TYPE=Symbol.for("react.lazy");var REACT_ACTIVITY_TYPE=Symbol.for("react.activity");var REACT_VIEW_TRANSITION_TYPE=Symbol.for("react.view_transition");var MAYBE_ITERATOR_SYMBOL=Symbol.iterator;function getIteratorFn(maybeIterable){if(null===maybeIterable||"object"!==typeof maybeIterable)return null;maybeIterable=MAYBE_ITERATOR_SYMBOL&&maybeIterable[MAYBE_ITERATOR_SYMBOL]||
|
|
8
8
|
maybeIterable["@@iterator"];return"function"===typeof maybeIterable?maybeIterable:null}var ReactNoopUpdateQueue={isMounted:function(){return false},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};var assign=Object.assign;var emptyObject={};function Component(props,context,updater){this.props=props;this.context=context;this.refs=emptyObject;this.updater=updater||ReactNoopUpdateQueue}Component.prototype.isReactComponent={};Component.prototype.setState=
|
|
9
9
|
function(partialState,callback){if("object"!==typeof partialState&&"function"!==typeof partialState&&null!=partialState)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,partialState,callback,"setState")};Component.prototype.forceUpdate=function(callback){this.updater.enqueueForceUpdate(this,callback,"forceUpdate")};function ComponentDummy(){}ComponentDummy.prototype=Component.prototype;function PureComponent2(props,context,updater){
|
|
@@ -1212,7 +1212,7 @@ cwd()){const listed=await gitListFiles(cwd2);const raw=listed??await walkFiles(c
|
|
|
1212
1212
|
1;const after=/^[^\s]*/.exec(text.slice(cursor))?.[0]??"";return{query,start,end:cursor+after.length}}var TWP_SLASH_ROUTES={"/tasks":{domain:"task",operation:"list"},"/task":{domain:"task",operation:"get"},"/projects":{domain:"project",operation:"list"}};function isTwpSlashCommand(name){return Object.hasOwn(TWP_SLASH_ROUTES,name)}async function runTwpSlashCommand(name,args,deps){const route=TWP_SLASH_ROUTES[name];if(!Object.hasOwn(TWP_SLASH_ROUTES,name)||route===void 0){return{code:2,out:"",err:`\u4E0D\u660E\u306A\u30B3\u30DE\u30F3\u30C9: ${name}
|
|
1213
1213
|
`}}const parsed=parseArgv([route.domain,route.operation,...args]);if(parsed.command!=="domain"||parsed.domain!==route.domain){return{code:2,out:"",err:`${name}: \u3053\u306E\u5F15\u6570\u306F\u4F7F\u3048\u307E\u305B\u3093\uFF08${args.join(" ")}\uFF09
|
|
1214
1214
|
`}}if(parsed.unknown.length>0){return{code:2,out:"",err:`\u4E0D\u660E\u306A\u5F15\u6570: ${parsed.unknown.join(" ")}
|
|
1215
|
-
`}}let out="";let err="";const io={out:text=>void(out+=text),err:text=>void(err+=text),isTty:true};const globals={profile:parsed.profile??deps.profile,...parsed.output!==void 0?{output:parsed.output}:{},...parsed.query!==void 0?{query:parsed.query}:{},dryRun:parsed.dryRun,debug:parsed.debug,yes:parsed.yes,refresh:parsed.refresh};const{runDomain}=await import("./run-
|
|
1215
|
+
`}}let out="";let err="";const io={out:text=>void(out+=text),err:text=>void(err+=text),isTty:true};const globals={profile:parsed.profile??deps.profile,...parsed.output!==void 0?{output:parsed.output}:{},...parsed.query!==void 0?{query:parsed.query}:{},dryRun:parsed.dryRun,debug:parsed.debug,yes:parsed.yes,refresh:parsed.refresh};const{runDomain}=await import("./run-HYQQIOVW.js");try{const code=await runDomain({domain:route.domain,...parsed.operation!==void 0?{operation:parsed.operation}:
|
|
1216
1216
|
{},argv:parsed.domainArgv,help:parsed.domainHelp,globals,version:deps.version,io,...deps.fetchImpl!==void 0?{fetchImpl:deps.fetchImpl}:{}});return{code,out,err}}catch(e){return{code:1,out,err:`${err}${e.message}
|
|
1217
1217
|
`}}}var GIT_LOG_OUTPUT=["9f3c1a2 feat(ui): \u4E00\u89A7\u306E\u30D5\u30A3\u30EB\u30BF\u3092 URL \u30AF\u30A8\u30EA\u3068\u540C\u671F\u3059\u308B","4b8e0d7 fix(ui): \u4EEE\u60F3\u30B9\u30AF\u30ED\u30FC\u30EB\u306E\u884C\u9AD8\u3055\u3092\u5B9F\u6E2C\u5024\u306B\u5408\u308F\u305B\u308B","c15a99e refactor(api): \u4E00\u89A7\u53D6\u5F97\u306E\u30DA\u30FC\u30B8\u30F3\u30B0\u51E6\u7406\u3092\u5171\u901A\u5316\u3059\u308B","2d70f4b test: \u4E00\u89A7\u30D5\u30A3\u30EB\u30BF\u306E\u56DE\u5E30\u30C6\u30B9\u30C8\u3092\u8FFD\u52A0\u3059\u308B",
|
|
1218
1218
|
"a6e2b38 fix(api): \u7A7A\u306E\u691C\u7D22\u6761\u4EF6\u3067\u5168\u4EF6\u8FD4\u3089\u306A\u3044\u3088\u3046\u306B\u3059\u308B","7c40d51 chore(deps): \u958B\u767A\u4F9D\u5B58\u3092\u6700\u65B0\u3078\u66F4\u65B0\u3059\u308B","e83b1c6 docs: \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\u624B\u9806\u306B Node 22 \u306E\u524D\u63D0\u3092\u8FFD\u8A18\u3059\u308B","b91f7a4 fix(ui): \u30E2\u30FC\u30C0\u30EB\u306E\u91CD\u306A\u308A\u9806\u3092\u6307\u5B9A\u3059\u308B","5a2c8e0 perf(api): \u4E00\u89A7\u306E N+1 \u3092\u89E3\u6D88\u3059\u308B",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import"./chunk-
|
|
4
|
-
ApiResponseError,UsageError}from"./chunk-VFPY2A23.js";import"./chunk-J7QYPKVK.js";import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var CREATE_USAGE="twp attendance record create --date <YYYY-MM-DD> --time <HH:MM> --type <clock-in|clock-out|break-start|break-end|switch> [--project <\u30B3\u30FC\u30C9|ID>] [--task <\u30BF\u30B9\u30AFID>] [--memo <\u30E1\u30E2>]";var UPDATE_USAGE="twp attendance record update <\u8A18\u9332ID> --memo <\u30E1\u30E2> [--month <YYYY-MM>]";var DELETE_USAGE="twp attendance record delete <\u8A18\u9332ID> --reason <\u7406\u7531> --yes [--month <YYYY-MM>]";var MOVE_USAGE="twp attendance record move <\u8A18\u9332\
|
|
3
|
+
import{PUNCH_TYPES,assertMonthOpen,attendanceDomain}from"./chunk-DBCF4H3V.js";import{dateFlag,monthFlag}from"./chunk-EXT4AIDF.js";import"./chunk-6LSQCOCJ.js";import"./chunk-FEJDU42E.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";import"./chunk-JA5A6UJ2.js";import"./chunk-QBGEYQ2I.js";import{requireResolved,withResolved}from"./chunk-PS5QFKHB.js";import"./chunk-II5RVJQN.js";import{isRecord,pick}from"./chunk-3ZRMMBP5.js";import{ApiRejectedError,
|
|
4
|
+
ApiResponseError,UsageError}from"./chunk-VFPY2A23.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var CREATE_USAGE="twp attendance record create --date <YYYY-MM-DD> --time <HH:MM> --type <clock-in|clock-out|break-start|break-end|switch> [--project <\u30B3\u30FC\u30C9|ID>] [--task <\u30BF\u30B9\u30AFID>] [--memo <\u30E1\u30E2>]";var UPDATE_USAGE="twp attendance record update <\u8A18\u9332ID> --memo <\u30E1\u30E2> [--month <YYYY-MM>]";var DELETE_USAGE="twp attendance record delete <\u8A18\u9332ID> --reason <\u7406\u7531> --yes [--month <YYYY-MM>]";var MOVE_USAGE="twp attendance record move <\u8A18\u9332\
|
|
5
5
|
ID> --project <\u30B3\u30FC\u30C9|ID> [--month <YYYY-MM>]";var TEXT_MAX=500;var UUID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;var TIME_PATTERN=/^(\d{2}):(\d{2})(?::(\d{2}))?$/;var CLOSED_REASON="\u30B5\u30FC\u30D0\u306F\u7DE0\u3081\u6E08\u307F\u306E\u6708\u3078\u306E\u4FEE\u6B63\u3092\u62D2\u5426\u305B\u305A\u7DE0\u3081\u306E\u96C6\u8A08\u3092\u6D17\u3044\u66FF\u3048\u308B\u306E\u3067\u3001CLI \u304C\u9001\u308B\u524D\u306B\u6B62\u3081\u3066\u3044\u307E\u3059\u3002";
|
|
6
6
|
var FORBIDDEN="\u81EA\u5206\u306E\u6253\u523B\u306E\u4FEE\u6B63\u306B\u306F\u6253\u523B\u4FEE\u6B63\u306E\u6A29\u9650\uFF08\u30E6\u30FC\u30B6\u30FC\u8A2D\u5B9A\u306E\u300C\u6253\u523B\u4FEE\u6B63\u300D\uFF09\u3068\u52E4\u6020\u306E\u5229\u7528\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u306E\u7BA1\u7406\u8005\u306B\u4ED8\u4E0E\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044";var RECORD_COLUMNS=["id","type","type_label","recorded_at","year_month","project_id","t\
|
|
7
7
|
ask_id","memo","is_manual","deleted_at"];var LABELS={clock_in:"\u51FA\u52E4",clock_out:"\u9000\u52E4",break_start:"\u4F11\u61A9\u958B\u59CB",break_end:"\u4F11\u61A9\u7D42\u4E86",switch:"\u5207\u66FF"};var TYPE_ORDER={break_start:1,break_end:2,switch:3,clock_out:4,clock_in:5};function zonedParts(epochMs,timeZone){const parts=new Intl.DateTimeFormat("en-US",{timeZone,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}).formatToParts(new Date(
|
|
@@ -47,5 +47,5 @@ day.punches,day.punches.filter(p=>p.id!==id),timeZone,day.initial))}return{notes
|
|
|
47
47
|
takesValue:true,placeholder:"<\u30B3\u30FC\u30C9|ID>"},...ID_FLAGS],async prepare(input,ctx){recordId(input,MOVE_USAGE);const explicit=input.flags.get("--project");if(explicit===void 0||explicit.trim()==="")throw new UsageError("--project\uFF08\u4ED8\u3051\u66FF\u3048\u5148\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",MOVE_USAGE);return withClock(input,ctx,{projectId:await ctx.projectId(explicit)})},plan:input=>({method:"POST",path:`/api/v1/attendance/records/${recordId(input,MOVE_USAGE)}\
|
|
48
48
|
/transfer`,body:{project_id:requireResolved(input,"projectId")}}),async preview(input,ctx){const{row,notes}=await existingPreview(input,ctx,MOVE_USAGE,"\u4ED8\u3051\u66FF\u3048");const to=requireResolved(input,"projectId");if(row["project_id"]===to)throw new UsageError(`\u8A18\u9332\u306F\u65E2\u306B\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 ${to} \u306B\u4ED8\u3044\u3066\u3044\u307E\u3059\uFF08\u4ED8\u3051\u66FF\u3048\u5148\u304C\u4ECA\u3068\u540C\u3058\u3067\u3059\uFF09`,MOVE_USAGE);notes.push(`\u4ED8\u3051\u66FF\u3048\
|
|
49
49
|
\u5148: \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 ${to}`);return{notes,warnings:[]}},summarize:body=>{const next=isRecord(body)?body["new_record"]:void 0;if(!isRecord(next))throw new ApiResponseError("\u4ED8\u3051\u66FF\u3048\u306E\u5FDC\u7B54\u306B new_record \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");return pick(next,RECORD_COLUMNS)},raw:body=>body,forbidden:FORBIDDEN};var attendanceRecordResource={name:"record",summary:"\
|
|
50
|
-
\u6253\u523B\u8A18\u9332\u306E\u4FEE\u6B63\uFF08\u904E\u53BB\u306E\u6642\u523B\u3067\u306E\u6253\u523B\u30FB\u30E1\u30E2\u306E\u5909\u66F4\u30FB\u53D6\u308A\u6D88\u3057\u30FB\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u4ED8\u3051\u66FF\u3048\uFF09",operations:[createOperation,updateOperation,deleteOperation,moveOperation]};var attendanceDomainWithRecords={...attendanceDomain,summary:"\u52E4\u6020\uFF08\u81EA\u5206\u306E\u6253\u523B\u72B6\u614B\u30FB\u6253\u523B\u5C65\u6B74\u30FB\u52E4\u6020\u8868\u30FB\u6253\u523B\u30FB\u6253\u523B\u4FEE\u6B63\uFF0F\u7BA1\u7406\u8005\u5411\u3051\u306E\u6B8B\u696D\u30B5\u30DE\u30EA\u30FB\u7DE0\u3081\u72B6\u6CC1\uFF09",
|
|
50
|
+
\u6253\u523B\u8A18\u9332\u306E\u4FEE\u6B63\uFF08\u904E\u53BB\u306E\u6642\u523B\u3067\u306E\u6253\u523B\u30FB\u30E1\u30E2\u306E\u5909\u66F4\u30FB\u53D6\u308A\u6D88\u3057\u30FB\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u4ED8\u3051\u66FF\u3048\uFF09",operations:[createOperation,updateOperation,deleteOperation,moveOperation]};var attendanceDomainWithRecords={...attendanceDomain,summary:"\u52E4\u6020\uFF08\u81EA\u5206\u306E\u6253\u523B\u72B6\u614B\u30FB\u6253\u523B\u5C65\u6B74\u30FB\u52E4\u6020\u8868\u30FB\u6253\u523B\u30FB\u6253\u523B\u4FEE\u6B63\u30FB\u52E4\u6020\u9023\u7D61\u30FB\u30C1\u30FC\u30E0\u306E\u52E4\u6020\u30FB\u30D5\u30EC\u30C3\u30AF\u30B9\u7CBE\u7B97\uFF0F\u7BA1\u7406\u8005\u5411\u3051\u306E\u6B8B\u696D\u30B5\u30DE\u30EA\u30FB\u7DE0\u3081\u72B6\u6CC1\uFF09",
|
|
51
51
|
subresources:[...attendanceDomain.subresources??[],attendanceRecordResource]};export{attendanceDomainWithRecords,attendanceRecordResource,businessDateOf,endState,introducedProblems,sequenceProblems,zonedParts,zonedToUtcIso};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{hoursMinutes}from"./chunk-
|
|
3
|
+
import{hoursMinutes}from"./chunk-DBCF4H3V.js";import{monthFlag}from"./chunk-EXT4AIDF.js";import"./chunk-6LSQCOCJ.js";import"./chunk-FEJDU42E.js";import"./chunk-GMBJTG6A.js";import"./chunk-JA5A6UJ2.js";import"./chunk-QBGEYQ2I.js";import"./chunk-PS5QFKHB.js";import"./chunk-II5RVJQN.js";import{isRecord,pick}from"./chunk-3ZRMMBP5.js";import{ApiResponseError,UsageError}from"./chunk-VFPY2A23.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";
|
|
4
|
+
import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var MONTH_FLAG={name:"--month",summary:"\u5BFE\u8C61\u306E\u5E74\u6708\uFF08YYYY-MM\uFF09",takesValue:true,placeholder:"<YYYY-MM>"};var ME_FLAG={name:"--me",summary:"\u81EA\u5206\u306E\u5206\u3060\u3051\u3092\u8868\u793A\u3059\u308B\uFF08\u7121\u3051\u308C\u3070\u5168\u54E1\u5206\u30FB\u7BA1\u7406\u8005\uFF09",takesValue:false};var FORBIDDEN_ADMIN="\u6A29\u9650\u304C\u8DB3\u308A\u307E\u305B\u3093\u3002\u5168\u54E1\u5206\uFF08--me \u306A\u3057\uFF09\u306F\u52E4\u6020\u306E\u7BA1\u7406\u8005\u6A29\u9650\uFF08\u52E4\u6020: \u7BA1\u7406\u8005\uFF09\u3001\u81EA\u5206\u306E\u5206\uFF08--me\uFF09\u306F\u52E4\u6020\u306E\u5229\u7528\u6A29\u9650\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u306E\u7BA1\u7406\u8005\u306B\u6A29\u9650\u306E\u4ED8\u4E0E\u3092\u4F9D\u983C\u3057\u3066\u304F\u3060\u3055\u3044";
|
|
4
5
|
function listBody(spec,body){if(!isRecord(body)||!Array.isArray(body[spec.key])){throw new ApiResponseError(`${spec.label}\u306E\u5FDC\u7B54\u306B ${spec.key} \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return body}function monthListOperation(spec){const usage=`twp ${spec.domain} list [--month <YYYY-MM>] [--me]`;return{name:"list",summary:`\u6708\u306E${spec.label}\u3092\u4E00\u89A7\u3059\u308B\uFF08--me \u3067\u81EA\u5206\u306E\u5206\u30FB\u7121\u3051\u308C\u3070\u5168\u54E1\u5206\uFF1D\u7BA1\u7406\u8005\uFF09`,
|
|
5
6
|
usage,description:`GET ${spec.path} \u3092\u8868\u793A\u3057\u307E\u3059\uFF08\u5168\u54E1\u5206\u30FB\u52E4\u6020\u306E\u7BA1\u7406\u8005\u6A29\u9650\u304C\u5FC5\u8981\uFF09\u3002--me \u3092\u4ED8\u3051\u308B\u3068 GET ${spec.path}/me\uFF08\u81EA\u5206\u306E\u5206\uFF09\u3067\u3059\u3002
|
|
6
7
|
--month \u304C\u7121\u3051\u308C\u3070\u4ECA\u6708\u3067\u3059\uFF08\u30C6\u30CA\u30F3\u30C8\u306E\u696D\u52D9\u65E5\u306E\u533A\u5207\u308A\u3067\u30B5\u30FC\u30D0\u304C\u6C7A\u3081\u307E\u3059\uFF09\u3002
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{CHECK_INTERVAL_MS,DISABLE_ENV,PARENT_PID_ENV,WORKER_ENV,autoUpdateDisabledReason,classifyInstall,describeAutoUpdate,isCheckDue,listRegisteredPids,lockFilePath,onStartup,pickNotice,readUpdateState,registerRunning,resolveCliPath,runDirPath,sameNpmPath,stateFilePath,workerEnv,writeUpdateState}from"./chunk-
|
|
3
|
+
import{CHECK_INTERVAL_MS,DISABLE_ENV,PARENT_PID_ENV,WORKER_ENV,autoUpdateDisabledReason,classifyInstall,describeAutoUpdate,isCheckDue,listRegisteredPids,lockFilePath,onStartup,pickNotice,readUpdateState,registerRunning,resolveCliPath,runDirPath,sameNpmPath,stateFilePath,workerEnv,writeUpdateState}from"./chunk-NWI2TBO6.js";import"./chunk-DXXFUNYN.js";import"./chunk-5WGOHFAS.js";import"./chunk-4VZKNEVN.js";import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";
|
|
4
4
|
import"./chunk-VSJBJXZO.js";export{CHECK_INTERVAL_MS,DISABLE_ENV,PARENT_PID_ENV,WORKER_ENV,autoUpdateDisabledReason,classifyInstall,describeAutoUpdate,isCheckDue,listRegisteredPids,lockFilePath,onStartup,pickNotice,readUpdateState,registerRunning,resolveCliPath,runDirPath,sameNpmPath,stateFilePath,workerEnv,writeUpdateState};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{fetchLatestVersion,isBehindLatest,resolveNpmCommand}from"./chunk-
|
|
4
|
-
import"./chunk-
|
|
3
|
+
import{fetchLatestVersion,isBehindLatest,resolveNpmCommand}from"./chunk-RQEX2WC5.js";import"./chunk-5WTFZJT7.js";import"./chunk-D233KKXW.js";import"./chunk-PMOUHEJQ.js";import"./chunk-XNLIEUAW.js";import"./chunk-J7QYPKVK.js";import{PARENT_PID_ENV,WORKER_ENV,autoUpdateDisabledReason,classifyInstall,isCheckDue,listRegisteredPids,lockFilePath,readUpdateState,resolveCliPath,runDirPath,writeUpdateState}from"./chunk-NWI2TBO6.js";import{PACKAGE_NAME,parseVersionCore}from"./chunk-DXXFUNYN.js";
|
|
4
|
+
import"./chunk-5WGOHFAS.js";import"./chunk-4VZKNEVN.js";import"./chunk-RZVI6PMW.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import{execFile}from"child_process";import fs from"fs";import path from"path";var PARENT_WAIT_MAX_MS=12*60*60*1e3;var PARENT_POLL_MS=1e3;var LOCK_STALE_MS=PARENT_WAIT_MAX_MS+60*60*1e3;var INSTALL_TIMEOUT_MS=0;function childEnv(env){const next={...env};delete next[WORKER_ENV];delete next[PARENT_PID_ENV];return next}function createNpmRunner(env=process.env){const cmd=resolveNpmCommand({env});if(cmd===null)return null;return(args,timeoutMs)=>new Promise(resolve=>{execFile(cmd.file,[...cmd.prefix,...args],{timeout:timeoutMs,windowsHide:true,maxBuffer:8*1024*1024,cwd:path.dirname(lockFilePath(env)),env:childEnv(env)},(error,stdout,stderr)=>{if(error===null){resolve({ok:true,stdout:String(stdout),stderr:String(
|
|
5
5
|
stderr)});return}const e=error;resolve({ok:false,stdout:String(stdout??""),stderr:String(stderr??""),...e.killed?{error:"\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8\u3057\u307E\u3057\u305F"}:typeof e.code==="string"?{error:e.code}:{}})})})}function summarizeNpmFailure(result){const text=`${result.stderr}
|
|
6
6
|
${result.stdout}`;const code=/npm (?:ERR!|error) code (\S+)/.exec(text)?.[1]??result.error;let reason;if(code==="EACCES"||code==="EPERM"){reason=`\u30B0\u30ED\u30FC\u30D0\u30EB\u306E\u5C0E\u5165\u5148\u306B\u66F8\u304D\u8FBC\u3080\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093\uFF08${code}\uFF09`}else if(code!==void 0&&/^(ENOTFOUND|ETIMEDOUT|ECONNREFUSED|ECONNRESET|EAI_AGAIN|ENETUNREACH)$/.test(code)){reason=`npm registry \u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\uFF08${code}\
|
|
7
7
|
\uFF09`}else if(code!==void 0){reason=`npm \u304C\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${code}\uFF09`}else{const line=text.split("\n").map(l=>l.trim()).find(l=>l!=="")??"\u4E0D\u660E\u306A\u30A8\u30E9\u30FC";reason=`npm \u304C\u5931\u6557\u3057\u307E\u3057\u305F: ${line}`}return stripTerminalControls(reason).slice(0,200)}function readInstalledVersion(cliPath){try{const pkgRoot=path.dirname(path.dirname(cliPath));const pkg=JSON.parse(fs.readFileSync(path.join(pkgRoot,"package.json"),"utf8"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{readBody}from"./chunk-6LSQCOCJ.js";import{BACKLOG_BASE_PATH,BACKLOG_PROJECT_SCOPE_LABEL,BACKLOG_SCOPE_LABEL,backlogSpacePath,isExactNumericId,resolveNamed}from"./chunk-
|
|
4
|
-
import
|
|
3
|
+
import{readBody}from"./chunk-6LSQCOCJ.js";import{BACKLOG_BASE_PATH,BACKLOG_PROJECT_SCOPE_LABEL,BACKLOG_SCOPE_LABEL,backlogSpacePath,isExactNumericId,resolveNamed}from"./chunk-FEJDU42E.js";import"./chunk-GMBJTG6A.js";import"./chunk-JA5A6UJ2.js";import"./chunk-QBGEYQ2I.js";import{requireResolved,singleRef,withResolved}from"./chunk-PS5QFKHB.js";import"./chunk-II5RVJQN.js";import{isRecord,pick}from"./chunk-3ZRMMBP5.js";import{ApiResponseError,UsageError}from"./chunk-VFPY2A23.js";
|
|
4
|
+
import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var DEFAULT_COUNT=20;var MAX_COUNT=100;var NUMERIC=/^[0-9]+$/;var ISSUE_REF=/^(?:[A-Za-z0-9_]+-[0-9]+|[0-9]+)$/;var DATE=/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;var SPACE_COLUMNS=["id","space_url"];var PROJECT_COLUMNS=["id","projectKey","name"];var ISSUE_LIST_COLUMNS=["issueKey","summary","status","assignee","priority","dueDate","updated","descriptionTruncated"];var ISSUE_GET_COLUMNS=["id","issueKey","projectId","summary","description","descriptionTruncated","status","issueType","priority","assignee","cr\
|
|
5
5
|
eatedUser","parentIssueId","startDate","dueDate","estimatedHours","actualHours","created","updated"];var COMMENT_COLUMNS=["id","created","createdUserId","createdUser","content","changeLog"];function commentRow(row){const source=isRecord(row)?row:{};const user=isRecord(source["createdUser"])?source["createdUser"]:{};return pick({...source,createdUserId:user["id"]??null,createdUser:user["name"]??null},COMMENT_COLUMNS)}var ATTACHMENT_COLUMNS=["id","name","size","contentType","createdUserId","create\
|
|
6
6
|
dUser","created"];var STATUS_COLUMNS=["id","name","color"];var USER_COLUMNS=["id","userId","name","mailAddress","roleType"];var SPACE_FLAG={name:"--space",summary:"Backlog \u30B9\u30DA\u30FC\u30B9\uFF08ID / \u30B9\u30DA\u30FC\u30B9URL / \u30B5\u30D6\u30C9\u30E1\u30A4\u30F3\uFF09\u3002\u767B\u9332\u304C1\u4EF6\u306A\u3089\u7701\u7565\u3067\u304D\u307E\u3059",takesValue:true,placeholder:"<ID|URL>"};var BODY_MAX_CHARS=1e5;var BODY_FLAGS=[{name:"--body-file",summary:"\u672C\u6587\u3092\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8AAD\u3080\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09\u3002\u6539\u884C\u30FBMarkdown\
|
|
7
7
|
\u3092\u58CA\u3055\u306A\u3044\u4E3B\u7D4C\u8DEF",takesValue:true,placeholder:"<\u30D1\u30B9|->"},{name:"--body",summary:"\u672C\u6587\u3092\u76F4\u63A5\u6307\u5B9A\u3059\u308B\uFF08\u4E00\u884C\u5411\u3051\u3002--body-file \u3068\u306E\u4F75\u7528\u306F\u30A8\u30E9\u30FC\uFF09",takesValue:true,placeholder:"<\u6587\u5B57\u5217>"}];function bodyHelp(fileFlag,inlineFlag){return`\u672C\u6587\u306F ${fileFlag} \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\u30FBMarkdown \u306E\u898B\u51FA\u3057\uFF08#\uFF09\u30FB
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{analysisForbidden}from"./chunk-
|
|
4
|
-
import"./chunk-J7QYPKVK.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import fs from"fs";import path from"path";var PATH="/api/v2/budget";var ANALYSIS_FORBIDDEN=analysisForbidden("");function budgetForbidden(body){if(body?.error==="forbidden")return"\u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u95B2\u89A7\u3067\u304D\u307E\u305B\u3093\uFF08\u30E1\u30F3\u30D0\u30FC\u3067\u306A\u3044\u304B\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u6A29\u9650\u304C\u8DB3\u308A\u307E\u305B\u3093\uFF09\u3002\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002";
|
|
3
|
+
import{analysisForbidden}from"./chunk-F53TSCRD.js";import{repeatedValues}from"./chunk-RX5HWI4L.js";import{nonEmpty}from"./chunk-MI6HVYR2.js";import"./chunk-DBCF4H3V.js";import"./chunk-EXT4AIDF.js";import"./chunk-6LSQCOCJ.js";import"./chunk-FEJDU42E.js";import"./chunk-GMBJTG6A.js";import{ApiError,MultipartBody}from"./chunk-JA5A6UJ2.js";import"./chunk-QBGEYQ2I.js";import{requireResolved,withResolved}from"./chunk-PS5QFKHB.js";import"./chunk-II5RVJQN.js";
|
|
4
|
+
import{isRecord,pick}from"./chunk-3ZRMMBP5.js";import{ApiRejectedError,ApiResponseError,UsageError}from"./chunk-VFPY2A23.js";import"./chunk-J7QYPKVK.js";import"./chunk-4VZKNEVN.js";import"./chunk-RZVI6PMW.js";import"./chunk-QQRJLH6B.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import fs from"fs";import path from"path";var PATH="/api/v2/budget";var ANALYSIS_FORBIDDEN=analysisForbidden("");function budgetForbidden(body){if(body?.error==="forbidden")return"\u3053\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u95B2\u89A7\u3067\u304D\u307E\u305B\u3093\uFF08\u30E1\u30F3\u30D0\u30FC\u3067\u306A\u3044\u304B\u3001\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u6A29\u9650\u304C\u8DB3\u308A\u307E\u305B\u3093\uFF09\u3002\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002";
|
|
5
5
|
return ANALYSIS_FORBIDDEN(body)}var FORBIDDEN=budgetForbidden;var EDIT_HINT="\u76EE\u6A19\u306E\u8A2D\u5B9A\u30FB\u30B3\u30D4\u30FC\u30FB\u53D6\u308A\u8FBC\u307F\u306F\u3001\u5168\u4F53\u7BA1\u7406\u8005\u304B\u5206\u6790\u306E\u6A29\u9650\u304C\u300C\u7BA1\u7406\u8005\u300D\u306E\u4EBA\u3060\u3051\u304C\u3067\u304D\u307E\u3059\u3002\u6309\u5206\u306F\u305D\u308C\u306B\u52A0\u3048\u3066\u3001\u305D\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u7BA1\u7406\u8005\u3082\u3067\u304D\u307E\u3059\n\uFF08\u3069\u3061\u3089\u3082\u5206\u6790\u306E\u6A29\u9650\u304C\u300C\u306A\u3057\u300D\u3067\u306F\u4F7F\u3048\u307E\u305B\u3093\uFF09\u3002";
|
|
6
6
|
var YEAR_MIN=2e3;var YEAR_MAX=2100;var IMPORT_MAX_BYTES=2048*1024;var SET_FILE_MAX_BYTES=4*1024*1024;var AMOUNT_MAX=999999999999;var SHOWN_OVERWRITES=24;var BOM=new RegExp(`^${String.fromCharCode(65279)}`);function usageOf(op){return`twp budget ${op} help`}function text(value){return typeof value==="string"||typeof value==="number"?String(value):""}function yen(value){return typeof value==="number"?`${value.toLocaleString("ja-JP")} \u5186`:"\uFF08\u306A\u3057\uFF09"}function noArgs(input,op){if(input.
|
|
7
7
|
args.length>0)throw new UsageError(`${op} \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,usageOf(op))}function envelope(body,what){if(!isRecord(body)||body["result"]!==true)throw new ApiResponseError(`${what}\u306E\u5FDC\u7B54\u306E\u5F62\u304C\u60F3\u5B9A\u3068\u9055\u3044\u307E\u3059\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return body}function dataRecord(body,what){const data=envelope(body,what)["data"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{featureLicenseGuidance}from"./chunk-
|
|
3
|
+
import{featureLicenseGuidance}from"./chunk-B6WIFZF2.js";import{nonEmpty}from"./chunk-MI6HVYR2.js";import{isExactNumericId}from"./chunk-FEJDU42E.js";import{UsageError}from"./chunk-VFPY2A23.js";var PDF_PATH="/api/v2/sales/pdf";var FEATURE_DENIED="\u3053\u306E\u6A5F\u80FD\u306B\u30A2\u30AF\u30BB\u30B9\u3059\u308B\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093\u3002";function salesFeatureDenied(body){return body?.error==="permission_denied"||body?.error==="forbidden"&&body.error_description===FEATURE_DENIED}function pdfForbidden(body){if(salesFeatureDenied(body))return featureLicenseGuidance("\u8CA9\u58F2\u7BA1\u7406");const reason=body?.error;if(typeof reason==="string"&&reason.endsWith(
|
|
4
4
|
"\u6A29\u9650\u304C\u3042\u308A\u307E\u305B\u3093")){return`${reason}\uFF08\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u7D10\u3065\u304F\u66F8\u985E\u306F\u305D\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30E1\u30F3\u30D0\u30FC\u3001\u7D10\u3065\u304B\u306A\u3044\u66F8\u985E\u306F\u4F5C\u6210\u8005\u30FB\u62C5\u5F53\u8005\u3068\u7BA1\u7406\u8005\u3060\u3051\u304C\u51FA\u529B\u3067\u304D\u307E\u3059\uFF09`}return void 0}var ESTIMATE={name:"estimate",label:"\u898B\u7A4D",noExample:"EST0000063",
|
|
5
5
|
defaultKind:"estimate",kinds:{estimate:{segment:"estimate",label:"\u898B\u7A4D\u66F8"},order:{segment:"order",label:"\u6CE8\u6587\u66F8"},"order-acceptance":{segment:"order-acceptance",label:"\u6CE8\u6587\u8ACB\u66F8"}}};var INVOICE={name:"invoice",label:"\u8ACB\u6C42",noExample:"INV0000170",defaultKind:"invoice",kinds:{invoice:{segment:"invoice",label:"\u8ACB\u6C42\u66F8"},delivery:{segment:"delivery",label:"\u7D0D\u54C1\u66F8"},inspection:{segment:"inspection",label:"\u691C\u53CE\u66F8"}}};var PURCHASE={
|
|
6
6
|
name:"purchase",label:"\u4ED5\u5165",defaultKind:"order",kinds:{order:{segment:"purchase-order",label:"\u6CE8\u6587\u66F8"},"order-acceptance":{segment:"purchase-order-acceptance",label:"\u6CE8\u6587\u8ACB\u66F8"}}};var OUT_FLAG={name:"--out",summary:"\u66F8\u304D\u51FA\u3057\u5148\u306E\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9\uFF08\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9.pdf>"};var FORCE_FLAG={name:"--force",summary:"\u65E2\u5B58\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u4E0A\u66F8\u304D\u3059\u308B",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{contentTypeFor,inspectLocalFile,issued}from"./chunk-
|
|
4
|
-
|
|
3
|
+
import{contentTypeFor,inspectLocalFile,issued}from"./chunk-VOMCTG6N.js";import{checkUploadQuota}from"./chunk-V64CGX7V.js";import{createFlags,fieldBody,hasAnyField,updateFlags}from"./chunk-MKQDUQQ2.js";import{readCsvFileText}from"./chunk-QLENN5DD.js";import{featureLicenseGuidance}from"./chunk-B6WIFZF2.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-MI6HVYR2.js";import{CUSTOMERS_PATH,SALES_COMPANIES_PATH,isExactNumericId}from"./chunk-FEJDU42E.js";
|
|
4
|
+
import{isSafePathSegment}from"./chunk-GMBJTG6A.js";import{ApiError,errorListMessages}from"./chunk-JA5A6UJ2.js";import{requireResolved,singleRef,withResolved}from"./chunk-PS5QFKHB.js";import{acknowledgement,isRecord,pick}from"./chunk-3ZRMMBP5.js";import{ApiRejectedError,ApiResponseError,UsageError}from"./chunk-VFPY2A23.js";import fs from"fs";import path from"path";function levelForbidden(licenseGuidance,levelGuidance){return body=>body?.error==="permission_denied"?licenseGuidance:levelGuidance}var COMPANY_LICENSE="\u53D6\u5F15\u5148\u3092\u6271\u3046\u306B\u306F\u8CA9\u58F2\u7BA1\u7406\u304B\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u8981\u308A\u307E\u3059\u304C\u3001\u3069\u3061\u3089\u3082\u3042\u308A\u307E\u305B\u3093\u3002\u30C6\u30CA\u30F3\u30C8\u304C\u3069\u3061\u3089\u3082\u5951\u7D04\u3057\u3066\u3044\u306A\u3044\u304B\u3001\u3042\u306A\u305F\u306E\u6A29\u9650\u304C\u3069\u3061\u3089\u3082\u300C\u306A\u3057\u300D\u306B\u306A\u3063\u3066\u3044\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002";
|
|
5
5
|
var CUSTOMER_LICENSE=featureLicenseGuidance("\u9867\u5BA2\u7BA1\u7406");var COMPANY_WRITE_FORBIDDEN=levelForbidden(COMPANY_LICENSE,"\u9867\u5BA2\u306E\u4F5C\u6210\u30FB\u66F4\u65B0\u306B\u306F\u3001\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7DE8\u96C6\u8005\u300D\u4EE5\u4E0A\u304B\u3001\u8CA9\u58F2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u30E1\u30F3\u30D0\u30FC\u300D\u4EE5\u4E0A\u306E\u3069\u3061\u3089\u304B\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
6
6
|
var LEVEL_LABELS={admin:"\u7BA1\u7406\u8005",editor:"\u7DE8\u96C6\u8005",viewer:"\u95B2\u89A7\u8005",none:"\u306A\u3057"};var CHILD_DELETE_NEEDS="\u62C5\u5F53\u8005\u30FB\u5BFE\u5FDC\u5C65\u6B74\u306E\u524A\u9664\u306B\u306F\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7BA1\u7406\u8005\u300D\u3067\u3042\u308B\u3053\u3068\u304C\u8981\u308A\u307E\u3059";var CUSTOMER_DELETE_FORBIDDEN=levelForbidden(COMPANY_LICENSE,"\u9867\u5BA2\u306E\u524A\u9664\u306B\u306F\u3001\u4F01\u696D\u306E\u524A\u9664\u306B\u9867\u5BA2\u7BA1\u7406\u306E\u300C\u7BA1\u7406\u8005\u300D\u304B\u8CA9\u58F2\u7BA1\u7406\u306E\u300C\u30E1\u30F3\u30D0\u30FC\u300D\u4EE5\u4E0A\u3001\u62C5\u5F53\u8005\u30FB\u5BFE\u5FDC\u5C65\u6B74\u306E\u524A\u9664\u306B\u9867\u5BA2\u7BA1\u7406\u306E\u300C\u7BA1\u7406\u8005\u300D\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\
|
|
7
7
|
\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");var CUSTOMER_UPDATE_FORBIDDEN=levelForbidden(CUSTOMER_LICENSE,"\u9867\u5BA2\u306E\u66F4\u65B0\u306B\u306F\u3001\u9867\u5BA2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u7DE8\u96C6\u8005\u300D\u4EE5\u4E0A\u304B\u3001\u8CA9\u58F2\u7BA1\u7406\u306E\u6A29\u9650\u304C\u300C\u30E1\u30F3\u30D0\u30FC\u300D\u4EE5\u4E0A\u306E\u3069\u3061\u3089\u304B\u304C\u8981\u308A\u307E\u3059\u3002\u30C6\u30CA\u30F3\u30C8\u7BA1\u7406\u8005\u306B\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
+
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
+
import{nonEmpty}from"./chunk-MI6HVYR2.js";import{readBody}from"./chunk-6LSQCOCJ.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";import{ApiError}from"./chunk-JA5A6UJ2.js";import{withResolved}from"./chunk-PS5QFKHB.js";import{isRecord,pick}from"./chunk-3ZRMMBP5.js";import{ApiRejectedError,ApiResponseError,UsageError}from"./chunk-VFPY2A23.js";var GROUPED_PATH="/api/v2/organization/skills/grouped";var SKILL_MAP_PATH="/api/v2/organization/skill-map";var QUALIFICATIONS_PATH="/api/v2/organization/qualifications";var USERS_LIST_PATH="/api/v2/admin/users/list";var USERS_PAGE_LIMIT=100;var USERS_MAX_PAGES=50;var HR_FORBIDDEN="HR\u7BA1\u7406\u8005\u306E\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\u3002\u30B9\u30AD\u30EB\u30DE\u30C3\u30D7\uFF08twp skill map / who\uFF09\u306F\u4EBA\u4E8B\u7BA1\u7406\u306E\u7BA1\u7406\u8005\u3060\u3051\u304C\u53C2\u7167\u3067\u304D\u307E\u3059";
|
|
4
|
+
function groupedSkillRows(body){const categories=isRecord(body)?body["categories"]:void 0;if(!Array.isArray(categories)){throw new ApiResponseError("\u30B9\u30AD\u30EB\u4E00\u89A7\u306E\u5FDC\u7B54\u306B categories \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return categories.flatMap(group=>{const category=isRecord(group)&&isRecord(group["category"])?group["category"]:{};const skills=isRecord(group)&&Array.
|
|
5
|
+
isArray(group["skills"])?group["skills"]:[];return skills.filter(isRecord).map(skill=>({...skill,category_id:skill["category_id"]??category["id"]??null,category_name:category["name"]??null}))})}function groupedCategories(body){groupedSkillRows(body);return body["categories"]}function skillMatrix(body){const matrix=isRecord(body)?body["matrix"]:void 0;if(!Array.isArray(matrix)){throw new ApiResponseError("\u30B9\u30AD\u30EB\u30DE\u30C3\u30D7\u306E\u5FDC\u7B54\u306B matrix \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
|
|
6
|
+
return matrix.filter(isRecord)}function qualificationRows(body){const list=isRecord(body)?body["list"]:void 0;if(!Array.isArray(list)){throw new ApiResponseError("\u8CC7\u683C\u30DE\u30B9\u30BF\u306E\u5FDC\u7B54\u306B list \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return list}var SKILLS_PATH="/api/v2/organization/skills";async function skillNames(ctx,ids=[]){const map={};try{for(const row of groupedSkillRows(
|
|
7
|
+
await ctx.send({method:"GET",path:GROUPED_PATH}))){if(typeof row["id"]==="string"&&typeof row["name"]==="string")map[row["id"]]=row["name"]}}catch(err){ctx.warn(`\u30B9\u30AD\u30EB\u540D\u3092\u53D6\u5F97\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\u3001skill_name \u306E\u5217\u306F\u7A7A\u6B04\u3067\u3059\uFF08${err.message}\uFF09\u3002skill_id \u306F --output json \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002`);return{}}const missing=[...new Set(ids)].filter(id=>!Object.hasOwn(map,id));
|
|
8
|
+
if(missing.length===0)return map;try{const body=await ctx.send({method:"GET",path:SKILLS_PATH});const list=isRecord(body)&&Array.isArray(body["list"])?body["list"]:[];for(const row of list){if(isRecord(row)&&typeof row["id"]==="string"&&typeof row["name"]==="string")map[row["id"]]=row["name"]}}catch{}const unresolved=missing.filter(id=>!Object.hasOwn(map,id)).length;if(unresolved>0){ctx.warn(`${unresolved} \u4EF6\u306E\u30B9\u30AD\u30EB\u306F\u540D\u524D\u3092\u5F15\u3051\u306A\u304B\u3063\u305F\u305F\u3081\u3001skill_name \u306E\u5217\u304C\u7A7A\u6B04\u3067\u3059\uFF08\u524A\u9664\u3055\u308C\u305F\u30B9\u30AD\u30EB\u306E\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\uFF09\u3002skill_id \u306F --output json \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002`)}
|
|
9
|
+
return map}function matrixSkillIds(matrix){return matrix.flatMap(row=>(Array.isArray(row["skills"])?row["skills"].filter(isRecord):[]).map(skill=>skill["skill_id"]).filter(id=>typeof id==="string"))}async function usersByDepartment(ctx,options={}){const departments={};let cursor;for(let page=0;page<USERS_MAX_PAGES;page++){const body=await ctx.send({method:"GET",path:USERS_LIST_PATH,query:{limit:USERS_PAGE_LIMIT,cursor,department_id:options.departmentId,include_hidden:"true"}});const items=isRecord(
|
|
10
|
+
body)?body["items"]:void 0;if(!Array.isArray(items)){throw new ApiResponseError("\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\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")}for(const row of items){if(isRecord(row)&&typeof row["user_id"]==="string"){departments[row["user_id"]]=typeof row["department_name"]==="string"?row["department_name"]:null}}if(options.needed!==void 0&&[...options.needed].
|
|
11
|
+
every(id=>Object.hasOwn(departments,id))){return{departments,complete:true}}const next=isRecord(body)?body["next_cursor"]:void 0;if(!(isRecord(body)&&body["has_more"]===true&&typeof next==="string"&&next!=="")){return{departments,complete:true}}cursor=next}return{departments,complete:false}}var FISCAL_YEAR_FLAG={name:"--fiscal-year",summary:"\u5E74\u5EA6\uFF08\u4F8B: 2026\uFF09\u3002\u7701\u7565\u3059\u308B\u3068\u5168\u5E74\u5EA6\u306E\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u304C\u4E26\u3076",takesValue:true,
|
|
12
|
+
placeholder:"<\u5E74\u5EA6>"};function fiscalYear(input){const raw=nonEmpty(input.flags,"--fiscal-year");if(raw===void 0)return void 0;if(!/^\d{4}$/.test(raw)){throw new UsageError(`--fiscal-year \u306B\u300C${raw}\u300D\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,"\u897F\u66A64\u6841\u306E\u5E74\u5EA6\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4F8B: --fiscal-year 2026\uFF09")}return raw}function minLevel(input){const raw=nonEmpty(input.flags,"--min-level");if(raw===void 0)
|
|
13
|
+
return 1;if(!/^[1-5]$/.test(raw)){throw new UsageError(`--min-level \u306B\u300C${raw}\u300D\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,"1\u301C5 \u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u30B9\u30AD\u30EB\u306E\u8A55\u4FA1\u30EC\u30D9\u30EB\u306F1\u301C5\uFF09")}return Number(raw)}function noArgs(input,usage){if(input.args.length>0)throw new UsageError(`\u4F4D\u7F6E\u5F15\u6570\u306F\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,usage)}function skillMapPlan(input){
|
|
14
|
+
return{method:"GET",path:SKILL_MAP_PATH,query:{fiscal_year:fiscalYear(input)}}}function matchSkill(rows,ref){const byId=rows.find(row=>row["id"]===ref);if(byId!==void 0)return byId;const lower=ref.toLowerCase();const name=row=>String(row["name"]??"").toLowerCase();const exact=rows.filter(row=>name(row)===lower);const hits=exact.length>0?exact:rows.filter(row=>name(row).includes(lower));if(hits.length===1&&hits[0]!==void 0)return hits[0];if(hits.length===0){throw new UsageError(`\u30B9\u30AD\u30EB\u300C${ref}\
|
|
15
|
+
\u300D\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093`,"\u767B\u9332\u3055\u308C\u3066\u3044\u308B\u30B9\u30AD\u30EB\u306F twp skill list \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059")}throw new UsageError(`\u30B9\u30AD\u30EB\u300C${ref}\u300D\u306B ${hits.length} \u4EF6\u5F53\u305F\u308A\u307E\u3057\u305F: ${hits.map(row=>`${String(row["name"])}\uFF08${String(row["id"])}\uFF09`).join(" / ")}`,"\u540D\u524D\u3092\u5B8C\u5168\u306B\u66F8\u304F\u304B\u3001ID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044")}
|
|
16
|
+
var SKILL_LIST_COLUMNS=["category_name","id","name","is_active","description"];var listOperation={name:"list",summary:"\u30B9\u30AD\u30EB\u30DE\u30B9\u30BF\u3092\u30AB\u30C6\u30B4\u30EA\u5225\u306B\u4E00\u89A7\u3059\u308B",usage:"twp skill list",description:"GET /api/v2/organization/skills/grouped\u3002\u30DA\u30FC\u30B8\u30F3\u30B0\u3092\u6301\u305F\u305A\u3001\u5E38\u306B\u5168\u4EF6\u3092\u8FD4\u3057\u307E\u3059\u3002\n--output table / text / tsv \u306F1\u30B9\u30AD\u30EB1\u884C\uFF08category_name / id / name / is_active / description\uFF09\u3067\u3059\u3002\n--output json \u306F\u30AB\u30C6\u30B4\u30EA\u3054\u3068\u306E\u5165\u308C\u5B50\uFF08categories[].category / skills[]\u30FB\u8A55\u4FA1\u57FA\u6E96 evaluation_criteria \u3092\u542B\u3080\uFF09\
|
|
17
|
+
\u3092\u305D\u306E\u307E\u307E\u51FA\u3057\u307E\u3059\u3002",flags:[],plan(input){noArgs(input,"twp skill list help");return{method:"GET",path:GROUPED_PATH}},summarize:body=>groupedSkillRows(body).map(row=>pick(row,SKILL_LIST_COLUMNS)),raw:body=>groupedCategories(body)};function mapBody(body){if(isRecord(body)&&isRecord(body["response"]))return body;return{response:isRecord(body)?body:{},skillNames:{}}}var MAP_COLUMNS=["user_name","skill_name","level","target_level","user_id","skill_id"];var mapOperation={
|
|
18
|
+
name:"map",summary:"\u30B9\u30AD\u30EB\u30DE\u30C3\u30D7\uFF08\u30E6\u30FC\u30B6\u30FC\xD7\u30B9\u30AD\u30EB\u306E\u8A55\u4FA1\u30EC\u30D9\u30EB\uFF09\u3092\u8868\u793A\u3059\u308B\uFF08HR\u7BA1\u7406\u8005\u306E\u307F\uFF09",usage:"twp skill map [--fiscal-year <\u5E74\u5EA6>] [--department <\u90E8\u7F72>]",description:"GET /api/v2/organization/skill-map\u3002\u30B9\u30AD\u30EB\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3092\u6301\u3064\u30E6\u30FC\u30B6\u30FC\u3060\u3051\u304C\u8F09\u308A\u307E\u3059\u3002\nlevel \u306F\u78BA\u5B9A\u30EC\u30D9\u30EB\uFF08\u672A\u78BA\u5B9A\u306A\u3089\u81EA\u5DF1\u8A55\u4FA1\u30EC\u30D9\u30EB\u30FB\u3069\u3061\u3089\u3082\u7121\u3051\u308C\u3070\u7A7A\uFF09\u3001target_level \u306F\u76EE\u6A19\u30EC\u30D9\u30EB\u3067\u3059\u3002\n\u884C\u306F\u30B9\u30AD\u30EB\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\uFF08\u30E6\u30FC\u30B6\u30FC\xD7\u5E74\u5EA6\uFF09\u3054\u3068\u306B\u51FA\u308B\u306E\u3067\u3001--fiscal-year \u3092\u7701\u7565\u3059\u308B\u3068\u540C\u3058\u4EBA\u304C\u5E74\u5EA6\u306E\u6570\u3060\u3051\
|
|
19
|
+
\u4E26\u3073\u307E\u3059\u3002\n--department \u306F\u4E3B\u6240\u5C5E\u306E\u90E8\u7F72\u3067\u7D5E\u308A\u8FBC\u307F\u307E\u3059\uFF08\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID\uFF09\u3002\u30B5\u30FC\u30D0\u306E\u30B9\u30AD\u30EB\u30DE\u30C3\u30D7\u306F\u90E8\u7F72\u3067\u7D5E\u308C\u306A\u3044\u305F\u3081\u3001\n\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\uFF08\u4E3B\u6240\u5C5E\u30FB\u8868\u793A\u30D5\u30E9\u30B0\u3092\u5916\u3057\u305F\u4EBA\u3082\u542B\u3081\u308B\uFF09\u3092\u5F15\u3044\u3066\u305D\u306E\u90E8\u7F72\u306E\u4EBA\u3060\u3051\u306B\u7D5E\u308A\u307E\u3059\u3002\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u304C\u5F15\u3051\u306A\u3051\u308C\u3070\n\u7D5E\u3089\u305A\u306B\u51FA\u3059\u3053\u3068\u306F\u305B\u305A\u3001\u6B62\u307E\u308A\u307E\u3059\uFF08\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u306F\u7D44\u7E54\u7BA1\u7406\u8005\u306E\u6A29\u9650\u304C\u8981\u308A\u307E\u3059\uFF09\u3002\n\n--output table / text / tsv \u306F1\u30E6\u30FC\u30B6\u30FC1\u30B9\u30AD\u30EB1\u884C\uFF08user_name / skill_name / level / target_level / user_id / skill_id\uFF09\u3067\u3059\u3002\n--output json \u306F\u30B5\u30FC\u30D0\u306E\u5FDC\u7B54\uFF08matrix\u30FBskill_summary\uFF09\u3092\u305D\u306E\u307E\u307E\u51FA\u3057\u307E\u3059\uFF08--department \u3067\u7D5E\u3063\u305F\u5834\u5408\u306F matrix \u3060\u3051\u304C\u7D5E\u3089\u308C\u307E\u3059\uFF09\u3002",
|
|
20
|
+
forbidden:HR_FORBIDDEN,flags:[FISCAL_YEAR_FLAG,{name:"--department",summary:"\u4E3B\u6240\u5C5E\u306E\u90E8\u7F72\u3067\u7D5E\u308A\u8FBC\u3080\uFF08\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID\uFF09",takesValue:true,placeholder:"<\u90E8\u7F72>"}],async prepare(input,ctx){noArgs(input,"twp skill map help");fiscalYear(input);const department=nonEmpty(input.flags,"--department");if(department===void 0)return input;return withResolved(input,{departmentId:(await ctx.resolver.department(department)).
|
|
21
|
+
id})},plan:skillMapPlan,plannedNotes:input=>["\u3053\u306E\u3042\u3068\u3001\u30B9\u30AD\u30EB\u540D\u3092\u8868\u793A\u3059\u308B\u305F\u3081\u30B9\u30AD\u30EB\u4E00\u89A7\u3092 GET \u3057\u307E\u3059\u3002",...input.flags.has("--department")?["\u90E8\u7F72\u3067\u7D5E\u308B\u305F\u3081\u3001\u305D\u306E\u90E8\u7F72\u306E\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\uFF08\u4E3B\u6240\u5C5E\uFF09\u3092 GET \u3057\u307E\u3059\u3002"]:[]],async execute(input,ctx){const response=await ctx.send(skillMapPlan(
|
|
22
|
+
input));let matrix=skillMatrix(response);const departmentId=input.resolved?.["departmentId"];if(departmentId!==void 0){let result;try{result=await usersByDepartment(ctx,{departmentId})}catch(err){if(err instanceof ApiError&&err.status===403){throw new ApiRejectedError(`--department \u3067\u7D5E\u308B\u306B\u306F\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\uFF08\u7D44\u7E54\u7BA1\u7406\u8005\uFF09\u306E\u6A29\u9650\u304C\u8981\u308A\u307E\u3059\u3002--department \u3092\u5916\u3057\u3066\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\uFF08${err.
|
|
23
|
+
message}\uFF09`)}throw err}const{departments,complete}=result;if(!complete){throw new ApiResponseError(`\u90E8\u7F72\u306E\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u304C ${USERS_MAX_PAGES*USERS_PAGE_LIMIT} \u4EF6\u3092\u8D85\u3048\u305F\u305F\u3081\u3001\u90E8\u7F72\u3067\u7D5E\u308A\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F\u3002--department \u3092\u5916\u3057\u3066\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}const before=matrix.length;matrix=matrix.filter(row=>typeof row["user_id"]===
|
|
24
|
+
"string"&&Object.hasOwn(departments,row["user_id"]));const excluded=before-matrix.length;if(excluded>0){ctx.warn(`\u30B9\u30AD\u30EB\u30DE\u30C3\u30D7\u306E ${before} \u4EBA\u306E\u3046\u3061\u3001\u3053\u306E\u90E8\u7F72\u306E\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\uFF08\u5728\u7C4D\u4E2D\u30FB\u4E3B\u6240\u5C5E\uFF09\u306B\u51FA\u306A\u3044 ${excluded} \u4EBA\u3092\u9664\u3044\u3066\u3044\u307E\u3059\uFF08\u4ED6\u90E8\u7F72\u306E\u4EBA\u306E\u307B\u304B\u3001\u5931\u52B9\u30FB\u975E\u8868\u793A\u306E\u30E6\u30FC\u30B6\u30FC\u3092\u542B\u307F\u307E\u3059\uFF09\u3002`)}}
|
|
25
|
+
return{response:{...response,matrix},skillNames:await skillNames(ctx,matrixSkillIds(matrix))}},summarize(body){const{response,skillNames:names}=mapBody(body);return skillMatrix(response).flatMap(row=>{const skills=Array.isArray(row["skills"])?row["skills"].filter(isRecord):[];return skills.map(skill=>pick({...skill,user_id:row["user_id"],user_name:row["user_name"],skill_name:typeof skill["skill_id"]==="string"?names[skill["skill_id"]]??null:null},MAP_COLUMNS))})},raw:body=>mapBody(body).response};
|
|
26
|
+
var WHO_COLUMNS=["user_name","department_name","level","target_level","user_id"];function whoRows(body){const{response,departments}=mapBody(body);const skillId=response["skill_id"];return skillMatrix(response).map(row=>{const skill=(Array.isArray(row["skills"])?row["skills"].filter(isRecord):[]).find(s=>s["skill_id"]===skillId)??{};const userId=row["user_id"];return{user_id:userId,user_name:row["user_name"]??null,department_name:typeof userId==="string"?departments!==void 0&&Object.hasOwn(departments,
|
|
27
|
+
userId)?departments[userId]:null:null,skill_id:skillId,level:skill["level"]??null,target_level:skill["target_level"]??null}})}var whoOperation={name:"who",summary:"\u6307\u5B9A\u3057\u305F\u30B9\u30AD\u30EB\u3092\u6301\u3064\u30E6\u30FC\u30B6\u30FC\u3092\u6240\u5C5E\u4ED8\u304D\u3067\u51FA\u3059\uFF08HR\u7BA1\u7406\u8005\u306E\u307F\uFF09",usage:"twp skill who --skill <\u30B9\u30AD\u30EB> [--min-level <1\u301C5>] [--fiscal-year <\u5E74\u5EA6>]",description:"\u30B9\u30AD\u30EB\u30DE\u30C3\u30D7\uFF08GET /api/v2/organization/skill-\
|
|
28
|
+
map\uFF09\u304B\u3089\u3001\u6307\u5B9A\u3057\u305F\u30B9\u30AD\u30EB\u306E\u8A55\u4FA1\u30EC\u30D9\u30EB\u304C --min-level\uFF08\u65E2\u5B9A 1\uFF09\u4EE5\u4E0A\u306E\n\u30E6\u30FC\u30B6\u30FC\u3092\u30EC\u30D9\u30EB\u306E\u9AD8\u3044\u9806\u306B\u51FA\u3057\u307E\u3059\u3002level \u306F\u78BA\u5B9A\u30EC\u30D9\u30EB\uFF08\u672A\u78BA\u5B9A\u306A\u3089\u81EA\u5DF1\u8A55\u4FA1\u30EC\u30D9\u30EB\uFF09\u3067\u3001\u3069\u3061\u3089\u3082\u7121\u3044\u4EBA\u306F\u51FA\u3057\u307E\u305B\u3093\u3002\n\u884C\u306F\u30B9\u30AD\u30EB\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\uFF08\u30E6\u30FC\u30B6\u30FC\xD7\u5E74\u5EA6\uFF09\u3054\u3068\u306A\u306E\u3067\u3001--fiscal-year \u3092\u7701\u7565\u3059\u308B\u3068\u540C\u3058\u4EBA\u304C\u5E74\u5EA6\u306E\u6570\u3060\u3051\u4E26\u3073\u307E\u3059\u3002\n--skill \u306F ID \u304B\u540D\u524D\u3067\u6307\u5B9A\u3057\u307E\u3059\uFF08\u5B8C\u5168\u4E00\u81F4 \u2192 \u90E8\u5206\u4E00\u81F4\u30671\u4EF6\u306B\u7D5E\u308C\u305F\u3068\u304D\u3060\u3051\u53D7\u3051\u4ED8\u3051\u307E\u3059\uFF09\u3002\n\u30B5\u30FC\u30D0\u306B\u6A2A\u65AD\u691C\u7D22\u306E API \u306F\u7121\u3044\u305F\u3081\u3001\u30B9\u30AD\u30EB\u4E00\u89A7\u30FB\u30B9\u30AD\u30EB\u30DE\u30C3\u30D7\u30FB\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\uFF08\u6240\u5C5E\u306E\u8868\u793A\u7528\uFF09\u3092\u9806\u306B GET \u3057\u3066 CLI \u3067\u7D5E\u308A\u307E\u3059\u3002\n\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u304C\u5F15\u3051\u306A\u3044\uFF08\u7D44\u7E54\u7BA1\u7406\u8005\u3067\u306A\u3044\u7B49\uFF09\u3068\u304D\u306F department_name \u3092\u7A7A\u6B04\u306B\u3057\u3066\u3001\u305D\u306E\u65E8\u3092 stderr \u306B\u51FA\u3057\u307E\u3059\u3002\n\n--output json \u306F\u8A72\u5F53\u8005\u306E\u884C\uFF08user_id / user_name / department_name / skill_id / level / target_level\uFF09\u3092\u51FA\u3057\u307E\u3059\u3002\n\u8CC7\u683C\u306E\u4FDD\u6709\u8005\u306E\u6A2A\u65AD\u691C\u7D22\uFF08twp qualification who\uFF09\u306F\u30B5\u30FC\u30D0\u306B AP\
|
|
29
|
+
I \u304C\u7121\u3044\u305F\u3081\u3001\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002",forbidden:HR_FORBIDDEN,flags:[{name:"--skill",summary:"\u5BFE\u8C61\u306E\u30B9\u30AD\u30EB\uFF08ID\u30FB\u540D\u524D\uFF09",takesValue:true,placeholder:"<\u30B9\u30AD\u30EB>"},{name:"--min-level",summary:"\u3053\u306E\u8A55\u4FA1\u30EC\u30D9\u30EB\u4EE5\u4E0A\u306E\u4EBA\u3060\u3051\u51FA\u3059\uFF081\u301C5\u30FB\u65E2\u5B9A 1\uFF09",takesValue:true,placeholder:"<1\u301C5>"},FISCAL_YEAR_FLAG],plan(input){noArgs(
|
|
30
|
+
input,"twp skill who help");if(nonEmpty(input.flags,"--skill")===void 0){throw new UsageError("--skill \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044","twp skill who --skill <\u30B9\u30AD\u30EB> [--min-level <1\u301C5>]")}minLevel(input);return skillMapPlan(input)},plannedNotes:()=>["\u3053\u306E\u524D\u306B\u3001--skill \u3092\u89E3\u6C7A\u3059\u308B\u305F\u3081\u30B9\u30AD\u30EB\u4E00\u89A7\u3092 GET \u3057\u307E\u3059\u3002","\u3053\u306E\u3042\u3068\u3001\u6240\u5C5E\u3092\u8868\u793A\u3059\u308B\u305F\u3081\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u3092 GET \u3057\u307E\u3059\u3002"],
|
|
31
|
+
async execute(input,ctx){const ref=nonEmpty(input.flags,"--skill");const threshold=minLevel(input);const skill=matchSkill(groupedSkillRows(await ctx.send({method:"GET",path:GROUPED_PATH})),ref);const skillId=String(skill["id"]);const response=await ctx.send(skillMapPlan(input));const level=row=>{const hit=(Array.isArray(row["skills"])?row["skills"].filter(isRecord):[]).find(s=>s["skill_id"]===skillId);return typeof hit?.["level"]==="number"?hit["level"]:0};const matrix=skillMatrix(response).filter(
|
|
32
|
+
row=>level(row)>=threshold).sort((a,b)=>level(b)-level(a));let departments;if(matrix.length>0){try{const needed=new Set(matrix.map(row=>String(row["user_id"])));const result=await usersByDepartment(ctx,{needed});const found=result.departments;departments=found;const unresolved=[...needed].filter(id=>!Object.hasOwn(found,id)).length;if(unresolved>0){ctx.warn(`${unresolved} \u4EBA\u306E\u6240\u5C5E\u3092\u30E6\u30FC\u30B6\u30FC\u4E00\u89A7\u304B\u3089\u5F15\u3051\u306A\u304B\u3063\u305F\u305F\u3081\u3001department_name \u306F\u7A7A\u6B04\u3067\u3059\uFF08\u975E\u8868\u793A\u30FB\u5931\u52B9\u306E\u30E6\u30FC\u30B6\u30FC\u3001\u307E\u305F\u306F\u4E00\u89A7\u306E\u4E0A\u9650\u8D85\u3048\uFF09\u3002`)}}catch(err){
|
|
33
|
+
ctx.warn(`\u6240\u5C5E\u3092\u53D6\u5F97\u3067\u304D\u306A\u304B\u3063\u305F\u305F\u3081\u3001department_name \u306E\u5217\u306F\u7A7A\u6B04\u3067\u3059\uFF08${err.message}\uFF09\u3002`)}}return{response:{...response,skill_id:skillId,skill_name:skill["name"]??null,matrix},skillNames:{},departments}},summarize:body=>whoRows(body).map(row=>pick(row,WHO_COLUMNS)),raw:body=>whoRows(body),notes(body){const{response}=mapBody(body);if(skillMatrix(response).length>0)return[];return[`\u30B9\u30AD\u30EB\u300C${String(
|
|
34
|
+
response["skill_name"]??response["skill_id"])}\u300D\u3067\u6761\u4EF6\u306B\u5F53\u305F\u308B\u30E6\u30FC\u30B6\u30FC\u306F\u3044\u307E\u305B\u3093\uFF08\u30B9\u30AD\u30EB\u30DE\u30C3\u30D7\u306B\u8F09\u308B\u306E\u306F\u30B9\u30AD\u30EB\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3092\u6301\u3064\u30E6\u30FC\u30B6\u30FC\u3060\u3051\u3067\u3059\uFF09\u3002`]}};var PROFILES_PATH="/api/v2/organization/user-skill-profiles";var SELF_EVALUATE_MAX_CHARS=1e6;var SELF_COMMENT_MAX=2e3;var POLICY_MAX=5e3;var SELF_EVALUATE_HELP='\
|
|
35
|
+
\u5185\u5BB9\uFF08--content-file\uFF09\u306F\u30B5\u30FC\u30D0\u304C\u53D7\u3051\u308B\u5F62\u306E JSON \u3067\u3059\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09:\n {"skills": [{"skill_id": "<\u30B9\u30AD\u30EBID>", "self_level": 1\u301C5, "self_comment": "\u4EFB\u610F\u30FB2,000\u5B57\u307E\u3067"}],\n "skill_up_policy": "\u4EFB\u610F\u30FB\u30B9\u30AD\u30EB\u30A2\u30C3\u30D7\u65B9\u91DD\u30FB5,000\u5B57\u307E\u3067"}\n skill_up_policy \u306F\u30AD\u30FC\u3092\u7701\u3051\u3070\u4ECA\u306E\u65B9\u91DD\u306E\u307E\u307E\u3001\u7A7A\u6587\u5B57\u304B null \u3092\u66F8\u304F\u3068\u6D88\u3048\u307E\u3059\u3002\n skill_id \u3068\u73FE\u5728\u306E\u8A55\u4FA1\u306F twp user skills me \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\uFF08--output json \u306E skills[].skill_id\uFF09\u3002\n \u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306B\u7121\u3044\u30B9\u30AD\u30EB\u30FB\u77E5\u3089\u306A\u3044\u30AD\u30FC\u306F\u9001\u308B\u524D\u306B\u6B62\u3081\u307E\u3059\uFF08\u30B5\u30FC\u30D0\u306F\u524D\u8005\u3092\u9ED9\u3063\u3066\u7121\u8996\u3059\u308B\u305F\u3081\uFF09\u3002\n \u9001\u3089\u306A\u304B\u3063\u305F\u30B9\u30AD\u30EB\u306F\u4ECA\u306E\u81EA\u5DF1\u8A55\u4FA1\u306E\u307E\u307E\u63D0\u51FA\u3055\u308C\u3001\u307E\u3060\u5024\u306E\u7121\u3044\u3082\u306E\u306F\u9001\u308B\u524D\u306B stderr \u3067\u6319\u3052\u307E\u3059\u3002';
|
|
36
|
+
function profileIdArg(input){const[raw,...rest]=input.args;const id=raw?.trim()??"";const usage="twp skill self-evaluate <\u30D7\u30ED\u30D5\u30A1\u30A4\u30EBID> --content-file <JSON> --yes";if(id==="")throw new UsageError("\u30B9\u30AD\u30EB\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306E ID \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",`${usage}\uFF08ID \u306F twp user skills me \u306E profile_id \u5217\uFF09`);if(rest.length>0)throw new UsageError(`\u53D7\u3051\u53D6\u308C\u308B\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB ID \u306F1\u3064\u3060\u3051\u3067\u3059: ${rest.
|
|
37
|
+
join(" ")}`,usage);if(!isSafePathSegment(id))throw new UsageError(`\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB ID \u306B\u4F7F\u3048\u306A\u3044\u6587\u5B57\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059: ${id}`,usage);return encodeURIComponent(id)}function parseSelfEvaluation(text){let parsed;try{parsed=JSON.parse(text)}catch(err){throw new UsageError(`--content-file \u304C JSON \u3068\u3057\u3066\u8AAD\u3081\u307E\u305B\u3093\uFF08${err.message}\uFF09`,SELF_EVALUATE_HELP)}if(!isRecord(parsed))throw new UsageError(
|
|
38
|
+
"--content-file \u306F JSON \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",SELF_EVALUATE_HELP);const problems=[];for(const key of Object.keys(parsed)){if(key!=="skills"&&key!=="skill_up_policy")problems.push(`\u77E5\u3089\u306A\u3044\u30AD\u30FC: ${key}`)}const skills=parsed["skills"];if(!Array.isArray(skills)||skills.length===0){problems.push("skills \u306F1\u4EF6\u4EE5\u4E0A\u306E\u914D\u5217\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044")}else{
|
|
39
|
+
const seen=new Set;skills.forEach((row,index)=>{const at=`skills[${index}]`;if(!isRecord(row)){problems.push(`${at} \u304C\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u306F\u3042\u308A\u307E\u305B\u3093`);return}for(const key of Object.keys(row)){if(!["skill_id","self_level","self_comment"].includes(key))problems.push(`\u77E5\u3089\u306A\u3044\u30AD\u30FC: ${at}.${key}`)}const skillId=row["skill_id"];if(typeof skillId!=="string"||skillId.trim()==="")problems.push(`${at}.skill_id \u304C\u3042\u308A\u307E\u305B\u3093`);else if(seen.
|
|
40
|
+
has(skillId))problems.push(`${at}.skill_id ${skillId} \u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059`);else seen.add(skillId);const level=row["self_level"];if(!(typeof level==="number"&&Number.isInteger(level)&&level>=1&&level<=5)){problems.push(`${at}.self_level \u306F 1\u301C5 \u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08${JSON.stringify(level)}\uFF09`)}const comment=row["self_comment"];if(comment!==void 0&&comment!==null){if(typeof comment!=="string")problems.
|
|
41
|
+
push(`${at}.self_comment \u306F\u6587\u5B57\u5217\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044`);else if([...comment].length>SELF_COMMENT_MAX)problems.push(`${at}.self_comment \u304C ${SELF_COMMENT_MAX} \u6587\u5B57\u3092\u8D85\u3048\u3066\u3044\u307E\u3059`)}})}const policy=parsed["skill_up_policy"];if(policy!==void 0&&policy!==null){if(typeof policy!=="string")problems.push("skill_up_policy \u306F\u6587\u5B57\u5217\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");else if([...policy].
|
|
42
|
+
length>POLICY_MAX)problems.push(`skill_up_policy \u304C ${POLICY_MAX} \u6587\u5B57\u3092\u8D85\u3048\u3066\u3044\u307E\u3059`)}if(problems.length>0){throw new UsageError(`--content-file \u3092\u76F4\u3057\u3066\u304F\u3060\u3055\u3044:
|
|
43
|
+
${problems.join("\n ")}`,SELF_EVALUATE_HELP)}return parsed}function selfEvaluatePlan(input){const content=input.resolved?.["content"];if(content===void 0)throw new Error("\u5185\u90E8\u30A8\u30E9\u30FC: content \u304C\u89E3\u6C7A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\uFF08prepare() \u306E\u914D\u7DDA\u6F0F\u308C\uFF09");return{method:"POST",path:`${PROFILES_PATH}/${profileIdArg(input)}/self-evaluate`,body:JSON.parse(content)}}var selfEvaluateOperation={name:"self-evaluate",summary:"\u81EA\u5206\u306E\u30B9\u30AD\u30EB\
|
|
44
|
+
\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306B\u81EA\u5DF1\u8A55\u4FA1\u3092\u5165\u308C\u3066\u63D0\u51FA\u3059\u308B\uFF08\u53D6\u308A\u6D88\u305B\u306A\u3044\u30FB--yes \u304C\u8981\u308B\uFF09",usage:"twp skill self-evaluate <\u30D7\u30ED\u30D5\u30A1\u30A4\u30EBID> --content-file <JSON> --yes",description:"POST /api/v2/organization/user-skill-profiles/{id}/self-evaluate\u3002\u753B\u9762\u306E\u300C\u81EA\u5DF1\u8A55\u4FA1\u3092\u9001\u4FE1\u300D\u3068\u540C\u3058\u64CD\u4F5C\u3067\u3059\u3002\n\u9001\u4FE1\u3059\u308B\u3068\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306F\u300C\u4E0B\u66F8\u304D\u300D\uFF08draft\uFF09\u304B\u3089\u300C\u81EA\u5DF1\u8A55\u4FA1\u6E08\u307F\u300D\uFF08self_evaluated\uFF09\u3078\u9032\u307F\u3001\u4E0A\u9577\u3078\u901A\u77E5\u304C\u5C4A\u304D\u307E\u3059\u3002\n\u9001\u4FE1\u5F8C\u306F\u81EA\u5206\u3067\u306F\u76F4\u305B\u306A\u3044\u306E\u3067 --yes \u304C\u8981\u308A\u307E\u3059\u3002\u81EA\u5DF1\u8A55\u4FA1\u3067\u304D\u308B\u306E\u306F\u672C\u4EBA\u306E\u30D7\
|
|
45
|
+
\u30ED\u30D5\u30A1\u30A4\u30EB\u304C draft \u306E\u3068\u304D\u3060\u3051\u3067\u3059\u3002\n\u9001\u308B\u524D\u306B\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3092 GET \u3057\u3001\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306B\u7121\u3044\u30B9\u30AD\u30EB\u3092\u6B62\u3081\u3001\u9001\u3089\u306A\u304B\u3063\u305F\u30B9\u30AD\u30EB\u3092 stderr \u306B\u6319\u3052\u307E\u3059\u3002\n\n"+SELF_EVALUATE_HELP,destructive:true,confirmation:"\u9001\u4FE1\u5F8C\u306F\u53D6\u308A\u6D88\u305B\u305A\u3001\u4E0A\u9577\u3078\u901A\u77E5\u304C\u5C4A\u304F\u64CD\u4F5C",
|
|
46
|
+
forbidden:"\u81EA\u5DF1\u8A55\u4FA1\u306F\u672C\u4EBA\u306E\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3067\u3060\u3051\u9001\u308C\u307E\u3059\uFF08\u4ED6\u4EBA\u306E\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306B\u306F\u9001\u308C\u307E\u305B\u3093\uFF09",flags:[{name:"--content-file",summary:"\u81EA\u5DF1\u8A55\u4FA1\u306E JSON \u30D5\u30A1\u30A4\u30EB\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>"}],async prepare(input){profileIdArg(input);const text=await readBody(
|
|
47
|
+
input,{flag:"--content",fileFlag:"--content-file",label:"\u81EA\u5DF1\u8A55\u4FA1\u306E\u5185\u5BB9",maxChars:SELF_EVALUATE_MAX_CHARS,usage:"twp skill self-evaluate <\u30D7\u30ED\u30D5\u30A1\u30A4\u30EBID> --content-file <JSON> --yes"});if(text===void 0)throw new UsageError("--content-file \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",SELF_EVALUATE_HELP);return withResolved(input,{content:JSON.stringify(parseSelfEvaluation(text))})},plan:selfEvaluatePlan,plannedNotes:input=>{const content=JSON.
|
|
48
|
+
parse(input.resolved?.["content"]??'{"skills":[]}');return[`\u3053\u306E\u524D\u306B\u3001\u30B9\u30AD\u30EB\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u3092 GET \u3057\u3066\u9001\u308B ${content.skills.length} \u4EF6\u306E\u30B9\u30AD\u30EB\u304C\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306B\u3042\u308B\u304B\u3092\u78BA\u304B\u3081\u307E\u3059\u3002`,"\u9001\u4FE1\u3059\u308B\u3068\u81EA\u5DF1\u8A55\u4FA1\u6E08\u307F\u306B\u306A\u308A\u3001\u4E0A\u9577\u3078\u901A\u77E5\u304C\u5C4A\u304D\u307E\u3059\uFF08\u81EA\u5206\u3067\u306F\u53D6\u308A\u6D88\u305B\u307E\u305B\u3093\uFF09\u3002"]},
|
|
49
|
+
async execute(input,ctx){const plan=selfEvaluatePlan(input);const profileBody=await ctx.send({method:"GET",path:`${PROFILES_PATH}/${profileIdArg(input)}`});const profile=isRecord(profileBody)?profileBody["user_skill_profile"]:void 0;if(!isRecord(profile)){throw new ApiResponseError("\u30B9\u30AD\u30EB\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306E\u5FDC\u7B54\u306B user_skill_profile \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
|
|
50
|
+
if(profile["status"]!=="draft"){throw new ApiRejectedError(`\u3053\u306E\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306F\u300C${String(profile["status"])}\u300D\u306A\u306E\u3067\u81EA\u5DF1\u8A55\u4FA1\u3067\u304D\u307E\u305B\u3093\uFF08\u81EA\u5DF1\u8A55\u4FA1\u306F draft \u306E\u3068\u304D\u3060\u3051\u3067\u3059\u3002\u73FE\u5728\u306E\u72B6\u614B\u306F twp user skills me \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\uFF09`)}const profileSkillIds=(Array.isArray(profile["skills"])?profile["skills"]:[]).
|
|
51
|
+
filter(isRecord).map(skill=>skill["skill_id"]).filter(id=>typeof id==="string");const sent=(plan.body.skills??[]).map(skill=>String(skill["skill_id"]));const unknown=sent.filter(id=>!profileSkillIds.includes(id));if(unknown.length>0){throw new UsageError(`\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306B\u7121\u3044\u30B9\u30AD\u30EB\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059: ${unknown.join(" / ")}`,`\u3053\u306E\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u306E\u30B9\u30AD\u30EB\u306F ${profileSkillIds.
|
|
52
|
+
join(" / ")||"\uFF08\u306A\u3057\uFF09"} \u3067\u3059\uFF08twp user skills me --output json \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\uFF09`)}const blank=(Array.isArray(profile["skills"])?profile["skills"]:[]).filter(isRecord).filter(skill=>typeof skill["skill_id"]==="string"&&!sent.includes(skill["skill_id"])&&(skill["self_level"]??null)===null).map(skill=>String(skill["skill_id"]));if(blank.length>0){ctx.warn(`\u9001\u3089\u306A\u304B\u3063\u305F\u30B9\u30AD\u30EB\u306F\u81EA\u5DF1\u8A55\u4FA1\u304C\u672A\u5165\u529B\u306E\u307E\u307E\u63D0\u51FA\u3055\u308C\u307E\u3059: ${blank.
|
|
53
|
+
join(" / ")}`)}return ctx.send(plan)},summarize:body=>{const profile=isRecord(body)&&isRecord(body["user_skill_profile"])?body["user_skill_profile"]:{};return{message:isRecord(body)?body["message"]??null:null,id:profile["id"]??null,status:profile["status"]??null,fiscal_year:profile["fiscal_year"]??null}},raw:body=>{if(!isRecord(body)||body["result"]!==true||!isRecord(body["user_skill_profile"])){throw new ApiResponseError("\u81EA\u5DF1\u8A55\u4FA1\u306E\u5FDC\u7B54\u306B user_skill_profile \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
|
|
54
|
+
return body["user_skill_profile"]}};var skillDomain={name:"skill",summary:"\u30B9\u30AD\u30EB\u30DE\u30B9\u30BF\u306E\u4E00\u89A7\u30FB\u30B9\u30AD\u30EB\u30DE\u30C3\u30D7\u30FB\u30B9\u30AD\u30EB\u4FDD\u6709\u8005\u306E\u6A2A\u65AD\u691C\u7D22\u30FB\u81EA\u5DF1\u8A55\u4FA1\u306E\u63D0\u51FA",operations:[listOperation,mapOperation,whoOperation,selfEvaluateOperation]};var QUALIFICATION_COLUMNS=["id","name","abbreviation","category","difficulty","is_recommended","is_active"];var qualificationDomain={
|
|
55
|
+
name:"qualification",summary:"\u8CC7\u683C\u30DE\u30B9\u30BF\u306E\u4E00\u89A7",operations:[{name:"list",summary:"\u8CC7\u683C\u30DE\u30B9\u30BF\u3092\u4E00\u89A7\u3059\u308B",usage:"twp qualification list [--keyword <\u8A9E>] [--recommended] [--category <\u5206\u985E>] [--difficulty <\u96E3\u6613\u5EA6>]",description:"GET /api/v2/organization/qualifications\u3002\u30DA\u30FC\u30B8\u30F3\u30B0\u3092\u6301\u305F\u305A\u3001\u5E38\u306B\u5168\u4EF6\u3092\u8FD4\u3057\u307E\u3059\u3002\n--recommended \u306F\u63A8\u5968\u8CC7\u683C\u3060\u3051\u306B\u7D5E\u308A\u307E\u3059\u3002--category / --difficulty \u306F\u30B5\u30FC\u30D0\u306E\u5024\u3092\u305D\u306E\u307E\u307E\u6E21\u3057\u307E\u3059\n\uFF08\u4F8B: --category technical / --difficulty C\uFF09\u3002\u5024\u306E\u4E00\u89A7\u306F \
|
|
56
|
+
--output json \u306E category / difficulty \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002\n\u30E6\u30FC\u30B6\u30FC\u3054\u3068\u306E\u4FDD\u6709\u8CC7\u683C\u306F twp user qualifications <\u30E6\u30FC\u30B6\u30FC> \u3067\u3059\u3002",flags:[{name:"--keyword",summary:"\u8CC7\u683C\u540D\u306E\u90E8\u5206\u4E00\u81F4\u3067\u7D5E\u308A\u8FBC\u3080",takesValue:true,placeholder:"<\u8A9E>"},{name:"--recommended",summary:"\u63A8\u5968\u8CC7\u683C\u3060\u3051\u3092\u51FA\u3059",takesValue:false},{name:"\
|
|
57
|
+
--category",summary:"\u5206\u985E\u3067\u7D5E\u308A\u8FBC\u3080\uFF08\u30B5\u30FC\u30D0\u306E\u5024\u30FB\u4F8B: technical\uFF09",takesValue:true,placeholder:"<\u5206\u985E>"},{name:"--difficulty",summary:"\u96E3\u6613\u5EA6\u3067\u7D5E\u308A\u8FBC\u3080\uFF08\u30B5\u30FC\u30D0\u306E\u5024\u30FB\u4F8B: C\uFF09",takesValue:true,placeholder:"<\u96E3\u6613\u5EA6>"}],plan(input){noArgs(input,"twp qualification list help");return{method:"GET",path:QUALIFICATIONS_PATH,query:{keyword:nonEmpty(input.flags,
|
|
58
|
+
"--keyword"),is_recommended:input.flags.has("--recommended")?"true":void 0,category:nonEmpty(input.flags,"--category"),difficulty:nonEmpty(input.flags,"--difficulty")}}},summarize:body=>qualificationRows(body).map(row=>pick(row,QUALIFICATION_COLUMNS)),raw:body=>qualificationRows(body)}]};export{groupedSkillRows,skillMatrix,skillNames,FISCAL_YEAR_FLAG,fiscalYear,matchSkill,parseSelfEvaluation,skillDomain,qualificationDomain};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{isTrustworthyCacheFile,writePrivateFileAtomic}from"./chunk-D233KKXW.js";import{AuthSession,loadCredentials,withFileLock}from"./chunk-XNLIEUAW.js";import{
|
|
3
|
+
import{isTrustworthyCacheFile,writePrivateFileAtomic}from"./chunk-D233KKXW.js";import{AuthSession,loadCredentials,withFileLock}from"./chunk-XNLIEUAW.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import{parseVersionCore}from"./chunk-DXXFUNYN.js";import{effectiveApiUrl,effectiveRelayUrl,resolveConfiguredModel,resolveProfile}from"./chunk-4VZKNEVN.js";import{ensureTwpHome,twpHomeDir}from"./chunk-RZVI6PMW.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";var MAX_EVENT_BYTES=8*1024*1024;var SseBufferOverflowError=class extends Error{constructor(limit){super(`SSE \u306E\u30A4\u30D9\u30F3\u30C8\u5883\u754C\uFF08\u7A7A\u884C\uFF09\u304C ${limit} \u30D0\u30A4\u30C8\u4EE5\u5185\u306B\u73FE\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u4E0A\u6D41\u306E\u5FDC\u7B54\u304C\u58CA\u308C\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002`)}};var SseParser=class{constructor(maxEventBytes=MAX_EVENT_BYTES){this.maxEventBytes=maxEventBytes}maxEventBytes;buffer="";pendingCr=false;push(chunk){
|
|
4
4
|
let pending=this.pendingCr?`\r${chunk}`:chunk;this.pendingCr=pending.endsWith("\r");if(this.pendingCr)pending=pending.slice(0,-1);this.buffer+=pending.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(this.buffer.length>this.maxEventBytes){this.buffer="";this.pendingCr=false;throw new SseBufferOverflowError(this.maxEventBytes)}const events=[];for(;;){const boundary=this.buffer.indexOf("\n\n");if(boundary===-1)break;const block=this.buffer.slice(0,boundary);this.buffer=this.buffer.slice(boundary+2);const parsed=parseBlock(
|
|
5
5
|
block);if(parsed)events.push(parsed)}return events}flush(){const rest=(this.pendingCr?`${this.buffer}
|
|
6
6
|
`:this.buffer).trim();this.buffer="";this.pendingCr=false;if(rest==="")return[];const parsed=parseBlock(rest);return parsed?[parsed]:[]}};function parseBlock(block){let event="message";const data=[];for(const line of block.split("\n")){if(line.startsWith(":"))continue;const colon=line.indexOf(":");const field=colon===-1?line:line.slice(0,colon);let value=colon===-1?"":line.slice(colon+1);if(value.startsWith(" "))value=value.slice(1);if(field==="event")event=value;else if(field==="data")data.push(
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
+
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
+
var DOMAIN_NAMES=["agent","agent-loop","ai-review-reason","analysis","announcement","attendance","backlog","budget","business-place","company","contract","customer","department","deposit","estimate","evaluation","expense","goal-sheet","inquiry","invoice","job-title","leave","media","meeting","note","notification","onedrive","outlook","payee","position","project","prospect","purchase","qualification","receivable","report","rounding-setting","seal-impression","shift","skill","storage","supplier-pa\
|
|
4
|
+
yment","support","task","teams","user","wiki","workchange","worker-agent","workflow"];function isDomainName(value){return value!==void 0&&DOMAIN_NAMES.includes(value)}var HELP_TOKEN="help";var API_TOKEN="api";export{DOMAIN_NAMES,isDomainName,HELP_TOKEN,API_TOKEN};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{FORCE_FLAG,OUT_FLAG,REV_FLAG,revOf,singleId,uploadStaged}from"./chunk-
|
|
3
|
+
import{FORCE_FLAG,OUT_FLAG,REV_FLAG,revOf,singleId,uploadStaged}from"./chunk-74WGU5BM.js";import{CUSTOMER_LICENSE,childForbidden,levelForbidden}from"./chunk-2NP3BLPI.js";import{inspectLocalFile}from"./chunk-VOMCTG6N.js";import{createFlags,fieldBody,hasAnyField,updateFlags}from"./chunk-MKQDUQQ2.js";import{nonEmpty}from"./chunk-MI6HVYR2.js";import{SALES_ESTIMATES_PATH,isExactNumericId}from"./chunk-FEJDU42E.js";import{requireResolved,withResolved}from"./chunk-PS5QFKHB.js";
|
|
4
4
|
import{acknowledgement,isRecord,pick}from"./chunk-3ZRMMBP5.js";import{ApiResponseError,UsageError}from"./chunk-VFPY2A23.js";import fs from"fs";import path from"path";var DOCUMENT_TYPES=["order_form","individual_contract","other"];var DOCUMENT_TYPE_HELP="order_form\uFF1D\u6CE8\u6587\u66F8 / individual_contract\uFF1D\u500B\u5225\u5951\u7D04\u66F8 / other\uFF1D\u305D\u306E\u4ED6\u6848\u4EF6\u66F8\u985E";var MAGIC_BYTES={pdf:["%PDF-"],jpg:["\xFF\xD8\xFF"],jpeg:["\xFF\xD8\xFF"],png:["\x89PNG\r\n\n"],xlsx:["PK","PK","PK\x07\b"],docx:["PK","PK","PK\x07\b"],xls:["\xD0\xCF\xE0\xA1\xB1\xE1"],doc:["\xD0\xCF\xE0\xA1\xB1\xE1"]};var FILE_NAME_MAX_CHARS=255;var FIELDS=[
|
|
5
5
|
{kind:"text",flag:"--name",key:"document_name",label:"\u66F8\u985E\u540D",maxChars:255,summary:"\u66F8\u985E\u540D\uFF08create \u3067\u306F\u5FC5\u9808\uFF09"},{kind:"enum",flag:"--type",key:"document_type",values:DOCUMENT_TYPES,summary:`\u66F8\u985E\u7A2E\u5225\uFF08${DOCUMENT_TYPE_HELP}\u30FBcreate \u3067\u306F\u5FC5\u9808\uFF09`}];var COLUMNS=["document_id","estimate_id","document_type","document_type_label","document_name","current_version","updated_by_name","updated_at"];var VERSION_COLUMNS=[
|
|
6
6
|
"version_number","file_name","file_size","is_current","created_by_name","created_at"];var ESTIMATE_FLAG={name:"--estimate",summary:"\u898B\u7A4D\u306E ID\uFF08twp estimate list \u306E id \u5217\u306E\u6570\u5B57\u30FB\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<\u898B\u7A4DID>"};var FILE_FLAG={name:"--file",summary:"\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3059\u308B\u30D5\u30A1\u30A4\u30EB\uFF08PDF\u30FBJPEG\u30FBPNG\u30FBWord\u30FBExcel\u3002\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<\
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{CUSTOMER_FLAG,CUSTOMER_LICENSE,childForbidden,levelForbidden,prepareCustomerFlag}from"./chunk-
|
|
4
|
-
import{
|
|
3
|
+
import{CUSTOMER_FLAG,CUSTOMER_LICENSE,childForbidden,levelForbidden,prepareCustomerFlag}from"./chunk-2NP3BLPI.js";import{inspectLocalFile}from"./chunk-VOMCTG6N.js";import{checkUploadQuota}from"./chunk-V64CGX7V.js";import{createFlags,fieldBody,hasAnyField,updateFlags}from"./chunk-MKQDUQQ2.js";import{booleanText}from"./chunk-OTIR4GES.js";import{nonEmpty}from"./chunk-MI6HVYR2.js";import{CUSTOMERS_PATH,isExactNumericId}from"./chunk-FEJDU42E.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";
|
|
4
|
+
import{ApiError}from"./chunk-JA5A6UJ2.js";import{requireResolved,withResolved}from"./chunk-PS5QFKHB.js";import{acknowledgement,isRecord,pick}from"./chunk-3ZRMMBP5.js";import{ApiResponseError,UsageError}from"./chunk-VFPY2A23.js";import{NotLoggedInError,SessionExpiredError}from"./chunk-XNLIEUAW.js";import fs from"fs";import path from"path";var CONTRACT_TYPES=["basic_contract","nda","other"];var CONTRACT_TYPE_HELP="basic_contract\uFF1D\u57FA\u672C\u5951\u7D04\u66F8 / nda\uFF1D\u6A5F\u5BC6\u4FDD\u6301\u5951\u7D04\u66F8 / other\uFF1D\u305D\u306E\u4ED6\u5951\u7D04\u66F8\u985E";var FILE_NAME_MAX_CHARS=255;var PDF_MAGIC="%PDF-";var CONTRACT_FIELDS=[{kind:"text",flag:"--name",key:"document_name",label:"\u66F8\u985E\u540D",maxChars:255,summary:"\u66F8\u985E\u540D\uFF08create \u3067\u306F\u5FC5\u9808\uFF09"},{kind:"enum",flag:"--type",key:"\
|
|
5
5
|
document_type",values:CONTRACT_TYPES,summary:`\u66F8\u985E\u7A2E\u5225\uFF08${CONTRACT_TYPE_HELP}\u30FBcreate \u3067\u306F\u5FC5\u9808\uFF09`}];var CONTRACT_COLUMNS=["document_id","company_id","document_type","document_name","current_version","updated_by_name","updated_at"];var VERSION_COLUMNS=["version_number","file_name","file_size","is_current","created_by_name","created_at"];var CASE_COLUMNS=["document_id","document_type_label","document_name","estimate_no","estimate_title","project_name","c\
|
|
6
6
|
urrent_version","updated_at"];var FILE_FLAG={name:"--file",summary:"\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3059\u308B PDF \u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\uFF08\u5FC5\u9808\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9.pdf>"};var OUT_FLAG={name:"--out",summary:"\u66F8\u304D\u51FA\u3057\u5148\u306E\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9\uFF08\u5FC5\u9808\u3002\u6A19\u6E96\u51FA\u529B\u3078\u306F\u51FA\u3057\u307E\u305B\u3093\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>"};var FORCE_FLAG={
|
|
7
7
|
name:"--force",summary:"\u66F8\u304D\u51FA\u3057\u5148\u304C\u65E2\u306B\u3042\u308C\u3070\u4E0A\u66F8\u304D\u3059\u308B\uFF08\u65E2\u5B9A\u3067\u306F\u4E0A\u66F8\u304D\u3057\u306A\u3044\uFF09",takesValue:false};var REV_FLAG={name:"--rev",summary:"\u53D6\u308A\u51FA\u3059\u7248\u306E\u756A\u53F7\uFF08\u7701\u7565\u6642\u306F\u73FE\u884C\u7248\u3002get \u306E versions \u306E version_number\uFF09",takesValue:true,placeholder:"<\u7248\u756A\u53F7>"};var CONTRACT_REF_HELP="--customer\uFF08\u9867\u5BA2\uFF09\u304C\u5FC5\u9808\u3067\u3059\u3002<\u66F8\u985EID>\
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{CommandModelMissingError,MAX_REPORTED_VIOLATIONS,loadCommandModelDomain,loadCommandModelIndex,validateBody,validateQuery}from"./chunk-NZ7WI4RZ.js";import{redactSecretValues,redactSecrets}from"./chunk-AUAZP2G7.js";import{
|
|
4
|
-
import{
|
|
3
|
+
import{CommandModelMissingError,MAX_REPORTED_VIOLATIONS,loadCommandModelDomain,loadCommandModelIndex,validateBody,validateQuery}from"./chunk-NZ7WI4RZ.js";import{redactSecretValues,redactSecrets}from"./chunk-AUAZP2G7.js";import{isForceOnly,killProcessTree,system32}from"./chunk-N2UVRM3Z.js";import{isSafePathSegment}from"./chunk-GMBJTG6A.js";import{ApiError,TwpApiClient,appendQuery}from"./chunk-JA5A6UJ2.js";import{DEFAULT_MAX_TOKENS,emptyUsage}from"./chunk-5WTFZJT7.js";
|
|
4
|
+
import{isPrivateTwpHome,isTrustworthyCacheFile,writePrivateFileAtomic}from"./chunk-D233KKXW.js";import{findExecutable,isWindowsDriveAbsolute}from"./chunk-PMOUHEJQ.js";import{AuthSession,NotLoggedInError,SessionExpiredError,withFileLock}from"./chunk-XNLIEUAW.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import{configReadDirs,ensureTwpHome,twpHomeDir}from"./chunk-RZVI6PMW.js";import{MODES,applyPermissionMode,checkPermission,isModeId,setActiveModes}from"./chunk-NAUH75MM.js";
|
|
5
|
+
import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import fs2 from"fs";import path3 from"path";import os2 from"os";import{realpathSync}from"fs";import{homedir}from"os";import{dirname,isAbsolute,relative,resolve,sep}from"path";var PathDeniedError=class extends Error{constructor(message){super(message);this.name="PathDeniedError"}};function resolveToolPath(input,cwd,home=homedir()){if(typeof input!=="string"||input.trim()===""){throw new PathDeniedError("path must be a non-empty string")}const expanded=expandHome(input,home);const abs=isAbsolute(expanded)?resolve(expanded):resolve(cwd,expanded);const root=realOrSelf(resolve(cwd));assertInside(abs,resolve(cwd),abs);assertNotSecret(abs,home);const real=realOrSelf(abs);if(real!==
|
|
5
6
|
abs){assertInside(real,root,abs);assertNotSecret(real,home)}return abs}function realToolPath(input,cwd,home=homedir()){return realOrSelf(resolveToolPath(input,cwd,home))}function assertInside(target,root,reported){const rel=relative(root,target);const outside=rel===".."||rel.startsWith(`..${sep}`)||isAbsolute(rel);if(outside){throw new PathDeniedError(`path escapes the working directory (${reported}). Only paths under ${root} can be accessed.`)}}function realOrSelf(target){let current=target;const rest=[];
|
|
6
7
|
for(;;){try{const real=realpathSync(current);return rest.length===0?real:resolve(real,...rest.reverse())}catch{const parent=dirname(current);if(parent===current)return target;rest.push(current.slice(parent.length+1));current=parent}}}function assertNotSecret(absPath,home=homedir(),env=process.env){const reason=secretReason(absPath,home,env);if(reason!==null)throw new PathDeniedError(`refusing to access ${absPath}: ${reason}`)}function secretReason(absPath,_home=homedir(),env=process.env){const lower=absPath.
|
|
7
8
|
toLowerCase();const segments=lower.split(sep);const base=segments[segments.length-1]??"";const parent=segments[segments.length-2]??"";if(base===".env"||base.startsWith(".env."))return".env files are denied (design \xA77)";if(segments.includes(".ssh"))return"SSH key material is denied (design \xA77)";if(parent===".git"&&base==="config"){return".git/config is denied (it can hold a GitHub token in the remote URL)"}if(base===".netrc"||base==="_netrc"||base===".npmrc")return"credential files are deni\
|