@ankhorage/studio 2.6.4 → 2.7.1

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.
Files changed (147) hide show
  1. package/README.md +1 -1
  2. package/apm/update.json +1 -1
  3. package/dist/authSettings.d.ts +5 -3
  4. package/dist/authSettings.d.ts.map +1 -1
  5. package/dist/authSettings.js +61 -49
  6. package/dist/authSettings.js.map +1 -1
  7. package/dist/cli/index.js +4 -4
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/core/studioManifestDraftModel.d.ts.map +1 -1
  10. package/dist/core/studioManifestDraftModel.js +9 -2
  11. package/dist/core/studioManifestDraftModel.js.map +1 -1
  12. package/dist/features/infrastructure/adapters/outbound/createStudioInfraAdapterPackageResolver.d.ts +4 -0
  13. package/dist/features/infrastructure/adapters/outbound/createStudioInfraAdapterPackageResolver.d.ts.map +1 -0
  14. package/dist/features/infrastructure/adapters/outbound/createStudioInfraAdapterPackageResolver.js +22 -0
  15. package/dist/features/infrastructure/adapters/outbound/createStudioInfraAdapterPackageResolver.js.map +1 -0
  16. package/dist/features/infrastructure/application/use-cases/initializeProjectLocalInfraNetworking.d.ts +4 -0
  17. package/dist/features/infrastructure/application/use-cases/initializeProjectLocalInfraNetworking.d.ts.map +1 -0
  18. package/dist/features/infrastructure/application/use-cases/initializeProjectLocalInfraNetworking.js +36 -0
  19. package/dist/features/infrastructure/application/use-cases/initializeProjectLocalInfraNetworking.js.map +1 -0
  20. package/dist/features/infrastructure/composition/createStudioProjectInfraLifecycle.d.ts +27 -0
  21. package/dist/features/infrastructure/composition/createStudioProjectInfraLifecycle.d.ts.map +1 -0
  22. package/dist/features/infrastructure/composition/createStudioProjectInfraLifecycle.js +67 -0
  23. package/dist/features/infrastructure/composition/createStudioProjectInfraLifecycle.js.map +1 -0
  24. package/dist/features/projects/adapters/outbound/ProjectGenerationStateStore.d.ts +29 -0
  25. package/dist/features/projects/adapters/outbound/ProjectGenerationStateStore.d.ts.map +1 -0
  26. package/dist/features/projects/adapters/outbound/ProjectGenerationStateStore.js +116 -0
  27. package/dist/features/projects/adapters/outbound/ProjectGenerationStateStore.js.map +1 -0
  28. package/dist/features/projects/composition/createProjectGenerationStateStore.d.ts +4 -0
  29. package/dist/features/projects/composition/createProjectGenerationStateStore.d.ts.map +1 -0
  30. package/dist/features/projects/composition/createProjectGenerationStateStore.js +6 -0
  31. package/dist/features/projects/composition/createProjectGenerationStateStore.js.map +1 -0
  32. package/dist/features/projects/domain/resolveStudioRuntimeProjectionState.d.ts +4 -0
  33. package/dist/features/projects/domain/resolveStudioRuntimeProjectionState.d.ts.map +1 -0
  34. package/dist/features/projects/domain/resolveStudioRuntimeProjectionState.js +17 -0
  35. package/dist/features/projects/domain/resolveStudioRuntimeProjectionState.js.map +1 -0
  36. package/dist/host/auth/projectAuthHealthService.d.ts +3 -4
  37. package/dist/host/auth/projectAuthHealthService.d.ts.map +1 -1
  38. package/dist/host/auth/projectAuthHealthService.js +14 -12
  39. package/dist/host/auth/projectAuthHealthService.js.map +1 -1
  40. package/dist/host/auth/projectAuthRuntimeDiagnostics.d.ts +10 -23
  41. package/dist/host/auth/projectAuthRuntimeDiagnostics.d.ts.map +1 -1
  42. package/dist/host/auth/projectAuthRuntimeDiagnostics.js +54 -118
  43. package/dist/host/auth/projectAuthRuntimeDiagnostics.js.map +1 -1
  44. package/dist/host/createStudioHost.d.ts +3 -3
  45. package/dist/host/createStudioHost.d.ts.map +1 -1
  46. package/dist/host/createStudioHost.js +3 -6
  47. package/dist/host/createStudioHost.js.map +1 -1
  48. package/dist/host/http/projectRuntimeRoutes.d.ts +2 -4
  49. package/dist/host/http/projectRuntimeRoutes.d.ts.map +1 -1
  50. package/dist/host/http/projectRuntimeRoutes.js +25 -44
  51. package/dist/host/http/projectRuntimeRoutes.js.map +1 -1
  52. package/dist/host/http/server.d.ts.map +1 -1
  53. package/dist/host/http/server.js +5 -91
  54. package/dist/host/http/server.js.map +1 -1
  55. package/dist/host/index.d.ts +1 -0
  56. package/dist/host/index.d.ts.map +1 -1
  57. package/dist/host/index.js.map +1 -1
  58. package/dist/host/layout/auth/resolveAuthLayoutPlan.js +2 -2
  59. package/dist/host/layout/auth/resolveAuthLayoutPlan.js.map +1 -1
  60. package/dist/host/layout/layoutGenerator.d.ts.map +1 -1
  61. package/dist/host/layout/layoutGenerator.js +17 -13
  62. package/dist/host/layout/layoutGenerator.js.map +1 -1
  63. package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.js +1 -1
  64. package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.js.map +1 -1
  65. package/dist/host/media/projectMediaStorage.d.ts +1 -1
  66. package/dist/host/media/projectMediaStorage.d.ts.map +1 -1
  67. package/dist/host/media/projectMediaStorage.js +19 -28
  68. package/dist/host/media/projectMediaStorage.js.map +1 -1
  69. package/dist/host/orchestrator/moduleManager.js +3 -3
  70. package/dist/host/orchestrator/moduleManager.js.map +1 -1
  71. package/dist/host/orchestrator/projectManager.d.ts +21 -21
  72. package/dist/host/orchestrator/projectManager.d.ts.map +1 -1
  73. package/dist/host/orchestrator/projectManager.js +97 -63
  74. package/dist/host/orchestrator/projectManager.js.map +1 -1
  75. package/dist/host/orchestrator/studioInfraUp.d.ts +5 -11
  76. package/dist/host/orchestrator/studioInfraUp.d.ts.map +1 -1
  77. package/dist/host/orchestrator/studioInfraUp.js +8 -36
  78. package/dist/host/orchestrator/studioInfraUp.js.map +1 -1
  79. package/dist/host/secrets/projectSecretService.d.ts +2 -3
  80. package/dist/host/secrets/projectSecretService.d.ts.map +1 -1
  81. package/dist/host/secrets/projectSecretService.js +24 -46
  82. package/dist/host/secrets/projectSecretService.js.map +1 -1
  83. package/dist/host/secrets/resolveProjectSecretDatabaseUrl.d.ts +3 -5
  84. package/dist/host/secrets/resolveProjectSecretDatabaseUrl.d.ts.map +1 -1
  85. package/dist/host/secrets/resolveProjectSecretDatabaseUrl.js +4 -11
  86. package/dist/host/secrets/resolveProjectSecretDatabaseUrl.js.map +1 -1
  87. package/dist/host/secrets/trustedOAuthInfraEnvironment.d.ts.map +1 -1
  88. package/dist/host/secrets/trustedOAuthInfraEnvironment.js +2 -2
  89. package/dist/host/secrets/trustedOAuthInfraEnvironment.js.map +1 -1
  90. package/dist/index.d.ts +3 -1
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +1 -0
  93. package/dist/index.js.map +1 -1
  94. package/dist/manifestState.d.ts.map +1 -1
  95. package/dist/manifestState.js +13 -8
  96. package/dist/manifestState.js.map +1 -1
  97. package/dist/manifestSync.js +1 -1
  98. package/dist/manifestSync.js.map +1 -1
  99. package/dist/projectAuthApi.d.ts +2 -2
  100. package/dist/projectAuthApi.d.ts.map +1 -1
  101. package/dist/projectAuthApi.js +6 -6
  102. package/dist/projectAuthApi.js.map +1 -1
  103. package/dist/projectAuthHealth.d.ts +4 -3
  104. package/dist/projectAuthHealth.d.ts.map +1 -1
  105. package/dist/projectAuthHealth.js +8 -6
  106. package/dist/projectAuthHealth.js.map +1 -1
  107. package/dist/projectAuthRuntimeDiagnostics.d.ts +2 -1
  108. package/dist/projectAuthRuntimeDiagnostics.d.ts.map +1 -1
  109. package/dist/projectAuthRuntimeDiagnostics.js.map +1 -1
  110. package/dist/projectDeployRuntimeInput.d.ts +2 -2
  111. package/dist/projectDeployRuntimeInput.d.ts.map +1 -1
  112. package/dist/projectOAuthSetup.d.ts +4 -3
  113. package/dist/projectOAuthSetup.d.ts.map +1 -1
  114. package/dist/projectOAuthSetup.js +3 -2
  115. package/dist/projectOAuthSetup.js.map +1 -1
  116. package/dist/projectSecretUsage.js +17 -16
  117. package/dist/projectSecretUsage.js.map +1 -1
  118. package/dist/types/project-generation.d.ts +11 -0
  119. package/dist/types/project-generation.d.ts.map +1 -0
  120. package/dist/types/project-generation.js +2 -0
  121. package/dist/types/project-generation.js.map +1 -0
  122. package/dist/ui/admin/pages/AuthAdminPage.d.ts.map +1 -1
  123. package/dist/ui/admin/pages/AuthAdminPage.js +21 -10
  124. package/dist/ui/admin/pages/AuthAdminPage.js.map +1 -1
  125. package/dist/ui/admin/pages/OverviewAdminPage.js +1 -1
  126. package/dist/ui/admin/pages/OverviewAdminPage.js.map +1 -1
  127. package/dist/ui/admin/pages/adminAuthCredentialFlow.js +0 -1
  128. package/dist/ui/admin/pages/adminAuthCredentialFlow.js.map +1 -1
  129. package/dist/ui/admin/pages/deploy/DeployMonetizationSyncCard.d.ts.map +1 -1
  130. package/dist/ui/admin/pages/deploy/DeployMonetizationSyncCard.js +2 -2
  131. package/dist/ui/admin/pages/deploy/DeployMonetizationSyncCard.js.map +1 -1
  132. package/dist/ui/admin/pages/deploy/DeployReleaseOperationsCard.d.ts.map +1 -1
  133. package/dist/ui/admin/pages/deploy/DeployReleaseOperationsCard.js +2 -2
  134. package/dist/ui/admin/pages/deploy/DeployReleaseOperationsCard.js.map +1 -1
  135. package/package.json +8 -5
  136. package/dist/host/orchestrator/infraSession.d.ts +0 -31
  137. package/dist/host/orchestrator/infraSession.d.ts.map +0 -1
  138. package/dist/host/orchestrator/infraSession.js +0 -79
  139. package/dist/host/orchestrator/infraSession.js.map +0 -1
  140. package/dist/host/orchestrator/projectGenerationState.d.ts +0 -11
  141. package/dist/host/orchestrator/projectGenerationState.d.ts.map +0 -1
  142. package/dist/host/orchestrator/projectGenerationState.js +0 -65
  143. package/dist/host/orchestrator/projectGenerationState.js.map +0 -1
  144. package/dist/host/utils/trimOutput.d.ts +0 -11
  145. package/dist/host/utils/trimOutput.d.ts.map +0 -1
  146. package/dist/host/utils/trimOutput.js +0 -9
  147. package/dist/host/utils/trimOutput.js.map +0 -1
@@ -0,0 +1,29 @@
1
+ import type { StudioRuntimeProjectionState } from '../../../../types/project-generation';
2
+ /*** Persist and inspect Studio-owned generated-project state in the canonical `.ankh/generation-state.json` document. */
3
+ export declare class ProjectGenerationStateStore {
4
+ /*** Read whether the current generated project state includes the Studio admin surface. */
5
+ readStudioInclusionAsync(projectPath: string): Promise<boolean>;
6
+ /*** Atomically persist Studio inclusion while preserving runtime projection evidence owned by the same state document. */
7
+ writeStudioInclusionAsync(projectPath: string, includeStudio: boolean): Promise<void>;
8
+ /*** Resolve current runtime projection currency without exposing persisted runtime signatures to callers. */
9
+ readRuntimeProjectionStateAsync(projectPath: string, expectedSignature: string): Promise<StudioRuntimeProjectionState>;
10
+ /*** Record the exact runtime signature only after the owning projection operation completed successfully. */
11
+ recordRuntimeProjectionSuccessAsync(projectPath: string, appliedSignature: string): Promise<void>;
12
+ /*** Persist bounded failure evidence for one attempted runtime signature while retaining the last successful signature. */
13
+ recordRuntimeProjectionFailureAsync(projectPath: string, failedSignature: string): Promise<void>;
14
+ /*** Read one required generation-state document and reject missing state instead of inferring ownership. */
15
+ private requireStateAsync;
16
+ /*** Read, parse and validate one generation-state document, optionally treating a missing file as an empty owner state. */
17
+ private readStateAsync;
18
+ /*** Read one generation-state source document with explicit missing-state semantics. */
19
+ private readStateSourceAsync;
20
+ /*** Parse one generation-state JSON source while preserving the original parse error as its cause. */
21
+ private parseStateSource;
22
+ /*** Validate the semantic shape of Studio's generated-project state document. */
23
+ private isProjectGenerationState;
24
+ /*** Validate persisted runtime projection evidence without accepting unrelated or malformed values. */
25
+ private isRuntimeProjectionEvidence;
26
+ /*** Resolve the canonical project generation-state path while rejecting path escape. */
27
+ private resolveStatePath;
28
+ }
29
+ //# sourceMappingURL=ProjectGenerationStateStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectGenerationStateStore.d.ts","sourceRoot":"","sources":["../../../../../src/features/projects/adapters/outbound/ProjectGenerationStateStore.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAEV,4BAA4B,EAC7B,MAAM,sCAAsC,CAAC;AAU9C,yHAAyH;AACzH,qBAAa,2BAA2B;IACtC,2FAA2F;IACrF,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKrE,0HAA0H;IACpH,yBAAyB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAS3F,6GAA6G;IACvG,+BAA+B,CACnC,WAAW,EAAE,MAAM,EACnB,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,4BAA4B,CAAC;IAKxC,6GAA6G;IACvG,mCAAmC,CACvC,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,IAAI,CAAC;IAShB,2HAA2H;IACrH,mCAAmC,CACvC,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IAahB,4GAA4G;YAC9F,iBAAiB;IAM/B,2HAA2H;YAC7G,cAAc;IAa5B,wFAAwF;YAC1E,oBAAoB;IAkBlC,sGAAsG;IACtG,OAAO,CAAC,gBAAgB;IAQxB,iFAAiF;IACjF,OAAO,CAAC,wBAAwB;IAShC,uGAAuG;IACvG,OAAO,CAAC,2BAA2B;IASnC,wFAAwF;IACxF,OAAO,CAAC,gBAAgB;CAWzB"}
@@ -0,0 +1,116 @@
1
+ import { promises as fs } from 'node:fs';
2
+ import path from 'node:path';
3
+ import { isMissingPathError, writeJsonFileAtomic } from '@ankhorage/utility/node/fs';
4
+ import { isRecord } from '@ankhorage/utility/object';
5
+ import { resolveStudioRuntimeProjectionState } from '../../domain/resolveStudioRuntimeProjectionState';
6
+ const PROJECT_GENERATION_STATE_REL_PATH = '.ankh/generation-state.json';
7
+ /*** Persist and inspect Studio-owned generated-project state in the canonical `.ankh/generation-state.json` document. */
8
+ export class ProjectGenerationStateStore {
9
+ /*** Read whether the current generated project state includes the Studio admin surface. */
10
+ async readStudioInclusionAsync(projectPath) {
11
+ const state = await this.requireStateAsync(projectPath);
12
+ return state.includeStudio;
13
+ }
14
+ /*** Atomically persist Studio inclusion while preserving runtime projection evidence owned by the same state document. */
15
+ async writeStudioInclusionAsync(projectPath, includeStudio) {
16
+ const statePath = this.resolveStatePath(projectPath);
17
+ const current = await this.readStateAsync(statePath, true);
18
+ const state = current
19
+ ? { ...current, includeStudio }
20
+ : { includeStudio };
21
+ await writeJsonFileAtomic(statePath, state);
22
+ }
23
+ /*** Resolve current runtime projection currency without exposing persisted runtime signatures to callers. */
24
+ async readRuntimeProjectionStateAsync(projectPath, expectedSignature) {
25
+ const state = await this.requireStateAsync(projectPath);
26
+ return resolveStudioRuntimeProjectionState(state.runtimeProjection, expectedSignature);
27
+ }
28
+ /*** Record the exact runtime signature only after the owning projection operation completed successfully. */
29
+ async recordRuntimeProjectionSuccessAsync(projectPath, appliedSignature) {
30
+ const statePath = this.resolveStatePath(projectPath);
31
+ const current = await this.requireStateAsync(projectPath);
32
+ await writeJsonFileAtomic(statePath, {
33
+ ...current,
34
+ runtimeProjection: { appliedSignature },
35
+ });
36
+ }
37
+ /*** Persist bounded failure evidence for one attempted runtime signature while retaining the last successful signature. */
38
+ async recordRuntimeProjectionFailureAsync(projectPath, failedSignature) {
39
+ const statePath = this.resolveStatePath(projectPath);
40
+ const current = await this.requireStateAsync(projectPath);
41
+ const appliedSignature = current.runtimeProjection?.appliedSignature;
42
+ await writeJsonFileAtomic(statePath, {
43
+ ...current,
44
+ runtimeProjection: {
45
+ ...(appliedSignature === undefined ? {} : { appliedSignature }),
46
+ failedSignature,
47
+ },
48
+ });
49
+ }
50
+ /*** Read one required generation-state document and reject missing state instead of inferring ownership. */
51
+ async requireStateAsync(projectPath) {
52
+ const state = await this.readStateAsync(this.resolveStatePath(projectPath), false);
53
+ if (!state)
54
+ throw new Error('Project generation state unexpectedly resolved as missing.');
55
+ return state;
56
+ }
57
+ /*** Read, parse and validate one generation-state document, optionally treating a missing file as an empty owner state. */
58
+ async readStateAsync(statePath, allowMissing) {
59
+ const source = await this.readStateSourceAsync(statePath, allowMissing);
60
+ if (source === null)
61
+ return null;
62
+ const parsed = this.parseStateSource(source, statePath);
63
+ if (!this.isProjectGenerationState(parsed)) {
64
+ throw new Error(`Project generation state is invalid at '${statePath}'.`);
65
+ }
66
+ return parsed;
67
+ }
68
+ /*** Read one generation-state source document with explicit missing-state semantics. */
69
+ async readStateSourceAsync(statePath, allowMissing) {
70
+ try {
71
+ return await fs.readFile(statePath, 'utf8');
72
+ }
73
+ catch (error) {
74
+ if (allowMissing && isMissingPathError(error))
75
+ return null;
76
+ if (isMissingPathError(error)) {
77
+ throw new Error(`Project generation state is missing at '${statePath}'. Run an explicit project sync with includeStudio set before using implicit runtime sync.`, { cause: error });
78
+ }
79
+ throw error;
80
+ }
81
+ }
82
+ /*** Parse one generation-state JSON source while preserving the original parse error as its cause. */
83
+ parseStateSource(source, statePath) {
84
+ try {
85
+ return JSON.parse(source);
86
+ }
87
+ catch (error) {
88
+ throw new Error(`Project generation state is invalid at '${statePath}'.`, { cause: error });
89
+ }
90
+ }
91
+ /*** Validate the semantic shape of Studio's generated-project state document. */
92
+ isProjectGenerationState(value) {
93
+ return (isRecord(value) &&
94
+ typeof value.includeStudio === 'boolean' &&
95
+ (value.runtimeProjection === undefined ||
96
+ this.isRuntimeProjectionEvidence(value.runtimeProjection)));
97
+ }
98
+ /*** Validate persisted runtime projection evidence without accepting unrelated or malformed values. */
99
+ isRuntimeProjectionEvidence(value) {
100
+ return (isRecord(value) &&
101
+ (value.appliedSignature === undefined || typeof value.appliedSignature === 'string') &&
102
+ (value.failedSignature === undefined || typeof value.failedSignature === 'string') &&
103
+ (typeof value.appliedSignature === 'string' || typeof value.failedSignature === 'string'));
104
+ }
105
+ /*** Resolve the canonical project generation-state path while rejecting path escape. */
106
+ resolveStatePath(projectPath) {
107
+ const root = path.resolve(projectPath);
108
+ const target = path.resolve(root, PROJECT_GENERATION_STATE_REL_PATH);
109
+ const relative = path.relative(root, target);
110
+ if (relative.startsWith('..') || path.isAbsolute(relative)) {
111
+ throw new Error(`Invalid project generation state path: ${PROJECT_GENERATION_STATE_REL_PATH}`);
112
+ }
113
+ return target;
114
+ }
115
+ }
116
+ //# sourceMappingURL=ProjectGenerationStateStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectGenerationStateStore.js","sourceRoot":"","sources":["../../../../../src/features/projects/adapters/outbound/ProjectGenerationStateStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAMrD,OAAO,EAAE,mCAAmC,EAAE,MAAM,kDAAkD,CAAC;AAEvG,MAAM,iCAAiC,GAAG,6BAA6B,CAAC;AAOxE,yHAAyH;AACzH,MAAM,OAAO,2BAA2B;IACtC,2FAA2F;IAC3F,KAAK,CAAC,wBAAwB,CAAC,WAAmB;QAChD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACxD,OAAO,KAAK,CAAC,aAAa,CAAC;IAC7B,CAAC;IAED,0HAA0H;IAC1H,KAAK,CAAC,yBAAyB,CAAC,WAAmB,EAAE,aAAsB;QACzE,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;QACrD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC3D,MAAM,KAAK,GAA2B,OAAO;YAC3C,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE;YAC/B,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC;QACtB,MAAM,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,6GAA6G;IAC7G,KAAK,CAAC,+BAA+B,CACnC,WAAmB,EACnB,iBAAyB;QAEzB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACxD,OAAO,mCAAmC,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,CAAC,KAAc;QAC7C,OAAO,CACL,QAAQ,CAAC,KAAK,CAAC;YACf,OAAO,KAAK,CAAC,aAAa,KAAK,SAAS;YACxC,CAAC,KAAK,CAAC,iBAAiB,KAAK,SAAS;gBACpC,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAC7D,CAAC;IACJ,CAAC;IAED,uGAAuG;IAC/F,2BAA2B,CAAC,KAAc;QAChD,OAAO,CACL,QAAQ,CAAC,KAAK,CAAC;YACf,CAAC,KAAK,CAAC,gBAAgB,KAAK,SAAS,IAAI,OAAO,KAAK,CAAC,gBAAgB,KAAK,QAAQ,CAAC;YACpF,CAAC,KAAK,CAAC,eAAe,KAAK,SAAS,IAAI,OAAO,KAAK,CAAC,eAAe,KAAK,QAAQ,CAAC;YAClF,CAAC,OAAO,KAAK,CAAC,gBAAgB,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,eAAe,KAAK,QAAQ,CAAC,CAC1F,CAAC;IACJ,CAAC;IAED,wFAAwF;IAChF,gBAAgB,CAAC,WAAmB;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,iCAAiC,CAAC,CAAC;QACrE,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC7C,IAAI,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC3D,MAAM,IAAI,KAAK,CACb,0CAA0C,iCAAiC,EAAE,CAC9E,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ import { ProjectGenerationStateStore } from '../adapters/outbound/ProjectGenerationStateStore';
2
+ /*** Compose Studio's canonical generated-project state store for host project lifecycle orchestration. */
3
+ export declare function createProjectGenerationStateStore(): ProjectGenerationStateStore;
4
+ //# sourceMappingURL=createProjectGenerationStateStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createProjectGenerationStateStore.d.ts","sourceRoot":"","sources":["../../../../src/features/projects/composition/createProjectGenerationStateStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAE/F,0GAA0G;AAC1G,wBAAgB,iCAAiC,IAAI,2BAA2B,CAE/E"}
@@ -0,0 +1,6 @@
1
+ import { ProjectGenerationStateStore } from '../adapters/outbound/ProjectGenerationStateStore';
2
+ /*** Compose Studio's canonical generated-project state store for host project lifecycle orchestration. */
3
+ export function createProjectGenerationStateStore() {
4
+ return new ProjectGenerationStateStore();
5
+ }
6
+ //# sourceMappingURL=createProjectGenerationStateStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createProjectGenerationStateStore.js","sourceRoot":"","sources":["../../../../src/features/projects/composition/createProjectGenerationStateStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAE/F,0GAA0G;AAC1G,MAAM,UAAU,iCAAiC;IAC/C,OAAO,IAAI,2BAA2B,EAAE,CAAC;AAC3C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ProjectRuntimeProjectionEvidence, StudioRuntimeProjectionState } from '../../../types/project-generation';
2
+ /*** Resolve durable runtime projection evidence against the current runtime-relevant manifest signature. */
3
+ export declare function resolveStudioRuntimeProjectionState(evidence: ProjectRuntimeProjectionEvidence | undefined, expectedSignature: string): StudioRuntimeProjectionState;
4
+ //# sourceMappingURL=resolveStudioRuntimeProjectionState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveStudioRuntimeProjectionState.d.ts","sourceRoot":"","sources":["../../../../src/features/projects/domain/resolveStudioRuntimeProjectionState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EAChC,4BAA4B,EAC7B,MAAM,mCAAmC,CAAC;AAE3C,4GAA4G;AAC5G,wBAAgB,mCAAmC,CACjD,QAAQ,EAAE,gCAAgC,GAAG,SAAS,EACtD,iBAAiB,EAAE,MAAM,GACxB,4BAA4B,CAc9B"}
@@ -0,0 +1,17 @@
1
+ /*** Resolve durable runtime projection evidence against the current runtime-relevant manifest signature. */
2
+ export function resolveStudioRuntimeProjectionState(evidence, expectedSignature) {
3
+ if (!evidence) {
4
+ return { status: 'unknown', reason: 'missing-evidence' };
5
+ }
6
+ if (evidence.failedSignature === expectedSignature) {
7
+ return { status: 'failed', reason: 'projection-failed' };
8
+ }
9
+ if (evidence.appliedSignature === expectedSignature) {
10
+ return { status: 'current', reason: 'applied' };
11
+ }
12
+ if (evidence.appliedSignature !== undefined || evidence.failedSignature !== undefined) {
13
+ return { status: 'pending', reason: 'manifest-changed' };
14
+ }
15
+ return { status: 'unknown', reason: 'missing-evidence' };
16
+ }
17
+ //# sourceMappingURL=resolveStudioRuntimeProjectionState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveStudioRuntimeProjectionState.js","sourceRoot":"","sources":["../../../../src/features/projects/domain/resolveStudioRuntimeProjectionState.ts"],"names":[],"mappings":"AAKA,4GAA4G;AAC5G,MAAM,UAAU,mCAAmC,CACjD,QAAsD,EACtD,iBAAyB;IAEzB,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC3D,CAAC;IACD,IAAI,QAAQ,CAAC,eAAe,KAAK,iBAAiB,EAAE,CAAC;QACnD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC3D,CAAC;IACD,IAAI,QAAQ,CAAC,gBAAgB,KAAK,iBAAiB,EAAE,CAAC;QACpD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAClD,CAAC;IACD,IAAI,QAAQ,CAAC,gBAAgB,KAAK,SAAS,IAAI,QAAQ,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QACtF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC3D,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;AAC3D,CAAC"}
@@ -1,13 +1,12 @@
1
1
  import type { ProjectAuthHealth } from '../../projectAuthHealth';
2
2
  import type { ProjectManager } from '../orchestrator/projectManager';
3
3
  import type { ProjectSecretService } from '../secrets/projectSecretService';
4
- type ProjectAuthHealthManager = Pick<ProjectManager, 'getInfrastructureStatus' | 'getProjectManifest'>;
4
+ type ProjectAuthHealthManager = Pick<ProjectManager, 'getInfrastructureOutputs' | 'getInfrastructureStatus' | 'getProjectManifest'>;
5
5
  export declare class ProjectAuthHealthService {
6
6
  private readonly projectManager;
7
7
  private readonly secretService;
8
- private readonly workspaceRoot;
9
8
  /***
10
- * Create the Studio host service that combines authored Auth state, secret availability, and generated-runtime diagnostics.
9
+ * Create the Studio host service that combines authored Auth state, secret availability, and provider-neutral Infra diagnostics.
11
10
  * @todo Move this service under the auth domain's host/application boundary.
12
11
  */
13
12
  constructor(options: {
@@ -15,7 +14,7 @@ export declare class ProjectAuthHealthService {
15
14
  readonly secretService: Pick<ProjectSecretService, 'list'>;
16
15
  readonly workspaceRoot: string;
17
16
  });
18
- /*** Resolve one project's bounded Auth health result without leaking infrastructure script output. */
17
+ /*** Resolve one project's bounded Auth health result without relying on provider-specific runtime scripts. */
19
18
  get(input: {
20
19
  readonly projectId: string;
21
20
  readonly environment?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"projectAuthHealthService.d.ts","sourceRoot":"","sources":["../../../src/host/auth/projectAuthHealthService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EA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';
2
3
  import { applyProjectAuthRuntimeDiagnostics } from '../../projectAuthRuntimeDiagnostics';
3
4
  import { resolveProjectAuthEnvironment } from '../../projectOAuthSetup';
@@ -5,17 +6,15 @@ import { observeProjectAuthRuntimeDiagnostics } from './projectAuthRuntimeDiagno
5
6
  export class ProjectAuthHealthService {
6
7
  projectManager;
7
8
  secretService;
8
- workspaceRoot;
9
9
  /***
10
- * Create the Studio host service that combines authored Auth state, secret availability, and generated-runtime diagnostics.
10
+ * Create the Studio host service that combines authored Auth state, secret availability, and provider-neutral Infra diagnostics.
11
11
  * @todo Move this service under the auth domain's host/application boundary.
12
12
  */
13
13
  constructor(options) {
14
14
  this.projectManager = options.projectManager;
15
15
  this.secretService = options.secretService;
16
- this.workspaceRoot = options.workspaceRoot;
17
16
  }
18
- /*** Resolve one project's bounded Auth health result without leaking infrastructure script output. */
17
+ /*** Resolve one project's bounded Auth health result without relying on provider-specific runtime scripts. */
19
18
  async get(input) {
20
19
  let manifest;
21
20
  try {
@@ -41,7 +40,8 @@ export class ProjectAuthHealthService {
41
40
  secretStoreAvailable: secretResult.ok,
42
41
  environment,
43
42
  });
44
- const oauth = manifest.infra.auth?.oauth;
43
+ const environmentSpec = readOwnProperty(manifest.infra.environments, environment);
44
+ const oauth = environmentSpec?.auth?.oauth;
45
45
  if (!oauth?.enabled || !oauth.providers.some((provider) => provider.enabled === true)) {
46
46
  return {
47
47
  ok: true,
@@ -50,14 +50,16 @@ export class ProjectAuthHealthService {
50
50
  };
51
51
  }
52
52
  try {
53
- const infraStatus = await this.projectManager.getInfrastructureStatus(input.projectId);
54
- const runtimeDiagnostics = await observeProjectAuthRuntimeDiagnostics({
55
- rootPath: this.workspaceRoot,
56
- projectId: input.projectId,
57
- target: infraStatus.target,
58
- generated: infraStatus.generated,
59
- environment,
53
+ const [infraStatus, infraOutputs] = await Promise.all([
54
+ this.projectManager.getInfrastructureStatus(input.projectId),
55
+ this.projectManager.getInfrastructureOutputs(input.projectId),
56
+ ]);
57
+ const publicBaseUrl = environmentSpec?.networking?.publicBaseUrl;
58
+ const runtimeDiagnostics = observeProjectAuthRuntimeDiagnostics({
59
+ status: infraStatus,
60
+ outputs: infraOutputs.outputs,
60
61
  callbackRoute: oauth.callbackRoute,
62
+ ...(publicBaseUrl ? { publicBaseUrl } : {}),
61
63
  });
62
64
  return {
63
65
  ok: true,
@@ -1 +1 @@
1
- {"version":3,"file":"projectAuthHealthService.js","sourceRoot":"","sources":["../../../src/host/auth/projectAuthHealthService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAGxE,OAAO,EAAE,oCAAoC,EAAE,MAAM,iCAAiC,CAAC;AAOvF,MAAM,OAAO,wBAAwB;IAClB,cAAc,CAA2B;IACzC,aAAa,CAAqC;IAClD,aAAa,CAAS;IAEvC;;;OAGG;IACH,YAAY,OAIX;QACC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAC7C,CAAC;IAED,sGAAsG;IACtG,KAAK,CAAC,GAAG,CAAC,KAGT;QACC,IAAI,QAAQ,CAAC;QACb,IAAI,CAAC;YACH,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC3E,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,KAAK,EAAE;oBACL,IAAI,EAAE,sBAAsB;oBAC5B,OAAO,EAAE,+DAA+D;iBACzE;aACF,CAAC;QACJ,CAAC;QAED,MAAM,WAAW,GAAG,6BAA6B,CAAC,KAAK,CAAC,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ACJ,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;gBACL,EAAE,EAAE,IAAI;gBACR,KAAK,EAAE,QAAQ;gBACf,IAAI,EAAE,kCAAkC,CAAC,aAAa,EAAE;oBACtD,kBAAkB,EAAE,EAAE;oBACtB,iBAAiB,EAAE,EAAE;oBACrB,aAAa,EAAE,aAAa;iBAC7B,CAAC;aACH,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"projectAuthHealthService.js","sourceRoot":"","sources":["../../../src/host/auth/projectAuthHealthService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAG5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAGxE,OAAO,EAAE,oCAAoC,EAAE,MAAM,iCAAiC,CAAC;AAOvF,MAAM,OAAO,wBAAwB;IAClB,cAAc,CAA2B;IACzC,aAAa,CAAqC;IAEnE;;;OAGG;IACH,YAAY,OAIX;QACC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAC7C,CAAC;IAED,8GAA8G;IAC9G,KAAK,CAAC,GAAG,CAAC,KAGT;QACC,IAAI,QAAQ,CAAC;QACb,IAAI,CAAC;YACH,QAAQ,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC3E,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,KAAK,EAAE;oBACL,IAAI,EAAE,sBAAsB;oBAC5B,OAAO,EAAE,+DAA+D;iBACzE;aACF,CAAC;QACJ,CAAC;QAED,MAAM,WAAW,GAAG,6BAA6B,CAAC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aAAa,EAAE,KAAK,CAAC,aAAa;gBAClC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC5C,CAAC,CAAC;YAEH,OAAO;gBACL,EAAE,EAAE,IAAI;gBACR,KAAK,EAAE,QAAQ;gBACf,IAAI,EAAE,kCAAkC,CAAC,aAAa,EAAE,kBAAkB,CAAC;aAC5E,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;gBACL,EAAE,EAAE,IAAI;gBACR,KAAK,EAAE,QAAQ;gBACf,IAAI,EAAE,kCAAkC,CAAC,aAAa,EAAE;oBACtD,kBAAkB,EAAE,EAAE;oBACtB,iBAAiB,EAAE,EAAE;oBACrB,aAAa,EAAE,aAAa;iBAC7B,CAAC;aACH,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
@@ -1,34 +1,21 @@
1
- import type { AuthRedirectEnvironment } from '@ankhorage/infra';
2
- import type { ProjectAuthRuntimeDiagnostics, ProjectAuthRuntimeRolloutStatus } from '../../projectAuthRuntimeDiagnostics';
1
+ import type { InfraOutput, InfraStatus } from '@ankhorage/contracts/infra';
2
+ import type { ProjectAuthRuntimeDiagnostics } from '../../projectAuthRuntimeDiagnostics';
3
3
  export interface ProjectAuthRedirectRuntime {
4
4
  readonly providerRedirectUrl: string;
5
- readonly siteUrl: string;
6
5
  readonly appCallbackTargets: readonly string[];
7
6
  readonly redirectAllowList: readonly string[];
8
7
  }
9
- export interface ParsedProjectAuthRuntimeStatus {
10
- readonly rolloutStatus: ProjectAuthRuntimeRolloutStatus;
11
- readonly providerRedirectUrl?: string;
12
- readonly appCallbackUrl?: string;
13
- }
14
- /***
15
- * Observe generated Auth redirect configuration and runtime lifecycle status for one Studio project.
16
- * @todo Keep this generated-infra observation under the auth domain's host adapter.
17
- */
8
+ /*** Observe Auth redirect configuration and rollout readiness from provider-neutral Infra outputs and status. */
18
9
  export declare function observeProjectAuthRuntimeDiagnostics(input: {
19
- readonly rootPath: string;
20
- readonly projectId: string;
21
- readonly target: string | null;
22
- readonly generated: boolean;
23
- readonly environment: AuthRedirectEnvironment;
24
10
  readonly callbackRoute: string;
25
- }): Promise<ProjectAuthRuntimeDiagnostics>;
26
- /*** Resolve canonical Auth provider/site/callback URLs from generated infrastructure environment values. */
11
+ readonly outputs: readonly InfraOutput[];
12
+ readonly publicBaseUrl?: string;
13
+ readonly status: InfraStatus;
14
+ }): ProjectAuthRuntimeDiagnostics;
15
+ /*** Resolve canonical Auth callback URLs from current public Infra outputs and authored networking intent. */
27
16
  export declare function resolveProjectAuthRedirectRuntime(input: {
28
- readonly environment: AuthRedirectEnvironment;
29
17
  readonly callbackRoute: string;
30
- readonly infraEnvironment: Readonly<Record<string, string | undefined>>;
18
+ readonly outputs: readonly InfraOutput[];
19
+ readonly publicBaseUrl?: string;
31
20
  }): ProjectAuthRedirectRuntime;
32
- /*** Parse bounded Auth provider callback and readiness values from generated infrastructure status output. */
33
- export declare function parseProjectAuthRuntimeStatus(stdout: string): ParsedProjectAuthRuntimeStatus;
34
21
  //# sourceMappingURL=projectAuthRuntimeDiagnostics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"projectAuthRuntimeDiagnostics.d.ts","sourceRoot":"","sources":["../../../src/host/auth/projectAuthRuntimeDiagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAUhE,OAAO,KAAK,EACV,6BAA6B,EAC7B,+BAA+B,EAChC,MAAM,qCAAqC,CAAC;AAY7C,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/C;AAED,MAAM,WAAW,8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AQ,CAAC,kBAAkB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/C;AAED,iHAAiH;AACjH,wBAAgB,oCAAoC,CAAC,KAAK,EAAE;IAC1D,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B,GAAG,6BAA6B,CAahC;AAED,8GAA8G;AAC9G,wBAAgB,iCAAiC,CAAC,KAAK,EAAE;IACvD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC,GAAG,0BAA0B,CAsB7B"}
@@ -1,128 +1,64 @@
1
- import { resolveAuthRedirectConfiguration } from '@ankhorage/infra';
2
- import { readProjectInfrastructureEnvironment, runProjectInfrastructureLifecycle, } from '@ankhorage/infra/project';
3
- import { readSafeRegexCapture, splitCommaSeparated } from '@ankhorage/utility/string';
4
- import { isExactHttpUrl, resolveHttpOrigin } from '@ankhorage/utility/url';
5
- import { getProjectPath } from '../orchestrator/projectPaths';
6
- const SAFE_INFRA_ENV_KEYS = [
7
- 'API_EXTERNAL_URL',
8
- 'APP_PORT_FORWARD_LOCAL_PORT',
9
- 'EXPO_PUBLIC_SUPABASE_URL',
10
- 'OAUTH_NATIVE_REDIRECT_URLS',
11
- 'SITE_URL',
12
- 'SUPABASE_GATEWAY_FORWARD_LOCAL_PORT',
13
- ];
14
- /***
15
- * Observe generated Auth redirect configuration and runtime lifecycle status for one Studio project.
16
- * @todo Keep this generated-infra observation under the auth domain's host adapter.
17
- */
18
- export async function observeProjectAuthRuntimeDiagnostics(input) {
19
- if (!input.generated || !input.target) {
20
- return {
21
- appCallbackTargets: [],
22
- redirectAllowList: [],
23
- rolloutStatus: 'not-generated',
24
- };
25
- }
26
- const diagnostics = [];
27
- const projectPath = getProjectPath(input.rootPath, input.projectId);
28
- let expected = null;
29
- try {
30
- const environment = await readProjectInfrastructureEnvironment({
31
- keys: SAFE_INFRA_ENV_KEYS,
32
- projectPath,
33
- target: input.target,
34
- });
35
- expected = resolveProjectAuthRedirectRuntime({
36
- environment: input.environment,
37
- callbackRoute: input.callbackRoute,
38
- infraEnvironment: environment,
39
- });
40
- }
41
- catch {
42
- diagnostics.push({
43
- code: 'auth_redirect_configuration_unavailable',
44
- severity: 'warning',
45
- message: 'Canonical Auth callback diagnostics could not be derived from generated Infra.',
46
- path: 'infra.auth.oauth',
47
- });
48
- }
49
- let observed = { rolloutStatus: 'unavailable' };
50
- try {
51
- const status = await runProjectInfrastructureLifecycle({
52
- projectId: input.projectId,
53
- projectPath,
54
- target: input.target,
55
- script: 'status',
56
- });
57
- observed = parseProjectAuthRuntimeStatus(status.stdout);
58
- }
59
- catch {
60
- // The public health result deliberately reports only a bounded state, never script output.
61
- }
62
- if (expected?.providerRedirectUrl &&
63
- observed.providerRedirectUrl &&
64
- expected.providerRedirectUrl !== observed.providerRedirectUrl) {
65
- diagnostics.push({
66
- code: 'auth_runtime_provider_callback_stale',
67
- severity: 'error',
68
- message: 'The running Auth provider callback does not match generated Infra configuration.',
69
- path: 'infra.auth.oauth.providerCallback',
70
- });
71
- }
72
- const expectedAppCallbackUrl = expected?.appCallbackTargets.find(isExactHttpUrl);
73
- if (expectedAppCallbackUrl &&
74
- observed.appCallbackUrl &&
75
- expectedAppCallbackUrl !== observed.appCallbackUrl) {
76
- diagnostics.push({
77
- code: 'auth_runtime_app_callback_stale',
78
- severity: 'error',
79
- message: 'The running Auth app callback does not match generated Infra configuration.',
80
- path: 'infra.auth.oauth.callbackRoute',
81
- });
82
- }
1
+ /*** Observe Auth redirect configuration and rollout readiness from provider-neutral Infra outputs and status. */
2
+ export function observeProjectAuthRuntimeDiagnostics(input) {
3
+ const expected = resolveProjectAuthRedirectRuntime({
4
+ callbackRoute: input.callbackRoute,
5
+ outputs: input.outputs,
6
+ ...(input.publicBaseUrl ? { publicBaseUrl: input.publicBaseUrl } : {}),
7
+ });
83
8
  return {
84
- ...(expected?.providerRedirectUrl
85
- ? { providerRedirectUrl: expected.providerRedirectUrl }
86
- : observed.providerRedirectUrl
87
- ? { providerRedirectUrl: observed.providerRedirectUrl }
88
- : {}),
89
- appCallbackTargets: expected?.appCallbackTargets ?? [],
90
- redirectAllowList: expected?.redirectAllowList ?? [],
91
- rolloutStatus: observed.rolloutStatus,
92
- diagnostics,
9
+ providerRedirectUrl: expected.providerRedirectUrl,
10
+ appCallbackTargets: expected.appCallbackTargets,
11
+ redirectAllowList: expected.redirectAllowList,
12
+ rolloutStatus: resolveProjectAuthRolloutStatus(input.status),
93
13
  };
94
14
  }
95
- /*** Resolve canonical Auth provider/site/callback URLs from generated infrastructure environment values. */
15
+ /*** Resolve canonical Auth callback URLs from current public Infra outputs and authored networking intent. */
96
16
  export function resolveProjectAuthRedirectRuntime(input) {
97
- const siteOrigin = resolveHttpOrigin(input.infraEnvironment.SITE_URL, input.infraEnvironment.APP_PORT_FORWARD_LOCAL_PORT);
98
- const gatewayOrigin = resolveHttpOrigin(input.infraEnvironment.API_EXTERNAL_URL ?? input.infraEnvironment.EXPO_PUBLIC_SUPABASE_URL, input.infraEnvironment.SUPABASE_GATEWAY_FORWARD_LOCAL_PORT);
99
- if (!siteOrigin || !gatewayOrigin) {
100
- throw new Error('Generated Infra does not expose canonical app and gateway origins.');
17
+ const supabaseUrl = readPublicEnvironmentOutput(input.outputs, 'EXPO_PUBLIC_SUPABASE_URL');
18
+ if (!supabaseUrl) {
19
+ throw new Error('Infra does not expose EXPO_PUBLIC_SUPABASE_URL for Auth diagnostics.');
101
20
  }
102
- const configuration = resolveAuthRedirectConfiguration({
103
- environment: input.environment,
104
- gatewayOrigin,
105
- siteOrigin,
106
- callbackRoute: input.callbackRoute,
107
- webOrigins: [siteOrigin],
108
- nativeRedirectUris: splitCommaSeparated(input.infraEnvironment.OAUTH_NATIVE_REDIRECT_URLS),
109
- });
21
+ const providerRedirectUrl = new URL('/auth/v1/callback', ensureTrailingSlash(supabaseUrl)).toString();
22
+ const publicBaseUrl = input.publicBaseUrl?.trim();
23
+ if (!publicBaseUrl) {
24
+ return { providerRedirectUrl, appCallbackTargets: [], redirectAllowList: [] };
25
+ }
26
+ const siteUrl = ensureTrailingSlash(publicBaseUrl);
27
+ const appCallbackUrl = new URL(normalizeCallbackRoute(input.callbackRoute), siteUrl).toString();
110
28
  return {
111
- providerRedirectUrl: configuration.providerCallbackUrl,
112
- siteUrl: configuration.siteUrl,
113
- appCallbackTargets: configuration.redirectAllowList.filter((target) => target !== configuration.siteUrl),
114
- redirectAllowList: configuration.redirectAllowList,
29
+ providerRedirectUrl,
30
+ appCallbackTargets: [appCallbackUrl],
31
+ redirectAllowList: [siteUrl, appCallbackUrl],
115
32
  };
116
33
  }
117
- /*** Parse bounded Auth provider callback and readiness values from generated infrastructure status output. */
118
- export function parseProjectAuthRuntimeStatus(stdout) {
119
- const providerRedirectUrl = readSafeRegexCapture(stdout, /provider\s+supabase-auth\/provider-callback:\s*([^\r\n]+)/iu, { allowWhitespace: false, maxLength: 2048 });
120
- const appCallbackUrl = readSafeRegexCapture(stdout, /provider\s+supabase-auth\/app-callback:\s*([^\r\n]+)/iu, { allowWhitespace: false, maxLength: 2048 });
121
- const readiness = /provider\s+supabase-auth\/GoTrue:\s*(not ready|ready)\b/iu.exec(stdout)?.[1];
122
- return {
123
- rolloutStatus: readiness === 'ready' ? 'ready' : readiness === 'not ready' ? 'not-ready' : 'unavailable',
124
- ...(providerRedirectUrl ? { providerRedirectUrl } : {}),
125
- ...(appCallbackUrl ? { appCallbackUrl } : {}),
126
- };
34
+ /*** Map provider-neutral Infra status to the bounded Auth rollout state exposed by Studio. */
35
+ function resolveProjectAuthRolloutStatus(status) {
36
+ if (status.state === 'ready')
37
+ return 'ready';
38
+ if (status.state === 'absent')
39
+ return 'not-generated';
40
+ if (status.state === 'pending' ||
41
+ status.state === 'degraded' ||
42
+ status.state === 'failed' ||
43
+ status.state === 'stopped') {
44
+ return 'not-ready';
45
+ }
46
+ return 'unavailable';
47
+ }
48
+ /*** Read one non-empty public Infra output by its application environment-variable name. */
49
+ function readPublicEnvironmentOutput(outputs, environmentVariable) {
50
+ const output = outputs.find((candidate) => candidate.visibility === 'public' && candidate.environmentVariable === environmentVariable);
51
+ if (output?.visibility !== 'public')
52
+ return undefined;
53
+ const value = String(output.value).trim();
54
+ return value.length > 0 ? value : undefined;
55
+ }
56
+ /*** Normalize an HTTP base URL to a trailing-slash form compatible with URL resolution. */
57
+ function ensureTrailingSlash(value) {
58
+ return value.endsWith('/') ? value : `${value}/`;
59
+ }
60
+ /*** Normalize one authored callback route to a relative URL path. */
61
+ function normalizeCallbackRoute(value) {
62
+ return value.trim().replace(/^\/+/, '');
127
63
  }
128
64
  //# sourceMappingURL=projectAuthRuntimeDiagnostics.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"projectAuthRuntimeDiagnostics.js","sourceRoot":"","sources":["../../../src/host/auth/projectAuthRuntimeDiagnostics.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EACL,oCAAoC,EACpC,iCAAiC,GAClC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAO3E,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,mBAAmB,GAAG;IAC1B,kBAAkB;IAClB,6BAA6B;IAC7B,0BAA0B;IAC1B,4BAA4B;IAC5B,UAAU;IACV,qCAAqC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;IAE3B,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CACzB,CAAC,SAAS,EAAE,EAAE,CACZ,SAAS,CAAC,UAAU,KAAK,QAAQ,IAAI,SAAS,CAAC,mBAAmB,KAAK,mBAAmB,CAC7F,CAAC;IACF,IAAI,MAAM,EAAE,UAAU,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACtD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1C,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9C,CAAC;AAED,2FAA2F;AAC3F,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;AACnD,CAAC;AAED,qEAAqE;AACrE,SAAS,sBAAsB,CAAC,KAAa;IAC3C,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC1C,CAAC"}
@@ -5,7 +5,7 @@ export interface CreateStudioHostOptions {
5
5
  readonly workspaceRoot: string;
6
6
  }
7
7
  /***
8
- * Compose the Studio host edge from project, module, update, deploy, and infrastructure-session owners.
8
+ * Compose the Studio host edge from project, module, update, deploy, and infrastructure lifecycle owners.
9
9
  * @todo Keep this as thin host composition while moving domain services out of host-owned folders.
10
10
  */
11
11
  export declare function createStudioHost(options: CreateStudioHostOptions): {
@@ -14,8 +14,8 @@ export declare function createStudioHost(options: CreateStudioHostOptions): {
14
14
  moduleManager: ModuleManager;
15
15
  projectUpdateService: import(".").ProjectUpdateService;
16
16
  projectDeployService: ProjectDeployService;
17
- /*** Close host-owned infrastructure sessions during Studio host shutdown. */
18
- close(): Promise<void>;
17
+ /*** Close Studio host-owned resources. Provider-neutral Infra lifecycle operations own their own runtime handles. */
18
+ close: () => void;
19
19
  };
20
20
  export type StudioHost = ReturnType<typeof createStudioHost>;
21
21
  //# sourceMappingURL=createStudioHost.d.ts.map