@vibeapi/cli 0.0.170 → 0.0.171

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
  {
2
2
  "schema": 1,
3
- "revision": "2026-11-03T15:29:29Z-12",
3
+ "revision": "2026-11-10T00:13:23Z-14",
4
4
  "min_client_version": "",
5
5
  "upgrade_message": "",
6
6
  "defaults": {
@@ -122,6 +122,46 @@
122
122
  "openai"
123
123
  ]
124
124
  },
125
+ {
126
+ "id": "claude-fable-5-2",
127
+ "name": "Claude Fable 5.2",
128
+ "description": "100 万上下文 | 高难度推理 | 长时 Agent 与多步研究",
129
+ "group": "",
130
+ "group_name": "",
131
+ "recommended": false,
132
+ "hidden": false,
133
+ "context_window": 1000000,
134
+ "max_output_tokens": 128000,
135
+ "capabilities": {
136
+ "functionCall": true,
137
+ "vision": true,
138
+ "reasoning": true,
139
+ "imageOutput": false,
140
+ "video": false,
141
+ "structuredOutput": true,
142
+ "contextWindowTokens": 1000000,
143
+ "maxOutput": 128000,
144
+ "inputModalities": [
145
+ "text",
146
+ "image"
147
+ ],
148
+ "outputModalities": [
149
+ "text"
150
+ ],
151
+ "knowledgeCutoff": "2026-06-30",
152
+ "reasoningEfforts": [
153
+ "low",
154
+ "medium",
155
+ "high",
156
+ "xhigh",
157
+ "max"
158
+ ]
159
+ },
160
+ "endpoint_types": [
161
+ "anthropic",
162
+ "openai"
163
+ ]
164
+ },
125
165
  {
126
166
  "id": "claude-fable-5-1",
127
167
  "name": "Claude Fable 5.1",
@@ -464,8 +504,8 @@
464
504
  ]
465
505
  },
466
506
  "endpoint_types": [
467
- "anthropic",
468
- "openai"
507
+ "openai",
508
+ "anthropic"
469
509
  ]
470
510
  },
471
511
  {
@@ -574,8 +614,8 @@
574
614
  ]
575
615
  },
576
616
  "endpoint_types": [
577
- "anthropic",
578
- "openai"
617
+ "openai",
618
+ "anthropic"
579
619
  ]
580
620
  },
581
621
  {
@@ -609,8 +649,7 @@
609
649
  ]
610
650
  },
611
651
  "endpoint_types": [
612
- "openai",
613
- "anthropic"
652
+ "openai"
614
653
  ]
615
654
  },
616
655
  {
@@ -646,8 +685,7 @@
646
685
  ]
647
686
  },
648
687
  "endpoint_types": [
649
- "openai",
650
- "anthropic"
688
+ "openai"
651
689
  ]
652
690
  },
653
691
  {
@@ -681,8 +719,8 @@
681
719
  ]
682
720
  },
683
721
  "endpoint_types": [
684
- "anthropic",
685
- "openai"
722
+ "openai",
723
+ "anthropic"
686
724
  ]
687
725
  },
688
726
  {
@@ -793,7 +831,6 @@
793
831
  ]
794
832
  },
795
833
  "endpoint_types": [
796
- "anthropic",
797
834
  "openai"
798
835
  ]
799
836
  },
@@ -859,8 +896,8 @@
859
896
  ]
860
897
  },
861
898
  "endpoint_types": [
862
- "anthropic",
863
- "openai"
899
+ "openai",
900
+ "anthropic"
864
901
  ]
865
902
  },
866
903
  {
@@ -891,8 +928,8 @@
891
928
  ]
892
929
  },
893
930
  "endpoint_types": [
894
- "anthropic",
895
- "openai"
931
+ "openai",
932
+ "anthropic"
896
933
  ]
897
934
  },
898
935
  {
@@ -1298,8 +1335,8 @@
1298
1335
  ]
1299
1336
  },
1300
1337
  "endpoint_types": [
1301
- "anthropic",
1302
- "openai"
1338
+ "openai",
1339
+ "anthropic"
1303
1340
  ]
1304
1341
  },
1305
1342
  {
@@ -1408,8 +1445,8 @@
1408
1445
  ]
1409
1446
  },
1410
1447
  "endpoint_types": [
1411
- "anthropic",
1412
- "openai"
1448
+ "openai",
1449
+ "anthropic"
1413
1450
  ]
1414
1451
  },
1415
1452
  {
@@ -1443,8 +1480,7 @@
1443
1480
  ]
1444
1481
  },
1445
1482
  "endpoint_types": [
1446
- "openai",
1447
- "anthropic"
1483
+ "openai"
1448
1484
  ]
1449
1485
  },
1450
1486
  {
@@ -1480,8 +1516,7 @@
1480
1516
  ]
1481
1517
  },
1482
1518
  "endpoint_types": [
1483
- "openai",
1484
- "anthropic"
1519
+ "openai"
1485
1520
  ]
1486
1521
  },
1487
1522
  {
@@ -1515,8 +1550,8 @@
1515
1550
  ]
1516
1551
  },
1517
1552
  "endpoint_types": [
1518
- "anthropic",
1519
- "openai"
1553
+ "openai",
1554
+ "anthropic"
1520
1555
  ]
1521
1556
  },
1522
1557
  {
@@ -1627,7 +1662,6 @@
1627
1662
  ]
1628
1663
  },
1629
1664
  "endpoint_types": [
1630
- "anthropic",
1631
1665
  "openai"
1632
1666
  ]
1633
1667
  },
@@ -1693,8 +1727,8 @@
1693
1727
  ]
1694
1728
  },
1695
1729
  "endpoint_types": [
1696
- "anthropic",
1697
- "openai"
1730
+ "openai",
1731
+ "anthropic"
1698
1732
  ]
1699
1733
  },
1700
1734
  {
@@ -1725,8 +1759,8 @@
1725
1759
  ]
1726
1760
  },
1727
1761
  "endpoint_types": [
1728
- "anthropic",
1729
- "openai"
1762
+ "openai",
1763
+ "anthropic"
1730
1764
  ]
1731
1765
  },
1732
1766
  {
@@ -2092,6 +2126,7 @@
2092
2126
  },
2093
2127
  "tier_chains": {
2094
2128
  "fable": [
2129
+ "claude-fable-5-2",
2095
2130
  "claude-fable-5-1",
2096
2131
  "claude-fable-5",
2097
2132
  "claude-opus-5-5",
@@ -2142,7 +2177,8 @@
2142
2177
  "claude-sonnet-5-5",
2143
2178
  "claude-haiku-5-5",
2144
2179
  "claude-fable-5",
2145
- "claude-fable-5-1"
2180
+ "claude-fable-5-1",
2181
+ "claude-fable-5-2"
2146
2182
  ]
2147
2183
  },
2148
2184
  "key_groups": {
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- if(Number(process.versions.node.split(".")[0])<20){const{brand:e}=await import("./lib/brand.js"),r=e().productName;console.error(`无法启动 ${r}:需要 Node.js 20 或更高版本,当前是 v${process.versions.node}。\n请安装 Node.js LTS 版(国内镜像:https://registry.npmmirror.com/binary.html?path=node/ ,也可以运行 nvm install --lts),安装后重新打开终端再运行。\n${r} needs Node.js 20 or later (found v${process.versions.node}); install the LTS release and open a new terminal.`),process.exit(1)}const{Command:e}=await import("./lib/command.js"),{logger:r}=await import("./utils/logger.js"),{reportCliError:o}=await import("./lib/errors.js"),{telemetryPending:s}=await import("./lib/telemetry.js");try{await(new e).execute(process.argv.slice(2))}catch(e){r.logError("CLI",e),o(e)}s()&&process.exit();export{};
2
+ if(Number(process.versions.node.split(".")[0])<20){const{brand:e}=await import("./lib/brand.js"),r=e().productName;console.error(`无法启动 ${r}:需要 Node.js 20 或更高版本,当前是 v${process.versions.node}。\n请安装 Node.js LTS 版(国内镜像:https://registry.npmmirror.com/binary.html?path=node/ ,也可以运行 nvm install --lts),安装后重新打开终端再运行。\n${r} needs Node.js 20 or later (found v${process.versions.node}); install the LTS release and open a new terminal.`),process.exit(1)}const{Command:e}=await import("./lib/command.js"),{logger:r}=await import("./utils/logger.js"),{reportCliError:o}=await import("./lib/errors.js"),{telemetryPending:s,reportCrash:t}=await import("./lib/telemetry.js");let n=!1;const i=e=>{n&&process.exit(1),n=!0,process.exitCode=1,console.error(e instanceof Error?e.stack??e.message:e);try{r.logError("CLI crash",e)}catch{}t(e).finally(()=>process.exit(1))};process.on("uncaughtException",i),process.on("unhandledRejection",i);try{await(new e).execute(process.argv.slice(2))}catch(e){r.logError("CLI",e),o(e)}s()&&process.exit();export{};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema": 1,
3
- "revision": "2026-11-03T15:29:29Z-12",
3
+ "revision": "2026-11-10T00:13:23Z-14",
4
4
  "min_client_version": "",
5
5
  "upgrade_message": "",
6
6
  "defaults": {
@@ -122,6 +122,46 @@
122
122
  "openai"
123
123
  ]
124
124
  },
125
+ {
126
+ "id": "claude-fable-5-2",
127
+ "name": "Claude Fable 5.2",
128
+ "description": "100 万上下文 | 高难度推理 | 长时 Agent 与多步研究",
129
+ "group": "",
130
+ "group_name": "",
131
+ "recommended": false,
132
+ "hidden": false,
133
+ "context_window": 1000000,
134
+ "max_output_tokens": 128000,
135
+ "capabilities": {
136
+ "functionCall": true,
137
+ "vision": true,
138
+ "reasoning": true,
139
+ "imageOutput": false,
140
+ "video": false,
141
+ "structuredOutput": true,
142
+ "contextWindowTokens": 1000000,
143
+ "maxOutput": 128000,
144
+ "inputModalities": [
145
+ "text",
146
+ "image"
147
+ ],
148
+ "outputModalities": [
149
+ "text"
150
+ ],
151
+ "knowledgeCutoff": "2026-06-30",
152
+ "reasoningEfforts": [
153
+ "low",
154
+ "medium",
155
+ "high",
156
+ "xhigh",
157
+ "max"
158
+ ]
159
+ },
160
+ "endpoint_types": [
161
+ "anthropic",
162
+ "openai"
163
+ ]
164
+ },
125
165
  {
126
166
  "id": "claude-fable-5-1",
127
167
  "name": "Claude Fable 5.1",
@@ -464,8 +504,8 @@
464
504
  ]
465
505
  },
466
506
  "endpoint_types": [
467
- "anthropic",
468
- "openai"
507
+ "openai",
508
+ "anthropic"
469
509
  ]
470
510
  },
471
511
  {
@@ -574,8 +614,8 @@
574
614
  ]
575
615
  },
576
616
  "endpoint_types": [
577
- "anthropic",
578
- "openai"
617
+ "openai",
618
+ "anthropic"
579
619
  ]
580
620
  },
581
621
  {
@@ -609,8 +649,7 @@
609
649
  ]
610
650
  },
611
651
  "endpoint_types": [
612
- "openai",
613
- "anthropic"
652
+ "openai"
614
653
  ]
615
654
  },
616
655
  {
@@ -646,8 +685,7 @@
646
685
  ]
647
686
  },
648
687
  "endpoint_types": [
649
- "openai",
650
- "anthropic"
688
+ "openai"
651
689
  ]
652
690
  },
653
691
  {
@@ -681,8 +719,8 @@
681
719
  ]
682
720
  },
683
721
  "endpoint_types": [
684
- "anthropic",
685
- "openai"
722
+ "openai",
723
+ "anthropic"
686
724
  ]
687
725
  },
688
726
  {
@@ -793,7 +831,6 @@
793
831
  ]
794
832
  },
795
833
  "endpoint_types": [
796
- "anthropic",
797
834
  "openai"
798
835
  ]
799
836
  },
@@ -859,8 +896,8 @@
859
896
  ]
860
897
  },
861
898
  "endpoint_types": [
862
- "anthropic",
863
- "openai"
899
+ "openai",
900
+ "anthropic"
864
901
  ]
865
902
  },
866
903
  {
@@ -891,8 +928,8 @@
891
928
  ]
892
929
  },
893
930
  "endpoint_types": [
894
- "anthropic",
895
- "openai"
931
+ "openai",
932
+ "anthropic"
896
933
  ]
897
934
  },
898
935
  {
@@ -1298,8 +1335,8 @@
1298
1335
  ]
1299
1336
  },
1300
1337
  "endpoint_types": [
1301
- "anthropic",
1302
- "openai"
1338
+ "openai",
1339
+ "anthropic"
1303
1340
  ]
1304
1341
  },
1305
1342
  {
@@ -1408,8 +1445,8 @@
1408
1445
  ]
1409
1446
  },
1410
1447
  "endpoint_types": [
1411
- "anthropic",
1412
- "openai"
1448
+ "openai",
1449
+ "anthropic"
1413
1450
  ]
1414
1451
  },
1415
1452
  {
@@ -1443,8 +1480,7 @@
1443
1480
  ]
1444
1481
  },
1445
1482
  "endpoint_types": [
1446
- "openai",
1447
- "anthropic"
1483
+ "openai"
1448
1484
  ]
1449
1485
  },
1450
1486
  {
@@ -1480,8 +1516,7 @@
1480
1516
  ]
1481
1517
  },
1482
1518
  "endpoint_types": [
1483
- "openai",
1484
- "anthropic"
1519
+ "openai"
1485
1520
  ]
1486
1521
  },
1487
1522
  {
@@ -1515,8 +1550,8 @@
1515
1550
  ]
1516
1551
  },
1517
1552
  "endpoint_types": [
1518
- "anthropic",
1519
- "openai"
1553
+ "openai",
1554
+ "anthropic"
1520
1555
  ]
1521
1556
  },
1522
1557
  {
@@ -1627,7 +1662,6 @@
1627
1662
  ]
1628
1663
  },
1629
1664
  "endpoint_types": [
1630
- "anthropic",
1631
1665
  "openai"
1632
1666
  ]
1633
1667
  },
@@ -1693,8 +1727,8 @@
1693
1727
  ]
1694
1728
  },
1695
1729
  "endpoint_types": [
1696
- "anthropic",
1697
- "openai"
1730
+ "openai",
1731
+ "anthropic"
1698
1732
  ]
1699
1733
  },
1700
1734
  {
@@ -1725,8 +1759,8 @@
1725
1759
  ]
1726
1760
  },
1727
1761
  "endpoint_types": [
1728
- "anthropic",
1729
- "openai"
1762
+ "openai",
1763
+ "anthropic"
1730
1764
  ]
1731
1765
  },
1732
1766
  {
@@ -2092,6 +2126,7 @@
2092
2126
  },
2093
2127
  "tier_chains": {
2094
2128
  "fable": [
2129
+ "claude-fable-5-2",
2095
2130
  "claude-fable-5-1",
2096
2131
  "claude-fable-5",
2097
2132
  "claude-opus-5-5",
@@ -2142,7 +2177,8 @@
2142
2177
  "claude-sonnet-5-5",
2143
2178
  "claude-haiku-5-5",
2144
2179
  "claude-fable-5",
2145
- "claude-fable-5-1"
2180
+ "claude-fable-5-1",
2181
+ "claude-fable-5-2"
2146
2182
  ]
2147
2183
  },
2148
2184
  "key_groups": {
@@ -58,6 +58,13 @@ export declare function track(step: string, status: StepStatus, extra?: {
58
58
  export declare function trackStep<T>(step: string, run: () => Promise<T> | T, detail?: Record<string, unknown>): Promise<T>;
59
59
  /** Sends what is queued and waits for it, at most `timeoutMs`; called before the process exits. */
60
60
  export declare function flushTelemetry(timeoutMs?: number): Promise<void>;
61
+ /**
62
+ * A throw that never reaches the command's own handler (an event or timer callback, a promise nobody awaits) ends the
63
+ * process with exit code 1 and, until now, no event: support saw only the install script's "exited with 1"
64
+ * (11-10, 0.0.170: setup sat in its closing steps for two hours after upgrading ChatGPT, then exited 1, no reason).
65
+ * Recorded as the command's failure, typed `crash`, with the first stack frame, and sent before the process goes.
66
+ */
67
+ export declare function reportCrash(error: unknown, timeoutMs?: number): Promise<void>;
61
68
  /**
62
69
  * Uploads a diagnostic report (the user asked for it, so `<PREFIX>_TELEMETRY=0` doesn't apply);
63
70
  * resolves to the code support looks it up by, or null when it didn't go through.
@@ -1 +1 @@
1
- import{randomUUID as e}from"crypto";import{arch as t,homedir as r,release as o}from"os";import{format as n,stripVTControlCharacters as s}from"util";import{brand as a,brandEnv as i,CLI_NAME as c}from"./brand.js";import{clientVersion as l,installId as u}from"./client-config.js";import{configManager as p}from"./config.js";import{gatewayAddresses as f}from"./gateway-addresses.js";import{INSTALL_ID_HEADER as m,REPORT_PATH as d,TELEMETRY_PATH as g}from"./gateway-protocol.js";const h=e();let w="wizard",y=[];const T=new Set;let S=null,x=v;export function telemetryEnabled(){if(process.env.VITEST&&!k)return!1;const e=i("TELEMETRY")?.trim().toLowerCase();return!("0"===e||"false"===e||"off"===e)}let $,k=!1;export function setTelemetrySenderForTests(e){x=e??v,k=null!==e,y=[]}export function clientHeaders(){const e=`${c}/${l()} (${process.platform} ${o()}; ${t()}) node/${process.versions.node}`;return telemetryEnabled()?{"User-Agent":e,[m]:u()}:{"User-Agent":e}}export function installClientHeaders(){const e=globalThis.fetch;if(!e||e.gatewayHeaders)return;const t=(t,r)=>{try{const o=new URL("string"==typeof t||t instanceof URL?t.toString():t.url);if(new Set([p.getBaseUrl(),...f().map(e=>e.url)].map(e=>new URL(e).host)).has(o.host)){const o=new Headers(r?.headers??(t instanceof Request?t.headers:void 0));for(const[e,t]of Object.entries(clientHeaders()))o.has(e)||o.set(e,t);return e(t,{...r,headers:o})}}catch{}return e(t,r)};t.gatewayHeaders=!0,globalThis.fetch=t}export function telemetryPending(){return T.size>0}function _(){return{install_id:u(),cli_version:l(),brand:a().id,os:process.platform,os_release:o(),arch:t(),node_version:process.versions.node}}export function maskHome(e){const t=r();if(!t||t.length<2)return e;const o=new Set([t,t.replace(/\\/g,"/")]);let n=e;for(const e of o)n=n.split(e).join("~");return n}export function maskSecrets(e){return maskHome(e).replace(/(sk-[A-Za-z0-9_-]{2})[A-Za-z0-9_-]{8,}([A-Za-z0-9_-]{4})\b/g,"$1…$2").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]{8,}/gi,"$1…").replace(/(\b[a-z][a-z0-9+.-]*:\/\/)\S*@/gi,"$1…@").replace(/[^\s/@:]+:[^\s/]*@(?=[a-z0-9.-]+)/gi,"…@").replace(/\b((?:api[_-]?key|token|password|passwd|secret|auth)\s*[=:]\s*)("?)[^\s"&;,]{6,}\2/gi,"$1$2…$2")}let b=!1;export function noteFailureReason(e){const t=s(e).split("\n").map(e=>e.trim()).filter(Boolean).pop();t&&($=t)}export function lastFailureReason(){return $}export function watchConsoleErrors(){if(b)return;b=!0;const e=console.error;console.error=(...t)=>{noteFailureReason(n(...t)),e.apply(console,t)}}export function setTelemetryCommand(e){w=e}export function track(e,t,r={}){if(!telemetryEnabled())return;const o=void 0===r.error?void 0:maskSecrets(r.error instanceof Error?r.error.message:String(r.error)).slice(0,2e3);y.push({ts:Date.now(),session:h,command:w,step:e,status:t,...void 0!==r.duration_ms?{duration_ms:Math.round(r.duration_ms)}:{},...o?{error:o}:{},...r.detail?{detail:r.detail}:{}}),"start"===t?z():S||(S=setTimeout(z,500),S.unref())}export async function trackStep(e,t,r){const o=Date.now();track(e,"start",r?{detail:r}:{});try{const r=await t();return track(e,"ok",{duration_ms:Date.now()-o}),r}catch(t){throw track(e,"fail",{duration_ms:Date.now()-o,error:t}),t}}function z(){if(S&&(clearTimeout(S),S=null),0===y.length)return;const e=y.splice(0,50),t=x(g,{..._(),events:e},3e3).then(()=>{},()=>{}).finally(()=>T.delete(t));T.add(t),y.length>0&&z()}export async function flushTelemetry(e=1500){z(),0!==T.size&&await Promise.race([Promise.allSettled([...T]),new Promise(t=>setTimeout(t,e).unref())])}export async function uploadReport(e){try{const t=await x(d,{..._(),report:e},2e4),r=t?.data?.code;return"string"==typeof r&&r?r:null}catch{return null}}async function v(e,t,r){const o=p.getApiKey()?.trim(),n=await fetch(new URL(e,p.getBaseUrl()).toString(),{method:"POST",headers:{"Content-Type":"application/json",...clientHeaders(),...o?{Authorization:`Bearer ${o}`}:{}},body:JSON.stringify(t),signal:AbortSignal.timeout(r)});if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json().catch(()=>null)}
1
+ import{randomUUID as e}from"crypto";import{arch as t,homedir as r,release as o}from"os";import{format as n,stripVTControlCharacters as s}from"util";import{brand as a,brandEnv as i,CLI_NAME as c}from"./brand.js";import{clientVersion as l,installId as u}from"./client-config.js";import{configManager as p}from"./config.js";import{gatewayAddresses as f}from"./gateway-addresses.js";import{INSTALL_ID_HEADER as m,REPORT_PATH as d,TELEMETRY_PATH as h}from"./gateway-protocol.js";const g=e();let y="wizard",w=[];const T=new Set;let k=null,x=z;export function telemetryEnabled(){if(process.env.VITEST&&!$)return!1;const e=i("TELEMETRY")?.trim().toLowerCase();return!("0"===e||"false"===e||"off"===e)}let S,$=!1;export function setTelemetrySenderForTests(e){x=e??z,$=null!==e,w=[]}export function clientHeaders(){const e=`${c}/${l()} (${process.platform} ${o()}; ${t()}) node/${process.versions.node}`;return telemetryEnabled()?{"User-Agent":e,[m]:u()}:{"User-Agent":e}}export function installClientHeaders(){const e=globalThis.fetch;if(!e||e.gatewayHeaders)return;const t=(t,r)=>{try{const o=new URL("string"==typeof t||t instanceof URL?t.toString():t.url);if(new Set([p.getBaseUrl(),...f().map(e=>e.url)].map(e=>new URL(e).host)).has(o.host)){const o=new Headers(r?.headers??(t instanceof Request?t.headers:void 0));for(const[e,t]of Object.entries(clientHeaders()))o.has(e)||o.set(e,t);return e(t,{...r,headers:o})}}catch{}return e(t,r)};t.gatewayHeaders=!0,globalThis.fetch=t}export function telemetryPending(){return T.size>0}function _(){return{install_id:u(),cli_version:l(),brand:a().id,os:process.platform,os_release:o(),arch:t(),node_version:process.versions.node}}export function maskHome(e){const t=r();if(!t||t.length<2)return e;const o=new Set([t,t.replace(/\\/g,"/")]);let n=e;for(const e of o)n=n.split(e).join("~");return n}export function maskSecrets(e){return maskHome(e).replace(/(sk-[A-Za-z0-9_-]{2})[A-Za-z0-9_-]{8,}([A-Za-z0-9_-]{4})\b/g,"$1…$2").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]{8,}/gi,"$1…").replace(/(\b[a-z][a-z0-9+.-]*:\/\/)\S*@/gi,"$1…@").replace(/[^\s/@:]+:[^\s/]*@(?=[a-z0-9.-]+)/gi,"…@").replace(/\b((?:api[_-]?key|token|password|passwd|secret|auth)\s*[=:]\s*)("?)[^\s"&;,]{6,}\2/gi,"$1$2…$2")}let b=!1;export function noteFailureReason(e){const t=s(e).split("\n").map(e=>e.trim()).filter(Boolean).pop();t&&(S=t)}export function lastFailureReason(){return S}export function watchConsoleErrors(){if(b)return;b=!0;const e=console.error;console.error=(...t)=>{noteFailureReason(n(...t)),e.apply(console,t)}}export function setTelemetryCommand(e){y=e}export function track(e,t,r={}){if(!telemetryEnabled())return;const o=void 0===r.error?void 0:maskSecrets(r.error instanceof Error?r.error.message:String(r.error)).slice(0,2e3);w.push({ts:Date.now(),session:g,command:y,step:e,status:t,...void 0!==r.duration_ms?{duration_ms:Math.round(r.duration_ms)}:{},...o?{error:o}:{},...r.detail?{detail:r.detail}:{}}),"start"===t?v():k||(k=setTimeout(v,500),k.unref())}export async function trackStep(e,t,r){const o=Date.now();track(e,"start",r?{detail:r}:{});try{const r=await t();return track(e,"ok",{duration_ms:Date.now()-o}),r}catch(t){throw track(e,"fail",{duration_ms:Date.now()-o,error:t}),t}}function v(){if(k&&(clearTimeout(k),k=null),0===w.length)return;const e=w.splice(0,50),t=x(h,{..._(),events:e},3e3).then(()=>{},()=>{}).finally(()=>T.delete(t));T.add(t),w.length>0&&v()}export async function flushTelemetry(e=1500){v(),0!==T.size&&await Promise.race([Promise.allSettled([...T]),new Promise(t=>setTimeout(t,e).unref())])}export async function reportCrash(e,t=1500){const r=e instanceof Error?e.stack?.split("\n").map(e=>e.trim()).find(e=>e.startsWith("at ")):void 0;track("command","fail",{error:e,detail:{exit_code:1,type:"crash",...r?{at:maskHome(r).slice(0,200)}:{}}}),await flushTelemetry(t)}export async function uploadReport(e){try{const t=await x(d,{..._(),report:e},2e4),r=t?.data?.code;return"string"==typeof r&&r?r:null}catch{return null}}async function z(e,t,r){const o=p.getApiKey()?.trim(),n=await fetch(new URL(e,p.getBaseUrl()).toString(),{method:"POST",headers:{"Content-Type":"application/json",...clientHeaders(),...o?{Authorization:`Bearer ${o}`}:{}},body:JSON.stringify(t),signal:AbortSignal.timeout(r)});if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json().catch(()=>null)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibeapi/cli",
3
- "version": "0.0.170",
3
+ "version": "0.0.171",
4
4
  "description": "CLI tool for managing AI coding assistants (Claude Code, Codex, OpenClaw, Hermes, AtomCode, Grok Build) with one unified config",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",