@agentconnect.md/setup 1.57.0-rc.2 → 1.57.0-rc.23

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/index.js CHANGED
@@ -60807,19 +60807,26 @@ function toRuntime(row) {
60807
60807
  updatedAt: row.updatedAt
60808
60808
  };
60809
60809
  }
60810
- /** Does any GitLab state still bind this deployment to its instance (§24.1)? A
60811
- * `disconnected` connection is credential-free history and does not; a binding
60812
- * (`cleanup_pending` included), an account, a hook, or a claim carrying a
60813
- * tombstone or an unfinished cleanup obligation does. */
60814
- async function gitlabStateExists(tx) {
60815
- const [connections, bindings, accounts, hooks, claims] = await Promise.all([
60816
- tx.gitlabConnection.count({ where: { NOT: { state: "disconnected" } } }),
60817
- tx.gitlabProjectBinding.count(),
60818
- tx.gitlabAgentAccount.count(),
60819
- tx.hookDef.count({ where: { kind: "gitlab" } }),
60820
- tx.codeHostRepositoryClaim.count({ where: { provider: "gitlab" } })
60821
- ]);
60822
- return connections + bindings + accounts + hooks + claims > 0;
60810
+ /**
60811
+ * Does any of one host's state still bind this deployment to its instance (§24.1)?
60812
+ * Keyed by provider here rather than in the code-host provider registry: the count
60813
+ * is a statement about Prisma models, which are persistence's knowledge.
60814
+ */
60815
+ const CODE_HOST_STATE_EXISTS = {
60816
+ github: async () => false,
60817
+ gitlab: async (tx) => {
60818
+ const [connections, bindings, accounts, hooks, claims] = await Promise.all([
60819
+ tx.gitlabConnection.count({ where: { NOT: { state: "disconnected" } } }),
60820
+ tx.gitlabProjectBinding.count(),
60821
+ tx.gitlabAgentAccount.count(),
60822
+ tx.hookDef.count({ where: { kind: "gitlab" } }),
60823
+ tx.codeHostRepositoryClaim.count({ where: { provider: "gitlab" } })
60824
+ ]);
60825
+ return connections + bindings + accounts + hooks + claims > 0;
60826
+ }
60827
+ };
60828
+ function codeHostStateExists(tx, provider) {
60829
+ return CODE_HOST_STATE_EXISTS[provider](tx);
60823
60830
  }
60824
60831
  var PgDeploymentConfigRepository = class {
60825
60832
  prisma;
@@ -60862,7 +60869,7 @@ var PgDeploymentConfigRepository = class {
60862
60869
  const previousValues = current ? parseDeploymentConfigValues(current.schemaVersion, current.values) : null;
60863
60870
  const previousBaseUrl = previousValues ? effectiveGitlabBaseUrl(previousValues) : this.envGitlabBaseUrl;
60864
60871
  const nextBaseUrl = effectiveGitlabBaseUrl(input.values);
60865
- if (previousBaseUrl !== nextBaseUrl && await gitlabStateExists(tx)) throw new DeploymentConfigGitlabBaseUrlLockedError(previousBaseUrl, nextBaseUrl);
60872
+ if (previousBaseUrl !== nextBaseUrl && await codeHostStateExists(tx, "gitlab")) throw new DeploymentConfigGitlabBaseUrlLockedError(previousBaseUrl, nextBaseUrl);
60866
60873
  const missingRefresh = (previousValues ? deploymentSecretsRequiringRefresh(previousValues, input.values) : []).filter((key) => !input.secrets[key]);
60867
60874
  if (missingRefresh.length > 0) throw new DeploymentConfigSecretRefreshRequiredError(missingRefresh);
60868
60875
  const currentSecrets = await tx.deploymentSecret.findMany({