@ankhorage/doctor 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c2e3845: Surface exact native OAuth callback schemes and native app-build requirements in Doctor readiness without duplicating runtime host detection.
8
+
3
9
  ## 0.9.0
4
10
 
5
11
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"authReadinessEnvironment.d.ts","sourceRoot":"","sources":["../src/authReadinessEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EACV,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE;IACrD,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,cAAc,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACtD,QAAQ,CAAC,WAAW,EAAE,sBAAsB,CAAC;IAC7C,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;CACpC,GAAG;IACF,QAAQ,CAAC,oBAAoB,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC5D,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;CAChD,CA6BA"}
1
+ {"version":3,"file":"authReadinessEnvironment.d.ts","sourceRoot":"","sources":["../src/authReadinessEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EACV,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAOrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE;IACrD,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,cAAc,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACtD,QAAQ,CAAC,WAAW,EAAE,sBAAsB,CAAC;IAC7C,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;CACpC,GAAG;IACF,QAAQ,CAAC,oBAAoB,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC5D,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;CAChD,CAgCA"}
@@ -1,3 +1,4 @@
1
+ import { createAuthReadinessMessage, resolveNativeAuthReadinessContext, } from './authReadinessNativeContext.js';
1
2
  import { collectMissingAuthReadinessRequirements } from './authReadinessRequirements.js';
2
3
  export function analyzeAuthReadinessEnvironment(input) {
3
4
  const missingNativeTargets = new Set();
@@ -12,12 +13,16 @@ export function analyzeAuthReadinessEnvironment(input) {
12
13
  if (target !== 'web' && missing.includes(`${target} deep-link scheme`)) {
13
14
  missingNativeTargets.add(target);
14
15
  }
16
+ const nativeContext = resolveNativeAuthReadinessContext({ target, targets: input.targets });
15
17
  return {
18
+ ...nativeContext,
16
19
  category: 'auth-oauth',
17
20
  environment: input.environment,
18
- message: missing.length === 0
19
- ? 'Manifest and adapter setup requirements are satisfiable; concrete callback URLs remain Infra/runtime-owned.'
20
- : `Missing ${missing.join(' and ')}.`,
21
+ message: createAuthReadinessMessage({
22
+ ...nativeContext,
23
+ missing,
24
+ target,
25
+ }),
21
26
  provider: input.provider,
22
27
  status: missing.length === 0 ? 'ready' : 'missing',
23
28
  target,
@@ -1 +1 @@
1
- {"version":3,"file":"authReadinessEnvironment.js","sourceRoot":"","sources":["../src/authReadinessEnvironment.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,uCAAuC,EAAE,MAAM,gCAAgC,CAAC;AAGzF,MAAM,UAAU,+BAA+B,CAAC,KAQ/C;IAIC,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC1D,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAmB,EAAE;QACrE,MAAM,OAAO,GAAG,uCAAuC,CAAC;YACtD,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,MAAM;YACN,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;QACH,IAAI,MAAM,KAAK,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM,mBAAmB,CAAC,EAAE,CAAC;YACvE,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,YAAY;YACtB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,OAAO,EACL,OAAO,CAAC,MAAM,KAAK,CAAC;gBAClB,CAAC,CAAC,6GAA6G;gBAC/G,CAAC,CAAC,WAAW,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG;YACzC,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,MAAM,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;YAClD,MAAM;YACN,SAAS,EAAE,kBAAkB;SAC9B,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,oBAAoB,EAAE,CAAC,GAAG,oBAAoB,CAAC,EAAE,SAAS,EAAE,CAAC;AACxE,CAAC","sourcesContent":["import type { AuthOAuthSetupPlan } from '@ankhorage/contracts/auth';\nimport type {\n AppDeployEnvironmentId,\n AppDeployTargetId,\n AppDeployTargets,\n} from '@ankhorage/contracts/deploy';\n\nimport { collectMissingAuthReadinessRequirements } from './authReadinessRequirements.js';\nimport type { DoctorReadiness } from './readiness.js';\n\nexport function analyzeAuthReadinessEnvironment(input: {\n readonly callbackRoute: unknown;\n readonly credentialsRef: unknown;\n readonly enabledTargets: readonly AppDeployTargetId[];\n readonly environment: AppDeployEnvironmentId;\n readonly plan: AuthOAuthSetupPlan;\n readonly provider: string;\n readonly targets: AppDeployTargets;\n}): {\n readonly missingNativeTargets: readonly AppDeployTargetId[];\n readonly readiness: readonly DoctorReadiness[];\n} {\n const missingNativeTargets = new Set<AppDeployTargetId>();\n const readiness = input.enabledTargets.map((target): DoctorReadiness => {\n const missing = collectMissingAuthReadinessRequirements({\n callbackRoute: input.callbackRoute,\n credentialsRef: input.credentialsRef,\n plan: input.plan,\n target,\n targets: input.targets,\n });\n if (target !== 'web' && missing.includes(`${target} deep-link scheme`)) {\n missingNativeTargets.add(target);\n }\n\n return {\n category: 'auth-oauth',\n environment: input.environment,\n message:\n missing.length === 0\n ? 'Manifest and adapter setup requirements are satisfiable; concrete callback URLs remain Infra/runtime-owned.'\n : `Missing ${missing.join(' and ')}.`,\n provider: input.provider,\n status: missing.length === 0 ? 'ready' : 'missing',\n target,\n transport: 'brokeredRedirect',\n };\n });\n\n return { missingNativeTargets: [...missingNativeTargets], readiness };\n}\n"]}
1
+ {"version":3,"file":"authReadinessEnvironment.js","sourceRoot":"","sources":["../src/authReadinessEnvironment.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,0BAA0B,EAC1B,iCAAiC,GAClC,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,uCAAuC,EAAE,MAAM,gCAAgC,CAAC;AAGzF,MAAM,UAAU,+BAA+B,CAAC,KAQ/C;IAIC,MAAM,oBAAoB,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC1D,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAmB,EAAE;QACrE,MAAM,OAAO,GAAG,uCAAuC,CAAC;YACtD,aAAa,EAAE,KAAK,CAAC,aAAa;YAClC,cAAc,EAAE,KAAK,CAAC,cAAc;YACpC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,MAAM;YACN,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;QACH,IAAI,MAAM,KAAK,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM,mBAAmB,CAAC,EAAE,CAAC;YACvE,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;QAED,MAAM,aAAa,GAAG,iCAAiC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5F,OAAO;YACL,GAAG,aAAa;YAChB,QAAQ,EAAE,YAAY;YACtB,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,OAAO,EAAE,0BAA0B,CAAC;gBAClC,GAAG,aAAa;gBAChB,OAAO;gBACP,MAAM;aACP,CAAC;YACF,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,MAAM,EAAE,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;YAClD,MAAM;YACN,SAAS,EAAE,kBAAkB;SAC9B,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,oBAAoB,EAAE,CAAC,GAAG,oBAAoB,CAAC,EAAE,SAAS,EAAE,CAAC;AACxE,CAAC","sourcesContent":["import type { AuthOAuthSetupPlan } from '@ankhorage/contracts/auth';\nimport type {\n AppDeployEnvironmentId,\n AppDeployTargetId,\n AppDeployTargets,\n} from '@ankhorage/contracts/deploy';\n\nimport {\n createAuthReadinessMessage,\n resolveNativeAuthReadinessContext,\n} from './authReadinessNativeContext.js';\nimport { collectMissingAuthReadinessRequirements } from './authReadinessRequirements.js';\nimport type { DoctorReadiness } from './readiness.js';\n\nexport function analyzeAuthReadinessEnvironment(input: {\n readonly callbackRoute: unknown;\n readonly credentialsRef: unknown;\n readonly enabledTargets: readonly AppDeployTargetId[];\n readonly environment: AppDeployEnvironmentId;\n readonly plan: AuthOAuthSetupPlan;\n readonly provider: string;\n readonly targets: AppDeployTargets;\n}): {\n readonly missingNativeTargets: readonly AppDeployTargetId[];\n readonly readiness: readonly DoctorReadiness[];\n} {\n const missingNativeTargets = new Set<AppDeployTargetId>();\n const readiness = input.enabledTargets.map((target): DoctorReadiness => {\n const missing = collectMissingAuthReadinessRequirements({\n callbackRoute: input.callbackRoute,\n credentialsRef: input.credentialsRef,\n plan: input.plan,\n target,\n targets: input.targets,\n });\n if (target !== 'web' && missing.includes(`${target} deep-link scheme`)) {\n missingNativeTargets.add(target);\n }\n\n const nativeContext = resolveNativeAuthReadinessContext({ target, targets: input.targets });\n return {\n ...nativeContext,\n category: 'auth-oauth',\n environment: input.environment,\n message: createAuthReadinessMessage({\n ...nativeContext,\n missing,\n target,\n }),\n provider: input.provider,\n status: missing.length === 0 ? 'ready' : 'missing',\n target,\n transport: 'brokeredRedirect',\n };\n });\n\n return { missingNativeTargets: [...missingNativeTargets], readiness };\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import type { AppDeployTargetId, AppDeployTargets } from '@ankhorage/contracts/deploy';
2
+ import type { DoctorReadiness } from './readiness.js';
3
+ export type NativeAuthReadinessContext = Pick<DoctorReadiness, 'callbackScheme' | 'hostRequirement'>;
4
+ export declare function resolveNativeAuthReadinessContext(input: {
5
+ readonly target: AppDeployTargetId;
6
+ readonly targets: AppDeployTargets;
7
+ }): NativeAuthReadinessContext;
8
+ export declare function createAuthReadinessMessage(input: {
9
+ readonly callbackScheme?: string;
10
+ readonly missing: readonly string[];
11
+ readonly target: AppDeployTargetId;
12
+ }): string;
13
+ //# sourceMappingURL=authReadinessNativeContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authReadinessNativeContext.d.ts","sourceRoot":"","sources":["../src/authReadinessNativeContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAC3C,eAAe,EACf,gBAAgB,GAAG,iBAAiB,CACrC,CAAC;AAEF,wBAAgB,iCAAiC,CAAC,KAAK,EAAE;IACvD,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;CACpC,GAAG,0BAA0B,CAQ7B;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;CACpC,GAAG,MAAM,CAUT"}
@@ -0,0 +1,19 @@
1
+ export function resolveNativeAuthReadinessContext(input) {
2
+ if (input.target === 'web')
3
+ return {};
4
+ const callbackScheme = input.targets[input.target]?.scheme;
5
+ return {
6
+ ...(callbackScheme === undefined ? {} : { callbackScheme }),
7
+ hostRequirement: 'development-or-standalone-build',
8
+ };
9
+ }
10
+ export function createAuthReadinessMessage(input) {
11
+ const base = input.missing.length === 0
12
+ ? 'Manifest and adapter setup requirements are satisfiable; concrete callback URLs remain Infra/runtime-owned.'
13
+ : `Missing ${input.missing.join(' and ')}.`;
14
+ if (input.target === 'web')
15
+ return base;
16
+ const scheme = input.callbackScheme === undefined ? '' : ` Callback scheme: ${input.callbackScheme}.`;
17
+ return `${base}${scheme} Native OAuth requires a development or standalone app build; runtime host compatibility remains runtime-owned.`;
18
+ }
19
+ //# sourceMappingURL=authReadinessNativeContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authReadinessNativeContext.js","sourceRoot":"","sources":["../src/authReadinessNativeContext.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,iCAAiC,CAAC,KAGjD;IACC,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK;QAAE,OAAO,EAAE,CAAC;IAEtC,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAC3D,OAAO;QACL,GAAG,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC;QAC3D,eAAe,EAAE,iCAAiC;KACnD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,KAI1C;IACC,MAAM,IAAI,GACR,KAAK,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;QACxB,CAAC,CAAC,6GAA6G;QAC/G,CAAC,CAAC,WAAW,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;IAChD,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAExC,MAAM,MAAM,GACV,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,qBAAqB,KAAK,CAAC,cAAc,GAAG,CAAC;IACzF,OAAO,GAAG,IAAI,GAAG,MAAM,iHAAiH,CAAC;AAC3I,CAAC","sourcesContent":["import type { AppDeployTargetId, AppDeployTargets } from '@ankhorage/contracts/deploy';\n\nimport type { DoctorReadiness } from './readiness.js';\n\nexport type NativeAuthReadinessContext = Pick<\n DoctorReadiness,\n 'callbackScheme' | 'hostRequirement'\n>;\n\nexport function resolveNativeAuthReadinessContext(input: {\n readonly target: AppDeployTargetId;\n readonly targets: AppDeployTargets;\n}): NativeAuthReadinessContext {\n if (input.target === 'web') return {};\n\n const callbackScheme = input.targets[input.target]?.scheme;\n return {\n ...(callbackScheme === undefined ? {} : { callbackScheme }),\n hostRequirement: 'development-or-standalone-build',\n };\n}\n\nexport function createAuthReadinessMessage(input: {\n readonly callbackScheme?: string;\n readonly missing: readonly string[];\n readonly target: AppDeployTargetId;\n}): string {\n const base =\n input.missing.length === 0\n ? 'Manifest and adapter setup requirements are satisfiable; concrete callback URLs remain Infra/runtime-owned.'\n : `Missing ${input.missing.join(' and ')}.`;\n if (input.target === 'web') return base;\n\n const scheme =\n input.callbackScheme === undefined ? '' : ` Callback scheme: ${input.callbackScheme}.`;\n return `${base}${scheme} Native OAuth requires a development or standalone app build; runtime host compatibility remains runtime-owned.`;\n}\n"]}
@@ -2,8 +2,10 @@ import type { AuthOAuthProviderId, AuthOAuthTransportId } from '@ankhorage/contr
2
2
  import type { AppDeployEnvironmentId, AppDeployTargetId } from '@ankhorage/contracts/deploy';
3
3
  export type DoctorReadinessStatus = 'missing' | 'ready' | 'unsupported';
4
4
  export interface DoctorReadiness {
5
+ readonly callbackScheme?: string;
5
6
  readonly category: 'auth-oauth';
6
7
  readonly environment: AppDeployEnvironmentId;
8
+ readonly hostRequirement?: 'development-or-standalone-build';
7
9
  readonly message: string;
8
10
  readonly provider: AuthOAuthProviderId;
9
11
  readonly status: DoctorReadinessStatus;
@@ -1 +1 @@
1
- {"version":3,"file":"readiness.d.ts","sourceRoot":"","sources":["../src/readiness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAE7F,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,CAAC;AAExE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,sBAAsB,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAC;CAC1C"}
1
+ {"version":3,"file":"readiness.d.ts","sourceRoot":"","sources":["../src/readiness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAE7F,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,CAAC;AAExE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,sBAAsB,CAAC;IAC7C,QAAQ,CAAC,eAAe,CAAC,EAAE,iCAAiC,CAAC;IAC7D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAC;CAC1C"}
@@ -1 +1 @@
1
- {"version":3,"file":"readiness.js","sourceRoot":"","sources":["../src/readiness.ts"],"names":[],"mappings":"","sourcesContent":["import type { AuthOAuthProviderId, AuthOAuthTransportId } from '@ankhorage/contracts/auth';\nimport type { AppDeployEnvironmentId, AppDeployTargetId } from '@ankhorage/contracts/deploy';\n\nexport type DoctorReadinessStatus = 'missing' | 'ready' | 'unsupported';\n\nexport interface DoctorReadiness {\n readonly category: 'auth-oauth';\n readonly environment: AppDeployEnvironmentId;\n readonly message: string;\n readonly provider: AuthOAuthProviderId;\n readonly status: DoctorReadinessStatus;\n readonly target: AppDeployTargetId;\n readonly transport: AuthOAuthTransportId;\n}\n"]}
1
+ {"version":3,"file":"readiness.js","sourceRoot":"","sources":["../src/readiness.ts"],"names":[],"mappings":"","sourcesContent":["import type { AuthOAuthProviderId, AuthOAuthTransportId } from '@ankhorage/contracts/auth';\nimport type { AppDeployEnvironmentId, AppDeployTargetId } from '@ankhorage/contracts/deploy';\n\nexport type DoctorReadinessStatus = 'missing' | 'ready' | 'unsupported';\n\nexport interface DoctorReadiness {\n readonly callbackScheme?: string;\n readonly category: 'auth-oauth';\n readonly environment: AppDeployEnvironmentId;\n readonly hostRequirement?: 'development-or-standalone-build';\n readonly message: string;\n readonly provider: AuthOAuthProviderId;\n readonly status: DoctorReadinessStatus;\n readonly target: AppDeployTargetId;\n readonly transport: AuthOAuthTransportId;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/doctor",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Executable Ankh provider and standalone CLI for lightweight repo and package compliance diagnostics.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -5,6 +5,10 @@ import type {
5
5
  AppDeployTargets,
6
6
  } from '@ankhorage/contracts/deploy';
7
7
 
8
+ import {
9
+ createAuthReadinessMessage,
10
+ resolveNativeAuthReadinessContext,
11
+ } from './authReadinessNativeContext.js';
8
12
  import { collectMissingAuthReadinessRequirements } from './authReadinessRequirements.js';
9
13
  import type { DoctorReadiness } from './readiness.js';
10
14
 
@@ -33,13 +37,16 @@ export function analyzeAuthReadinessEnvironment(input: {
33
37
  missingNativeTargets.add(target);
34
38
  }
35
39
 
40
+ const nativeContext = resolveNativeAuthReadinessContext({ target, targets: input.targets });
36
41
  return {
42
+ ...nativeContext,
37
43
  category: 'auth-oauth',
38
44
  environment: input.environment,
39
- message:
40
- missing.length === 0
41
- ? 'Manifest and adapter setup requirements are satisfiable; concrete callback URLs remain Infra/runtime-owned.'
42
- : `Missing ${missing.join(' and ')}.`,
45
+ message: createAuthReadinessMessage({
46
+ ...nativeContext,
47
+ missing,
48
+ target,
49
+ }),
43
50
  provider: input.provider,
44
51
  status: missing.length === 0 ? 'ready' : 'missing',
45
52
  target,
@@ -0,0 +1,37 @@
1
+ import type { AppDeployTargetId, AppDeployTargets } from '@ankhorage/contracts/deploy';
2
+
3
+ import type { DoctorReadiness } from './readiness.js';
4
+
5
+ export type NativeAuthReadinessContext = Pick<
6
+ DoctorReadiness,
7
+ 'callbackScheme' | 'hostRequirement'
8
+ >;
9
+
10
+ export function resolveNativeAuthReadinessContext(input: {
11
+ readonly target: AppDeployTargetId;
12
+ readonly targets: AppDeployTargets;
13
+ }): NativeAuthReadinessContext {
14
+ if (input.target === 'web') return {};
15
+
16
+ const callbackScheme = input.targets[input.target]?.scheme;
17
+ return {
18
+ ...(callbackScheme === undefined ? {} : { callbackScheme }),
19
+ hostRequirement: 'development-or-standalone-build',
20
+ };
21
+ }
22
+
23
+ export function createAuthReadinessMessage(input: {
24
+ readonly callbackScheme?: string;
25
+ readonly missing: readonly string[];
26
+ readonly target: AppDeployTargetId;
27
+ }): string {
28
+ const base =
29
+ input.missing.length === 0
30
+ ? 'Manifest and adapter setup requirements are satisfiable; concrete callback URLs remain Infra/runtime-owned.'
31
+ : `Missing ${input.missing.join(' and ')}.`;
32
+ if (input.target === 'web') return base;
33
+
34
+ const scheme =
35
+ input.callbackScheme === undefined ? '' : ` Callback scheme: ${input.callbackScheme}.`;
36
+ return `${base}${scheme} Native OAuth requires a development or standalone app build; runtime host compatibility remains runtime-owned.`;
37
+ }
package/src/readiness.ts CHANGED
@@ -4,8 +4,10 @@ import type { AppDeployEnvironmentId, AppDeployTargetId } from '@ankhorage/contr
4
4
  export type DoctorReadinessStatus = 'missing' | 'ready' | 'unsupported';
5
5
 
6
6
  export interface DoctorReadiness {
7
+ readonly callbackScheme?: string;
7
8
  readonly category: 'auth-oauth';
8
9
  readonly environment: AppDeployEnvironmentId;
10
+ readonly hostRequirement?: 'development-or-standalone-build';
9
11
  readonly message: string;
10
12
  readonly provider: AuthOAuthProviderId;
11
13
  readonly status: DoctorReadinessStatus;