@keruyun/agent-cli 1.4.14 → 1.5.3-beta.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/README.md +6 -6
- package/bin/sdk.mjs +1 -1
- package/binaries.json +31 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,12 +17,12 @@ npm i @keruyun/agent-cli@latest -g --registry=https://registry.npmmirror.com
|
|
|
17
17
|
|
|
18
18
|
| 平台 | 解压后体积 |
|
|
19
19
|
| --- | --- |
|
|
20
|
-
| darwin-arm64 | 66.
|
|
21
|
-
| darwin-x64(baseline 变体,兼容无 AVX2 的老 CPU) | 72.
|
|
22
|
-
| linux-x64 | 84.
|
|
23
|
-
| linux-arm64 | 84.
|
|
24
|
-
| linux-x64-musl | 78.
|
|
25
|
-
| win32-x64 | 90.
|
|
20
|
+
| darwin-arm64 | 66.56 MB |
|
|
21
|
+
| darwin-x64(baseline 变体,兼容无 AVX2 的老 CPU) | 72.99 MB |
|
|
22
|
+
| linux-x64 | 84.28 MB |
|
|
23
|
+
| linux-arm64 | 84.24 MB |
|
|
24
|
+
| linux-x64-musl | 78.32 MB |
|
|
25
|
+
| win32-x64 | 90.28 MB |
|
|
26
26
|
|
|
27
27
|
## 校验
|
|
28
28
|
|
package/bin/sdk.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var Q=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Z=Q((Fe,me)=>{me.exports={name:"@keruyun/agent-cli",version:"1.4.
|
|
1
|
+
var Q=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Z=Q((Fe,me)=>{me.exports={name:"@keruyun/agent-cli",version:"1.4.23",description:"\u5BA2\u5982\u4E91 CLI \u5DE5\u5177",keywords:[],license:"MIT",author:"\u7384\u5BAB",repository:{type:"git",url:"http://gitlab.alibaba-inc.com/alsc-kry-open/krycli.git"},bin:{krycli:"./bin/index.js"},files:["bin"],exports:{"/sdk":{types:"./bin/sdk.mjs",import:"./bin/sdk.mjs"}},scripts:{prepare:"husky install",postinstall:"node bin/where_is_kry_cli.js",prepublishOnly:"tnpm run build",dev:"node scripts/dev.mjs",check:"tsc --noEmit && vitest run",ci:"tnpm run lint && tnpm run verify",verify:"node scripts/verify-refactor.mjs","verify:baseline":"node scripts/verify-refactor.mjs --baseline",test:"vitest run",lint:"eslint . --ext js,jsx,ts,tsx","lint:fix":"eslint --fix . --ext js,jsx,ts,tsx",build:"tsc --noEmit && tnpm run prod && tnpm run sdk && cp -f ./py/log.py ./bin/log.py",prod:"esbuild src/index.ts --bundle --minify --format=cjs --outfile=./bin/index.js --platform=node --legal-comments=none $ESBUILD_DEFINE",sdk:"esbuild src/sdk.ts --bundle --minify --format=esm --outfile=./bin/sdk.mjs --platform=node --legal-comments=none $ESBUILD_DEFINE","build:bin":"node scripts/build-binaries.mjs","release:pack":"node scripts/pack-release.mjs --tarball","release:verify":"node scripts/pack-release.mjs --verify","release:outer:beta":"node scripts/publish-binary.mjs --target=outer --tag=beta --prerelease","release:outer":"node scripts/publish-binary.mjs --target=outer --tag=latest","release:inner:beta":"node scripts/publish-binary.mjs --target=inner --tag=beta --prerelease","release:inner":"node scripts/publish-binary.mjs --target=inner --tag=latest","regr:base":'node regression/snapshot.mjs --target "node bin/index.js" --label node --layer L0,L1,L2',"regr:bun":'node regression/snapshot.mjs --target "./dist-bun/kry-cli" --label bun --layer L0,L1,L2',"regr:diff":"node regression/compare.mjs --base node --target bun",doc:"node dist/schema/gen.js",pack:"node dist/pack/index.js",wasm:"node scripts/gen-sql-wasm.mjs","legacy:release:outer":"node scripts/publish-release.mjs","legacy:release:inner":"node scripts/publish-beta.mjs --pre"},dependencies:{xlsx:"^0.18.5"},devDependencies:{"@ali/eslint-config-att":"^1.0.6","@ali/stylelint-config-xy":"^1.0.14","@commitlint/cli":"^17.7.1","@commitlint/config-conventional":"^17.7.0","@commitlint/cz-commitlint":"^17.7.1","@commitlint/format":"^17.4.4","@fast-csv/format":"^5.0.7","@puppeteer/browsers":"^3.0.3","@types/fs-extra":"^11.0.4","@types/node":"^25.6.0","@types/sql.js":"^1.4.11","@typescript-eslint/eslint-plugin":"^6.4.0","@typescript-eslint/parser":"^6.4.0",commander:"^15.0.0","cz-conventional-changelog":"^3.3.0",dayjs:"^1.11.20",esbuild:"^0.28.0",eslint:"^8.47.0","eslint-plugin-react":"^7.33.2","eslint-plugin-react-hooks":"^4.6.0",exceljs:"^4.4.0","fs-extra":"^11.3.5",husky:"^8.0.3",jsonrepair:"^3.14.0",jszip:"^3.10.1","lint-staged":"^14.0.0","puppeteer-core":"^25.0.4","sql.js":"^1.14.1",stylelint:"^15.10.3","ts-node":"^10.9.2",tslib:"^2.4.0",typescript:"^5.0.0",vitest:"^4.1.6",zod:"^4.4.3"},"lint-staged":{"**/*.{ts,tsx,js,jsx}":"eslint","**/*.less":"stylelint"},config:{commitizen:{path:"@commitlint/cz-commitlint"}}}});import ee from"path";import te from"os";var ne={prod:{api:"https://openapi.keruyun.com",auth:"https://open.keruyun.com",clientId:"kry-cli"},pre:{api:"https://preopenapi.tongyun0815.com",auth:"https://preopen.tongyun0815.com",clientId:"kry-cli"},gld:{api:"https://gldopenapi.keruyun.com",auth:"https://gldopen.keruyun.com",clientId:"kry-cli"},safety:{api:"https://openapi.keruyun.com",auth:"https://open.keruyun.com",clientId:"kry-cli",extraHeaders:{"kry-api-brand-id":"32296"}}},w={daily:"gld",pre:"pre",prod:"prod"};var re="prod";function b(){if(process.env?.CLIENT_CLAW_ENV&&w[process.env.CLIENT_CLAW_ENV])return w[process.env.CLIENT_CLAW_ENV];let e=process.env.KRY_FORCE_ENV;return e&&ne[e]?e:re}function S(...e){return ee.join(process.env.AGENT_WORK_ROOT||te.homedir(),...e)}var C=(...e)=>{let t=b();return t==="prod"?S(".kry-cli",...e):S(`.kry-cli-${t}`,...e)},m="-o /temp_path/file.json",k="-o /path/file.xlsx",oe="-o /path/file.csv",ie={viewBrand:"krycli brand",viewBrandJson:"krycli brand --format json",viewShop:"krycli shop",viewShopByKeyword:"krycli shop -k '\u5173\u952E\u8BCD1|\u5173\u952E\u8BCD2'",viewShopParams:e=>`krycli shop -b ${e?.brandId||"<brandId>"}`,viewShopJson:"krycli shop -b <brandId> --format json",callShop:"krycli call /open/xxx -s <shopId> -d '<JSON>'",callShopParams:e=>`krycli call ${e?.url||"/open/xxx"} -s ${e?.shopId||"<shopId>"} -d '<JSON>'`,callBrand:"krycli call /open/xxx -b <brandId> -d '<JSON>'",callBrandOutput:`krycli call /open/xxx -b <brandId> ${m} -d '<JSON>'`,callBrandParams:e=>`krycli call ${e?.url||"/open/xxx"} -b ${e?.brandId||"<brandId>"} -d '<JSON>'`,callOutput:"\u5982\u679C\u6570\u636E\u91CF\u8FC7\u5927\u6216\u8005\u95E8\u5E97\u8D85\u8FC7 10 \u5BB6\uFF0C\u4F7F\u7528\u53C2\u6570 `-o <tempFilePath>` \u5C06\u6570\u636E\u4FDD\u5B58\u5230\u4E34\u65F6\u6587\u4EF6",login:"krycli login",logout:"krycli logout",logoutJson:"krycli logout --format json",viewAllApi:"krycli view",viewSpcApi:"krycli view <\u63A5\u53E3\u8DEF\u5F84>",viewSpcApiJson:"krycli view <\u63A5\u53E3\u8DEF\u5F84> --format json",searchApi:"krycli view '\u5173\u952E\u8BCD1|\u5173\u952E\u8BCD2'",comment:{kry:"krycli comment keruyun -b 123 --shopIds 456,789 --start 2026-04-01 --end 2026-04-30",kryAll:"krycli comment keruyun -b 123 --start 2026-04-01 --end 2026-04-30",kryOutput:`krycli comment keruyun -b 123 ${oe}`,meituan:`krycli comment meituan ${k} --start 2026-04-01 --end 2026-04-30`,brandKey:"krycli comment brandKey -b 123",weibo:{brand:"krycli comment weibo -b 123",key:"krycli comment weibo -k \u54C1\u724C\u5173\u952E\u8BCD"},xiaohongshu:{brand:"krycli comment xiaohongshu -b 123",key:"krycli comment xiaohongshu -k \u54C1\u724C\u5173\u952E\u8BCD"},blackcat:{key:`krycli comment blackcat -k \u9738\u738B\u8336\u59EC ${m}`,company:`krycli comment blackcat --companyUrl 'https://zj.tousu.sina.com.cn/company/view/?couid=5652018762' ${m}`}},export:{star:`krycli export ecom star ${k}`,star30:`krycli export ecom star ${k} --start 2026-04-01 --end 2026-04-30`},viewDate:"krycli date",viewDateJson:"krycli date --format json",upgrade:"krycli upgrade",upgradeCheck:"krycli upgrade --check",upgradeForce:"krycli upgrade --force",upgradeMin:"krycli upgrade --min <version>"},se=process.env.AGENT_WORK_ROOT||"";function ce(e){return e?.match(/(?:^|[/\\])(user-[^/\\]+)[/\\]?$/)?.[1]||""}var x=ce(se),T=!!x,O=(process.env.REWIND_SESSION_ID||"").match(/^eval-sess-eval/);function E(){return process.env.CLIENT_CLAW_TYPE==="KRY_CLAW"}import*as a from"fs";import*as p from"path";import _ from"os";var ae="https://tnnm-alsc-saas-merchant-spider-fy21.cn-wulanchabu.log.aliyuncs.com/logstores/kry-cli/track?APIVersion=0.6.0",I="KRY_CLI_NO_TRACK",A="KRY_CLI_TRACK_DEBUG",le=process.env.REWIND_SESSION_ID||"",Se=process.env.ROBOT_UID||"",de=crypto.randomUUID().replaceAll("-",""),j,D,L=0,R=0,$,P,z,J,U,F,B;function H(e){e?.brandId&&(j=e.brandId),e?.brandName&&(D=e.brandName),e?.brandCount!==void 0&&(L=e.brandCount),e?.shopCount!==void 0&&(R=e.shopCount),e?.version&&($=e.version),e?.userId&&(P=e.userId),e?.source&&(z=e.source),e?.mobile&&(J=e.mobile),e?.pkg&&(U=e.pkg)}function pe(e){let t={path:"",skill:""},o=((e||[]).find(i=>i.includes("kry-"))||"").split(/[/\\]+/),r=o.findIndex(i=>i.includes("kry-")&&i!=="kry-claw-skills");return r===-1||(t.skill=o[r],t.path=o.slice(r+1).join("/")),t}function K(){try{let e=pe(process.argv);return e.skill&&(B=e.skill),e.path&&(F=e.path),e}catch{}return null}function M(e){return e instanceof Error}function V(e){let t={};return Object.keys(e).forEach(n=>{t[n]=e[n]}),t.stack=e.stack,t}function ue(e){return Object.fromEntries(Object.entries(e).map(([t,n])=>[t,typeof n=="string"?n:JSON.stringify(n,(o,r)=>M(r)?V(r):r)]))}var ge=()=>process.env[I]==="1"||process.env[I]==="true",N=()=>process.env[A]==="1"||process.env[A]==="true";function fe(e){let t=e?.cause;return t?t.code?t.code:Array.isArray(t.errors)?t.errors.find(n=>n?.code)?.code||"":t.message?String(t.message).slice(0,100):"":""}function h(e,t,n){if(ge())return;let o,r=b();if(r==="prod"&&e==="debug")return;let i={traceId:de,level:e,message:t},d={env:r,brandId:j,brandName:D,brandCount:L.toString(),shopCount:R.toString(),version:$,sessionId:le,userId:P,hostname:_.hostname(),platform:_.platform(),arch:_.arch(),source:z,mobile:J,pkg:U,callPath:F,callSkill:B};O&&(d.test="TestRunner");try{let{tag:s,...l}=n||{},c={...i,tag:s,data:l};Object.keys(c.data||{}).length===0&&delete c.data,o=JSON.stringify({__logs__:[ue(c)],__tags__:d})}catch{o=JSON.stringify({__logs__:[JSON.stringify({...i,level:"error",message:t,data:"[Unserializable]"})],__tags__:d})}let f=Date.now();return fetch(ae,{method:"POST",headers:new Headers,body:o}).then(s=>{N()&&process.stderr.write(`[log] HTTP ${s.status}\uFF08${Date.now()-f} ms\uFF09${t}
|
|
2
2
|
`)}).catch(s=>{if(N()){let l=fe(s);process.stderr.write(`[log] \u4E0A\u62A5\u5931\u8D25\uFF08${Date.now()-f} ms\uFF09\uFF1A${s?.name||""} ${s?.message||String(s)}${l?` cause=${l}`:""}
|
|
3
3
|
`)}})}function G(e){return{info:(t,n)=>h("info",t,{...e,...n}),warn:(t,n)=>h("warn",t,{...e,...n}),error:(t,n)=>h("error",t,{...e,...M(n)?V(n):n}),debug:(t,n)=>h("debug",t,{...e,...n}),child:t=>G({...e,...t})}}var u=G();var g=C(),De=p.join(g,"credentials.json"),Le=p.join(g,"token-cache.json"),W=p.join(g,"authorized-orgs.json"),Re=3e3*1e3;var Y=p.join(g,"token.json"),$e=p.join(g,"discovery.json"),Pe=p.join(g,"login.pid");function he(){let e=u.child({tag:"loadOAuth2Token"});if(!a.existsSync(Y))return null;try{let t=a.readFileSync(Y,"utf-8");return JSON.parse(t)}catch(t){return e.error("\u8BFB\u53D6 OAuth2 Token \u5931\u8D25",t),null}}var Je=1440*60*1e3;function ye(){let e=u.child({tag:"loadAuthorizedOrgs"});if(!a.existsSync(W))return null;try{let t=a.readFileSync(W,"utf-8");return JSON.parse(t)}catch(t){return e.error("\u672C\u5730\u8BFB\u53D6\u5DF2\u6388\u6743\u54C1\u724C/\u95E8\u5E97\u5217\u8868\u5931\u8D25",t),null}}function X(){let e={success:!1,brandId:"",brandName:"",brandCount:0,shopCount:0,brandMap:{},shopMap:{},brands:[],shops:[]},t=ye();if(t){let n=t.brandList||[],o=n.length,r={},i={},d=n[0]||{},f=String(d.id||"")||"",s=d.name||"",l=0;for(let c of n){r[String(c.id)]=c,e.brands.push(c);let y=c.shopList||[];y.length>l&&(l=y.length,f=String(c.id),s=c.name);for(let v of y)i[String(v.id)]=v}e.success=!0,e.brandMap=r,e.shopMap=i,e.brandCount=o,e.shopCount=l,e.brandId=f,e.brandName=s}return e}function q(){try{let o=(he()?.access_token||"").split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),r=o.padEnd(o.length+(4-o.length%4)%4,"="),i=Buffer.from(r,"base64").toString("utf8");return JSON.parse(i)}catch{return{}}}try{let e=u.child({tag:"sdk:init"}),t=X(),n=q(),o=T?"wukong":"other";E()&&(o="kryclaw");let r=Z();H({version:r.version,brandId:t.brandId,brandName:t.brandName,brandCount:t.brandCount,shopCount:t.shopCount,userId:x,source:o,mobile:n?.sub,pkg:r.name});let i=K();e.info("SDK \u542F\u52A8\uFF0C\u8BBE\u7F6E\u65E5\u5FD7\u53C2\u6570",{args:process.argv.join(" "),call:i})}catch{}export{u as logger};
|
package/binaries.json
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.5.3-beta.0",
|
|
3
3
|
"targets": {
|
|
4
4
|
"darwin-arm64": {
|
|
5
|
-
"url": "https://s.koubei.com/
|
|
6
|
-
"sha256": "
|
|
7
|
-
"brSha256": "
|
|
8
|
-
"brBytes":
|
|
9
|
-
"bytes":
|
|
5
|
+
"url": "https://s.koubei.com/kCGKRJJk7bpAcjWQrxNjsjwjSBnJyDmy.br",
|
|
6
|
+
"sha256": "2cf41f2faf848f607e8ca7b608ae5ead91fdde025bcfd809bf6233f54b908c07",
|
|
7
|
+
"brSha256": "6cb7df36e3b4e0368eca7a112caf49dd6260cb5675b82a8e1b48329c79eef7cf",
|
|
8
|
+
"brBytes": 22359288,
|
|
9
|
+
"bytes": 69788786
|
|
10
10
|
},
|
|
11
11
|
"darwin-x64": {
|
|
12
|
-
"url": "https://s.koubei.com/
|
|
13
|
-
"sha256": "
|
|
14
|
-
"brSha256": "
|
|
15
|
-
"brBytes":
|
|
16
|
-
"bytes":
|
|
12
|
+
"url": "https://s.koubei.com/wZPr2dAb6A74rJE82CJAP2pwch68F3Fx.br",
|
|
13
|
+
"sha256": "60cb0cec68994265b71c73dc9c503a54d29c1abe0736a4d6a2d56eae63257f27",
|
|
14
|
+
"brSha256": "1d64caa352a105519c2eb455bbcb764bb3376c19074906095a2f08c8a94506dc",
|
|
15
|
+
"brBytes": 24781638,
|
|
16
|
+
"bytes": 76537248
|
|
17
17
|
},
|
|
18
18
|
"linux-x64": {
|
|
19
|
-
"url": "https://s.koubei.com/
|
|
20
|
-
"sha256": "
|
|
21
|
-
"brSha256": "
|
|
22
|
-
"brBytes":
|
|
23
|
-
"bytes":
|
|
19
|
+
"url": "https://s.koubei.com/WTTEGYE5iRfFtyp4iFjhFHhcWf5iAMpF.br",
|
|
20
|
+
"sha256": "4fa1b3236ebdd1a76f911f8df2d22983d6e1eb4fca2fbc4646d32d238a93ea0a",
|
|
21
|
+
"brSha256": "66cf0350ec7aa1cf16effa26792cd215d9900a58642b6cc1a3006ec620b81bdd",
|
|
22
|
+
"brBytes": 33000646,
|
|
23
|
+
"bytes": 88376520
|
|
24
24
|
},
|
|
25
25
|
"linux-arm64": {
|
|
26
|
-
"url": "https://s.koubei.com/
|
|
27
|
-
"sha256": "
|
|
28
|
-
"brSha256": "
|
|
29
|
-
"brBytes":
|
|
30
|
-
"bytes":
|
|
26
|
+
"url": "https://s.koubei.com/zM6rtfPCbzNS6JNWNRdmBzn85iNQZTTE.br",
|
|
27
|
+
"sha256": "97295f0728d966f1dd2280d2f14c6c40d47ddca3e7fb262e008876cf952186c8",
|
|
28
|
+
"brSha256": "befad39161d634cc47dbee749b3c77694738a3aa56222cc8dc2f8e4784dd920d",
|
|
29
|
+
"brBytes": 32661759,
|
|
30
|
+
"bytes": 88328184
|
|
31
31
|
},
|
|
32
32
|
"linux-x64-musl": {
|
|
33
|
-
"url": "https://s.koubei.com/
|
|
34
|
-
"sha256": "
|
|
35
|
-
"brSha256": "
|
|
36
|
-
"brBytes":
|
|
37
|
-
"bytes":
|
|
33
|
+
"url": "https://s.koubei.com/ZWrCJS8C2XwinEBfAhz8yzQXyRPkXRec.br",
|
|
34
|
+
"sha256": "5ab978bdba5877d3ee40dd9628f53c21d3f0fc78f690eaf121c6808382169f52",
|
|
35
|
+
"brSha256": "b5d04c68037585b12d324bb06a03460f9212aee9c1f3119dcb3d8645215aaaf6",
|
|
36
|
+
"brBytes": 30858847,
|
|
37
|
+
"bytes": 82122200
|
|
38
38
|
},
|
|
39
39
|
"win32-x64": {
|
|
40
|
-
"url": "https://s.koubei.com/
|
|
41
|
-
"sha256": "
|
|
42
|
-
"brSha256": "
|
|
43
|
-
"brBytes":
|
|
44
|
-
"bytes":
|
|
40
|
+
"url": "https://s.koubei.com/bFzNFT8KNQw6tK6WieF4wM4jYPk3aPE3.br",
|
|
41
|
+
"sha256": "8a5815d859b66b9c43bea323c0e258bc79d0701ce3c3c4f37cff25d8649723ca",
|
|
42
|
+
"brSha256": "c299af038a030249b9270d2333131832cda7d985c9f90161a0605ceb820c8173",
|
|
43
|
+
"brBytes": 35917701,
|
|
44
|
+
"bytes": 94661120
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|