claude-down 0.3.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kaj Kowalski
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,122 @@
1
+ # claude-down
2
+
3
+ **Is Claude down? Again?**
4
+
5
+ > A tiny CLI tool to check if Claude is operational, combining official status reports with community signals.
6
+
7
+ `claude-down` monitors two sources in parallel:
8
+
9
+ 1. **Anthropic Status Page** (`status.claude.com`): The authoritative source for incident reports and component status.
10
+ 2. **Downdetector**: Community-driven signal that often leads official reports by several minutes.
11
+
12
+ ## Installation
13
+
14
+ You can run it directly using `bunx` or `npx`:
15
+
16
+ ```bash
17
+ bunx claude-down status
18
+ # or
19
+ npx -y claude-down status
20
+ ```
21
+
22
+ Or install it globally:
23
+
24
+ ```bash
25
+ bun install -g claude-down
26
+ # or
27
+ npm install -g claude-down
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ### Human-readable summary
33
+
34
+ The `status` command provides a status indicator, a brief description, and details from both sources.
35
+
36
+ ```bash
37
+ claude-down status
38
+ ```
39
+
40
+ ### JSON output
41
+
42
+ Get structured data for scripts or monitoring tools.
43
+
44
+ ```bash
45
+ claude-down status --json
46
+ ```
47
+
48
+ ### Silent mode
49
+
50
+ Use for CI/CD or shell scripts where you only care about the exit code.
51
+
52
+ ```bash
53
+ claude-down status -q
54
+ ```
55
+
56
+ ### Specific source
57
+
58
+ You can check a specific source using subcommands or the `--source` flag.
59
+
60
+ ```bash
61
+ # Using subcommands
62
+ claude-down anthropic
63
+ claude-down downdetector
64
+
65
+ # Using flags
66
+ claude-down status --source anthropic
67
+ # or
68
+ claude-down status -s downdetector
69
+ ```
70
+
71
+ ## Browser Usage
72
+
73
+ `claude-down` provides a browser-safe entry point that only includes the Anthropic Statuspage source (since Downdetector requires a local Chromium binary).
74
+
75
+ ```typescript
76
+ import { checkAnthropic, fetchSummary } from "claude-down/browser";
77
+
78
+ const status = await checkAnthropic();
79
+ if (status.down) {
80
+ console.log("Claude is down:", status.reason);
81
+ }
82
+ ```
83
+
84
+ ## Exit Codes
85
+
86
+ The CLI returns specific exit codes based on the severity of the outage:
87
+
88
+ | Code | Status | Description |
89
+ | -----: | :---------- | :------------------------------------------------------------ |
90
+ | **0** | Operational | Everything is working normally. |
91
+ | **1** | Degraded | Minor issues reported by Anthropic. |
92
+ | **2** | Outage | Major/critical outage or Downdetector reports Claude is down. |
93
+ | **21** | Unknown | Both status sources are unreachable. |
94
+
95
+ ## Development
96
+
97
+ This project is built with [dreamcli].
98
+
99
+ ### Setup
100
+
101
+ ```bash
102
+ bun install
103
+ ```
104
+
105
+ ### Build
106
+
107
+ ```bash
108
+ bun run build
109
+ ```
110
+
111
+ ### Test
112
+
113
+ ```bash
114
+ bun test
115
+ ```
116
+
117
+ ## License
118
+
119
+ [MIT][LICENSE] © 2026 Kaj Kowalski
120
+
121
+ [LICENSE]: https://github.com/kjanat/claude-down/blob/master/LICENSE
122
+ [dreamcli]: https://github.com/kjanat/dreamcli
@@ -0,0 +1,11 @@
1
+ import { n as Result } from "./types-phXTAZxX.mjs";
2
+
3
+ //#region src/lib/anthropic.d.ts
4
+ /** Checks the status of Anthropic's services by querying their Statuspage API.
5
+ *
6
+ * @param baseUrl - Optional base URL for the Anthropic Statuspage API. Defaults to a predefined constant.
7
+ * @returns A promise that resolves to a Result object containing either the summary of the status or an error reason.
8
+ */
9
+ declare function check(baseUrl?: string): Promise<Result>;
10
+ //#endregion
11
+ export { check as checkAnthropic, check as default };
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ import{CLIError as e,cli as t,command as n,flag as r}from"@kjanat/dreamcli";import{exit as i,stdout as a}from"node:process";import{spawn as o,spawnSync as s}from"node:child_process";import{mkdtempSync as c,rmSync as l}from"node:fs";import{tmpdir as ee}from"node:os";import{join as u}from"node:path";import{setTimeout as d}from"node:timers/promises";var f=Object.defineProperty,p=Object.getOwnPropertyDescriptor,te=Object.getOwnPropertyNames,m=Object.prototype.hasOwnProperty,h=(e,t)=>()=>(e&&(t=e(e=0)),t),g=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),_=(e,t)=>{let n={};for(var r in e)f(n,r,{get:e[r],enumerable:!0});return t||f(n,Symbol.toStringTag,{value:`Module`}),n},v=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=te(t),a=0,o=i.length,s;a<o;a++)s=i[a],!m.call(e,s)&&s!==n&&f(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=p(t,s))||r.enumerable});return e},ne=e=>m.call(e,`module.exports`)?e[`module.exports`]:v(f({},`__esModule`,{value:!0}),e),y=g((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Endpoint=void 0,e.Endpoint={ACTIVE_JSON:`upcoming.json`,API_V2_BASE:`api/v2`,components(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.COMPONENTS_JSON}`},COMPONENTS_JSON:`components.json`,INCIDENTS:`incidents`,Incidents:{all(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.INCIDENTS_JSON}`},unresolved(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.INCIDENTS}/${e.Endpoint.UNRESOLVED_JSON}`}},INCIDENTS_JSON:`incidents.json`,SCHEDULED_MAINTENANCES:`scheduled-maintenances`,SCHEDULED_MAINTENANCES_JSON:`scheduled-maintenances.json`,ScheduledMaintenances:{active(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SCHEDULED_MAINTENANCES}/${e.Endpoint.ACTIVE_JSON}`},all(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SCHEDULED_MAINTENANCES_JSON}`},upcoming(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SCHEDULED_MAINTENANCES}/${e.Endpoint.UPCOMING_JSON}`}},status(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.STATUS_JSON}`},STATUS_JSON:`status.json`,subscriber(t){return`/${e.Endpoint.API_V2_BASE}/subscribers/${encodeURIComponent(t)}.json`},subscribers(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SUBSCRIBERS_JSON}`},SUBSCRIBERS_JSON:`subscribers.json`,summary(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SUMMARY_JSON}`},SUMMARY_JSON:`summary.json`,UNRESOLVED_JSON:`unresolved.json`,UPCOMING_JSON:`upcoming.json`}})),b=g((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.IncidentsAPI=void 0;let n=y();e.IncidentsAPI=class{constructor(e){this.apiClient=e}getAll(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.Incidents.all(),{data:t}=yield this.apiClient.get(e);return t})}getUnresolved(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.Incidents.unresolved(),{data:t}=yield this.apiClient.get(e);return t})}}})),x=g((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.ScheduledMaintenancesAPI=void 0;let n=y();e.ScheduledMaintenancesAPI=class{constructor(e){this.apiClient=e}getActive(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.ScheduledMaintenances.active(),{data:t}=yield this.apiClient.get(e);return t})}getAll(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.ScheduledMaintenances.all(),{data:t}=yield this.apiClient.get(e);return t})}getUpcoming(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.ScheduledMaintenances.upcoming(),{data:t}=yield this.apiClient.get(e);return t})}}})),S=g((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.SubscribersAPI=void 0;let n=y();e.SubscribersAPI=class{constructor(e){this.apiClient=e}createComponentSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscribers(),{data:r}=yield this.apiClient.post(t,{subscriber:e});return r})}createIncidentSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscribers(),{data:r}=yield this.apiClient.post(t,{subscriber:e});return r})}createPageSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscribers(),{data:r}=yield this.apiClient.post(t,{subscriber:e});return r})}getSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscribers(),{data:r}=yield this.apiClient.get(t,{params:{subscriber:{id:e}}});return r})}removeSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscriber(e),{data:r}=yield this.apiClient.delete(t);return r})}}})),C=g((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(b(),e),n(x(),e),n(S(),e)})),re=g((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ie=g((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ae=g((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MaintenanceStatus=e.IncidentStatus=e.IncidentImpact=void 0;var t;(function(e){e.Critical=`critical`,e.Major=`major`,e.Minor=`minor`,e.None=`none`})(t||(e.IncidentImpact=t={}));var n;(function(e){e.Identified=`identified`,e.Investigating=`investigating`,e.Monitoring=`monitoring`,e.Postmortem=`postmortem`,e.Resolved=`resolved`})(n||(e.IncidentStatus=n={}));var r;(function(e){e.Completed=`completed`,e.InProgress=`in_progress`,e.Scheduled=`scheduled`,e.Verifying=`verifying`})(r||(e.MaintenanceStatus=r={}))})),oe=g((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(re(),e),n(ie(),e),n(ae(),e)})),w,T=h((()=>{w=class{constructor(e,t){this.baseUrl=e,this.config=t,this.interceptors={request:[],response:[]}}async delete(e,t){let n=await this.request(e,{...t,method:`DELETE`});return{data:await this.formatData(n,t),headers:n.headers,status:n.status}}async get(e,t){let n=await this.request(e,{...t,method:`GET`});return{data:await this.formatData(n,t),headers:n.headers,status:n.status}}async head(e,t){let n=await this.request(e,{...t,method:`HEAD`});return{data:await this.formatData(n,t),headers:n.headers,status:n.status}}async options(e,t){let n=await this.request(e,{...t,method:`OPTIONS`});return{data:await this.formatData(n,t),headers:n.headers,status:n.status}}async patch(e,t,n){let r=await this.request(e,{...n,data:t,method:`PATCH`});return{data:await this.formatData(r,n),headers:r.headers,status:r.status}}async post(e,t,n){let r=await this.request(e,{data:t,...n,method:`POST`});return{data:await this.formatData(r,n),headers:r.headers,status:r.status}}async put(e,t,n){let r=await this.request(e,{data:t,...n,method:`PUT`});return{data:await this.formatData(r,n),headers:r.headers,status:r.status}}async request(e,t){let n=new URL(e,this.baseUrl);if(t.params)for(let[e,r]of Object.entries(t.params))r!=null&&n.searchParams.append(e,String(r));let r={method:t.method.toUpperCase(),url:n,...this.config};if(t.headers&&(r.headers={...r.headers,...t.headers}),this.config?.auth){let{password:e,username:t}=this.config.auth,n=btoa(`${t}:${e}`);r.headers={...r.headers,Authorization:`Basic ${n}`}}if(t.data&&(t.data instanceof Object&&(r.headers={...r.headers,"Content-Type":`application/json`},t.data=JSON.stringify(t.data)),r.body=t.data),this.interceptors.request.length>0)for(let e of this.interceptors.request)r={...r,...await e({...r,url:n})};n=r.url;let i=await fetch(n,r);if(!i.ok){let e;try{e=await i.text()}catch{e=i.statusText}throw Error(e?`Request failed with status code ${i.status}: ${e}`:`Request failed with status code ${i.status}`)}if(this.interceptors.response.length>0)for(let e of this.interceptors.response)await e(i);return i}setBaseURL(e){this.baseUrl=e}setConfig(e){this.config=e}formatData(e,t){switch(t?.responseType||`json`){case`arraybuffer`:return e.arrayBuffer();case`blob`:return e.blob();case`text`:return e.text();default:return e.json()}}}})),E=h((()=>{})),D=_({APIClient:()=>w}),O=h((()=>{T(),E()})),k=g((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.Statuspage=void 0;let n=(O(),ne(D)),r=C(),i=y();e.Statuspage=class{constructor(e){if(this.getComponents=()=>t(this,void 0,void 0,function*(){let e=i.Endpoint.components(),{data:t}=yield this.apiClient.get(e);return t}),this.getStatus=()=>t(this,void 0,void 0,function*(){let e=i.Endpoint.status(),{data:t}=yield this.apiClient.get(e);return t}),this.getSummary=()=>t(this,void 0,void 0,function*(){let e=i.Endpoint.summary(),{data:t}=yield this.apiClient.get(e);return t}),!e)throw Error(`A page ID needs to be set in order to use the client.`);this.apiClient=new n.APIClient(`https://${e}.statuspage.io`),this.api={getComponents:this.getComponents,getStatus:this.getStatus,getSummary:this.getSummary,incidents:new r.IncidentsAPI(this.apiClient),scheduledMaintenances:new r.ScheduledMaintenancesAPI(this.apiClient),subscribers:new r.SubscribersAPI(this.apiClient)}}setApiUrl(e){this.apiClient.setBaseURL(e)}}})),A=g((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(C(),e),n(oe(),e),n(k(),e)}))();const j={none:0,minor:1,major:2,critical:2,unavailable:21},M=`https://status.claude.com`,N=[`google-chrome-stable`,`google-chrome`,`chromium`,`brave`,`microsoft-edge-stable`,`microsoft-edge`];async function P(e=M){try{let t=new A.Statuspage(`anthropic`);return t.setApiUrl(e),{kind:`ok`,summary:await t.api.getSummary()}}catch(e){return{kind:`unknown`,reason:e instanceof Error?e.message:String(e)}}}function F(){for(let e of N){let t=s(`which`,[e]);if(t.status===0&&t.stdout)return t.stdout.toString().trim()}return null}function I(e){return typeof e==`object`&&!!e&&`webSocketDebuggerUrl`in e&&typeof e.webSocketDebuggerUrl==`string`}function L(e){return typeof e==`object`&&!!e&&`id`in e&&typeof e.id==`number`}function R(e){return typeof e==`object`&&!!e&&`result`in e&&typeof e.result==`object`&&e.result!==null&&`result`in e.result&&typeof e.result.result==`object`&&e.result.result!==null&&`value`in e.result.result&&typeof e.result.result.value==`string`}function z(e){if(typeof e!=`object`||!e||!(`title`in e)||typeof e.title!=`string`||`h1`in e&&e.h1!==null&&typeof e.h1!=`string`||!(`pogo`in e))return!1;if(e.pogo===null)return!0;if(typeof e.pogo!=`object`)return!1;let t=e.pogo;return!(`outage`in t&&t.outage!==void 0&&typeof t.outage!=`boolean`)}async function B(e,t){let n=Date.now()+t;for(;Date.now()<n;){try{if((await fetch(`${e}/json/version`)).ok)return!0}catch{}await d(100)}return!1}function V(e){let t=new Map,n=0;return e.onmessage=e=>{let n=typeof e.data==`string`?e.data:e.data instanceof ArrayBuffer?new TextDecoder().decode(e.data):null;if(n===null)return;let r;try{r=JSON.parse(n)}catch{return}if(!L(r))return;let i=t.get(r.id);i&&(t.delete(r.id),i(r))},(r,i={})=>new Promise((a,o)=>{let s=++n,c=setTimeout(()=>{t.delete(s),o(Error(`CDP command '${r}' timed out`))},5e3);t.set(s,e=>{clearTimeout(c),a(e)}),e.send(JSON.stringify({id:s,method:r,params:i}))})}async function H(e,t){await e(`Runtime.enable`);let n=Date.now()+t;for(;Date.now()<n;){let t=await e(`Runtime.evaluate`,{expression:`JSON.stringify({ title: document.title, pogo: window.PogoConfig ?? null, h1: document.querySelector("h1")?.innerText ?? null })`,returnByValue:!0});if(R(t)){let e;try{e=JSON.parse(t.result.result.value)}catch{e=null}if(z(e)&&e.pogo!==null&&e.title!==`Just a moment...`)return{pogo:e.pogo,heading:e.h1}}await d(700)}return null}async function se(e){let t;try{t=c(u(ee(),`claude-down-`))}catch(e){return{ok:!1,error:`mkdtemp failed: ${e instanceof Error?e.message:String(e)}`}}let n=9222+Math.floor(Math.random()*1e3),r=o(e,[`--headless=new`,`--disable-gpu`,`--no-sandbox`,`--disable-blink-features=AutomationControlled`,`--window-size=1920,1080`,`--user-data-dir=${t}`,`--remote-debugging-port=${n}`,`--user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36`,`about:blank`],{stdio:`ignore`}),i=`http://localhost:${n}`;return await B(i,5e3)?{ok:!0,proc:r,userDataDir:t,base:i}:(r.kill(),l(t,{recursive:!0,force:!0,maxRetries:5,retryDelay:100}),{ok:!1,error:`CDP endpoint never came up`})}async function U(e,t){let n=await(await fetch(`${e}/json/new?${encodeURIComponent(t)}`,{method:`PUT`})).json();if(!I(n))return{ok:!1,error:`unexpected CDP target shape`};let r=new WebSocket(n.webSocketDebuggerUrl);return await new Promise((e,t)=>{r.onopen=()=>e(),r.onerror=()=>t(Error(`WebSocket connection failed`)),r.onclose=()=>t(Error(`WebSocket closed before opening`))}),{ok:!0,send:V(r),close:()=>r.close()}}async function W(){let e=F();if(!e)return{ok:!1,error:`no chromium/chrome binary found`};let t=await se(e);if(!t.ok)return t;let{proc:n,userDataDir:r,base:i}=t;try{let e=await U(i,`https://downdetector.com/status/claude-ai/`);if(!e.ok)return e;let t=await H(e.send,2e4);return e.close(),t?t.pogo.outage===!0?{ok:!0,down:!0,reason:t.heading??`outage reported`}:{ok:!0,down:!1}:{ok:!1,error:`CF challenge not cleared in time`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}finally{n.kill(),l(r,{recursive:!0,force:!0,maxRetries:5,retryDelay:100})}}const G=[`anthropic`,`downdetector`],K={anthropic:`Anthropic`,downdetector:`Downdetector`};function ce(e){return e===`none`||e===`minor`||e===`major`||e===`critical`?e:`critical`}function q(e,t,n){if(n.length!==0){e.push(` ${t}:`);for(let t of n)e.push(` - ${t}`)}}function le(e){let t=[K[e.source]];if(e.source===`downdetector`)return t.push(` ${e.details??`No user-reported issues`}`),t.join(`
3
+ `);t.push(` ${e.details??`All systems operational`}`);let n=e.incidents?.map(e=>`${e.name} (${e.status})`)??[];return q(t,n.length===1?`Active incident`:`Active incidents`,n),q(t,`Affected components`,e.affected?.map(e=>e.name)??[]),t.join(`
4
+ `)}async function J(t){let n=await P(t);if(n.kind===`unknown`)throw new e(`anthropic unavailable: ${n.reason}`,{code:`ANTHROPIC_UNAVAILABLE`,exitCode:j.unavailable,details:{anthropic:n.reason}});let r=ce(n.summary.status.indicator),i=n.summary.components.filter(e=>e.status!==`operational`);return{exitCode:j[r],row:{source:`anthropic`,status:r===`none`?`up`:r,details:n.summary.status.description,incidents:n.summary.incidents.length>0?n.summary.incidents.map(e=>({name:e.name,status:e.status})):null,affected:i.length>0?i.map(e=>({name:e.name,status:e.status})):null}}}async function Y(){let t=await W();if(!t.ok)throw new e(`downdetector unavailable: ${t.error}`,{code:`DOWNDETECTOR_UNAVAILABLE`,exitCode:j.unavailable,details:{downdetector:t.error}});return{exitCode:t.down?j.major:j.none,row:{source:`downdetector`,status:t.down?`down`:`up`,details:t.down?t.reason:null}}}async function ue(e,t){return Promise.all(e.map(e=>{switch(e){case`anthropic`:return J(t);case`downdetector`:return Y()}}))}function de(e){return e.reduce((e,t)=>Math.max(e,t.exitCode),j.none)}function fe(e){return e.map(e=>e.row).sort((e,t)=>e.source.localeCompare(t.source))}function X(e,t){if(t.jsonMode||!t.isTTY){t.json(e);return}t.log(e.map(e=>le(e)).join(`
5
+
6
+ `))}const Z=r.boolean().alias(`q`).describe(`Silent; exit code only`),Q=r.string().default(M).env(`CLAUDE_DOWN_ANTHROPIC_STATUS_BASE`).describe(`Override Anthropic status page base URL`),pe=r.array(r.enum(G)).default([...G]).alias(`s`).describe(`Data source(s) to check`),me=n(`status`).description(`Check Claude status across Anthropic and Downdetector`).example(`status`,`Check all sources`).example(`status --source anthropic`,`Check only Anthropic`).example(`status --json`,`Emit machine-readable source rows`).flag(`anthropicStatusBase`,Q).flag(`quiet`,Z).flag(`source`,pe).action(async({flags:e,out:t})=>{let n=await ue(e.source,e.anthropicStatusBase);if(e.quiet){let e=de(n);e!==0&&i(e);return}X(fe(n),t)}),he=n(`anthropic`).description(`Check only ${K.anthropic}`).example(`anthropic`,`Check only ${K.anthropic}`).flag(`anthropicStatusBase`,Q).flag(`quiet`,Z).action(async({flags:e,out:t})=>{let n=await J(e.anthropicStatusBase);if(e.quiet){n.exitCode!==0&&i(n.exitCode);return}X([n.row],t)}),ge=n(`downdetector`).description(`Check only ${K.downdetector}`).example(`downdetector`,`Check only ${K.downdetector}`).flag(`quiet`,Z).action(async({flags:e,out:t})=>{let n=await Y();if(e.quiet){n.exitCode!==0&&i(n.exitCode);return}X([n.row],t)}),$=t(`claude-down`).packageJson({inferName:!0}).command(me).command(he).command(ge).completions();import.meta.main&&$.run({help:{width:a.columns}});export{$ as claudeDown};
@@ -0,0 +1,107 @@
1
+ //#region node_modules/statuspage.io/dist/interfaces/Result.d.ts
2
+ declare enum IncidentImpact {
3
+ Critical = "critical",
4
+ Major = "major",
5
+ Minor = "minor",
6
+ None = "none"
7
+ }
8
+ declare enum IncidentStatus {
9
+ Identified = "identified",
10
+ Investigating = "investigating",
11
+ Monitoring = "monitoring",
12
+ Postmortem = "postmortem",
13
+ Resolved = "resolved"
14
+ }
15
+ declare enum MaintenanceStatus {
16
+ Completed = "completed",
17
+ InProgress = "in_progress",
18
+ Scheduled = "scheduled",
19
+ Verifying = "verifying"
20
+ }
21
+ interface Component {
22
+ created_at: string;
23
+ description: null | string;
24
+ group: boolean;
25
+ group_id: null | string;
26
+ id: string;
27
+ name: string;
28
+ only_show_if_degraded: boolean;
29
+ page_id: string;
30
+ position: number;
31
+ showcase: boolean;
32
+ start_date: null | string;
33
+ status: string;
34
+ updated_at: string;
35
+ }
36
+ interface Components extends Page {
37
+ components: Component[];
38
+ }
39
+ interface Incident {
40
+ created_at: string;
41
+ id: string;
42
+ impact: IncidentImpact;
43
+ incident_updates: IncidentUpdate[];
44
+ monitoring_at: null | string;
45
+ name: string;
46
+ page_id: string;
47
+ resolved_at: null | string;
48
+ shortlink: string;
49
+ status: IncidentStatus;
50
+ updated_at: string;
51
+ }
52
+ interface Incidents extends Page {
53
+ incidents: Incident[];
54
+ }
55
+ interface IncidentUpdate {
56
+ body: string;
57
+ created_at: string;
58
+ display_at: string;
59
+ id: string;
60
+ incident_id: string;
61
+ status: IncidentStatus;
62
+ updated_at: string;
63
+ }
64
+ interface Page {
65
+ page: {
66
+ id: string;
67
+ name: string;
68
+ time_zone: string;
69
+ updated_at: string;
70
+ url: string;
71
+ };
72
+ }
73
+ type ScheduledMaintenance = {
74
+ scheduled_for: string;
75
+ scheduled_until: string;
76
+ status: MaintenanceStatus;
77
+ } & Omit<Incident, 'status'>;
78
+ interface ScheduledMaintenances extends Page {
79
+ scheduled_maintenances: ScheduledMaintenance[];
80
+ }
81
+ interface Status extends Page {
82
+ status: {
83
+ description: string;
84
+ indicator: string;
85
+ };
86
+ }
87
+ type Summary = Components & Incidents & ScheduledMaintenances & Status;
88
+ //#endregion
89
+ //#region src/lib/types.d.ts
90
+ /** The result of a status check, which can either be a successful summary or an unknown state with a reason. */
91
+ type Result = {
92
+ kind: 'ok';
93
+ summary: Summary;
94
+ } | {
95
+ kind: 'unknown';
96
+ reason: string;
97
+ };
98
+ //#endregion
99
+ //#region src/lib/anthropic.d.ts
100
+ /** Checks the status of Anthropic's services by querying their Statuspage API.
101
+ *
102
+ * @param baseUrl - Optional base URL for the Anthropic Statuspage API. Defaults to a predefined constant.
103
+ * @returns A promise that resolves to a Result object containing either the summary of the status or an error reason.
104
+ */
105
+ declare function check(baseUrl?: string): Promise<Result>;
106
+ //#endregion
107
+ export { type Result, type Summary, check as checkAnthropic };
@@ -0,0 +1 @@
1
+ var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(e,t)=>()=>(e&&(t=e(e=0)),t),a=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),o=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},s=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var c=n(a),l=0,u=c.length,d;l<u;l++)d=c[l],!r.call(i,d)&&d!==o&&e(i,d,{get:(e=>a[e]).bind(null,d),enumerable:!(s=t(a,d))||s.enumerable});return i},c=t=>r.call(t,`module.exports`)?t[`module.exports`]:s(e({},`__esModule`,{value:!0}),t),l=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Endpoint=void 0,e.Endpoint={ACTIVE_JSON:`upcoming.json`,API_V2_BASE:`api/v2`,components(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.COMPONENTS_JSON}`},COMPONENTS_JSON:`components.json`,INCIDENTS:`incidents`,Incidents:{all(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.INCIDENTS_JSON}`},unresolved(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.INCIDENTS}/${e.Endpoint.UNRESOLVED_JSON}`}},INCIDENTS_JSON:`incidents.json`,SCHEDULED_MAINTENANCES:`scheduled-maintenances`,SCHEDULED_MAINTENANCES_JSON:`scheduled-maintenances.json`,ScheduledMaintenances:{active(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SCHEDULED_MAINTENANCES}/${e.Endpoint.ACTIVE_JSON}`},all(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SCHEDULED_MAINTENANCES_JSON}`},upcoming(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SCHEDULED_MAINTENANCES}/${e.Endpoint.UPCOMING_JSON}`}},status(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.STATUS_JSON}`},STATUS_JSON:`status.json`,subscriber(t){return`/${e.Endpoint.API_V2_BASE}/subscribers/${encodeURIComponent(t)}.json`},subscribers(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SUBSCRIBERS_JSON}`},SUBSCRIBERS_JSON:`subscribers.json`,summary(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SUMMARY_JSON}`},SUMMARY_JSON:`summary.json`,UNRESOLVED_JSON:`unresolved.json`,UPCOMING_JSON:`upcoming.json`}})),u=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.IncidentsAPI=void 0;let n=l();e.IncidentsAPI=class{constructor(e){this.apiClient=e}getAll(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.Incidents.all(),{data:t}=yield this.apiClient.get(e);return t})}getUnresolved(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.Incidents.unresolved(),{data:t}=yield this.apiClient.get(e);return t})}}})),d=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.ScheduledMaintenancesAPI=void 0;let n=l();e.ScheduledMaintenancesAPI=class{constructor(e){this.apiClient=e}getActive(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.ScheduledMaintenances.active(),{data:t}=yield this.apiClient.get(e);return t})}getAll(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.ScheduledMaintenances.all(),{data:t}=yield this.apiClient.get(e);return t})}getUpcoming(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.ScheduledMaintenances.upcoming(),{data:t}=yield this.apiClient.get(e);return t})}}})),f=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.SubscribersAPI=void 0;let n=l();e.SubscribersAPI=class{constructor(e){this.apiClient=e}createComponentSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscribers(),{data:r}=yield this.apiClient.post(t,{subscriber:e});return r})}createIncidentSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscribers(),{data:r}=yield this.apiClient.post(t,{subscriber:e});return r})}createPageSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscribers(),{data:r}=yield this.apiClient.post(t,{subscriber:e});return r})}getSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscribers(),{data:r}=yield this.apiClient.get(t,{params:{subscriber:{id:e}}});return r})}removeSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscriber(e),{data:r}=yield this.apiClient.delete(t);return r})}}})),p=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(u(),e),n(d(),e),n(f(),e)})),m=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),h=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),g=a((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MaintenanceStatus=e.IncidentStatus=e.IncidentImpact=void 0;var t;(function(e){e.Critical=`critical`,e.Major=`major`,e.Minor=`minor`,e.None=`none`})(t||(e.IncidentImpact=t={}));var n;(function(e){e.Identified=`identified`,e.Investigating=`investigating`,e.Monitoring=`monitoring`,e.Postmortem=`postmortem`,e.Resolved=`resolved`})(n||(e.IncidentStatus=n={}));var r;(function(e){e.Completed=`completed`,e.InProgress=`in_progress`,e.Scheduled=`scheduled`,e.Verifying=`verifying`})(r||(e.MaintenanceStatus=r={}))})),_=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(m(),e),n(h(),e),n(g(),e)})),v,y=i((()=>{v=class{constructor(e,t){this.baseUrl=e,this.config=t,this.interceptors={request:[],response:[]}}async delete(e,t){let n=await this.request(e,{...t,method:`DELETE`});return{data:await this.formatData(n,t),headers:n.headers,status:n.status}}async get(e,t){let n=await this.request(e,{...t,method:`GET`});return{data:await this.formatData(n,t),headers:n.headers,status:n.status}}async head(e,t){let n=await this.request(e,{...t,method:`HEAD`});return{data:await this.formatData(n,t),headers:n.headers,status:n.status}}async options(e,t){let n=await this.request(e,{...t,method:`OPTIONS`});return{data:await this.formatData(n,t),headers:n.headers,status:n.status}}async patch(e,t,n){let r=await this.request(e,{...n,data:t,method:`PATCH`});return{data:await this.formatData(r,n),headers:r.headers,status:r.status}}async post(e,t,n){let r=await this.request(e,{data:t,...n,method:`POST`});return{data:await this.formatData(r,n),headers:r.headers,status:r.status}}async put(e,t,n){let r=await this.request(e,{data:t,...n,method:`PUT`});return{data:await this.formatData(r,n),headers:r.headers,status:r.status}}async request(e,t){let n=new URL(e,this.baseUrl);if(t.params)for(let[e,r]of Object.entries(t.params))r!=null&&n.searchParams.append(e,String(r));let r={method:t.method.toUpperCase(),url:n,...this.config};if(t.headers&&(r.headers={...r.headers,...t.headers}),this.config?.auth){let{password:e,username:t}=this.config.auth,n=btoa(`${t}:${e}`);r.headers={...r.headers,Authorization:`Basic ${n}`}}if(t.data&&(t.data instanceof Object&&(r.headers={...r.headers,"Content-Type":`application/json`},t.data=JSON.stringify(t.data)),r.body=t.data),this.interceptors.request.length>0)for(let e of this.interceptors.request)r={...r,...await e({...r,url:n})};n=r.url;let i=await fetch(n,r);if(!i.ok){let e;try{e=await i.text()}catch{e=i.statusText}throw Error(e?`Request failed with status code ${i.status}: ${e}`:`Request failed with status code ${i.status}`)}if(this.interceptors.response.length>0)for(let e of this.interceptors.response)await e(i);return i}setBaseURL(e){this.baseUrl=e}setConfig(e){this.config=e}formatData(e,t){switch(t?.responseType||`json`){case`arraybuffer`:return e.arrayBuffer();case`blob`:return e.blob();case`text`:return e.text();default:return e.json()}}}})),b=i((()=>{})),x=o({APIClient:()=>v}),S=i((()=>{y(),b()})),C=a((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.Statuspage=void 0;let n=(S(),c(x)),r=p(),i=l();e.Statuspage=class{constructor(e){if(this.getComponents=()=>t(this,void 0,void 0,function*(){let e=i.Endpoint.components(),{data:t}=yield this.apiClient.get(e);return t}),this.getStatus=()=>t(this,void 0,void 0,function*(){let e=i.Endpoint.status(),{data:t}=yield this.apiClient.get(e);return t}),this.getSummary=()=>t(this,void 0,void 0,function*(){let e=i.Endpoint.summary(),{data:t}=yield this.apiClient.get(e);return t}),!e)throw Error(`A page ID needs to be set in order to use the client.`);this.apiClient=new n.APIClient(`https://${e}.statuspage.io`),this.api={getComponents:this.getComponents,getStatus:this.getStatus,getSummary:this.getSummary,incidents:new r.IncidentsAPI(this.apiClient),scheduledMaintenances:new r.ScheduledMaintenancesAPI(this.apiClient),subscribers:new r.SubscribersAPI(this.apiClient)}}setApiUrl(e){this.apiClient.setBaseURL(e)}}})),w=a((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(p(),e),n(_(),e),n(C(),e)}))();async function T(e=`https://status.claude.com`){try{let t=new w.Statuspage(`anthropic`);return t.setApiUrl(e),{kind:`ok`,summary:await t.api.getSummary()}}catch(e){return{kind:`unknown`,reason:e instanceof Error?e.message:String(e)}}}export{T as checkAnthropic};
@@ -0,0 +1,17 @@
1
+ //#region src/lib/constants.d.ts
2
+ /** Mapping of status levels to their corresponding exit codes. */
3
+ declare const EXIT_CODES: {
4
+ readonly none: 0;
5
+ readonly minor: 1;
6
+ readonly major: 2;
7
+ readonly critical: 2;
8
+ readonly unavailable: 21;
9
+ };
10
+ /** Base URL for Anthropic's status page API. */
11
+ declare const ANTHROPIC_STATUS_BASE = "https://status.claude.com";
12
+ /** URL for Claude AI's status page on Downdetector. */
13
+ declare const DOWNDETECTOR_URL = "https://downdetector.com/status/claude-ai/";
14
+ /** Executable names to probe via `which` when locating a Chromium-family binary. */
15
+ declare const BROWSER_CANDIDATES: readonly ["google-chrome-stable", "google-chrome", "chromium", "brave", "microsoft-edge-stable", "microsoft-edge"];
16
+ //#endregion
17
+ export { EXIT_CODES as i, BROWSER_CANDIDATES as n, DOWNDETECTOR_URL as r, ANTHROPIC_STATUS_BASE as t };
@@ -0,0 +1,2 @@
1
+ import { i as EXIT_CODES, n as BROWSER_CANDIDATES, r as DOWNDETECTOR_URL, t as ANTHROPIC_STATUS_BASE } from "./constants-CY8aOEl6.mjs";
2
+ export { ANTHROPIC_STATUS_BASE, BROWSER_CANDIDATES, DOWNDETECTOR_URL, EXIT_CODES };
@@ -0,0 +1,14 @@
1
+ import { r as Signal } from "./types-phXTAZxX.mjs";
2
+
3
+ //#region src/lib/downdetector.d.ts
4
+ /**
5
+ * Launches a headless Chrome instance, navigates to the Downdetector page for Claude AI,
6
+ * waits for the Cloudflare challenge to clear, and extracts the outage status.
7
+ *
8
+ * The browser and its temporary user data directory are cleaned up in all cases.
9
+ *
10
+ * @returns A {@link Signal} indicating whether an outage is reported, the service is up, or an error occurred.
11
+ */
12
+ declare function check(): Promise<Signal>;
13
+ //#endregion
14
+ export { check as checkDownDetector, check as default };
@@ -0,0 +1,5 @@
1
+ import { i as EXIT_CODES } from "./constants-CY8aOEl6.mjs";
2
+ import { i as Summary, n as Result, r as Signal, t as Indicator } from "./types-phXTAZxX.mjs";
3
+ import { checkAnthropic as check } from "./anthropic.mjs";
4
+ import { checkDownDetector as check$1 } from "./downdetector.mjs";
5
+ export { EXIT_CODES, type Indicator, type Result, type Signal, type Summary, check as checkAnthropic, check$1 as checkDownDetector };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{spawn as e,spawnSync as t}from"node:child_process";import{mkdtempSync as n,rmSync as r}from"node:fs";import{tmpdir as i}from"node:os";import{join as a}from"node:path";import{setTimeout as o}from"node:timers/promises";var s=Object.defineProperty,c=Object.getOwnPropertyDescriptor,l=Object.getOwnPropertyNames,u=Object.prototype.hasOwnProperty,d=(e,t)=>()=>(e&&(t=e(e=0)),t),f=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),p=(e,t)=>{let n={};for(var r in e)s(n,r,{get:e[r],enumerable:!0});return t||s(n,Symbol.toStringTag,{value:`Module`}),n},m=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=l(t),a=0,o=i.length,d;a<o;a++)d=i[a],!u.call(e,d)&&d!==n&&s(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=c(t,d))||r.enumerable});return e},h=e=>u.call(e,`module.exports`)?e[`module.exports`]:m(s({},`__esModule`,{value:!0}),e),g=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Endpoint=void 0,e.Endpoint={ACTIVE_JSON:`upcoming.json`,API_V2_BASE:`api/v2`,components(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.COMPONENTS_JSON}`},COMPONENTS_JSON:`components.json`,INCIDENTS:`incidents`,Incidents:{all(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.INCIDENTS_JSON}`},unresolved(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.INCIDENTS}/${e.Endpoint.UNRESOLVED_JSON}`}},INCIDENTS_JSON:`incidents.json`,SCHEDULED_MAINTENANCES:`scheduled-maintenances`,SCHEDULED_MAINTENANCES_JSON:`scheduled-maintenances.json`,ScheduledMaintenances:{active(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SCHEDULED_MAINTENANCES}/${e.Endpoint.ACTIVE_JSON}`},all(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SCHEDULED_MAINTENANCES_JSON}`},upcoming(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SCHEDULED_MAINTENANCES}/${e.Endpoint.UPCOMING_JSON}`}},status(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.STATUS_JSON}`},STATUS_JSON:`status.json`,subscriber(t){return`/${e.Endpoint.API_V2_BASE}/subscribers/${encodeURIComponent(t)}.json`},subscribers(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SUBSCRIBERS_JSON}`},SUBSCRIBERS_JSON:`subscribers.json`,summary(){return`/${e.Endpoint.API_V2_BASE}/${e.Endpoint.SUMMARY_JSON}`},SUMMARY_JSON:`summary.json`,UNRESOLVED_JSON:`unresolved.json`,UPCOMING_JSON:`upcoming.json`}})),_=f((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.IncidentsAPI=void 0;let n=g();e.IncidentsAPI=class{constructor(e){this.apiClient=e}getAll(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.Incidents.all(),{data:t}=yield this.apiClient.get(e);return t})}getUnresolved(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.Incidents.unresolved(),{data:t}=yield this.apiClient.get(e);return t})}}})),v=f((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.ScheduledMaintenancesAPI=void 0;let n=g();e.ScheduledMaintenancesAPI=class{constructor(e){this.apiClient=e}getActive(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.ScheduledMaintenances.active(),{data:t}=yield this.apiClient.get(e);return t})}getAll(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.ScheduledMaintenances.all(),{data:t}=yield this.apiClient.get(e);return t})}getUpcoming(){return t(this,void 0,void 0,function*(){let e=n.Endpoint.ScheduledMaintenances.upcoming(),{data:t}=yield this.apiClient.get(e);return t})}}})),y=f((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.SubscribersAPI=void 0;let n=g();e.SubscribersAPI=class{constructor(e){this.apiClient=e}createComponentSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscribers(),{data:r}=yield this.apiClient.post(t,{subscriber:e});return r})}createIncidentSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscribers(),{data:r}=yield this.apiClient.post(t,{subscriber:e});return r})}createPageSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscribers(),{data:r}=yield this.apiClient.post(t,{subscriber:e});return r})}getSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscribers(),{data:r}=yield this.apiClient.get(t,{params:{subscriber:{id:e}}});return r})}removeSubscription(e){return t(this,void 0,void 0,function*(){let t=n.Endpoint.subscriber(e),{data:r}=yield this.apiClient.delete(t);return r})}}})),b=f((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(_(),e),n(v(),e),n(y(),e)})),x=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),S=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),C=f((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MaintenanceStatus=e.IncidentStatus=e.IncidentImpact=void 0;var t;(function(e){e.Critical=`critical`,e.Major=`major`,e.Minor=`minor`,e.None=`none`})(t||(e.IncidentImpact=t={}));var n;(function(e){e.Identified=`identified`,e.Investigating=`investigating`,e.Monitoring=`monitoring`,e.Postmortem=`postmortem`,e.Resolved=`resolved`})(n||(e.IncidentStatus=n={}));var r;(function(e){e.Completed=`completed`,e.InProgress=`in_progress`,e.Scheduled=`scheduled`,e.Verifying=`verifying`})(r||(e.MaintenanceStatus=r={}))})),w=f((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(x(),e),n(S(),e),n(C(),e)})),T,E=d((()=>{T=class{constructor(e,t){this.baseUrl=e,this.config=t,this.interceptors={request:[],response:[]}}async delete(e,t){let n=await this.request(e,{...t,method:`DELETE`});return{data:await this.formatData(n,t),headers:n.headers,status:n.status}}async get(e,t){let n=await this.request(e,{...t,method:`GET`});return{data:await this.formatData(n,t),headers:n.headers,status:n.status}}async head(e,t){let n=await this.request(e,{...t,method:`HEAD`});return{data:await this.formatData(n,t),headers:n.headers,status:n.status}}async options(e,t){let n=await this.request(e,{...t,method:`OPTIONS`});return{data:await this.formatData(n,t),headers:n.headers,status:n.status}}async patch(e,t,n){let r=await this.request(e,{...n,data:t,method:`PATCH`});return{data:await this.formatData(r,n),headers:r.headers,status:r.status}}async post(e,t,n){let r=await this.request(e,{data:t,...n,method:`POST`});return{data:await this.formatData(r,n),headers:r.headers,status:r.status}}async put(e,t,n){let r=await this.request(e,{data:t,...n,method:`PUT`});return{data:await this.formatData(r,n),headers:r.headers,status:r.status}}async request(e,t){let n=new URL(e,this.baseUrl);if(t.params)for(let[e,r]of Object.entries(t.params))r!=null&&n.searchParams.append(e,String(r));let r={method:t.method.toUpperCase(),url:n,...this.config};if(t.headers&&(r.headers={...r.headers,...t.headers}),this.config?.auth){let{password:e,username:t}=this.config.auth,n=btoa(`${t}:${e}`);r.headers={...r.headers,Authorization:`Basic ${n}`}}if(t.data&&(t.data instanceof Object&&(r.headers={...r.headers,"Content-Type":`application/json`},t.data=JSON.stringify(t.data)),r.body=t.data),this.interceptors.request.length>0)for(let e of this.interceptors.request)r={...r,...await e({...r,url:n})};n=r.url;let i=await fetch(n,r);if(!i.ok){let e;try{e=await i.text()}catch{e=i.statusText}throw Error(e?`Request failed with status code ${i.status}: ${e}`:`Request failed with status code ${i.status}`)}if(this.interceptors.response.length>0)for(let e of this.interceptors.response)await e(i);return i}setBaseURL(e){this.baseUrl=e}setConfig(e){this.config=e}formatData(e,t){switch(t?.responseType||`json`){case`arraybuffer`:return e.arrayBuffer();case`blob`:return e.blob();case`text`:return e.text();default:return e.json()}}}})),D=d((()=>{})),O=p({APIClient:()=>T}),k=d((()=>{E(),D()})),A=f((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.Statuspage=void 0;let n=(k(),h(O)),r=b(),i=g();e.Statuspage=class{constructor(e){if(this.getComponents=()=>t(this,void 0,void 0,function*(){let e=i.Endpoint.components(),{data:t}=yield this.apiClient.get(e);return t}),this.getStatus=()=>t(this,void 0,void 0,function*(){let e=i.Endpoint.status(),{data:t}=yield this.apiClient.get(e);return t}),this.getSummary=()=>t(this,void 0,void 0,function*(){let e=i.Endpoint.summary(),{data:t}=yield this.apiClient.get(e);return t}),!e)throw Error(`A page ID needs to be set in order to use the client.`);this.apiClient=new n.APIClient(`https://${e}.statuspage.io`),this.api={getComponents:this.getComponents,getStatus:this.getStatus,getSummary:this.getSummary,incidents:new r.IncidentsAPI(this.apiClient),scheduledMaintenances:new r.ScheduledMaintenancesAPI(this.apiClient),subscribers:new r.SubscribersAPI(this.apiClient)}}setApiUrl(e){this.apiClient.setBaseURL(e)}}})),j=f((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(b(),e),n(w(),e),n(A(),e)}))();const M={none:0,minor:1,major:2,critical:2,unavailable:21},N=[`google-chrome-stable`,`google-chrome`,`chromium`,`brave`,`microsoft-edge-stable`,`microsoft-edge`];async function P(e=`https://status.claude.com`){try{let t=new j.Statuspage(`anthropic`);return t.setApiUrl(e),{kind:`ok`,summary:await t.api.getSummary()}}catch(e){return{kind:`unknown`,reason:e instanceof Error?e.message:String(e)}}}function F(){for(let e of N){let n=t(`which`,[e]);if(n.status===0&&n.stdout)return n.stdout.toString().trim()}return null}function I(e){return typeof e==`object`&&!!e&&`webSocketDebuggerUrl`in e&&typeof e.webSocketDebuggerUrl==`string`}function L(e){return typeof e==`object`&&!!e&&`id`in e&&typeof e.id==`number`}function R(e){return typeof e==`object`&&!!e&&`result`in e&&typeof e.result==`object`&&e.result!==null&&`result`in e.result&&typeof e.result.result==`object`&&e.result.result!==null&&`value`in e.result.result&&typeof e.result.result.value==`string`}function z(e){if(typeof e!=`object`||!e||!(`title`in e)||typeof e.title!=`string`||`h1`in e&&e.h1!==null&&typeof e.h1!=`string`||!(`pogo`in e))return!1;if(e.pogo===null)return!0;if(typeof e.pogo!=`object`)return!1;let t=e.pogo;return!(`outage`in t&&t.outage!==void 0&&typeof t.outage!=`boolean`)}async function B(e,t){let n=Date.now()+t;for(;Date.now()<n;){try{if((await fetch(`${e}/json/version`)).ok)return!0}catch{}await o(100)}return!1}function V(e){let t=new Map,n=0;return e.onmessage=e=>{let n=typeof e.data==`string`?e.data:e.data instanceof ArrayBuffer?new TextDecoder().decode(e.data):null;if(n===null)return;let r;try{r=JSON.parse(n)}catch{return}if(!L(r))return;let i=t.get(r.id);i&&(t.delete(r.id),i(r))},(r,i={})=>new Promise((a,o)=>{let s=++n,c=setTimeout(()=>{t.delete(s),o(Error(`CDP command '${r}' timed out`))},5e3);t.set(s,e=>{clearTimeout(c),a(e)}),e.send(JSON.stringify({id:s,method:r,params:i}))})}async function H(e,t){await e(`Runtime.enable`);let n=Date.now()+t;for(;Date.now()<n;){let t=await e(`Runtime.evaluate`,{expression:`JSON.stringify({ title: document.title, pogo: window.PogoConfig ?? null, h1: document.querySelector("h1")?.innerText ?? null })`,returnByValue:!0});if(R(t)){let e;try{e=JSON.parse(t.result.result.value)}catch{e=null}if(z(e)&&e.pogo!==null&&e.title!==`Just a moment...`)return{pogo:e.pogo,heading:e.h1}}await o(700)}return null}async function U(t){let o;try{o=n(a(i(),`claude-down-`))}catch(e){return{ok:!1,error:`mkdtemp failed: ${e instanceof Error?e.message:String(e)}`}}let s=9222+Math.floor(Math.random()*1e3),c=e(t,[`--headless=new`,`--disable-gpu`,`--no-sandbox`,`--disable-blink-features=AutomationControlled`,`--window-size=1920,1080`,`--user-data-dir=${o}`,`--remote-debugging-port=${s}`,`--user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36`,`about:blank`],{stdio:`ignore`}),l=`http://localhost:${s}`;return await B(l,5e3)?{ok:!0,proc:c,userDataDir:o,base:l}:(c.kill(),r(o,{recursive:!0,force:!0,maxRetries:5,retryDelay:100}),{ok:!1,error:`CDP endpoint never came up`})}async function W(e,t){let n=await(await fetch(`${e}/json/new?${encodeURIComponent(t)}`,{method:`PUT`})).json();if(!I(n))return{ok:!1,error:`unexpected CDP target shape`};let r=new WebSocket(n.webSocketDebuggerUrl);return await new Promise((e,t)=>{r.onopen=()=>e(),r.onerror=()=>t(Error(`WebSocket connection failed`)),r.onclose=()=>t(Error(`WebSocket closed before opening`))}),{ok:!0,send:V(r),close:()=>r.close()}}async function G(){let e=F();if(!e)return{ok:!1,error:`no chromium/chrome binary found`};let t=await U(e);if(!t.ok)return t;let{proc:n,userDataDir:i,base:a}=t;try{let e=await W(a,`https://downdetector.com/status/claude-ai/`);if(!e.ok)return e;let t=await H(e.send,2e4);return e.close(),t?t.pogo.outage===!0?{ok:!0,down:!0,reason:t.heading??`outage reported`}:{ok:!0,down:!1}:{ok:!1,error:`CF challenge not cleared in time`}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}finally{n.kill(),r(i,{recursive:!0,force:!0,maxRetries:5,retryDelay:100})}}export{M as EXIT_CODES,P as checkAnthropic,G as checkDownDetector};
@@ -0,0 +1,115 @@
1
+ import { i as EXIT_CODES } from "./constants-CY8aOEl6.mjs";
2
+
3
+ //#region node_modules/statuspage.io/dist/interfaces/Result.d.ts
4
+ declare enum IncidentImpact {
5
+ Critical = "critical",
6
+ Major = "major",
7
+ Minor = "minor",
8
+ None = "none"
9
+ }
10
+ declare enum IncidentStatus {
11
+ Identified = "identified",
12
+ Investigating = "investigating",
13
+ Monitoring = "monitoring",
14
+ Postmortem = "postmortem",
15
+ Resolved = "resolved"
16
+ }
17
+ declare enum MaintenanceStatus {
18
+ Completed = "completed",
19
+ InProgress = "in_progress",
20
+ Scheduled = "scheduled",
21
+ Verifying = "verifying"
22
+ }
23
+ interface Component {
24
+ created_at: string;
25
+ description: null | string;
26
+ group: boolean;
27
+ group_id: null | string;
28
+ id: string;
29
+ name: string;
30
+ only_show_if_degraded: boolean;
31
+ page_id: string;
32
+ position: number;
33
+ showcase: boolean;
34
+ start_date: null | string;
35
+ status: string;
36
+ updated_at: string;
37
+ }
38
+ interface Components extends Page {
39
+ components: Component[];
40
+ }
41
+ interface Incident {
42
+ created_at: string;
43
+ id: string;
44
+ impact: IncidentImpact;
45
+ incident_updates: IncidentUpdate[];
46
+ monitoring_at: null | string;
47
+ name: string;
48
+ page_id: string;
49
+ resolved_at: null | string;
50
+ shortlink: string;
51
+ status: IncidentStatus;
52
+ updated_at: string;
53
+ }
54
+ interface Incidents extends Page {
55
+ incidents: Incident[];
56
+ }
57
+ interface IncidentUpdate {
58
+ body: string;
59
+ created_at: string;
60
+ display_at: string;
61
+ id: string;
62
+ incident_id: string;
63
+ status: IncidentStatus;
64
+ updated_at: string;
65
+ }
66
+ interface Page {
67
+ page: {
68
+ id: string;
69
+ name: string;
70
+ time_zone: string;
71
+ updated_at: string;
72
+ url: string;
73
+ };
74
+ }
75
+ type ScheduledMaintenance = {
76
+ scheduled_for: string;
77
+ scheduled_until: string;
78
+ status: MaintenanceStatus;
79
+ } & Omit<Incident, 'status'>;
80
+ interface ScheduledMaintenances extends Page {
81
+ scheduled_maintenances: ScheduledMaintenance[];
82
+ }
83
+ interface Status extends Page {
84
+ status: {
85
+ description: string;
86
+ indicator: string;
87
+ };
88
+ }
89
+ type Summary = Components & Incidents & ScheduledMaintenances & Status;
90
+ //#endregion
91
+ //#region src/lib/types.d.ts
92
+ /** Indicator represents the specific status code or condition that can be used to determine the state of a service. */
93
+ type Indicator = keyof typeof EXIT_CODES;
94
+ /** A signal represents the outcome of a status check, indicating whether the service is down and providing relevant information. */
95
+ type Signal = {
96
+ ok: true;
97
+ down: true;
98
+ reason: string;
99
+ } | {
100
+ ok: true;
101
+ down: false;
102
+ } | {
103
+ ok: false;
104
+ error: string;
105
+ };
106
+ /** The result of a status check, which can either be a successful summary or an unknown state with a reason. */
107
+ type Result = {
108
+ kind: 'ok';
109
+ summary: Summary;
110
+ } | {
111
+ kind: 'unknown';
112
+ reason: string;
113
+ };
114
+ //#endregion
115
+ export { Summary as i, Result as n, Signal as r, Indicator as t };
@@ -0,0 +1,2 @@
1
+ import { i as Summary, n as Result, r as Signal, t as Indicator } from "./types-phXTAZxX.mjs";
2
+ export { Indicator, Result, Signal, Summary };
package/package.json ADDED
@@ -0,0 +1,87 @@
1
+ {
2
+ "name": "claude-down",
3
+ "version": "0.3.0",
4
+ "description": "Is claude code down? Probably...",
5
+ "homepage": "https://github.com/kjanat/claude-down#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/kjanat/claude-down/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/kjanat/claude-down.git"
12
+ },
13
+ "license": "MIT",
14
+ "author": "Kaj Kowalski <info@kajkowalski.nl> (https://github.com/kjanat)",
15
+ "type": "module",
16
+ "imports": {
17
+ "#claude-down": "./src/index.ts",
18
+ "#claude-down/*": "./src/*",
19
+ "#test/*": "./test/*"
20
+ },
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.mts",
24
+ "default": "./dist/index.mjs"
25
+ },
26
+ "./browser": {
27
+ "types": "./dist/browser/browser.d.ts",
28
+ "default": "./dist/browser/browser.js"
29
+ },
30
+ "./package.json": "./package.json"
31
+ },
32
+ "bin": {
33
+ "claude-down": "dist/bin/cli.mjs"
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "README.md",
38
+ "LICENSE",
39
+ "package.json"
40
+ ],
41
+ "scripts": {
42
+ "bd": "bun run build",
43
+ "build": "tsdown",
44
+ "check": "biome check",
45
+ "fmt": "bunx dprint fmt",
46
+ "lint": "biome lint",
47
+ "local": "bun run build -l warn && bun link",
48
+ "prepublishOnly": "bun run build -l warn",
49
+ "publishChecks": "e18e-cli analyze; attw; bunx publint --pack bun --strict",
50
+ "test": "bun test",
51
+ "typecheck": "tsc --noEmit"
52
+ },
53
+ "dependencies": {
54
+ "@kjanat/dreamcli": "^2.1.0"
55
+ },
56
+ "devDependencies": {
57
+ "@biomejs/biome": "^2.4.13",
58
+ "@types/bun": "^1.3.13",
59
+ "@types/node": "^25.6.0",
60
+ "statuspage.io": "^3.5.0",
61
+ "tsdown": "^0.21.10",
62
+ "typescript": "^6.0.3"
63
+ },
64
+ "packageManager": "bun@1.3.13",
65
+ "engines": {
66
+ "bun": ">=1.3",
67
+ "node": ">=24"
68
+ },
69
+ "devEngines": {
70
+ "packageManager": [
71
+ {
72
+ "name": "bun",
73
+ "onFail": "warn"
74
+ }
75
+ ],
76
+ "runtime": [
77
+ {
78
+ "name": "bun",
79
+ "onFail": "warn"
80
+ }
81
+ ]
82
+ },
83
+ "inlinedDependencies": {
84
+ "@ffflorian/api-client": "2.5.1",
85
+ "statuspage.io": "3.5.0"
86
+ }
87
+ }