Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions apps/tangle-cloud/src/blueprintApps/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,15 @@ function parseExternalApp(
const reasons: string[] = [];

if (requestedMode === 'iframe') {
reasons.push('Iframe embedding is disabled by policy; verified apps must open in a new tab.');
reasons.push(
'Iframe embedding is disabled by policy; verified apps must open in a new tab.',
);
}

if (!options.publisherVerified) {
reasons.push('Publisher is not verified for advanced external app handoff.');
reasons.push(
'Publisher is not verified for advanced external app handoff.',
);
}

if (!options.metadataVerified) {
Expand Down Expand Up @@ -288,7 +292,8 @@ export function buildBlueprintManifestFromMetadata(
? 'verified'
: getPublisherVerificationForNamespace(publisherNamespace),
};
const metadataVerified = blueprint.metadataVerification?.status === 'verified';
const metadataVerified =
blueprint.metadataVerification?.status === 'verified';
const publisherVerified = publisher.verification === 'verified';
const slugPolicy = canPublisherClaimSlug(normalizedRequestedSlug, publisher)
? 'publisher-scoped'
Expand All @@ -313,9 +318,12 @@ export function buildBlueprintManifestFromMetadata(
};

const allowDeclarativeTier =
manifestRoot !== null && blueprint.metadataVerification?.productionReady === true;
manifestRoot !== null &&
blueprint.metadataVerification?.productionReady === true;
const trustedExternalApp =
manifest.externalApp?.trust === 'trusted' ? manifest.externalApp : undefined;
manifest.externalApp?.trust === 'trusted'
? manifest.externalApp
: undefined;

const entry: BlueprintAppEntry = {
slug: normalizedRequestedSlug,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ const BlueprintHostCard = ({ blueprint, serviceId }: Props) => {
value={
blueprint.metadataVerification?.status === 'verified'
? 'Verified owner attestation'
: blueprint.metadataVerification?.reason ??
'Unverified metadata'
: (blueprint.metadataVerification?.reason ??
'Unverified metadata')
}
/>
</div>
Expand Down Expand Up @@ -158,10 +158,7 @@ const BlueprintHostCard = ({ blueprint, serviceId }: Props) => {
<InfoBlock label="Icon" value={blueprintUi.theme.icon} />
)}
{blueprintUi.theme.accentColor && (
<InfoBlock
label="Accent"
value={blueprintUi.theme.accentColor}
/>
<InfoBlock label="Accent" value={blueprintUi.theme.accentColor} />
)}
{blueprintUi.theme.secondaryColor && (
<InfoBlock
Expand Down Expand Up @@ -256,8 +253,9 @@ const BlueprintHostCard = ({ blueprint, serviceId }: Props) => {
{action.fields && action.fields.length > 0 && (
<Typography variant="body2" className="text-mono-100">
{action.fields
.map((field) =>
`${field.label} (${field.input}${field.required ? ', required' : ''})`,
.map(
(field) =>
`${field.label} (${field.input}${field.required ? ', required' : ''})`,
)
.join(' • ')}
</Typography>
Expand Down
4 changes: 2 additions & 2 deletions apps/tangle-cloud/src/pages/blueprints/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,8 @@ const BasicInfoStep: FC<BasicInfoStepProps> = ({
/>
<Typography variant="body3" className="text-mono-100 mt-1">
Publish the JSON preview below at this URI so cloud.tangle.tools can
resolve your hosted blueprint surfaces and shared runtime metadata.
New SDK blueprints ship the same contract shape in
resolve your hosted blueprint surfaces and shared runtime metadata. New
SDK blueprints ship the same contract shape in
`metadata/blueprint-metadata.json`.
{requiresIpfsForBlueprintMetadata()
? ' Production hosting only accepts ipfs:// metadata URIs.'
Expand Down
17 changes: 11 additions & 6 deletions apps/tangle-cloud/src/pages/blueprints/manage/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,21 @@ const fetchBlueprintMetadataPreview = async (
controller.abort();
}

const response = await fetch(resolveBlueprintMetadataFetchUrl(metadataUri), {
signal: controller.signal,
cache: 'no-store',
});
const response = await fetch(
resolveBlueprintMetadataFetchUrl(metadataUri),
{
signal: controller.signal,
cache: 'no-store',
},
);

if (!response.ok) {
throw new Error(`Failed to fetch metadata: ${response.status}`);
}

const metadataText = await response.text();
const { parsed, rawMetadata } = parseBlueprintMetadataJsonText(metadataText);
const { parsed, rawMetadata } =
parseBlueprintMetadataJsonText(metadataText);
const metadataJson = rawMetadata;
if (metadataJson === null) {
throw new Error('Metadata payload must be a JSON object');
Expand All @@ -195,7 +199,8 @@ const fetchBlueprintMetadataPreview = async (
codeRepository: parsed.codeUrl ?? undefined,
docs:
metadataJson !== null
? readString(metadataJson.docs) ?? readString(metadataJson.documentation)
? (readString(metadataJson.docs) ??
readString(metadataJson.documentation))
: undefined,
metadataHash: computeBlueprintMetadataPayloadHash(metadataJson),
};
Expand Down
Loading
Loading