{"version":3,"file":"settings.fixture.mjs","names":[],"sources":["../../../../src/web/features/settings/settings.fixture.ts"],"sourcesContent":["import type { SettingsSectionContribution } from '@agimon-ai/po-core/web';\n\nimport type { ProviderAuthSummary } from '../../../types/auth.ts';\nimport type {\n  RepositorySettingsView,\n  SettingsConfigView,\n  SettingsPresetsView,\n  SettingsRepository,\n} from '../../../types/settings.ts';\nimport { mockStoryRequests, seedStorySession, STORY_WORKSPACE_ID } from '../../components/Story.fixture.tsx';\nimport { seedTemplateStory, templateConfig } from '../../components/Template.fixture.tsx';\n\nexport const repository: SettingsRepository = {\n  id: STORY_WORKSPACE_ID,\n  name: 'po',\n  path: '/workspace/po',\n  active: true,\n};\n\nexport const section: SettingsSectionContribution = {\n  id: 'story-settings',\n  label: 'Agent defaults',\n  detail: 'Review editable, inherited, and read-only values before saving.',\n  fields: [\n    {\n      id: 'name',\n      label: 'Session name',\n      kind: 'text',\n      keyPath: ['review', 'name'],\n      detail: 'A descriptive name for a new review.',\n    },\n    { id: 'limit', label: 'Iteration limit', kind: 'number', keyPath: ['review', 'limit'] },\n    { id: 'enabled', label: 'Enable review', kind: 'toggle', keyPath: ['review', 'enabled'] },\n    {\n      id: 'model',\n      label: 'Model',\n      kind: 'select',\n      keyPath: ['review', 'model'],\n      options: [\n        { value: 'local', label: 'Local model' },\n        { value: 'remote', label: 'Remote model' },\n      ],\n    },\n    { id: 'source', label: 'Configuration source', kind: 'info', keyPath: ['review', 'source'] },\n  ],\n};\n\nexport const config: SettingsConfigView = {\n  ...templateConfig,\n  values: {\n    ...templateConfig.values,\n    'review.name': { value: 'Component review', origin: 'host', scope: 'both' },\n    'review.limit': { value: '5', origin: 'default', scope: 'both' },\n    'review.enabled': { value: 'true', origin: 'host', scope: 'both' },\n    'review.model': { value: 'local', origin: 'repository', scope: 'both' },\n    'review.source': { value: 'Machine configuration', origin: 'host', scope: 'host' },\n  },\n};\n\nexport const repositorySettings: RepositorySettingsView = {\n  repository,\n  hash: 'story-repository',\n  catalogs: {\n    presets: [\n      { name: 'copilot', description: 'Interactive development' },\n      { name: 'review', description: 'Source review' },\n    ],\n    domains: [{ name: 'development' }, { name: 'testing' }],\n    profiles: [{ name: 'ponytail' }, { name: 'reviewer' }],\n  },\n  selection: {\n    preset: { effective: 'copilot', origin: 'host' },\n    domains: { effective: ['development', 'testing'], repository: ['development', 'testing'], origin: 'repository' },\n    profile: { effective: 'ponytail', origin: 'default' },\n  },\n};\n\nconst apiKey = { type: 'api_key', label: 'API key' } as const;\nconst oauth = { type: 'oauth', label: 'Browser sign-in' } as const;\n\n/** A slice of Pi's real catalog: one stored sign-in, one environment key, and the long tail. */\nexport const providers: ProviderAuthSummary[] = [\n  { id: 'openai-codex', name: 'OpenAI Codex', methods: [oauth], authenticated: { type: 'oauth', source: 'stored' } },\n  {\n    id: 'anthropic',\n    name: 'Anthropic',\n    methods: [oauth, apiKey],\n    authenticated: { type: 'api_key', source: 'ANTHROPIC_API_KEY' },\n  },\n  { id: 'amazon-bedrock', name: 'Amazon Bedrock', methods: [apiKey] },\n  { id: 'ant-ling', name: 'Ant Ling', methods: [apiKey] },\n  { id: 'azure-openai-responses', name: 'Azure OpenAI', methods: [apiKey] },\n  { id: 'baseten', name: 'Baseten', methods: [apiKey] },\n  { id: 'cerebras', name: 'Cerebras', methods: [apiKey] },\n  { id: 'cloudflare-ai-gateway', name: 'Cloudflare AI Gateway', methods: [apiKey] },\n  { id: 'deepseek', name: 'DeepSeek', methods: [apiKey] },\n  { id: 'github-copilot', name: 'GitHub Copilot', methods: [oauth] },\n  { id: 'google', name: 'Google Gemini', methods: [oauth, apiKey] },\n  { id: 'google-vertex', name: 'Google Vertex AI', methods: [] },\n  { id: 'groq', name: 'Groq', methods: [apiKey] },\n  { id: 'mistral', name: 'Mistral', methods: [apiKey] },\n  { id: 'openrouter', name: 'OpenRouter', methods: [apiKey] },\n];\n\n/** Mirrors .po/presets.yaml in this repository, trimmed. */\nexport const presetsView: SettingsPresetsView = {\n  defaultPreset: 'copilot',\n  presets: [\n    {\n      name: 'copilot',\n      description:\n        'General-purpose coding with delegation, persistent tasks, supervised commands, and structured feedback.',\n      layers: [\n        { name: 'team', packages: ['po-team'] },\n        { name: 'task', packages: ['po-task'] },\n        { name: 'source-control', packages: ['po-git'] },\n        { name: 'browser', packages: ['po-browse'] },\n      ],\n    },\n    {\n      name: 'minimal',\n      description: 'Lean preset with Team delegation and persistent tasks.',\n      layers: [\n        { name: 'team', packages: ['po-team'] },\n        { name: 'task', packages: ['po-task'] },\n      ],\n    },\n    { name: 'examples', description: 'Layer-free base for the plugin and workflow examples.', layers: [] },\n  ],\n  alwaysIncluded: ['po-codemode', 'po-help', 'po-runner', 'po-read', 'po-edit', 'po-log', 'po-mcp'],\n  hash: 'story-modes-hash',\n};\nexport function seedSettingsStory(responses: Readonly<Record<string, unknown>> = {}): void {\n  seedStorySession();\n  seedTemplateStory();\n  mockStoryRequests({\n    'GET /api/settings': config,\n    [`GET /api/workspaces/${STORY_WORKSPACE_ID}/settings`]: config,\n    'GET /api/settings/repositories': { repositories: [repository] },\n    [`GET /api/workspaces/${STORY_WORKSPACE_ID}/settings/repository`]: repositorySettings,\n    'GET /api/settings/images': { autoResize: true, maxDimension: 1568, minDimension: 256, maxAllowedDimension: 2048 },\n    'GET /api/settings/presets': presetsView,\n    'GET /api/plugins/po/providers': { providers },\n    ...responses,\n  });\n}\n\n/** A voice-shaped grouped section: radio cards, a sign-in row, and titled groups. */\nexport const groupedSection: SettingsSectionContribution = {\n  id: 'voice',\n  label: 'voice',\n  detail: 'Talk with Po in two ways. Pick what new sessions start with; switch from the Voice panel while voice runs.',\n  groups: [\n    { id: 'start', label: 'New sessions start with', detail: 'Press v e in a session to start voice.' },\n    {\n      id: 'live',\n      label: 'Live conversation',\n      detail: 'Live handles the talking. Po still does the work in your session.',\n      signInProvider: 'po-chatgpt',\n    },\n    {\n      id: 'daily',\n      label: 'Daily work',\n      detail: 'Listens with a transcriber on this computer. Dictation from the composer uses the same transcriber.',\n    },\n    { id: 'narration', label: 'Narration', detail: 'How daily work corrects what it heard and speaks back.' },\n  ],\n  fields: [\n    {\n      id: 'mode',\n      label: 'New sessions start with',\n      kind: 'select',\n      keyPath: ['voice', 'mode'],\n      group: 'start',\n      presentation: 'cards',\n      defaultValue: 'legacy',\n      options: [\n        {\n          value: 'live',\n          label: 'Live conversation',\n          detail: 'Experimental. Back-and-forth talk that answers as you speak. Best for thinking out loud with Po.',\n        },\n        {\n          value: 'legacy',\n          label: 'Daily work',\n          detail: 'Say a request, Po transcribes it on this computer and narrates as it works. Best while Po is busy.',\n        },\n      ],\n    },\n    {\n      id: 'live-voice',\n      label: 'Voice',\n      kind: 'select',\n      keyPath: ['voice', 'live', 'voice'],\n      group: 'live',\n      placeholder: 'Default (cove)',\n      options: ['cove', 'juniper', 'maple'].map((value) => ({ value, label: value })),\n    },\n    {\n      id: 'live-model',\n      label: 'Model',\n      kind: 'text',\n      keyPath: ['voice', 'live', 'model'],\n      group: 'live',\n      placeholder: 'gpt-live-1-codex',\n    },\n    {\n      id: 'engine',\n      label: 'Transcriber',\n      kind: 'select',\n      keyPath: ['voice', 'engine'],\n      group: 'daily',\n      detail: 'Auto uses the first one it finds.',\n      options: ['auto', 'whisper-cpp', 'openai-whisper', 'mlx-whisper'].map((value) => ({ value, label: value })),\n    },\n    {\n      id: 'language',\n      label: 'Language',\n      kind: 'text',\n      keyPath: ['voice', 'language'],\n      group: 'daily',\n      placeholder: 'en',\n    },\n    {\n      id: 'narration-voice',\n      label: 'Narration voice',\n      kind: 'text',\n      keyPath: ['voice', 'autoCapture', 'tts', 'voice'],\n      group: 'narration',\n    },\n  ],\n};\n\nexport const groupedConfig: SettingsConfigView = {\n  ...templateConfig,\n  values: {\n    ...templateConfig.values,\n    'voice.mode': { origin: 'default', scope: 'host' },\n    'voice.live.voice': { origin: 'default', scope: 'host' },\n    'voice.live.model': { origin: 'default', scope: 'host' },\n    'voice.engine': { value: 'auto', origin: 'host', scope: 'both' },\n    'voice.language': { origin: 'default', scope: 'both' },\n    'voice.autoCapture.tts.voice': { origin: 'default', scope: 'both' },\n  },\n};\n\nexport const poSignIn: ProviderAuthSummary = {\n  id: 'po-chatgpt',\n  name: 'ChatGPT for Po features',\n  methods: [oauth],\n  kind: 'po-feature',\n};\n"],"mappings":";;;AAYA,MAAa,aAAiC;CAC5C,IAAI;CACJ,MAAM;CACN,MAAM;CACN,QAAQ;AACV;AA8BA,MAAa,SAA6B;CACxC,GAAG;CACH,QAAQ;EACN,GAAG,eAAe;EAClB,eAAe;GAAE,OAAO;GAAoB,QAAQ;GAAQ,OAAO;EAAO;EAC1E,gBAAgB;GAAE,OAAO;GAAK,QAAQ;GAAW,OAAO;EAAO;EAC/D,kBAAkB;GAAE,OAAO;GAAQ,QAAQ;GAAQ,OAAO;EAAO;EACjE,gBAAgB;GAAE,OAAO;GAAS,QAAQ;GAAc,OAAO;EAAO;EACtE,iBAAiB;GAAE,OAAO;GAAyB,QAAQ;GAAQ,OAAO;EAAO;CACnF;AACF;AAEA,MAAa,qBAA6C;CACxD;CACA,MAAM;CACN,UAAU;EACR,SAAS,CACP;GAAE,MAAM;GAAW,aAAa;EAA0B,GAC1D;GAAE,MAAM;GAAU,aAAa;EAAgB,CACjD;EACA,SAAS,CAAC,EAAE,MAAM,cAAc,GAAG,EAAE,MAAM,UAAU,CAAC;EACtD,UAAU,CAAC,EAAE,MAAM,WAAW,GAAG,EAAE,MAAM,WAAW,CAAC;CACvD;CACA,WAAW;EACT,QAAQ;GAAE,WAAW;GAAW,QAAQ;EAAO;EAC/C,SAAS;GAAE,WAAW,CAAC,eAAe,SAAS;GAAG,YAAY,CAAC,eAAe,SAAS;GAAG,QAAQ;EAAa;EAC/G,SAAS;GAAE,WAAW;GAAY,QAAQ;EAAU;CACtD;AACF;AAEA,MAAM,SAAS;CAAE,MAAM;CAAW,OAAO;AAAU;AACnD,MAAM,QAAQ;CAAE,MAAM;CAAS,OAAO;AAAkB;;AAGxD,MAAa,YAAmC;CAC9C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