Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

8.7 KB
Raw Blame
// The registry of PortOS credentials — the single list Settings > Credentials
// renders. Pure data, no I/O, so a lib and a service can read it without a
// service→lib inversion. Runtime resolution — settings store, repo `.env`,
// inherited process.env, CLI/keychain, instance config — lives in
// `server/services/credentialInventory.js`.
//
// Ordered most-value-first. Adding a credential:
//   1. add a descriptor here;
//   2. point `configurePath` at the integration tab; `privateStore: true` enables
//      write-only management here for keys resolved through settings.js;
//   3. tag `feature` when an instance-feature id from instanceFeatureRegistry
//      stays dark without it.
// Presence and source only. Never the value, and not a masked prefix either.

export const CREDENTIAL_TIERS = Object.freeze(['free', 'metered', 'none']);

export const CREDENTIALS = Object.freeze([
  Object.freeze({
    id: 'huggingface',
    privateStore: true,
    label: 'Hugging Face',
    unlocks: 'Authenticated model, LoRA, and 3D-asset downloads (FLUX, LTX, Trellis, and gated Hub repos).',
    tier: 'free',
    getUrl: 'https://huggingface.co/settings/tokens',
    envVars: Object.freeze(['HF_TOKEN', 'HUGGINGFACE_HUB_TOKEN', 'HUGGINGFACEHUB_API_TOKEN', 'HUGGINGFACE_TOKEN']),
    settingsPath: 'imageGen.hfToken',
    configurePath: '/media/image?settings=1',
  }),
  Object.freeze({
    id: 'artificial-analysis', label: 'Artificial Analysis', privateStore: true,
    unlocks: 'Model benchmark and pricing sync.', tier: 'free',
    getUrl: 'https://artificialanalysis.ai/', envVars: Object.freeze(['ARTIFICIAL_ANALYSIS_API_KEY']),
    settingsPath: 'secrets.artificialAnalysis.apiKey', configurePath: '/settings/credentials',
  }),
  Object.freeze({
    id: 'fal', label: 'fal.ai', privateStore: true,
    unlocks: 'Video and image generation through fal.ai.', tier: 'metered',
    getUrl: 'https://fal.ai/dashboard/keys', envVars: Object.freeze(['FAL_KEY']),
    settingsPath: 'videoGen.fal.apiKey', configurePath: '/settings/credentials',
  }),
  Object.freeze({
    id: 'reactor', label: 'reactor.inc', privateStore: true,
    unlocks: 'Video generation through reactor.inc.', tier: 'metered',
    getUrl: 'https://reactor.inc/', envVars: Object.freeze(['REACTOR_API_KEY']),
    settingsPath: 'videoGen.reactor.apiKey', configurePath: '/settings/credentials',
  }),
  Object.freeze({
    id: 'runway', label: 'Runway', privateStore: true,
    unlocks: 'Image and video generation through Runway\'s developer API.', tier: 'metered',
    getUrl: 'https://dev.runwayml.com/', envVars: Object.freeze(['RUNWAYML_API_SECRET']),
    settingsPath: 'videoGen.runway.apiKey', configurePath: '/settings/credentials',
  }),
  Object.freeze({
    id: 'github',
    label: 'GitHub',
    unlocks: 'CoS agent PRs, `gh` on spawned CLIs, and the GitHub Dev Tools page.',
    tier: 'free',
    getUrl: 'https://github.com/settings/tokens',
    envVars: Object.freeze(['GH_TOKEN', 'GITHUB_TOKEN']),
    settingsPath: null,
    configurePath: '/devtools/github',
  }),
  Object.freeze({
    id: 'anthropic',
    label: 'Anthropic / Claude',
    unlocks: 'Claude Code CLI/TUI coding agents and cloud Claude text.',
    tier: 'metered',
    getUrl: 'https://console.anthropic.com/settings/keys',
    envVars: Object.freeze(['ANTHROPIC_API_KEY', 'ANTHROPIC_AUTH_TOKEN']),
    settingsPath: null,
    configurePath: '/ai',
  }),
  Object.freeze({
    id: 'openai',
    label: 'OpenAI / Codex',
    unlocks: 'Codex CLI/TUI coding agents and OpenAI API text.',
    tier: 'metered',
    getUrl: 'https://platform.openai.com/api-keys',
    envVars: Object.freeze(['OPENAI_API_KEY']),
    settingsPath: null,
    configurePath: '/ai',
  }),
  Object.freeze({
    id: 'google',
    label: 'Google / Gemini',
    unlocks: 'Antigravity / Gemini CLI coding agents and Google AI image/text.',
    tier: 'metered',
    getUrl: 'https://aistudio.google.com/apikey',
    envVars: Object.freeze(['GEMINI_API_KEY', 'GOOGLE_API_KEY', 'GOOGLE_GENAI_API_KEY']),
    settingsPath: null,
    configurePath: '/ai',
  }),
  Object.freeze({
    id: 'xai',
    label: 'xAI / Grok',
    unlocks: 'Grok CLI/TUI coding agents and grok image/video.',
    tier: 'metered',
    getUrl: 'https://console.x.ai/',
    envVars: Object.freeze(['XAI_API_KEY', 'GROK_API_KEY']),
    settingsPath: null,
    configurePath: '/ai',
  }),
  Object.freeze({
    id: 'civitai',
    privateStore: true,
    label: 'CivitAI',
    unlocks: 'LoRA and checkpoint downloads from civitai.com.',
    tier: 'free',
    getUrl: 'https://civitai.com/user/account',
    envVars: Object.freeze(['CIVITAI_API_KEY']),
    settingsPath: 'civitai.apiKey',
    configurePath: '/models/loras',
  }),
  Object.freeze({
    id: 'telegram',
    label: 'Telegram',
    unlocks: 'Outbound Telegram notifications and the MCP bridge bot.',
    tier: 'free',
    getUrl: 'https://t.me/BotFather',
    envVars: Object.freeze(['TELEGRAM_BOT_TOKEN']),
    settingsPath: 'secrets.telegram.token',
    configurePath: '/settings/telegram',
  }),
  Object.freeze({
    id: 'jira',
    label: 'JIRA',
    unlocks: 'Sprint boards, ticket triage, and JIRA reports.',
    tier: 'metered',
    getUrl: 'https://id.atlassian.com/manage-profile/security/api-tokens',
    envVars: Object.freeze([]),
    settingsPath: null,
    configurePath: '/devtools/jira',
    feature: 'jira',
  }),
  Object.freeze({
    id: 'datadog',
    label: 'DataDog',
    unlocks: 'Error-monitoring dashboards for apps wired to a DataDog instance.',
    tier: 'metered',
    getUrl: 'https://app.datadoghq.com/organization-settings/api-keys',
    envVars: Object.freeze([]),
    settingsPath: null,
    configurePath: '/devtools/datadog',
    feature: 'datadog',
  }),
  Object.freeze({
    id: 'spotify',
    label: 'Spotify',
    unlocks: 'Listening-history ingest for Brain / Digital Twin taste.',
    tier: 'free',
    getUrl: 'https://developer.spotify.com/dashboard',
    envVars: Object.freeze([]),
    settingsPath: null,
    configurePath: '/brain/spotify',
  }),
  Object.freeze({
    id: 'youtube',
    label: 'YouTube',
    unlocks: 'Watch-history ingest from a signed-in managed browser.',
    tier: 'free',
    getUrl: 'https://www.youtube.com/',
    envVars: Object.freeze([]),
    settingsPath: 'youtube.enabled',
    configurePath: '/brain/youtube',
  }),
  Object.freeze({
    id: 'signal',
    label: 'Signal',
    unlocks: 'Local Signal Desktop chat ingest for Tribe and the life timeline.',
    tier: 'none',
    getUrl: 'https://signal.org/download/',
    envVars: Object.freeze(['SIGNAL_DIR', 'SIGNAL_CONFIG_PATH', 'SIGNAL_KEYCHAIN_PASSWORD']),
    settingsPath: null,
    configurePath: '/messages/signal',
  }),
  Object.freeze({
    id: 'stacker-news',
    label: 'Stacker News',
    unlocks: 'Territory stewardship, item ingest, and approved SN actions.',
    tier: 'free',
    getUrl: 'https://stacker.news/settings',
    envVars: Object.freeze([]),
    settingsPath: null,
    configurePath: '/stacker-news',
  }),
  Object.freeze({
    id: 'mortalloom',
    label: 'MortalLoom',
    unlocks: 'iCloud MortalLoom.json import into Health tracking.',
    tier: 'none',
    getUrl: null,
    envVars: Object.freeze([]),
    settingsPath: 'mortalloom.path',
    configurePath: '/settings/mortalloom',
    feature: 'health',
  }),
  Object.freeze({
    id: 'openclaw',
    label: 'OpenClaw',
    unlocks: 'Operator chat with a configured OpenClaw runtime.',
    tier: 'none',
    getUrl: null,
    envVars: Object.freeze(['OPENCLAW_AUTH_TOKEN', 'OPENCLAW_BASE_URL']),
    settingsPath: null,
    configurePath: '/openclaw',
    feature: 'openclaw',
  }),
  Object.freeze({
    id: 'cursor',
    label: 'Cursor',
    unlocks: 'cursor-agent CLI coding agents.',
    tier: 'metered',
    getUrl: 'https://cursor.com/dashboard',
    envVars: Object.freeze(['CURSOR_API_KEY']),
    settingsPath: null,
    configurePath: '/ai',
  }),
  Object.freeze({
    id: 'kimi',
    label: 'Kimi / Moonshot',
    unlocks: 'Kimi Code CLI/TUI coding agents.',
    tier: 'metered',
    getUrl: 'https://platform.moonshot.ai/console/api-keys',
    envVars: Object.freeze(['KIMI_API_KEY', 'MOONSHOT_API_KEY']),
    settingsPath: null,
    configurePath: '/ai',
  }),
  Object.freeze({
    id: 'eidoverse-visitor-token',
    privateStore: true,
    label: 'Eidoverse Visitor Bridge',
    unlocks: 'The managed-visitor broker\'s shared host credential, letting an app the owner explicitly provisions (e.g. Fly Garden) admit a paused body into an allowlisted Eidoverse world.',
    tier: 'none',
    getUrl: null,
    envVars: Object.freeze(['PORTOS_EIDOVERSE_VISITOR_TOKEN']),
    settingsPath: 'secrets.eidoverse.visitorToken',
    configurePath: '/settings/credentials',
    feature: 'eidoverse',
  }),
]);

export const CREDENTIAL_IDS = Object.freeze(CREDENTIALS.map((credential) => credential.id));