@tocca-systems/twp-cli 0.12.0 → 0.14.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.
@@ -1,6 +1,6 @@
1
1
  import { createRequire as __twpCreateRequire } from 'node:module';
2
2
  const require = __twpCreateRequire(import.meta.url);
3
- import{PRIVATE_PROJECT_REF,isPrivateProjectRef}from"./chunk-GY7KI5E5.js";import{charCount,readBody}from"./chunk-QVXZEUKN.js";import{acknowledgement,isRecord,pick,requireResolved,singleRef,withResolved}from"./chunk-GFC2ASHE.js";import{repeatedValues}from"./chunk-O52CUEDO.js";import"./chunk-QQRJLH6B.js";import{PRIVATE_TASKS_PATH}from"./chunk-MZHTRHZS.js";import"./chunk-JKSXUBND.js";import{PRIVATE_TASK_KEY_PREFIX,isPrivateTaskKey,isTaskKey}from"./chunk-II5RVJQN.js";
3
+ import{PRIVATE_PROJECT_REF,isPrivateProjectRef}from"./chunk-GY7KI5E5.js";import{charCount,readBody}from"./chunk-QVXZEUKN.js";import{acknowledgement,isRecord,pick,requireResolved,singleRef,withResolved}from"./chunk-GFC2ASHE.js";import{repeatedValues}from"./chunk-O52CUEDO.js";import"./chunk-QQRJLH6B.js";import{PRIVATE_TASKS_PATH,TASK_MASTERS}from"./chunk-V4VHRASG.js";import"./chunk-JKSXUBND.js";import{PRIVATE_TASK_KEY_PREFIX,isPrivateTaskKey,isTaskKey}from"./chunk-II5RVJQN.js";
4
4
  import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-2SGDY6YP.js";import{ApiResponseError,UsageError}from"./chunk-M3GWY6NT.js";import{isSafePathSegment,safeProjectIdPolicy}from"./chunk-5QCAIKFE.js";import"./chunk-NERYSBA4.js";import"./chunk-RZVI6PMW.js";import"./chunk-J7QYPKVK.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";function classifyTaskRef(ref){const value=ref.trim();if(safeProjectIdPolicy.isDirectId(value))return{kind:"id",value};if(isTaskKey(value))return{kind:"key",value};return{kind:"unknown",value}}function wantsPrivateSurface(input){const project=input.flags.get("--project");return project!==void 0&&isPrivateProjectRef(project)}function taskSurface(input,ref){const project=input.flags.get("--project");const{kind,value}=classifyTaskRef(ref);if(project!==void 0&&isPrivateProjectRef(project)){if(kind===
5
5
  "key"&&!isPrivateTaskKey(value)){throw new UsageError(`--project ${PRIVATE_PROJECT_REF}\uFF08\u500B\u4EBA\u30BF\u30B9\u30AF\uFF09\u306B ${value} \u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,`\u500B\u4EBA\u30BF\u30B9\u30AF\u306E\u30AD\u30FC\u306F ${PRIVATE_TASK_KEY_PREFIX}-<\u756A\u53F7> \u306E\u5F62\u3067\u3059\u3002ID\uFF08UUID / ULID\uFF09\u3067\u3082\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002
6
6
  \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30BF\u30B9\u30AF\u3092\u6307\u3059\u306A\u3089 --project ${PRIVATE_PROJECT_REF} \u3092\u5916\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return"private"}if(kind==="key"&&isPrivateTaskKey(value)&&project===void 0){throw new UsageError(`${value} \u306F\u500B\u4EBA\u30BF\u30B9\u30AF\u306E\u30AD\u30FC\u306B\u3082\u3001\u30B3\u30FC\u30C9 ${PRIVATE_TASK_KEY_PREFIX} \u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30BF\u30B9\u30AF\u30AD\u30FC\u306B\u3082\u8AAD\u3081\u307E\u3059`,
@@ -86,29 +86,61 @@ const contentHtml=await readContentHtml(input,usage);const attachments=attachmen
86
86
  requireResolved(input,"commentId"))}`,body:commentBody(input)}),summarize:body=>pick(commentObject(body),WRITE_COLUMNS),raw:commentObject},{name:"delete",summary:"\u30B3\u30E1\u30F3\u30C8\u3092\u524A\u9664\u3059\u308B",usage:"twp task comment delete <\u30B3\u30E1\u30F3\u30C8ID> --task <\u30AD\u30FC|ID> --yes",description:`${COMMENT_REF_HELP}
87
87
 
88
88
  \u524A\u9664\u306F\u53D6\u308A\u6D88\u305B\u307E\u305B\u3093\u3002`,destructive:true,flags:[COMMENT_REF_FLAG,TASK_REF_FLAG,PROJECT_FLAG],prepare:(input,ctx)=>prepareCommentTarget(input,ctx,"twp task comment delete help"),plan:input=>({method:"DELETE",path:`${commentPath(input)}/${encodeURIComponent(requireResolved(input,"commentId"))}`}),summarize:body=>acknowledgement(body,"\u30B3\u30E1\u30F3\u30C8\u524A\u9664"),raw:body=>acknowledgement(body,"\u30B3\u30E1\u30F3\u30C8\u524A\u9664")}]};async function requireContent(input,usage){
89
- const content=await readBody(input,{flag:"--body",fileFlag:"--body-file",label:"\u30B3\u30E1\u30F3\u30C8\u672C\u6587",maxChars:CONTENT_MAX_CHARS,usage});if(content===void 0){throw new UsageError("\u30B3\u30E1\u30F3\u30C8\u672C\u6587\u3092 --body-file <\u30D1\u30B9> \u304B --body <\u6587\u5B57\u5217> \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",usage)}return content}var ISO_DATE_RE=/^\d{4}-\d{2}-\d{2}$/;function isoDate(input,flag){const raw=input.flags.get(flag);if(raw===void 0)return void 0;const value=raw.trim();if(!ISO_DATE_RE.test(value)){throw new UsageError(`${flag} \u306F YYYY-MM-DD \u306E\u5F62\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${raw}`,"\u4F8B: 2026-09-30")}const[y,m,d]=value.split("-").map(Number);const probe=new Date(Date.UTC(y,m-1,d));if(probe.getUTCFullYear()!==y||probe.getUTCMonth()+1!==m||probe.getUTCDate()!==d){throw new UsageError(
89
+ const content=await readBody(input,{flag:"--body",fileFlag:"--body-file",label:"\u30B3\u30E1\u30F3\u30C8\u672C\u6587",maxChars:CONTENT_MAX_CHARS,usage});if(content===void 0){throw new UsageError("\u30B3\u30E1\u30F3\u30C8\u672C\u6587\u3092 --body-file <\u30D1\u30B9> \u304B --body <\u6587\u5B57\u5217> \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",usage)}return content}var PRIVATE_UNSUPPORTED=[{flag:"--assignee",clearToken:"assignee",reason:"\u500B\u4EBA\u30BF\u30B9\u30AF\u306F\u5E38\u306B\u81EA\u5206\u306E\u3082\u306E\u306A\u306E\u3067\u3001\u30B5\u30FC\u30D0\u5074\u306B\u62C5\u5F53\u8005\u3092\u6307\u5B9A\u30FB\u7D5E\u308A\u8FBC\u307F\u3059\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093\u3002"},{flag:"--milestone",clearToken:"milestone",reason:"\u500B\u4EBA\u30BF\u30B9\u30AF\u306B\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u306E\u9805\u76EE\u304C\u30B5\u30FC\u30D0\u5074\u306B\u3042\u308A\u307E\u305B\u3093\u3002"}];
90
+ function rejectPrivateUnsupportedFlags(input){const clearTokens=new Set(repeatedValues(input,"--clear").map(token=>token.trim()));for(const entry of PRIVATE_UNSUPPORTED){if(input.flags.has(entry.flag)){throw new UsageError(`--project ${PRIVATE_PROJECT_REF}\uFF08\u500B\u4EBA\u30BF\u30B9\u30AF\uFF09\u3067\u306F ${entry.flag} \u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,`${entry.reason}${entry.flag} \u3092\u5916\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}if(clearTokens.has(entry.clearToken)){
91
+ throw new UsageError(`--project ${PRIVATE_PROJECT_REF}\uFF08\u500B\u4EBA\u30BF\u30B9\u30AF\uFF09\u3067\u306F --clear ${entry.clearToken} \u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,`${entry.reason}\u9001\u3063\u3066\u3082\u4F55\u3082\u8D77\u304D\u306A\u3044\u305F\u3081\u3001--clear ${entry.clearToken} \u3092\u5916\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}}}function privateTaskRef(ref){const{kind,value}=classifyTaskRef(ref);if(kind==="unknown"){throw new UsageError(`\u30BF\u30B9\u30AF\u306E\u6307\u5B9A\u304C\u300C\u500B\u4EBA\u30BF\u30B9\u30AF\u306E\u30AD\u30FC\uFF08\u4F8B PR\
92
+ IVATE-22361\uFF09\u300D\u306B\u3082\u300CID\uFF08UUID / ULID\uFF09\u300D\u306B\u3082\u898B\u3048\u307E\u305B\u3093: ${ref}`,`\u500B\u4EBA\u30BF\u30B9\u30AF\u306E\u4E00\u89A7\u306F twp task list --project ${PRIVATE_PROJECT_REF} \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002`)}return{kind,value}}async function resolvePrivateTaskId(ctx,ref){const{kind,value}=privateTaskRef(ref);if(kind==="id")return value;const task=await ctx.resolver.privateTask(value);const id=task["id"];if(!isSafePathSegment(id)){
93
+ throw new ApiResponseError(`\u500B\u4EBA\u30BF\u30B9\u30AF\u306E\u5FDC\u7B54\u306E task.id \u3092\u305D\u306E\u307E\u307E\u4F7F\u3048\u307E\u305B\u3093\uFF08${String(id).slice(0,60)}\uFF09\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return id}async function resolvePrivateStatusAndType(input,ctx,options){const out={};const status=nonEmpty(input.flags,"--status");if(status!==void 0){out["status_id"]=(await ctx.resolver.privateStatus(status)).id}else if(options.
94
+ useDefaults){const ref=await ctx.resolver.privateDefaultStatus();out["status_id"]=ref.id;out["status_defaulted"]=ref.name}const type=nonEmpty(input.flags,"--type");if(type!==void 0){out["type_id"]=(await ctx.resolver.privateTaskType(type)).id}else if(options.useDefaults){const ref=await ctx.resolver.privateDefaultTaskType();out["type_id"]=ref.id;out["type_defaulted"]=ref.name}return out}async function resolvePrivateExtras(input,ctx){const out={};const category=nonEmpty(input.flags,"--category");
95
+ if(category!==void 0){out["category_id"]=(await ctx.resolver.privateTaskMaster("categories",category,"--category","\u30AB\u30C6\u30B4\u30EA")).id}const labels=repeatedValues(input,"--label");if(labels.length>0){const ids=[];for(const ref of labels){const label=await ctx.resolver.privateTaskMaster("labels",ref,"--label","\u30E9\u30D9\u30EB");if(!ids.includes(label.id))ids.push(label.id)}out["label_ids"]=JSON.stringify(ids)}return out}var SPECS=[{kind:"status",resource:"status",summary:"\u30BF\u30B9\u30AF\u306E\u30B9\u30C6\u30FC\u30BF\u30B9\uFF08--status \u306B\u6E21\u305B\u308B\u5024\uFF09\u3092\u4E00\u89A7\u3059\u308B",columns:["id","name","code","is_default","is_completed","sort_order"],privateEnvelope:"statuses"},{kind:"type",resource:"type",summary:"\u30BF\u30B9\u30AF\u306E\u7A2E\u5225\uFF08--type \u306B\u6E21\u305B\u308B\u5024\uFF09\u3092\u4E00\u89A7\u3059\u308B",columns:["id","name","code","is_default","sort_order"],privateEnvelope:"\
96
+ types"},{kind:"category",resource:"category",summary:"\u30BF\u30B9\u30AF\u306E\u30AB\u30C6\u30B4\u30EA\u3092\u4E00\u89A7\u3059\u308B",columns:["id","name","color","sort_order"],privateEnvelope:"categories"},{kind:"milestone",resource:"milestone",summary:"\u30BF\u30B9\u30AF\u306E\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\u3092\u4E00\u89A7\u3059\u308B",columns:["id","name","due_date","is_completed","sort_order"]},{kind:"label",resource:"label",summary:"\u30BF\u30B9\u30AF\u306E\u30E9\u30D9\u30EB\u3092\u4E00\u89A7\u3059\u308B",
97
+ columns:["id","name","color"],privateEnvelope:"labels"}];var PRIVATE_SURFACE="private";function isPrivatePlan(input){return input.resolved?.["surface"]===PRIVATE_SURFACE}function rows(body){if(!Array.isArray(body)){throw new Error(`\u30BF\u30B9\u30AF\u30DE\u30B9\u30BF\u4E00\u89A7\u306E\u5185\u90E8\u8868\u73FE\u304C\u914D\u5217\u3067\u306F\u3042\u308A\u307E\u305B\u3093: ${typeof body}`)}return body}function masterResource(spec){const master=TASK_MASTERS[spec.kind];const privateHelp=spec.privateEnvelope===
98
+ void 0?`\u500B\u4EBA\u30BF\u30B9\u30AF\uFF08--project ${PRIVATE_PROJECT_REF}\uFF09\u306B${master.label}\u306F\u3042\u308A\u307E\u305B\u3093\u3002`:`\u500B\u4EBA\u30BF\u30B9\u30AF\u306F --project ${PRIVATE_PROJECT_REF} \u3067\u4E00\u89A7\u3067\u304D\u307E\u3059\u3002`;return{name:spec.resource,summary:spec.summary,operations:[{name:"list",summary:spec.summary,usage:`twp task ${spec.resource} list [--project <\u30B3\u30FC\u30C9|ID>]`,description:`name \u5217\u306E\u5024\u306F twp task list / create / update \u306E\u30D5\u30E9\u30B0\u3078\u305D\u306E\u307E\u307E\
99
+ \u6E21\u305B\u307E\u3059\uFF08ID \u3067\u3082\u6E21\u305B\u307E\u3059\uFF09\u3002
100
+ --output json \u306F API \u304C\u8FD4\u3059\u5168\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002
101
+ \u7D50\u679C\u306F\u540D\u524D\u89E3\u6C7A\u3068\u540C\u3058\u30AD\u30E3\u30C3\u30B7\u30E5\uFF08\u65E2\u5B9A 10 \u5206\uFF09\u304B\u3089\u8FD4\u308B\u305F\u3081\u3001\u7D9A\u3051\u3066\u6253\u3064\u30B3\u30DE\u30F3\u30C9\u3067\u5F80\u5FA9\u306F\u5897\u3048\u307E\u305B\u3093\u3002
102
+ \u6700\u65B0\u3092\u53D6\u308A\u76F4\u3059\u3068\u304D\u306F --refresh \u3092\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u3002
103
+ ${privateHelp}`,flags:[PROJECT_FLAG],async prepare(input,ctx){if(input.args.length>0){throw new UsageError(`list \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,`\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306F --project <\u30B3\u30FC\u30C9|ID> \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}if(wantsPrivateSurface(input)){if(spec.privateEnvelope===void 0){throw new UsageError(`--project ${PRIVATE_PROJECT_REF}\uFF08\u500B\u4EBA\u30BF\u30B9\u30AF\uFF09\u306B${master.
104
+ label}\u306F\u3042\u308A\u307E\u305B\u3093`,`\u500B\u4EBA\u30BF\u30B9\u30AF\u306E\u30DE\u30B9\u30BF\u306F\u30B9\u30C6\u30FC\u30BF\u30B9\u30FB\u7A2E\u5225\u30FB\u30AB\u30C6\u30B4\u30EA\u30FB\u30E9\u30D9\u30EB\u3060\u3051\u3067\u3059\u3002`)}return withResolved(input,{surface:PRIVATE_SURFACE})}return withResolved(input,{projectId:await ctx.projectId(input.flags.get("--project"))})},plan(input){if(isPrivatePlan(input))return{method:"GET",path:`${PRIVATE_TASKS_PATH}/masters`};return{method:"GET",path:`\
105
+ /api/v2/projects/${encodeURIComponent(requireResolved(input,"projectId"))}/${master.path}`}},async fetchCached(input,ctx){if(isPrivatePlan(input)){return ctx.resolver.privateMasterRows(spec.privateEnvelope,master.label)}return ctx.resolver.taskMasterRows(spec.kind,requireResolved(input,"projectId"))},summarize:body=>rows(body).map(row=>pick(row,spec.columns)),raw:body=>rows(body),notes:body=>rows(body).length===0?[`${master.label}\u306F1\u4EF6\u3082\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u305B\u3093\uFF08--refresh \u3067\u53D6\u308A\u76F4\u305B\u307E\u3059\uFF09\u3002`]:
106
+ []}]}}var taskMasterResources=SPECS.map(masterResource);var ISO_DATE_RE=/^\d{4}-\d{2}-\d{2}$/;function isoDate(input,flag){const raw=input.flags.get(flag);if(raw===void 0)return void 0;const value=raw.trim();if(!ISO_DATE_RE.test(value)){throw new UsageError(`${flag} \u306F YYYY-MM-DD \u306E\u5F62\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${raw}`,"\u4F8B: 2026-09-30")}const[y,m,d]=value.split("-").map(Number);const probe=new Date(Date.UTC(y,m-1,d));if(probe.getUTCFullYear()!==y||probe.getUTCMonth()+1!==m||probe.getUTCDate()!==d){throw new UsageError(
90
107
  `${flag} \u306B\u5B58\u5728\u3057\u306A\u3044\u65E5\u4ED8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059: ${raw}`,"\u4F8B: 2026-09-30")}return value}function priority(input,flag="--priority"){const raw=input.flags.get(flag);if(raw===void 0)return void 0;const trimmed=raw.trim();const value=/^\d+$/.test(trimmed)?Number(trimmed):Number.NaN;if(!Number.isInteger(value)||value<1||value>3){throw new UsageError(`${flag} \u306F 1 / 2 / 3 \u306E\u3044\u305A\u308C\u304B\u3067\u3059: ${raw}`,"1: \u9AD8 \uFF0F\
91
- 2: \u4E2D \uFF0F 3: \u4F4E")}return value}function boundedText(input,flag,options){const raw=input.flags.get(flag);if(raw===void 0)return void 0;if(raw.trim()===""){throw new UsageError(`${flag} \u306B\u7A7A\u306E\u5024\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,`${options.label}\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}const count=[...raw].length;if(count>options.maxChars){throw new UsageError(`${options.label}\u304C\u9577\u3059\u304E\u307E\u3059\uFF08${count} \u6587\u5B57\u30FB\u4E0A\u9650 ${options.
92
- maxChars} \u6587\u5B57\uFF09`,`${flag} \u3092 ${options.maxChars} \u6587\u5B57\u4EE5\u5185\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return raw}function rejectPrivateUnsupportedFlags(input){if(!input.flags.has("--assignee"))return;throw new UsageError(`--project ${PRIVATE_PROJECT_REF}\uFF08\u500B\u4EBA\u30BF\u30B9\u30AF\uFF09\u3067\u306F --assignee \u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,"\u500B\u4EBA\u30BF\u30B9\u30AF\u306F\u5E38\u306B\u81EA\u5206\u306E\u3082\u306E\u306A\u306E\u3067\u3001\u30B5\u30FC\u30D0\u5074\u306B\u62C5\u5F53\u8005\u3092\u6307\u5B9A\u30FB\u7D5E\u308A\u8FBC\u307F\u3059\u308B\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093\u3002--assignee \u3092\u5916\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
93
- function privateTaskRef(ref){const{kind,value}=classifyTaskRef(ref);if(kind==="unknown"){throw new UsageError(`\u30BF\u30B9\u30AF\u306E\u6307\u5B9A\u304C\u300C\u500B\u4EBA\u30BF\u30B9\u30AF\u306E\u30AD\u30FC\uFF08\u4F8B PRIVATE-22361\uFF09\u300D\u306B\u3082\u300CID\uFF08UUID / ULID\uFF09\u300D\u306B\u3082\u898B\u3048\u307E\u305B\u3093: ${ref}`,`\u500B\u4EBA\u30BF\u30B9\u30AF\u306E\u4E00\u89A7\u306F twp task list --project ${PRIVATE_PROJECT_REF} \u3067\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002`)}
94
- return{kind,value}}async function resolvePrivateTaskId(ctx,ref){const{kind,value}=privateTaskRef(ref);if(kind==="id")return value;const task=await ctx.resolver.privateTask(value);const id=task["id"];if(!isSafePathSegment(id)){throw new ApiResponseError(`\u500B\u4EBA\u30BF\u30B9\u30AF\u306E\u5FDC\u7B54\u306E task.id \u3092\u305D\u306E\u307E\u307E\u4F7F\u3048\u307E\u305B\u3093\uFF08${String(id).slice(0,60)}\uFF09\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}
95
- return id}async function resolvePrivateStatusAndType(input,ctx,options){const out={};const status=nonEmpty(input.flags,"--status");if(status!==void 0){out["status_id"]=(await ctx.resolver.privateStatus(status)).id}else if(options.useDefaults){const ref=await ctx.resolver.privateDefaultStatus();out["status_id"]=ref.id;out["status_defaulted"]=ref.name}const type=nonEmpty(input.flags,"--type");if(type!==void 0){out["type_id"]=(await ctx.resolver.privateTaskType(type)).id}else if(options.useDefaults){
96
- const ref=await ctx.resolver.privateDefaultTaskType();out["type_id"]=ref.id;out["type_defaulted"]=ref.name}return out}var LIST_COLUMNS2=["key","subject","status_id","assignee_id","priority","due_date","updated_at"];var GET_COLUMNS=["id","key","project_id","subject","description","status_id","type_id","category_id","milestone_id","assignee_id","priority","start_date","due_date","estimated_hours","actual_hours","progress","parent_id","subtask_count","created_by","created_at","updated_by","updated_at"];var listPaging2=envelopePaging({label:"\u30BF\u30B9\u30AF\u4E00\u89A7"});var PRIVATE_HELP=`\u500B\u4EBA\u30BF\u30B9\u30AF\uFF08\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u5C5E\u3055\u306A\u3044\u81EA\u5206\u3060\u3051\u306E\
108
+ 2: \u4E2D \uFF0F 3: \u4F4E")}return value}function decimal(input,flag,options){const raw=input.flags.get(flag);if(raw===void 0)return void 0;const trimmed=raw.trim();const value=/^\d+(\.\d+)?$/.test(trimmed)?Number(trimmed):Number.NaN;if(!Number.isFinite(value)||value<options.min||value>options.max){throw new UsageError(`${flag} \u306F ${options.min} \u4EE5\u4E0A ${options.max} \u4EE5\u4E0B\u306E\u6570\u5024\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${raw}`,"\u4F8B: 3 / 3.5")}return value}
109
+ function boundedText(input,flag,options){const raw=input.flags.get(flag);if(raw===void 0)return void 0;if(raw.trim()===""){throw new UsageError(`${flag} \u306B\u7A7A\u306E\u5024\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,`${options.label}\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}const count=[...raw].length;if(count>options.maxChars){throw new UsageError(`${options.label}\u304C\u9577\u3059\u304E\u307E\u3059\uFF08${count} \u6587\u5B57\u30FB\u4E0A\u9650 ${options.maxChars}\
110
+ \u6587\u5B57\uFF09`,`${flag} \u3092 ${options.maxChars} \u6587\u5B57\u4EE5\u5185\u306B\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return raw}var LIST_COLUMNS2=["key","subject","status_id","assignee_id","priority","due_date","updated_at"];var GET_COLUMNS=["id","key","project_id","subject","description","status_id","type_id","category_id","milestone_id","assignee_id","priority","start_date","due_date","estimated_hours","actual_hours","progress","parent_id","subtask_count","created_by","created_at","updated_by","updated_at"];var listPaging2=envelopePaging({label:"\u30BF\u30B9\u30AF\u4E00\u89A7"});var PRIVATE_HELP=`\u500B\u4EBA\u30BF\u30B9\u30AF\uFF08\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B\u5C5E\u3055\u306A\u3044\u81EA\u5206\u3060\u3051\u306E\
97
111
  \u30BF\u30B9\u30AF\uFF09\u306F --project ${PRIVATE_PROJECT_REF} \u3067\u64CD\u4F5C\u3057\u307E\u3059\u3002
98
112
  twp task list --project ${PRIVATE_PROJECT_REF}
99
113
  \u500B\u4EBA\u30BF\u30B9\u30AF\u306E\u30AD\u30FC\u306F PRIVATE-<\u756A\u53F7> \u3067\u3059\u3002\u62C5\u5F53\u8005\u306E\u6307\u5B9A\u30FB\u7D5E\u308A\u8FBC\u307F\uFF08--assignee\uFF09\u306F\u3067\u304D\u307E\u305B\u3093
100
114
  \uFF08\u500B\u4EBA\u30BF\u30B9\u30AF\u306F\u5E38\u306B\u81EA\u5206\u306E\u3082\u306E\u306A\u306E\u3067\u3001\u30B5\u30FC\u30D0\u5074\u306B\u62C5\u5F53\u8005\u306E\u9805\u76EE\u304C\u3042\u308A\u307E\u305B\u3093\uFF09\u3002
101
- \u30B3\u30E1\u30F3\u30C8\uFF08twp task comment\uFF09\u306F\u500B\u4EBA\u30BF\u30B9\u30AF\u3067\u306F\u4F7F\u3048\u307E\u305B\u3093\u3002TWP \u306E\u753B\u9762\u304B\u3089\u64CD\u4F5C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`;var PRIVATE_SURFACE="private";function isPrivatePlan(input){return input.resolved?.["surface"]===PRIVATE_SURFACE}function taskObject(body){const task=isRecord(body)?body["task"]:void 0;if(!isRecord(task)){throw new ApiResponseError("\u30BF\u30B9\u30AF\u8A73\u7D30\u306E\u5FDC\u7B54\u306B task \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
102
- return task}function subtaskItems(body){const items=isRecord(body)?body["items"]:void 0;if(!Array.isArray(items)){throw new ApiResponseError("\u30B5\u30D6\u30BF\u30B9\u30AF\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")}return items}var SUBJECT_MAX_CHARS=500;var DESCRIPTION_MAX_CHARS=1e4;var FIELD_FLAGS=[{name:"--subject",summary:"\u4EF6\u540D",takesValue:true,placeholder:"\
103
- <\u6587\u5B57\u5217>"},{name:"--description",summary:"\u672C\u6587\u3092\u76F4\u63A5\u6307\u5B9A\u3059\u308B\uFF08--description-file \u3068\u306E\u4F75\u7528\u306F\u30A8\u30E9\u30FC\uFF09",takesValue:true,placeholder:"<\u6587\u5B57\u5217>"},{name:"--description-file",summary:"\u672C\u6587\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",takesValue:true,placeholder:"<\u30D1\u30B9|->"},
104
- {name:"--status",summary:"\u30B9\u30C6\u30FC\u30BF\u30B9\uFF08\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"},{name:"--type",summary:"\u7A2E\u5225\uFF08\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"},{name:"--assignee",summary:"\u62C5\u5F53\u8005\uFF08me / \u540D\u524D / \u30E1\u30FC\u30EB / ID\uFF09",takesValue:true,placeholder:"<me|\u540D\u524D|ID>"},{name:"--due-date",summary:"\u671F\u65E5\uFF08YYYY-MM-\
105
- DD\uFF09",takesValue:true,placeholder:"<YYYY-MM-DD>"},{name:"--start-date",summary:"\u958B\u59CB\u65E5\uFF08YYYY-MM-DD\uFF09",takesValue:true,placeholder:"<YYYY-MM-DD>"},{name:"--priority",summary:"\u512A\u5148\u5EA6\uFF081: \u9AD8 / 2: \u4E2D / 3: \u4F4E\uFF09",takesValue:true,placeholder:"<1|2|3>"}];var FIELD_HELP="--status / --type / --assignee \u306F\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID \u306E\u3044\u305A\u308C\u3067\u3082\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\n\u5B8C\u5168\u4E00\u81F4\u3060\u3051\u3067\u89E3\u6C7A\u3057\u3001\u8907\u6570\u306B\u5F53\u305F\u308B\u30FB1\u4EF6\u3082\u5F53\u305F\u3089\u306A\u3044\u5834\u5408\u306F\u5019\u88DC\u3092\u51FA\u3057\u3066\u7D42\u4E86\u30B3\u30FC\u30C9 2 \u3067\u6B62\u307E\u308A\u307E\u3059\u3002\n--assignee me \u306F\u300C\u3044\u307E\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u308B\u30E6\u30FC\u30B6\u30FC\u300D\u3067\u3059\u3002\n\n\u672C\u6587\u306F --description-file \u3092\u4E3B\u7D4C\u8DEF\u306B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u30B7\u30A7\u30EB\
106
- \u306E\u5F15\u6570\u306B\u8F09\u305B\u308B\u3068\u6539\u884C\u30FBMarkdown \u306E\n\u898B\u51FA\u3057\uFF08#\uFF09\u30FB\u5F15\u7528\u7B26\u3067\u58CA\u308C\u307E\u3059\uFF09\u3002--description-file - \u3067\u6A19\u6E96\u5165\u529B\u304B\u3089\u8AAD\u3081\u307E\u3059\u3002\u672C\u6587\u306F\u52A0\u5DE5\u3057\u307E\u305B\u3093\n\uFF08\u6539\u884C\u30FBCRLF \u306F\u305D\u306E\u307E\u307E\u9001\u308A\u307E\u3059\u3002\u843D\u3068\u3059\u306E\u306F\u5148\u982D\u306E UTF-8 BOM \u3060\u3051\u3067\u3059\uFF09\u3002\n\n\u5024\u306E\u89E3\u9664\uFF08\u62C5\u5F53\u8005\u3092\u5916\u3059\u30FB\u671F\u65E5\u3092\u6D88\u3059\uFF09\u306F\u3053\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u3067\u306F\u3067\u304D\u307E\u305B\u3093\u3002TWP \u306E\u753B\u9762\u304B\u3089\u884C\u3063\u3066\u304F\u3060\u3055\u3044\u3002";
107
- function readDescription(input,usage){return readBody(input,{flag:"--description",fileFlag:"--description-file",label:"\u672C\u6587",maxChars:DESCRIPTION_MAX_CHARS,usage})}function checkPureFields(input){boundedText(input,"--subject",{maxChars:SUBJECT_MAX_CHARS,label:"\u4EF6\u540D"});isoDate(input,"--due-date");isoDate(input,"--start-date");priority(input)}function taskBody(input){const body={};const put=(key,value)=>{if(value!==void 0)body[key]=value};put("subject",boundedText(input,"--subject",
108
- {maxChars:SUBJECT_MAX_CHARS,label:"\u4EF6\u540D"}));const description=input.resolved?.["description"];put("description",description);if(description!==void 0)body["description_html"]=null;put("status_id",input.resolved?.["status_id"]);put("type_id",input.resolved?.["type_id"]);put("assignee_id",input.resolved?.["assignee_id"]);put("due_date",isoDate(input,"--due-date"));put("start_date",isoDate(input,"--start-date"));put("priority",priority(input));return body}async function resolveStatusAndType(input,ctx,projectId,options){
109
- const out={};const status=nonEmpty(input.flags,"--status");if(status!==void 0){out["status_id"]=(await ctx.resolver.status(projectId,status)).id}else if(options.useDefaults){const ref=await ctx.resolver.defaultStatus(projectId);out["status_id"]=ref.id;out["status_defaulted"]=ref.name}const type=nonEmpty(input.flags,"--type");if(type!==void 0){out["type_id"]=(await ctx.resolver.taskType(projectId,type)).id}else if(options.useDefaults){const ref=await ctx.resolver.defaultTaskType(projectId);out["t\
110
- ype_id"]=ref.id;out["type_defaulted"]=ref.name}const assignee=nonEmpty(input.flags,"--assignee");if(assignee!==void 0)out["assignee_id"]=(await ctx.resolver.assignee(projectId,assignee)).id;return out}var taskDomain={name:"task",summary:"\u30BF\u30B9\u30AF\u306E\u4E00\u89A7\u30FB\u8A73\u7D30\u30FB\u30B5\u30D6\u30BF\u30B9\u30AF\u30FB\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664",operations:[{name:"list",summary:"\u30BF\u30B9\u30AF\u3092\u4E00\u89A7\u3059\u308B",usage:"twp task list [--project \
111
- <\u30B3\u30FC\u30C9|ID|__private__>] [--status <\u540D\u524D>] [--type <\u540D\u524D>] [--assignee <me|\u540D\u524D>] [--keyword <\u8A9E>] [--all]",description:`--output json \u306F API \u304C\u8FD4\u3059\u5168\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002
115
+ \u30B3\u30E1\u30F3\u30C8\uFF08twp task comment\uFF09\u306F\u500B\u4EBA\u30BF\u30B9\u30AF\u3067\u306F\u4F7F\u3048\u307E\u305B\u3093\u3002TWP \u306E\u753B\u9762\u304B\u3089\u64CD\u4F5C\u3057\u3066\u304F\u3060\u3055\u3044\u3002`;var PRIVATE_SURFACE2="private";function isPrivatePlan2(input){return input.resolved?.["surface"]===PRIVATE_SURFACE2}function taskObject(body){const task=isRecord(body)?body["task"]:void 0;if(!isRecord(task)){throw new ApiResponseError("\u30BF\u30B9\u30AF\u8A73\u7D30\u306E\u5FDC\u7B54\u306B task \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
116
+ return task}function subtaskItems(body){const items=isRecord(body)?body["items"]:void 0;if(!Array.isArray(items)){throw new ApiResponseError("\u30B5\u30D6\u30BF\u30B9\u30AF\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")}return items}var SUBJECT_MAX_CHARS=500;var ESTIMATED_HOURS_MAX=9999;var DESCRIPTION_MAX_CHARS=1e4;var FIELD_FLAGS=[{name:"--subject",summary:"\u4EF6\u540D",
117
+ takesValue:true,placeholder:"<\u6587\u5B57\u5217>"},{name:"--description",summary:"\u672C\u6587\u3092\u76F4\u63A5\u6307\u5B9A\u3059\u308B\uFF08--description-file \u3068\u306E\u4F75\u7528\u306F\u30A8\u30E9\u30FC\uFF09",takesValue:true,placeholder:"<\u6587\u5B57\u5217>"},{name:"--description-file",summary:"\u672C\u6587\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",takesValue:true,placeholder:"\
118
+ <\u30D1\u30B9|->"},{name:"--status",summary:"\u30B9\u30C6\u30FC\u30BF\u30B9\uFF08\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"},{name:"--type",summary:"\u7A2E\u5225\uFF08\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"},{name:"--assignee",summary:"\u62C5\u5F53\u8005\uFF08me / \u540D\u524D / \u30E1\u30FC\u30EB / ID\uFF09",takesValue:true,placeholder:"<me|\u540D\u524D|ID>"},{name:"--due-date",summary:"\
119
+ \u671F\u65E5\uFF08YYYY-MM-DD\uFF09",takesValue:true,placeholder:"<YYYY-MM-DD>"},{name:"--start-date",summary:"\u958B\u59CB\u65E5\uFF08YYYY-MM-DD\uFF09",takesValue:true,placeholder:"<YYYY-MM-DD>"},{name:"--priority",summary:"\u512A\u5148\u5EA6\uFF081: \u9AD8 / 2: \u4E2D / 3: \u4F4E\uFF09",takesValue:true,placeholder:"<1|2|3>"},{name:"--category",summary:"\u30AB\u30C6\u30B4\u30EA\uFF08\u540D\u524D\u30FBID\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"},{name:"--milestone",summary:"\u30DE\u30A4\u30EB\u30B9\u30C8\u30FC\u30F3\uFF08\
120
+ \u540D\u524D\u30FBID\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"},{name:"--label",summary:"\u30E9\u30D9\u30EB\uFF08\u540D\u524D\u30FBID\uFF09\u3002\u8907\u6570\u6307\u5B9A\u3067\u304D\u307E\u3059\uFF08\u6307\u5B9A\u3057\u305F\u3082\u306E\u304C\u5168\u4F53\u306B\u306A\u308A\u307E\u3059\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>",repeatable:true},{name:"--estimated-hours",summary:"\u898B\u7A4D\u5DE5\u6570\uFF08\u6642\u9593\u30FB0\u301C9999\u30FB\u5C0F\u6570\u53EF\uFF09",takesValue:true,
121
+ placeholder:"<\u6570\u5024>"},{name:"--custom-field",summary:"\u30AB\u30B9\u30BF\u30E0\u30D5\u30A3\u30FC\u30EB\u30C9\uFF08<\u30D5\u30A3\u30FC\u30EB\u30C9\u540D>=<\u5024>\uFF09\u3002\u8907\u6570\u6307\u5B9A\u3067\u304D\u307E\u3059",takesValue:true,placeholder:"<\u540D\u524D>=<\u5024>",repeatable:true},{name:"--parent",summary:"\u89AA\u30BF\u30B9\u30AF\uFF08\u30AD\u30FC\u30FBID\uFF09\u3002\u6307\u5B9A\u3059\u308B\u3068\u30B5\u30D6\u30BF\u30B9\u30AF\u306B\u306A\u308A\u307E\u3059",takesValue:true,placeholder:"\
122
+ <\u30AD\u30FC|ID>"}];var CLEAR_FLAG={name:"--clear",summary:"\u9805\u76EE\u3092\u7A7A\u306B\u3059\u308B\uFF08\u8907\u6570\u6307\u5B9A\u53EF\u30FB\u6307\u5B9A\u3057\u305F\u9805\u76EE\u3060\u3051\u304C\u7A7A\u306B\u306A\u308A\u307E\u3059\uFF09",takesValue:true,placeholder:"<\u9805\u76EE>",repeatable:true};var CLEARABLE=[{token:"assignee",flags:["--assignee"],key:"assignee_id"},{token:"due-date",flags:["--due-date"],key:"due_date"},{token:"start-date",flags:["--start-date"],key:"start_date"},{token:"\
123
+ priority",flags:["--priority"],key:"priority"},{token:"category",flags:["--category"],key:"category_id"},{token:"milestone",flags:["--milestone"],key:"milestone_id"},{token:"label",flags:["--label"],key:"label_ids",empty:[]},{token:"estimated-hours",flags:["--estimated-hours"],key:"estimated_hours"},{token:"description",flags:["--description","--description-file"],key:"description"},{token:"parent",flags:["--parent"],key:"parent_task_id"}];var CLEAR_HELP=`--clear \u306F\u6307\u5B9A\u3057\u305F\u9805\u76EE\u3060\u3051\u3092\u7A7A\u306B\u3057\u307E\u3059\uFF08\u4F8B: --clear assig\
124
+ nee --clear due-date\uFF09\u3002
125
+ \u6307\u5B9A\u3067\u304D\u308B\u9805\u76EE: ${CLEARABLE.map(entry=>entry.token).join(" / ")}
126
+ \u4EF6\u540D\u30FB\u30B9\u30C6\u30FC\u30BF\u30B9\u30FB\u7A2E\u5225\u306F\u30B5\u30FC\u30D0\u5074\u3067\u5FC5\u9808\u306E\u305F\u3081\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093\u3002
127
+ \u540C\u3058\u9805\u76EE\u3092\u5024\u3068 --clear \u306E\u4E21\u65B9\u3067\u6307\u5B9A\u3059\u308B\u3068\u30A8\u30E9\u30FC\u306B\u306A\u308A\u307E\u3059\uFF08\u3069\u3061\u3089\u304C\u52B9\u3044\u305F\u306E\u304B\u5206\u304B\u3089\u306A\u3044\u305F\u3081\uFF09\u3002`;function clearTargets(input){const tokens=repeatedValues(input,CLEAR_FLAG.name).map(token=>token.trim());const out=[];for(const token of tokens){const entry=CLEARABLE.find(candidate=>candidate.token===token);if(entry===void 0){throw new UsageError(
128
+ `--clear \u306B\u6307\u5B9A\u3067\u304D\u306A\u3044\u9805\u76EE\u3067\u3059: ${token===""?"(\u7A7A)":token}`,`\u6307\u5B9A\u3067\u304D\u308B\u9805\u76EE: ${CLEARABLE.map(candidate=>candidate.token).join(" / ")}`)}if(out.includes(entry))throw new UsageError(`--clear \u306E\u9805\u76EE\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059: ${token}`);const conflict=entry.flags.find(flag=>input.flags.has(flag)||repeatedValues(input,flag).length>0);if(conflict!==void 0){throw new UsageError(`${conflict} \u3068\
129
+ --clear ${token} \u306E\u4E21\u65B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059`,"\u5024\u3092\u5165\u308C\u308B\u304B\u7A7A\u306B\u3059\u308B\u304B\u306E\u3069\u3061\u3089\u304B\u4E00\u65B9\u3060\u3051\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}out.push(entry)}return out}function customFields(input){const entries=repeatedValues(input,"--custom-field");if(entries.length===0)return void 0;const out={};for(const entry of entries){const at=entry.indexOf("=");if(at<=0){
130
+ throw new UsageError(`--custom-field \u306F <\u30D5\u30A3\u30FC\u30EB\u30C9\u540D>=<\u5024> \u306E\u5F62\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${entry}`,"\u4F8B: --custom-field \u9867\u5BA2\u540D=\u30C8\u30C3\u30AB\uFF08\u5024\u304C\u7A7A\u306E\u3068\u304D\u306F --custom-field \u9867\u5BA2\u540D= \u3068\u66F8\u304D\u307E\u3059\uFF09")}const name=entry.slice(0,at).trim();if(name==="")throw new UsageError(`--custom-field \u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u540D\u304C\u7A7A\u3067\u3059: ${entry}`);
131
+ if(name in out)throw new UsageError(`--custom-field \u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u540D\u304C\u91CD\u8907\u3057\u3066\u3044\u307E\u3059: ${name}`);out[name]=entry.slice(at+1)}return out}var FIELD_HELP="--status / --type / --assignee \u306F\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID \u306E\u3044\u305A\u308C\u3067\u3082\u6307\u5B9A\u3067\u304D\u307E\u3059\u3002\n\u5B8C\u5168\u4E00\u81F4\u3060\u3051\u3067\u89E3\u6C7A\u3057\u3001\u8907\u6570\u306B\u5F53\u305F\u308B\u30FB1\u4EF6\u3082\u5F53\u305F\u3089\u306A\u3044\u5834\u5408\u306F\u5019\u88DC\u3092\u51FA\u3057\u3066\u7D42\u4E86\u30B3\u30FC\u30C9 2 \u3067\u6B62\u307E\u308A\u307E\u3059\u3002\n--assignee me \u306F\u300C\u3044\u307E\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u308B\u30E6\u30FC\u30B6\u30FC\u300D\u3067\u3059\u3002\n\n\u672C\u6587\u306F --description-file \u3092\u4E3B\u7D4C\u8DEF\u306B\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u30B7\u30A7\u30EB\u306E\u5F15\u6570\u306B\u8F09\u305B\u308B\u3068\u6539\u884C\u30FBMarkdown \u306E\n\u898B\u51FA\u3057\uFF08#\uFF09\u30FB\u5F15\u7528\u7B26\u3067\u58CA\u308C\u307E\u3059\uFF09\u3002--description-file - \u3067\u6A19\u6E96\u5165\u529B\u304B\u3089\u8AAD\u3081\u307E\u3059\u3002\u672C\u6587\u306F\u52A0\u5DE5\u3057\u307E\u305B\u3093\n\uFF08\u6539\u884C\u30FBCRLF \u306F\u305D\u306E\u307E\u307E\u9001\u308A\u307E\u3059\u3002\u843D\u3068\u3059\u306E\u306F\u5148\u982D\u306E \
132
+ UTF-8 BOM \u3060\u3051\u3067\u3059\uFF09\u3002\n\n--category / --milestone / --label \u3082\u540C\u3058\u898F\u7D04\u3067\u540D\u524D\u304B\u3089\u5F15\u3051\u307E\u3059\uFF08--label \u306F\u8907\u6570\u6307\u5B9A\u3067\u304D\u307E\u3059\uFF09\u3002\n--label \u306F\u300C\u6307\u5B9A\u3057\u305F\u3082\u306E\u304C\u5168\u4F53\u300D\u3067\u3059\uFF08\u3044\u307E\u4ED8\u3044\u3066\u3044\u308B\u30E9\u30D9\u30EB\u306B\u8DB3\u3059\u306E\u3067\u306F\u306A\u304F\u3001\u7F6E\u304D\u63DB\u3048\u307E\u3059\uFF09\u3002\n--parent \u3092\u6307\u5B9A\u3059\u308B\u3068\u3001\u305D\u306E\u30BF\u30B9\u30AF\u306E\u30B5\u30D6\u30BF\u30B9\u30AF\u3068\u3057\u3066\u6271\u308F\u308C\u307E\u3059\uFF08\u30B5\u30FC\u30D0\u5074\u3067\u968E\u5C64\u306E\u691C\u8A3C\u304C\u8D70\u308A\u307E\u3059\uFF09\u3002\n--custom-field \u306F\u30AB\u30B9\u30BF\u30E0\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u300C\u540D\u524D\u300D\u3092\u9375\u306B\u3057\u307E\u3059\uFF08\u7DE8\u96C6\u306B\u306F\u7BA1\u7406\u8005\u307E\u305F\u306F\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC\u6A29\u9650\u304C\u8981\u308A\u307E\u3059\uFF09\u3002";
133
+ function readDescription(input,usage){return readBody(input,{flag:"--description",fileFlag:"--description-file",label:"\u672C\u6587",maxChars:DESCRIPTION_MAX_CHARS,usage})}function checkPureFields(input){boundedText(input,"--subject",{maxChars:SUBJECT_MAX_CHARS,label:"\u4EF6\u540D"});isoDate(input,"--due-date");isoDate(input,"--start-date");priority(input);decimal(input,"--estimated-hours",{min:0,max:ESTIMATED_HOURS_MAX});customFields(input);clearTargets(input)}function taskBody(input){const body={};
134
+ const put=(key,value)=>{if(value!==void 0)body[key]=value};put("subject",boundedText(input,"--subject",{maxChars:SUBJECT_MAX_CHARS,label:"\u4EF6\u540D"}));const description=input.resolved?.["description"];put("description",description);if(description!==void 0)body["description_html"]=null;put("status_id",input.resolved?.["status_id"]);put("type_id",input.resolved?.["type_id"]);put("assignee_id",input.resolved?.["assignee_id"]);put("due_date",isoDate(input,"--due-date"));put("start_date",isoDate(
135
+ input,"--start-date"));put("priority",priority(input));put("category_id",input.resolved?.["category_id"]);put("milestone_id",input.resolved?.["milestone_id"]);put("label_ids",takeList2(input,"label_ids"));put("estimated_hours",decimal(input,"--estimated-hours",{min:0,max:ESTIMATED_HOURS_MAX}));put("custom_fields",customFields(input));put("parent_task_id",input.resolved?.["parent_task_id"]);for(const entry of clearTargets(input)){body[entry.key]="empty"in entry?entry.empty:null;if(entry.key==="de\
136
+ scription")body["description_html"]=null}return body}function takeList2(input,key){const raw=input.resolved?.[key];if(raw===void 0||raw==="")return void 0;const parsed=JSON.parse(raw);if(!Array.isArray(parsed))throw new Error(`\u5185\u90E8\u30A8\u30E9\u30FC: ${key} \u306E\u53D7\u3051\u6E21\u3057\u304C\u58CA\u308C\u3066\u3044\u307E\u3059`);return parsed}async function resolveStatusAndType(input,ctx,projectId,options){const out={};const status=nonEmpty(input.flags,"--status");if(status!==void 0){out["\
137
+ status_id"]=(await ctx.resolver.status(projectId,status)).id}else if(options.useDefaults){const ref=await ctx.resolver.defaultStatus(projectId);out["status_id"]=ref.id;out["status_defaulted"]=ref.name}const type=nonEmpty(input.flags,"--type");if(type!==void 0){out["type_id"]=(await ctx.resolver.taskType(projectId,type)).id}else if(options.useDefaults){const ref=await ctx.resolver.defaultTaskType(projectId);out["type_id"]=ref.id;out["type_defaulted"]=ref.name}const assignee=nonEmpty(input.flags,"\
138
+ --assignee");if(assignee!==void 0)out["assignee_id"]=(await ctx.resolver.assignee(projectId,assignee)).id;return out}async function resolveExtras(input,ctx,projectId){const out={};const category=nonEmpty(input.flags,"--category");if(category!==void 0)out["category_id"]=(await ctx.resolver.taskMaster("category",projectId,category,"--category")).id;const milestone=nonEmpty(input.flags,"--milestone");if(milestone!==void 0)out["milestone_id"]=(await ctx.resolver.taskMaster("milestone",projectId,milestone,
139
+ "--milestone")).id;const labels=repeatedValues(input,"--label");if(labels.length>0){const ids=[];for(const ref of labels){const label=await ctx.resolver.taskMaster("label",projectId,ref,"--label");if(!ids.includes(label.id))ids.push(label.id)}out["label_ids"]=JSON.stringify(ids)}const parent=nonEmpty(input.flags,"--parent");if(parent!==void 0)out["parent_task_id"]=await resolveParentTaskId(ctx,projectId,parent);return out}async function resolveParentTaskId(ctx,projectId,ref){const classified=classifyTaskRef(
140
+ ref);if(classified.kind==="id")return classified.value;if(classified.kind==="unknown"){throw new UsageError(`--parent \u304C\u300C\u30BF\u30B9\u30AF\u30AD\u30FC\uFF08\u4F8B ABC-123\uFF09\u300D\u306B\u3082\u300CID\uFF08UUID / ULID\uFF09\u300D\u306B\u3082\u898B\u3048\u307E\u305B\u3093: ${ref}`,"\u89AA\u30BF\u30B9\u30AF\u306F\u30AD\u30FC\u304B ID \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}const resolved=await ctx.resolver.taskByKey(classified.value);if(resolved.projectId!==projectId){
141
+ throw new UsageError(`--parent ${classified.value} \u306F\u5225\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30BF\u30B9\u30AF\u3067\u3059`,"\u89AA\u30BF\u30B9\u30AF\u306F\u540C\u3058\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u30BF\u30B9\u30AF\u3060\u3051\u3092\u6307\u5B9A\u3067\u304D\u307E\u3059\uFF08\u30B5\u30FC\u30D0\u5074\u304C\u540C\u4E00\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u5185\u3067\u3057\u304B\u968E\u5C64\u3092\u4F5C\u308C\u307E\u305B\u3093\uFF09\u3002")}const id=resolved.task["id"];
142
+ if(typeof id!=="string"||id===""){throw new ApiResponseError(`\u30BF\u30B9\u30AF\u30AD\u30FC\u89E3\u6C7A\u306E\u5FDC\u7B54\u306B task.id \u304C\u3042\u308A\u307E\u305B\u3093\uFF08--parent ${classified.value}\uFF09\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}return id}async function resolvePrivateParent(input,ctx){const parent=nonEmpty(input.flags,"--parent");if(parent===void 0)return{};return{parent_task_id:await resolvePrivateTaskId(ctx,parent)}}var taskDomain={
143
+ name:"task",summary:"\u30BF\u30B9\u30AF\u306E\u4E00\u89A7\u30FB\u8A73\u7D30\u30FB\u30B5\u30D6\u30BF\u30B9\u30AF\u30FB\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664",operations:[{name:"list",summary:"\u30BF\u30B9\u30AF\u3092\u4E00\u89A7\u3059\u308B",usage:"twp task list [--project <\u30B3\u30FC\u30C9|ID|__private__>] [--status <\u540D\u524D>] [--type <\u540D\u524D>] [--assignee <me|\u540D\u524D>] [--keyword <\u8A9E>] [--all]",description:`--output json \u306F API \u304C\u8FD4\u3059\u5168\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002
112
144
  --output table / text / tsv \u306F\u8981\u7D04\u5217\uFF08key / subject / status_id / assignee_id / priority / due_date / updated_at\uFF09\u3067\u3059\u3002
113
145
  \u6B32\u3057\u3044\u5217\u3060\u3051\u3092\u6A5F\u68B0\u51E6\u7406\u3057\u305F\u3044\u3068\u304D\u306F --query \u3067\u9078\u3093\u3067\u304F\u3060\u3055\u3044\uFF08--query \u306F\u751F\u30C7\u30FC\u30BF\u306B\u5BFE\u3057\u3066\u8A55\u4FA1\u3055\u308C\u307E\u3059\uFF09\u3002
114
146
 
@@ -121,33 +153,33 @@ ${PRIVATE_HELP}
121
153
 
122
154
  `+LIST_PAGING_HELP,flags:[...LIST_FLAGS,PROJECT_FLAG,{name:"--status",summary:"\u30B9\u30C6\u30FC\u30BF\u30B9\u3067\u7D5E\u308A\u8FBC\u3080\uFF08\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"},{name:"--type",summary:"\u7A2E\u5225\u3067\u7D5E\u308A\u8FBC\u3080\uFF08\u540D\u524D\u30FB\u30B3\u30FC\u30C9\u30FBID\uFF09",takesValue:true,placeholder:"<\u540D\u524D|ID>"},{name:"--assignee",summary:"\u62C5\u5F53\u8005\u3067\u7D5E\u308A\u8FBC\u3080\uFF08me / \u540D\u524D / \u30E1\u30FC\u30EB / ID\uFF09",
123
155
  takesValue:true,placeholder:"<me|\u540D\u524D|ID>"},{name:"--keyword",summary:"\u4EF6\u540D\u30FB\u672C\u6587\u306E\u90E8\u5206\u4E00\u81F4\u3067\u7D5E\u308A\u8FBC\u3080\uFF08\u691C\u7D22\u7D4C\u8DEF\u306B\u5207\u308A\u66FF\u308F\u308A\u307E\u3059\uFF09",takesValue:true,placeholder:"<\u8A9E>"}],paging:listPaging2,async prepare(input,ctx){if(input.args.length>0){throw new UsageError(`list \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,"twp task list h\
124
- elp")}if(wantsPrivateSurface(input)){rejectPrivateUnsupportedFlags(input);return withResolved(input,{surface:PRIVATE_SURFACE,...await resolvePrivateStatusAndType(input,ctx,{useDefaults:false})})}const projectId=await ctx.projectId(input.flags.get("--project"));const resolved={projectId};const status=nonEmpty(input.flags,"--status");if(status!==void 0)resolved["status_id"]=(await ctx.resolver.status(projectId,status)).id;const type=nonEmpty(input.flags,"--type");if(type!==void 0)resolved["type_id"]=
125
- (await ctx.resolver.taskType(projectId,type)).id;const assignee=nonEmpty(input.flags,"--assignee");if(assignee!==void 0)resolved["assignee_id"]=(await ctx.resolver.assignee(projectId,assignee)).id;return withResolved(input,resolved)},plan(input){const query={limit:positiveInteger(input.flags,"--limit"),cursor:nonEmpty(input.flags,"--cursor"),keyword:nonEmpty(input.flags,"--keyword"),status_id:input.resolved?.["status_id"],type_id:input.resolved?.["type_id"],assignee_id:input.resolved?.["assignee\
126
- _id"]};if(isPrivatePlan(input))return{method:"GET",path:PRIVATE_TASKS_PATH,query};const projectId=requireResolved(input,"projectId");return{method:"GET",path:`/api/v2/projects/${encodeURIComponent(projectId)}/tasks`,query}},summarize:body=>listPaging2.items(body).map(row=>pick(row,LIST_COLUMNS2)),raw:body=>listPaging2.items(body)},{name:"get",summary:"\u30BF\u30B9\u30AF1\u4EF6\u306E\u8A73\u7D30\u3092\u8868\u793A\u3059\u308B",usage:"twp task get <\u30AD\u30FC|ID> [--project <\u30B3\u30FC\u30C9|ID|__private__>]",
156
+ elp")}if(wantsPrivateSurface(input)){rejectPrivateUnsupportedFlags(input);return withResolved(input,{surface:PRIVATE_SURFACE2,...await resolvePrivateStatusAndType(input,ctx,{useDefaults:false})})}const projectId=await ctx.projectId(input.flags.get("--project"));const resolved={projectId};const status=nonEmpty(input.flags,"--status");if(status!==void 0)resolved["status_id"]=(await ctx.resolver.status(projectId,status)).id;const type=nonEmpty(input.flags,"--type");if(type!==void 0)resolved["type_i\
157
+ d"]=(await ctx.resolver.taskType(projectId,type)).id;const assignee=nonEmpty(input.flags,"--assignee");if(assignee!==void 0)resolved["assignee_id"]=(await ctx.resolver.assignee(projectId,assignee)).id;return withResolved(input,resolved)},plan(input){const query={limit:positiveInteger(input.flags,"--limit"),cursor:nonEmpty(input.flags,"--cursor"),keyword:nonEmpty(input.flags,"--keyword"),status_id:input.resolved?.["status_id"],type_id:input.resolved?.["type_id"],assignee_id:input.resolved?.["assi\
158
+ gnee_id"]};if(isPrivatePlan2(input))return{method:"GET",path:PRIVATE_TASKS_PATH,query};const projectId=requireResolved(input,"projectId");return{method:"GET",path:`/api/v2/projects/${encodeURIComponent(projectId)}/tasks`,query}},summarize:body=>listPaging2.items(body).map(row=>pick(row,LIST_COLUMNS2)),raw:body=>listPaging2.items(body)},{name:"get",summary:"\u30BF\u30B9\u30AF1\u4EF6\u306E\u8A73\u7D30\u3092\u8868\u793A\u3059\u308B",usage:"twp task get <\u30AD\u30FC|ID> [--project <\u30B3\u30FC\u30C9|ID|__private__>]",
127
159
  description:`${TASK_REF_HELP}
128
160
 
129
- ${PRIVATE_HELP}`,flags:[TASK_REF_FLAG,PROJECT_FLAG],async prepare(input,ctx){const ref=singleRef(input,{flag:"--task",label:"\u30BF\u30B9\u30AF",usage:"twp task get help"});if(taskSurface(input,ref)===PRIVATE_SURFACE){return withResolved(input,{surface:PRIVATE_SURFACE,privateRef:privateTaskRef(ref).value})}const classified=classifyTaskRef(ref);if(classified.kind==="key"){rejectRedundantProject(input,classified.value);return withResolved(input,{mode:"key",key:classified.value})}const{projectId,taskId}=await resolveTaskLocation(
130
- input,ctx,classified.value);return withResolved(input,{mode:"id",projectId,taskId})},plan(input){if(isPrivatePlan(input)){return{method:"GET",path:`${PRIVATE_TASKS_PATH}/${encodeURIComponent(requireResolved(input,"privateRef"))}`}}if(requireResolved(input,"mode")==="key"){return{method:"GET",path:`/api/v2/tasks/resolve-by-key/${encodeURIComponent(requireResolved(input,"key"))}`}}const projectId=encodeURIComponent(requireResolved(input,"projectId"));return{method:"GET",path:`/api/v2/projects/${projectId}\
131
- /tasks/${encodeURIComponent(requireResolved(input,"taskId"))}`}},summarize:body=>pick(taskObject(body),GET_COLUMNS),raw:body=>taskObject(body)},{name:"subtasks",summary:"\u30BF\u30B9\u30AF\u306E\u30B5\u30D6\u30BF\u30B9\u30AF\u3092\u4E00\u89A7\u3059\u308B",usage:"twp task subtasks <\u30AD\u30FC|ID> [--project <\u30B3\u30FC\u30C9|ID|__private__>]",description:`${TASK_REF_HELP}
161
+ ${PRIVATE_HELP}`,flags:[TASK_REF_FLAG,PROJECT_FLAG],async prepare(input,ctx){const ref=singleRef(input,{flag:"--task",label:"\u30BF\u30B9\u30AF",usage:"twp task get help"});if(taskSurface(input,ref)===PRIVATE_SURFACE2){return withResolved(input,{surface:PRIVATE_SURFACE2,privateRef:privateTaskRef(ref).value})}const classified=classifyTaskRef(ref);if(classified.kind==="key"){rejectRedundantProject(input,classified.value);return withResolved(input,{mode:"key",key:classified.value})}const{projectId,
162
+ taskId}=await resolveTaskLocation(input,ctx,classified.value);return withResolved(input,{mode:"id",projectId,taskId})},plan(input){if(isPrivatePlan2(input)){return{method:"GET",path:`${PRIVATE_TASKS_PATH}/${encodeURIComponent(requireResolved(input,"privateRef"))}`}}if(requireResolved(input,"mode")==="key"){return{method:"GET",path:`/api/v2/tasks/resolve-by-key/${encodeURIComponent(requireResolved(input,"key"))}`}}const projectId=encodeURIComponent(requireResolved(input,"projectId"));return{method:"\
163
+ GET",path:`/api/v2/projects/${projectId}/tasks/${encodeURIComponent(requireResolved(input,"taskId"))}`}},summarize:body=>pick(taskObject(body),GET_COLUMNS),raw:body=>taskObject(body)},{name:"subtasks",summary:"\u30BF\u30B9\u30AF\u306E\u30B5\u30D6\u30BF\u30B9\u30AF\u3092\u4E00\u89A7\u3059\u308B",usage:"twp task subtasks <\u30AD\u30FC|ID> [--project <\u30B3\u30FC\u30C9|ID|__private__>]",description:`${TASK_REF_HELP}
132
164
 
133
165
  ${PRIVATE_HELP}
134
166
 
135
- \u3053\u306E API \u306F\u30DA\u30FC\u30B8\u30F3\u30B0\u3092\u6301\u305F\u305A\u3001\u5E38\u306B\u5168\u4EF6\u3092\u8FD4\u3057\u307E\u3059\uFF08--all / --limit \u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002`,flags:[TASK_REF_FLAG,PROJECT_FLAG],async prepare(input,ctx){const ref=singleRef(input,{flag:"--task",label:"\u30BF\u30B9\u30AF",usage:"twp task subtasks help"});if(taskSurface(input,ref)===PRIVATE_SURFACE){return withResolved(input,{surface:PRIVATE_SURFACE,taskId:await resolvePrivateTaskId(
136
- ctx,ref)})}return withResolved(input,await resolveTaskLocation(input,ctx,ref))},plan(input){const taskId=encodeURIComponent(requireResolved(input,"taskId"));if(isPrivatePlan(input)){return{method:"GET",path:`${PRIVATE_TASKS_PATH}/${taskId}/subtasks`}}const projectId=encodeURIComponent(requireResolved(input,"projectId"));return{method:"GET",path:`/api/v2/projects/${projectId}/tasks/${taskId}/subtasks`}},summarize:body=>subtaskItems(body).map(row=>pick(row,LIST_COLUMNS2)),raw:body=>subtaskItems(body)},
137
- {name:"create",summary:"\u30BF\u30B9\u30AF\u3092\u4F5C\u6210\u3059\u308B",usage:'twp task create --subject "<\u4EF6\u540D>" [--project <\u30B3\u30FC\u30C9|ID|__private__>] [--type <\u540D\u524D>] [--status <\u540D\u524D>] [--assignee <me|\u540D\u524D>]',description:`--subject \u3060\u3051\u304C\u5FC5\u9808\u3067\u3059\u3002--status / --type \u3092\u7701\u304F\u3068\u3001\u305D\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u304C\u65E2\u5B9A\u306B\u6307\u5B9A\u3057\u3066\u3044\u308B
167
+ \u3053\u306E API \u306F\u30DA\u30FC\u30B8\u30F3\u30B0\u3092\u6301\u305F\u305A\u3001\u5E38\u306B\u5168\u4EF6\u3092\u8FD4\u3057\u307E\u3059\uFF08--all / --limit \u306F\u3042\u308A\u307E\u305B\u3093\uFF09\u3002`,flags:[TASK_REF_FLAG,PROJECT_FLAG],async prepare(input,ctx){const ref=singleRef(input,{flag:"--task",label:"\u30BF\u30B9\u30AF",usage:"twp task subtasks help"});if(taskSurface(input,ref)===PRIVATE_SURFACE2){return withResolved(input,{surface:PRIVATE_SURFACE2,taskId:await resolvePrivateTaskId(
168
+ ctx,ref)})}return withResolved(input,await resolveTaskLocation(input,ctx,ref))},plan(input){const taskId=encodeURIComponent(requireResolved(input,"taskId"));if(isPrivatePlan2(input)){return{method:"GET",path:`${PRIVATE_TASKS_PATH}/${taskId}/subtasks`}}const projectId=encodeURIComponent(requireResolved(input,"projectId"));return{method:"GET",path:`/api/v2/projects/${projectId}/tasks/${taskId}/subtasks`}},summarize:body=>subtaskItems(body).map(row=>pick(row,LIST_COLUMNS2)),raw:body=>subtaskItems(body)},
169
+ {name:"create",summary:"\u30BF\u30B9\u30AF\u3092\u4F5C\u6210\u3059\u308B",usage:'twp task create --subject "<\u4EF6\u540D>" [--project <\u30B3\u30FC\u30C9|ID|__private__>] [--type <\u540D\u524D>] [--status <\u540D\u524D>] [--assignee <me|\u540D\u524D>] [--category <\u540D\u524D>] [--label <\u540D\u524D>] [--parent <\u30AD\u30FC|ID>]',description:`--subject \u3060\u3051\u304C\u5FC5\u9808\u3067\u3059\u3002--status / --type \u3092\u7701\u304F\u3068\u3001\u305D\u306E\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u304C\u65E2\u5B9A\u306B\u6307\u5B9A\u3057\u3066\u3044\u308B
138
170
  \u3082\u306E\u3092\u4F7F\u3044\u307E\u3059\uFF08\u30B5\u30FC\u30D0\u5074\u3067\u306F\u3069\u3061\u3089\u3082\u5FC5\u9808\u9805\u76EE\u3067\u3059\uFF09\u3002\u65E2\u5B9A\u3092\u4F7F\u3063\u305F\u5834\u5408\u306F stderr \u306B\u6CE8\u8A18\u304C\u51FA\u307E\u3059\u3002
139
171
 
140
- \u30B5\u30D6\u30BF\u30B9\u30AF\u306E\u4F5C\u6210\uFF08\u89AA\u30BF\u30B9\u30AF\u306E\u6307\u5B9A\uFF09\u306F\u3053\u306E\u30B3\u30DE\u30F3\u30C9\u3067\u306F\u884C\u3048\u307E\u305B\u3093\u3002\u540C\u3058\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\u304C
141
- \u89AA\u306E\u6307\u5B9A\u3092\u53D7\u3051\u307E\u3059\u304C\u3001\u30B5\u30FC\u30D0\u5074\u306F\u968E\u5C64\u306E\u691C\u8A3C\u3068\u6DF1\u3055\u306E\u8A08\u7B97\u3092\u542B\u3080\u5225\u306E\u51E6\u7406\u3078\u5206\u5C90\u3057\u307E\u3059\u3002
142
- \u6271\u3044\u304C\u5909\u308F\u308B\u306E\u3067\u3001\u5225\u30B3\u30DE\u30F3\u30C9\u3068\u3057\u3066\u7528\u610F\u3057\u307E\u3059\u3002
172
+ \u30B5\u30D6\u30BF\u30B9\u30AF\u306F --parent <\u30AD\u30FC|ID> \u3067\u4F5C\u6210\u3057\u307E\u3059\uFF08\u89AA\u306F\u3053\u306E\u30BF\u30B9\u30AF\u306E\u300C\u6587\u8108\u300D\u306A\u306E\u3067\u30D5\u30E9\u30B0\u3067\u3059\u30FB\xA713.5\uFF09\u3002
173
+ \u6307\u5B9A\u3059\u308B\u3068\u30B5\u30FC\u30D0\u5074\u306F\u968E\u5C64\u306E\u691C\u8A3C\u3068\u6DF1\u3055\u306E\u8A08\u7B97\u3092\u542B\u3080\u51E6\u7406\u3078\u5206\u5C90\u3057\u307E\u3059\u304C\u3001\u6253\u3061\u65B9\u306F\u5909\u308F\u308A\u307E\u305B\u3093\u3002
174
+ \u4F5C\u6210\u5F8C\u306F twp task subtasks <\u89AA\u30AD\u30FC> \u306B\u73FE\u308C\u307E\u3059\u3002
143
175
 
144
176
  ${PRIVATE_HELP}
145
177
 
146
178
  `+FIELD_HELP,flags:[...FIELD_FLAGS,PROJECT_FLAG],async prepare(input,ctx){if(input.args.length>0){throw new UsageError(`create \u306F\u4F4D\u7F6E\u5F15\u6570\u3092\u53D6\u308A\u307E\u305B\u3093: ${input.args.join(" ")}`,'\u4EF6\u540D\u306F --subject "<\u4EF6\u540D>" \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002')}checkPureFields(input);if(boundedText(input,"--subject",{maxChars:SUBJECT_MAX_CHARS,label:"\u4EF6\u540D"})===void 0){throw new UsageError('\u4EF6\u540D\u3092 --subject "<\u4EF6\u540D>" \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044',
147
- "twp task create help")}if(wantsPrivateSurface(input)){rejectPrivateUnsupportedFlags(input);const privateDescription=await readDescription(input,"twp task create help");return withResolved(input,{surface:PRIVATE_SURFACE,...privateDescription!==void 0?{description:privateDescription}:{},...await resolvePrivateStatusAndType(input,ctx,{useDefaults:true})})}const description=await readDescription(input,"twp task create help");const projectId=await ctx.projectId(input.flags.get("--project"));return withResolved(
148
- input,{projectId,...description!==void 0?{description}:{},...await resolveStatusAndType(input,ctx,projectId,{useDefaults:true})})},plan:input=>isPrivatePlan(input)?{method:"POST",path:PRIVATE_TASKS_PATH,body:taskBody(input)}:{method:"POST",path:`/api/v2/projects/${encodeURIComponent(requireResolved(input,"projectId"))}/tasks`,body:taskBody(input)},summarize:body=>pick(taskObject(body),GET_COLUMNS),raw:taskObject,plannedNotes:input=>{const notes=[];const status=input.resolved?.["status_defaulted"];
149
- const type=input.resolved?.["type_defaulted"];if(status!==void 0)notes.push(`--status \u672A\u6307\u5B9A\u306E\u305F\u3081\u3001\u65E2\u5B9A\u306E\u30B9\u30C6\u30FC\u30BF\u30B9\u300C${status}\u300D\u3092\u4F7F\u3044\u307E\u3059\u3002`);if(type!==void 0)notes.push(`--type \u672A\u6307\u5B9A\u306E\u305F\u3081\u3001\u65E2\u5B9A\u306E\u7A2E\u5225\u300C${type}\u300D\u3092\u4F7F\u3044\u307E\u3059\u3002`);return notes}},{name:"update",summary:"\u30BF\u30B9\u30AF\u3092\u66F4\u65B0\u3059\u308B",usage:'tw\
150
- p task update <\u30AD\u30FC|ID> [--status <\u540D\u524D>] [--assignee <me|\u540D\u524D>] [--subject "<\u4EF6\u540D>"]',description:`${TASK_REF_HELP}
179
+ "twp task create help")}if(wantsPrivateSurface(input)){rejectPrivateUnsupportedFlags(input);const privateDescription=await readDescription(input,"twp task create help");return withResolved(input,{surface:PRIVATE_SURFACE2,...privateDescription!==void 0?{description:privateDescription}:{},...await resolvePrivateStatusAndType(input,ctx,{useDefaults:true}),...await resolvePrivateExtras(input,ctx),...await resolvePrivateParent(input,ctx)})}const description=await readDescription(input,"twp task creat\
180
+ e help");const projectId=await ctx.projectId(input.flags.get("--project"));return withResolved(input,{projectId,...description!==void 0?{description}:{},...await resolveStatusAndType(input,ctx,projectId,{useDefaults:true}),...await resolveExtras(input,ctx,projectId)})},plan:input=>isPrivatePlan2(input)?{method:"POST",path:PRIVATE_TASKS_PATH,body:taskBody(input)}:{method:"POST",path:`/api/v2/projects/${encodeURIComponent(requireResolved(input,"projectId"))}/tasks`,body:taskBody(input)},summarize:body=>pick(
181
+ taskObject(body),GET_COLUMNS),raw:taskObject,plannedNotes:input=>{const notes=[];const status=input.resolved?.["status_defaulted"];const type=input.resolved?.["type_defaulted"];if(status!==void 0)notes.push(`--status \u672A\u6307\u5B9A\u306E\u305F\u3081\u3001\u65E2\u5B9A\u306E\u30B9\u30C6\u30FC\u30BF\u30B9\u300C${status}\u300D\u3092\u4F7F\u3044\u307E\u3059\u3002`);if(type!==void 0)notes.push(`--type \u672A\u6307\u5B9A\u306E\u305F\u3081\u3001\u65E2\u5B9A\u306E\u7A2E\u5225\u300C${type}\u300D\u3092\u4F7F\u3044\u307E\u3059\u3002`);
182
+ return notes}},{name:"update",summary:"\u30BF\u30B9\u30AF\u3092\u66F4\u65B0\u3059\u308B",usage:'twp task update <\u30AD\u30FC|ID> [--status <\u540D\u524D>] [--assignee <me|\u540D\u524D>] [--subject "<\u4EF6\u540D>"] [--category <\u540D\u524D>] [--label <\u540D\u524D>] [--clear <\u9805\u76EE>]',description:`${TASK_REF_HELP}
151
183
 
152
184
  \u6307\u5B9A\u3057\u305F\u9805\u76EE\u3060\u3051\u3092\u5909\u66F4\u3057\u307E\u3059\uFF08\u6307\u5B9A\u3057\u306A\u304B\u3063\u305F\u9805\u76EE\u306F\u5909\u308F\u308A\u307E\u305B\u3093\uFF09\u3002
153
185
  \u5909\u66F4\u3059\u308B\u9805\u76EE\u30921\u3064\u3082\u6307\u5B9A\u3057\u306A\u3044\u3068\u30A8\u30E9\u30FC\u306B\u306A\u308A\u307E\u3059\u2014\u2014\u4F55\u3082\u5909\u308F\u3089\u306A\u3044\u66F4\u65B0\u3067\u3082\u3001
@@ -155,13 +187,15 @@ p task update <\u30AD\u30FC|ID> [--status <\u540D\u524D>] [--assignee <me|\u540D
155
187
 
156
188
  ${PRIVATE_HELP}
157
189
 
158
- `+FIELD_HELP,flags:[...FIELD_FLAGS,TASK_REF_FLAG,PROJECT_FLAG],async prepare(input,ctx){const ref=singleRef(input,{flag:"--task",label:"\u30BF\u30B9\u30AF",usage:"twp task update help"});checkPureFields(input);if(!FIELD_FLAGS.some(flag=>input.flags.has(flag.name))){throw new UsageError("\u5909\u66F4\u3059\u308B\u9805\u76EE\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",`\u6307\u5B9A\u3067\u304D\u308B\u9805\u76EE: ${FIELD_FLAGS.map(flag=>flag.name).join(" / ")}`)}const surface=taskSurface(
159
- input,ref);if(surface===PRIVATE_SURFACE)rejectPrivateUnsupportedFlags(input);const description=await readDescription(input,"twp task update help");if(surface===PRIVATE_SURFACE){return withResolved(input,{surface:PRIVATE_SURFACE,taskId:await resolvePrivateTaskId(ctx,ref),...description!==void 0?{description}:{},...await resolvePrivateStatusAndType(input,ctx,{useDefaults:false})})}const located=await resolveTaskLocation(input,ctx,ref);return withResolved(input,{...located,...description!==void 0?{
160
- description}:{},...await resolveStatusAndType(input,ctx,located.projectId,{useDefaults:false})})},plan:input=>{const taskId=encodeURIComponent(requireResolved(input,"taskId"));const body=taskBody(input);if(isPrivatePlan(input))return{method:"PUT",path:`${PRIVATE_TASKS_PATH}/${taskId}`,body};return{method:"PUT",path:`/api/v2/projects/${encodeURIComponent(requireResolved(input,"projectId"))}/tasks/${taskId}`,body}},summarize:body=>pick(taskObject(body),GET_COLUMNS),raw:taskObject},{name:"delete",summary:"\
161
- \u30BF\u30B9\u30AF\u3092\u524A\u9664\u3059\u308B",usage:"twp task delete <\u30AD\u30FC|ID> --yes [--project <\u30B3\u30FC\u30C9|ID|__private__>]",description:`${TASK_REF_HELP}
190
+ ${FIELD_HELP}
191
+
192
+ `+CLEAR_HELP,flags:[...FIELD_FLAGS,CLEAR_FLAG,TASK_REF_FLAG,PROJECT_FLAG],async prepare(input,ctx){const ref=singleRef(input,{flag:"--task",label:"\u30BF\u30B9\u30AF",usage:"twp task update help"});checkPureFields(input);const changed=FIELD_FLAGS.some(flag=>input.flags.has(flag.name)||repeatedValues(input,flag.name).length>0)||repeatedValues(input,CLEAR_FLAG.name).length>0;if(!changed){throw new UsageError("\u5909\u66F4\u3059\u308B\u9805\u76EE\u30921\u3064\u4EE5\u4E0A\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",
193
+ `\u6307\u5B9A\u3067\u304D\u308B\u9805\u76EE: ${FIELD_FLAGS.map(flag=>flag.name).join(" / ")} / ${CLEAR_FLAG.name}`)}const surface=taskSurface(input,ref);if(surface===PRIVATE_SURFACE2)rejectPrivateUnsupportedFlags(input);const description=await readDescription(input,"twp task update help");if(surface===PRIVATE_SURFACE2){return withResolved(input,{surface:PRIVATE_SURFACE2,taskId:await resolvePrivateTaskId(ctx,ref),...description!==void 0?{description}:{},...await resolvePrivateStatusAndType(input,
194
+ ctx,{useDefaults:false}),...await resolvePrivateExtras(input,ctx),...await resolvePrivateParent(input,ctx)})}const located=await resolveTaskLocation(input,ctx,ref);return withResolved(input,{...located,...description!==void 0?{description}:{},...await resolveStatusAndType(input,ctx,located.projectId,{useDefaults:false}),...await resolveExtras(input,ctx,located.projectId)})},plan:input=>{const taskId=encodeURIComponent(requireResolved(input,"taskId"));const body=taskBody(input);if(isPrivatePlan2(
195
+ input))return{method:"PUT",path:`${PRIVATE_TASKS_PATH}/${taskId}`,body};return{method:"PUT",path:`/api/v2/projects/${encodeURIComponent(requireResolved(input,"projectId"))}/tasks/${taskId}`,body}},summarize:body=>pick(taskObject(body),GET_COLUMNS),raw:taskObject},{name:"delete",summary:"\u30BF\u30B9\u30AF\u3092\u524A\u9664\u3059\u308B",usage:"twp task delete <\u30AD\u30FC|ID> --yes [--project <\u30B3\u30FC\u30C9|ID|__private__>]",description:`${TASK_REF_HELP}
162
196
 
163
197
  \u524A\u9664\u306F\u53D6\u308A\u6D88\u305B\u307E\u305B\u3093\u3002\u30B5\u30D6\u30BF\u30B9\u30AF\u3092\u6301\u3064\u30BF\u30B9\u30AF\u3092\u6D88\u3059\u3068\u3001\u30B5\u30FC\u30D0\u5074\u306E\u898F\u5247\u306B\u5F93\u3063\u3066
164
198
  \u5B50\u3082\u4E00\u7DD2\u306B\u6271\u308F\u308C\u307E\u3059\u3002\u5148\u306B twp task subtasks <\u30AD\u30FC> \u3067\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002
165
199
 
166
- `+PRIVATE_HELP,destructive:true,flags:[TASK_REF_FLAG,PROJECT_FLAG],async prepare(input,ctx){const ref=singleRef(input,{flag:"--task",label:"\u30BF\u30B9\u30AF",usage:"twp task delete help"});if(taskSurface(input,ref)===PRIVATE_SURFACE){return withResolved(input,{surface:PRIVATE_SURFACE,taskId:await resolvePrivateTaskId(ctx,ref)})}return withResolved(input,await resolveTaskLocation(input,ctx,ref))},plan:input=>{const taskId=encodeURIComponent(requireResolved(input,"taskId"));if(isPrivatePlan(input))
167
- return{method:"DELETE",path:`${PRIVATE_TASKS_PATH}/${taskId}`};return{method:"DELETE",path:`/api/v2/projects/${encodeURIComponent(requireResolved(input,"projectId"))}/tasks/${taskId}`}},summarize:body=>acknowledgement(body,"\u30BF\u30B9\u30AF\u524A\u9664"),raw:body=>acknowledgement(body,"\u30BF\u30B9\u30AF\u524A\u9664")}],subresources:[taskCommentResource]};export{taskDomain};
200
+ `+PRIVATE_HELP,destructive:true,flags:[TASK_REF_FLAG,PROJECT_FLAG],async prepare(input,ctx){const ref=singleRef(input,{flag:"--task",label:"\u30BF\u30B9\u30AF",usage:"twp task delete help"});if(taskSurface(input,ref)===PRIVATE_SURFACE2){return withResolved(input,{surface:PRIVATE_SURFACE2,taskId:await resolvePrivateTaskId(ctx,ref)})}return withResolved(input,await resolveTaskLocation(input,ctx,ref))},plan:input=>{const taskId=encodeURIComponent(requireResolved(input,"taskId"));if(isPrivatePlan2(input))
201
+ return{method:"DELETE",path:`${PRIVATE_TASKS_PATH}/${taskId}`};return{method:"DELETE",path:`/api/v2/projects/${encodeURIComponent(requireResolved(input,"projectId"))}/tasks/${taskId}`}},summarize:body=>acknowledgement(body,"\u30BF\u30B9\u30AF\u524A\u9664"),raw:body=>acknowledgement(body,"\u30BF\u30B9\u30AF\u524A\u9664")}],subresources:[taskCommentResource,...taskMasterResources]};export{taskDomain};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tocca-systems/twp-cli",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "TWP CLI — Tocca Working Platform の CLI 型統合インターフェース(AIエージェントハーネス)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -43,7 +43,7 @@
43
43
  "undici": "^8.10.2"
44
44
  },
45
45
  "devDependencies": {
46
- "@changesets/cli": "3.0.2",
46
+ "@changesets/cli": "3.0.3",
47
47
  "@eslint/js": "^10.0.1",
48
48
  "@jmespath-community/jmespath": "^1.3.0",
49
49
  "@types/node": "^26.5.1",