@anvil-works/anvil-cli 0.8.0-canary.12 → 0.8.0-canary.14

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/api.d.ts CHANGED
@@ -7,13 +7,17 @@ export type { WatchDiagnosticEventName, WatchDiagnosticEventPayload, WatchSessio
7
7
  export { branchFromEnvironmentVersion, readEnvironmentPid, requireEnvironmentBranch, writeEnvironmentPid, } from "./environment";
8
8
  export type { AnvilEnvironmentBinding, AnvilEnvironmentVersion, EnvBranchChangeMode } from "./environment";
9
9
  export { AppIdCandidate, AppIdWithContext, CheckoutAppListItem, detectAppIdsByCommitLookup, detectAppIdsFromAllRemotes, filterCandidates, formatCandidateLabel, getGitFetchUrl, getGitPushUrl, getLatestVersion, getWebSocketUrl, listAppsForCheckout, lookupRemoteInfoForAppId, lookupByCommit, saveUpdates, ValidateAppIdResponse, validateAppId, } from "./services/anvil-api";
10
- export { ANVIL_SYNC_CLIENT_ID, getAccountsForUrl, getAvailableAnvilUrls, getValidAuthToken, hasTokensForUrl, verifyAndStoreTokens, LoginResult, LogoutResult, logout, TokenData, clearInMemoryTokens, setInMemoryTokens, verifyAuth, } from "./services/auth";
10
+ export { ANVIL_SYNC_CLIENT_ID, getAccountsForUrl, getAvailableAnvilUrls, getValidAuthToken, GetValidAuthTokenOptions, hasTokensForUrl, REFRESH_REQUEST_TIMEOUT_MS, verifyAndStoreTokens, LoginResult, LogoutResult, logout, TokenData, clearInMemoryTokens, setInMemoryTokens, verifyAuth, } from "./services/auth";
11
11
  export { DeviceAuthorizationResponse, OAuthTokenResponse, pollDeviceAuthorization, requestDeviceAuthorization, } from "./services/oauth-login";
12
12
  export { CheckoutCloneOptions, CheckoutExecutionDeps, CheckoutOptions, CheckoutResult, executeCheckout, getDefaultDestinationDirectory, isDirectoryNonEmpty, isPathInsideGitRepo, parseCheckoutInput, ParsedCheckoutInput, sanitizeDirectoryName, validateCheckoutDestination, } from "./commands/checkout";
13
13
  export { createCheckoutPickerSource, type CheckoutPickerDeps, type CheckoutPickerSourceController, type CheckoutPickerSourceOptions, } from "./commands/checkout-picker";
14
14
  export { buildGitAuthDoctorReport, formatGitAuthDoctorReport, inspectCredentialHelperCommand, parseCredentialHelperCommand, } from "./commands/gitAuth";
15
15
  export type { CredentialFillResult, GitAuthDoctorAppReport, GitAuthDoctorFinding, GitAuthDoctorRemote, GitAuthDoctorReport, GitAuthDoctorStatus, GitCredentialHelperDetails, GitCredentialSimulation, InspectCredentialHelperOptions, } from "./commands/gitAuth";
16
16
  export { executeGitCredentialOperation } from "./commands/gitCredential";
17
+ export { executeModelTokenOperation, getModelToken, MODEL_TOKEN_LOCK_TIMEOUT_MS } from "./commands/modelToken";
18
+ export type { ModelTokenDeps, ModelTokenOptions } from "./commands/modelToken";
19
+ export { AUTH_FILE_LOCK_DEFAULTS, getModelTokenHelperScript, installModelTokenHelperScript, MODEL_TOKEN_HELPER_FILENAME, withRepoAuthFileLock, } from "./services/git-auth";
20
+ export type { AuthFileLockOptions } from "./services/git-auth";
17
21
  export { deleteConfig, getAllConfig, getConfig, getInstalledPreferredEditors, getPreferredEditorCommand, getSettableConfigKeys, isCommandAvailable, normalizeAnvilUrl, parseConfigSetValue, preferredEditors, PreferredEditor, resetConfig, resolveAnvilUrl, setAuthTokensForAccount, setConfig, SettableConfigKey, } from "./config";
18
22
  export { BranchSyncStatus, ValidateBranchSyncStatusOptions, validateAnvilApp, validateBranchSyncStatus, } from "./services/validation";
19
23
  export { AnvilYamlValidationResult, FormTemplateValidationResult, ValidatePathResult, ValidationTarget, ValidationIssue, formatValidationPath, validatePath, validateAnvilYaml, validateFormTemplate, } from "./validators";
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAkB,QAAQ,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AO,CAAC,MAAM,CAAC,CA2BjH;AAMD;;;GAGG;AACH,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CA8J9G"}
package/dist/cli.js CHANGED
@@ -13384,9 +13384,10 @@ var __webpack_exports__ = {};
13384
13384
  type: "auth_invalid",
13385
13385
  message
13386
13386
  }),
13387
- refreshFailed: (message)=>({
13387
+ refreshFailed: (message, status)=>({
13388
13388
  type: "token_refresh_failed",
13389
- message
13389
+ message,
13390
+ status
13390
13391
  })
13391
13392
  };
13392
13393
  const createAppError = {
@@ -13600,6 +13601,19 @@ var __webpack_exports__ = {};
13600
13601
  return "An unknown error occurred";
13601
13602
  }
13602
13603
  }
13604
+ function getErrorCauseMessage(error) {
13605
+ if ("object" != typeof error || null === error || !("cause" in error)) return null;
13606
+ const cause = error.cause;
13607
+ if (null == cause) return null;
13608
+ const message = errors_getErrorMessage(cause);
13609
+ const code = "object" == typeof cause && null !== cause && "code" in cause && "string" == typeof cause.code ? cause.code : null;
13610
+ if (code && !message.includes(code)) return `${message} (${code})`;
13611
+ return message;
13612
+ }
13613
+ function logErrorCause(error, ui) {
13614
+ const causeMessage = getErrorCauseMessage(error);
13615
+ if (causeMessage) ui.verbose(`Cause: ${causeMessage}`);
13616
+ }
13603
13617
  const external_module_namespaceObject = require("module");
13604
13618
  const requireFromHere = (0, external_module_namespaceObject.createRequire)(__filename);
13605
13619
  const GIT_CREDENTIAL_HELPER_FILENAME = "anvil-credential-helper.cjs";
@@ -13820,6 +13834,76 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
13820
13834
  function getAuthFilePath(gitDir) {
13821
13835
  return external_path_default().join(gitDir, "anvil-auth.json");
13822
13836
  }
13837
+ const AUTH_FILE_LOCK_DEFAULTS = {
13838
+ staleMs: 30000,
13839
+ timeoutMs: 60000,
13840
+ retryDelayMs: 100,
13841
+ heartbeatMs: 5000
13842
+ };
13843
+ function git_auth_delay(ms) {
13844
+ return new Promise((resolve)=>setTimeout(resolve, ms));
13845
+ }
13846
+ async function acquireAuthFileLock(lockPath, options) {
13847
+ const deadline = Date.now() + options.timeoutMs;
13848
+ while(true){
13849
+ try {
13850
+ const handle = await external_fs_.promises.open(lockPath, "wx", 384);
13851
+ try {
13852
+ await handle.writeFile(JSON.stringify({
13853
+ pid: process.pid,
13854
+ acquiredAt: new Date().toISOString()
13855
+ }));
13856
+ } finally{
13857
+ await handle.close();
13858
+ }
13859
+ return;
13860
+ } catch (e) {
13861
+ if ("EEXIST" !== e.code) throw e;
13862
+ }
13863
+ try {
13864
+ const lockStat = await external_fs_.promises.stat(lockPath);
13865
+ if (Date.now() - lockStat.mtimeMs > options.staleMs) {
13866
+ await external_fs_.promises.rm(lockPath, {
13867
+ force: true
13868
+ });
13869
+ continue;
13870
+ }
13871
+ } catch {
13872
+ continue;
13873
+ }
13874
+ if (Date.now() >= deadline) throw new Error(`Timed out waiting for the Anvil auth file lock at ${lockPath}`);
13875
+ await git_auth_delay(options.retryDelayMs);
13876
+ }
13877
+ }
13878
+ async function withRepoAuthFileLock(repoPath, fn, options) {
13879
+ const gitDir = await getRepositoryGitDir(repoPath);
13880
+ const lockPath = `${getAuthFilePath(gitDir)}.lock`;
13881
+ const lockOptions = {
13882
+ ...AUTH_FILE_LOCK_DEFAULTS,
13883
+ ...options
13884
+ };
13885
+ await external_fs_.promises.mkdir(external_path_default().dirname(lockPath), {
13886
+ recursive: true
13887
+ });
13888
+ await acquireAuthFileLock(lockPath, lockOptions);
13889
+ const heartbeat = startAuthFileLockHeartbeat(lockPath, lockOptions.heartbeatMs);
13890
+ try {
13891
+ return await fn();
13892
+ } finally{
13893
+ clearInterval(heartbeat);
13894
+ await external_fs_.promises.rm(lockPath, {
13895
+ force: true
13896
+ });
13897
+ }
13898
+ }
13899
+ function startAuthFileLockHeartbeat(lockPath, heartbeatMs) {
13900
+ const heartbeat = setInterval(()=>{
13901
+ const now = new Date();
13902
+ external_fs_.promises.utimes(lockPath, now, now).catch(()=>{});
13903
+ }, heartbeatMs);
13904
+ heartbeat.unref();
13905
+ return heartbeat;
13906
+ }
13823
13907
  function decodeKey(b64key) {
13824
13908
  const key = Buffer.from(b64key, "base64");
13825
13909
  if (32 !== key.length) throw new Error("Encryption key must be a base64-encoded 32-byte key");
@@ -13864,10 +13948,19 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
13864
13948
  recursive: true
13865
13949
  });
13866
13950
  const authJson = JSON.stringify(auth, null, 2);
13867
- await external_fs_.promises.writeFile(authFilePath, encrypt(authJson, encryptionKey), {
13868
- mode: 384
13869
- });
13870
- await external_fs_.promises.chmod(authFilePath, 448);
13951
+ const tempFilePath = `${authFilePath}.tmp-${external_node_crypto_default().randomBytes(6).toString("hex")}`;
13952
+ try {
13953
+ await external_fs_.promises.writeFile(tempFilePath, encrypt(authJson, encryptionKey), {
13954
+ mode: 384
13955
+ });
13956
+ await external_fs_.promises.chmod(tempFilePath, 448);
13957
+ await external_fs_.promises.rename(tempFilePath, authFilePath);
13958
+ } catch (e) {
13959
+ await external_fs_.promises.rm(tempFilePath, {
13960
+ force: true
13961
+ });
13962
+ throw e;
13963
+ }
13871
13964
  await git.raw([
13872
13965
  "config",
13873
13966
  "--local",
@@ -13876,7 +13969,7 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
13876
13969
  ]);
13877
13970
  return authFilePath;
13878
13971
  }
13879
- const readAuthFromRepo = async (repoPath)=>{
13972
+ const git_auth_readAuthFromRepo = async (repoPath)=>{
13880
13973
  const git = esm_default(repoPath);
13881
13974
  const gitDir = await getRepositoryGitDir(repoPath, git);
13882
13975
  const authFilePath = getAuthFilePath(gitDir);
@@ -13889,12 +13982,13 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
13889
13982
  return resolveAnvilUrl();
13890
13983
  }
13891
13984
  const ANVIL_SYNC_CLIENT_ID = "anvil-sync";
13985
+ const REFRESH_REQUEST_TIMEOUT_MS = 12000;
13892
13986
  let inMemoryAuth = null;
13893
13987
  function authMatches(auth, anvilUrl, username) {
13894
13988
  return auth.anvilUrl === normalizeAnvilUrl(anvilUrl) && (!username || auth.username === username);
13895
13989
  }
13896
13990
  let repoContext = null;
13897
- function setRepoContext(repoPath) {
13991
+ function auth_setRepoContext(repoPath) {
13898
13992
  repoContext = repoPath;
13899
13993
  }
13900
13994
  const inFlightRefreshes = new Map();
@@ -13917,7 +14011,7 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
13917
14011
  throw errors_createAuthError.invalid(`Network error: ${e.message}`);
13918
14012
  }
13919
14013
  }
13920
- async function refreshAccessToken(refreshToken, anvilUrl = getDefaultAnvilUrl(), clientId = ANVIL_SYNC_CLIENT_ID) {
14014
+ async function refreshAccessToken(refreshToken, anvilUrl = getDefaultAnvilUrl(), clientId = ANVIL_SYNC_CLIENT_ID, options) {
13921
14015
  try {
13922
14016
  const tokenResponse = await fetch(`${anvilUrl}/oauth/token`, {
13923
14017
  method: "POST",
@@ -13928,11 +14022,12 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
13928
14022
  grant_type: "refresh_token",
13929
14023
  refresh_token: refreshToken,
13930
14024
  client_id: clientId
13931
- })
14025
+ }),
14026
+ signal: AbortSignal.timeout(options?.timeoutMs ?? REFRESH_REQUEST_TIMEOUT_MS)
13932
14027
  });
13933
14028
  if (!tokenResponse.ok) {
13934
14029
  const errorText = await tokenResponse.text();
13935
- throw errors_createAuthError.refreshFailed(`Failed to refresh token: ${tokenResponse.status} ${errorText}`);
14030
+ throw errors_createAuthError.refreshFailed(`Failed to refresh token: ${tokenResponse.status} ${errorText}`, tokenResponse.status);
13936
14031
  }
13937
14032
  const tokenData = await tokenResponse.json();
13938
14033
  return tokenData;
@@ -13944,22 +14039,21 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
13944
14039
  async function hasTokensForUrl(anvilUrl, username) {
13945
14040
  if (inMemoryAuth) return authMatches(inMemoryAuth, anvilUrl, username);
13946
14041
  {
13947
- const repoAuth = repoContext ? await readAuthFromRepo(repoContext) : void 0;
14042
+ const repoAuth = repoContext ? await git_auth_readAuthFromRepo(repoContext) : void 0;
13948
14043
  if (repoAuth && authMatches(repoAuth, anvilUrl, username)) return true;
13949
14044
  return hasTokens(anvilUrl, username);
13950
14045
  }
13951
14046
  }
13952
- async function auth_getValidAuthToken(anvilUrl = getDefaultAnvilUrl(), username) {
14047
+ async function auth_getValidAuthToken(anvilUrl = getDefaultAnvilUrl(), username, options) {
13953
14048
  const normalized = normalizeAnvilUrl(anvilUrl);
13954
14049
  const source = await resolveTokenSource(normalized, username);
13955
14050
  const tokens = getSourceTokens(source);
13956
14051
  if (!tokens.authToken && !tokens.refreshToken) throw errors_createAuthError.required("Not logged in. Please log in first.");
13957
- const isExpired = null !== tokens.authTokenExpiresAt && tokens.authTokenExpiresAt <= Math.floor(Date.now() / 1000) + 60;
13958
- if (tokens.refreshToken && isExpired) {
14052
+ if (tokens.refreshToken && isAccessTokenExpired(tokens)) {
13959
14053
  const refreshKey = getRefreshKey(normalized, username, source, tokens.refreshToken);
13960
14054
  const existingRefresh = inFlightRefreshes.get(refreshKey);
13961
14055
  if (existingRefresh) return existingRefresh;
13962
- const refreshPromise = refreshAndStoreAccessToken(normalized, username, source, tokens.refreshToken).finally(()=>{
14056
+ const refreshPromise = refreshAndStoreAccessToken(normalized, username, source, tokens.refreshToken, options).finally(()=>{
13963
14057
  inFlightRefreshes.delete(refreshKey);
13964
14058
  });
13965
14059
  inFlightRefreshes.set(refreshKey, refreshPromise);
@@ -13973,7 +14067,7 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
13973
14067
  type: "memory",
13974
14068
  auth: inMemoryAuth
13975
14069
  };
13976
- const repoAuth = repoContext ? await readAuthFromRepo(repoContext) : void 0;
14070
+ const repoAuth = repoContext ? await git_auth_readAuthFromRepo(repoContext) : void 0;
13977
14071
  if (repoAuth && authMatches(repoAuth, normalizedUrl, username)) return {
13978
14072
  type: "repo",
13979
14073
  auth: repoAuth,
@@ -13989,6 +14083,9 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
13989
14083
  function getSourceTokens(source) {
13990
14084
  return "store" === source.type ? source.tokens : source.auth.tokens;
13991
14085
  }
14086
+ function isAccessTokenExpired(tokens) {
14087
+ return null !== tokens.authTokenExpiresAt && tokens.authTokenExpiresAt <= Math.floor(Date.now() / 1000) + 60;
14088
+ }
13992
14089
  function getStoreAccountUsername(normalizedUrl, username, refreshToken) {
13993
14090
  if (username) return username;
13994
14091
  const urlTokens = getUrlTokens(normalizedUrl);
@@ -14007,11 +14104,43 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
14007
14104
  return `store:${normalizedUrl}:${source.accountUsername ?? username ?? refreshToken}`;
14008
14105
  }
14009
14106
  }
14010
- async function refreshAndStoreAccessToken(normalizedUrl, username, source, refreshToken) {
14107
+ async function refreshAndStoreAccessToken(normalizedUrl, username, source, refreshToken, options) {
14108
+ if ("repo" === source.type) return refreshRepoAuthTokens(source.repoPath, {
14109
+ anvilUrl: normalizedUrl,
14110
+ username,
14111
+ auth: source.auth,
14112
+ refreshToken,
14113
+ lock: options?.lock,
14114
+ requestTimeoutMs: options?.requestTimeoutMs
14115
+ });
14116
+ return performTokenRefresh(normalizedUrl, username, source, refreshToken, options?.requestTimeoutMs);
14117
+ }
14118
+ async function refreshRepoAuthTokens(repoPath, options) {
14119
+ const normalizedUrl = normalizeAnvilUrl(options.anvilUrl);
14120
+ return withRepoAuthFileLock(repoPath, async ()=>{
14121
+ let auth = options.auth;
14122
+ let refreshToken = options.refreshToken;
14123
+ const current = await git_auth_readAuthFromRepo(repoPath);
14124
+ if (current && authMatches(current, normalizedUrl, options.username)) {
14125
+ if (current.tokens.authToken && !isAccessTokenExpired(current.tokens)) return current.tokens.authToken;
14126
+ auth = current;
14127
+ refreshToken = current.tokens.refreshToken ?? refreshToken;
14128
+ }
14129
+ if (!auth || !refreshToken) throw errors_createAuthError.required("No repo auth tokens available to refresh.");
14130
+ return performTokenRefresh(normalizedUrl, options.username, {
14131
+ type: "repo",
14132
+ auth,
14133
+ repoPath
14134
+ }, refreshToken, options.requestTimeoutMs);
14135
+ }, options.lock);
14136
+ }
14137
+ async function performTokenRefresh(normalizedUrl, username, source, refreshToken, requestTimeoutMs) {
14011
14138
  try {
14012
14139
  const tokens = getSourceTokens(source);
14013
14140
  const clientId = tokens.clientId ?? ANVIL_SYNC_CLIENT_ID;
14014
- const tokenData = await refreshAccessToken(refreshToken, normalizedUrl, clientId);
14141
+ const tokenData = await refreshAccessToken(refreshToken, normalizedUrl, clientId, {
14142
+ timeoutMs: requestTimeoutMs
14143
+ });
14015
14144
  const newTokens = {
14016
14145
  authToken: tokenData.access_token,
14017
14146
  refreshToken: tokenData.refresh_token,
@@ -14033,12 +14162,28 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
14033
14162
  }
14034
14163
  return tokenData.access_token;
14035
14164
  } catch (e) {
14165
+ if ("repo" === source.type && isRefreshTokenRejection(e)) await clearRepoAuthTokens(source.repoPath, source.auth).catch(()=>{});
14036
14166
  await clearTokensForAccount(normalizedUrl, username, refreshToken);
14037
14167
  throw e;
14038
14168
  }
14039
14169
  }
14170
+ function isRefreshTokenRejection(e) {
14171
+ const error = e;
14172
+ return error?.type === "token_refresh_failed" && (400 === error.status || 401 === error.status);
14173
+ }
14174
+ async function clearRepoAuthTokens(repoPath, auth) {
14175
+ const encryptionKey = process.env["ANVIL_AUTH_FILE_ENCRYPTION_KEY"];
14176
+ if (!encryptionKey) return;
14177
+ auth.tokens = {
14178
+ authToken: null,
14179
+ refreshToken: null,
14180
+ authTokenExpiresAt: null,
14181
+ clientId: auth.tokens.clientId
14182
+ };
14183
+ await writeAuthToFile(repoPath, auth, encryptionKey);
14184
+ }
14040
14185
  async function clearTokensForAccount(url, username, refreshToken) {
14041
- if (inMemoryAuth || repoContext && await readAuthFromRepo(repoContext)) return;
14186
+ if (inMemoryAuth || repoContext && await git_auth_readAuthFromRepo(repoContext)) return;
14042
14187
  {
14043
14188
  const normalized = normalizeAnvilUrl(url);
14044
14189
  if (username) deleteAccountTokens(normalized, username);
@@ -14068,7 +14213,7 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
14068
14213
  loggedOut: false,
14069
14214
  message: "Cannot log out when using in-memory auth tokens"
14070
14215
  };
14071
- if (repoContext && await readAuthFromRepo(repoContext)) return {
14216
+ if (repoContext && await git_auth_readAuthFromRepo(repoContext)) return {
14072
14217
  loggedOut: false,
14073
14218
  message: "Cannot log out when using auth tokens stored in the local git config."
14074
14219
  };
@@ -14099,7 +14244,7 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
14099
14244
  inMemoryAuth.username
14100
14245
  ] : [];
14101
14246
  {
14102
- const repoAuth = repoContext ? await readAuthFromRepo(repoContext) : void 0;
14247
+ const repoAuth = repoContext ? await git_auth_readAuthFromRepo(repoContext) : void 0;
14103
14248
  if (repoAuth && authMatches(repoAuth, url)) return [
14104
14249
  repoAuth.username
14105
14250
  ];
@@ -14111,7 +14256,7 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
14111
14256
  inMemoryAuth.anvilUrl
14112
14257
  ];
14113
14258
  {
14114
- const repoAuth = repoContext ? await readAuthFromRepo(repoContext) : void 0;
14259
+ const repoAuth = repoContext ? await git_auth_readAuthFromRepo(repoContext) : void 0;
14115
14260
  if (repoAuth) return [
14116
14261
  repoAuth.anvilUrl
14117
14262
  ];
@@ -16440,6 +16585,45 @@ Promise.resolve(executeGitCredentialOperation(process.argv[2] || "get", {
16440
16585
  };
16441
16586
  }
16442
16587
  const validatePython_requireFromHere = (0, external_module_namespaceObject.createRequire)(__filename);
16588
+ const DEFAULT_PYRIGHT_MAX_OLD_SPACE_MB = 768;
16589
+ const DEFAULT_PYRIGHT_TIMEOUT_MS = 300000;
16590
+ function parsePositiveIntegerEnv(env, name, defaultValue) {
16591
+ const rawValue = env[name];
16592
+ if (void 0 === rawValue || "" === rawValue) return {
16593
+ value: defaultValue
16594
+ };
16595
+ if (!/^\d+$/.test(rawValue) || Number(rawValue) <= 0 || !Number.isSafeInteger(Number(rawValue))) return {
16596
+ error: `${name} must be a positive integer`
16597
+ };
16598
+ return {
16599
+ value: Number(rawValue)
16600
+ };
16601
+ }
16602
+ function pyrightChildNodeOptions(nodeOptions, maxOldSpaceMb) {
16603
+ const maxOldSpaceFlag = "--max[-_]old[-_]space[-_]size";
16604
+ const withoutEqualsForm = (nodeOptions ?? "").replace(new RegExp(`(^|\\s)${maxOldSpaceFlag}=\\S+`, "g"), "$1");
16605
+ const withoutSeparateForm = withoutEqualsForm.replace(new RegExp(`(^|\\s)${maxOldSpaceFlag}\\s+\\S+`, "g"), "$1");
16606
+ return [
16607
+ withoutSeparateForm.trim(),
16608
+ `--max-old-space-size=${maxOldSpaceMb}`
16609
+ ].filter(Boolean).join(" ");
16610
+ }
16611
+ function semanticProcessFailure(message) {
16612
+ return {
16613
+ ok: false,
16614
+ message: "Python semantic validation could not be run",
16615
+ issues: [
16616
+ {
16617
+ path: "root",
16618
+ message,
16619
+ severity: "error"
16620
+ }
16621
+ ]
16622
+ };
16623
+ }
16624
+ function isV8HeapOutOfMemory(stderr) {
16625
+ return /(?:JavaScript heap out of memory|Reached heap limit|Ineffective mark-compacts near heap limit)/i.test(stderr);
16626
+ }
16443
16627
  function resolveBundledAnvilPyright() {
16444
16628
  try {
16445
16629
  return {
@@ -16707,8 +16891,13 @@ print(json.dumps({"issues": issues}))
16707
16891
  };
16708
16892
  }
16709
16893
  function validatePythonWithPyright(appRoot, options = {}) {
16894
+ const env = options.env ?? process.env;
16895
+ const maxOldSpace = parsePositiveIntegerEnv(env, "ANVIL_PYRIGHT_MAX_OLD_SPACE_MB", DEFAULT_PYRIGHT_MAX_OLD_SPACE_MB);
16896
+ if ("error" in maxOldSpace) return semanticProcessFailure(maxOldSpace.error);
16897
+ const timeout = parsePositiveIntegerEnv(env, "ANVIL_PYRIGHT_TIMEOUT_MS", DEFAULT_PYRIGHT_TIMEOUT_MS);
16898
+ if ("error" in timeout) return semanticProcessFailure(timeout.error);
16710
16899
  const pyright = void 0 === options.pyright ? findAnvilPyright({
16711
- env: options.env
16900
+ env
16712
16901
  }) : options.pyright;
16713
16902
  if (!pyright) return {
16714
16903
  ok: false,
@@ -16731,30 +16920,19 @@ print(json.dumps({"issues": issues}))
16731
16920
  ...options.files ?? []
16732
16921
  ], {
16733
16922
  encoding: "utf8",
16734
- maxBuffer: 10485760
16923
+ env: {
16924
+ ...env,
16925
+ NODE_OPTIONS: pyrightChildNodeOptions(env.NODE_OPTIONS, maxOldSpace.value)
16926
+ },
16927
+ maxBuffer: 10485760,
16928
+ timeout: timeout.value
16735
16929
  });
16736
- if (result.error) return {
16737
- ok: false,
16738
- message: "Python semantic validation could not be run",
16739
- issues: [
16740
- {
16741
- path: "root",
16742
- message: result.error.message,
16743
- severity: "error"
16744
- }
16745
- ]
16746
- };
16747
- if (0 !== result.status && 1 !== result.status) return {
16748
- ok: false,
16749
- message: "Python semantic validation could not be run",
16750
- issues: [
16751
- {
16752
- path: "root",
16753
- message: result.stderr.trim() || `anvil-pyright exited with status ${result.status}`,
16754
- severity: "error"
16755
- }
16756
- ]
16757
- };
16930
+ if (result.error) {
16931
+ if ("ETIMEDOUT" === result.error.code) return semanticProcessFailure(`anvil-pyright exceeded the ${timeout.value} ms timeout. Increase ANVIL_PYRIGHT_TIMEOUT_MS or validate a smaller target.`);
16932
+ return semanticProcessFailure(result.error.message);
16933
+ }
16934
+ if (isV8HeapOutOfMemory(result.stderr)) return semanticProcessFailure(`anvil-pyright ran out of memory with a ${maxOldSpace.value} MB heap. Increase ANVIL_PYRIGHT_MAX_OLD_SPACE_MB or validate a smaller target.`);
16935
+ if (0 !== result.status && 1 !== result.status) return semanticProcessFailure(result.stderr.trim() || `anvil-pyright exited with status ${result.status}`);
16758
16936
  let parsed;
16759
16937
  try {
16760
16938
  parsed = JSON.parse(result.stdout.trim());
@@ -21577,7 +21755,7 @@ print(json.dumps({"issues": issues}))
21577
21755
  ])).trim();
21578
21756
  const resolvedGitCommonDir = external_path_default().isAbsolute(rawGitCommonDir) ? rawGitCommonDir : external_path_default().resolve(inputPath, rawGitCommonDir);
21579
21757
  const gitCommonDir = external_fs_default().realpathSync(resolvedGitCommonDir);
21580
- setRepoContext(repoPath);
21758
+ auth_setRepoContext(repoPath);
21581
21759
  const remotes = (await git.getRemotes(true)).map(detectAnvilRemote);
21582
21760
  const anvilRemotes = remotes.filter((remote)=>remote.appId && remote.anvilUrl && "https" === remote.transport);
21583
21761
  const findings = [];
@@ -21703,7 +21881,7 @@ print(json.dumps({"issues": issues}))
21703
21881
  const repoPath = options.repoPath ?? deps.cwd();
21704
21882
  if ("get" !== operation) return null;
21705
21883
  if (!request.protocol || !request.host) return null;
21706
- setRepoContext(repoPath);
21884
+ auth_setRepoContext(repoPath);
21707
21885
  const appId = parseAppIdFromGitPath(request.path);
21708
21886
  if (!appId) return null;
21709
21887
  const requestUrl = normalizeAnvilUrl(`${request.protocol}://${request.host}`);
@@ -21785,7 +21963,7 @@ print(json.dumps({"issues": issues}))
21785
21963
  async function watch(repoPath, appId, options = {}) {
21786
21964
  const { anvilUrl = DEFAULT_ANVIL_URL, gitUrl = anvilUrl, stagedOnly = false, username } = options;
21787
21965
  repoPath = external_path_default().resolve(repoPath);
21788
- setRepoContext(repoPath);
21966
+ auth_setRepoContext(repoPath);
21789
21967
  const storedEnvPid = options.environment?.envPid ? void 0 : await readEnvironmentPid(repoPath);
21790
21968
  const environment = options.environment ?? (storedEnvPid ? {
21791
21969
  envPid: storedEnvPid
@@ -22573,7 +22751,7 @@ print(json.dumps({"issues": issues}))
22573
22751
  process.exit(1);
22574
22752
  }
22575
22753
  const { path: repoPath = process.cwd(), appid: explicitAppId, useFirst = false, stagedOnly = false, dependencyWatch = true, autoMode = false, url: explicitUrl, user: explicitUsername, open: openAfterValidation = false } = options;
22576
- setRepoContext(repoPath);
22754
+ auth_setRepoContext(repoPath);
22577
22755
  try {
22578
22756
  const validationResult = await validateAnvilApp(repoPath);
22579
22757
  if (validationResult.appName) logger_logger.info(external_chalk_default().green("Anvil app: ") + external_chalk_default().bold(validationResult.appName));
@@ -22780,6 +22958,7 @@ print(json.dumps({"issues": issues}))
22780
22958
  logger_logger.success("Logged in as " + external_chalk_default().bold(result.email));
22781
22959
  } catch (e) {
22782
22960
  logger_logger.error("Error: " + e.message);
22961
+ logErrorCause(e, logger_logger);
22783
22962
  process.exit(1);
22784
22963
  }
22785
22964
  });
@@ -23358,6 +23537,7 @@ print(json.dumps({"issues": issues}))
23358
23537
  await runConfigureFlow(version, configure_defaultDeps);
23359
23538
  } catch (e) {
23360
23539
  logger_logger.error("Error: " + errors_getErrorMessage(e));
23540
+ logErrorCause(e, logger_logger);
23361
23541
  process.exit(1);
23362
23542
  }
23363
23543
  });
@@ -1 +1 @@
1
- {"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../src/commands/configure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAKnC,MAAM,WAAW,sBAAsB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B;AAcD,eAAO,MAAM,+BAA+B,6BAA6B,CAAC;AAC1E,eAAO,MAAM,oBAAoB,8BAA8B,CAAC;AAShE,wBAAsB,wBAAwB,CAC1C,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,SAAS,MAAM,EAAE,EACnC,EAAE,EAAE,IAAI,CAAC,OAAO,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAC3E,OAAO,CAAC,MAAM,CAAC,CAkEjB;AAED,wBAAsB,yBAAyB,CAC3C,cAAc,EAAE,MAAM,EACtB,mBAAmB,GAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAoB,GACrE,OAAO,CAAC,sBAAsB,CAAC,CAuBjC;AAoGD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAYhF"}
1
+ {"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../src/commands/configure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAKnC,MAAM,WAAW,sBAAsB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B;AAcD,eAAO,MAAM,+BAA+B,6BAA6B,CAAC;AAC1E,eAAO,MAAM,oBAAoB,8BAA8B,CAAC;AAShE,wBAAsB,wBAAwB,CAC1C,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,SAAS,MAAM,EAAE,EACnC,EAAE,EAAE,IAAI,CAAC,OAAO,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAC3E,OAAO,CAAC,MAAM,CAAC,CAkEjB;AAED,wBAAsB,yBAAyB,CAC3C,cAAc,EAAE,MAAM,EACtB,mBAAmB,GAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAoB,GACrE,OAAO,CAAC,sBAAsB,CAAC,CAuBjC;AAoGD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAahF"}
@@ -1 +1 @@
1
- {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsC3D"}
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuC3D"}
@@ -0,0 +1,33 @@
1
+ import { getValidAuthToken } from "../services/auth";
2
+ import { readAuthFromRepo } from "../services/git-auth";
3
+ export interface ModelTokenDeps {
4
+ getValidAuthToken: typeof getValidAuthToken;
5
+ readAuthFromRepo: typeof readAuthFromRepo;
6
+ cwd: () => string;
7
+ }
8
+ export interface ModelTokenOptions {
9
+ deps?: ModelTokenDeps;
10
+ repoPath?: string;
11
+ /** How long to wait for the cross-process auth file lock; defaults to MODEL_TOKEN_LOCK_TIMEOUT_MS. */
12
+ lockTimeoutMs?: number;
13
+ }
14
+ /**
15
+ * Codex waits a bounded time for a command-based auth provider (the agent-host
16
+ * configures timeout_ms = 30000), so the helper must give up on the auth file
17
+ * lock well before then and fail loudly rather than be killed mid-wait.
18
+ */
19
+ export declare const MODEL_TOKEN_LOCK_TIMEOUT_MS = 12000;
20
+ /**
21
+ * Resolve a valid access token for the repo-local auth session. Refreshes a
22
+ * stale access token (persisting the rotated refresh token) under the
23
+ * cross-process auth file lock.
24
+ */
25
+ export declare function getModelToken(options?: ModelTokenOptions): Promise<string>;
26
+ /**
27
+ * Model-token helper entry point, invoked by the generated
28
+ * anvil-model-token-helper.cjs script: print a valid access token (and nothing
29
+ * else) to stdout. Any failure propagates so the helper script can exit
30
+ * non-zero with a message on stderr.
31
+ */
32
+ export declare function executeModelTokenOperation(options?: ModelTokenOptions): Promise<void>;
33
+ //# sourceMappingURL=modelToken.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modelToken.d.ts","sourceRoot":"","sources":["../../src/commands/modelToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAkB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,WAAW,cAAc;IAC3B,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,GAAG,EAAE,MAAM,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sGAAsG;IACtG,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AAIH,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAQlD;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBpF;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/F"}
package/dist/errors.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  * Typed error definitions for anvil-cli.
3
3
  * Uses discriminated unions for type-safe error handling.
4
4
  */
5
+ import type { Logger } from "./logger";
5
6
  export type AuthError = {
6
7
  type: "auth_required";
7
8
  message?: string;
@@ -14,6 +15,7 @@ export type AuthError = {
14
15
  } | {
15
16
  type: "token_refresh_failed";
16
17
  message?: string;
18
+ status?: number;
17
19
  };
18
20
  export type AppError = {
19
21
  type: "app_not_found";
@@ -102,7 +104,7 @@ export declare const createAuthError: {
102
104
  required: (message?: string) => AuthError;
103
105
  expired: (message?: string) => AuthError;
104
106
  invalid: (message?: string) => AuthError;
105
- refreshFailed: (message?: string) => AuthError;
107
+ refreshFailed: (message?: string, status?: number) => AuthError;
106
108
  };
107
109
  export declare const createAppError: {
108
110
  notFound: (appId: string) => AppError;
@@ -148,4 +150,12 @@ export declare function isNetworkError(error: AnvilError): error is NetworkError
148
150
  export declare function isValidationError(error: AnvilError): error is ValidationError;
149
151
  export declare function isSaveError(error: AnvilError): error is SaveError;
150
152
  export declare function getErrorMessage(error: unknown): string;
153
+ /**
154
+ * Return the immediate underlying cause of an error in a form suitable for
155
+ * verbose CLI output. Native fetch errors use `cause` for the useful network
156
+ * or TLS failure while exposing only "fetch failed" as their main message.
157
+ */
158
+ export declare function getErrorCauseMessage(error: unknown): string | null;
159
+ /** Log useful nested error details without adding noise to normal CLI output. */
160
+ export declare function logErrorCause(error: unknown, ui: Pick<Logger, "verbose">): void;
151
161
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,MAAM,MAAM,SAAS,GACf;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,IAAI,EAAE,sBAAsB,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAGzD,MAAM,MAAM,QAAQ,GACd;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAG9D,MAAM,MAAM,SAAS,GACf;IAAE,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