@dendelion/paper-camp 0.16.0 → 0.17.1
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/dist/app/assets/index-BXRfFWnQ.js +4 -0
- package/dist/app/assets/index-BXRfFWnQ.js.map +1 -0
- package/dist/app/assets/index-BrriNOla.js +2 -0
- package/dist/app/assets/{index-Bz4Df_iX.js.map → index-BrriNOla.js.map} +1 -1
- package/dist/app/assets/{index-Cm3hzD0z.js → index-C4T8Gzjs.js} +2 -2
- package/dist/app/assets/{index-Cm3hzD0z.js.map → index-C4T8Gzjs.js.map} +1 -1
- package/dist/app/assets/{index-BiDION9V.js → index-CSl9MOCi.js} +3 -3
- package/dist/app/assets/{index-BiDION9V.js.map → index-CSl9MOCi.js.map} +1 -1
- package/dist/app/assets/{index-CGtPCj1V.js → index-D0gBw6x1.js} +3 -3
- package/dist/app/assets/{index-CGtPCj1V.js.map → index-D0gBw6x1.js.map} +1 -1
- package/dist/app/assets/index-DJwR0UyW.js +2 -0
- package/dist/app/assets/index-DJwR0UyW.js.map +1 -0
- package/dist/app/assets/index-_tpcAf-k.js +2 -0
- package/dist/app/assets/index-_tpcAf-k.js.map +1 -0
- package/dist/app/assets/main-Ll-lvqgh.css +1 -0
- package/dist/app/assets/main-Zb7gEID9.js +207 -0
- package/dist/app/assets/main-Zb7gEID9.js.map +1 -0
- package/dist/app/assets/{sidebar-section-B3aJWLXB.js → sidebar-section-DxUjM4Rm.js} +2 -2
- package/dist/app/assets/{sidebar-section-B3aJWLXB.js.map → sidebar-section-DxUjM4Rm.js.map} +1 -1
- package/dist/app/index.html +2 -2
- package/dist/app/toolbar.js +4050 -4100
- package/dist/app/toolbar.js.map +1 -1
- package/dist/chunks/{parked-questions.DZYZgrSZ.js → phase-progress.DsBJvd_o.js} +1224 -1095
- package/dist/chunks/phase-progress.DsBJvd_o.js.map +1 -0
- package/dist/cli/index.js +7783 -7627
- package/dist/cli/index.js.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +98 -91
- package/dist/core/phase-progress.d.ts +16 -0
- package/dist/core/phase-progress.d.ts.map +1 -0
- package/dist/core/phase-progress.test.d.ts +2 -0
- package/dist/core/phase-progress.test.d.ts.map +1 -0
- package/dist/core/phase-run.d.ts +17 -0
- package/dist/core/phase-run.d.ts.map +1 -0
- package/dist/core/phase-run.test.d.ts +2 -0
- package/dist/core/phase-run.test.d.ts.map +1 -0
- package/dist/core/rate-limit.d.ts +4 -0
- package/dist/core/rate-limit.d.ts.map +1 -0
- package/dist/core/rate-limit.test.d.ts +2 -0
- package/dist/core/rate-limit.test.d.ts.map +1 -0
- package/dist/core/sections.d.ts.map +1 -1
- package/dist/core/stats.d.ts +5 -1
- package/dist/core/stats.d.ts.map +1 -1
- package/dist/types/index.d.ts +59 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/app/assets/index-0BzPyUVh.js +0 -2
- package/dist/app/assets/index-0BzPyUVh.js.map +0 -1
- package/dist/app/assets/index-Bz4Df_iX.js +0 -2
- package/dist/app/assets/index-C6vBW0wx.js +0 -4
- package/dist/app/assets/index-C6vBW0wx.js.map +0 -1
- package/dist/app/assets/index-Dtdlcmro.js +0 -2
- package/dist/app/assets/index-Dtdlcmro.js.map +0 -1
- package/dist/app/assets/main-Ba3mXsWY.js +0 -207
- package/dist/app/assets/main-Ba3mXsWY.js.map +0 -1
- package/dist/app/assets/main-CIoBIAYG.css +0 -1
- package/dist/chunks/parked-questions.DZYZgrSZ.js.map +0 -1
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/types/index.ts"],"sourcesContent":["export type PlanStatus = 'idea' | 'planned' | 'in-progress' | 'review' | 'done' | 'dropped';\n\nexport const PLAN_STATUSES: PlanStatus[] = [\n 'idea',\n 'planned',\n 'in-progress',\n 'review',\n 'done',\n 'dropped',\n];\n\nexport interface LogEntry {\n date: string;\n text: string;\n}\n\nexport type PlanKind = 'feat' | 'fix' | 'chore' | 'docs' | 'refactor';\n\nexport const PLAN_KINDS: PlanKind[] = ['feat', 'fix', 'chore', 'docs', 'refactor'];\n\nexport const AGENT_IDS = ['claude-code', 'opencode'] as const;\n\nexport type AgentId = (typeof AGENT_IDS)[number];\n\nexport const AGENT_LABELS: Record<AgentId, string> = {\n 'claude-code': 'Claude Code',\n opencode: 'OpenCode',\n};\n\nexport interface PhaseItem {\n done: boolean;\n text: string;\n description?: string;\n source?: 'review';\n}\n\n/** A body section anchor is `body` for now — the whole prose block is the only\n * body section a plan/entity has until later phases break it into sub-sections. */\nexport type MarginNoteAnchor = { kind: 'phase'; index: number } | { kind: 'body' };\n\nexport type MarginNoteState = 'open' | 'resolved';\n\nexport type MarginNoteKind = 'note' | 'decision' | 'question';\n\nexport interface MarginNote {\n anchor: MarginNoteAnchor;\n prose: string;\n state: MarginNoteState;\n kind?: MarginNoteKind;\n}\n\n/** What a thread message originally was, before log/review/notes/clarifications folded\n * into one ordered thread on the entity — 'note'/'decision'/'question' carry `state`,\n * the rest are plain historical records. 'chat' is thread-native (no legacy section):\n * Paper Scout conversation, collapsed by default in thread views. */\nexport type ThreadMessageKind =\n | 'log'\n | 'clarification'\n | 'review'\n | 'note'\n | 'decision'\n | 'question'\n | 'chat';\n\nexport interface ThreadMessage {\n kind: ThreadMessageKind;\n /** Absent for messages ported from the old Notes section, which never carried a date. */\n date?: string;\n text: string;\n /** Only meaningful for note/decision/question kinds. */\n state?: MarginNoteState;\n /** Absent means 'user' — no thread message predates this field being agent-authored. */\n from?: 'user' | 'agent';\n}\n\n/** Ambient context a chat mount (desk, toolbar) feeds alongside a message — each\n * mount populates whatever it has (IDEA-130); Scout folds it into the prompt\n * silently, it never becomes a user-visible field. */\nexport interface MountContext {\n route?: string;\n focusedIdeaId?: string;\n viewport?: { width: number; height: number };\n}\n\nexport interface RawEntry {\n title: string;\n fields: Record<string, string>;\n body: string;\n phases: PhaseItem[];\n log?: LogEntry[];\n clarifications?: LogEntry[];\n notes?: MarginNote[];\n review?: LogEntry[];\n}\n\nexport interface ParseWarning {\n title: string;\n message: string;\n}\n\nexport interface ParseResult<T> {\n entries: T[];\n warnings: ParseWarning[];\n}\n\n/** A PR's reviewable/mergeable state, as surfaced by `gh pr list`. */\nexport type PrState = 'draft' | 'open' | 'closed' | 'merged';\n\n/** GitHub's PR review decision, as surfaced by `gh pr list --json reviewDecision`. */\nexport type ReviewDecision = 'approved' | 'changes-requested' | 'review-required';\n\n// Per-comment detail; PrInfo.unresolvedThreadCount only counts these.\nexport interface ReviewThread {\n /** GraphQL node id — what `resolveReviewThread`/`replyToReviewThread` address. */\n id: string;\n /** File path the comment is anchored to; absent for a PR-level (not diff-anchored) comment. */\n path?: string;\n line?: number;\n author?: string;\n body: string;\n}\n\n// Parsed from the JSON object a fix-review agent's prompt requires as its final line.\nexport interface FixReviewResult {\n commit: { title: string; message: string };\n addressed: string[];\n skipped: { threadId: string; why: string }[];\n}\n\nexport interface FeedbackPhaseEdit {\n op: 'add' | 'reword';\n /** 1-based position in the plan's current phase list; required for \"reword\", ignored for \"add\". */\n index?: number;\n text: string;\n description?: string;\n}\n\nexport interface FeedbackEdit {\n phases?: FeedbackPhaseEdit[];\n /** The complete replacement body, when the message corrects body prose. */\n body?: string;\n}\n\n// Parsed from the JSON object a feedback-reply agent's prompt requires as its\n// final line. The chat never creates ideas — a request is either a reply or an\n// edit on the current plan.\nexport interface FeedbackReplyResult {\n reply: string;\n edit?: FeedbackEdit;\n /** True when the user's message answers an open question the agent asked\n * earlier in this thread — the route persists that message as a clarification. */\n answersQuestion?: boolean;\n}\n\n/** Live-resolved PR info for an entity's branch — see `core/pr.ts`. */\nexport interface PrInfo {\n number: number;\n url: string;\n state: PrState;\n /** Undefined when no review has been requested/decided, or when unresolved (offline, closed/merged PR). */\n reviewDecision?: ReviewDecision;\n /** Count of unresolved review threads. Only fetched for open/draft PRs; undefined when not fetched or unresolved. */\n unresolvedThreadCount?: number;\n /** Whether a comment or review landed after the PR's last commit — a proxy for \"since the last agent pass\" (a pass ends with a push). Only fetched for open/draft PRs. */\n hasNewCommentsSincePush?: boolean;\n}\n\nexport interface PlanEntry {\n title: string;\n status: PlanStatus;\n kind?: PlanKind;\n id?: string;\n idea?: string;\n agent?: AgentId;\n created: string;\n updated?: string;\n audited?: string;\n auditedHash?: string;\n /** Version tag (e.g. v0.13.1) that first shipped this idea, stamped from the release train. */\n released?: string;\n tags: string[];\n /** Absent renders under the virtual \"No subject\" group. */\n subject?: string;\n /** Absent means unordered — sorts after all ordered entries, by created date. */\n order?: number;\n body: string;\n phases: PhaseItem[];\n /** Post-build findings, same checkbox grammar as `phases` — see EntityEntry.fixes. */\n fixes?: PhaseItem[];\n log?: LogEntry[];\n clarifications?: LogEntry[];\n notes?: MarginNote[];\n /** Prose written against the whole finished plan, distinct from the flat `log` — an\n * agent later splits each entry into rework phases or a follow-up idea. */\n review?: LogEntry[];\n /** The entity's single ordered feedback thread — see EntityEntry.thread. */\n thread?: ThreadMessage[];\n /** Set by readEntities from which dir the file came from — see EntityEntry.archived. */\n archived?: boolean;\n pr?: PrInfo;\n}\n\nexport interface ArchivableIdea {\n id: string;\n title: string;\n pr: PrInfo;\n}\n\n/** One open `question` thread message, resolved to the idea it's parked on. `ageDays`\n * is `Infinity` for a question ported from the pre-Thread Notes section, which never\n * carried a date — the oldest kind of unresolved question there is. */\nexport interface ParkedQuestion {\n entityId: string;\n entityTitle: string;\n text: string;\n date?: string;\n ageDays: number;\n}\n\nexport type ConsistencyIssueKind = 'orphan-subject' | 'title-style';\n\nexport interface ConsistencyIssue {\n kind: ConsistencyIssueKind;\n section: 'plans';\n title: string;\n message: string;\n planId?: string;\n}\n\nexport interface CommentStats {\n commentLines: number;\n sourceLines: number;\n ratio: number;\n}\n\nexport interface TasksPerWeek {\n /** ISO week, e.g. \"2026-W05\". */\n week: string;\n count: number;\n}\n\nexport interface ProjectStats {\n generatedAt: string;\n comments: CommentStats;\n testLines: number;\n /** Null when no coverage report has been emitted yet (run `pnpm test`). */\n testCoveragePct: number | null;\n entitiesByStatus: Partial<Record<EntityStatus, number>>;\n openQuestions: number;\n decisions: number;\n tasksPerWeek: TasksPerWeek[];\n}\n\nexport type IdeaKind = 'idea' | 'note';\n\nexport type IdeaStatus = 'open' | 'done' | 'dropped';\n\nexport interface IdeaEntry {\n id: string | null;\n title: string;\n body: string;\n kind?: IdeaKind;\n status?: IdeaStatus;\n /** Absent renders under the virtual \"No subject\" group. */\n subject?: string;\n /** Absent means unordered — sorts after all ordered entries, by created date. */\n order?: number;\n /** Fallback sort key for unordered entries — see `order`. Absent on view-model-only IdeaEntry literals that never enter the worklist sort. */\n created?: string;\n log?: LogEntry[];\n}\n\n// Unified entity — one file per entity, plan as an optional Phases section.\n// Supersedes PlanEntry/IdeaEntry once the migration cutover lands.\n\n/** Work classification — same Conventional-Commits values as PlanKind; `kind` renamed to `type` in the unified schema. */\nexport type EntityType = PlanKind;\n\n/** Plan lifecycle plus the note-only `open`. Notes use open → done/dropped; everything else uses the PlanStatus track. */\nexport type EntityStatus = PlanStatus | 'open';\n\nexport interface EntityEntry {\n id: string;\n title: string;\n /** Absent until the entity is classified (usually when its plan is drafted). */\n type?: EntityType;\n /** \"note\" marks an entity that never grows phases. */\n kind?: 'note';\n /** Stored override, not the source of truth — see entityFrontmatterSchema. */\n status?: EntityStatus;\n agent?: AgentId;\n created: string;\n updated?: string;\n audited?: string;\n auditedHash?: string;\n /** Version tag (e.g. v0.13.1) that first shipped this idea, stamped from the release train. */\n released?: string;\n tags: string[];\n /** Absent renders as the virtual \"No subject\" group. */\n subject?: string;\n /** Absent means unordered — sorts after all ordered entries, by created date. */\n order?: number;\n body: string;\n phases: PhaseItem[];\n /** Post-build findings, same checkbox grammar as `phases` — appended below Phases\n * rather than rewriting the plan's already-finished phase history. */\n fixes?: PhaseItem[];\n /** The entity's single ordered feedback thread — folds what used to be separate\n * log/clarifications/notes/review sections. */\n thread?: ThreadMessage[];\n /** Set by readEntities from which of the two scanned dirs the file came from, not the frontmatter. */\n archived?: boolean;\n}\n\n// No `id`/`status`: it only becomes a real idea if a human promotes it.\nexport interface SuggestionEntry {\n date: string;\n title: string;\n description: string;\n}\n\nexport interface RoadmapItem {\n name: string;\n description: string;\n candidates: string[];\n linked: string[];\n}\n\nexport interface RoadmapHorizon {\n title: string;\n items: RoadmapItem[];\n}\n\nexport interface Roadmap {\n goal: string;\n horizons: RoadmapHorizon[];\n standingConcerns: RoadmapItem[];\n}\n\nexport interface RoadmapLink {\n id: string;\n status: PlanStatus;\n taskRuns: number;\n pr?: PrInfo;\n released: boolean;\n}\n\nexport interface RoadmapRollup {\n total: number;\n done: number;\n}\n\nexport interface ResolvedRoadmapItem extends RoadmapItem {\n links: RoadmapLink[];\n rollup: RoadmapRollup;\n}\n\nexport interface ResolvedRoadmapHorizon {\n title: string;\n items: ResolvedRoadmapItem[];\n rollup: RoadmapRollup;\n}\n\nexport interface ResolvedRoadmap {\n goal: string;\n horizons: ResolvedRoadmapHorizon[];\n events: RoadmapEvent[];\n}\n\nexport type RoadmapEventKind = 'created' | 'task-run';\n\nexport interface RoadmapEvent {\n date: string;\n kind: RoadmapEventKind;\n entityId: string;\n horizonTitle: string;\n itemName: string;\n label: string;\n}\n\nexport interface EnvEntry {\n key: string;\n value: string;\n /** Set on GET responses when the value is withheld — secrets never reach the client. */\n isSet?: boolean;\n}\n\nexport interface AgentConfig {\n agent: AgentId;\n model?: string;\n effort?: string;\n}\n\n/** Model/effort passed to an adapter's buildArgs — the AgentConfig minus the agent id. */\nexport interface AgentRunOptions {\n model?: string;\n effort?: string;\n /** Prior claude-code session id to continue instead of starting cold; ignored by opencode. */\n resume?: string;\n}\n\n/** Maps option names to a fixed value list (renders a Select) or null (free-text or hidden). */\nexport type AgentOptionsDescriptor = Record<string, string[] | null | undefined>;\n\nexport const AGENT_OPTIONS: Record<AgentId, AgentOptionsDescriptor> = {\n 'claude-code': {\n model: ['opus', 'sonnet', 'fable', 'haiku'],\n effort: ['low', 'medium', 'high', 'xhigh', 'max'],\n },\n opencode: {\n model: null,\n },\n};\n\nexport function coerceAgentConfig(v: unknown): AgentConfig {\n const toAgent = (a: unknown): AgentId =>\n AGENT_IDS.includes(a as AgentId) ? (a as AgentId) : 'claude-code';\n if (typeof v === 'string') return { agent: toAgent(v) };\n // A missing key must not throw — that would 500 the /api/config read this protects.\n const obj = (v ?? {}) as Record<string, unknown>;\n return {\n agent: toAgent(obj.agent),\n ...(typeof obj.model === 'string' && { model: obj.model }),\n ...(typeof obj.effort === 'string' && { effort: obj.effort }),\n };\n}\n\nexport interface DefaultAgentsMap {\n phase: AgentConfig;\n planDraft: AgentConfig;\n ideaExtend: AgentConfig;\n commitSuggest: AgentConfig;\n feedback: AgentConfig;\n}\n\nexport const DEFAULT_AGENTS: DefaultAgentsMap = {\n phase: { agent: 'opencode' },\n planDraft: { agent: 'claude-code' },\n ideaExtend: { agent: 'claude-code' },\n commitSuggest: { agent: 'claude-code' },\n feedback: { agent: 'claude-code', model: 'sonnet', effort: 'medium' },\n};\n\n/** Toolbar segments, left to right (IDEA-128/IDEA-133); trimmed per project via `IntegrationConfig.toolbar.segments`. */\nexport const TOOLBAR_SEGMENT_IDS = ['focus', 'scout', 'desk'] as const;\n\nexport type ToolbarSegmentId = (typeof TOOLBAR_SEGMENT_IDS)[number];\n\nexport interface IntegrationToolbarConfig {\n enabled?: boolean;\n segments?: ToolbarSegmentId[];\n /** Opt-in escape hatch: without it, the vite plugin stays off when `mode` is `production`. */\n allowProduction?: boolean;\n}\n\nexport interface IntegrationConfig {\n toolbar?: IntegrationToolbarConfig;\n route?: string;\n}\n\nexport interface PaperCampConfig {\n version: string;\n projectName: string;\n initializedAt: string;\n /** The unified-entity `idea` counter; the per-kind plan counters are legacy, present only in pre-migration configs. */\n nextId?: Partial<Record<PlanKind, number>> & { idea?: number };\n port?: number;\n defaultAgents?: DefaultAgentsMap;\n /** Derived from `ROADMAP.md` on every read (IDEA-95), never written to disk; an idea's\n * `subject` not present here renders as \"No subject\". */\n subjects?: string[];\n /** Opts out of the first-run redirect to Settings > Setup while capabilities are incomplete. */\n setupDismissed?: boolean;\n /** In-app dev toolbar (IDEA-128) — the `@dendelion/paper-camp/vite` plugin's mount, toggleable for frontend targets. */\n integration?: IntegrationConfig;\n}\n\nexport type CheckStatus = 'stale' | 'running' | 'pass' | 'fail';\n\nexport interface CheckResult {\n status: CheckStatus;\n lastRun: string | null;\n output: string;\n}\n\nexport type CheckName = 'lint' | 'format' | 'test' | 'consistency';\n\nexport type CapabilityStatus = 'ok' | 'warn' | 'missing';\n\nexport interface CapabilityResult {\n id: string;\n status: CapabilityStatus;\n detail: string;\n}\n\nexport interface AgentAuthStatus {\n loggedIn: boolean | null;\n authMethod: string | null;\n apiProvider: string | null;\n}\n\nexport type LoginRelayPhase =\n | 'starting'\n | 'awaiting-authorization'\n | 'success'\n | 'error'\n | 'cancelled';\n\nexport interface LoginRelayState {\n phase: LoginRelayPhase;\n authorizeUrl: string | null;\n error?: string;\n}\n\nexport type ServiceId = 'git' | 'gh' | `agent:${AgentId}`;\n\n/** What a Connections row offers once its service isn't `ok` — copy a command, follow a link, or read plain instructions. */\nexport type ConnectAction =\n /** `runnable` marks a command with no placeholders and no interactive prompts — safe for the server to execute directly instead of just displaying it. */\n | { kind: 'command'; command: string; runnable?: boolean }\n | { kind: 'link'; url: string; label: string }\n | { kind: 'text'; message: string };\n\nexport interface ConnectionResult {\n id: ServiceId;\n label: string;\n unlocks: string;\n status: CapabilityStatus;\n detail: string;\n authenticated: boolean | null;\n connect: ConnectAction | null;\n}\n\nexport interface MergePolicy {\n allowSquashMerge: boolean;\n allowMergeCommit: boolean;\n allowRebaseMerge: boolean;\n squashMergeCommitTitle: string;\n squashMergeCommitMessage: string;\n}\n\nexport type MergePolicyResult =\n | { status: 'ok'; repo: string; policy: MergePolicy }\n | { status: 'unavailable'; reason: string };\n\nexport interface GitStatusEntry {\n path: string;\n status: string;\n staged: boolean;\n renameSource?: string;\n}\n\nexport interface GitStatusResponse {\n branch: string;\n entries: GitStatusEntry[];\n ahead: number;\n behind: number;\n diverged: boolean;\n branchHygiene: BranchHygieneStatus;\n}\n\nexport interface FileDiffEntry {\n path: string;\n renameSource?: string;\n staged: boolean;\n binary: boolean;\n additions: number;\n deletions: number;\n // 'diff' is a unified patch (tracked files); 'raw' is untracked file content, not a\n // patch; 'too-large' means `patch` is empty and the file was skipped.\n contentKind: 'diff' | 'raw' | 'too-large';\n patch: string;\n}\n\nexport type BranchHygieneStatus =\n | 'clean-on-main'\n | 'stale-merged'\n | 'stale-no-upstream'\n | 'dirty'\n | 'fine';\n\nexport interface GitLiveState {\n branch: string;\n ahead: number;\n behind: number;\n dirtyCount: number;\n}\n\nexport interface GitSyncFailure {\n ok: false;\n stage: 'reconcile' | 'stash-pop' | 'conflicted';\n message: string;\n stashPending: boolean;\n // Only set when stage is 'conflicted': the files a rebase left with unresolved\n // markers, for a one-click \"ask the agent to resolve\" rather than a bare error.\n conflictedFiles?: string[];\n // Only set when stage is 'conflicted': the ref the rebase targeted, and each\n // conflicted file's last-seen content (with markers) before the rebase was\n // aborted for safety — the resolve-conflict agent's raw material.\n conflictRef?: string;\n conflictedContent?: { path: string; content: string }[];\n // Prompt for the agent recovery job (see git-sync-recovery.ts) — the deterministic\n // path's failure, the working-tree state, and the goal, packaged for a future\n // launch rather than thrown at the user.\n recoveryPrompt: string;\n // Only set when stage is 'conflicted': a prompt scoped to landing this one rebase\n // (see resolve-conflict-prompt.ts) — launched only on explicit \"ask the agent to\n // resolve\" confirmation from the sync-failed toast, never automatically.\n conflictPrompt?: string;\n}\n\nexport type GitSyncResult = { ok: true } | GitSyncFailure;\n\nexport type AgentTaskStatus = 'starting' | 'running' | 'stopping' | 'done' | 'error' | 'superseded';\n\nexport type TaskKind =\n | 'phase'\n | 'audit'\n | 'batch-reconcile'\n | 'run-all'\n | 'draft'\n | 'extend'\n | 'suggest'\n | 'commit-suggest'\n | 'overlap-check'\n | 'prioritise'\n | 'sync'\n | 'reconcile'\n | 'fix-review'\n | 'resolve-conflict'\n | 'feedback';\n\n// Persisted to papercamp/tasks.log (JSON Lines) — survives a dev-server restart,\n// unlike the in-memory task registry.\nexport interface TaskLogEntry {\n id: string;\n taskKind: TaskKind;\n planId?: string;\n planTitle: string;\n agentId: AgentId;\n startedAt: string;\n endedAt: string;\n outcome: 'done' | 'error' | 'superseded';\n reason?: string;\n}\n\nexport interface TrailHop<T> {\n reached: boolean;\n data?: T;\n}\n\nexport interface ProvenanceTrail {\n id: string;\n idea: TrailHop<{ title: string; status?: EntityStatus; type?: EntityType }>;\n phases: TrailHop<PhaseItem[]>;\n taskRuns: TrailHop<TaskLogEntry[]>;\n commits: TrailHop<string[]>;\n pr: TrailHop<PrInfo>;\n releaseLine: TrailHop<string>;\n}\n\nexport interface ReleaseNoteIdea {\n id: string;\n title: string;\n}\n\nexport interface ReleaseNoteSection {\n label: string;\n ideas: ReleaseNoteIdea[];\n}\n\nexport interface AgentTaskState {\n id: string;\n status: AgentTaskStatus;\n taskKind: TaskKind;\n planTitle: string;\n planId?: string;\n phaseIndex?: number;\n fixAttempt?: number;\n fixAttemptCap?: number;\n ideaId?: string;\n agentId: AgentId;\n lines: string[];\n // fix-review only: prefills the commit form once the agent has reported.\n suggestedCommit?: { title: string; message: string };\n errorKind?: 'auth' | 'question';\n}\n\nexport interface OverlapVerdict {\n verdict: 'existing' | 'extend' | 'new';\n targetId: string | null;\n reasoning: string;\n}\n\n/** `why` carries one line per entry in `order`, same index — the reason for that id's placement. */\nexport interface PrioritiseVerdict {\n order: string[];\n why: string;\n}\n\nexport interface ReconcileQueueItem {\n planId: string;\n title: string;\n before: { body: string; phases: PhaseItem[] };\n}\n"],"names":["PLAN_STATUSES","PLAN_KINDS","AGENT_IDS","AGENT_LABELS","AGENT_OPTIONS","coerceAgentConfig","v","toAgent","a","obj","DEFAULT_AGENTS","TOOLBAR_SEGMENT_IDS"],"mappings":"AAEO,MAAMA,IAA8B;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GASaC,IAAyB,CAAC,QAAQ,OAAO,SAAS,QAAQ,UAAU,GAEpEC,IAAY,CAAC,eAAe,UAAU,GAItCC,IAAwC;AAAA,EACnD,eAAe;AAAA,EACf,UAAU;AACZ,GAyXaC,IAAyD;AAAA,EACpE,eAAe;AAAA,IACb,OAAO,CAAC,QAAQ,UAAU,SAAS,OAAO;AAAA,IAC1C,QAAQ,CAAC,OAAO,UAAU,QAAQ,SAAS,KAAK;AAAA,EAAA;AAAA,EAElD,UAAU;AAAA,IACR,OAAO;AAAA,EAAA;AAEX;AAEO,SAASC,EAAkBC,GAAyB;AACzD,QAAMC,IAAU,CAACC,MACfN,EAAU,SAASM,CAAY,IAAKA,IAAgB;AACtD,MAAI,OAAOF,KAAM,SAAU,QAAO,EAAE,OAAOC,EAAQD,CAAC,EAAA;AAEpD,QAAMG,IAAOH,KAAK,CAAA;AAClB,SAAO;AAAA,IACL,OAAOC,EAAQE,EAAI,KAAK;AAAA,IACxB,GAAI,OAAOA,EAAI,SAAU,YAAY,EAAE,OAAOA,EAAI,MAAA;AAAA,IAClD,GAAI,OAAOA,EAAI,UAAW,YAAY,EAAE,QAAQA,EAAI,OAAA;AAAA,EAAO;AAE/D;AAUO,MAAMC,IAAmC;AAAA,EAC9C,OAAO,EAAE,OAAO,WAAA;AAAA,EAChB,WAAW,EAAE,OAAO,cAAA;AAAA,EACpB,YAAY,EAAE,OAAO,cAAA;AAAA,EACrB,eAAe,EAAE,OAAO,cAAA;AAAA,EACxB,UAAU,EAAE,OAAO,eAAe,OAAO,UAAU,QAAQ,SAAA;AAC7D,GAGaC,IAAsB,CAAC,SAAS,SAAS,MAAM;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/types/index.ts"],"sourcesContent":["export type PlanStatus = 'idea' | 'planned' | 'in-progress' | 'review' | 'done' | 'dropped';\n\nexport const PLAN_STATUSES: PlanStatus[] = [\n 'idea',\n 'planned',\n 'in-progress',\n 'review',\n 'done',\n 'dropped',\n];\n\nexport interface LogEntry {\n date: string;\n text: string;\n}\n\nexport type PlanKind = 'feat' | 'fix' | 'chore' | 'docs' | 'refactor';\n\nexport const PLAN_KINDS: PlanKind[] = ['feat', 'fix', 'chore', 'docs', 'refactor'];\n\nexport const AGENT_IDS = ['claude-code', 'opencode'] as const;\n\nexport type AgentId = (typeof AGENT_IDS)[number];\n\nexport const AGENT_LABELS: Record<AgentId, string> = {\n 'claude-code': 'Claude Code',\n opencode: 'OpenCode',\n};\n\nexport interface PhaseRun {\n durationMs: number;\n inputTokens: number;\n outputTokens: number;\n model?: string;\n attempts: number;\n}\n\nexport interface PhaseItem {\n done: boolean;\n text: string;\n description?: string;\n source?: 'review';\n run?: PhaseRun;\n}\n\nexport type PhaseMilestone = 'implement' | 'verify' | 'checkbox';\n\n/** A body section anchor is `body` for now — the whole prose block is the only\n * body section a plan/entity has until later phases break it into sub-sections. */\nexport type MarginNoteAnchor = { kind: 'phase'; index: number } | { kind: 'body' };\n\nexport type MarginNoteState = 'open' | 'resolved';\n\nexport type MarginNoteKind = 'note' | 'decision' | 'question';\n\nexport interface MarginNote {\n anchor: MarginNoteAnchor;\n prose: string;\n state: MarginNoteState;\n kind?: MarginNoteKind;\n}\n\n/** What a thread message originally was, before log/review/notes/clarifications folded\n * into one ordered thread on the entity — 'note'/'decision'/'question' carry `state`,\n * the rest are plain historical records. 'chat' is thread-native (no legacy section):\n * Paper Scout conversation, collapsed by default in thread views. */\nexport type ThreadMessageKind =\n | 'log'\n | 'clarification'\n | 'review'\n | 'note'\n | 'decision'\n | 'question'\n | 'chat';\n\nexport interface ThreadMessage {\n kind: ThreadMessageKind;\n /** Absent for messages ported from the old Notes section, which never carried a date. */\n date?: string;\n text: string;\n /** Only meaningful for note/decision/question kinds. */\n state?: MarginNoteState;\n /** Absent means 'user' — no thread message predates this field being agent-authored. */\n from?: 'user' | 'agent';\n}\n\n/** Ambient context a chat mount (desk, toolbar) feeds alongside a message — each\n * mount populates whatever it has (IDEA-130); Scout folds it into the prompt\n * silently, it never becomes a user-visible field. */\nexport interface MountContext {\n route?: string;\n focusedIdeaId?: string;\n viewport?: { width: number; height: number };\n}\n\nexport interface RawEntry {\n title: string;\n fields: Record<string, string>;\n body: string;\n phases: PhaseItem[];\n log?: LogEntry[];\n clarifications?: LogEntry[];\n notes?: MarginNote[];\n review?: LogEntry[];\n}\n\nexport interface ParseWarning {\n title: string;\n message: string;\n}\n\nexport interface ParseResult<T> {\n entries: T[];\n warnings: ParseWarning[];\n}\n\n/** A PR's reviewable/mergeable state, as surfaced by `gh pr list`. */\nexport type PrState = 'draft' | 'open' | 'closed' | 'merged';\n\n/** GitHub's PR review decision, as surfaced by `gh pr list --json reviewDecision`. */\nexport type ReviewDecision = 'approved' | 'changes-requested' | 'review-required';\n\n// Per-comment detail; PrInfo.unresolvedThreadCount only counts these.\nexport interface ReviewThread {\n /** GraphQL node id — what `resolveReviewThread`/`replyToReviewThread` address. */\n id: string;\n /** File path the comment is anchored to; absent for a PR-level (not diff-anchored) comment. */\n path?: string;\n line?: number;\n author?: string;\n body: string;\n}\n\n// Parsed from the JSON object a fix-review agent's prompt requires as its final line.\nexport interface FixReviewResult {\n commit: { title: string; message: string };\n addressed: string[];\n skipped: { threadId: string; why: string }[];\n}\n\nexport interface FeedbackPhaseEdit {\n op: 'add' | 'reword';\n /** 1-based position in the plan's current phase list; required for \"reword\", ignored for \"add\". */\n index?: number;\n text: string;\n description?: string;\n}\n\nexport interface FeedbackEdit {\n phases?: FeedbackPhaseEdit[];\n /** The complete replacement body, when the message corrects body prose. */\n body?: string;\n}\n\n// Parsed from the JSON object a feedback-reply agent's prompt requires as its\n// final line. The chat never creates ideas — a request is either a reply or an\n// edit on the current plan.\nexport interface FeedbackReplyResult {\n reply: string;\n edit?: FeedbackEdit;\n /** True when the user's message answers an open question the agent asked\n * earlier in this thread — the route persists that message as a clarification. */\n answersQuestion?: boolean;\n}\n\n/** Live-resolved PR info for an entity's branch — see `core/pr.ts`. */\nexport interface PrInfo {\n number: number;\n url: string;\n state: PrState;\n /** Undefined when no review has been requested/decided, or when unresolved (offline, closed/merged PR). */\n reviewDecision?: ReviewDecision;\n /** Count of unresolved review threads. Only fetched for open/draft PRs; undefined when not fetched or unresolved. */\n unresolvedThreadCount?: number;\n /** Whether a comment or review landed after the PR's last commit — a proxy for \"since the last agent pass\" (a pass ends with a push). Only fetched for open/draft PRs. */\n hasNewCommentsSincePush?: boolean;\n}\n\nexport interface PlanEntry {\n title: string;\n status: PlanStatus;\n kind?: PlanKind;\n id?: string;\n idea?: string;\n agent?: AgentId;\n created: string;\n updated?: string;\n audited?: string;\n auditedHash?: string;\n /** Version tag (e.g. v0.13.1) that first shipped this idea, stamped from the release train. */\n released?: string;\n tags: string[];\n /** Absent renders under the virtual \"No subject\" group. */\n subject?: string;\n /** Absent means unordered — sorts after all ordered entries, by created date. */\n order?: number;\n body: string;\n phases: PhaseItem[];\n /** Post-build findings, same checkbox grammar as `phases` — see EntityEntry.fixes. */\n fixes?: PhaseItem[];\n log?: LogEntry[];\n clarifications?: LogEntry[];\n notes?: MarginNote[];\n /** Prose written against the whole finished plan, distinct from the flat `log` — an\n * agent later splits each entry into rework phases or a follow-up idea. */\n review?: LogEntry[];\n /** The entity's single ordered feedback thread — see EntityEntry.thread. */\n thread?: ThreadMessage[];\n /** Set by readEntities from which dir the file came from — see EntityEntry.archived. */\n archived?: boolean;\n pr?: PrInfo;\n}\n\nexport interface ArchivableIdea {\n id: string;\n title: string;\n pr: PrInfo;\n}\n\n/** One open `question` thread message, resolved to the idea it's parked on. `ageDays`\n * is `Infinity` for a question ported from the pre-Thread Notes section, which never\n * carried a date — the oldest kind of unresolved question there is. */\nexport interface ParkedQuestion {\n entityId: string;\n entityTitle: string;\n text: string;\n date?: string;\n ageDays: number;\n}\n\nexport type ConsistencyIssueKind = 'orphan-subject' | 'title-style';\n\nexport interface ConsistencyIssue {\n kind: ConsistencyIssueKind;\n section: 'plans';\n title: string;\n message: string;\n planId?: string;\n}\n\nexport interface CommentStats {\n commentLines: number;\n sourceLines: number;\n ratio: number;\n}\n\nexport interface TasksPerWeek {\n /** ISO week, e.g. \"2026-W05\". */\n week: string;\n count: number;\n}\n\nexport interface UsagePerWeek {\n /** ISO week, e.g. \"2026-W05\". */\n week: string;\n agentMinutes: number;\n inputTokens: number;\n outputTokens: number;\n}\n\nexport interface IdeaCost {\n planId: string;\n planTitle: string;\n inputTokens: number;\n outputTokens: number;\n durationMs: number;\n}\n\nexport interface CapacityStat {\n snapshot: RateLimitSnapshot;\n capturedAt: string;\n}\n\nexport interface ProjectStats {\n generatedAt: string;\n comments: CommentStats;\n testLines: number;\n /** Null when no coverage report has been emitted yet (run `pnpm test`). */\n testCoveragePct: number | null;\n entitiesByStatus: Partial<Record<EntityStatus, number>>;\n openQuestions: number;\n decisions: number;\n tasksPerWeek: TasksPerWeek[];\n usagePerWeek: UsagePerWeek[];\n medianPhaseDurationMs: number | null;\n mostExpensiveIdeas: IdeaCost[];\n capacity: CapacityStat | null;\n}\n\nexport type IdeaKind = 'idea' | 'note';\n\nexport type IdeaStatus = 'open' | 'done' | 'dropped';\n\nexport interface IdeaEntry {\n id: string | null;\n title: string;\n body: string;\n kind?: IdeaKind;\n status?: IdeaStatus;\n /** Absent renders under the virtual \"No subject\" group. */\n subject?: string;\n /** Absent means unordered — sorts after all ordered entries, by created date. */\n order?: number;\n /** Fallback sort key for unordered entries — see `order`. Absent on view-model-only IdeaEntry literals that never enter the worklist sort. */\n created?: string;\n log?: LogEntry[];\n}\n\n// Unified entity — one file per entity, plan as an optional Phases section.\n// Supersedes PlanEntry/IdeaEntry once the migration cutover lands.\n\n/** Work classification — same Conventional-Commits values as PlanKind; `kind` renamed to `type` in the unified schema. */\nexport type EntityType = PlanKind;\n\n/** Plan lifecycle plus the note-only `open`. Notes use open → done/dropped; everything else uses the PlanStatus track. */\nexport type EntityStatus = PlanStatus | 'open';\n\nexport interface EntityEntry {\n id: string;\n title: string;\n /** Absent until the entity is classified (usually when its plan is drafted). */\n type?: EntityType;\n /** \"note\" marks an entity that never grows phases. */\n kind?: 'note';\n /** Stored override, not the source of truth — see entityFrontmatterSchema. */\n status?: EntityStatus;\n agent?: AgentId;\n created: string;\n updated?: string;\n audited?: string;\n auditedHash?: string;\n /** Version tag (e.g. v0.13.1) that first shipped this idea, stamped from the release train. */\n released?: string;\n tags: string[];\n /** Absent renders as the virtual \"No subject\" group. */\n subject?: string;\n /** Absent means unordered — sorts after all ordered entries, by created date. */\n order?: number;\n body: string;\n phases: PhaseItem[];\n /** Post-build findings, same checkbox grammar as `phases` — appended below Phases\n * rather than rewriting the plan's already-finished phase history. */\n fixes?: PhaseItem[];\n /** The entity's single ordered feedback thread — folds what used to be separate\n * log/clarifications/notes/review sections. */\n thread?: ThreadMessage[];\n /** Set by readEntities from which of the two scanned dirs the file came from, not the frontmatter. */\n archived?: boolean;\n}\n\n// No `id`/`status`: it only becomes a real idea if a human promotes it.\nexport interface SuggestionEntry {\n date: string;\n title: string;\n description: string;\n}\n\nexport interface RoadmapItem {\n name: string;\n description: string;\n candidates: string[];\n linked: string[];\n}\n\nexport interface RoadmapHorizon {\n title: string;\n items: RoadmapItem[];\n}\n\nexport interface Roadmap {\n goal: string;\n horizons: RoadmapHorizon[];\n standingConcerns: RoadmapItem[];\n}\n\nexport interface RoadmapLink {\n id: string;\n status: PlanStatus;\n taskRuns: number;\n pr?: PrInfo;\n released: boolean;\n}\n\nexport interface RoadmapRollup {\n total: number;\n done: number;\n}\n\nexport interface ResolvedRoadmapItem extends RoadmapItem {\n links: RoadmapLink[];\n rollup: RoadmapRollup;\n}\n\nexport interface ResolvedRoadmapHorizon {\n title: string;\n items: ResolvedRoadmapItem[];\n rollup: RoadmapRollup;\n}\n\nexport interface ResolvedRoadmap {\n goal: string;\n horizons: ResolvedRoadmapHorizon[];\n events: RoadmapEvent[];\n}\n\nexport type RoadmapEventKind = 'created' | 'task-run';\n\nexport interface RoadmapEvent {\n date: string;\n kind: RoadmapEventKind;\n entityId: string;\n horizonTitle: string;\n itemName: string;\n label: string;\n}\n\nexport interface EnvEntry {\n key: string;\n value: string;\n /** Set on GET responses when the value is withheld — secrets never reach the client. */\n isSet?: boolean;\n}\n\nexport interface AgentConfig {\n agent: AgentId;\n model?: string;\n effort?: string;\n}\n\n/** Model/effort passed to an adapter's buildArgs — the AgentConfig minus the agent id. */\nexport interface AgentRunOptions {\n model?: string;\n effort?: string;\n /** Prior claude-code session id to continue instead of starting cold; ignored by opencode. */\n resume?: string;\n}\n\n/** Maps option names to a fixed value list (renders a Select) or null (free-text or hidden). */\nexport type AgentOptionsDescriptor = Record<string, string[] | null | undefined>;\n\nexport const AGENT_OPTIONS: Record<AgentId, AgentOptionsDescriptor> = {\n 'claude-code': {\n model: ['opus', 'sonnet', 'fable', 'haiku'],\n effort: ['low', 'medium', 'high', 'xhigh', 'max'],\n },\n opencode: {\n model: null,\n },\n};\n\nexport function coerceAgentConfig(v: unknown): AgentConfig {\n const toAgent = (a: unknown): AgentId =>\n AGENT_IDS.includes(a as AgentId) ? (a as AgentId) : 'claude-code';\n if (typeof v === 'string') return { agent: toAgent(v) };\n // A missing key must not throw — that would 500 the /api/config read this protects.\n const obj = (v ?? {}) as Record<string, unknown>;\n return {\n agent: toAgent(obj.agent),\n ...(typeof obj.model === 'string' && { model: obj.model }),\n ...(typeof obj.effort === 'string' && { effort: obj.effort }),\n };\n}\n\nexport interface DefaultAgentsMap {\n phase: AgentConfig;\n planDraft: AgentConfig;\n ideaExtend: AgentConfig;\n commitSuggest: AgentConfig;\n feedback: AgentConfig;\n}\n\nexport const DEFAULT_AGENTS: DefaultAgentsMap = {\n phase: { agent: 'opencode' },\n planDraft: { agent: 'claude-code' },\n ideaExtend: { agent: 'claude-code' },\n commitSuggest: { agent: 'claude-code' },\n feedback: { agent: 'claude-code', model: 'sonnet', effort: 'medium' },\n};\n\n/** Toolbar segments, left to right (IDEA-128/IDEA-133); trimmed per project via `IntegrationConfig.toolbar.segments`. */\nexport const TOOLBAR_SEGMENT_IDS = ['focus', 'scout', 'desk'] as const;\n\nexport type ToolbarSegmentId = (typeof TOOLBAR_SEGMENT_IDS)[number];\n\nexport interface IntegrationToolbarConfig {\n enabled?: boolean;\n segments?: ToolbarSegmentId[];\n /** Opt-in escape hatch: without it, the vite plugin stays off when `mode` is `production`. */\n allowProduction?: boolean;\n}\n\nexport interface IntegrationConfig {\n toolbar?: IntegrationToolbarConfig;\n route?: string;\n}\n\nexport interface PaperCampConfig {\n version: string;\n projectName: string;\n initializedAt: string;\n /** The unified-entity `idea` counter; the per-kind plan counters are legacy, present only in pre-migration configs. */\n nextId?: Partial<Record<PlanKind, number>> & { idea?: number };\n port?: number;\n defaultAgents?: DefaultAgentsMap;\n /** Derived from `ROADMAP.md` on every read (IDEA-95), never written to disk; an idea's\n * `subject` not present here renders as \"No subject\". */\n subjects?: string[];\n /** Opts out of the first-run redirect to Settings > Setup while capabilities are incomplete. */\n setupDismissed?: boolean;\n /** In-app dev toolbar (IDEA-128) — the `@dendelion/paper-camp/vite` plugin's mount, toggleable for frontend targets. */\n integration?: IntegrationConfig;\n}\n\nexport type CheckStatus = 'stale' | 'running' | 'pass' | 'fail';\n\nexport interface CheckResult {\n status: CheckStatus;\n lastRun: string | null;\n output: string;\n}\n\nexport type CheckName = 'lint' | 'format' | 'test' | 'consistency';\n\nexport type CapabilityStatus = 'ok' | 'warn' | 'missing';\n\nexport interface CapabilityResult {\n id: string;\n status: CapabilityStatus;\n detail: string;\n}\n\nexport interface AgentAuthStatus {\n loggedIn: boolean | null;\n authMethod: string | null;\n apiProvider: string | null;\n}\n\nexport type LoginRelayPhase =\n | 'starting'\n | 'awaiting-authorization'\n | 'success'\n | 'error'\n | 'cancelled';\n\nexport interface LoginRelayState {\n phase: LoginRelayPhase;\n authorizeUrl: string | null;\n error?: string;\n}\n\nexport type ServiceId = 'git' | 'gh' | `agent:${AgentId}`;\n\n/** What a Connections row offers once its service isn't `ok` — copy a command, follow a link, or read plain instructions. */\nexport type ConnectAction =\n /** `runnable` marks a command with no placeholders and no interactive prompts — safe for the server to execute directly instead of just displaying it. */\n | { kind: 'command'; command: string; runnable?: boolean }\n | { kind: 'link'; url: string; label: string }\n | { kind: 'text'; message: string };\n\nexport interface ConnectionResult {\n id: ServiceId;\n label: string;\n unlocks: string;\n status: CapabilityStatus;\n detail: string;\n authenticated: boolean | null;\n connect: ConnectAction | null;\n}\n\nexport interface MergePolicy {\n allowSquashMerge: boolean;\n allowMergeCommit: boolean;\n allowRebaseMerge: boolean;\n squashMergeCommitTitle: string;\n squashMergeCommitMessage: string;\n}\n\nexport type MergePolicyResult =\n | { status: 'ok'; repo: string; policy: MergePolicy }\n | { status: 'unavailable'; reason: string };\n\nexport interface GitStatusEntry {\n path: string;\n status: string;\n staged: boolean;\n renameSource?: string;\n}\n\nexport interface GitStatusResponse {\n branch: string;\n entries: GitStatusEntry[];\n ahead: number;\n behind: number;\n diverged: boolean;\n branchHygiene: BranchHygieneStatus;\n}\n\nexport interface FileDiffEntry {\n path: string;\n renameSource?: string;\n staged: boolean;\n binary: boolean;\n additions: number;\n deletions: number;\n // 'diff' is a unified patch (tracked files); 'raw' is untracked file content, not a\n // patch; 'too-large' means `patch` is empty and the file was skipped.\n contentKind: 'diff' | 'raw' | 'too-large';\n patch: string;\n}\n\nexport type BranchHygieneStatus =\n | 'clean-on-main'\n | 'stale-merged'\n | 'stale-no-upstream'\n | 'dirty'\n | 'fine';\n\nexport interface GitLiveState {\n branch: string;\n ahead: number;\n behind: number;\n dirtyCount: number;\n}\n\nexport interface GitSyncFailure {\n ok: false;\n stage: 'reconcile' | 'stash-pop' | 'conflicted';\n message: string;\n stashPending: boolean;\n // Only set when stage is 'conflicted': the files a rebase left with unresolved\n // markers, for a one-click \"ask the agent to resolve\" rather than a bare error.\n conflictedFiles?: string[];\n // Only set when stage is 'conflicted': the ref the rebase targeted, and each\n // conflicted file's last-seen content (with markers) before the rebase was\n // aborted for safety — the resolve-conflict agent's raw material.\n conflictRef?: string;\n conflictedContent?: { path: string; content: string }[];\n // Prompt for the agent recovery job (see git-sync-recovery.ts) — the deterministic\n // path's failure, the working-tree state, and the goal, packaged for a future\n // launch rather than thrown at the user.\n recoveryPrompt: string;\n // Only set when stage is 'conflicted': a prompt scoped to landing this one rebase\n // (see resolve-conflict-prompt.ts) — launched only on explicit \"ask the agent to\n // resolve\" confirmation from the sync-failed toast, never automatically.\n conflictPrompt?: string;\n}\n\nexport type GitSyncResult = { ok: true } | GitSyncFailure;\n\nexport type AgentTaskStatus = 'starting' | 'running' | 'stopping' | 'done' | 'error' | 'superseded';\n\nexport type TaskKind =\n | 'phase'\n | 'audit'\n | 'batch-reconcile'\n | 'run-all'\n | 'draft'\n | 'extend'\n | 'suggest'\n | 'commit-suggest'\n | 'overlap-check'\n | 'prioritise'\n | 'sync'\n | 'reconcile'\n | 'fix-review'\n | 'resolve-conflict'\n | 'feedback';\n\n// Persisted to papercamp/tasks.log (JSON Lines) — survives a dev-server restart,\n// unlike the in-memory task registry.\nexport interface TaskLogEntry {\n id: string;\n taskKind: TaskKind;\n planId?: string;\n planTitle: string;\n agentId: AgentId;\n startedAt: string;\n endedAt: string;\n outcome: 'done' | 'error' | 'superseded';\n reason?: string;\n usage?: RunUsage;\n phaseRuns?: PhaseRunRecord[];\n rateLimit?: RateLimitSnapshot;\n}\n\nexport interface RunUsage {\n durationMs: number;\n numTurns: number;\n model?: string;\n inputTokens: number;\n outputTokens: number;\n cacheCreationTokens: number;\n cacheReadTokens: number;\n costUsd: number;\n}\n\nexport interface RateLimitSnapshot {\n status: string;\n rateLimitType?: string;\n resetsAt?: number;\n overage?: boolean;\n}\n\nexport interface PhaseRunRecord {\n kind: 'phase' | 'fix';\n index: number;\n usage: RunUsage;\n}\n\nexport interface TrailHop<T> {\n reached: boolean;\n data?: T;\n}\n\nexport interface ProvenanceTrail {\n id: string;\n idea: TrailHop<{ title: string; status?: EntityStatus; type?: EntityType }>;\n phases: TrailHop<PhaseItem[]>;\n taskRuns: TrailHop<TaskLogEntry[]>;\n commits: TrailHop<string[]>;\n pr: TrailHop<PrInfo>;\n releaseLine: TrailHop<string>;\n}\n\nexport interface ReleaseNoteIdea {\n id: string;\n title: string;\n}\n\nexport interface ReleaseNoteSection {\n label: string;\n ideas: ReleaseNoteIdea[];\n}\n\nexport interface AgentTaskState {\n id: string;\n status: AgentTaskStatus;\n taskKind: TaskKind;\n planTitle: string;\n planId?: string;\n phaseIndex?: number;\n fixAttempt?: number;\n fixAttemptCap?: number;\n ideaId?: string;\n agentId: AgentId;\n lines: string[];\n phaseAnchor?: PhaseMilestone;\n anchorEnteredAt?: number;\n lastStreamAt?: number;\n // fix-review only: prefills the commit form once the agent has reported.\n suggestedCommit?: { title: string; message: string };\n errorKind?: 'auth' | 'question';\n rateLimit?: RateLimitSnapshot;\n}\n\nexport interface OverlapVerdict {\n verdict: 'existing' | 'extend' | 'new';\n targetId: string | null;\n reasoning: string;\n}\n\n/** `why` carries one line per entry in `order`, same index — the reason for that id's placement. */\nexport interface PrioritiseVerdict {\n order: string[];\n why: string;\n}\n\nexport interface ReconcileQueueItem {\n planId: string;\n title: string;\n before: { body: string; phases: PhaseItem[] };\n}\n"],"names":["PLAN_STATUSES","PLAN_KINDS","AGENT_IDS","AGENT_LABELS","AGENT_OPTIONS","coerceAgentConfig","v","toAgent","a","obj","DEFAULT_AGENTS","TOOLBAR_SEGMENT_IDS"],"mappings":"AAEO,MAAMA,IAA8B;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GASaC,IAAyB,CAAC,QAAQ,OAAO,SAAS,QAAQ,UAAU,GAEpEC,IAAY,CAAC,eAAe,UAAU,GAItCC,IAAwC;AAAA,EACnD,eAAe;AAAA,EACf,UAAU;AACZ,GA6ZaC,IAAyD;AAAA,EACpE,eAAe;AAAA,IACb,OAAO,CAAC,QAAQ,UAAU,SAAS,OAAO;AAAA,IAC1C,QAAQ,CAAC,OAAO,UAAU,QAAQ,SAAS,KAAK;AAAA,EAAA;AAAA,EAElD,UAAU;AAAA,IACR,OAAO;AAAA,EAAA;AAEX;AAEO,SAASC,EAAkBC,GAAyB;AACzD,QAAMC,IAAU,CAACC,MACfN,EAAU,SAASM,CAAY,IAAKA,IAAgB;AACtD,MAAI,OAAOF,KAAM,SAAU,QAAO,EAAE,OAAOC,EAAQD,CAAC,EAAA;AAEpD,QAAMG,IAAOH,KAAK,CAAA;AAClB,SAAO;AAAA,IACL,OAAOC,EAAQE,EAAI,KAAK;AAAA,IACxB,GAAI,OAAOA,EAAI,SAAU,YAAY,EAAE,OAAOA,EAAI,MAAA;AAAA,IAClD,GAAI,OAAOA,EAAI,UAAW,YAAY,EAAE,QAAQA,EAAI,OAAA;AAAA,EAAO;AAE/D;AAUO,MAAMC,IAAmC;AAAA,EAC9C,OAAO,EAAE,OAAO,WAAA;AAAA,EAChB,WAAW,EAAE,OAAO,cAAA;AAAA,EACpB,YAAY,EAAE,OAAO,cAAA;AAAA,EACrB,eAAe,EAAE,OAAO,cAAA;AAAA,EACxB,UAAU,EAAE,OAAO,eAAe,OAAO,UAAU,QAAQ,SAAA;AAC7D,GAGaC,IAAsB,CAAC,SAAS,SAAS,MAAM;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dendelion/paper-camp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "Local-first, AI-native project management with retro aesthetics",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.12.1",
|
|
@@ -90,6 +90,7 @@
|
|
|
90
90
|
"@biomejs/biome": "^1.9.3",
|
|
91
91
|
"@commitlint/cli": "^21.0.2",
|
|
92
92
|
"@commitlint/config-conventional": "^21.0.2",
|
|
93
|
+
"@dendelion/paper-camp": "0.16.0",
|
|
93
94
|
"@types/node": "^20.0.0",
|
|
94
95
|
"@types/react": "^18.3.11",
|
|
95
96
|
"@types/react-dom": "^18.3.0",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as o,j as e,P as x,R as c,T as d,N as m,w as j}from"./main-Ba3mXsWY.js";import{c as i}from"./tokens-C3C44lLs.js";const p=async()=>{const s=await fetch("/api/stats");if(!s.ok)throw new Error(`Failed to fetch stats: ${s.status}`);return s.json()},h=["open",...d],u={...m,open:"Open"},f=s=>`${Math.round(s*100)}%`,n=({title:s,children:t})=>e.jsx("div",{className:"flex-[1_1_260px] max-w-[360px] max-[480px]:flex-[1_1_100%] max-[480px]:max-w-none",children:e.jsx(j,{size:"small",texture:"kraft",className:"h-full",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("span",{className:"font-handwritten text-xs font-semibold opacity-[0.55]",children:s}),t]})})}),a=({label:s,value:t})=>e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"opacity-70",children:s}),e.jsx("span",{className:"font-semibold",children:t})]}),v=({comments:s})=>e.jsxs(n,{title:"Comment ratio",children:[e.jsx(c,{value:s.ratio*100,color:i.accentSlate}),e.jsx(a,{label:"Ratio",value:f(s.ratio)}),e.jsx(a,{label:"Comment lines",value:s.commentLines}),e.jsx(a,{label:"Source lines",value:s.sourceLines})]}),N=({testCoveragePct:s})=>e.jsx(n,{title:"Test coverage",children:s===null?e.jsx("p",{className:"opacity-50 m-0",children:"Run `pnpm test` to generate a coverage report."}):e.jsxs(e.Fragment,{children:[e.jsx(c,{value:s,color:i.accentGreen}),e.jsx(a,{label:"Line coverage",value:`${Math.round(s)}%`})]})}),S=({sourceLines:s,testLines:t})=>e.jsxs(n,{title:"Codebase size",children:[e.jsx(a,{label:"Source lines",value:s}),e.jsx(a,{label:"Test lines",value:t})]}),g=({entitiesByStatus:s})=>e.jsxs(n,{title:"Entities by status",children:[h.filter(t=>s[t]).map(t=>e.jsx(a,{label:u[t],value:s[t]},t)),Object.keys(s).length===0&&e.jsx("p",{className:"opacity-50 m-0",children:"No entities yet."})]}),b=({openQuestions:s,decisions:t})=>e.jsxs(n,{title:"Notes",children:[e.jsx(a,{label:"Open questions",value:s}),e.jsx(a,{label:"Decisions",value:t})]}),y=({tasksPerWeek:s})=>{const t=Math.max(1,...s.map(l=>l.count));return e.jsxs(n,{title:"Tasks per week",children:[s.length===0&&e.jsx("p",{className:"opacity-50 m-0",children:"No tasks run yet."}),s.map(l=>e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(a,{label:l.week,value:l.count}),e.jsx(c,{value:l.count,max:t,color:i.accentAmber,height:4})]},l.week))]})},C=()=>{const[s,t]=o.useState(null),[l,r]=o.useState(!1);return o.useEffect(()=>{p().then(t).catch(()=>r(!0))},[]),e.jsxs("div",{children:[e.jsx(x,{children:"Stats"}),e.jsx("p",{className:"opacity-50 mb-6",children:"A read-only look at project health — every number here is informational, none of them gate anything."}),l&&e.jsx("p",{className:"opacity-50",children:"Couldn't load stats."}),!l&&!s&&e.jsx("p",{className:"opacity-50",children:"Loading…"}),s&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-start gap-2.5",children:[e.jsx(v,{comments:s.comments}),e.jsx(N,{testCoveragePct:s.testCoveragePct}),e.jsx(S,{sourceLines:s.comments.sourceLines,testLines:s.testLines}),e.jsx(g,{entitiesByStatus:s.entitiesByStatus}),e.jsx(b,{openQuestions:s.openQuestions,decisions:s.decisions}),e.jsx(y,{tasksPerWeek:s.tasksPerWeek})]}),e.jsxs("p",{className:"opacity-[0.4] text-2xs mt-6",children:["Generated ",new Date(s.generatedAt).toLocaleString()]})]})]})};export{C as StatsPage};
|
|
2
|
-
//# sourceMappingURL=index-0BzPyUVh.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-0BzPyUVh.js","sources":["../../../src/app/services/content/stats-api.ts","../../../src/app/features/stats/stats-page.tsx"],"sourcesContent":["import type { ProjectStats } from '@/types/index';\n\nexport const fetchStats = async () => {\n const res = await fetch('/api/stats');\n if (!res.ok) throw new Error(`Failed to fetch stats: ${res.status}`);\n return res.json() as Promise<ProjectStats>;\n};\n","import { PageTitle } from '@/app/components/page-title';\nimport { STATUS_LABEL } from '@/app/features/plans/constants';\nimport { fetchStats } from '@/app/services/content';\nimport { color } from '@/app/styles/tokens';\nimport { type EntityStatus, PLAN_STATUSES, type ProjectStats } from '@/types/index';\nimport { Card, Progress } from '@dendelion/paper-ui';\nimport { useEffect, useState } from 'react';\n\nconst ENTITY_STATUS_ORDER: EntityStatus[] = ['open', ...PLAN_STATUSES];\n\nconst ENTITY_STATUS_LABEL: Record<EntityStatus, string> = { ...STATUS_LABEL, open: 'Open' };\n\nconst pct = (value: number) => `${Math.round(value * 100)}%`;\n\nconst StatCard = ({ title, children }: { title: string; children: React.ReactNode }) => (\n <div className=\"flex-[1_1_260px] max-w-[360px] max-[480px]:flex-[1_1_100%] max-[480px]:max-w-none\">\n <Card size=\"small\" texture=\"kraft\" className=\"h-full\">\n <div className=\"flex flex-col gap-3\">\n <span className=\"font-handwritten text-xs font-semibold opacity-[0.55]\">{title}</span>\n {children}\n </div>\n </Card>\n </div>\n);\n\nconst StatRow = ({ label, value }: { label: string; value: React.ReactNode }) => (\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"opacity-70\">{label}</span>\n <span className=\"font-semibold\">{value}</span>\n </div>\n);\n\nconst CommentRatioCard = ({ comments }: { comments: ProjectStats['comments'] }) => (\n <StatCard title=\"Comment ratio\">\n <Progress value={comments.ratio * 100} color={color.accentSlate} />\n <StatRow label=\"Ratio\" value={pct(comments.ratio)} />\n <StatRow label=\"Comment lines\" value={comments.commentLines} />\n <StatRow label=\"Source lines\" value={comments.sourceLines} />\n </StatCard>\n);\n\nconst TestCoverageCard = ({ testCoveragePct }: { testCoveragePct: number | null }) => (\n <StatCard title=\"Test coverage\">\n {testCoveragePct === null ? (\n <p className=\"opacity-50 m-0\">Run `pnpm test` to generate a coverage report.</p>\n ) : (\n <>\n <Progress value={testCoveragePct} color={color.accentGreen} />\n <StatRow label=\"Line coverage\" value={`${Math.round(testCoveragePct)}%`} />\n </>\n )}\n </StatCard>\n);\n\nconst CodebaseSizeCard = ({\n sourceLines,\n testLines,\n}: { sourceLines: number; testLines: number }) => (\n <StatCard title=\"Codebase size\">\n <StatRow label=\"Source lines\" value={sourceLines} />\n <StatRow label=\"Test lines\" value={testLines} />\n </StatCard>\n);\n\nconst EntitiesByStatusCard = ({\n entitiesByStatus,\n}: { entitiesByStatus: ProjectStats['entitiesByStatus'] }) => (\n <StatCard title=\"Entities by status\">\n {ENTITY_STATUS_ORDER.filter((status) => entitiesByStatus[status]).map((status) => (\n <StatRow key={status} label={ENTITY_STATUS_LABEL[status]} value={entitiesByStatus[status]} />\n ))}\n {Object.keys(entitiesByStatus).length === 0 && (\n <p className=\"opacity-50 m-0\">No entities yet.</p>\n )}\n </StatCard>\n);\n\nconst NotesCard = ({ openQuestions, decisions }: { openQuestions: number; decisions: number }) => (\n <StatCard title=\"Notes\">\n <StatRow label=\"Open questions\" value={openQuestions} />\n <StatRow label=\"Decisions\" value={decisions} />\n </StatCard>\n);\n\nconst TasksPerWeekCard = ({ tasksPerWeek }: { tasksPerWeek: ProjectStats['tasksPerWeek'] }) => {\n const max = Math.max(1, ...tasksPerWeek.map((w) => w.count));\n return (\n <StatCard title=\"Tasks per week\">\n {tasksPerWeek.length === 0 && <p className=\"opacity-50 m-0\">No tasks run yet.</p>}\n {tasksPerWeek.map((week) => (\n <div key={week.week} className=\"flex flex-col gap-1\">\n <StatRow label={week.week} value={week.count} />\n <Progress value={week.count} max={max} color={color.accentAmber} height={4} />\n </div>\n ))}\n </StatCard>\n );\n};\n\nexport const StatsPage = () => {\n const [stats, setStats] = useState<ProjectStats | null>(null);\n const [loadFailed, setLoadFailed] = useState(false);\n\n useEffect(() => {\n fetchStats()\n .then(setStats)\n .catch(() => setLoadFailed(true));\n }, []);\n\n return (\n <div>\n <PageTitle>Stats</PageTitle>\n <p className=\"opacity-50 mb-6\">\n A read-only look at project health — every number here is informational, none of them gate\n anything.\n </p>\n {loadFailed && <p className=\"opacity-50\">Couldn't load stats.</p>}\n {!loadFailed && !stats && <p className=\"opacity-50\">Loading…</p>}\n {stats && (\n <>\n <div className=\"flex flex-wrap items-start gap-2.5\">\n <CommentRatioCard comments={stats.comments} />\n <TestCoverageCard testCoveragePct={stats.testCoveragePct} />\n <CodebaseSizeCard\n sourceLines={stats.comments.sourceLines}\n testLines={stats.testLines}\n />\n <EntitiesByStatusCard entitiesByStatus={stats.entitiesByStatus} />\n <NotesCard openQuestions={stats.openQuestions} decisions={stats.decisions} />\n <TasksPerWeekCard tasksPerWeek={stats.tasksPerWeek} />\n </div>\n <p className=\"opacity-[0.4] text-2xs mt-6\">\n Generated {new Date(stats.generatedAt).toLocaleString()}\n </p>\n </>\n )}\n </div>\n );\n};\n"],"names":["fetchStats","res","ENTITY_STATUS_ORDER","PLAN_STATUSES","ENTITY_STATUS_LABEL","STATUS_LABEL","pct","value","StatCard","title","children","jsx","Card","jsxs","StatRow","label","CommentRatioCard","comments","Progress","color","TestCoverageCard","testCoveragePct","Fragment","CodebaseSizeCard","sourceLines","testLines","EntitiesByStatusCard","entitiesByStatus","status","NotesCard","openQuestions","decisions","TasksPerWeekCard","tasksPerWeek","max","w","week","StatsPage","stats","setStats","useState","loadFailed","setLoadFailed","useEffect","PageTitle"],"mappings":"0HAEO,MAAMA,EAAa,SAAY,CACpC,MAAMC,EAAM,MAAM,MAAM,YAAY,EACpC,GAAI,CAACA,EAAI,GAAI,MAAM,IAAI,MAAM,0BAA0BA,EAAI,MAAM,EAAE,EACnE,OAAOA,EAAI,KAAA,CACb,ECEMC,EAAsC,CAAC,OAAQ,GAAGC,CAAa,EAE/DC,EAAoD,CAAE,GAAGC,EAAc,KAAM,MAAA,EAE7EC,EAAOC,GAAkB,GAAG,KAAK,MA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ACtD,EACAzB,EAAAA,KAAC,IAAA,CAAE,UAAU,8BAA8B,SAAA,CAAA,aAC9B,IAAI,KAAKyB,EAAM,WAAW,EAAE,eAAA,CAAe,CAAA,CACxD,CAAA,CAAA,CACF,CAAA,EAEJ,CAEJ"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{k as N,r as h,W as k,j as e,X as g,Y as v,Z as I,_ as w,J as P,u as p,a as C,P as E}from"./main-Ba3mXsWY.js";const j=n=>Number.isFinite(n)?n<=0?"today":n===1?"1 day ago":`${n} days ago`:"age unknown",T=({question:n,plan:x,expanded:a,onToggle:u,onOpen:t,reload:y})=>{const{toast:l}=N(),[i,m]=h.useState(""),{sending:o,send:s,undo:d,undoing:r,undoEdit:b}=k(x,{reload:y,notify:l}),c=async()=>{i.trim()&&await s(i.trim())&&m("")};return e.jsxs("div",{className:"border-b border-black/10 last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-3 py-2.5",children:[e.jsx("button",{type:"button",onClick:t,"aria-label":`Open ${n.entityTitle}`,className:"bg-transparent border-none p-0 cursor-pointer",children:e.jsx(g,{id:n.entityId})}),e.jsx("button",{type:"button",onClick:u,"aria-expanded":a,className:"flex-1 min-w-0 truncate text-left bg-transparent border-none p-0 cursor-pointer",children:n.text}),e.jsx("span",{className:"opacity-50 text-xs whitespace-nowrap",children:j(n.ageDays)})]}),a&&e.jsxs("div",{className:"flex flex-col gap-3 pb-4",children:[e.jsx(v,{messages:x.thread??[],undo:d,undoing:r,onUndo:b}),e.jsx(I,{value:i,onChange:f=>m(f.target.value),"aria-label":`Reply to ${n.entityTitle}`,placeholder:"Reply to resolve and resume…",rows:2,disabled:o}),e.jsxs("div",{className:"flex justify-end items-center gap-3",children:[e.jsx("span",{className:o?"visible":"invisible",children:e.jsx(w,{size:"small",label:"Agent replying…"})}),e.jsx(P,{size:"small",onClick:c,disabled:o||!i.trim(),children:"Reply"})]})]})]})},R=()=>{const[n,x]=h.useState(null),a=p(s=>s.parkedQuestions),u=p(s=>s.parkedQuestionsError!==null),t=p(s=>s.plans),y=p(s=>s.loadPlans),l=p(s=>s.loadParkedQuestions),i=C();h.useEffect(()=>{l()},[l]);const m=async()=>{await Promise.all([y(),l()])},o=s=>{t!=null&&t.entries.some(d=>d.title===s)?i({to:"/plans/$planId",params:{planId:encodeURIComponent(s)}}):i({to:"/ideas/$ideaId",params:{ideaId:encodeURIComponent(s)}})};return e.jsxs("div",{children:[e.jsx(E,{children:"Inbox"}),e.jsx("p",{className:"opacity-50 mb-6",children:"Every open agent question, oldest first — parked decisions waiting on a human."}),u&&e.jsx("p",{className:"opacity-50",children:"Couldn't load parked questions."}),!u&&!a&&e.jsx("p",{className:"opacity-50",children:"Loading…"}),a&&a.length===0&&e.jsx("p",{className:"opacity-50",children:"Nothing parked — every agent question has an answer."}),a&&a.length>0&&e.jsx("div",{className:"flex flex-col",children:a.map((s,d)=>{const r=`${s.entityId}-${d}`,b=t==null?void 0:t.entries.find(c=>c.id===s.entityId);return b?e.jsx(T,{question:s,plan:b,expanded:n===r,onToggle:()=>x(c=>c===r?null:r),onOpen:()=>o(s.entityTitle),reload:m},r):e.jsxs("div",{className:"flex items-center gap-3 py-2.5 border-b border-black/10 last:border-b-0",children:[e.jsx("button",{type:"button",onClick:()=>o(s.entityTitle),"aria-label":`Open ${s.entityTitle}`,className:"bg-transparent border-none p-0 cursor-pointer",children:e.jsx(g,{id:s.entityId})}),e.jsx("span",{className:"flex-1 min-w-0 truncate",children:s.text}),e.jsx("span",{className:"opacity-50 text-xs whitespace-nowrap",children:j(s.ageDays)})]},r)})})]})};export{R as InboxPage};
|
|
2
|
-
//# sourceMappingURL=index-Bz4Df_iX.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{u as S,m as L,r as d,k as T,j as e,E as z,v as D,J as v,F as O,G as M,a as B,B as U,H as C,P as E,M as $,w as _,U as y,S as b,I as V,o as I,K as F,g as G,L as H,N as q}from"./main-Ba3mXsWY.js";import{O as fe}from"./main-Ba3mXsWY.js";const w="__no-subject__",K=({horizonTitle:a,item:s,candidateName:t,onClose:r,onPromoted:l})=>{const c=S(n=>n.promoteRoadmapItem),o=S(n=>n.launchIdeaExtend),{subjects:f,available:p}=L(),[h,u]=d.useState(w),[j,g]=d.useState(!1),[x,N]=d.useState(null),{toast:R}=T();d.useEffect(()=>{s&&(u(t?s.name:w),g(!1),N(null))},[s,t]);const k=async()=>{if(!(!s||!a)){g(!0),N(null);try{const n=await c(a,s,h===w?void 0:h,t??void 0),i=S.getState().ideaEntries.find(m=>m.id===n);if(i)try{await o(n,O(i,a))}catch(m){R({title:"Idea created, but the refine agent failed to launch",description:M(m.message),variant:"error"})}l(),r()}catch(n){N(n.message)}finally{g(!1)}}};return e.jsx(z,{open:s!==null,onClose:r,title:t??(s==null?void 0:s.name)??"",size:"small",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[!t&&e.jsx("p",{className:"m-0 opacity-80",children:s==null?void 0:s.description}),e.jsx("div",{children:e.jsx(D,{size:"small",value:h,onChange:u,disabled:j||!p,options:[{value:w,label:"No subject"},...!p&&h!==w?[{value:h,label:h}]:[],...f.map(n=>({value:n,label:n}))]})}),x&&e.jsx("p",{className:"m-0 text-watercolor-rose-dark text-sm",children:x}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(v,{type:"button",variant:"ghost",onClick:r,disabled:j,children:"Cancel"}),e.jsx(v,{type:"button",variant:"primary",onClick:k,disabled:j,children:j?"Promoting…":"Promote to idea"})]})]})})},J=a=>({shipped:a.filter(s=>s.status==="done").length,queued:a.filter(s=>s.status!=="done"&&s.status!=="dropped").length}),A="font-handwritten text-md font-semibold opacity-70 leading-none pt-2 px-1 pb-0",W="text-2xs font-normal px-1 py-0 opacity-50",Z=({size:a=14})=>e.jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("polyline",{points:"9 18 15 12 9 6"})}),Q=({name:a,onPromote:s})=>e.jsx(_,{size:"small",texture:"kraft",className:"plan-row-card",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"flex-1",children:a}),e.jsx(v,{type:"button",variant:"ghost",size:"small",onClick:s,children:"Promote to idea"})]})}),X=({onAdd:a})=>{const[s,t]=d.useState(""),[r,l]=d.useState(!1),c=async()=>{if(s.trim()){l(!0);try{await a(s.trim()),t("")}finally{l(!1)}}};return e.jsxs("div",{className:"flex gap-2",children:[e.jsx(I,{size:"small",value:s,onChange:o=>t(o.target.value),onKeyDown:o=>{o.key==="Enter"&&c()},placeholder:"Add option…",disabled:r,className:"flex-1"}),e.jsx(v,{type:"button",variant:"ghost",size:"small",onClick:c,disabled:r||!s.trim(),children:"Add"})]})},Y=({onAdd:a})=>{const[s,t]=d.useState(!1),[r,l]=d.useState(""),[c,o]=d.useState(""),[f,p]=d.useState(!1),h=async()=>{if(r.trim()){p(!0);try{await a(r.trim(),c.trim()),l(""),o(""),t(!1)}finally{p(!1)}}};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(I,{size:"small",value:r,onChange:u=>l(u.target.value),placeholder:"Item name…",disabled:f,autoFocus:!0}),e.jsx(I,{size:"small",value:c,onChange:u=>o(u.target.value),onKeyDown:u=>{u.key==="Enter"&&h()},placeholder:"Description…",disabled:f}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(v,{type:"button",variant:"ghost",size:"small",onClick:()=>t(!1),disabled:f,children:"Cancel"}),e.jsx(v,{type:"button",size:"small",onClick:h,disabled:f||!r.trim(),children:"Add"})]})]}):e.jsx(v,{type:"button",variant:"ghost",size:"small",onClick:()=>t(!0),children:"+ Add item"})},ee=(a,s)=>`${a} ${s}${a===1?"":"s"}`,ae=({link:a})=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(G,{content:`${ee(a.taskRuns,"task run")}${a.released?" · released":""}`,children:e.jsx(y,{size:"small",fillColor:b[a.status].fill,textColor:b[a.status].text,children:a.id})}),a.pr&&e.jsx(H,{pr:a.pr})]}),se=({plan:a,onOpen:s})=>e.jsx(_,{size:"small",texture:"kraft",className:"plan-row-card",children:e.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-3 w-full bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left",children:[e.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:a.title}),e.jsx(y,{size:"small",fillColor:b[a.status].fill,textColor:b[a.status].text,children:q[a.status]})]})}),te=({item:a,graduated:s,highlighted:t,onPromote:r,onPromoteCandidate:l,onAddCandidate:c,onViewGraduated:o,onOpenGraduated:f})=>{const[p,h]=d.useState(t),u=a.candidates.length>0,{shipped:j,queued:g}=J(s);return e.jsxs("div",{className:`flex flex-col gap-1 ${t?"roadmap-item-highlighted outline outline-2 outline-offset-[-2px] outline-[rgba(200,154,90,0.5)]":""}`,children:[e.jsx(_,{size:"small",texture:"canvas",className:"plan-row-card",children:e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button","aria-expanded":p,"aria-label":p?"Collapse item":"Expand item",onClick:()=>h(x=>!x),className:`inline-flex items-center bg-transparent border-none cursor-pointer opacity-50 p-0 ${p?"rotate-90":""}`,children:e.jsx(Z,{})}),e.jsx("span",{className:"font-semibold flex-1",children:a.name}),e.jsx(v,{type:"button",variant:"ghost",size:"small",onClick:r,children:"Promote to idea"})]}),e.jsx("span",{className:`text-sm opacity-70 ${p?"":"line-clamp-2"}`,children:a.description}),e.jsxs("div",{className:"flex items-center gap-1",children:[(g>0||j>0)&&e.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-1 bg-transparent border-none p-0 cursor-pointer",children:[g>0&&e.jsxs(y,{size:"small",fillColor:b.planned.fill,textColor:b.planned.text,children:[g," in queue"]}),j>0&&e.jsxs(y,{size:"small",fillColor:b.done.fill,textColor:b.done.text,children:[j," shipped"]})]}),u&&e.jsxs(y,{size:"small",fillColor:"rgba(0, 0, 0, 0.06)",textColor:"rgba(0, 0, 0, 0.55)",children:[a.candidates.length," candidate",a.candidates.length===1?"":"s"]}),a.rollup.total>0&&e.jsxs(y,{size:"small",fillColor:b.planned.fill,textColor:b.planned.text,children:[a.rollup.done,"/",a.rollup.total," done"]})]}),a.links.length>0&&e.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:a.links.map(x=>e.jsx(ae,{link:x},x.id))})]})}),p&&e.jsxs("div",{className:"flex flex-col gap-1 pl-6",children:[a.candidates.map(x=>e.jsx(Q,{name:x,onPromote:()=>l(x)},x)),s.map(x=>e.jsx(se,{plan:x,onOpen:()=>f(x.title)},x.title)),e.jsx(X,{onAdd:c})]})]})},le=({goal:a})=>{const[s,t]=d.useState(!1),[r,...l]=a.split(/\n{2,}/),c=l.length>0;return e.jsxs("div",{className:"mb-6 pb-4 border-b border-black/[8%]",children:[e.jsx("span",{className:"font-handwritten text-xs font-semibold opacity-[0.55]",children:"The goal"}),e.jsxs("div",{className:"font-display-luminari text-lg leading-[1.4] mt-2",children:[e.jsx("div",{className:s?void 0:"line-clamp-1",children:e.jsx($,{children:r})}),s&&c&&e.jsx($,{children:l.join(`
|
|
2
|
-
|
|
3
|
-
`)})]}),c&&e.jsx("button",{type:"button",onClick:()=>t(o=>!o),className:"bg-transparent border-none p-0 mt-2 cursor-pointer text-2xs opacity-[0.65] underline",children:s?"Show less":"Show more"})]})},ne=[{id:"tree",label:"Outline"},{id:"map",label:"Board"},{id:"timeline",label:"Timeline"}],re=({mode:a,onChange:s})=>e.jsx("nav",{"aria-label":"Roadmap view",className:"flex gap-1 mb-4",children:ne.map(t=>e.jsx(v,{type:"button",variant:"ghost",size:"small",isActive:a===t.id,"aria-pressed":a===t.id,onClick:()=>s(t.id),children:t.label},t.id))}),P=({items:a,graduatedByItem:s})=>{const t=a.filter(l=>s(l).length>0).length,r=a.length-t;return e.jsxs("div",{className:W,children:[t," graduated · ",r," charted"]})},oe={created:"bg-watercolor-slate","task-run":"bg-watercolor-amber"},ie=({events:a,rangeStart:s,rangeEnd:t})=>{const r=t-s||1;return e.jsx("div",{className:"relative h-8 mx-1 border-b border-black/10",children:a.map((l,c)=>e.jsx("button",{type:"button",className:`absolute top-1/2 w-2.5 h-2.5 p-0 border-none rounded-full -translate-x-1/2 -translate-y-1/2 cursor-pointer ${oe[l.kind]}`,style:{left:`${(Date.parse(l.date)-s)/r*100}%`},title:`${l.itemName} — ${l.label} (${l.date})`,"aria-label":`${l.itemName} — ${l.label} (${l.date})`},`${l.entityId}-${l.kind}-${c}`))})},de=({item:a})=>{const s=a.rollup.total>0?Math.round(a.rollup.done/a.rollup.total*100):0;return e.jsxs("div",{className:"flex flex-col gap-1 py-2 px-2.5",children:[e.jsx("div",{className:"font-semibold text-sm",children:a.name}),e.jsx("div",{className:"h-1.5 rounded-full bg-black/[0.08] overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full ${a.rollup.total>0?"bg-watercolor-green":"bg-transparent"}`,style:{width:`${s}%`}})}),e.jsx("div",{className:"text-2xs opacity-50",children:a.rollup.total>0?`${a.rollup.done}/${a.rollup.total} done`:"not started"})]})},ce=({roadmap:a,graduatedByItem:s})=>e.jsx("div",{className:"flex flex-col gap-6",children:a.horizons.map(t=>e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("div",{className:A,children:t.title}),e.jsx(P,{items:t.items,graduatedByItem:s})]}),e.jsx("div",{className:"flex flex-wrap items-start gap-2.5",children:t.items.map(r=>e.jsx("div",{className:"flex-[1_1_240px] max-w-[320px] max-[480px]:flex-[1_1_100%] max-[480px]:max-w-none",children:e.jsx(de,{item:r})},r.name))})]},t.title))}),xe=({roadmap:a})=>{if(a.events.length===0)return e.jsx("p",{className:"opacity-50",children:"No dated events yet."});const s=a.events.map(l=>Date.parse(l.date)),t=Math.min(...s),r=Math.max(...s);return e.jsxs("div",{className:"flex flex-col gap-6",children:[a.horizons.map(l=>{const c=a.events.filter(o=>o.horizonTitle===l.title);return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("div",{className:A,children:l.title}),c.length===0?e.jsx("div",{className:"text-2xs font-normal px-1 py-0 opacity-40",children:"No events yet"}):e.jsx(ie,{events:c,rangeStart:t,rangeEnd:r})]},l.title)}),e.jsxs("div",{className:"flex justify-between text-2xs opacity-50",children:[e.jsx("span",{children:new Date(t).toLocaleDateString()}),e.jsx("span",{children:new Date(r).toLocaleDateString()})]})]})},me=()=>{const[a,s]=d.useState(null),[t,r]=d.useState(!0),[l,c]=d.useState(!1),[o,f]=d.useState(null),[p,h]=d.useState("tree"),u=S(n=>n.plans),j=B(),{item:g}=U({from:"/roadmap"}),x=d.useRef(null);if(d.useEffect(()=>{C().then(s).catch(()=>c(!0)).finally(()=>r(!1))},[]),d.useEffect(()=>{var i;if(!g||t)return;const n=(i=x.current)==null?void 0:i.querySelector(".roadmap-item-highlighted");n==null||n.scrollIntoView({behavior:"smooth",block:"center"})},[g,t]),t)return e.jsxs("div",{children:[e.jsx(E,{children:"Roadmap"}),e.jsx("p",{className:"opacity-50",children:"Loading…"})]});if(l)return e.jsxs("div",{children:[e.jsx(E,{children:"Roadmap"}),e.jsx("p",{className:"opacity-50",children:"Couldn't load the roadmap — the server may need a restart to pick up new routes."})]});if(!a||a.horizons.length===0)return e.jsxs("div",{children:[e.jsx(E,{children:"Roadmap"}),e.jsx("p",{className:"opacity-50",children:"No `ROADMAP.md` found at the project root."})]});const N=n=>(u==null?void 0:u.entries.filter(i=>i.subject===n.name))??[],R=async(n,i,m)=>{await F(n,i,m),s(await C())},k=async(n,i,m)=>{await V(n,i,m),s(await C())};return e.jsxs("div",{ref:x,children:[e.jsx(le,{goal:a.goal}),e.jsx(re,{mode:p,onChange:h}),p==="tree"&&e.jsx("div",{className:"flex flex-col gap-6",children:a.horizons.map(n=>e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("div",{className:A,children:n.title}),e.jsx(P,{items:n.items,graduatedByItem:N})]}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2.5",children:[n.items.map(i=>e.jsx("div",{className:"flex-[1_1_240px] max-w-[320px] max-[480px]:flex-[1_1_100%] max-[480px]:max-w-none",children:e.jsx(te,{item:i,graduated:N(i),highlighted:i.name===g,onPromote:()=>f({horizonTitle:n.title,item:i}),onPromoteCandidate:m=>f({horizonTitle:n.title,item:i,candidateName:m}),onAddCandidate:m=>k(n.title,i.name,m),onViewGraduated:()=>j({to:"/",search:{subject:i.name}}),onOpenGraduated:m=>j({to:"/plans/$planId",params:{planId:encodeURIComponent(m)}})})},i.name)),e.jsx("div",{className:"flex-[1_1_240px] max-w-[320px] max-[480px]:flex-[1_1_100%] max-[480px]:max-w-none",children:e.jsx(Y,{onAdd:(i,m)=>R(n.title,i,m)})})]})]},n.title))}),p==="map"&&e.jsx(ce,{roadmap:a,graduatedByItem:N}),p==="timeline"&&e.jsx(xe,{roadmap:a}),e.jsx(K,{horizonTitle:(o==null?void 0:o.horizonTitle)??null,item:(o==null?void 0:o.item)??null,candidateName:o==null?void 0:o.candidateName,onClose:()=>f(null),onPromoted:()=>C().then(s)})]})};export{me as RoadmapPage,fe as useRoadmapItemNames};
|
|
4
|
-
//# sourceMappingURL=index-C6vBW0wx.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-C6vBW0wx.js","sources":["../../../src/app/features/roadmap/promote-roadmap-item-modal.tsx","../../../src/app/features/roadmap/roadmap-page.tsx"],"sourcesContent":["import { buildRoadmapPromotePrompt } from '@/app/features/plans/prompts';\nimport { useSubjectVocabulary } from '@/app/hooks/use-subject-vocabulary';\nimport { useAppStore } from '@/app/stores/app-store';\nimport { oneLineErrorSummary } from '@/app/utils/error-summary';\nimport type { RoadmapItem } from '@/types/index';\nimport { Button, Modal, Select, useToast } from '@dendelion/paper-ui';\nimport { useEffect, useState } from 'react';\n\nconst NO_SUBJECT = '__no-subject__';\n\ninterface PromoteRoadmapItemModalProps {\n horizonTitle: string | null;\n item: RoadmapItem | null;\n candidateName?: string | null;\n onClose: () => void;\n onPromoted: () => void;\n}\n\nexport const PromoteRoadmapItemModal = ({\n horizonTitle,\n item,\n candidateName,\n onClose,\n onPromoted,\n}: PromoteRoadmapItemModalProps) => {\n const promoteRoadmapItem = useAppStore((s) => s.promoteRoadmapItem);\n const launchIdeaExtend = useAppStore((s) => s.launchIdeaExtend);\n const { subjects, available: subjectsAvailable } = useSubjectVocabulary();\n const [subject, setSubject] = useState(NO_SUBJECT);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const { toast } = useToast();\n\n useEffect(() => {\n if (item) {\n // A candidate defaults to its parent item's name — the \"big bet becomes a\n // Subject\" rule — but the picker still lets the user override it.\n setSubject(candidateName ? item.name : NO_SUBJECT);\n setLoading(false);\n setError(null);\n }\n }, [item, candidateName]);\n\n const handlePromote = async () => {\n if (!item || !horizonTitle) return;\n setLoading(true);\n setError(null);\n try {\n const id = await promoteRoadmapItem(\n horizonTitle,\n item,\n subject === NO_SUBJECT ? undefined : subject,\n candidateName ?? undefined,\n );\n const idea = useAppStore.getState().ideaEntries.find((e) => e.id === id);\n if (idea) {\n try {\n await launchIdeaExtend(id, buildRoadmapPromotePrompt(idea, horizonTitle));\n } catch (err) {\n // The idea was created either way — a failed refine launch just means\n // no background research ran, not that the promotion itself failed.\n toast({\n title: 'Idea created, but the refine agent failed to launch',\n description: oneLineErrorSummary((err as Error).message),\n variant: 'error',\n });\n }\n }\n onPromoted();\n onClose();\n } catch (err) {\n setError((err as Error).message);\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <Modal\n open={item !== null}\n onClose={onClose}\n title={candidateName ?? item?.name ?? ''}\n size=\"small\"\n >\n <div className=\"flex flex-col gap-4\">\n {!candidateName && <p className=\"m-0 opacity-80\">{item?.description}</p>}\n <div>\n <Select\n size=\"small\"\n value={subject}\n onChange={setSubject}\n disabled={loading || !subjectsAvailable}\n options={[\n { value: NO_SUBJECT, label: 'No subject' },\n ...(!subjectsAvailable && subject !== NO_SUBJECT\n ? [{ value: subject, label: subject }]\n : []),\n ...subjects.map((s) => ({ value: s, label: s })),\n ]}\n />\n </div>\n {error && <p className=\"m-0 text-watercolor-rose-dark text-sm\">{error}</p>}\n <div className=\"flex justify-end gap-2\">\n <Button type=\"button\" variant=\"ghost\" onClick={onClose} disabled={loading}>\n Cancel\n </Button>\n <Button type=\"button\" variant=\"primary\" onClick={handlePromote} disabled={loading}>\n {loading ? 'Promoting…' : 'Promote to idea'}\n </Button>\n </div>\n </div>\n </Modal>\n );\n};\n","import { Markdown } from '@/app/components/markdown';\nimport { PageTitle } from '@/app/components/page-title';\nimport { PrBadge } from '@/app/features/plans/components/pr-badge';\nimport { STATUS_LABEL, STATUS_STAMP } from '@/app/features/plans/constants';\nimport { addRoadmapCandidate, addRoadmapItem, fetchRoadmap } from '@/app/services/content/docs-api';\nimport { useAppStore } from '@/app/stores/app-store';\nimport type {\n PlanEntry,\n ResolvedRoadmap,\n ResolvedRoadmapItem,\n RoadmapEvent,\n RoadmapEventKind,\n RoadmapLink,\n} from '@/types/index';\nimport { Button, Card, Input, Stamp, Tooltip } from '@dendelion/paper-ui';\nimport { useNavigate, useSearch } from '@tanstack/react-router';\nimport { useEffect, useRef, useState } from 'react';\nimport { PromoteRoadmapItemModal } from './promote-roadmap-item-modal';\n\nconst graduationCounts = (graduated: PlanEntry[]) => ({\n shipped: graduated.filter((p) => p.status === 'done').length,\n queued: graduated.filter((p) => p.status !== 'done' && p.status !== 'dropped').length,\n});\n\nconst HORIZON_HEADER_CLASSES =\n 'font-handwritten text-md font-semibold opacity-70 leading-none pt-2 px-1 pb-0';\n\nconst HORIZON_PULSE_CLASSES = 'text-2xs font-normal px-1 py-0 opacity-50';\n\nconst ChevronRightIcon = ({ size = 14 }: { size?: number }) => (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <polyline points=\"9 18 15 12 9 6\" />\n </svg>\n);\n\nconst CandidateRow = ({\n name,\n onPromote,\n}: {\n name: string;\n onPromote: () => void;\n}) => (\n <Card size=\"small\" texture=\"kraft\" className=\"plan-row-card\">\n <div className=\"flex items-center gap-3\">\n <span className=\"flex-1\">{name}</span>\n <Button type=\"button\" variant=\"ghost\" size=\"small\" onClick={onPromote}>\n Promote to idea\n </Button>\n </div>\n </Card>\n);\n\nconst AddCandidateForm = ({ onAdd }: { onAdd: (name: string) => Promise<void> }) => {\n const [name, setName] = useState('');\n const [saving, setSaving] = useState(false);\n\n const handleAdd = async () => {\n if (!name.trim()) return;\n setSaving(true);\n try {\n await onAdd(name.trim());\n setName('');\n } finally {\n setSaving(false);\n }\n };\n\n return (\n <div className=\"flex gap-2\">\n <Input\n size=\"small\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleAdd();\n }}\n placeholder=\"Add option…\"\n disabled={saving}\n className=\"flex-1\"\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"small\"\n onClick={handleAdd}\n disabled={saving || !name.trim()}\n >\n Add\n </Button>\n </div>\n );\n};\n\nconst AddItemForm = ({\n onAdd,\n}: {\n onAdd: (name: string, description: string) => Promise<void>;\n}) => {\n const [open, setOpen] = useState(false);\n const [name, setName] = useState('');\n const [description, setDescription] = useState('');\n const [saving, setSaving] = useState(false);\n\n const handleAdd = async () => {\n if (!name.trim()) return;\n setSaving(true);\n try {\n await onAdd(name.trim(), description.trim());\n setName('');\n setDescription('');\n setOpen(false);\n } finally {\n setSaving(false);\n }\n };\n\n if (!open) {\n return (\n <Button type=\"button\" variant=\"ghost\" size=\"small\" onClick={() => setOpen(true)}>\n + Add item\n </Button>\n );\n }\n\n return (\n <div className=\"flex flex-col gap-2\">\n <Input\n size=\"small\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder=\"Item name…\"\n disabled={saving}\n autoFocus\n />\n <Input\n size=\"small\"\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter') handleAdd();\n }}\n placeholder=\"Description…\"\n disabled={saving}\n />\n <div className=\"flex justify-end gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"small\"\n onClick={() => setOpen(false)}\n disabled={saving}\n >\n Cancel\n </Button>\n <Button type=\"button\" size=\"small\" onClick={handleAdd} disabled={saving || !name.trim()}>\n Add\n </Button>\n </div>\n </div>\n );\n};\n\nconst plural = (count: number, noun: string) => `${count} ${noun}${count === 1 ? '' : 's'}`;\n\nconst RoadmapLinkTrail = ({ link }: { link: RoadmapLink }) => (\n <div className=\"flex items-center gap-1\">\n <Tooltip content={`${plural(link.taskRuns, 'task run')}${link.released ? ' · released' : ''}`}>\n <Stamp\n size=\"small\"\n fillColor={STATUS_STAMP[link.status].fill}\n textColor={STATUS_STAMP[link.status].text}\n >\n {link.id}\n </Stamp>\n </Tooltip>\n {link.pr && <PrBadge pr={link.pr} />}\n </div>\n);\n\nconst GraduatedRow = ({ plan, onOpen }: { plan: PlanEntry; onOpen: () => void }) => (\n <Card size=\"small\" texture=\"kraft\" className=\"plan-row-card\">\n <button\n type=\"button\"\n onClick={onOpen}\n className=\"flex items-center gap-3 w-full bg-transparent border-none p-0 cursor-pointer [font:inherit] text-inherit text-left\"\n >\n <span className=\"flex-1 overflow-hidden text-ellipsis whitespace-nowrap\">{plan.title}</span>\n <Stamp\n size=\"small\"\n fillColor={STATUS_STAMP[plan.status].fill}\n textColor={STATUS_STAMP[plan.status].text}\n >\n {STATUS_LABEL[plan.status]}\n </Stamp>\n </button>\n </Card>\n);\n\nconst RoadmapItemRow = ({\n item,\n graduated,\n highlighted,\n onPromote,\n onPromoteCandidate,\n onAddCandidate,\n onViewGraduated,\n onOpenGraduated,\n}: {\n item: ResolvedRoadmapItem;\n graduated: PlanEntry[];\n highlighted: boolean;\n onPromote: () => void;\n onPromoteCandidate: (candidateName: string) => void;\n onAddCandidate: (name: string) => Promise<void>;\n onViewGraduated: () => void;\n onOpenGraduated: (title: string) => void;\n}) => {\n const [expanded, setExpanded] = useState(highlighted);\n const hasCandidates = item.candidates.length > 0;\n const { shipped, queued } = graduationCounts(graduated);\n\n return (\n <div\n className={`flex flex-col gap-1 ${highlighted ? 'roadmap-item-highlighted outline outline-2 outline-offset-[-2px] outline-[rgba(200,154,90,0.5)]' : ''}`}\n >\n <Card size=\"small\" texture=\"canvas\" className=\"plan-row-card\">\n <div className=\"flex flex-col gap-1\">\n <div className=\"flex items-center gap-2\">\n {/* Raw <button>: icon-only toggle, paper-ui Button doesn't offer this compact chrome. */}\n <button\n type=\"button\"\n aria-expanded={expanded}\n aria-label={expanded ? 'Collapse item' : 'Expand item'}\n onClick={() => setExpanded((v) => !v)}\n className={`inline-flex items-center bg-transparent border-none cursor-pointer opacity-50 p-0 ${expanded ? 'rotate-90' : ''}`}\n >\n <ChevronRightIcon />\n </button>\n <span className=\"font-semibold flex-1\">{item.name}</span>\n <Button type=\"button\" variant=\"ghost\" size=\"small\" onClick={onPromote}>\n Promote to idea\n </Button>\n </div>\n <span className={`text-sm opacity-70 ${expanded ? '' : 'line-clamp-2'}`}>\n {item.description}\n </span>\n <div className=\"flex items-center gap-1\">\n {(queued > 0 || shipped > 0) && (\n <button\n type=\"button\"\n onClick={onViewGraduated}\n className=\"flex items-center gap-1 bg-transparent border-none p-0 cursor-pointer\"\n >\n {queued > 0 && (\n <Stamp\n size=\"small\"\n fillColor={STATUS_STAMP.planned.fill}\n textColor={STATUS_STAMP.planned.text}\n >\n {queued} in queue\n </Stamp>\n )}\n {shipped > 0 && (\n <Stamp\n size=\"small\"\n fillColor={STATUS_STAMP.done.fill}\n textColor={STATUS_STAMP.done.text}\n >\n {shipped} shipped\n </Stamp>\n )}\n </button>\n )}\n {hasCandidates && (\n <Stamp size=\"small\" fillColor=\"rgba(0, 0, 0, 0.06)\" textColor=\"rgba(0, 0, 0, 0.55)\">\n {item.candidates.length} candidate{item.candidates.length === 1 ? '' : 's'}\n </Stamp>\n )}\n {item.rollup.total > 0 && (\n <Stamp\n size=\"small\"\n fillColor={STATUS_STAMP.planned.fill}\n textColor={STATUS_STAMP.planned.text}\n >\n {item.rollup.done}/{item.rollup.total} done\n </Stamp>\n )}\n </div>\n {item.links.length > 0 && (\n <div className=\"flex items-center gap-1 flex-wrap\">\n {item.links.map((link) => (\n <RoadmapLinkTrail key={link.id} link={link} />\n ))}\n </div>\n )}\n </div>\n </Card>\n {expanded && (\n <div className=\"flex flex-col gap-1 pl-6\">\n {item.candidates.map((candidateName) => (\n <CandidateRow\n key={candidateName}\n name={candidateName}\n onPromote={() => onPromoteCandidate(candidateName)}\n />\n ))}\n {graduated.map((plan) => (\n <GraduatedRow key={plan.title} plan={plan} onOpen={() => onOpenGraduated(plan.title)} />\n ))}\n <AddCandidateForm onAdd={onAddCandidate} />\n </div>\n )}\n </div>\n );\n};\n\nconst GoalBanner = ({ goal }: { goal: string }) => {\n const [expanded, setExpanded] = useState(false);\n const [firstParagraph, ...restParagraphs] = goal.split(/\\n{2,}/);\n const hasMore = restParagraphs.length > 0;\n\n return (\n <div className=\"mb-6 pb-4 border-b border-black/[8%]\">\n <span className=\"font-handwritten text-xs font-semibold opacity-[0.55]\">The goal</span>\n <div className=\"font-display-luminari text-lg leading-[1.4] mt-2\">\n <div className={expanded ? undefined : 'line-clamp-1'}>\n <Markdown>{firstParagraph}</Markdown>\n </div>\n {expanded && hasMore && <Markdown>{restParagraphs.join('\\n\\n')}</Markdown>}\n </div>\n {hasMore && (\n <button\n type=\"button\"\n onClick={() => setExpanded((v) => !v)}\n className=\"bg-transparent border-none p-0 mt-2 cursor-pointer text-2xs opacity-[0.65] underline\"\n >\n {expanded ? 'Show less' : 'Show more'}\n </button>\n )}\n </div>\n );\n};\n\ntype RoadmapViewMode = 'tree' | 'map' | 'timeline';\n\nconst VIEW_MODES: { id: RoadmapViewMode; label: string }[] = [\n { id: 'tree', label: 'Outline' },\n { id: 'map', label: 'Board' },\n { id: 'timeline', label: 'Timeline' },\n];\n\nconst RoadmapViewModeSwitch = ({\n mode,\n onChange,\n}: {\n mode: RoadmapViewMode;\n onChange: (mode: RoadmapViewMode) => void;\n}) => (\n <nav aria-label=\"Roadmap view\" className=\"flex gap-1 mb-4\">\n {VIEW_MODES.map((viewMode) => (\n <Button\n key={viewMode.id}\n type=\"button\"\n variant=\"ghost\"\n size=\"small\"\n isActive={mode === viewMode.id}\n aria-pressed={mode === viewMode.id}\n onClick={() => onChange(viewMode.id)}\n >\n {viewMode.label}\n </Button>\n ))}\n </nav>\n);\n\nconst HorizonPulse = ({\n items,\n graduatedByItem,\n}: {\n items: ResolvedRoadmapItem[];\n graduatedByItem: (item: ResolvedRoadmapItem) => PlanEntry[];\n}) => {\n const graduated = items.filter((item) => graduatedByItem(item).length > 0).length;\n const charted = items.length - graduated;\n return (\n <div className={HORIZON_PULSE_CLASSES}>\n {graduated} graduated · {charted} charted\n </div>\n );\n};\n\nconst EVENT_KIND_COLOR: Record<RoadmapEventKind, string> = {\n created: 'bg-watercolor-slate',\n 'task-run': 'bg-watercolor-amber',\n};\n\nconst RoadmapTimelineTrack = ({\n events,\n rangeStart,\n rangeEnd,\n}: {\n events: RoadmapEvent[];\n rangeStart: number;\n rangeEnd: number;\n}) => {\n const span = rangeEnd - rangeStart || 1;\n return (\n <div className=\"relative h-8 mx-1 border-b border-black/10\">\n {events.map((event, i) => (\n <button\n type=\"button\"\n key={`${event.entityId}-${event.kind}-${i}`}\n className={`absolute top-1/2 w-2.5 h-2.5 p-0 border-none rounded-full -translate-x-1/2 -translate-y-1/2 cursor-pointer ${EVENT_KIND_COLOR[event.kind]}`}\n style={{\n left: `${((Date.parse(event.date) - rangeStart) / span) * 100}%`,\n }}\n title={`${event.itemName} — ${event.label} (${event.date})`}\n aria-label={`${event.itemName} — ${event.label} (${event.date})`}\n />\n ))}\n </div>\n );\n};\n\nconst RoadmapMapItem = ({ item }: { item: ResolvedRoadmapItem }) => {\n const percent =\n item.rollup.total > 0 ? Math.round((item.rollup.done / item.rollup.total) * 100) : 0;\n return (\n <div className=\"flex flex-col gap-1 py-2 px-2.5\">\n <div className=\"font-semibold text-sm\">{item.name}</div>\n <div className=\"h-1.5 rounded-full bg-black/[0.08] overflow-hidden\">\n <div\n className={`h-full rounded-full ${item.rollup.total > 0 ? 'bg-watercolor-green' : 'bg-transparent'}`}\n style={{\n width: `${percent}%`,\n }}\n />\n </div>\n <div className=\"text-2xs opacity-50\">\n {item.rollup.total > 0 ? `${item.rollup.done}/${item.rollup.total} done` : 'not started'}\n </div>\n </div>\n );\n};\n\nconst RoadmapMap = ({\n roadmap,\n graduatedByItem,\n}: {\n roadmap: ResolvedRoadmap;\n graduatedByItem: (item: ResolvedRoadmapItem) => PlanEntry[];\n}) => (\n <div className=\"flex flex-col gap-6\">\n {roadmap.horizons.map((horizon) => (\n <div key={horizon.title} className=\"flex flex-col gap-1\">\n <div className=\"flex items-baseline gap-2\">\n <div className={HORIZON_HEADER_CLASSES}>{horizon.title}</div>\n <HorizonPulse items={horizon.items} graduatedByItem={graduatedByItem} />\n </div>\n <div className=\"flex flex-wrap items-start gap-2.5\">\n {horizon.items.map((item) => (\n <div\n key={item.name}\n className=\"flex-[1_1_240px] max-w-[320px] max-[480px]:flex-[1_1_100%] max-[480px]:max-w-none\"\n >\n <RoadmapMapItem item={item} />\n </div>\n ))}\n </div>\n </div>\n ))}\n </div>\n);\n\nconst RoadmapTimeline = ({ roadmap }: { roadmap: ResolvedRoadmap }) => {\n if (roadmap.events.length === 0) {\n return <p className=\"opacity-50\">No dated events yet.</p>;\n }\n\n const dates = roadmap.events.map((event) => Date.parse(event.date));\n const rangeStart = Math.min(...dates);\n const rangeEnd = Math.max(...dates);\n\n return (\n <div className=\"flex flex-col gap-6\">\n {roadmap.horizons.map((horizon) => {\n const events = roadmap.events.filter((event) => event.horizonTitle === horizon.title);\n return (\n <div key={horizon.title} className=\"flex flex-col gap-1\">\n <div className={HORIZON_HEADER_CLASSES}>{horizon.title}</div>\n {events.length === 0 ? (\n <div className=\"text-2xs font-normal px-1 py-0 opacity-40\">No events yet</div>\n ) : (\n <RoadmapTimelineTrack events={events} rangeStart={rangeStart} rangeEnd={rangeEnd} />\n )}\n </div>\n );\n })}\n <div className=\"flex justify-between text-2xs opacity-50\">\n <span>{new Date(rangeStart).toLocaleDateString()}</span>\n <span>{new Date(rangeEnd).toLocaleDateString()}</span>\n </div>\n </div>\n );\n};\n\nexport const RoadmapPage = () => {\n const [roadmap, setRoadmap] = useState<ResolvedRoadmap | null>(null);\n const [loading, setLoading] = useState(true);\n const [loadFailed, setLoadFailed] = useState(false);\n const [promoting, setPromoting] = useState<{\n horizonTitle: string;\n item: ResolvedRoadmapItem;\n candidateName?: string;\n } | null>(null);\n const [viewMode, setViewMode] = useState<RoadmapViewMode>('tree');\n const plans = useAppStore((s) => s.plans);\n const navigate = useNavigate();\n const { item: highlightedItem } = useSearch({ from: '/roadmap' });\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n fetchRoadmap()\n .then(setRoadmap)\n .catch(() => setLoadFailed(true))\n .finally(() => setLoading(false));\n }, []);\n\n useEffect(() => {\n if (!highlightedItem || loading) return;\n const row = containerRef.current?.querySelector('.roadmap-item-highlighted');\n row?.scrollIntoView({ behavior: 'smooth', block: 'center' });\n }, [highlightedItem, loading]);\n\n if (loading) {\n return (\n <div>\n <PageTitle>Roadmap</PageTitle>\n <p className=\"opacity-50\">Loading…</p>\n </div>\n );\n }\n\n if (loadFailed) {\n return (\n <div>\n <PageTitle>Roadmap</PageTitle>\n <p className=\"opacity-50\">\n Couldn't load the roadmap — the server may need a restart to pick up new routes.\n </p>\n </div>\n );\n }\n\n if (!roadmap || roadmap.horizons.length === 0) {\n return (\n <div>\n <PageTitle>Roadmap</PageTitle>\n <p className=\"opacity-50\">No `ROADMAP.md` found at the project root.</p>\n </div>\n );\n }\n\n const graduatedByItem = (item: ResolvedRoadmapItem) =>\n plans?.entries.filter((p) => p.subject === item.name) ?? [];\n\n const handleAddItem = async (horizonTitle: string, name: string, description: string) => {\n await addRoadmapItem(horizonTitle, name, description);\n setRoadmap(await fetchRoadmap());\n };\n\n const handleAddCandidate = async (horizonTitle: string, itemName: string, name: string) => {\n await addRoadmapCandidate(horizonTitle, itemName, name);\n setRoadmap(await fetchRoadmap());\n };\n\n return (\n <div ref={containerRef}>\n <GoalBanner goal={roadmap.goal} />\n <RoadmapViewModeSwitch mode={viewMode} onChange={setViewMode} />\n {viewMode === 'tree' && (\n <div className=\"flex flex-col gap-6\">\n {roadmap.horizons.map((horizon) => (\n <div key={horizon.title} className=\"flex flex-col gap-1\">\n <div className=\"flex items-baseline gap-2\">\n <div className={HORIZON_HEADER_CLASSES}>{horizon.title}</div>\n <HorizonPulse items={horizon.items} graduatedByItem={graduatedByItem} />\n </div>\n <div className=\"flex flex-wrap items-start gap-2.5\">\n {horizon.items.map((item) => (\n <div\n key={item.name}\n className=\"flex-[1_1_240px] max-w-[320px] max-[480px]:flex-[1_1_100%] max-[480px]:max-w-none\"\n >\n <RoadmapItemRow\n item={item}\n graduated={graduatedByItem(item)}\n highlighted={item.name === highlightedItem}\n onPromote={() => setPromoting({ horizonTitle: horizon.title, item })}\n onPromoteCandidate={(candidateName) =>\n setPromoting({ horizonTitle: horizon.title, item, candidateName })\n }\n onAddCandidate={(name) => handleAddCandidate(horizon.title, item.name, name)}\n onViewGraduated={() => navigate({ to: '/', search: { subject: item.name } })}\n onOpenGraduated={(title) =>\n navigate({\n to: '/plans/$planId',\n params: { planId: encodeURIComponent(title) },\n })\n }\n />\n </div>\n ))}\n <div className=\"flex-[1_1_240px] max-w-[320px] max-[480px]:flex-[1_1_100%] max-[480px]:max-w-none\">\n <AddItemForm\n onAdd={(name, description) => handleAddItem(horizon.title, name, description)}\n />\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n {viewMode === 'map' && <RoadmapMap roadmap={roadmap} graduatedByItem={graduatedByItem} />}\n {viewMode === 'timeline' && <RoadmapTimeline roadmap={roadmap} />}\n <PromoteRoadmapItemModal\n horizonTitle={promoting?.horizonTitle ?? null}\n item={promoting?.item ?? null}\n candidateName={promoting?.candidateName}\n onClose={() => setPromoting(null)}\n onPromoted={() => fetchRoadmap().then(setRoadmap)}\n />\n </div>\n );\n};\n"],"names":["NO_SUBJECT","PromoteRoadmapItemModal","horizonTitle","item","candidateName","onClose","onPromoted","promoteRoadmapItem","useAppStore","s","launchIdeaExtend","subjects","subjectsAvailable","useSubjectVocabulary","subject","setSubject","useState","loading","setLoading","error","setError","toast","useToast","useEffect","handlePromote","id","idea","e","buildRoadmapPromotePrompt","err","oneLineErrorSummary","jsx","Modal","jsxs","Select","Button","graduationCounts","graduated","p","HORIZON_HEADER_CLASSES","HORIZON_PULSE_CLASSES","ChevronRightIcon","size","CandidateRow","name","onPromote","Card","AddCandidateForm","onAdd","setName","saving","setSaving","handleAdd","Input","AddItemForm","open","setOpen","description","setDescription","plural","count","noun","RoadmapLinkTrail","link","Tooltip","Stamp","STATUS_STAMP","PrBadge","GraduatedRow","plan","onOpen","STATUS_LABEL","RoadmapItemRow","highlighted","onPromoteCandidate","onAddCandidate","onViewGraduated","onOpenGraduated","expanded","setExpanded","hasCandidates","shipped","queued","v","GoalBanner","goal","firstParagraph","restParagraphs","hasMore","Markdown","VIEW_MODES","RoadmapViewModeSwitch","mode","onChange","viewMode","HorizonPulse","items","graduatedByItem","charted","EVENT_KIND_COLOR","RoadmapTimelineTrack","events","rangeStart","rangeEnd","span","event","i","RoadmapMapItem","percent","RoadmapMap","roadmap","horizon","RoadmapTimeline","dates","RoadmapPage","setRoadmap","loadFailed","setLoadFailed","promoting","setPromoting","setViewMode","plans","navigate","useNavigate","highlightedItem","useSearch","containerRef","useRef","fetchRoadmap","row","_a","PageTitle","handleAddItem","addRoadmapItem","handleAddC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AMa,CAAW,CAAA,CAAA,CAC9E,CACF,CAAA,CAAA,CACF,CAAA,CAAA,EAnCQsD,EAAQ,KAoClB,CACD,EACH,EAEDjB,IAAa,OAAS/D,EAAAA,IAAC8E,GAAA,CAAW,QAAAC,EAAkB,gBAAAb,EAAkC,EACtFH,IAAa,YAAc/D,EAAAA,IAACiF,GAAA,CAAgB,QAAAF,CAAA,CAAkB,EAC/D/E,EAAAA,IAAC9B,EAAA,CACC,cAAcqH,GAAA,YAAAA,EAAW,eAAgB,KACzC,MAAMA,GAAA,YAAAA,EAAW,OAAQ,KACzB,cAAeA,GAAA,YAAAA,EAAW,cAC1B,QAAS,IAAMC,EAAa,IAAI,EAChC,WAAY,IAAMS,IAAe,KAAKb,CAAU,CAAA,CAAA,CAClD,EACF,CAEJ"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as d,k as _,j as e,l as M,U as P,w as F,J as f,p as v,c as V,e as K,g as se,h as te,s as D,u as T,V as X,m as ae,a as Q,n as Z,P as ne,q as le,o as G,D as z,t as ie,A as O,v as q,x as oe,z as re,i as L}from"./main-Ba3mXsWY.js";import{c as ce}from"./tokens-C3C44lLs.js";import{S as W}from"./sidebar-section-B3aJWLXB.js";const de=async()=>{try{const s=await fetch("/api/merge-policy");return s.ok?await s.json():null}catch{return null}},me=async()=>{try{const s=await fetch("/api/merge-policy/apply",{method:"POST"});return s.ok?await s.json():null}catch{return null}},ee={allowSquashMerge:!0,allowMergeCommit:!1,allowRebaseMerge:!1,squashMergeCommitTitle:"PR_TITLE",squashMergeCommitMessage:"PR_BODY"},B=[{key:"allowSquashMerge",label:"Allow squash merge"},{key:"allowMergeCommit",label:"Allow merge commit"},{key:"allowRebaseMerge",label:"Allow rebase merge"},{key:"squashMergeCommitTitle",label:"Squash commit title"},{key:"squashMergeCommitMessage",label:"Squash commit message"}];function $(s){return typeof s=="boolean"?s?"Yes":"No":s}function pe(s){return B.every(t=>s[t.key]===ee[t.key])}const he=({label:s,current:t,recommended:r,isLast:l})=>{const p=t===r;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-3 pb-2 pt-2",children:[e.jsx("span",{className:"flex-1",children:s}),e.jsx("span",{className:p?"opacity-[0.65] font-normal":"font-semibold",children:$(t)}),!p&&e.jsxs("span",{className:"opacity-[0.45]",children:["→ ",$(r)]})]}),!l&&e.jsx(v,{})]})},ue=()=>{const[s,t]=d.useState(void 0),[r,l]=d.useState(!1),{toast:p}=_();d.useEffect(()=>{de().then(t)},[]);const u=async()=>{l(!0);const n=await me();l(!1),(n==null?void 0:n.status)==="ok"?(t(n),p({title:"Merge policy applied",variant:"success"})):p({title:"Failed to apply merge policy",description:(n==null?void 0:n.status)==="unavailable"?n.reason:void 0,variant:"error"})},h=(s==null?void 0:s.status)==="ok"&&pe(s.policy);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"m-0",children:"Merge Policy"}),e.jsx("p",{className:"opacity-50 mt-1",children:"Paper Camp's canonical policy: squash-only merges, with the commit title and body taken from the PR."})]}),s===void 0&&e.jsx("p",{children:"Loading…"}),s===null&&e.jsx(M,{variant:"warning",children:"Failed to load merge policy."}),(s==null?void 0:s.status)==="unavailable"&&e.jsx(M,{variant:"warning",children:s.reason}),(s==null?void 0:s.status)==="ok"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("span",{className:"font-medium",children:s.repo}),e.jsx(P,{size:"small",fillColor:h?"rgba(143, 185, 150, 0.25)":"rgba(212, 163, 115, 0.25)",textColor:h?"#5E8A66":"#A67B4F",children:h?"Matches recommended policy":"Differs from recommended policy"})]}),e.jsx(F,{size:"small",texture:"kraft",children:B.map((n,c)=>e.jsx(he,{label:n.label,current:s.policy[n.key],recommended:ee[n.key],isLast:c===B.length-1},n.key))}),e.jsx("div",{className:"mt-4",children:e.jsx(f,{size:"small",onClick:u,disabled:r||h,children:r?"Applying…":"Apply recommended policy"})})]})]})},xe=2e3,je="agent:claude-code",ge=["claude auth login","claude setup-token"],fe=()=>e.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[e.jsx("p",{className:"opacity-[0.65] text-sm m-0",children:"The in-app relay couldn't complete. Run one of these in a terminal instead:"}),ge.map(s=>e.jsx(X,{code:s},s)),e.jsxs("p",{className:"opacity-50 text-sm m-0",children:["Alternatively, set ",e.jsx("code",{children:"ANTHROPIC_API_KEY"})," in the server's environment — that bills as API usage rather than your Max subscription, so treat it as a fallback, not the default."]})]}),be=({onSignedIn:s})=>{const t=T(c=>c.loginRelay),r=T(c=>c.startLoginRelay),l=T(c=>c.loadLoginRelayStatus),p=T(c=>c.cancelLoginRelay),{toast:u}=_(),h=d.useRef(null),n=t==null?void 0:t.phase;return d.useEffect(()=>{if(n!=="starting"&&n!=="awaiting-authorization")return;const c=window.setInterval(()=>l(),xe);return()=>window.clearInterval(c)},[n,l]),d.useEffect(()=>{const c=t==null?void 0:t.authorizeUrl;n!=="awaiting-authorization"||!c||h.current===c||(h.current=c,window.open(c,"_blank","noopener,noreferrer"))},[n,t==null?void 0:t.authorizeUrl]),d.useEffect(()=>{n==="success"?(u({title:"Signed in",variant:"success"}),s()):n==="error"&&u({title:"Sign-in failed",description:t==null?void 0:t.error,variant:"error"})},[n]),n==="starting"?e.jsx(f,{size:"small",disabled:!0,children:"Starting…"}):n==="awaiting-authorization"?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{size:"small",onClick:()=>(t==null?void 0:t.authorizeUrl)&&window.open(t.authorizeUrl,"_blank","noopener,noreferrer"),children:"Reopen sign-in tab"}),e.jsx(f,{size:"small",onClick:()=>p(),children:"Cancel"})]}):e.jsxs("div",{children:[e.jsx(f,{size:"small",onClick:()=>r(),children:"Sign in"}),n==="error"&&e.jsx(fe,{})]})},ve={ok:{fill:"rgba(143, 185, 150, 0.25)",text:"#5E8A66",label:"Ready"},warn:{fill:"rgba(212, 163, 115, 0.25)",text:"#A67B4F",label:"Needs attention"},missing:{fill:"rgba(201, 139, 139, 0.25)",text:"#6E3A3A",label:"Missing"}},ye=({connection:s,onConnect:t,connecting:r})=>{const{connect:l}=s;return l?l.kind==="command"&&l.runnable?e.jsx(f,{size:"small",onClick:()=>t(s.id),disabled:r,children:r?"Running…":`Run \`${l.command}\``}):l.kind==="command"?e.jsx("div",{className:"mt-2",children:e.jsx(X,{code:l.command})}):l.kind==="link"?e.jsx(f,{size:"small",onClick:()=>window.open(l.url,"_blank","noopener,noreferrer"),children:l.label}):e.jsx("p",{className:"opacity-[0.65] text-sm mt-2 mx-0 mb-0",children:l.message}):null},Ne=({connection:s,isLast:t,onRecheck:r,rechecking:l,onConnect:p,connecting:u})=>{const h=ve[s.status];return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"pb-3 pt-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"flex-1 font-medium",children:s.label}),s.authenticated===!1&&e.jsx(se,{content:"Installed, but not signed in",children:e.jsx(P,{size:"small",variant:"warning",children:"Not signed in"})}),e.jsx(P,{size:"small",fillColor:h.fill,textColor:h.text,children:h.label}),e.jsx(f,{size:"small",onClick:()=>r(s.id),disabled:l,children:l?"Checking…":"Recheck"})]}),e.jsxs("p",{className:"opacity-[0.65] text-sm mt-1 mx-0 mb-0",children:["Unlocks: ",s.unlocks]}),e.jsx("p",{className:"opacity-50 text-sm mt-1 mx-0 mb-0",children:s.detail}),e.jsx("div",{className:"mt-2",children:s.id===je&&s.authenticated===!1?e.jsx(be,{onSignedIn:()=>r(s.id)}):e.jsx(ye,{connection:s,onConnect:p,connecting:u})})]}),!t&&e.jsx(v,{})]})},Se=()=>{const[s,t]=d.useState(null),[r,l]=d.useState(!1),[p,u]=d.useState(null),[h,n]=d.useState(null),[c,S]=d.useState(!1),{toast:y}=_(),N=d.useCallback(i=>{if(i===null){l(!0);return}l(!1),t(i)},[]);d.useEffect(()=>{V().then(N),K().then(i=>S((i==null?void 0:i.setupDismissed)??!1))},[N]);const A=async i=>{u(i),N(await V()),u(null)},m=async i=>{n(i);const b=await te(i);b?t(C=>(C==null?void 0:C.map(R=>R.id===i?b:R))??C):y({title:"Failed to connect",variant:"error"}),n(null)},x=async()=>{const i=!c,{ok:b}=await D({setupDismissed:i});b?(S(i),y({title:"Saved",variant:"success"})):y({title:"Failed to save",variant:"error"})},k=(s==null?void 0:s.every(i=>i.status==="ok"))??!0;return e.jsxs("div",{children:[e.jsx("div",{className:"mb-6",children:e.jsx("h2",{className:"m-0",children:"Setup"})}),s===null&&!r&&e.jsx("p",{children:"Loading…"}),r&&e.jsx("div",{className:"mb-4",children:e.jsx(M,{variant:"warning",children:"Failed to load connections. Try refreshing."})}),s&&e.jsxs(e.Fragment,{children:[!k&&e.jsx("div",{className:"mb-4",children:e.jsx(M,{variant:"warning",children:"Some connections are incomplete — features that depend on them stay disabled until fixed. Run the connect command below, then recheck."})}),e.jsx(F,{size:"small",texture:"kraft",children:s.map((i,b)=>e.jsx(Ne,{connection:i,isLast:b===s.length-1,onRecheck:A,rechecking:p===i.id,onConnect:m,connecting:h===i.id},i.id))}),e.jsx("div",{className:"mt-4",children:e.jsx(f,{size:"small",onClick:x,children:c?"Show Setup on open again":"Don't show Setup on open"})})]})]})},ke=()=>{const{subjects:s,loading:t,available:r}=ae(),l=Q();return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"m-0",children:"Subjects"}),e.jsx("p",{className:"opacity-50 mt-1",children:"Subjects are the roadmap's bets and standing concerns. Edit the vocabulary on the Roadmap page."})]}),t&&e.jsx("p",{children:"Loading…"}),!t&&!r&&e.jsx("p",{className:"opacity-60 m-0",children:"Couldn't load subjects — check the server config."}),!t&&r&&e.jsxs(F,{size:"small",texture:"kraft",children:[s.length===0&&e.jsx("p",{className:"opacity-[0.45] m-0 pb-2",children:"No subjects yet."}),s.map((p,u)=>e.jsxs("div",{children:[e.jsx("div",{className:"pb-2 pt-2",children:p}),u<s.length-1&&e.jsx(v,{})]},p)),s.length>0&&e.jsx(v,{}),e.jsx("div",{className:"pt-3",children:e.jsx(f,{size:"small",onClick:()=>l({to:"/roadmap"}),children:"Go to Roadmap"})})]})]})},J=["phase","planDraft","ideaExtend","commitSuggest","feedback"],we={phase:"Phase run",planDraft:"Plan draft",ideaExtend:"Idea extend",commitSuggest:"Commit suggest",feedback:"Scout chat"},Ae=140,Ce=160,Ee=110,Ie=()=>e.jsxs("div",{className:"flex items-center gap-3 pb-1",children:[e.jsx("span",{className:"w-[110px] shrink-0 text-sm opacity-[0.45]",children:"Task"}),e.jsx("span",{className:"w-[140px] shrink-0 text-sm opacity-[0.45]",children:"Agent"}),e.jsx("span",{className:"w-[160px] shrink-0 text-sm opacity-[0.45]",children:"Model"}),e.jsx("span",{className:"w-[110px] shrink-0 text-sm opacity-[0.45]",children:"Effort"})]}),ze=({taskKey:s,agentConfig:t,isLast:r,onSave:l})=>{const p=O[t.agent]??O["claude-code"],u=p.model,h=p.effort,[n,c]=d.useState(t.model??"");d.useEffect(()=>{c(t.model??"")},[t.model]);const S=m=>{var b;const x=m,k=O[x],i={agent:x};t.model&&(k.model===null||(b=k.model)!=null&&b.includes(t.model))&&(i.model=t.model),t.effort&&Array.isArray(k.effort)&&(i.effort=t.effort),l(s,i)},y=m=>{l(s,{...t,model:m||void 0})},N=()=>{l(s,{...t,model:n||void 0})},A=m=>{l(s,{...t,effort:m||void 0})};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-3 pb-2 pt-2",children:[e.jsx("span",{className:"w-[110px] shrink-0 text-sm opacity-[0.65]",children:we[s]}),e.jsx(q,{size:"small",width:Ae,value:t.agent,onChange:S,options:oe.map(m=>({value:m,label:re[m]}))}),Array.isArray(u)?e.jsx(q,{size:"small",width:Ce,value:t.model??"",onChange:y,options:[{value:"",label:"Default"},...u.map(m=>({value:m,label:m}))]}):u===null?e.jsx(G,{size:"small",className:"w-[160px]",value:n,placeholder:"Default model",onChange:m=>c(m.target.value),onBlur:N}):null,e.jsx("div",{className:Array.isArray(h)?"visible":"invisible",children:e.jsx(q,{size:"small",width:Ee,value:t.effort??"",onChange:A,options:[{value:"",label:"Default"},...(Array.isArray(h)?h:[]).map(m=>({value:m,label:m}))]})})]}),!r&&e.jsx(v,{})]})},De=()=>{var Y,H;const s=d.useRef(null),[t,r]=d.useState(void 0),{iconDataUri:l,loading:p}=le(),[u,h]=d.useState(null),n=u??l,[c,S]=d.useState(!1),[y,N]=d.useState(""),[A,m]=d.useState(""),{toast:x}=_();d.useEffect(()=>{K().then(a=>{r(a),(a==null?void 0:a.port)!==void 0&&N(String(a.port)),(a==null?void 0:a.projectName)!==void 0&&m(a.projectName)})},[]);const k=async(a,g)=>{const o=t==null?void 0:t.defaultAgents,j={phase:(o==null?void 0:o.phase)??z.phase,planDraft:(o==null?void 0:o.planDraft)??z.planDraft,ideaExtend:(o==null?void 0:o.ideaExtend)??z.ideaExtend,commitSuggest:(o==null?void 0:o.commitSuggest)??z.commitSuggest,feedback:(o==null?void 0:o.feedback)??z.feedback,[a]:g},{ok:w,error:E}=await D({defaultAgents:j});w?(r(I=>I&&{...I,defaultAgents:j}),x({title:"Saved",variant:"success"})):x({title:"Failed to save",description:E,variant:"error"})},i=async()=>{const a=Number(y);if(!t||!Number.isInteger(a)||a<=0||a===t.port)return;const{ok:g,error:o}=await D({port:a});g?(r(j=>j&&{...j,port:a}),x({title:"Saved",description:"Restart `paper-camp dev` to apply the new port.",variant:"success"})):x({title:"Failed to save",description:o,variant:"error"})},b=async()=>{var w,E,I;if(!t)return;const a=!(((E=(w=t.integration)==null?void 0:w.toolbar)==null?void 0:E.enabled)??!0),g={...t.integration,toolbar:{...(I=t.integration)==null?void 0:I.toolbar,enabled:a}},{ok:o,error:j}=await D({integration:g});o?(r(U=>U&&{...U,integration:g}),x({title:"Saved",variant:"success"})):x({title:"Failed to save",description:j,variant:"error"})},C=async()=>{const a=A.trim();if(!t||!a||a===t.projectName)return;const{ok:g,error:o}=await D({projectName:a});g?(r(j=>j&&{...j,projectName:a}),m(a),x({title:"Saved",variant:"success"})):x({title:"Failed to save",description:o,variant:"error"})},R=async a=>{var j;const g=(j=a.target.files)==null?void 0:j[0];if(!g)return;S(!0);const o=new FileReader;o.onloadend=async()=>{const w=o.result,E=await ie(w);S(!1),E?(h(w),x({title:"Saved",variant:"success"})):x({title:"Failed to save",variant:"error"})},o.readAsDataURL(g)};return e.jsxs("div",{children:[e.jsx("div",{className:"mb-6",children:e.jsx("h2",{className:"m-0",children:"Project Info"})}),t===void 0&&e.jsx("p",{children:"Loading…"}),t===null&&e.jsxs(M,{variant:"warning",children:["No papercamp/config.json found — run ",e.jsx("code",{children:"paper-camp init"})," in this directory first."]}),t&&e.jsxs(F,{size:"small",texture:"kraft",children:[e.jsxs("div",{className:"flex items-end gap-3 pb-3",children:[e.jsx(G,{value:A,onChange:a=>m(a.target.value),onBlur:C,label:"Project Name"}),e.jsxs(P,{size:"small",fillColor:"rgba(143, 185, 150, 0.25)",textColor:ce.accentGreenDark,children:["v",t.version]})]}),e.jsx(v,{}),e.jsxs("div",{className:"flex items-center gap-3 pb-3 pt-3",children:[n&&e.jsx("img",{src:n,alt:"Project icon",className:"w-10 h-10 object-contain shrink-0 rounded"}),e.jsxs("div",{children:[e.jsx("input",{ref:s,type:"file",accept:".svg,.png,.jpg,.jpeg,.gif,.webp",onChange:R,className:"hidden"}),e.jsx(f,{size:"small",onClick:()=>{var a;return(a=s.current)==null?void 0:a.click()},disabled:c,children:c?"Uploading…":"Choose File"}),p&&e.jsx("p",{className:"text-sm opacity-50 mt-1 mx-0 mb-0",children:"Loading…"}),!p&&!n&&!c&&e.jsx("p",{className:"text-sm opacity-[0.45] mt-1 mx-0 mb-0",children:"No icon set."})]})]}),e.jsx(v,{}),e.jsx("div",{className:"flex items-end gap-3 pb-3 pt-3",children:e.jsx(G,{type:"number",value:y,onChange:a=>N(a.target.value),onBlur:i,label:"Port",helperText:"Default for `paper-camp dev`. Restart the server to apply a change."})}),e.jsx(v,{}),e.jsxs("div",{className:"flex items-center justify-between gap-3 pb-3 pt-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"m-0",children:"In-app dev toolbar"}),e.jsx("p",{className:"opacity-[0.45] text-sm mt-1 mx-0 mb-0",children:"Inject the paper-camp toolbar into this project's dev server via the Vite plugin."})]}),e.jsx(f,{size:"small",onClick:b,children:((H=(Y=t.integration)==null?void 0:Y.toolbar)==null?void 0:H.enabled)??!0?"Disable":"Enable"})]}),e.jsx(v,{}),e.jsx(Ie,{}),J.map((a,g)=>{var o;return e.jsx(ze,{taskKey:a,agentConfig:((o=t.defaultAgents)==null?void 0:o[a])??z[a],isLast:g===J.length-1,onSave:k},a)})]}),e.jsxs("p",{className:"opacity-[0.45] text-sm mt-4",children:[e.jsx("strong",{children:"Initialized:"})," ",t?new Date(t.initializedAt).toLocaleString():"—"]})]})},Le=()=>{const s=Z();return e.jsxs("div",{children:[e.jsx(ne,{children:"Settings"}),s==="subjects"?e.jsx(ke,{}):s==="setup"?e.jsx(Se,{}):s==="merge-policy"?e.jsx(ue,{}):e.jsx(De,{})]})},Pe=()=>{const s=Z(),t=Q();return e.jsxs(e.Fragment,{children:[e.jsxs(W,{label:"General",children:[e.jsx(L,{size:"small",active:s===null,onClick:()=>t({to:"/settings"}),children:"Project Info"}),e.jsx(L,{size:"small",active:s==="setup",onClick:()=>t({to:"/settings/$section",params:{section:"setup"}}),children:"Setup"}),e.jsx(L,{size:"small",active:s==="merge-policy",onClick:()=>t({to:"/settings/$section",params:{section:"merge-policy"}}),children:"Merge Policy"})]}),e.jsx(W,{label:"Ideas",children:e.jsx(L,{size:"small",active:s==="subjects",onClick:()=>t({to:"/settings/$section",params:{section:"subjects"}}),children:"Subjects"})})]})};export{Le as SettingsPage,Pe as SettingsSidebar};
|
|
2
|
-
//# sourceMappingURL=index-Dtdlcmro.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-Dtdlcmro.js","sources":["../../../src/app/services/system/merge-policy-api.ts","../../../src/app/features/settings/components/merge-policy-section.tsx","../../../src/app/features/settings/components/setup-section.tsx","../../../src/app/features/settings/components/subjects-section.tsx","../../../src/app/features/settings/settings-page.tsx","../../../src/app/features/settings/components/settings-sidebar.tsx"],"sourcesContent":["import type { MergePolicyResult } from '@/types/index';\n\nexport const fetchMergePolicy = async (): Promise<MergePolicyResult | null> => {\n try {\n const response = await fetch('/api/merge-policy');\n if (!response.ok) return null;\n return (await response.json()) as MergePolicyResult;\n } catch {\n return null;\n }\n};\n\nexport const applyMergePolicy = async (): Promise<MergePolicyResult | null> => {\n try {\n const response = await fetch('/api/merge-policy/apply', { method: 'POST' });\n if (!response.ok) return null;\n return (await response.json()) as MergePolicyResult;\n } catch {\n return null;\n }\n};\n","import { applyMergePolicy, fetchMergePolicy } from '@/app/services/system';\nimport type { MergePolicy, MergePolicyResult } from '@/types/index';\nimport { Alert, Button, Card, Divider, Stamp, useToast } from '@dendelion/paper-ui';\nimport { useEffect, useState } from 'react';\n\nconst RECOMMENDED: MergePolicy = {\n allowSquashMerge: true,\n allowMergeCommit: false,\n allowRebaseMerge: false,\n squashMergeCommitTitle: 'PR_TITLE',\n squashMergeCommitMessage: 'PR_BODY',\n};\n\nconst POLICY_ROWS: { key: keyof MergePolicy; label: string }[] = [\n { key: 'allowSquashMerge', label: 'Allow squash merge' },\n { key: 'allowMergeCommit', label: 'Allow merge commit' },\n { key: 'allowRebaseMerge', label: 'Allow rebase merge' },\n { key: 'squashMergeCommitTitle', label: 'Squash commit title' },\n { key: 'squashMergeCommitMessage', label: 'Squash commit message' },\n];\n\nfunction formatValue(value: boolean | string): string {\n return typeof value === 'boolean' ? (value ? 'Yes' : 'No') : value;\n}\n\nfunction matchesRecommended(policy: MergePolicy): boolean {\n return POLICY_ROWS.every((row) => policy[row.key] === RECOMMENDED[row.key]);\n}\n\ninterface PolicyRowProps {\n label: string;\n current: boolean | string;\n recommended: boolean | string;\n isLast: boolean;\n}\n\nconst PolicyRow = ({ label, current, recommended, isLast }: PolicyRowProps) => {\n const matches = current === recommended;\n return (\n <>\n <div className=\"flex items-center gap-3 pb-2 pt-2\">\n <span className=\"flex-1\">{label}</span>\n <span className={matches ? 'opacity-[0.65] font-normal' : 'font-semibold'}>\n {formatValue(current)}\n </span>\n {!matches && <span className=\"opacity-[0.45]\">→ {formatValue(recommended)}</span>}\n </div>\n {!isLast && <Divider />}\n </>\n );\n};\n\nexport const MergePolicySection = () => {\n const [result, setResult] = useState<MergePolicyResult | null | undefined>(undefined);\n const [applying, setApplying] = useState(false);\n const { toast } = useToast();\n\n useEffect(() => {\n fetchMergePolicy().then(setResult);\n }, []);\n\n const handleApply = async () => {\n setApplying(true);\n const applied = await applyMergePolicy();\n setApplying(false);\n if (applied?.status === 'ok') {\n setResult(applied);\n toast({ title: 'Merge policy applied', variant: 'success' });\n } else {\n toast({\n title: 'Failed to apply merge policy',\n description: applied?.status === 'unavailable' ? applied.reason : undefined,\n variant: 'error',\n });\n }\n };\n\n const upToDate = result?.status === 'ok' && matchesRecommended(result.policy);\n\n return (\n <div>\n <div className=\"mb-6\">\n <h2 className=\"m-0\">Merge Policy</h2>\n <p className=\"opacity-50 mt-1\">\n Paper Camp's canonical policy: squash-only merges, with the commit title and body taken\n from the PR.\n </p>\n </div>\n {result === undefined && <p>Loading…</p>}\n {result === null && <Alert variant=\"warning\">Failed to load merge policy.</Alert>}\n {result?.status === 'unavailable' && <Alert variant=\"warning\">{result.reason}</Alert>}\n {result?.status === 'ok' && (\n <>\n <div className=\"flex items-center gap-3 mb-3\">\n <span className=\"font-medium\">{result.repo}</span>\n <Stamp\n size=\"small\"\n fillColor={upToDate ? 'rgba(143, 185, 150, 0.25)' : 'rgba(212, 163, 115, 0.25)'}\n textColor={upToDate ? '#5E8A66' : '#A67B4F'}\n >\n {upToDate ? 'Matches recommended policy' : 'Differs from recommended policy'}\n </Stamp>\n </div>\n <Card size=\"small\" texture=\"kraft\">\n {POLICY_ROWS.map((row, idx) => (\n <PolicyRow\n key={row.key}\n label={row.label}\n current={result.policy[row.key]}\n recommended={RECOMMENDED[row.key]}\n isLast={idx === POLICY_ROWS.length - 1}\n />\n ))}\n </Card>\n <div className=\"mt-4\">\n <Button size=\"small\" onClick={handleApply} disabled={applying || upToDate}>\n {applying ? 'Applying…' : 'Apply recommended policy'}\n </Button>\n </div>\n </>\n )}\n </div>\n );\n};\n","import { connectService, fetchConfig, fetchConnections, saveConfig } from '@/app/services/system';\nimport { useAppStore } from '@/app/stores/app-store';\nimport type { CapabilityStatus, ConnectionResult } from '@/types/index';\nimport {\n Alert,\n Button,\n Card,\n CodeBlock,\n Divider,\n Stamp,\n Tooltip,\n useToast,\n} from '@dendelion/paper-ui';\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nconst RELAY_POLL_MS = 2000;\n\n// Only claude-code exposes `auth login`/`auth status` (see agentAuthenticated in server/services.ts).\nconst RELAY_CONNECTION_ID: ConnectionResult['id'] = 'agent:claude-code';\n\n// Same two commands the relay drives interactively — shown as copy-paste fallback\n// when the relay itself can't run (no PTY, offline, unsupported CLI version).\nconst AUTH_FIX_COMMANDS = ['claude auth login', 'claude setup-token'] as const;\n\nconst RelayFallbackGuide = () => (\n <div className=\"mt-2 flex flex-col gap-2\">\n <p className=\"opacity-[0.65] text-sm m-0\">\n The in-app relay couldn't complete. Run one of these in a terminal instead:\n </p>\n {AUTH_FIX_COMMANDS.map((cmd) => (\n <CodeBlock key={cmd} code={cmd} />\n ))}\n <p className=\"opacity-50 text-sm m-0\">\n {/* paper-ui has no inline-code component, only the block-level CodeBlock */}\n Alternatively, set <code>ANTHROPIC_API_KEY</code> in the server's environment — that bills as\n API usage rather than your Max subscription, so treat it as a fallback, not the default.\n </p>\n </div>\n);\n\nconst SignInAction = ({ onSignedIn }: { onSignedIn: () => void }) => {\n const loginRelay = useAppStore((s) => s.loginRelay);\n const startLoginRelay = useAppStore((s) => s.startLoginRelay);\n const loadLoginRelayStatus = useAppStore((s) => s.loadLoginRelayStatus);\n const cancelLoginRelay = useAppStore((s) => s.cancelLoginRelay);\n const { toast } = useToast();\n const openedUrlRef = useRef<string | null>(null);\n const phase = loginRelay?.phase;\n\n useEffect(() => {\n if (phase !== 'starting' && phase !== 'awaiting-authorization') return;\n const id = window.setInterval(() => loadLoginRelayStatus(), RELAY_POLL_MS);\n return () => window.clearInterval(id);\n }, [phase, loadLoginRelayStatus]);\n\n useEffect(() => {\n const url = loginRelay?.authorizeUrl;\n if (phase !== 'awaiting-authorization' || !url || openedUrlRef.current === url) return;\n openedUrlRef.current = url;\n window.open(url, '_blank', 'noopener,noreferrer');\n }, [phase, loginRelay?.authorizeUrl]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: keyed on phase transitions only — toast/onSignedIn aren't stable across renders, and including them would refire on every relay poll\n useEffect(() => {\n if (phase === 'success') {\n toast({ title: 'Signed in', variant: 'success' });\n onSignedIn();\n } else if (phase === 'error') {\n toast({ title: 'Sign-in failed', description: loginRelay?.error, variant: 'error' });\n }\n }, [phase]);\n\n if (phase === 'starting') {\n return (\n <Button size=\"small\" disabled>\n Starting…\n </Button>\n );\n }\n if (phase === 'awaiting-authorization') {\n return (\n <div className=\"flex items-center gap-2\">\n <Button\n size=\"small\"\n onClick={() =>\n loginRelay?.authorizeUrl &&\n window.open(loginRelay.authorizeUrl, '_blank', 'noopener,noreferrer')\n }\n >\n Reopen sign-in tab\n </Button>\n <Button size=\"small\" onClick={() => cancelLoginRelay()}>\n Cancel\n </Button>\n </div>\n );\n }\n return (\n <div>\n <Button size=\"small\" onClick={() => startLoginRelay()}>\n Sign in\n </Button>\n {phase === 'error' && <RelayFallbackGuide />}\n </div>\n );\n};\n\nconst STATUS_STAMP: Record<CapabilityStatus, { fill: string; text: string; label: string }> = {\n ok: { fill: 'rgba(143, 185, 150, 0.25)', text: '#5E8A66', label: 'Ready' },\n warn: { fill: 'rgba(212, 163, 115, 0.25)', text: '#A67B4F', label: 'Needs attention' },\n missing: { fill: 'rgba(201, 139, 139, 0.25)', text: '#6E3A3A', label: 'Missing' },\n};\n\nconst ConnectActionView = ({\n connection,\n onConnect,\n connecting,\n}: {\n connection: ConnectionResult;\n onConnect: (id: string) => void;\n connecting: boolean;\n}) => {\n const { connect } = connection;\n if (!connect) return null;\n if (connect.kind === 'command' && connect.runnable) {\n return (\n <Button size=\"small\" onClick={() => onConnect(connection.id)} disabled={connecting}>\n {connecting ? 'Running…' : `Run \\`${connect.command}\\``}\n </Button>\n );\n }\n if (connect.kind === 'command') {\n return (\n <div className=\"mt-2\">\n <CodeBlock code={connect.command} />\n </div>\n );\n }\n if (connect.kind === 'link') {\n return (\n <Button\n size=\"small\"\n onClick={() => window.open(connect.url, '_blank', 'noopener,noreferrer')}\n >\n {connect.label}\n </Button>\n );\n }\n return <p className=\"opacity-[0.65] text-sm mt-2 mx-0 mb-0\">{connect.message}</p>;\n};\n\nconst ConnectionRow = ({\n connection,\n isLast,\n onRecheck,\n rechecking,\n onConnect,\n connecting,\n}: {\n connection: ConnectionResult;\n isLast: boolean;\n onRecheck: (id: string) => void;\n rechecking: boolean;\n onConnect: (id: string) => void;\n connecting: boolean;\n}) => {\n const stamp = STATUS_STAMP[connection.status];\n return (\n <>\n <div className=\"pb-3 pt-3\">\n <div className=\"flex items-center gap-3\">\n <span className=\"flex-1 font-medium\">{connection.label}</span>\n {connection.authenticated === false && (\n <Tooltip content=\"Installed, but not signed in\">\n <Stamp size=\"small\" variant=\"warning\">\n Not signed in\n </Stamp>\n </Tooltip>\n )}\n <Stamp size=\"small\" fillColor={stamp.fill} textColor={stamp.text}>\n {stamp.label}\n </Stamp>\n <Button size=\"small\" onClick={() => onRecheck(connection.id)} disabled={rechecking}>\n {rechecking ? 'Checking…' : 'Recheck'}\n </Button>\n </div>\n <p className=\"opacity-[0.65] text-sm mt-1 mx-0 mb-0\">Unlocks: {connection.unlocks}</p>\n <p className=\"opacity-50 text-sm mt-1 mx-0 mb-0\">{connection.detail}</p>\n <div className=\"mt-2\">\n {connection.id === RELAY_CONNECTION_ID && connection.authenticated === false ? (\n <SignInAction onSignedIn={() => onRecheck(connection.id)} />\n ) : (\n <ConnectActionView\n connection={connection}\n onConnect={onConnect}\n connecting={connecting}\n />\n )}\n </div>\n </div>\n {!isLast && <Divider />}\n </>\n );\n};\n\nexport const SetupSection = () => {\n const [connections, setConnections] = useState<ConnectionResult[] | null>(null);\n const [loadFailed, setLoadFailed] = useState(false);\n const [reloadingId, setReloadingId] = useState<string | null>(null);\n const [connectingId, setConnectingId] = useState<string | null>(null);\n const [setupDismissed, setSetupDismissed] = useState(false);\n const { toast } = useToast();\n\n const applyConnections = useCallback((result: ConnectionResult[] | null) => {\n if (result === null) {\n setLoadFailed(true);\n return;\n }\n setLoadFailed(false);\n setConnections(result);\n }, []);\n\n useEffect(() => {\n fetchConnections().then(applyConnections);\n fetchConfig().then((c) => setSetupDismissed(c?.setupDismissed ?? false));\n }, [applyConnections]);\n\n const handleRecheck = async (id: string) => {\n setReloadingId(id);\n applyConnections(await fetchConnections());\n setReloadingId(null);\n };\n\n const handleConnect = async (id: string) => {\n setConnectingId(id);\n const updated = await connectService(id);\n if (updated) {\n setConnections((prev) => prev?.map((c) => (c.id === id ? updated : c)) ?? prev);\n } else {\n toast({ title: 'Failed to connect', variant: 'error' });\n }\n setConnectingId(null);\n };\n\n const handleDismissToggle = async () => {\n const next = !setupDismissed;\n const { ok } = await saveConfig({ setupDismissed: next });\n if (ok) {\n setSetupDismissed(next);\n toast({ title: 'Saved', variant: 'success' });\n } else {\n toast({ title: 'Failed to save', variant: 'error' });\n }\n };\n\n const allOk = connections?.every((c) => c.status === 'ok') ?? true;\n\n return (\n <div>\n <div className=\"mb-6\">\n <h2 className=\"m-0\">Setup</h2>\n </div>\n {connections === null && !loadFailed && <p>Loading…</p>}\n {loadFailed && (\n <div className=\"mb-4\">\n <Alert variant=\"warning\">Failed to load connections. Try refreshing.</Alert>\n </div>\n )}\n {connections && (\n <>\n {!allOk && (\n <div className=\"mb-4\">\n <Alert variant=\"warning\">\n Some connections are incomplete — features that depend on them stay disabled until\n fixed. Run the connect command below, then recheck.\n </Alert>\n </div>\n )}\n <Card size=\"small\" texture=\"kraft\">\n {connections.map((c, idx) => (\n <ConnectionRow\n key={c.id}\n connection={c}\n isLast={idx === connections.length - 1}\n onRecheck={handleRecheck}\n rechecking={reloadingId === c.id}\n onConnect={handleConnect}\n connecting={connectingId === c.id}\n />\n ))}\n </Card>\n <div className=\"mt-4\">\n <Button size=\"small\" onClick={handleDismissToggle}>\n {setupDismissed ? 'Show Setup on open again' : \"Don't show Setup on open\"}\n </Button>\n </div>\n </>\n )}\n </div>\n );\n};\n","import { useSubjectVocabulary } from '@/app/hooks';\nimport { Button, Card, Divider } from '@dendelion/paper-ui';\nimport { useNavigate } from '@tanstack/react-router';\n\nexport const SubjectsSection = () => {\n const { subjects, loading, available } = useSubjectVocabulary();\n const navigate = useNavigate();\n\n return (\n <div>\n <div className=\"mb-6\">\n <h2 className=\"m-0\">Subjects</h2>\n <p className=\"opacity-50 mt-1\">\n Subjects are the roadmap's bets and standing concerns. Edit the vocabulary on the Roadmap\n page.\n </p>\n </div>\n {loading && <p>Loading…</p>}\n {!loading && !available && (\n <p className=\"opacity-60 m-0\">Couldn't load subjects — check the server config.</p>\n )}\n {!loading && available && (\n <Card size=\"small\" texture=\"kraft\">\n {subjects.length === 0 && <p className=\"opacity-[0.45] m-0 pb-2\">No subjects yet.</p>}\n {subjects.map((name, idx) => (\n <div key={name}>\n <div className=\"pb-2 pt-2\">{name}</div>\n {idx < subjects.length - 1 && <Divider />}\n </div>\n ))}\n {subjects.length > 0 && <Divider />}\n <div className=\"pt-3\">\n <Button size=\"small\" onClick={() => navigate({ to: '/roadmap' })}>\n Go to Roadmap\n </Button>\n </div>\n </Card>\n )}\n </div>\n );\n};\n","import { PageTitle } from '@/app/components/page-title';\nimport { useActiveSettingsSection, useProjectIdentity } from '@/app/hooks';\nimport { fetchConfig, saveConfig, uploadIcon } from '@/app/services/system';\nimport { color } from '@/app/styles/tokens';\nimport {\n AGENT_IDS,\n AGENT_LABELS,\n AGENT_OPTIONS,\n type AgentConfig,\n type AgentId,\n DEFAULT_AGENTS,\n type DefaultAgentsMap,\n type PaperCampConfig,\n} from '@/types/index';\nimport { Alert, Button, Card, Divider, Input, Select, Stamp, useToast } from '@dendelion/paper-ui';\nimport { useEffect, useRef, useState } from 'react';\nimport { MergePolicySection } from './components/merge-policy-section';\nimport { SetupSection } from './components/setup-section';\nimport { SubjectsSection } from './components/subjects-section';\n\nconst TASK_TYPE_KEYS = ['phase', 'planDraft', 'ideaExtend', 'commitSuggest', 'feedback'] as const;\ntype TaskTypeKey = (typeof TASK_TYPE_KEYS)[number];\n\nconst TASK_TYPE_LABELS: Record<TaskTypeKey, string> = {\n phase: 'Phase run',\n planDraft: 'Plan draft',\n ideaExtend: 'Idea extend',\n commitSuggest: 'Commit suggest',\n feedback: 'Scout chat',\n};\n\ninterface AgentTaskRowProps {\n taskKey: TaskTypeKey;\n agentConfig: AgentConfig;\n isLast: boolean;\n onSave: (key: TaskTypeKey, config: AgentConfig) => Promise<void>;\n}\n\nconst TASK_COLUMN_WIDTH = 110;\nconst AGENT_COLUMN_WIDTH = 140;\nconst MODEL_COLUMN_WIDTH = 160;\nconst EFFORT_COLUMN_WIDTH = 110;\n\nconst AgentTaskRowHeader = () => (\n <div className=\"flex items-center gap-3 pb-1\">\n <span className=\"w-[110px] shrink-0 text-sm opacity-[0.45]\">Task</span>\n <span className=\"w-[140px] shrink-0 text-sm opacity-[0.45]\">Agent</span>\n <span className=\"w-[160px] shrink-0 text-sm opacity-[0.45]\">Model</span>\n <span className=\"w-[110px] shrink-0 text-sm opacity-[0.45]\">Effort</span>\n </div>\n);\n\nconst AgentTaskRow = ({ taskKey, agentConfig, isLast, onSave }: AgentTaskRowProps) => {\n // Fall back if the config carries an unknown agent id — never white-screen the page.\n const opts = AGENT_OPTIONS[agentConfig.agent] ?? AGENT_OPTIONS['claude-code'];\n const modelOpts = opts.model;\n const effortOpts = opts.effort;\n const [localModel, setLocalModel] = useState(agentConfig.model ?? '');\n\n useEffect(() => {\n setLocalModel(agentConfig.model ?? '');\n }, [agentConfig.model]);\n\n const handleAgentChange = (v: string) => {\n const newId = v as AgentId;\n const newOpts = AGENT_OPTIONS[newId];\n const newConfig: AgentConfig = { agent: newId };\n // Only carry the model over if the new agent accepts it — otherwise a claude\n // model like 'opus' would leak into opencode and fail at launch.\n if (\n agentConfig.model &&\n (newOpts.model === null || newOpts.model?.includes(agentConfig.model))\n ) {\n newConfig.model = agentConfig.model;\n }\n if (agentConfig.effort && Array.isArray(newOpts.effort)) newConfig.effort = agentConfig.effort;\n onSave(taskKey, newConfig);\n };\n\n const handleModelSelectChange = (v: string) => {\n onSave(taskKey, { ...agentConfig, model: v || undefined });\n };\n\n const handleModelInputBlur = () => {\n onSave(taskKey, { ...agentConfig, model: localModel || undefined });\n };\n\n const handleEffortChange = (v: string) => {\n onSave(taskKey, { ...agentConfig, effort: v || undefined });\n };\n\n return (\n <>\n <div className=\"flex items-center gap-3 pb-2 pt-2\">\n <span className=\"w-[110px] shrink-0 text-sm opacity-[0.65]\">\n {TASK_TYPE_LABELS[taskKey]}\n </span>\n <Select\n size=\"small\"\n width={AGENT_COLUMN_WIDTH}\n value={agentConfig.agent}\n onChange={handleAgentChange}\n options={AGENT_IDS.map((id) => ({ value: id, label: AGENT_LABELS[id] }))}\n />\n {Array.isArray(modelOpts) ? (\n <Select\n size=\"small\"\n width={MODEL_COLUMN_WIDTH}\n value={agentConfig.model ?? ''}\n onChange={handleModelSelectChange}\n options={[\n { value: '', label: 'Default' },\n ...modelOpts.map((m) => ({ value: m, label: m })),\n ]}\n />\n ) : modelOpts === null ? (\n <Input\n size=\"small\"\n className=\"w-[160px]\"\n value={localModel}\n placeholder=\"Default model\"\n onChange={(e) => setLocalModel(e.target.value)}\n onBlur={handleModelInputBlur}\n />\n ) : null}\n {/* Reserve the effort slot even when the agent has no effort options, so\n switching agents doesn't change the control count and shift the row. */}\n <div className={Array.isArray(effortOpts) ? 'visible' : 'invisible'}>\n <Select\n size=\"small\"\n width={EFFORT_COLUMN_WIDTH}\n value={agentConfig.effort ?? ''}\n onChange={handleEffortChange}\n options={[\n { value: '', label: 'Default' },\n ...(Array.isArray(effortOpts) ? effortOpts : []).map((e) => ({ value: e, label: e })),\n ]}\n />\n </div>\n </div>\n {!isLast && <Divider />}\n </>\n );\n};\n\nconst GeneralSection = () => {\n const fileRef = useRef<HTMLInputElement>(null);\n const [config, setConfig] = useState<PaperCampConfig | null | undefined>(undefined);\n const { iconDataUri: fetchedIconDataUri, loading: identityLoading } = useProjectIdentity();\n const [uploadedIconDataUri, setUploadedIconDataUri] = useState<string | null>(null);\n const iconDataUri = uploadedIconDataUri ?? fetchedIconDataUri;\n const [uploading, setUploading] = useState(false);\n const [portInput, setPortInput] = useState('');\n const [nameInput, setNameInput] = useState('');\n const { toast } = useToast();\n\n useEffect(() => {\n fetchConfig().then((c) => {\n setConfig(c);\n if (c?.port !== undefined) setPortInput(String(c.port));\n if (c?.projectName !== undefined) setNameInput(c.projectName);\n });\n }, []);\n\n const handleSaveAgentConfig = async (key: TaskTypeKey, newEntry: AgentConfig) => {\n const current = config?.defaultAgents;\n const updated: DefaultAgentsMap = {\n phase: current?.phase ?? DEFAULT_AGENTS.phase,\n planDraft: current?.planDraft ?? DEFAULT_AGENTS.planDraft,\n ideaExtend: current?.ideaExtend ?? DEFAULT_AGENTS.ideaExtend,\n commitSuggest: current?.commitSuggest ?? DEFAULT_AGENTS.commitSuggest,\n feedback: current?.feedback ?? DEFAULT_AGENTS.feedback,\n [key]: newEntry,\n };\n const { ok, error } = await saveConfig({ defaultAgents: updated });\n if (ok) {\n setConfig((prev) => (prev ? { ...prev, defaultAgents: updated } : prev));\n toast({ title: 'Saved', variant: 'success' });\n } else {\n toast({ title: 'Failed to save', description: error, variant: 'error' });\n }\n };\n\n const handleSavePort = async () => {\n const port = Number(portInput);\n if (!config || !Number.isInteger(port) || port <= 0 || port === config.port) return;\n const { ok, error } = await saveConfig({ port });\n if (ok) {\n setConfig((prev) => (prev ? { ...prev, port } : prev));\n toast({\n title: 'Saved',\n description: 'Restart `paper-camp dev` to apply the new port.',\n variant: 'success',\n });\n } else {\n toast({ title: 'Failed to save', description: error, variant: 'error' });\n }\n };\n\n const handleToggleIntegration = async () => {\n if (!config) return;\n const next = !(config.integration?.toolbar?.enabled ?? true);\n const integration = {\n ...config.integration,\n toolbar: { ...config.integration?.toolbar, enabled: next },\n };\n const { ok, error } = await saveConfig({ integration });\n if (ok) {\n setConfig((prev) => (prev ? { ...prev, integration } : prev));\n toast({ title: 'Saved', variant: 'success' });\n } else {\n toast({ title: 'Failed to save', description: error, variant: 'error' });\n }\n };\n\n const handleSaveName = async () => {\n const projectName = nameInput.trim();\n if (!config || !projectName || projectName === config.projectName) return;\n const { ok, error } = await saveConfig({ projectName });\n if (ok) {\n setConfig((prev) => (prev ? { ...prev, projectName } : prev));\n setNameInput(projectName);\n toast({ title: 'Saved', variant: 'success' });\n } else {\n toast({ title: 'Failed to save', description: error, variant: 'error' });\n }\n };\n\n const handleFile = async (e: React.ChangeEvent<HTMLInputElement>) => {\n const file = e.target.files?.[0];\n if (!file) return;\n setUploading(true);\n const reader = new FileReader();\n reader.onloadend = async () => {\n const dataUri = reader.result as string;\n const ok = await uploadIcon(dataUri);\n setUploading(false);\n if (ok) {\n setUploadedIconDataUri(dataUri);\n toast({ title: 'Saved', variant: 'success' });\n } else {\n toast({ title: 'Failed to save', variant: 'error' });\n }\n };\n reader.readAsDataURL(file);\n };\n\n return (\n <div>\n <div className=\"mb-6\">\n <h2 className=\"m-0\">Project Info</h2>\n </div>\n {config === undefined && <p>Loading…</p>}\n {config === null && (\n <Alert variant=\"warning\">\n No papercamp/config.json found — run <code>paper-camp init</code> in this directory first.\n </Alert>\n )}\n {config && (\n <Card size=\"small\" texture=\"kraft\">\n <div className=\"flex items-end gap-3 pb-3\">\n <Input\n value={nameInput}\n onChange={(e) => setNameInput(e.target.value)}\n onBlur={handleSaveName}\n label=\"Project Name\"\n />\n <Stamp\n size=\"small\"\n fillColor=\"rgba(143, 185, 150, 0.25)\"\n textColor={color.accentGreenDark}\n >\n v{config.version}\n </Stamp>\n </div>\n <Divider />\n\n <div className=\"flex items-center gap-3 pb-3 pt-3\">\n {iconDataUri && (\n <img\n src={iconDataUri}\n alt=\"Project icon\"\n className=\"w-10 h-10 object-contain shrink-0 rounded\"\n />\n )}\n <div>\n {/* paper-ui has no file-input component, so this raw input is intentional */}\n <input\n ref={fileRef}\n type=\"file\"\n accept=\".svg,.png,.jpg,.jpeg,.gif,.webp\"\n onChange={handleFile}\n className=\"hidden\"\n />\n <Button size=\"small\" onClick={() => fileRef.current?.click()} disabled={uploading}>\n {uploading ? 'Uploading…' : 'Choose File'}\n </Button>\n {identityLoading && <p className=\"text-sm opacity-50 mt-1 mx-0 mb-0\">Loading…</p>}\n {!identityLoading && !iconDataUri && !uploading && (\n <p className=\"text-sm opacity-[0.45] mt-1 mx-0 mb-0\">No icon set.</p>\n )}\n </div>\n </div>\n <Divider />\n\n <div className=\"flex items-end gap-3 pb-3 pt-3\">\n <Input\n type=\"number\"\n value={portInput}\n onChange={(e) => setPortInput(e.target.value)}\n onBlur={handleSavePort}\n label=\"Port\"\n helperText=\"Default for `paper-camp dev`. Restart the server to apply a change.\"\n />\n </div>\n <Divider />\n\n <div className=\"flex items-center justify-between gap-3 pb-3 pt-3\">\n <div>\n <p className=\"m-0\">In-app dev toolbar</p>\n <p className=\"opacity-[0.45] text-sm mt-1 mx-0 mb-0\">\n Inject the paper-camp toolbar into this project's dev server via the Vite plugin.\n </p>\n </div>\n <Button size=\"small\" onClick={handleToggleIntegration}>\n {(config.integration?.toolbar?.enabled ?? true) ? 'Disable' : 'Enable'}\n </Button>\n </div>\n <Divider />\n\n <AgentTaskRowHeader />\n {TASK_TYPE_KEYS.map((key, idx) => (\n <AgentTaskRow\n key={key}\n taskKey={key}\n agentConfig={config.defaultAgents?.[key] ?? DEFAULT_AGENTS[key]}\n isLast={idx === TASK_TYPE_KEYS.length - 1}\n onSave={handleSaveAgentConfig}\n />\n ))}\n </Card>\n )}\n\n <p className=\"opacity-[0.45] text-sm mt-4\">\n <strong>Initialized:</strong>{' '}\n {config ? new Date(config.initializedAt).toLocaleString() : '—'}\n </p>\n </div>\n );\n};\n\nexport const SettingsPage = () => {\n const section = useActiveSettingsSection();\n return (\n <div>\n <PageTitle>Settings</PageTitle>\n {section === 'subjects' ? (\n <SubjectsSection />\n ) : section === 'setup' ? (\n <SetupSection />\n ) : section === 'merge-policy' ? (\n <MergePolicySection />\n ) : (\n <GeneralSection />\n )}\n </div>\n );\n};\n","import { useActiveSettingsSection } from '@/app/hooks';\nimport { ListItem } from '@dendelion/paper-ui';\nimport { useNavigate } from '@tanstack/react-router';\nimport { SidebarSection } from '../../plans/components/sidebar-section';\n\nexport const SettingsSidebar = () => {\n const section = useActiveSettingsSection();\n const navigate = useNavigate();\n\n return (\n <>\n <SidebarSection label=\"General\">\n <ListItem\n size=\"small\"\n active={section === null}\n onClick={() => navigate({ to: '/settings' })}\n >\n Project Info\n </ListItem>\n <ListItem\n size=\"small\"\n active={section === 'setup'}\n onClick={() => navigate({ to: '/settings/$section', params: { section: 'setup' } })}\n >\n Setup\n </ListItem>\n <ListItem\n size=\"small\"\n active={section === 'merge-policy'}\n onClick={() =>\n navigate({ to: '/settings/$section', params: { section: 'merge-policy' } })\n }\n >\n Merge Policy\n </ListItem>\n </SidebarSection>\n <SidebarSection label=\"Ideas\">\n <ListItem\n size=\"small\"\n active={section === 'subjects'}\n onClick={() => navigate({ to: '/settings/$section', params: { section: 'subjects' } })}\n >\n Subjects\n </ListItem>\n </SidebarSection>\n </>\n );\n};\n"],"names":["fetchMergePolicy","response","applyMergePolicy","RECOMMENDED","POLICY_ROWS","formatValue","value","matchesRecommended","policy","row","PolicyRow","label","current","recommended","isLast","matches","jsxs","Fragment","jsx","Divider","MergePolicySection","result","setResult","useState","applying","setApplying","toast","useToast","useEffect","handleApply","applied","upToDate","Alert","Stamp","Card","idx","Button","RELAY_POLL_MS","RELAY_CONNECTION_ID","AUTH_FIX_COMMANDS","RelayFallbackGuide","cmd","CodeBlock","SignInAction","onSignedIn","loginRelay","useAppStore","s","startLoginRelay","loadLoginRelayStatus","cancelLoginRelay","openedUrlRef","useRef","phase","id","url","STATUS_STAMP","ConnectActionView","connection","onConnect","connecting","connect","ConnectionRow","onRecheck","rechecking","stamp","Tooltip","SetupSection","connections","setConnections","loadFailed","setLoadFailed","reloadingId","setReloadingId","connectingId","setConnectingId","setupDismissed","setSetupDismissed","applyConnections","useCallback","fetchConnections","fetchConfig","c","handleRecheck","handleConnect","updated","connectService","prev","handleDismissToggle","next","ok","saveConfig","allOk","SubjectsSection","subjects","loading","available","useSubjectVocabulary","navigate","useNavigate","name","TASK_TYPE_KEYS","TASK_TYPE_LABELS","AGENT_COLUMN_WIDTH","MODEL_COLUMN_WIDTH","EFFORT_COLUMN_WIDTH","AgentTaskRowHeader","AgentTaskRow","taskKey","agentConfig","onSave","opts","AGENT_OPTIONS","modelOpts","effortOpts","localModel","setLocalModel","handleAgentChange","v","newId","newOpts","newConfig","_a","handleModelSelectChange","handleModelInputBlur","handleEffortChange","Select","AGENT_IDS","AGENT_LABELS","Input","e","GeneralSection","fileRef","config","setConfig","fetchedIconDataUri","identityLoading","useProjectIdentity","uploadedIconDataUri","setUploadedIconDataUri","iconDataUri","uploading","setUploading","portInput","setPortInput","nameInput","setNameInput","handleSaveAgentConfig","key","newEntry","DEFAULT_AGENTS","error","handleSavePort","port","handleToggleIntegration","_b","integration","_c","handleSaveName","projectName","handleFile","file","reader","dataUri","uploadIcon","color","SettingsPage","section","useActiveSettingsSection","PageTitle","SettingsSidebar","SidebarSection","ListItem"],"mappings":"wUAEO,MAAMA,GAAmB,SAA+C,CAC7E,GAAI,CACF,MAAMC,EAAW,MAAM,MAAM,mBAAmB,EAChD,OAAKA,EAAS,GACN,MAAMA,EAAS,KAAA,EADE,IAE3B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