@openape/apes 0.16.0 → 0.18.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/dist/{auth-lock-NYI376IM.js → auth-lock-GPLHRXOM.js} +2 -2
- package/dist/chunk-7NUT2PFT.js +220 -0
- package/dist/chunk-7NUT2PFT.js.map +1 -0
- package/dist/{chunk-OFIVF6NH.js → chunk-EDYICCBC.js} +2 -2
- package/dist/{chunk-6GPSKAMU.js → chunk-IDPV5SNB.js} +1 -1
- package/dist/{chunk-O7GSG3OE.js → chunk-IT6T6AKX.js} +31 -240
- package/dist/chunk-IT6T6AKX.js.map +1 -0
- package/dist/cli.js +103 -25
- package/dist/cli.js.map +1 -1
- package/dist/config-JH2IEPIR.js +30 -0
- package/dist/config-JH2IEPIR.js.map +1 -0
- package/dist/http-JZT4XV5I.js +23 -0
- package/dist/http-JZT4XV5I.js.map +1 -0
- package/dist/index.js +7 -5
- package/dist/{orchestrator-PUAO57CY.js → orchestrator-FJVDWH45.js} +8 -6
- package/dist/{orchestrator-PUAO57CY.js.map → orchestrator-FJVDWH45.js.map} +1 -1
- package/dist/{server-NZMLYPN4.js → server-RPC46G4J.js} +8 -6
- package/dist/{server-NZMLYPN4.js.map → server-RPC46G4J.js.map} +1 -1
- package/package.json +3 -3
- package/dist/chunk-O7GSG3OE.js.map +0 -1
- /package/dist/{auth-lock-NYI376IM.js.map → auth-lock-GPLHRXOM.js.map} +0 -0
- /package/dist/{chunk-OFIVF6NH.js.map → chunk-EDYICCBC.js.map} +0 -0
- /package/dist/{chunk-6GPSKAMU.js.map → chunk-IDPV5SNB.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CONFIG_DIR
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IDPV5SNB.js";
|
|
5
5
|
|
|
6
6
|
// src/auth-lock.ts
|
|
7
7
|
import { open, rm, stat } from "fs/promises";
|
|
@@ -38,4 +38,4 @@ export {
|
|
|
38
38
|
acquireAuthLock,
|
|
39
39
|
releaseAuthLock
|
|
40
40
|
};
|
|
41
|
-
//# sourceMappingURL=auth-lock-
|
|
41
|
+
//# sourceMappingURL=auth-lock-GPLHRXOM.js.map
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
getAuthToken,
|
|
4
|
+
getIdpUrl,
|
|
5
|
+
loadAuth,
|
|
6
|
+
loadConfig,
|
|
7
|
+
saveAuth
|
|
8
|
+
} from "./chunk-IDPV5SNB.js";
|
|
9
|
+
|
|
10
|
+
// src/http.ts
|
|
11
|
+
import consola from "consola";
|
|
12
|
+
var debug = process.argv.includes("--debug");
|
|
13
|
+
var ApiError = class extends Error {
|
|
14
|
+
constructor(statusCode, message, problemDetails) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.statusCode = statusCode;
|
|
17
|
+
this.problemDetails = problemDetails;
|
|
18
|
+
this.name = "ApiError";
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var _discoveryCache = {};
|
|
22
|
+
async function discoverEndpoints(idpUrl) {
|
|
23
|
+
if (_discoveryCache[idpUrl]) {
|
|
24
|
+
return _discoveryCache[idpUrl];
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
const response = await fetch(`${idpUrl}/.well-known/openid-configuration`);
|
|
28
|
+
if (response.ok) {
|
|
29
|
+
const data = await response.json();
|
|
30
|
+
_discoveryCache[idpUrl] = data;
|
|
31
|
+
return data;
|
|
32
|
+
}
|
|
33
|
+
} catch {
|
|
34
|
+
}
|
|
35
|
+
_discoveryCache[idpUrl] = {};
|
|
36
|
+
return {};
|
|
37
|
+
}
|
|
38
|
+
async function getGrantsEndpoint(idpUrl) {
|
|
39
|
+
const disco = await discoverEndpoints(idpUrl);
|
|
40
|
+
return disco.openape_grants_endpoint || `${idpUrl}/api/grants`;
|
|
41
|
+
}
|
|
42
|
+
async function getAgentChallengeEndpoint(idpUrl) {
|
|
43
|
+
const disco = await discoverEndpoints(idpUrl);
|
|
44
|
+
return disco.ddisa_agent_challenge_endpoint || `${idpUrl}/api/agent/challenge`;
|
|
45
|
+
}
|
|
46
|
+
async function getAgentAuthenticateEndpoint(idpUrl) {
|
|
47
|
+
const disco = await discoverEndpoints(idpUrl);
|
|
48
|
+
return disco.ddisa_agent_authenticate_endpoint || `${idpUrl}/api/agent/authenticate`;
|
|
49
|
+
}
|
|
50
|
+
async function getDelegationsEndpoint(idpUrl) {
|
|
51
|
+
const disco = await discoverEndpoints(idpUrl);
|
|
52
|
+
return disco.openape_delegations_endpoint || `${idpUrl}/api/delegations`;
|
|
53
|
+
}
|
|
54
|
+
async function refreshAgentToken() {
|
|
55
|
+
const auth = loadAuth();
|
|
56
|
+
if (!auth)
|
|
57
|
+
return null;
|
|
58
|
+
const config = loadConfig();
|
|
59
|
+
const keyPath = config.agent?.key;
|
|
60
|
+
if (!keyPath)
|
|
61
|
+
return null;
|
|
62
|
+
try {
|
|
63
|
+
const { readFileSync } = await import("fs");
|
|
64
|
+
const { sign } = await import("crypto");
|
|
65
|
+
const { homedir } = await import("os");
|
|
66
|
+
const { loadEd25519PrivateKey } = await import("./ssh-key-YBNNG5K5.js");
|
|
67
|
+
const resolved = keyPath.replace(/^~/, homedir());
|
|
68
|
+
const keyContent = readFileSync(resolved, "utf-8");
|
|
69
|
+
const privateKey = loadEd25519PrivateKey(keyContent);
|
|
70
|
+
const challengeUrl = await getAgentChallengeEndpoint(auth.idp);
|
|
71
|
+
const challengeResp = await fetch(challengeUrl, {
|
|
72
|
+
method: "POST",
|
|
73
|
+
headers: { "Content-Type": "application/json" },
|
|
74
|
+
body: JSON.stringify({ agent_id: auth.email })
|
|
75
|
+
});
|
|
76
|
+
if (!challengeResp.ok)
|
|
77
|
+
return null;
|
|
78
|
+
const { challenge } = await challengeResp.json();
|
|
79
|
+
const { Buffer } = await import("buffer");
|
|
80
|
+
const signature = sign(null, Buffer.from(challenge), privateKey).toString("base64");
|
|
81
|
+
const authenticateUrl = await getAgentAuthenticateEndpoint(auth.idp);
|
|
82
|
+
const authResp = await fetch(authenticateUrl, {
|
|
83
|
+
method: "POST",
|
|
84
|
+
headers: { "Content-Type": "application/json" },
|
|
85
|
+
body: JSON.stringify({ agent_id: auth.email, challenge, signature })
|
|
86
|
+
});
|
|
87
|
+
if (!authResp.ok)
|
|
88
|
+
return null;
|
|
89
|
+
const { token, expires_in } = await authResp.json();
|
|
90
|
+
saveAuth({
|
|
91
|
+
...auth,
|
|
92
|
+
access_token: token,
|
|
93
|
+
expires_at: Math.floor(Date.now() / 1e3) + (expires_in || 3600)
|
|
94
|
+
});
|
|
95
|
+
if (debug) {
|
|
96
|
+
consola.debug("Token refreshed via Ed25519 challenge-response");
|
|
97
|
+
}
|
|
98
|
+
return token;
|
|
99
|
+
} catch {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async function refreshOAuthToken() {
|
|
104
|
+
const auth = loadAuth();
|
|
105
|
+
if (!auth?.refresh_token)
|
|
106
|
+
return null;
|
|
107
|
+
const { acquireAuthLock, releaseAuthLock } = await import("./auth-lock-GPLHRXOM.js");
|
|
108
|
+
const lock = await acquireAuthLock({ timeoutMs: 5e3 });
|
|
109
|
+
if (!lock) {
|
|
110
|
+
return getAuthToken();
|
|
111
|
+
}
|
|
112
|
+
try {
|
|
113
|
+
const latest = loadAuth();
|
|
114
|
+
if (latest?.expires_at && Date.now() / 1e3 < latest.expires_at - 30)
|
|
115
|
+
return latest.access_token;
|
|
116
|
+
const activeRefreshToken = latest?.refresh_token ?? auth.refresh_token;
|
|
117
|
+
if (!activeRefreshToken)
|
|
118
|
+
return null;
|
|
119
|
+
const disco = await discoverEndpoints(auth.idp);
|
|
120
|
+
const tokenEndpoint = disco.token_endpoint || `${auth.idp}/token`;
|
|
121
|
+
const body = new URLSearchParams({
|
|
122
|
+
grant_type: "refresh_token",
|
|
123
|
+
refresh_token: activeRefreshToken
|
|
124
|
+
});
|
|
125
|
+
const resp = await fetch(tokenEndpoint, {
|
|
126
|
+
method: "POST",
|
|
127
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
128
|
+
body: body.toString()
|
|
129
|
+
});
|
|
130
|
+
if (!resp.ok) {
|
|
131
|
+
if (resp.status === 400 || resp.status === 401) {
|
|
132
|
+
const base2 = latest ?? auth;
|
|
133
|
+
saveAuth({ ...base2, refresh_token: void 0 });
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
const tokens = await resp.json();
|
|
138
|
+
const base = latest ?? auth;
|
|
139
|
+
saveAuth({
|
|
140
|
+
...base,
|
|
141
|
+
access_token: tokens.access_token,
|
|
142
|
+
refresh_token: tokens.refresh_token ?? base.refresh_token,
|
|
143
|
+
expires_at: Math.floor(Date.now() / 1e3) + (tokens.expires_in || 300)
|
|
144
|
+
});
|
|
145
|
+
if (debug)
|
|
146
|
+
consola.debug("Token refreshed via OAuth refresh_token");
|
|
147
|
+
return tokens.access_token;
|
|
148
|
+
} finally {
|
|
149
|
+
await releaseAuthLock(lock);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
async function ensureFreshToken() {
|
|
153
|
+
const cached = getAuthToken();
|
|
154
|
+
if (cached) return cached;
|
|
155
|
+
const agentToken = await refreshAgentToken();
|
|
156
|
+
if (agentToken) return agentToken;
|
|
157
|
+
const oauthToken = await refreshOAuthToken();
|
|
158
|
+
return oauthToken ?? null;
|
|
159
|
+
}
|
|
160
|
+
async function apiFetch(path, options = {}) {
|
|
161
|
+
const token = options.token ?? await ensureFreshToken();
|
|
162
|
+
if (!token) {
|
|
163
|
+
throw new Error("Not authenticated (token expired). Run `apes login` first.");
|
|
164
|
+
}
|
|
165
|
+
let url;
|
|
166
|
+
if (path.startsWith("http")) {
|
|
167
|
+
url = path;
|
|
168
|
+
} else {
|
|
169
|
+
const idp = options.idp || getIdpUrl();
|
|
170
|
+
if (!idp) {
|
|
171
|
+
throw new Error("No IdP URL configured. Run `apes login` first or pass --idp.");
|
|
172
|
+
}
|
|
173
|
+
url = `${idp}${path}`;
|
|
174
|
+
}
|
|
175
|
+
const method = options.method || "GET";
|
|
176
|
+
const headers = {
|
|
177
|
+
"Authorization": `Bearer ${token}`,
|
|
178
|
+
"Content-Type": "application/json"
|
|
179
|
+
};
|
|
180
|
+
if (debug) {
|
|
181
|
+
consola.debug(`${method} ${url}`);
|
|
182
|
+
consola.debug(`Token: ${token.substring(0, 20)}...${token.substring(token.length - 10)}`);
|
|
183
|
+
}
|
|
184
|
+
const response = await fetch(url, {
|
|
185
|
+
method,
|
|
186
|
+
headers,
|
|
187
|
+
body: options.body ? JSON.stringify(options.body) : void 0
|
|
188
|
+
});
|
|
189
|
+
if (debug) {
|
|
190
|
+
consola.debug(`Response: ${response.status} ${response.statusText}`);
|
|
191
|
+
}
|
|
192
|
+
if (!response.ok) {
|
|
193
|
+
const contentType = response.headers.get("content-type") || "";
|
|
194
|
+
if (contentType.includes("application/problem+json") || contentType.includes("application/json")) {
|
|
195
|
+
try {
|
|
196
|
+
const problem = await response.json();
|
|
197
|
+
const message = problem.detail || problem.title || problem.statusMessage || problem.message || `${response.status} ${response.statusText}`;
|
|
198
|
+
throw new ApiError(response.status, message, problem);
|
|
199
|
+
} catch (e) {
|
|
200
|
+
if (e instanceof ApiError)
|
|
201
|
+
throw e;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const text = await response.text();
|
|
205
|
+
throw new ApiError(response.status, text || `${response.status} ${response.statusText}`);
|
|
206
|
+
}
|
|
207
|
+
return response.json();
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export {
|
|
211
|
+
ApiError,
|
|
212
|
+
discoverEndpoints,
|
|
213
|
+
getGrantsEndpoint,
|
|
214
|
+
getAgentChallengeEndpoint,
|
|
215
|
+
getAgentAuthenticateEndpoint,
|
|
216
|
+
getDelegationsEndpoint,
|
|
217
|
+
ensureFreshToken,
|
|
218
|
+
apiFetch
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=chunk-7NUT2PFT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/http.ts"],"sourcesContent":["import consola from 'consola'\nimport { getAuthToken, getIdpUrl, loadAuth, loadConfig, saveAuth } from './config'\n\nconst debug = process.argv.includes('--debug')\n\nexport class ApiError extends Error {\n constructor(public statusCode: number, message: string, public problemDetails?: Record<string, unknown>) {\n super(message)\n this.name = 'ApiError'\n }\n}\n\n// OIDC Discovery cache (one-time per CLI invocation)\nconst _discoveryCache: Record<string, Record<string, unknown>> = {}\n\nexport async function discoverEndpoints(idpUrl: string): Promise<Record<string, unknown>> {\n if (_discoveryCache[idpUrl]) {\n return _discoveryCache[idpUrl]\n }\n\n try {\n const response = await fetch(`${idpUrl}/.well-known/openid-configuration`)\n if (response.ok) {\n const data = await response.json() as Record<string, unknown>\n _discoveryCache[idpUrl] = data\n return data\n }\n }\n catch {}\n\n // Return empty if discovery fails (graceful degradation)\n _discoveryCache[idpUrl] = {}\n return {}\n}\n\nexport async function getGrantsEndpoint(idpUrl: string): Promise<string> {\n const disco = await discoverEndpoints(idpUrl)\n return (disco.openape_grants_endpoint as string) || `${idpUrl}/api/grants`\n}\n\nexport async function getAgentChallengeEndpoint(idpUrl: string): Promise<string> {\n const disco = await discoverEndpoints(idpUrl)\n return (disco.ddisa_agent_challenge_endpoint as string) || `${idpUrl}/api/agent/challenge`\n}\n\nexport async function getAgentAuthenticateEndpoint(idpUrl: string): Promise<string> {\n const disco = await discoverEndpoints(idpUrl)\n return (disco.ddisa_agent_authenticate_endpoint as string) || `${idpUrl}/api/agent/authenticate`\n}\n\nexport async function getDelegationsEndpoint(idpUrl: string): Promise<string> {\n const disco = await discoverEndpoints(idpUrl)\n return (disco.openape_delegations_endpoint as string) || `${idpUrl}/api/delegations`\n}\n\n/**\n * Re-authenticate an agent using Ed25519 challenge-response.\n * Called automatically when the token is expired.\n */\nasync function refreshAgentToken(): Promise<string | null> {\n const auth = loadAuth()\n if (!auth)\n return null\n\n const config = loadConfig()\n const keyPath = config.agent?.key\n if (!keyPath)\n return null\n\n try {\n const { readFileSync } = await import('node:fs')\n const { sign } = await import('node:crypto')\n const { homedir } = await import('node:os')\n const { loadEd25519PrivateKey } = await import('./ssh-key.js')\n\n const resolved = keyPath.replace(/^~/, homedir())\n const keyContent = readFileSync(resolved, 'utf-8')\n const privateKey = loadEd25519PrivateKey(keyContent)\n\n const challengeUrl = await getAgentChallengeEndpoint(auth.idp)\n const challengeResp = await fetch(challengeUrl, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ agent_id: auth.email }),\n })\n\n if (!challengeResp.ok)\n return null\n\n const { challenge } = await challengeResp.json() as { challenge: string }\n const { Buffer } = await import('node:buffer')\n const signature = sign(null, Buffer.from(challenge), privateKey).toString('base64')\n\n const authenticateUrl = await getAgentAuthenticateEndpoint(auth.idp)\n const authResp = await fetch(authenticateUrl, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ agent_id: auth.email, challenge, signature }),\n })\n\n if (!authResp.ok)\n return null\n\n const { token, expires_in } = await authResp.json() as { token: string, expires_in: number }\n\n saveAuth({\n ...auth,\n access_token: token,\n expires_at: Math.floor(Date.now() / 1000) + (expires_in || 3600),\n })\n\n if (debug) {\n consola.debug('Token refreshed via Ed25519 challenge-response')\n }\n\n return token\n }\n catch {\n return null\n }\n}\n\n/**\n * Refresh an OAuth2 access token using a stored refresh_token. Used for\n * PKCE/browser login sessions where no Ed25519 agent key is configured.\n *\n * Serialized via a file lock so concurrent apes/ape-shell invocations don't\n * both consume the same rotating refresh token (which would revoke the\n * entire family server-side).\n */\nasync function refreshOAuthToken(): Promise<string | null> {\n const auth = loadAuth()\n if (!auth?.refresh_token)\n return null\n\n const { acquireAuthLock, releaseAuthLock } = await import('./auth-lock.js')\n const lock = await acquireAuthLock({ timeoutMs: 5000 })\n if (!lock) {\n // Another process is refreshing. It should have updated auth.json by now;\n // re-read and return whatever fresh token is there (may still be null).\n return getAuthToken()\n }\n\n try {\n // Re-read auth.json inside the lock — another holder may already have\n // refreshed while we were waiting, in which case we reuse the new token.\n const latest = loadAuth()\n if (latest?.expires_at && Date.now() / 1000 < latest.expires_at - 30)\n return latest.access_token\n\n const activeRefreshToken = latest?.refresh_token ?? auth.refresh_token\n if (!activeRefreshToken)\n return null\n\n const disco = await discoverEndpoints(auth.idp)\n const tokenEndpoint = (disco.token_endpoint as string) || `${auth.idp}/token`\n\n const body = new URLSearchParams({\n grant_type: 'refresh_token',\n refresh_token: activeRefreshToken,\n })\n\n const resp = await fetch(tokenEndpoint, {\n method: 'POST',\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n body: body.toString(),\n })\n\n if (!resp.ok) {\n // Family may have been revoked server-side — clear refresh_token to\n // prevent an infinite retry loop on every subsequent apes invocation.\n if (resp.status === 400 || resp.status === 401) {\n const base = latest ?? auth\n saveAuth({ ...base, refresh_token: undefined })\n }\n return null\n }\n\n const tokens = await resp.json() as {\n access_token: string\n refresh_token?: string\n expires_in?: number\n }\n\n const base = latest ?? auth\n saveAuth({\n ...base,\n access_token: tokens.access_token,\n refresh_token: tokens.refresh_token ?? base.refresh_token,\n expires_at: Math.floor(Date.now() / 1000) + (tokens.expires_in || 300),\n })\n\n if (debug)\n consola.debug('Token refreshed via OAuth refresh_token')\n\n return tokens.access_token\n }\n finally {\n await releaseAuthLock(lock)\n }\n}\n\n/**\n * Refresh the local IdP token if it has expired. Used by every code path\n * that needs an access token — `apiFetch` for IdP-bound HTTP calls, plus\n * any pure-introspection command (`apes whoami`, `apes config get …`)\n * that previously only read local auth state and surfaced a stale\n * \"expired\" without attempting renewal.\n *\n * Returns the fresh access token on success, or null when no refresh\n * path is available (no agent key AND no refresh_token, or both refresh\n * attempts failed). Callers decide what to do with null — `apiFetch`\n * throws \"Not authenticated\", `whoami` falls back to the on-disk state.\n */\nexport async function ensureFreshToken(): Promise<string | null> {\n const cached = getAuthToken()\n if (cached) return cached\n\n // Auto-refresh: priority (1) ed25519 agent key, (2) OAuth refresh_token.\n // Agent-key first because it is concurrency-safe — every challenge is\n // independent server-side, so parallel ape-shell spawns don't race.\n const agentToken = await refreshAgentToken()\n if (agentToken) return agentToken\n const oauthToken = await refreshOAuthToken()\n return oauthToken ?? null\n}\n\nexport async function apiFetch<T = unknown>(\n path: string,\n options: {\n method?: string\n body?: unknown\n idp?: string\n token?: string\n } = {},\n): Promise<T> {\n const token = options.token ?? await ensureFreshToken()\n\n if (!token) {\n throw new Error('Not authenticated (token expired). Run `apes login` first.')\n }\n\n let url: string\n if (path.startsWith('http')) {\n url = path\n }\n else {\n const idp = options.idp || getIdpUrl()\n if (!idp) {\n throw new Error('No IdP URL configured. Run `apes login` first or pass --idp.')\n }\n url = `${idp}${path}`\n }\n const method = options.method || 'GET'\n const headers: Record<string, string> = {\n 'Authorization': `Bearer ${token}`,\n 'Content-Type': 'application/json',\n }\n\n if (debug) {\n consola.debug(`${method} ${url}`)\n consola.debug(`Token: ${token.substring(0, 20)}...${token.substring(token.length - 10)}`)\n }\n\n const response = await fetch(url, {\n method,\n headers,\n body: options.body ? JSON.stringify(options.body) : undefined,\n })\n\n if (debug) {\n consola.debug(`Response: ${response.status} ${response.statusText}`)\n }\n\n if (!response.ok) {\n const contentType = response.headers.get('content-type') || ''\n\n // Parse RFC 7807 Problem Details\n if (contentType.includes('application/problem+json') || contentType.includes('application/json')) {\n try {\n const problem = await response.json() as Record<string, unknown>\n const message = (problem.detail as string) || (problem.title as string) || (problem.statusMessage as string) || (problem.message as string) || `${response.status} ${response.statusText}`\n throw new ApiError(response.status, message, problem)\n }\n catch (e) {\n if (e instanceof ApiError)\n throw e\n }\n }\n\n const text = await response.text()\n throw new ApiError(response.status, text || `${response.status} ${response.statusText}`)\n }\n\n return response.json() as Promise<T>\n}\n"],"mappings":";;;;;;;;;;AAAA,OAAO,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AAU,EAAE;AAAA,EACrE;AAEA,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,cAAc,SAAS,QAAQ,IAAI,cAAc,KAAK;AAG5D,QAAI,YAAY,SAAS,0BAA0B,KAAK,YAAY,SAAS,kBAAkB,GAAG;AAChG,UAAI;AACF,cAAM,UAAU,MAAM,SAAS,KAAK;AACpC,cAAM,UAAW,QAAQ,UAAsB,QAAQ,SAAqB,QAAQ,iBAA6B,QAAQ,WAAsB,GAAG,SAAS,MAAM,IAAI,SAAS,UAAU;AACxL,cAAM,IAAI,SAAS,SAAS,QAAQ,SAAS,OAAO;AAAA,MACtD,SACO,GAAG;AACR,YAAI,aAAa;AACf,gBAAM;AAAA,MACV;AAAA,IACF;AAEA,UAAM,OAAO,MAAM,SAAS,KAAK;AACjC,UAAM,IAAI,SAAS,SAAS,QAAQ,QAAQ,GAAG,SAAS,MAAM,IAAI,SAAS,UAAU,EAAE;AAAA,EACzF;AAEA,SAAO,SAAS,KAAK;AACvB;","names":["base"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
loadConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IDPV5SNB.js";
|
|
5
5
|
|
|
6
6
|
// src/notifications.ts
|
|
7
7
|
import { spawn } from "child_process";
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
isApesSelfDispatch,
|
|
78
78
|
checkSudoRejection
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-EDYICCBC.js.map
|