@wtfalch/foundry 0.16.6 → 0.16.7

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.d.ts CHANGED
@@ -23,6 +23,8 @@ export { PlatformOrgBlockedError, PlatformOrgPorts } from './plan/index.js';
23
23
  export type { CoolifyPort, CloudflarePort, ZitadelPort, CallsSfuPort, JobsSchedulerPort, FilesOrganisationPort, AiOrganisationPort, FoundryStepExecutorPorts, PlatformOrgPortSource, AgoraHostPort, AgoraHostValues, LoginHostBinding, LoginHostBindingsPort, } from './plan/index.js';
24
24
  export { FoundryStepExecutor, NotBuiltError, healthUrls, loginHostnameFor } from './plan/index.js';
25
25
  export { HttpJobsSchedulerClient } from './plan/index.js';
26
+ export type { ZitadelListAppsRawApp } from './plan/index.js';
27
+ export { adaptZitadelListApps } from './plan/index.js';
26
28
  export type { MailIdentityApp, MailIdentityAudienceCheck } from './plan/index.js';
27
29
  export { checkMailIdentityAudience } from './plan/index.js';
28
30
  export type { MailAllowlistApp } from './plan/index.js';
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ export { DEFAULT_ORG_PLATFORM_READINESS, ORG_PLATFORM_KEY_REFS, agoraHostValuesF
10
10
  export { PlatformOrgBlockedError, PlatformOrgPorts } from './plan/index.js';
11
11
  export { FoundryStepExecutor, NotBuiltError, healthUrls, loginHostnameFor } from './plan/index.js';
12
12
  export { HttpJobsSchedulerClient } from './plan/index.js';
13
+ export { adaptZitadelListApps } from './plan/index.js';
13
14
  export { checkMailIdentityAudience } from './plan/index.js';
14
15
  export { checkMailAppsAllowlist } from './plan/index.js';
15
16
  export { FoundryPlatformStepExecutor, ProvidersPlatformCloudflareReader, ProvidersPlatformCoolifyReader, createZitadelAdminMinter, createZitadelProjectRoles, PLATFORM_AUTH_KEY, PLATFORM_MAIL_KEY, PLATFORM_MAIL_ADMIN_KEY_DESCRIPTION, } from './plan/index.js';
@@ -35,4 +35,6 @@ export type { MailAllowlistApp } from './mail-identity-allowlist.js';
35
35
  export { checkMailAppsAllowlist } from './mail-identity-allowlist.js';
36
36
  export type { CoolifyPort, CloudflarePort, ZitadelPort, CallsSfuPort, JobsSchedulerPort, FilesOrganisationPort, AiOrganisationPort, FoundryStepExecutorPorts, PlatformOrgPortSource, } from './executor.js';
37
37
  export { FoundryStepExecutor, NotBuiltError, healthUrls } from './executor.js';
38
+ export type { ZitadelListAppsRawApp } from './executor.js';
39
+ export { adaptZitadelListApps } from './executor.js';
38
40
  export { HttpJobsSchedulerClient } from './jobs-scheduler-http.js';
@@ -18,4 +18,5 @@ export { loginHostnameFor } from './login-host.js';
18
18
  export { checkMailIdentityAudience } from './mail-identity.js';
19
19
  export { checkMailAppsAllowlist } from './mail-identity-allowlist.js';
20
20
  export { FoundryStepExecutor, NotBuiltError, healthUrls } from './executor.js';
21
+ export { adaptZitadelListApps } from './executor.js';
21
22
  export { HttpJobsSchedulerClient } from './jobs-scheduler-http.js';
@@ -1049,6 +1049,10 @@ function planSfu(platform) {
1049
1049
  * the broker's own token as part of running this step, and a step that is
1050
1050
  * never planned never runs. So this still plans the step -- surfacing
1051
1051
  * `executorBlocked` in `blocked` for visibility, not to stop planning.
1052
+ * Exception (the auth-broker loop): once everything else is applied and
1053
+ * `otherInputsMissing` is non-empty, nothing this step can do changes the
1054
+ * missing inputs, so it is reported blocked and not planned -- else every
1055
+ * `driveApply` round replans it until `maxRounds`.
1052
1056
  *
1053
1057
  * #211 round 6: round 3's `!brokerApplied` guard assumed "no executor" and
1054
1058
  * "broker not yet created" always coincide. They don't: a broker recorded on
@@ -1159,10 +1163,25 @@ function planAuth(platform, recordedIds, executorBlocked, executorMissing, authD
1159
1163
  // #211 round 3: a blocked reason with no broker yet created also means the
1160
1164
  // executor is unusable (no auth dependencies) -- nothing to plan.
1161
1165
  // A blocked reason with the broker already created means only its deploy
1162
- // is held back; plan the step anyway so it can keep retrying and, once
1163
- // #209/#210 land, deploy on the very next apply.
1166
+ // is held back; plan the step anyway, so it can mint what it can (#209) and,
1167
+ // once #210 lands, deploy on the very next apply.
1164
1168
  if (executorBlocked && !brokerApplied)
1165
1169
  return { step: null, blocked: executorBlocked };
1170
+ // Loop fix: everything but the broker deploy is applied and that deploy
1171
+ // waits on an input (`otherInputsMissing`, never the token this step mints)
1172
+ // that another run supplies -- re-applying changes nothing, so the step
1173
+ // planned and applied every `driveApply` round, with dozens of Coolify
1174
+ // calls each, until `maxRounds`. Report it blocked and plan nothing; the
1175
+ // next plan re-reads the live inputs, so it plans the step once they exist.
1176
+ // The login client is not required here: `provisionPlatformAuth` mints it
1177
+ // only once those same inputs exist, so it is never recorded before then.
1178
+ if (executorBlocked &&
1179
+ otherInputsMissing.length > 0 &&
1180
+ recordedIds[key] &&
1181
+ connectorApplied &&
1182
+ recordedIds[PLATFORM_AUTH_ZITADEL_RUN_OPTIONS_SCOPE_KEY] === AUTH_ZITADEL_RUN_OPTIONS) {
1183
+ return { step: null, blocked: executorBlocked };
1184
+ }
1166
1185
  return {
1167
1186
  step: {
1168
1187
  action: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wtfalch/foundry",
3
- "version": "0.16.6",
3
+ "version": "0.16.7",
4
4
  "description": "Foundry's SDK: the declared org's types, the plan and apply contracts, and the state store's interface.",
5
5
  "repository": {
6
6
  "type": "git",