@tocca-systems/twp-cli 0.15.1 → 0.17.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 +21 -0
- package/command-model/_routes.json +1939 -0
- package/command-model/analysis.json +4 -4
- package/command-model/attendance.json +2 -2
- package/command-model/badge.json +4 -4
- package/command-model/dynamo-inquiry.json +41 -0
- package/command-model/holiday.json +19 -19
- package/command-model/index.json +5 -5
- package/command-model/invoice.json +1 -1
- package/command-model/project.json +42 -0
- package/command-model/sales.json +150 -150
- package/command-model/staff-kpi.json +47 -6
- package/command-model/staffing-plan.json +41 -0
- package/command-model/user-group.json +2 -2
- package/dist/api-command-UIL4WGMG.js +127 -0
- package/dist/{chunk-2SGDY6YP.js → chunk-2VISRLWS.js} +1 -1
- package/dist/{chunk-HCO3IYGJ.js → chunk-EZCMF4I3.js} +38 -18
- package/dist/{chunk-BPMSIIOU.js → chunk-KXFT226N.js} +11 -11
- package/dist/cli.js +4 -4
- package/dist/{commands-RNBJ3AKL.js → commands-UGGBVOYU.js} +23 -21
- package/dist/{project-KIPSH5GP.js → project-OKTJ32JT.js} +1 -1
- package/dist/run-DWQEHR6I.js +4 -0
- package/dist/{setup-OULTAG6G.js → setup-I4PA2TQW.js} +1 -1
- package/dist/{task-UK4QO26W.js → task-7K54BO5U.js} +1 -1
- package/package.json +1 -1
- package/dist/api-command-HGTPIEAP.js +0 -73
- package/dist/run-BJQLIPWN.js +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{EngineNotConfiguredError,NoopEngine,UnknownEngineError,aiUnavailableLabel,assertKnownEngine,failureHint,isAiUnavailable,needsHumanToRestoreAi}from"./chunk-ZOOEH7ZE.js";import{buildLoopConfig,describeOperations,evaluateOwnership,formatHookIds,formatHookWiring,localDate,loopStateDir,runPrefetch,runPreflight}from"./chunk-
|
|
3
|
+
import{EngineNotConfiguredError,NoopEngine,UnknownEngineError,aiUnavailableLabel,assertKnownEngine,failureHint,isAiUnavailable,needsHumanToRestoreAi}from"./chunk-ZOOEH7ZE.js";import{CapacityReporter,buildLoopConfig,describeOperations,evaluateOwnership,formatHookIds,formatHookWiring,localDate,loopStateDir,runPrefetch,runPreflight}from"./chunk-EZCMF4I3.js";import{claudeConfigDir,exclusiveInflightEntries,formatExclusiveEntry,normalizeSkillName,resolveDetectDeps,skillOfItem,spawnSyncResolved}from"./chunk-3WJHTPOZ.js";
|
|
4
4
|
import{AgentLoopApi,REQUIRE_ZERO_STATUS,ScheduleApi,collectDue,describeError,filterByStatus,gateStatus,isPermanent,nowInZone,parseCounts,pick,pickString,promptSection}from"./chunk-N56AWWTM.js";import{compareVersionCores,parseVersionCore}from"./chunk-DXXFUNYN.js";import{killProcessTree,system32}from"./chunk-N2UVRM3Z.js";import{joinFor}from"./chunk-PMOUHEJQ.js";import{PRIVATE_PROJECT_REF,isPrivateProjectRef,privateProjectId,projectFileKey}from"./chunk-GY7KI5E5.js";import{
|
|
5
5
|
AuthSession}from"./chunk-63LDNYGW.js";import{extractLeadingTaskKey}from"./chunk-II5RVJQN.js";import{effectiveApiUrl,resolveProfile}from"./chunk-NERYSBA4.js";import"./chunk-RZVI6PMW.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import{resolveProjectRef,uuidProjectIdPolicy}from"./chunk-5QCAIKFE.js";import"./chunk-VSJBJXZO.js";import fs11 from"fs";import path9 from"path";import{execFileSync}from"child_process";import fs from"fs";import path from"path";var DEFAULT_GRACE_MS=6e4;var InstanceLock=class{constructor(lockDir2,opts={}){this.lockDir=lockDir2;this.opts=opts}lockDir;opts;owned=null;acquire(){const mine=this.tryMkdir();if(mine)return{acquired:true,reason:"",note:null};const oldPid=this.readPid();if(oldPid!==null){if(this.isLoop(oldPid)){return{acquired:false,reason:`\u540C\u3058\u30DE\u30B7\u30F3\u3067\u5225\u306E task-loop \u304C\u7A3C\u50CD\u4E2D\u3067\u3059\uFF08pid=${oldPid} / \u30ED\u30C3\u30AF: ${this.lockDir}\uFF09`,note:null}}const note=`\
|
|
6
6
|
\u30ED\u30C3\u30AF\u306EPID ${oldPid} \u306F\u5225\u306E\u30D7\u30ED\u30BB\u30B9\u306B\u518D\u5229\u7528\u3055\u308C\u3066\u3044\u307E\u3059\uFF08\u30EB\u30FC\u30D7\u3067\u306F\u306A\u3044\uFF09\u2192 \u6B8B\u9AB8\u3068\u3057\u3066\u5F15\u304D\u53D6\u308A\u307E\u3059`;return this.takeOver(note)}const age=this.lockAgeMs();const grace=this.opts.graceMs??DEFAULT_GRACE_MS;if(age===null||age<grace){return{acquired:false,reason:`\u30ED\u30C3\u30AF\u304C\u4F5C\u6210\u76F4\u5F8C\u306E\u305F\u3081\u5F85\u6A5F\u5074\u306B\u5012\u3057\u307E\u3059\uFF08\u30ED\u30C3\u30AF: ${this.
|
|
@@ -28,25 +28,27 @@ since===null?null:this.now()-this.since;this.since=null;this.expired=false;retur
|
|
|
28
28
|
note:null}}if(this.expired)return{wait:false,logs:[this.expiredLog()],note:expiredNote()};const now=this.now();if(this.since===null){this.since=now;return{wait:true,logs:[` \u23F8 ${r.detail}`,` \u30C8\u30E9\u30B9\u30C8\u304C\u5C0E\u51FA\u3055\u308C\u308B\u307E\u3067\u30A2\u30A4\u30C6\u30E0\u3092\u53D6\u308A\u307E\u305B\u3093\uFF08\u6700\u5927${Math.round(this.timeoutMs/6e4)}\u5206\uFF09\u3002\u672A\u30C8\u30E9\u30B9\u30C8\u306E\u307E\u307E\u5B9F\u884C\u3059\u308B\u3068 permissions.allow \u304C\u7121\u8996\u3055\u308C\u3001\u6210\u679C\u3092\u51FA\u3057\u3066\u3082 untrusted \u3067\u8A18\u9332\u3055\u308C\u307E\u3059`],
|
|
29
29
|
note:null}}const waited=now-this.since;if(waited>=this.timeoutMs){this.expired=true;return{wait:false,logs:[this.expiredLog()],note:expiredNote()}}return{wait:true,logs:[` \u23F8 ${r.detail}\uFF08\u5F85\u6A5F ${Math.round(waited/1e3)}\u79D2\uFF09`],note:null}}expiredLog(){return` \u26D4 ${Math.round(this.timeoutMs/6e4)}\u5206\u5F85\u3063\u3066\u3082\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u306E\u30C8\u30E9\u30B9\u30C8\u304C\u5C0E\u51FA\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002\u7121\u8A00\u306E\u7121\u7A3C\u50CD\u3092\u907F\u3051\u308B\u305F\u3081\u901A\u5E38\u52D5\u4F5C\u3078\u843D\u3068\u3057\u307E\u3059\uFF08untrusted \u3067\u5931\u6557\u8A18\u9332\u304C\u6B8B\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\uFF09\u3002\u78BA\u8A8D: runner-state status \uFF0F \u67A0\u306E .claude.json \u306E projects[<workspace>].hasTrustDialogAccepted`}};
|
|
30
30
|
function expiredNote(){return["\u3010\u8B66\u544A: \u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u304C\u672A\u30C8\u30E9\u30B9\u30C8\u3067\u3059\u3011","\u3053\u306E\u30DE\u30B7\u30F3\u306E claude \u306F\u30EF\u30FC\u30AF\u30B9\u30DA\u30FC\u30B9\u3092\u672A\u30C8\u30E9\u30B9\u30C8\u306E\u72B6\u614B\u3067\u8D77\u52D5\u3057\u3066\u3044\u307E\u3059\u3002","permissions.allow \u304C\u7121\u8996\u3055\u308C\u3001\u6210\u679C\u3092\u51FA\u3057\u5207\u3063\u3066\u3082\u5B9F\u884C\u7D50\u679C\u304C untrusted \u3068\u3057\u3066\u8A18\u9332\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002",
|
|
31
|
-
"\u30C8\u30E9\u30B9\u30C8\u306E\u5C0E\u51FA\uFF08runner-state \u306E2\u5206\u3054\u3068\u306E\u6CBB\u7652\uFF09\u304C30\u5206\u4EE5\u4E0A\u6210\u7ACB\u3057\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u3053\u306E\u72B6\u614B\u306E\u307E\u307E\u5B9F\u884C\u3057\u3066\u3044\u307E\u3059\u3002"].join("\n")}import os from"os";var RunnerRegistrationError=class extends Error{};var RunnerSession=class{constructor(api,config,log,now=()=>Date.now()){this.api=api;this.config=config;this.log=log;this.now=now;this.forcePending=config.forceRunner}api;config;log;now;registered=false;heartbeatTimeoutServer=null;forcePending;hooksPayloadWarningLogged=false;timer=null;phase="idle";currentItemId="";lastTickAt=0;lastOkAt=0;failures=0;sending=false;silenceWarned=false;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
this.log.log(
|
|
40
|
-
this.log.log(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
\
|
|
44
|
-
this.
|
|
45
|
-
config.heartbeatIntervalSec
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
31
|
+
"\u30C8\u30E9\u30B9\u30C8\u306E\u5C0E\u51FA\uFF08runner-state \u306E2\u5206\u3054\u3068\u306E\u6CBB\u7652\uFF09\u304C30\u5206\u4EE5\u4E0A\u6210\u7ACB\u3057\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u3053\u306E\u72B6\u614B\u306E\u307E\u307E\u5B9F\u884C\u3057\u3066\u3044\u307E\u3059\u3002"].join("\n")}import os from"os";var RunnerRegistrationError=class extends Error{};var RunnerSession=class{constructor(api,config,log,now=()=>Date.now()){this.api=api;this.config=config;this.log=log;this.now=now;this.forcePending=config.forceRunner;this.capacity=config.capacityProbe===null?null:new CapacityReporter(config.capacityProbe,config.workspace,m=>this.log.log(m),process.env,this.now)}api;config;log;now;registered=false;heartbeatTimeoutServer=null;forcePending;hooksPayloadWarningLogged=false;timer=null;phase="idle";currentItemId="";lastTickAt=0;lastOkAt=0;failures=0;sending=false;silenceWarned=false;capacity;capacityRefresh(force){
|
|
32
|
+
const reporter=this.capacity;if(reporter===null)return null;return(force?reporter.refresh():reporter.refreshIfDue()).catch(err=>{this.log.log(` \u26A0\uFE0F capacity_probe \u3067\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F\uFF08${err.message}\uFF09\u3002\u67A0\u60C5\u5831\u306A\u3057\u3067\u7D9A\u884C\u3057\u307E\u3059`)})}payload(phase,itemId="",force=false){const p={runner_id:this.config.runnerId,run_id:this.config.runId,phase,pid:process.pid,safe_mode:this.config.safeMode};const host=os.
|
|
33
|
+
hostname();if(host)p.hostname=host;if(this.config.configHash)p.config_hash=this.config.configHash;const hooks=formatHookIds(this.config.prefetch,this.config.preflight);if(hooks.length<=512){p.hooks=hooks}else if(!this.hooksPayloadWarningLogged){this.log.log(` \u26A0\uFE0F \u30D5\u30C3\u30AF\u914D\u7DDA\u306E\u5831\u544A\u5024\u304C512\u6587\u5B57\u3092\u8D85\u3048\u305F\u305F\u3081\u53F0\u5E33\u3078\u306E\u5831\u544A\u3060\u3051\u3092\u7701\u7565\u3057\u307E\u3059\uFF08prefetch=${this.config.prefetch.
|
|
34
|
+
length}\u4EF6 / preflight=${this.config.preflight.length}\u4EF6\uFF09`);this.hooksPayloadWarningLogged=true}const capacity=this.capacity?.take()??null;if(capacity!==null)p.capacity=capacity;if(this.config.version)p.version=this.config.version;if(itemId)p.current_item_id=itemId;if(force)p.force=true;return p}async checkHeartbeatInterval(){const res=await this.api.runners();if(!res.ok)return;const timeout=pick(res.json,"heartbeat_timeout");if(typeof timeout!=="number")return;this.heartbeatTimeoutServer=
|
|
35
|
+
timeout;if(this.config.heartbeatIntervalSec>=timeout){this.log.log(` \u26A0\uFE0F AGENT_LOOP_HEARTBEAT_INTERVAL=${this.config.heartbeatIntervalSec}\u79D2 \u304C\u30B5\u30FC\u30D0\u306E\u6B7B\u6D3B\u3057\u304D\u3044\u5024 ${timeout}\u79D2 \u4EE5\u4E0A\u3067\u3059`);this.log.log(" \u3053\u306E\u307E\u307E\u3067\u306F\u81EA\u5206\u304C\u300C\u5FDC\u7B54\u306A\u3057\u300D\u3068\u5224\u5B9A\u3055\u308C\u3001\u5B9F\u884C\u4E2D\u306E\u30A2\u30A4\u30C6\u30E0\u3092\u4ED6\u6A5F\u306B\u56DE\u53CE\u3055\u308C\u3001\u8A08\u753B\u30ED\u30C3\u30AF\u306E\u5EF6\u9577\u3082 409 \u3067\u901A\u3089\u306A\u304F\u306A\u308A\u307E\u3059\uFF08\u3057\u304D\u3044\u5024\u306E 1/3 \u4EE5\u4E0B\u3092\u63A8\u5968\uFF09")}}async registerOrThrow(){
|
|
36
|
+
let lastStatus;let lastBody;let lastDetail;const registering=this.capacityRefresh(true);if(registering!==null)await registering;for(let attempt=1;;attempt++){const res=await this.api.registerRunner(this.payload("idle","",this.forcePending));this.forcePending=false;lastStatus=res.status;lastBody=res.json;lastDetail=describeError(res);if(res.ok){this.registered=true;this.log.log(` \u30E9\u30F3\u30CA\u30FC\u767B\u9332: ${this.config.runnerId}\uFF08run_id: ${this.config.runId}\uFF09`);return}const permanent=res.
|
|
37
|
+
status!==null&&res.status>=400&&res.status<500;if(!permanent&&attempt<3){this.log.log(` \u26A0\uFE0F \u30E9\u30F3\u30CA\u30FC\u767B\u9332\u306B\u5931\u6557\uFF08${lastDetail}\uFF09\u3002${attempt}\u56DE\u76EE\u30FB5\u79D2\u5F8C\u306B\u518D\u8A66\u884C\u3057\u307E\u3059`);this.capacity?.rearm();await sleep(5e3);continue}break}if(lastStatus===409){this.log.log("\u274C \u3053\u306E\u30E9\u30F3\u30CA\u30FCID\u306F\u5225\u30D7\u30ED\u30BB\u30B9\u304C\u7A3C\u50CD\u4E2D\u3068\u3057\u3066\u767B\u9332\u3055\u308C\u3066\u3044\u307E\u3059\uFF08HTTP 409\uFF09");
|
|
38
|
+
this.log.log(" \u524D\u306E\u30D7\u30ED\u30BB\u30B9\u304C\u7570\u5E38\u7D42\u4E86\u3057\u3066\u3044\u308B\u5834\u5408\u306F\u767B\u9332\u3092\u596A\u3063\u3066\u8D77\u52D5\u3057\u3066\u304F\u3060\u3055\u3044:");this.log.log(` twp task-loop run --project ${this.config.projectRef} --force-runner`);this.log.log(" \u26A0\uFE0F \u305F\u3060\u3057**\u524D\u306E\u30D7\u30ED\u30BB\u30B9\u304C\u751F\u304D\u3066\u3044\u308B\u5834\u5408\u306F\u4F7F\u308F\u306A\u3044\u3053\u3068**\uFF08\u5B9F\u884C\u4E2D\u30A2\u30A4\u30C6\u30E0\u304C\u4E8C\u91CD\u306B\u8D70\u308A\u307E\u3059\uFF09");
|
|
39
|
+
this.log.log(` \uFF08\u30B5\u30FC\u30D0\u306E\u767B\u9332\u306F\u6B7B\u6D3B\u3057\u304D\u3044\u5024 ${this.heartbeatTimeoutServer??600}\u79D2 \u307E\u3067 live \u6271\u3044\u306E\u305F\u3081\u3001\u5F85\u3063\u3066\u3082\u6570\u5206\u304B\u304B\u308A\u307E\u3059\uFF09`)}else if(lastStatus===403){if(pickString(lastBody,"reason")==="max_runners_exceeded"){this.log.log("\u274C \u7A3C\u50CD\u30E9\u30F3\u30CA\u30FC\u304C\u4E0A\u9650\u306B\u9054\u3057\u3066\u3044\u307E\u3059\uFF08HTTP 403\u30FBmax_runners_exceeded\uFF09");
|
|
40
|
+
this.log.log(" \u53F0\u6570\u8A2D\u5B9A\uFF08\u30B5\u30FC\u30D0\u5074 AGENT_LOOP_MAX_RUNNERS\uFF09\u3092\u898B\u76F4\u3059\u304B\u3001\u4E0D\u8981\u306A\u30E9\u30F3\u30CA\u30FC\u3092\u505C\u6B62\u3057\u3066\u304F\u3060\u3055\u3044");this.log.log(" **--force-runner \u3067\u306F\u901A\u308A\u307E\u305B\u3093**\uFF08\u8A2D\u5B9A\u3092\u76F4\u3059\u307E\u3067\u540C\u3058\u7D50\u679C\u306B\u306A\u308A\u307E\u3059\uFF09")}else{this.log.log(`\u274C \u30E9\u30F3\u30CA\u30FC\u767B\u9332\u304C 403 \u3067\u62D2\u5426\u3055\u308C\u307E\u3057\u305F: ${lastDetail}`);
|
|
41
|
+
this.log.log(" \u53F0\u6570\u4E0A\u9650\u3068\u306F\u5225\u306E\u7406\u7531\u3067\u3059\u3002\u78BA\u8A8D: \u30ED\u30B0\u30A4\u30F3\u4E2D\u30E6\u30FC\u30B6\u30FC\u306E\u6A29\u9650\uFF0F\u30C6\u30CA\u30F3\u30C8\u306E\u30AF\u30EC\u30B8\u30C3\u30C8\u72B6\u614B")}}else{this.log.log(`\u274C \u30E9\u30F3\u30CA\u30FC\u767B\u9332\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${lastDetail}\uFF09\u3002\u767B\u9332\u3067\u304D\u306A\u3044\u72B6\u614B\u3067\u306F claim \u304C\u901A\u3089\u306A\u3044\u305F\u3081\u7D42\u4E86\u3057\u307E\u3059`)}
|
|
42
|
+
throw new RunnerRegistrationError(`\u30E9\u30F3\u30CA\u30FC\u767B\u9332\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08http=${lastStatus??"\u306A\u3057"}\uFF09`)}async beat(phase,itemId=""){this.phase=phase;this.currentItemId=itemId;if(!this.registered)return;const refreshing=this.capacityRefresh(false);if(refreshing!==null)await refreshing;const res=await this.api.heartbeatRunner(this.payload(phase,itemId));if(res.ok){this.markSent();return}if(res.status===409){this.log.log(" \u26A0\uFE0F heartbeat \u304C 4\
|
|
43
|
+
09\uFF08\u767B\u9332\u304C\u5225\u30D7\u30ED\u30BB\u30B9\u306B\u596A\u308F\u308C\u305F\u53EF\u80FD\u6027\uFF09\u3002\u6B21\u306E\u30A2\u30A4\u30C6\u30E0\u53D6\u5F97\u6642\u306B\u767B\u9332\u3057\u76F4\u3057\u307E\u3059");this.registered=false;this.failures+=1;return}this.failures+=1;this.log.log(` \u26A0\uFE0F heartbeat \u306E\u9001\u4FE1\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${describeError(res)}\u30FBphase=${phase}\uFF09\u3002\u7D9A\u304F\u3068\u4ED6\u6A5F\u304B\u3089\u5FDC\u7B54\u306A\u3057\u3068\u898B\u306A\u3055\u308C\u307E\u3059`)}markSent(){
|
|
44
|
+
if(this.failures>0){const silentSec=this.lastOkAt===0?0:Math.round((this.now()-this.lastOkAt)/1e3);this.log.log(` \u2705 heartbeat \u306E\u9001\u4FE1\u304C\u5FA9\u5E30\u3057\u307E\u3057\u305F\uFF08\u9023\u7D9A\u5931\u6557 ${this.failures}\u56DE\u30FB\u6C88\u9ED9 ${silentSec}\u79D2\uFF09`)}this.failures=0;this.silenceWarned=false;this.lastOkAt=this.now()}startHeartbeatWorker(){if(!this.registered){this.log.log(" \u26A0\uFE0F \u30E9\u30F3\u30CA\u30FC\u672A\u767B\u9332\u306E\u305F\u3081 heartbeat \u306E\u5468\u671F\u9001\u4FE1\u3092\u958B\u59CB\u3057\u307E\u305B\u3093\uFF08\u5B9F\u884C\u4E2D\u306B dead \u5224\u5B9A\u3055\u308C\u307E\u3059\uFF09");
|
|
45
|
+
return}if(this.timer)return;this.lastTickAt=this.now();if(this.lastOkAt===0)this.lastOkAt=this.now();this.timer=setInterval(()=>{void this.heartbeatTick()},this.config.heartbeatIntervalSec*1e3);this.timer.unref?.()}async heartbeatTick(){const intervalMs=this.config.heartbeatIntervalSec*1e3;const at=this.now();const sinceTick=this.lastTickAt===0?0:at-this.lastTickAt;this.lastTickAt=at;if(sinceTick>intervalMs*2){this.log.log(` \u26A0\uFE0F heartbeat \u306E\u5468\u671F\u9001\u4FE1\u304C ${Math.round(
|
|
46
|
+
sinceTick/1e3)}\u79D2\u3076\u308A\u306B\u767A\u706B\u3057\u307E\u3057\u305F\uFF08\u9593\u9694\u306F ${this.config.heartbeatIntervalSec}\u79D2\uFF09\u3002\u30D7\u30ED\u30BB\u30B9\u304C\u6B62\u307E\u3063\u3066\u3044\u305F\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059`)}if(this.sending){this.log.log(" \u26A0\uFE0F \u524D\u56DE\u306E heartbeat \u304C\u672A\u5B8C\u4E86\u306E\u305F\u3081\u4ECA\u56DE\u306E\u9001\u4FE1\u3092\u98DB\u3070\u3057\u307E\u3057\u305F\uFF08\u5FDC\u7B54\u304C\u9045\u5EF6\u3057\u3066\u3044\u307E\u3059\uFF09");
|
|
47
|
+
return}this.sending=true;try{const refreshing=this.capacityRefresh(false);if(refreshing!==null)await refreshing;const res=await this.api.heartbeatRunner(this.payload(this.phase,this.currentItemId));if(res.ok){this.markSent();return}this.failures+=1;if(res.status===409){this.registered=false;if(this.failures<=3||this.failures%5===0){this.log.log(` \u26A0\uFE0F heartbeat\uFF08\u5468\u671F\u9001\u4FE1\uFF09\u304C 409\u3002\u767B\u9332\u304C\u5225\u30D7\u30ED\u30BB\u30B9\u306B\u596A\u308F\u308C\u305F\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\uFF08${this.
|
|
48
|
+
failures}\u56DE\u9023\u7D9A\u30FB\u6B21\u306E\u30A2\u30A4\u30C6\u30E0\u53D6\u5F97\u6642\u306B\u767B\u9332\u3057\u76F4\u3057\u307E\u3059\uFF09`)}}else if(this.failures<=3||this.failures%5===0){this.log.log(` \u26A0\uFE0F heartbeat \u306E\u5468\u671F\u9001\u4FE1\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08${describeError(res)}\u30FB${this.failures}\u56DE\u9023\u7D9A\u30FBphase=${this.phase}\uFF09`)}}catch(err){this.failures+=1;if(this.failures<=3||this.failures%5===0){this.log.log(` \u26A0\uFE0F hear\
|
|
49
|
+
tbeat \u306E\u5468\u671F\u9001\u4FE1\u3067\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F\uFF08${err.message}\u30FB${this.failures}\u56DE\u9023\u7D9A\uFF09`)}}finally{this.sending=false;this.warnIfSilent()}}warnIfSilent(){if(this.silenceWarned||this.lastOkAt===0)return;const timeout=this.heartbeatTimeoutServer??600;const silentSec=Math.round((this.now()-this.lastOkAt)/1e3);if(silentSec<timeout)return;this.silenceWarned=true;this.log.log(` \u26D4 heartbeat \u3092 ${silentSec}\u79D2 \u9001\u308C\u3066\u3044\u307E\u305B\u3093\uFF08\u30B5\u30FC\u30D0\
|
|
50
|
+
\u306E\u6B7B\u6D3B\u3057\u304D\u3044\u5024 ${timeout}\u79D2\uFF09\u3002\u5B9F\u884C\u4E2D\u306E\u30A2\u30A4\u30C6\u30E0\u304C\u4ED6\u6A5F\u306B\u56DE\u53CE\u3055\u308C\u3046\u308B\u72B6\u614B\u3067\u3059`)}stopHeartbeatWorker(){if(!this.timer)return;clearInterval(this.timer);this.timer=null}async deregister(){this.stopHeartbeatWorker();if(!this.registered)return;this.registered=false;await this.api.deregisterRunner(this.payload("idle"))}};function sleep(ms){return new Promise(resolve=>setTimeout(
|
|
51
|
+
resolve,ms))}var PlanLock=class{constructor(deps){this.deps=deps;this.renewIntervalSec=deps.config.planLockRenewIntervalSec}deps;held=false;startedAt="";failStreak=0;permanentFail=false;ownLastFinish="";lostReason=null;renewTimer=null;renewStopped=true;renewIntervalSec;renewInFlight=null;now(){return this.deps.now?.()??Date.now()}sleep(ms){return(this.deps.sleepFn??sleep)(ms)}async acquire(){const{api,config,log,runner}=this.deps;if(await this.alreadyPlannedByOther())return"not-needed";const deadline=this.now()+
|
|
50
52
|
config.planLockWaitMaxSec*1e3;let waited=false;let firstFinished="";let retriedRegister=false;let stealAttempts=0;for(;;){const res=await api.planStart(config.runnerId,config.runId);if(!res.ok&&res.status===409&&!retriedRegister){log.log(" \u26A0\uFE0F plan/start \u304C 409\uFF08\u30E9\u30F3\u30CA\u30FC\u672A\u767B\u9332\u6271\u3044\uFF09\u3002register \u304B\u3089\u3084\u308A\u76F4\u3057\u307E\u3059");retriedRegister=true;await this.deps.reregister();continue}if(!res.ok){this.failStreak+=1;if(isPermanent(
|
|
51
53
|
res)){log.log(` \u26D4 \u8A08\u753B\u30ED\u30C3\u30AF\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\uFF08HTTP ${res.status}\u30FB${this.failStreak}\u30B5\u30A4\u30AF\u30EB\u9023\u7D9A\uFF09\u3002**\u518D\u8A66\u884C\u3067\u306F\u89E3\u6D88\u3057\u307E\u305B\u3093**`);log.log(` \u30B5\u30FC\u30D0\u304C\u8FD4\u3057\u305F\u7406\u7531: ${describeError(res)}`);log.log(" \u78BA\u8A8D: \u30ED\u30B0\u30A4\u30F3\u4E2D\u30E6\u30FC\u30B6\u30FC\u306E\u6A29\u9650\uFF0F--project \u306E\u6307\u5B9A\uFF0FAPI \u306E\u63A5\u7D9A\u5148");
|
|
52
54
|
this.permanentFail=true}else{log.log(` \u26D4 \u8A08\u753B\u30ED\u30C3\u30AF\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\uFF08${describeError(res)}\u30FB${this.failStreak}\u30B5\u30A4\u30AF\u30EB\u9023\u7D9A\uFF09\u3002\u6B21\u30B5\u30A4\u30AF\u30EB\u3067\u518D\u8A66\u884C\u3057\u307E\u3059`);this.permanentFail=false}log.log(" **\u3053\u306E\u30B5\u30A4\u30AF\u30EB\u306E\u8A08\u753B\u3092\u30B9\u30AD\u30C3\u30D7\u3057\u307E\u3059**\uFF08\u6392\u4ED6\u304C\u53D6\u308C\u306A\u3044\u72B6\u614B\u3067\u8A08\u753B\u3059\u308B\u3068\u3001\u8907\u6570\u53F0\u304C\u540C\u3058\u8A08\u753B\u3092\u7A4D\u307F\u307E\u3059\uFF09");
|
|
@@ -321,7 +323,7 @@ operations.preflightHosts;return new DispatchEngine(config.ai,log,{workspace:con
|
|
|
321
323
|
return path9.join(config.stateDir,`task-loop-${projectFileKey(config.projectId)}.lock.d`)}async function runTaskLoop(opts){if(opts.action==="stop")return await stopLoop(opts);const profile=resolveProfile(opts.profile);let creds;try{creds=new AuthSession(profile.name,profile.apiUrl).loadOrThrow()}catch(err){process.stderr.write(`${err.message}
|
|
322
324
|
`);return 1}const apiUrl=effectiveApiUrl(profile,creds.api_url);const session=new AuthSession(profile.name,apiUrl);const projectRef=opts.project??process.env.TWP_PROJECT??"";if(projectRef===""){process.stderr.write("--project <\u30AD\u30FC|UUID> \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08TWP_PROJECT \u3067\u3082\u53EF\uFF09\n");return 2}const projectApi=new ProjectApi(apiUrl,session);let project;try{project=await projectApi.resolve(projectRef)}catch(err){process.stderr.write(`${err.
|
|
323
325
|
message}
|
|
324
|
-
`);return 1}const projectId=project.id;if(opts.action==="setup"){const{runSetup,parseAiList}=await import("./setup-
|
|
326
|
+
`);return 1}const projectId=project.id;if(opts.action==="setup"){const{runSetup,parseAiList}=await import("./setup-I4PA2TQW.js");let ais;if(opts.ais!==void 0&&opts.ais.length>0){const parsed=parseAiList(opts.ais.join(","));if(parsed.unknown.length>0){process.stderr.write(`--ai \u306B\u672A\u77E5\u306E\u5024\u304C\u3042\u308A\u307E\u3059: ${parsed.unknown.join(" / ")}
|
|
325
327
|
`);return 2}ais=parsed.ais}return runSetup({projectId,projectRef,projectName:project.name===project.id?projectRef:`${project.code} / ${project.name}`,apiUrl,yes:opts.yes===true,...ais!==void 0?{ais}:{},...opts.workspace!==void 0?{workspace:opts.workspace}:{},...opts.aiConfigFile!==void 0?{aiConfigFile:opts.aiConfigFile}:{},...opts.noAiConfigFile===true?{noAiConfigFile:true}:{},...opts.profile!==void 0?{profile:opts.profile}:{}})}const config=buildLoopConfig({projectId,projectRef,apiUrl,safeMode:opts.
|
|
326
328
|
safe,daemon:opts.daemon,...opts.maxCycles!==void 0?{maxCycles:opts.maxCycles}:{},...opts.interval!==void 0?{intervalSec:opts.interval}:{},forceRunner:opts.forceRunner,...opts.engine!==void 0?{engine:opts.engine}:{},version:opts.version});const api=new AgentLoopApi({apiUrl,projectId,session});if(opts.action==="status"||opts.action==="schedule"){for(const warning of config.warnings)process.stderr.write(`\u26A0\uFE0F ${warning}
|
|
327
329
|
`)}if(opts.action==="status")return showStatus(api,config);if(opts.action==="schedule"){const{runScheduleCommand}=await import("./schedule-command-YPKIO3FK.js");return runScheduleCommand({api,projectApi,config},{now:opts.scheduleNow,counts:opts.scheduleCounts,gate:opts.scheduleGate,verbose:opts.verbose===true})}if(config.engine===""){process.stderr.write(`${new EngineNotConfiguredError().message}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{isRecord,pick,requireResolved,withResolved}from"./chunk-GFC2ASHE.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-
|
|
3
|
+
import{isRecord,pick,requireResolved,withResolved}from"./chunk-GFC2ASHE.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-2VISRLWS.js";import{ApiResponseError,UsageError}from"./chunk-M3GWY6NT.js";import{collapsesInUrlPath,safeProjectIdPolicy}from"./chunk-5QCAIKFE.js";import"./chunk-VSJBJXZO.js";var LIST_COLUMNS=["id","code","name","status","effective_status"];var GET_COLUMNS=["id","code","name","status","effective_status","display_flg","closed_flg","task_enabled_flg","start_date","end_date","created_at","updated_at"];var MEMBER_COLUMNS=["user_id","user_name","user_email","role","alias","department_name"];function memberItems(body){const list=isRecord(body)?body["list"]:void 0;if(!Array.isArray(list)){throw new ApiResponseError("\u30E1\u30F3\u30D0\u30FC\u4E00\u89A7\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")}
|
|
4
4
|
return list}var listPaging=envelopePaging({label:"\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u4E00\u89A7"});function listItems(body){return listPaging.items(body)}function projectObject(body){const project=isRecord(body)?body["project"]:void 0;if(!isRecord(project)){throw new ApiResponseError("\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u8A73\u7D30\u306E\u5FDC\u7B54\u306B project \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}return project}
|
|
5
5
|
var projectDomain={name:"project",summary:"\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306E\u4E00\u89A7\u30FB\u8A73\u7D30",operations:[{name:"list",summary:"\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u3092\u4E00\u89A7\u3059\u308B",usage:"twp project list [--all] [--limit <\u4EF6\u6570>] [--cursor <\u30AB\u30FC\u30BD\u30EB>] [--keyword <\u8A9E>] [--status <\u72B6\u614B>]",description:"--output json \u306F API \u304C\u8FD4\u3059\u5168\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u51FA\u3057\u307E\u3059\u3002\n--output table / text / tsv \u306F\u8981\u7D04\u5217\uFF08id / code / name / status / effective_status\uFF09\u3067\u3059\u3002\n\u6B32\u3057\u3044\u5217\u3060\u3051\u3092\
|
|
6
6
|
\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\n\n"+LIST_PAGING_HELP,flags:[...LIST_FLAGS,{name:"--keyword",summary:"\u30B3\u30FC\u30C9\u30FB\u540D\u79F0\u306E\u90E8\u5206\u4E00\u81F4\u3067\u7D5E\u308A\u8FBC\u3080",takesValue:true,placeholder:"<\u8A9E>"},{name:"--status",summary:"\u30B9\u30C6\u30FC\u30BF\u30B9\u3067\u7D5E\u308A\u8FBC\u3080\uFF08\u4F8B: active\uFF09",
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
+
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
+
import{CURATED_PAGING_VOCABULARY,buildPrepareContext,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain}from"./chunk-KXFT226N.js";import"./chunk-WVS4W5FY.js";import"./chunk-63LDNYGW.js";import"./chunk-FKIZ5ZJU.js";import"./chunk-O52CUEDO.js";import"./chunk-QQRJLH6B.js";import"./chunk-7WEYBZSK.js";import"./chunk-JKSXUBND.js";import"./chunk-II5RVJQN.js";import"./chunk-NERYSBA4.js";import"./chunk-RZVI6PMW.js";
|
|
4
|
+
import"./chunk-J7QYPKVK.js";import"./chunk-NHYMHCAT.js";import"./chunk-2VISRLWS.js";import"./chunk-M3GWY6NT.js";import"./chunk-5QCAIKFE.js";import"./chunk-VSJBJXZO.js";export{CURATED_PAGING_VOCABULARY,buildPrepareContext,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{PromptAbortedError,promptText}from"./chunk-L37NS5L2.js";import{localConfigPath,parseClaudeLauncher}from"./chunk-
|
|
3
|
+
import{PromptAbortedError,promptText}from"./chunk-L37NS5L2.js";import{localConfigPath,parseClaudeLauncher}from"./chunk-EZCMF4I3.js";import{AiConfig,detectAiClis,formatDetection,isDetectableAi,isSelectable}from"./chunk-3WJHTPOZ.js";import"./chunk-N2UVRM3Z.js";import"./chunk-PMOUHEJQ.js";import"./chunk-GY7KI5E5.js";import"./chunk-RZVI6PMW.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import fs from"fs";import path from"path";var RECOMMENDED_ROTATION={complex:["claude"],verify:["claude"],security:["claude"],support:["claude"],triage:["claude"],search:["claude"],simple:["claude"]};var RECOMMENDED_CHAINS={complex:["claude","codex"],verify:["claude","codex","copilot"],security:["claude","codex","copilot"],support:["claude","codex","copilot"],triage:["codex","gemini","copilot","claude"],search:["codex","gemini","copilot","claude"],simple:["codex","gemini","copilot","claude"]};var PREFERENCE=["claude","codex","gemini","co\
|
|
4
4
|
pilot"];function buildAiAssignment(selected){if(selected.length===0)throw new Error("\u9078\u629E\u3055\u308C\u305FAI\u304C\u7A7A\u3067\u3059");const fallbackOrder=PREFERENCE.filter(ai=>selected.includes(ai));for(const ai of selected)if(!fallbackOrder.includes(ai))fallbackOrder.push(ai);const chains={};const rotation={};for(const category of Object.keys(RECOMMENDED_CHAINS)){const filtered=(RECOMMENDED_CHAINS[category]??[]).filter(ai=>selected.includes(ai));const chain=filtered.length>0?filtered:
|
|
5
5
|
[...fallbackOrder];chains[category]=chain;const rot=(RECOMMENDED_ROTATION[category]??[]).filter(ai=>selected.includes(ai));const head=chain[0];rotation[category]=rot.length>0?rot:head===void 0?[...fallbackOrder]:[head]}return{primary_rotation:rotation,fallback_chains:chains}}var SETUP_EXIT_NO_CLI=3;var SETUP_EXIT_ABORTED=130;async function runSetup(opts){const env=opts.env??process.env;const rawOut=opts.out??(t=>void process.stdout.write(t));const rawErr=opts.err??(t=>void process.stderr.write(t));
|
|
6
6
|
const out=t=>rawOut(stripTerminalControls(t));const err=t=>rawErr(stripTerminalControls(t));const rawAsk=opts.ask??promptText;const ask=q=>rawAsk(stripTerminalControls(q));const detect=opts.detect??detectAiClis;try{return await setupFlow(opts,{env,out,err,ask,detect})}catch(e){if(e instanceof PromptAbortedError){err("\n\u4E2D\u6B62\u3057\u307E\u3057\u305F\u3002\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u306F\u4F5C\u6210\u3057\u3066\u3044\u307E\u305B\u3093\u3002\n \u5BFE\u8A71\u305B\u305A\u306B\u5B9F\u884C\u3059\u308B\u306B\u306F --yes \u3092\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u3002\n");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
3
|
import{PRIVATE_PROJECT_REF,isPrivateProjectRef}from"./chunk-GY7KI5E5.js";import{acknowledgement,isRecord,pick,requireResolved,singleRef,withResolved}from"./chunk-GFC2ASHE.js";import{charCount,readBody}from"./chunk-QVXZEUKN.js";import{repeatedValues}from"./chunk-O52CUEDO.js";import"./chunk-QQRJLH6B.js";import{PRIVATE_TASKS_PATH,TASK_MASTERS}from"./chunk-7WEYBZSK.js";import"./chunk-JKSXUBND.js";import{PRIVATE_TASK_KEY_PREFIX,isPrivateTaskKey,isTaskKey}from"./chunk-II5RVJQN.js";
|
|
4
|
-
import"./chunk-NERYSBA4.js";import"./chunk-RZVI6PMW.js";import"./chunk-J7QYPKVK.js";import"./chunk-NHYMHCAT.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-
|
|
4
|
+
import"./chunk-NERYSBA4.js";import"./chunk-RZVI6PMW.js";import"./chunk-J7QYPKVK.js";import"./chunk-NHYMHCAT.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-2VISRLWS.js";import{ApiResponseError,UsageError}from"./chunk-M3GWY6NT.js";import{isSafePathSegment,safeProjectIdPolicy}from"./chunk-5QCAIKFE.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`,
|
|
7
7
|
`\u3069\u3061\u3089\u3092\u6307\u3059\u304B --project \u3067\u9078\u3093\u3067\u304F\u3060\u3055\u3044\u3002
|
package/package.json
CHANGED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
-
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{readBody}from"./chunk-QVXZEUKN.js";import{OUTPUT_FORMATS,evaluateQuery,exitCodeFor,redactSecretValues,renderOutput,reportError,resolveOutputFormat,withDebug}from"./chunk-BPMSIIOU.js";import"./chunk-WVS4W5FY.js";import{AuthSession,NotLoggedInError,SessionExpiredError,loadCredentials}from"./chunk-63LDNYGW.js";import{GLOBAL_OPTIONS_HELP,HELP_TOKEN}from"./chunk-FKIZ5ZJU.js";import{parseOperationArgs,repeatedValues}from"./chunk-O52CUEDO.js";import"./chunk-QQRJLH6B.js";
|
|
4
|
-
import"./chunk-7WEYBZSK.js";import{ApiError,TwpApiClient,appendQuery}from"./chunk-JKSXUBND.js";import"./chunk-II5RVJQN.js";import{effectiveApiUrl,resolveConfiguredOutput,resolveProfile}from"./chunk-NERYSBA4.js";import"./chunk-RZVI6PMW.js";import{httpFetch}from"./chunk-J7QYPKVK.js";import{stripTerminalControls}from"./chunk-NHYMHCAT.js";import"./chunk-2SGDY6YP.js";import{EXIT_OK,NetworkError,UsageError}from"./chunk-M3GWY6NT.js";import"./chunk-5QCAIKFE.js";
|
|
5
|
-
import"./chunk-VSJBJXZO.js";var API_COMMAND_HELP=`twp api \u2014 API \u306E\u30D1\u30B9\u3092\u76F4\u63A5\u53E9\u304F\uFF08\u30A8\u30B9\u30B1\u30FC\u30D7\u30CF\u30C3\u30C1\uFF09
|
|
6
|
-
|
|
7
|
-
\u4F7F\u3044\u65B9:
|
|
8
|
-
twp api <\u30D1\u30B9> [\u30AA\u30D7\u30B7\u30E7\u30F3]
|
|
9
|
-
|
|
10
|
-
\u753B\u9762\u3067\u3067\u304D\u308B\u64CD\u4F5C\u306F\u3059\u3079\u3066 API \u306E\u30D1\u30B9\u3092\u6301\u3064\u306E\u3067\u3001\u30AD\u30E5\u30EC\u30FC\u30B7\u30E7\u30F3\u5C64\uFF08twp task / twp project \u2026\uFF09\u306B
|
|
11
|
-
\u51FA\u3066\u3044\u306A\u3044\u64CD\u4F5C\u3078\u306F\u3053\u3053\u304B\u3089\u5230\u9054\u3067\u304D\u307E\u3059\u3002\u30D1\u30B9\u306F API \u306E\u5951\u7D04\u305D\u306E\u3082\u306E\u306A\u306E\u3067\u3001
|
|
12
|
-
\u3053\u306E CLI \u306F\u30D1\u30B9\u306B\u3064\u3044\u3066\u5F8C\u65B9\u4E92\u63DB\u3092\u7D04\u675F\u3057\u307E\u305B\u3093\u3002
|
|
13
|
-
|
|
14
|
-
\u4F8B:
|
|
15
|
-
twp api /v2/projects?limit=10
|
|
16
|
-
twp api /v2/projects --query-param limit=10
|
|
17
|
-
twp api /v2/tasks/{taskId} --method PUT --body-file body.json --yes
|
|
18
|
-
twp api /v2/attendance/records --method POST --generate-cli-skeleton > in.json
|
|
19
|
-
twp api /v2/attendance/records --method POST --cli-input-json in.json --yes
|
|
20
|
-
|
|
21
|
-
\u30AA\u30D7\u30B7\u30E7\u30F3:
|
|
22
|
-
--method <\u30E1\u30BD\u30C3\u30C9> GET | POST | PUT | PATCH | DELETE\uFF08\u65E2\u5B9A GET\uFF09
|
|
23
|
-
--body-file <\u30D1\u30B9> \u30EA\u30AF\u30A8\u30B9\u30C8\u30DC\u30C7\u30A3\u306E JSON \u30D5\u30A1\u30A4\u30EB\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09
|
|
24
|
-
--cli-input-json <\u30D1\u30B9> \u5168\u5F15\u6570\u3092 JSON \u3067\u6E21\u3059\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09
|
|
25
|
-
\u500B\u5225\u30D5\u30E9\u30B0\u3068\u4F75\u7528\u3057\u305F\u3068\u304D\u306F**\u30D5\u30E9\u30B0\u304C\u52DD\u3061\u307E\u3059**
|
|
26
|
-
--generate-cli-skeleton --cli-input-json \u3078\u6E21\u3059\u5165\u529B\u3072\u306A\u5F62\u3092\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3057\u307E\u3059
|
|
27
|
-
\uFF08\u9001\u4FE1\u3082\u30ED\u30B0\u30A4\u30F3\u3082\u884C\u3044\u307E\u305B\u3093\uFF09
|
|
28
|
-
--query-param <k=v> \u30AF\u30A8\u30EA\u5F15\u6570\u3002\u8907\u6570\u6307\u5B9A\u3067\u304D\u307E\u3059
|
|
29
|
-
\u5024\u306E\u4E2D\u306E = \u306F\u5207\u308A\u843D\u3068\u3057\u307E\u305B\u3093\uFF08\u6700\u521D\u306E = \u3067\u5206\u5272\uFF09
|
|
30
|
-
--no-redact \u5FDC\u7B54\u306E\u4F0F\u5B57\u5316\u3092\u89E3\u9664\u3057\u307E\u3059\uFF08\u65E2\u5B9A\u306F\u4F0F\u5B57\u5316\u3059\u308B\uFF09
|
|
31
|
-
\u9375\u306E\u767A\u884C\u306A\u3069\u3001\u4F0F\u305B\u308B\u3068\u5024\u304C\u4F7F\u3048\u306A\u3044\u64CD\u4F5C\u306E\u305F\u3081\u306E\u3082\u306E\u3067\u3059
|
|
32
|
-
|
|
33
|
-
\u51FA\u529B\u306E\u4F0F\u5B57\u5316:
|
|
34
|
-
\u5FDC\u7B54\u306B\u8F09\u308B token / secret / api_key / password \u306A\u3069\u306E\u5024\u306F\u3001\u65E2\u5B9A\u3067 ***\uFF08\u4F0F\u5B57\uFF09\u306B\u3057\u3066\u51FA\u3057\u307E\u3059\u3002
|
|
35
|
-
\u51FA\u529B\u306F\u7AEF\u672B\u3068\u30ED\u30B0\uFF08AI CLI \u306E\u30C8\u30E9\u30F3\u30B9\u30AF\u30EA\u30D7\u30C8\u3092\u542B\u3080\uFF09\u306B\u5E73\u6587\u3067\u6B8B\u308B\u305F\u3081\u3067\u3059\u3002
|
|
36
|
-
\u767A\u884C\u3057\u305F\u9375\u3092\u53D7\u3051\u53D6\u308B\u306A\u3069\u5024\u305D\u306E\u3082\u306E\u304C\u8981\u308B\u3068\u304D\u306F --no-redact \u3092\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044
|
|
37
|
-
\uFF08\u4ED8\u3051\u305F\u3053\u3068\u306F stderr \u30781\u884C\u51FA\u307E\u3059\uFF09\u3002
|
|
38
|
-
|
|
39
|
-
\u66F8\u304D\u8FBC\u307F\u306E\u6271\u3044:
|
|
40
|
-
GET \u4EE5\u5916\u306F --yes \u304C\u5FC5\u8981\u3067\u3059\u3002\u751F\u30D1\u30B9\u306F\u4EFB\u610F\u306E\u66F8\u304D\u8FBC\u307F\u3078\u5230\u9054\u3067\u304D\u308B\u305F\u3081\u3001
|
|
41
|
-
\u300C\u8AAD\u307F\u53D6\u308A\u4EE5\u5916\u306F\u3059\u3079\u3066\u78BA\u8A8D\u3092\u8981\u3059\u308B\u300D\u306B\u5012\u3057\u3066\u3044\u307E\u3059\u3002
|
|
42
|
-
\u9001\u308B\u5185\u5BB9\u306F --dry-run \u3067\u5148\u306B\u78BA\u8A8D\u3067\u304D\u307E\u3059\uFF08--dry-run \u306F\u9001\u3089\u306A\u3044\u306E\u3067 --yes \u306F\u8981\u308A\u307E\u305B\u3093\uFF09\u3002
|
|
43
|
-
\u5B9F\u884C\u306E\u524D\u306B\u63A5\u7D9A\u5148\uFF08\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u540D\u3068 URL\uFF09\u3092 stderr \u3078\u51FA\u3057\u307E\u3059\u3002
|
|
44
|
-
|
|
45
|
-
\u3044\u307E\u306F\u5165\u3063\u3066\u3044\u306A\u3044\u3082\u306E\uFF08\u4ECA\u5F8C\u306E\u30EA\u30EA\u30FC\u30B9\u3067\u5BFE\u5FDC\u3057\u307E\u3059\uFF09:
|
|
46
|
-
\u30B3\u30DE\u30F3\u30C9\u30E2\u30C7\u30EB\u304C\u672A\u540C\u68B1\u306E\u305F\u3081\u3001\u30B9\u30AD\u30FC\u30DE\u691C\u8A3C\u30FB\u81EA\u52D5\u30DA\u30FC\u30B8\u30F3\u30B0\u30FB\u30D1\u30B9\u5019\u88DC\u306E\u63D0\u793A\u306F\u884C\u3044\u307E\u305B\u3093\u3002
|
|
47
|
-
\u4E00\u89A7\u306E\u7D9A\u304D\u306F\u5FDC\u7B54\u306E next_cursor \u3092 --query-param cursor=\u2026 \u306B\u6E21\u3057\u3066\u8FBF\u3063\u3066\u304F\u3060\u3055\u3044\u3002
|
|
48
|
-
|
|
49
|
-
${GLOBAL_OPTIONS_HELP}
|
|
50
|
-
`;var writeOut=text=>void process.stdout.write(text);var writeErr=text=>void process.stderr.write(text);function line(text){return text===""?"":text.endsWith("\n")?text:`${text}
|
|
51
|
-
`}var API_METHODS=["GET","POST","PUT","PATCH","DELETE"];var API_FLAGS=[{name:"--method",summary:`HTTP \u30E1\u30BD\u30C3\u30C9\uFF08${API_METHODS.join(" / ")}\u30FB\u65E2\u5B9A GET\uFF09`,takesValue:true,placeholder:"<\u30E1\u30BD\u30C3\u30C9>"},{name:"--body-file",summary:"\u30EA\u30AF\u30A8\u30B9\u30C8\u30DC\u30C7\u30A3\u306E JSON \u30D5\u30A1\u30A4\u30EB\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>"},{name:"--cli-input-json",summary:"\u5168\u5F15\u6570\u3092 JSON \u3067\u6E21\u3059\uFF08-\
|
|
52
|
-
\u3067\u6A19\u6E96\u5165\u529B\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9>"},{name:"--generate-cli-skeleton",summary:"--cli-input-json \u3078\u6E21\u3059\u5165\u529B\u3072\u306A\u5F62\u3092\u51FA\u529B\u3057\u3066\u7D42\u4E86\u3059\u308B",takesValue:false},{name:"--query-param",summary:"\u30AF\u30A8\u30EA\u5F15\u6570\uFF08k=v\u30FB\u8907\u6570\u6307\u5B9A\u53EF\uFF09",takesValue:true,placeholder:"<k=v>",repeatable:true},{name:"--no-redact",summary:"\u5FDC\u7B54\u306E\u4F0F\u5B57\u5316\u3092\u89E3\u9664\u3057\u3066\u751F\u306E\u5024\u3092\u51FA\u3059\uFF08\u9375\u306E\u53D7\u3051\u53D6\u308A\u7B49\uFF09",
|
|
53
|
-
takesValue:false}];var MAX_BODY_CHARS=1e6;function normalizeApiPath(raw){const trimmed=raw.trim();if(trimmed==="")throw new UsageError("\u30D1\u30B9\u304C\u7A7A\u3067\u3059","\u4F8B: twp api /v2/projects");if(/^https?:\/\//i.test(trimmed)){throw new UsageError(`\u30D1\u30B9\u306B URL \u306F\u6E21\u305B\u307E\u305B\u3093: ${trimmed}`,"\u63A5\u7D9A\u5148\u306F\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u304C\u6C7A\u3081\u307E\u3059\u3002\u30D1\u30B9\u3060\u3051\u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4F8B: /v2/projects\uFF09\u3002")}
|
|
54
|
-
const hashIndex=trimmed.indexOf("#");const withoutHash=hashIndex===-1?trimmed:trimmed.slice(0,hashIndex);const queryIndex=withoutHash.indexOf("?");const pathPart=queryIndex===-1?withoutHash:withoutHash.slice(0,queryIndex);const queryPart=queryIndex===-1?void 0:withoutHash.slice(queryIndex+1);const withSlash=pathPart.startsWith("/")?pathPart:`/${pathPart}`;const path=withSlash.toLowerCase().startsWith("/api/")?withSlash:`/api${withSlash}`;return{path,query:queryPart===void 0||queryPart===""?void 0:
|
|
55
|
-
queryPart}}function parseMethod(raw){if(raw===void 0)return"GET";const upper=raw.trim().toUpperCase();if(API_METHODS.includes(upper))return upper;throw new UsageError(`--method \u306B\u300C${raw}\u300D\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,`\u6307\u5B9A\u3067\u304D\u308B\u306E\u306F ${API_METHODS.join(" / ")} \u3067\u3059\u3002`)}function parseQueryParams(values){const out={};for(const raw of values){const index=raw.indexOf("=");if(index<=0){throw new UsageError(`--query-param \u306F k=v \u306E\
|
|
56
|
-
\u5F62\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044: ${raw}`,"\u4F8B: --query-param limit=10 --query-param keyword=\u4F1A\u8B70")}const key=raw.slice(0,index);if(Object.prototype.hasOwnProperty.call(out,key)){throw new UsageError(`--query-param ${key} \u304C\u8907\u6570\u56DE\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059`)}out[key]=raw.slice(index+1)}return out}function parseQueryString(raw){if(raw===void 0)return{};const out={};for(const[key,value]of new URLSearchParams(raw))out[key]=
|
|
57
|
-
value;return out}function buildSkeleton(method,path,query){const skeleton={method,path};const queryEntries=Object.entries(query);skeleton.query=queryEntries.length>0?Object.fromEntries(queryEntries.map(([key,value])=>[key,String(value??"")])):{};if(method!=="GET")skeleton.body={};return skeleton}function parseCliInput(text){let parsed;try{parsed=JSON.parse(text)}catch(err){throw new UsageError(`--cli-input-json \u306E JSON \u3092\u89E3\u91C8\u3067\u304D\u307E\u305B\u3093: ${err.message}`)}if(parsed===
|
|
58
|
-
null||typeof parsed!=="object"||Array.isArray(parsed)){throw new UsageError("--cli-input-json \u306B\u306F\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",'\u4F8B: {"method":"POST","path":"/v2/...","body":{}}')}const known=new Set(["method","path","query","body"]);const unknown=Object.keys(parsed).filter(key=>!known.has(key));if(unknown.length>0){throw new UsageError(`--cli-input-json \u306B\u77E5\u3089\u306A\u3044\u30AD\u30FC\u304C\u3042\u308A\u307E\u3059: ${unknown.
|
|
59
|
-
join(" / ")}`,`\u4F7F\u3048\u308B\u306E\u306F ${[...known].join(" / ")} \u3067\u3059\u3002`)}const input=parsed;for(const key of["method","path"]){const value=input[key];if(value!==void 0&&typeof value!=="string"){throw new UsageError(`--cli-input-json \u306E ${key} \u306F\u6587\u5B57\u5217\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044`)}}if(input.query!==void 0){if(input.query===null||typeof input.query!=="object"||Array.isArray(input.query)){throw new UsageError("--cli-input-json \u306E query \u306F\u30AA\u30D6\
|
|
60
|
-
\u30B8\u30A7\u30AF\u30C8\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044")}for(const[key,value]of Object.entries(input.query)){if(typeof value!=="string"&&typeof value!=="number"&&typeof value!=="boolean"){throw new UsageError(`--cli-input-json \u306E query.${key} \u306F\u6587\u5B57\u5217\u30FB\u6570\u5024\u30FB\u771F\u507D\u5024\u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044`)}}}return input}async function runApiCommand(options){const{globals}=options;let format=null;try{const profile=resolveProfile(
|
|
61
|
-
globals.profile);format=resolveOutputFormat({...globals.output!==void 0?{flag:globals.output}:{},...(()=>{const configured=resolveConfiguredOutput(profile.name);return configured!==void 0?{configured}:{}})(),isTty:process.stdout.isTTY===true});if(format===null){throw new UsageError(`--output \u306B\u300C${globals.output??""}\u300D\u306F\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093`,`\u6307\u5B9A\u3067\u304D\u308B\u306E\u306F ${OUTPUT_FORMATS.join(" / ")} \u3067\u3059`)}if(options.help||options.argv[0]===
|
|
62
|
-
HELP_TOKEN){const extra=options.argv[0]===HELP_TOKEN?options.argv.slice(1):options.argv;if(extra.length>0&&!options.help){throw new UsageError(`twp api help \u306F\u5F15\u6570\u3092\u53D6\u308A\u307E\u305B\u3093: ${extra.join(" ")}`,"\u30D1\u30B9\u3092\u53E9\u304F\u306A\u3089 help \u3092\u5916\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4F8B: twp api /v2/projects\uFF09\u3002")}writeOut(API_COMMAND_HELP);return EXIT_OK}const input=parseOperationArgs(options.argv,API_FLAGS);const noRedact=input.flags.
|
|
63
|
-
has("--no-redact");const cliInputText=await readBody(input,{flag:"--cli-input-json-inline",fileFlag:"--cli-input-json",label:"--cli-input-json",maxChars:MAX_BODY_CHARS,usage:"\u4F8B: twp api /v2/projects --method POST --generate-cli-skeleton > in.json"});const cliInput=cliInputText===void 0?void 0:parseCliInput(cliInputText);const[pathArg,...extraArgs]=input.args;if(extraArgs.length>0){throw new UsageError(`\u4F59\u5206\u306A\u5F15\u6570\u304C\u3042\u308A\u307E\u3059: ${extraArgs.join(" ")}`,"tw\
|
|
64
|
-
p api \u304C\u53D7\u3051\u308B\u4F4D\u7F6E\u5F15\u6570\u306F\u30D1\u30B91\u3064\u3060\u3051\u3067\u3059\u3002\u30AF\u30A8\u30EA\u306F\u30D1\u30B9\u306B\u66F8\u304F\u304B --query-param \u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}const rawPath=pathArg??cliInput?.path;if(rawPath===void 0){throw new UsageError("\u30D1\u30B9\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044","\u4F8B: twp api /v2/projects?limit=10\uFF08\u4E00\u89A7\u306F twp api help\uFF09")}const{path,query:inlineQuery}=normalizeApiPath(
|
|
65
|
-
rawPath);const method=parseMethod(input.flags.get("--method")??cliInput?.method);const query={...parseQueryString(inlineQuery),...cliInput?.query??{},...parseQueryParams(repeatedValues(input,"--query-param"))};if(input.flags.has("--generate-cli-skeleton")){if(input.flags.has("--body-file")){throw new UsageError("--generate-cli-skeleton \u3068 --body-file \u306F\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093","\u3072\u306A\u5F62\u3092\u51FA\u3057\u3066\u304B\u3089\u7DE8\u96C6\u3057\u3001--cli-input-json \u3067\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002")}
|
|
66
|
-
writeOut(`${JSON.stringify(buildSkeleton(method,path.replace(/^\/api/,""),query),null,2)}
|
|
67
|
-
`);return EXIT_OK}const bodyText=await readBody(input,{flag:"--body-inline",fileFlag:"--body-file",label:"\u30EA\u30AF\u30A8\u30B9\u30C8\u30DC\u30C7\u30A3",maxChars:MAX_BODY_CHARS,usage:"\u4F8B: twp api /v2/projects --method POST --body-file body.json --yes"});let body;if(bodyText!==void 0){try{body=JSON.parse(bodyText)}catch(err){throw new UsageError(`--body-file \u306E JSON \u3092\u89E3\u91C8\u3067\u304D\u307E\u305B\u3093: ${err.message}`)}}else if(cliInput!==void 0&&"body"in cliInput){body=cliInput.
|
|
68
|
-
body}if(body!==void 0&&method==="GET"){throw new UsageError("GET \u306B\u30EA\u30AF\u30A8\u30B9\u30C8\u30DC\u30C7\u30A3\u306F\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093","\u66F8\u304D\u8FBC\u307F\u306A\u3089 --method POST / PUT / PATCH \u3092\u3001\u7D5E\u308A\u8FBC\u307F\u306A\u3089 --query-param \u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044\u3002")}if(!globals.dryRun&&method!=="GET"&&!globals.yes){throw new UsageError(`twp api \u306F GET \u4EE5\u5916\u306B --yes \u304C\u5FC5\u8981\u3067\u3059\uFF08\u6307\u5B9A: ${method}\
|
|
69
|
-
${path}\uFF09`,"\u9001\u308B\u5185\u5BB9\u306F --dry-run \u3067\u5148\u306B\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002")}const plan={method,path,query,...body!==void 0?{body}:{}};const stored=loadCredentials(profile.name);const apiUrl=effectiveApiUrl(profile,stored?.api_url);writeErr(`\u63A5\u7D9A\u5148: ${stripTerminalControls(profile.name)} (${stripTerminalControls(apiUrl)})
|
|
70
|
-
`);writeErr("\u6CE8\u8A18: \u30B3\u30DE\u30F3\u30C9\u30E2\u30C7\u30EB\u672A\u540C\u68B1\u306E\u305F\u3081\u3001\u30B9\u30AD\u30FC\u30DE\u691C\u8A3C\u3068\u81EA\u52D5\u30DA\u30FC\u30B8\u30F3\u30B0\u306F\u884C\u3044\u307E\u305B\u3093\u3002\n");if(noRedact){writeErr("\u6CE8\u8A18: --no-redact \u306E\u305F\u3081\u51FA\u529B\u3092\u4F0F\u5B57\u5316\u3057\u307E\u305B\u3093\uFF08\u7AEF\u672B\u3068\u30ED\u30B0\u306B\u5E73\u6587\u3067\u6B8B\u308A\u307E\u3059\uFF09\u3002\n")}if(globals.dryRun){writeOut(line(
|
|
71
|
-
renderOutput(dryRunValue(apiUrl,plan),format,noRedact)));return EXIT_OK}const transport=options.fetchImpl??httpFetch;const fetchImpl=globals.debug?withDebug(transport):transport;const session=new AuthSession(profile.name,apiUrl,process.env,fetchImpl);const client=new TwpApiClient(apiUrl,session,fetchImpl,options.version);let responseBody;try{responseBody=await client.request(plan.method,appendQuery(plan.path,plan.query),plan.body)}catch(err){if(err instanceof ApiError||err instanceof NotLoggedInError||
|
|
72
|
-
err instanceof SessionExpiredError)throw err;throw new NetworkError(`${apiUrl} \u3078\u306E\u901A\u4FE1\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${err.message}`,{cause:err})}const source=noRedact?responseBody:redactSecretValues(responseBody);const value=globals.query===void 0?source:await evaluateQuery(globals.query,source);writeOut(line(renderOutput(value,format,noRedact)));return EXIT_OK}catch(err){const code=exitCodeFor(err);reportError(err,format,code);return code}}function dryRunValue(apiUrl,plan){
|
|
73
|
-
const value={method:plan.method,url:`${apiUrl}${appendQuery(plan.path,plan.query)}`};if(plan.body!==void 0)value["body"]=plan.body;return value}export{API_FLAGS,API_METHODS,buildSkeleton,normalizeApiPath,parseCliInput,parseMethod,parseQueryParams,parseQueryString,runApiCommand};
|
package/dist/run-BJQLIPWN.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
|
-
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{buildPrepareContext,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain}from"./chunk-BPMSIIOU.js";import"./chunk-WVS4W5FY.js";import"./chunk-63LDNYGW.js";import"./chunk-FKIZ5ZJU.js";import"./chunk-O52CUEDO.js";import"./chunk-QQRJLH6B.js";import"./chunk-7WEYBZSK.js";import"./chunk-JKSXUBND.js";import"./chunk-II5RVJQN.js";import"./chunk-NERYSBA4.js";import"./chunk-RZVI6PMW.js";import"./chunk-J7QYPKVK.js";
|
|
4
|
-
import"./chunk-NHYMHCAT.js";import"./chunk-2SGDY6YP.js";import"./chunk-M3GWY6NT.js";import"./chunk-5QCAIKFE.js";import"./chunk-VSJBJXZO.js";export{buildPrepareContext,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain};
|