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
4 changes: 2 additions & 2 deletions src/components/integrations/LokiBuildCta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { EntityType } from '@/config/entity-registry';
/**
* Loki cross-sell — "build this with an AI fleet".
*
* Loki is the sibling execution product (OC = economic layer, FC =
* Loki is the sibling execution product (OC = economic layer, Loki =
* production layer; one shared login via "Login with OrangeCat"). This CTA is
* the single bridge component; the target URL derives from the integration
* SSOT in the entity registry.
Expand All @@ -20,7 +20,7 @@ import type { EntityType } from '@/config/entity-registry';
*/

// Deep link straight into Loki's create-project dialog (?new=1 opens it,
// params survive the sign-in redirect — FC PR #56). Unauthenticated users pass
// params survive the sign-in redirect — Loki PR #56). Unauthenticated users pass
// through "Continue with OrangeCat" and land in the open dialog.
const LOKI_BUILD_URL = `${ORANGECAT_LOKI_INTEGRATION.loki.site}/projects?new=1`;

Expand Down
15 changes: 7 additions & 8 deletions src/services/loki/entitlement-notify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import type { PaymentIntent } from '@/domain/payments/types';
import { parseLokiPass } from '@/config/loki-passes';

const LOKI_URL =
process.env.LOKI_ENTITLEMENT_URL ||
'https://loki.orangecat.ch/api/orangecat/entitlement';
process.env.LOKI_ENTITLEMENT_URL || 'https://loki.orangecat.ch/api/orangecat/entitlement';

// parseLokiPass + the plan set live in the config SSOT (the seed writes
// the very tags this reads), re-exported here for existing importers.
Expand Down Expand Up @@ -61,13 +60,13 @@ export async function notifyLokiProjectFunding(pi: PaymentIntent): Promise<void>
externalId: pi.id,
});
if (!result.ok) {
logger.warn('[fc-funding] Loki rejected event', {
logger.warn('[loki-funding] Loki rejected event', {
piId: pi.id,
status: result.status,
});
}
} catch (err) {
logger.error('[fc-funding] notify failed (non-fatal)', {
logger.error('[loki-funding] notify failed (non-fatal)', {
piId: pi.id,
error: (err as Error).message,
});
Expand Down Expand Up @@ -107,7 +106,7 @@ export async function notifyLokiEntitlement(pi: PaymentIntent): Promise<void> {
.eq('actor_type', 'user')
.maybeSingle();
if (!actor?.id) {
logger.warn('[fc-entitlement] no personal actor for buyer — cannot map to Loki', {
logger.warn('[loki-entitlement] no personal actor for buyer — cannot map to Loki', {
buyerId: pi.buyer_id,
});
return;
Expand All @@ -121,19 +120,19 @@ export async function notifyLokiEntitlement(pi: PaymentIntent): Promise<void> {
amountBtc: String(pi.amount_btc ?? ''),
});
if (!result.ok) {
logger.warn('[fc-entitlement] Loki rejected grant', {
logger.warn('[loki-entitlement] Loki rejected grant', {
piId: pi.id,
status: result.status,
});
} else {
logger.info('[fc-entitlement] granted', {
logger.info('[loki-entitlement] granted', {
piId: pi.id,
plan: pass.plan,
periodDays: pass.periodDays,
});
}
} catch (err) {
logger.error('[fc-entitlement] notify failed (non-fatal)', {
logger.error('[loki-entitlement] notify failed (non-fatal)', {
piId: pi.id,
error: (err as Error).message,
});
Expand Down
5 changes: 2 additions & 3 deletions src/services/loki/site-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
import { postSignedToLoki, lokiRailConfigured } from './signed-post';
import { logger } from '@/utils/logger';

const SITE_URL =
process.env.LOKI_SITE_URL || 'https://loki.orangecat.ch/api/orangecat/site';
const SITE_URL = process.env.LOKI_SITE_URL || 'https://loki.orangecat.ch/api/orangecat/site';

/**
* What a remote caller may ask for. A strict subset of the register's
Expand Down Expand Up @@ -107,7 +106,7 @@ export async function requestLokiSite(input: SiteBuildInput): Promise<SiteBuildO
// written for a person and names the next step (409 → "sign in to
// Loki once"; 429 → the daily ceiling and why it exists).
const detail = readDetail(result.body);
logger.warn('[fc-site] build request refused', {
logger.warn('[loki-site] build request refused', {
actorId: input.actorId,
slug,
status: result.status,
Expand Down
Loading