panoma 0.10.2 → 0.10.3
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/app/BUILD-INFO.json +2 -2
- package/app/apps/web/.next-bundle/BUILD_ID +1 -1
- package/app/apps/web/.next-bundle/app-build-manifest.json +314 -314
- package/app/apps/web/.next-bundle/app-path-routes-manifest.json +52 -52
- package/app/apps/web/.next-bundle/build-manifest.json +3 -3
- package/app/apps/web/.next-bundle/prerender-manifest.json +9 -9
- package/app/apps/web/.next-bundle/required-server-files.json +3 -3
- package/app/apps/web/.next-bundle/server/app/(app)/agents/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/agents/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/ai/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/ai/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/apps/[id]/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/apps/[id]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/apps/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/apps/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/bridge/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/bridge/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/copies/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/copies/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/credentials/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/credentials/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/disk/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/disk/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/handoff/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/handoff/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/hidden/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/hidden/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/p/[slug]/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/p/[slug]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/p/[slug]/video/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/p/[slug]/video/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/packages/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/packages/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/runs/[id]/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/runs/[id]/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/runs/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/runs/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/search/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/search/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/spend/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/spend/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/twin/look/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/twin/look/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/twin/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/twin/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/(app)/unsaved/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/(app)/unsaved/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/_not-found/page.js +2 -2
- package/app/apps/web/.next-bundle/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/accounts/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/accounts/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/apps/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/apps/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/consult/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/consult/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/context/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/context/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/conversations/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/conversations/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/handoff/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/handoff/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/hello/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/hello/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/journal/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/journal/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/keys/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/keys/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/log/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/log/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/mcp/route.js +2 -2
- package/app/apps/web/.next-bundle/server/app/api/agent/mcp/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/notes/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/notes/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/tasks/[id]/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/tasks/[id]/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/tasks/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/tasks/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/video/cancel/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/video/cancel/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/video/jobs/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/video/jobs/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/video/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/agent/video/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/ai/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/ai/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/[operation]/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/[operation]/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/credentials/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/credentials/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/jobs/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/jobs/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/legal/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/legal/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/settings/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/[id]/settings/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/jobs/[jobId]/artifact/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/jobs/[jobId]/artifact/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/jobs/[jobId]/cancel/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/jobs/[jobId]/cancel/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/jobs/[jobId]/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/jobs/[jobId]/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/apps/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/assets/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/assets/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/assignments/launch/route.js +2 -2
- package/app/apps/web/.next-bundle/server/app/api/assignments/launch/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/assignments/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/assignments/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/catalog/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/catalog/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/check/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/check/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/consultations/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/consultations/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/describe/route.js +2 -2
- package/app/apps/web/.next-bundle/server/app/api/describe/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/disk/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/disk/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/enrich/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/enrich/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/environment/route.js +2 -2
- package/app/apps/web/.next-bundle/server/app/api/environment/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/[id]/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/[id]/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/digest/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/digest/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/launch/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/launch/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/record/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/record/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/handoff/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/hooks/route.js +2 -2
- package/app/apps/web/.next-bundle/server/app/api/hooks/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/ingest/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/ingest/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/apply/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/apply/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/context/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/context/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/inspect/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/inspect/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/repair/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/repair/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/md/review/route.js +2 -2
- package/app/apps/web/.next-bundle/server/app/api/md/review/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/memory/export/route.js +2 -2
- package/app/apps/web/.next-bundle/server/app/api/memory/export/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/north/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/north/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/notes/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/notes/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/open/all/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/open/all/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/open/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/open/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/project/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/project/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/rescan/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/rescan/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/roots/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/roots/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/runs/[id]/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/runs/[id]/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/runs/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/runs/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/scale/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/scale/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/search/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/secrets/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/secrets/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/spend/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/spend/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/tasks/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/tasks/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/today/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/today/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/assign/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/assign/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/classify/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/classify/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/critique/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/critique/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/design/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/design/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/distill/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/distill/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/episodes/learn/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/episodes/learn/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/episodes/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/episodes/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/look/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/look/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/mine/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/mine/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/rehearse/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/rehearse/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/score/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/score/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/shot/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/shot/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/sources/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/sources/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/synthesize/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/synthesize/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/taste/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/taste/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/verdicts/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/twin/verdicts/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/watch/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/api/watch/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/apple-icon.png/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/icon/[id]/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app/icon/[id]/route_client-reference-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/app/icon.png/route.js +1 -1
- package/app/apps/web/.next-bundle/server/app-paths-manifest.json +52 -52
- package/app/apps/web/.next-bundle/server/chunks/1646.js +5 -5
- package/app/apps/web/.next-bundle/server/chunks/305.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/3834.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/3863.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/4478.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/4498.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/5103.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/6206.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/7011.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/7245.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/7400.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/7711.js +1 -0
- package/app/apps/web/.next-bundle/server/chunks/7865.js +1 -0
- package/app/apps/web/.next-bundle/server/chunks/8280.js +2 -0
- package/app/apps/web/.next-bundle/server/chunks/8345.js +1 -0
- package/app/apps/web/.next-bundle/server/chunks/8404.js +1 -1
- package/app/apps/web/.next-bundle/server/chunks/9511.js +2 -2
- package/app/apps/web/.next-bundle/server/functions-config-manifest.json +6 -6
- package/app/apps/web/.next-bundle/server/middleware-build-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/middleware-manifest.json +5 -5
- package/app/apps/web/.next-bundle/server/middleware.js +2 -2
- package/app/apps/web/.next-bundle/server/next-font-manifest.js +1 -1
- package/app/apps/web/.next-bundle/server/next-font-manifest.json +1 -1
- package/app/apps/web/.next-bundle/server/pages/500.html +1 -1
- package/app/apps/web/.next-bundle/server/pages/_error.js +1 -1
- package/app/apps/web/.next-bundle/server/server-reference-manifest.json +1 -1
- package/app/apps/web/.next-bundle/static/chunks/1369-36f443dda274b80a.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/2575-f9490e00a1a7e890.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/2921-144ba161a116c199.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/agents/{page-cae57c1555749574.js → page-f462b8467dd5c51d.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/ai/{page-f63553805baaea0c.js → page-4c896120faf997ec.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/apps/[id]/page-d2df027f727969f3.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/apps/page-5a9e8e647a0def47.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/bridge/page-0b4d18439ecf25c4.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/copies/page-643e24fd5815660d.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/credentials/{page-c1d8a21174d6bba2.js → page-11a07b1baf3ec7af.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/disk/page-b3e61a31dc5ce4fd.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/error-ae5877c791b4ce89.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/handoff/{page-41198249f6480477.js → page-da789bd4fead725d.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/hidden/{page-0eec0c39fae7b922.js → page-b30fa429fdc9d742.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/layout-159f4a8efe5c5183.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/p/[slug]/page-40675374b12c9222.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/p/[slug]/video/{page-8ac2b429692e90c6.js → page-108d4714551b97e7.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/page-bf2aaefd9c16245d.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/runs/[id]/page-d82fbce3080071a2.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/runs/page-643e24fd5815660d.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/search/{page-0788d039d155cdf2.js → page-a2217949ba4ddf59.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/spend/page-d4314054c95ad2ae.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/twin/look/page-333f2ebaa1bcd366.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/twin/{page-12d36b362fc4d2d2.js → page-a73ebd831a36d1ba.js} +1 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/unsaved/page-cb950413f781b573.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/global-not-found-643e24fd5815660d.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/app/not-found-643e24fd5815660d.js +1 -0
- package/app/apps/web/.next-bundle/static/chunks/{main-app-ec5cb301dd9fc61e.js → main-app-bde594e3a17b5c95.js} +1 -1
- package/app/apps/web/server.js +1 -1
- package/app/node_modules/drizzle-orm/node_modules/.bin/gel +3 -3
- package/dist/{ai-command-TSSMG7H3.js → ai-command-QEXAVD5A.js} +1 -1
- package/dist/{apps-7E4RUVJY.js → apps-FBC65DRJ.js} +3 -3
- package/dist/{check-command-RIUGB4HV.js → check-command-GBIFTYMC.js} +3 -3
- package/dist/{chunk-3QYJKRW6.js → chunk-CTWQQWH7.js} +1 -0
- package/dist/{chunk-FWSQH4NS.js → chunk-FI2ZMO24.js} +2 -2
- package/dist/{chunk-HHHT2MTQ.js → chunk-R3D5NBHW.js} +1 -1
- package/dist/{chunk-WAI2SCFY.js → chunk-TXXI7WVK.js} +2 -2
- package/dist/{chunk-47UUF7B7.js → chunk-U2FAFPLA.js} +7 -2
- package/dist/{handoff-command-NGSYPGWW.js → handoff-command-LT7XVHWZ.js} +3 -3
- package/dist/index.js +16 -16
- package/dist/{md-command-PYD3SPHA.js → md-command-QFRCVG3N.js} +2 -2
- package/dist/{memory-command-BWP52OQS.js → memory-command-PETERVDN.js} +2 -2
- package/dist/{next-command-NFDGQMHO.js → next-command-PUKTGFHC.js} +3 -3
- package/dist/{north-command-SKBVZEGK.js → north-command-GFPTPOXX.js} +3 -3
- package/dist/{review-command-SMYI7XKH.js → review-command-AMGBA6JJ.js} +1 -1
- package/dist/{spend-command-NYAELLRP.js → spend-command-7KF2TMUR.js} +2 -2
- package/dist/{twin-command-M25PTHLP.js → twin-command-K42J3VLZ.js} +3 -3
- package/dist/{video-QKEQ2FGR.js → video-UUJXJTLD.js} +4 -4
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/app/apps/web/.next-bundle/server/chunks/1454.js +0 -2
- package/app/apps/web/.next-bundle/server/chunks/3815.js +0 -1
- package/app/apps/web/.next-bundle/server/chunks/6131.js +0 -1
- package/app/apps/web/.next-bundle/server/chunks/7957.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/1369-2c988debdc250f63.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/2575-61e3c59775a07058.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/2921-abf2bd91adbc76d4.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/apps/[id]/page-da64889cd7413e00.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/apps/page-3cf7accd30ae08c7.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/bridge/page-f1661f3e36e93d98.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/copies/page-44ebbc5d00245788.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/disk/page-79c4c0af255ea5db.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/error-bc8b33871ce6ee62.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/layout-f4763a241faa2e25.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/p/[slug]/page-bf90188e9460900b.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/page-a6579330ff0a1c45.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/runs/[id]/page-71e91e2f82fbcd0a.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/runs/page-44ebbc5d00245788.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/spend/page-9b43a28c5537214d.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/twin/look/page-47bc811a5a4bbed5.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/(app)/unsaved/page-4bffe36641979e0c.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/global-not-found-44ebbc5d00245788.js +0 -1
- package/app/apps/web/.next-bundle/static/chunks/app/not-found-44ebbc5d00245788.js +0 -1
- /package/app/apps/web/.next-bundle/static/{w6oDX-SYfedAnhX2GThXZ → goMZpqW7N7YNi-BWPnlZ_}/_buildManifest.js +0 -0
- /package/app/apps/web/.next-bundle/static/{w6oDX-SYfedAnhX2GThXZ → goMZpqW7N7YNi-BWPnlZ_}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1162],{3030:(e,t,n)=>{"use strict";n.d(t,{TwinLab:()=>c});var s=n(38657),i=n(32165),l=n(3043),a=n(9144),r=n(26488),o=n(52948),d=n(59916);function c(e){let{projects:t,hasBeliefs:n}=e,c=(0,a.kj)(),[u,x]=(0,i.useState)(""),[p,h]=(0,i.useState)(""),[w,f]=(0,i.useState)(null),[b,y]=(0,i.useState)(null),[g,j]=(0,i.useState)(null),[v,N]=(0,i.useState)(null),k=(0,i.useRef)(!1),M=t.find(e=>e.slug===p);function S(){y(null),j(null)}async function C(e){if(k.current)return;let t=u.trim();if(!t||t.length>r.s)return void j(c("twinLab.invalidRequest",{max:r.s}));if(e||(null==b?void 0:b.status)==="preview"&&b.evidence.length){k.current=!0,f(e?"preview":"draft"),j(null),e&&y(null);try{let s=await fetch("/api/twin/rehearse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:t,...p?{slug:p}:{},dryRun:e})}),i=await s.json();if("number"==typeof i.remainingCalls&&N(i.remainingCalls),!s.ok){var n;j(429===s.status?c("twinLab.budgetReached"):[null!=(n=i.error)?n:c("twinLab.failed"),i.hint].filter(Boolean).join(" "));return}if(!Array.isArray(i.evidence)||!["preview","drafted","abstained"].includes(i.status))return void j(c("twinLab.failed"));y(i)}catch(e){j(c("project.unreachable"))}finally{k.current=!1,f(null)}}}let L=(null==b?void 0:b.reason)==="no-beliefs"?"twinLab.noBeliefs":(null==b?void 0:b.reason)==="no-match"?"twinLab.noMatch":"twinLab.unsupported";return(0,s.jsxs)("section",{id:"decision-lab",tabIndex:-1,"aria-labelledby":"twin-lab-title",className:"page-shell__section scroll-mt-24 rounded-lg border border-edge bg-surface",children:[(0,s.jsxs)("div",{className:"border-b border-edge px-5 py-5 sm:px-6",children:[(0,s.jsxs)("p",{className:"flex items-center gap-2 font-mono text-xs text-smoke",children:[(0,s.jsx)(l.qRK,{"aria-hidden":!0,className:"h-4 w-4"}),c("twinLab.eyebrow")]}),(0,s.jsx)("h2",{id:"twin-lab-title",className:"mt-2 text-base font-semibold",children:c("twinLab.title")}),(0,s.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed text-smoke",children:c("twinLab.lead")})]}),(0,s.jsxs)("div",{className:"grid lg:grid-cols-2",children:[(0,s.jsxs)("form",{onSubmit:function(e){e.preventDefault(),C(!0)},className:"min-w-0 px-5 py-5 sm:px-6","aria-busy":null!==w,children:[(0,s.jsx)(o.fs,{label:c("twinLab.question"),value:u,onChange:e=>{x(e.target.value),S()},maxLength:r.s,rows:4,required:!0,disabled:null!==w||!n,"aria-describedby":"twin-lab-question-hint twin-lab-count".concat(n?"":" twin-lab-untrained"),placeholder:c("twinLab.placeholder")}),!n&&(0,s.jsx)("p",{id:"twin-lab-untrained",className:"mt-2 text-xs leading-relaxed text-smoke",children:c("twinLab.firstTitle")}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap justify-between gap-2 text-xs text-smoke",children:[(0,s.jsx)("p",{id:"twin-lab-question-hint",children:c("twinLab.questionHint")}),(0,s.jsx)("p",{id:"twin-lab-count",className:"font-mono",children:c("twinLab.characters",{n:u.length,max:r.s})})]}),(0,s.jsxs)(o.l6,{label:c("twinLab.project"),className:"mt-5",value:p,onChange:e=>{h(e.target.value),S()},disabled:null!==w||!n,"aria-describedby":"twin-lab-scope-hint",children:[(0,s.jsx)("option",{value:"",children:c("twinLab.global")}),t.map(e=>(0,s.jsx)("option",{value:e.slug,children:e.label},e.slug))]}),(0,s.jsx)("p",{id:"twin-lab-scope-hint",className:"mt-2 text-xs leading-relaxed text-smoke",children:c("twinLab.scopeHint")}),(0,s.jsxs)("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[(0,s.jsx)(o.rA,{type:"submit",tone:"surface",busy:"preview"===w,busyLabel:c("twinLab.previewing"),disabled:null!==w||!u.trim()||!n,children:c("twinLab.preview")}),(0,s.jsx)("span",{className:"text-xs text-smoke",children:c("twinLab.previewCost")})]}),g&&(0,s.jsx)(o.lZ,{text:g,className:"mt-4"})]}),(0,s.jsxs)("div",{className:"min-w-0 border-t border-edge bg-ground px-5 py-5 sm:px-6 lg:border-t-0 lg:border-l",children:[(0,s.jsx)("p",{role:"status","aria-live":"polite",className:"font-mono text-xs text-smoke",children:"preview"===w?c("twinLab.previewing"):"draft"===w?c("twinLab.drafting"):(null==b?void 0:b.status)==="drafted"?c("twinLab.draftReady"):(null==b?void 0:b.status)==="abstained"?c("twinLab.abstained"):(null==b?void 0:b.status)==="preview"?c("twinLab.evidenceCount",{n:b.evidence.length}):c("twinLab.waiting")}),!b&&(0,s.jsx)(o.pp,{variant:"bare",className:"mt-4 max-w-md",title:c(n?"twinLab.emptyTitle":"twinLab.firstTitle"),action:!n&&(0,s.jsx)(m,{}),children:c(n?"twinLab.emptyBody":"twinLab.noBeliefs")}),(null==b?void 0:b.status)==="abstained"&&(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsx)("h3",{className:"text-base font-semibold",children:c("twinLab.abstainedTitle")}),(0,s.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-smoke",children:c(L)}),(0,s.jsx)(m,{className:"mt-3"})]}),(null==b?void 0:b.status)==="drafted"&&(0,s.jsxs)(o.Zp,{className:"mt-3",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:c("twinLab.draftTitle")}),(0,s.jsx)("p",{className:"mt-2 whitespace-pre-wrap break-words text-base leading-relaxed",children:b.answer}),(0,s.jsx)("p",{className:"mt-3 text-xs leading-relaxed text-smoke",children:c("twinLab.draftHint")}),(0,s.jsx)("p",{className:"mt-3 text-xs leading-relaxed text-smoke",children:c("twinLab.disagree")}),(0,s.jsx)(m,{className:"mt-3"})]}),b&&b.evidence.length>0&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:c("drafted"===b.status?"twinLab.citations":"twinLab.evidence")}),(0,s.jsx)("ol",{className:"mt-3 flex flex-col gap-2",role:"list",children:b.evidence.map((e,t)=>{var n;let i=(0,d.Jj)(e.topic);return(0,s.jsxs)(o.Zp,{as:"li",pad:"sm",children:[(0,s.jsxs)("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 font-mono text-[11px] text-smoke",children:[(0,s.jsx)("span",{"aria-hidden":!0,children:String(t+1).padStart(2,"0")}),(0,s.jsx)("span",{children:c("episode"===e.kind?"twinLab.episode":"signed"===e.state?"twin.badgeSigned":"twin.badgeStanding")}),"episode"!==e.kind&&(0,s.jsxs)("span",{children:["\xb7 ",i?c(i):e.topic]})]}),(0,s.jsxs)("a",{href:"episode"===e.kind?"/twin?episode=".concat(encodeURIComponent(e.id),"#episode-").concat(e.id):"#belief-".concat(e.id),className:"mt-1.5 flex items-start gap-2 text-sm leading-relaxed underline-offset-4 hover:underline",children:[(0,s.jsx)("span",{className:"min-w-0 flex-1 whitespace-pre-line break-words",children:e.statement}),(0,s.jsx)(l.OvC,{"aria-hidden":!0,className:"mt-0.5 h-4 w-4 shrink-0 text-smoke"}),(0,s.jsx)("span",{className:"sr-only",children:c("episode"===e.kind?"twinLab.openEpisode":"twinLab.openEvidence")})]}),(0,s.jsx)("p",{className:"mt-2 text-xs text-smoke",children:"episode"===e.kind?c("twinLab.episodeScope"):e.scope?c("twinLab.projectRule",{project:null!=(n=null==M?void 0:M.label)?n:e.scope}):c("twinLab.globalRule")})]},e.id)})})]}),b&&b.omittedBeliefs>0&&(0,s.jsx)("p",{className:"mt-3 font-mono text-xs text-smoke",children:c("twinLab.omitted",{n:b.omittedBeliefs})}),null!==v&&(0,s.jsx)("p",{className:"mt-3 font-mono text-xs text-smoke",children:c("twinLab.remaining",{n:v})}),(null==b?void 0:b.status)==="preview"&&b.evidence.length>0&&(0,s.jsxs)("div",{className:"mt-5 border-t border-edge pt-4",children:[(0,s.jsx)(o.rA,{type:"button",tone:"accent",busy:"draft"===w,busyLabel:c("twinLab.drafting"),disabled:null!==w||0===v,onClick:()=>void C(!1),children:c("twinLab.rehearse")}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-smoke",children:c(0===v?"twinLab.budgetReached":"twinLab.draftCost")})]})]})]}),(0,s.jsx)("p",{className:"border-t border-edge px-5 py-3 text-xs leading-relaxed text-smoke sm:px-6",children:c("twinLab.boundary")})]})}function m(e){let{className:t}=e,n=(0,a.kj)();return(0,s.jsxs)("a",{href:"#teach",className:"inline-flex items-center gap-1 text-sm underline underline-offset-4".concat(t?" ".concat(t):""),children:[n("twinLab.teach"),(0,s.jsx)(l.OvC,{"aria-hidden":!0,className:"h-4 w-4"})]})}},4733:(e,t,n)=>{"use strict";n.d(t,{TwinMemory:()=>w});var s=n(38657),i=n(32165),l=n(10354),a=n(3043),r=n(9144),o=n(52948);let d=["goal","context","constraints","alternatives","decision","rationale","outcome","conditions","exceptions"],c={goal:{label:"twinMemory.fieldGoal",hint:"twinMemory.hintGoal"},context:{label:"twinMemory.fieldContext",hint:"twinMemory.hintContext"},constraints:{label:"twinMemory.fieldConstraints",hint:"twinMemory.hintConstraints"},alternatives:{label:"twinMemory.fieldAlternatives",hint:"twinMemory.hintAlternatives"},decision:{label:"twinMemory.fieldDecision",hint:"twinMemory.hintDecision"},rationale:{label:"twinMemory.fieldRationale",hint:"twinMemory.hintRationale"},outcome:{label:"twinMemory.fieldOutcome",hint:"twinMemory.hintOutcome"},conditions:{label:"twinMemory.fieldConditions",hint:"twinMemory.hintConditions"},exceptions:{label:"twinMemory.fieldExceptions",hint:"twinMemory.hintExceptions"}};function m(e){var t,n,s;return(null==(t=e.fields.decision)?void 0:t.text.trim())||(null==(n=e.fields.goal)?void 0:n.text.trim())||(null==(s=e.fields.context)?void 0:s.text.trim())||null}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();return null!==e.validUntil&&Date.parse(e.validUntil)<=t}let x={opening:"twinMemory.kindOpening",reaction:"twinMemory.kindReaction",brief:"twinMemory.kindBrief"};async function p(e,t,n){let s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),i=await s.json();if(!s.ok){var l;throw Error([null!=(l=i.error)?l:n,i.hint].filter(Boolean).join(" "))}return i}function h(e,t){return e instanceof Error?e.message:t("project.unreachable")}function w(e){var t;let{projects:n,episodes:l,coverage:d,dailyCalls:c,focusId:m,olderCursor:u,conflicts:x}=e,p=(0,r.kj)(),w=(null==(t=l.find(e=>e.id===m))?void 0:t.status)==="dismissed",[j,v]=(0,i.useState)(w),[N,k]=(0,i.useState)(null),[M,S]=(0,i.useState)(null),[C,L]=(0,i.useState)(null),[T,O]=(0,i.useState)(null),P=(0,i.useRef)(!1),[R,A]=(0,i.useState)(l),[E,I]=(0,i.useState)(l),[U,D]=(0,i.useState)(u),[q,B]=(0,i.useState)(""),[F,z]=(0,i.useState)(""),[Z,_]=(0,i.useState)(null),[J,H]=(0,i.useState)(null),G=(0,i.useRef)(!1);R!==l&&(A(l),I(l),D(u));let W=E.filter(e=>j||"active"===e.status),V=E.filter(e=>"dismissed"===e.status).length;function Y(e){var t,s;return{...e,projectName:e.identity&&null!=(s=null==(t=n.find(t=>t.identity===e.identity))?void 0:t.label)?s:null}}async function K(e,t){var n,s;let i=new URLSearchParams;e&&i.set("q",e),t&&i.set("before",t);let l=i.toString(),a=await fetch("/api/twin/episodes".concat(l?"?".concat(l):"")),r=await a.json();if(!a.ok||!Array.isArray(r.episodes))throw Error(null!=(n=r.error)?n:p("twinMemory.requestFailed"));return{episodes:r.episodes.map(Y),nextCursor:null!=(s=r.nextCursor)?s:null}}async function Q(e){if(G.current)return;let t=e.trim();if(!t){z(""),I(l),D(u),H(null);return}G.current=!0,_("search"),H(null);try{let e=await K(t,null);z(t),I(e.episodes),D(e.nextCursor)}catch(e){H(h(e,p))}finally{G.current=!1,_(null)}}async function X(){if(!G.current&&U){G.current=!0,_("older"),H(null);try{let e=await K(F,U);I(t=>{let n=new Set(t.map(e=>e.id));return[...t,...e.episodes.filter(e=>!n.has(e.id))]}),D(e.nextCursor)}catch(e){H(h(e,p))}finally{G.current=!1,_(null)}}}return(0,i.useEffect)(()=>{var e;m&&(w&&v(!0),O(m),null==(e=document.getElementById("episode-".concat(m)))||e.focus())},[m,w]),(0,i.useEffect)(()=>{var e;T&&(null==(e=document.getElementById("episode-".concat(T)))||e.focus())},[T,j]),(0,i.useEffect)(()=>{F&&Q(F)},[l]),(0,s.jsxs)("section",{id:"decision-memory",tabIndex:-1,"aria-labelledby":"twin-memory-title",className:"page-shell__section scroll-mt-24 overflow-hidden rounded-lg border border-edge bg-surface",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-edge px-5 py-5 sm:px-6",children:[(0,s.jsxs)("div",{className:"max-w-2xl",children:[(0,s.jsxs)("p",{className:"flex items-center gap-2 font-mono text-xs text-smoke",children:[(0,s.jsx)(a.lPA,{"aria-hidden":!0,className:"h-4 w-4"}),p("twinMemory.eyebrow")]}),(0,s.jsx)("h2",{id:"twin-memory-title",className:"mt-2 text-base font-semibold",children:p("twinMemory.title")}),(0,s.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-smoke",children:p("twinMemory.lead")})]}),(0,s.jsxs)("div",{className:"rounded-lg border border-edge bg-ground px-3 py-2 font-mono text-xs text-smoke",children:[(0,s.jsx)("p",{children:p("twinMemory.captured",{n:d.total})}),(0,s.jsx)("p",{className:"mt-1",children:p("twinMemory.awaiting",{n:d.pending})})]})]}),(0,s.jsxs)("div",{className:"grid lg:grid-cols-[1.3fr_1fr]",children:[(0,s.jsx)(b,{projects:n,revision:N,blocked:M,dirty:P,savedMessage:C,onCancel:()=>{k(null),S(null),L(null)},onClear:()=>{k(M),S(null)},onSaved:()=>{L(p(N?"twinMemory.savedRevision":"twinMemory.savedNew")),k(null),S(null)}}),(0,s.jsx)(y,{pendingCount:d.pending,deferred:d.deferred,dailyCalls:c})]}),x.length>0&&(0,s.jsxs)("div",{id:"competing-versions",tabIndex:-1,"aria-labelledby":"twin-competing-title",className:"scroll-mt-24 border-t border-edge px-5 py-5 sm:px-6",children:[(0,s.jsx)("h3",{id:"twin-competing-title",className:"text-base font-semibold",children:p("twinMemory.competingTitle")}),(0,s.jsx)("p",{className:"mt-2 max-w-2xl text-xs leading-relaxed text-smoke",children:p("twinMemory.competingLead")}),(0,s.jsx)("p",{className:"mt-2 font-mono text-xs text-smoke",children:p("twinMemory.competingFamilies",{n:x.length})}),(0,s.jsx)("ul",{className:"mt-4 grid items-start gap-3 xl:grid-cols-2",role:"list",children:x.map(e=>(0,s.jsx)(f,{family:e},e.map(e=>e.id).join(",")))})]}),(0,s.jsxs)("div",{className:"border-t border-edge px-5 py-5 sm:px-6",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,s.jsx)("h3",{className:"text-base font-semibold",children:p("twinMemory.recentTitle")}),V>0&&(0,s.jsx)(o.Jl,{size:"sm",checked:j,onChange:e=>v(e.target.checked),children:p("twinMemory.includeDismissed",{n:V})})]}),(0,s.jsxs)("form",{role:"search","aria-busy":"search"===Z,className:"mt-3 flex flex-wrap items-end gap-2",onSubmit:e=>{e.preventDefault(),Q(q)},children:[(0,s.jsx)(o.D0,{label:p("twinMemory.searchLabel"),className:"min-w-0 grow sm:max-w-md",type:"search",value:q,maxLength:200,disabled:null!==Z,"aria-describedby":"memory-search-hint",onChange:e=>{B(e.target.value),!e.target.value.trim()&&F&&Q("")}}),(0,s.jsx)(o.rA,{type:"submit",tone:"surface",busy:"search"===Z,busyLabel:p("twinMemory.searching"),disabled:null!==Z,children:p("twinMemory.search")}),F&&(0,s.jsx)(o.rA,{type:"button",tone:"plain",disabled:null!==Z,onClick:()=>{B(""),Q("")},children:p("twinMemory.clearSearch")})]}),(0,s.jsx)("p",{id:"memory-search-hint",className:"mt-1 text-xs leading-relaxed text-smoke",children:p("twinMemory.searchHint")}),J&&(0,s.jsx)(o.lZ,{text:J,className:"mt-2"}),(0,s.jsx)("p",{className:"mt-3 text-xs text-smoke",children:F?p("twinMemory.shownMatches",{query:F,n:W.length}):p("twinMemory.shown",{n:W.length})}),0===W.length&&F?(0,s.jsx)(o.pp,{variant:"note",role:"status",className:"mt-4",title:p("twinMemory.noMatches",{query:F})}):0===W.length?(0,s.jsx)(o.pp,{className:"mt-4",title:p("twinMemory.emptyTitle"),children:p("twinMemory.emptyBody")}):(0,s.jsx)("ul",{className:"mt-4 grid items-start gap-3 xl:grid-cols-2",role:"list",children:W.map(e=>(0,s.jsx)(g,{episode:e,previousAvailable:!!(e.supersedesId&&E.some(t=>t.id===e.supersedesId)),hasActiveSuccessor:!!e.activeRevisionId,onPrevious:()=>{var t,n;v(!0),O(null!=(n=e.supersedesId)?n:null),null==(t=document.getElementById("episode-".concat(e.supersedesId)))||t.focus()},onRevise:()=>{var t;L(null),e.id!==(null==N?void 0:N.id)&&(P.current?S(e):(S(null),k(e))),null==(t=document.getElementById("memory-capture-form"))||t.scrollIntoView({block:"start",behavior:"instant"})}},e.id))}),U&&(0,s.jsx)(o.rA,{type:"button",tone:"surface",className:"mt-4",busy:"older"===Z,busyLabel:p("twinMemory.loadingOlder"),disabled:null!==Z,onClick:()=>void X(),children:p("twinMemory.loadOlder")}),(0,s.jsx)("p",{className:"mt-4 text-xs leading-relaxed text-smoke",children:p("twinMemory.boundary")})]})]})}function f(e){let{family:t}=e,n=(0,r.kj)(),a=(0,l.useRouter)(),[d,c]=(0,i.useState)(null),[u,x]=(0,i.useState)(null),w=(0,i.useRef)(!1);async function f(e){if(w.current)return;w.current=!0,c(e.id),x(null);let s=!1;try{for(let i of t)i.id!==e.id&&(await p("/api/twin/episodes",{id:i.id,status:"dismissed",expectedUpdatedAt:i.updatedAt},n("twinMemory.requestFailed")),s=!0)}catch(e){x(h(e,n))}finally{w.current=!1,c(null),s&&a.refresh()}}return(0,s.jsxs)("li",{className:"min-w-0 rounded-lg border border-edge bg-ground p-4",children:[(0,s.jsx)("ol",{className:"space-y-3",role:"list",children:t.map(e=>{var t,i;return(0,s.jsxs)("li",{className:"flex flex-wrap items-start justify-between gap-3 border-t border-edge pt-3 first:border-t-0 first:pt-0",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("p",{className:"flex flex-wrap gap-x-2 gap-y-1 font-mono text-[11px] text-smoke",children:[(0,s.jsx)("span",{children:n("owner"===e.origin?"twinMemory.byOwner":"twinMemory.fromHistory")}),(0,s.jsxs)("span",{children:["\xb7 ",null!=(t=e.projectName)?t:n(e.identity?"twinMemory.unlinkedProject":"twinMemory.noProject")]}),(0,s.jsxs)("time",{dateTime:e.createdAt,children:["\xb7 ",e.createdAt.slice(0,10)]})]}),(0,s.jsx)("p",{className:"mt-1 line-clamp-3 break-words text-sm leading-relaxed",children:null!=(i=m(e))?i:n("twinMemory.untitled")}),(0,s.jsx)("a",{href:"#episode-".concat(e.id),className:"mt-1 inline-block text-xs underline underline-offset-4",children:n("twinMemory.explore")})]}),(0,s.jsx)(o.rA,{type:"button",tone:"surface",busy:d===e.id,busyLabel:n("twinMemory.keeping"),disabled:null!==d,onClick:()=>void f(e),children:n("twinMemory.keepThis")})]},e.id)})}),u&&(0,s.jsx)(o.lZ,{text:u,className:"mt-3"})]})}function b(e){var t,n,a,m,u;let{projects:x,revision:w,blocked:f,dirty:b,savedMessage:y,onSaved:g,onCancel:j,onClear:v}=e,N=(0,r.kj)(),k=(0,l.useRouter)(),[M,S]=(0,i.useState)({}),[C,L]=(0,i.useState)(""),[T,O]=(0,i.useState)(new Set),[P,R]=(0,i.useState)(null),[A,E]=(0,i.useState)(""),[I,U]=(0,i.useState)(!1),[D,q]=(0,i.useState)(null),[B,F]=(0,i.useState)(!1),z=(0,i.useRef)(!1),Z=(0,i.useRef)(null),_=!!((null==(t=M.goal)?void 0:t.trim())||(null==(n=M.decision)?void 0:n.trim())),J=d.filter(e=>"goal"!==e&&"decision"!==e),H=J.filter(e=>{var t;return T.has(e)||!!(null==(t=M[e])?void 0:t.trim())}),G=J.filter(e=>!H.includes(e)),W=(null==w?void 0:w.identity)&&null!=(m=null==(a=x.find(e=>e.identity===w.identity))?void 0:a.slug)?m:"";async function V(e){if(e.preventDefault(),!z.current&&_){z.current=!0,U(!0),q(null);try{await p("/api/twin/episodes",{fields:M,...A?{validUntil:A}:{},...w?{replacesId:w.id,expectedUpdatedAt:w.updatedAt}:C?{slug:C}:{}},N("twinMemory.requestFailed")),S({}),O(new Set),R(null),E(""),F(!1),b.current=!1,g(),k.refresh()}catch(e){q(h(e,N))}finally{z.current=!1,U(!1)}}}function Y(e){var t;let n=null!=(t=M[e])?t:"";return(0,s.jsxs)("div",{children:[(0,s.jsx)(o.fs,{label:N(c[e].label),id:"memory-".concat(e),value:n,maxLength:1200,rows:"decision"===e?3:2,disabled:I,placeholder:N(c[e].hint),"aria-describedby":"memory-".concat(e,"-count"),onChange:t=>{S(n=>({...n,[e]:t.target.value})),F(!0),b.current=!0}}),(0,s.jsx)("p",{id:"memory-".concat(e,"-count"),className:"mt-1 text-right font-mono text-[11px] text-smoke",children:N("twinMemory.characters",{n:n.length,max:1200})})]},e)}return(0,i.useEffect)(()=>{var e,t,n,s;S(w?Object.fromEntries(d.map(e=>{var t,n;return[e,null!=(n=null==(t=w.fields[e])?void 0:t.text)?n:""]})):{}),O(new Set(w?d.filter(e=>{var t;return null==(t=w.fields[e])?void 0:t.text.trim()}):[])),R(null),E(null!=(s=null==w||null==(e=w.validUntil)?void 0:e.slice(0,10))?s:""),L(W),F(!1),b.current=!1,w&&(null==(n=Z.current)||null==(t=n.querySelector("textarea"))||t.focus({preventScroll:!0}))},[w,W,b]),(0,i.useEffect)(()=>{var e;P&&(null==(e=document.getElementById("memory-".concat(P)))||e.focus())},[P]),(0,s.jsxs)("form",{id:"memory-capture-form",ref:Z,onSubmit:V,"aria-busy":I,"aria-labelledby":"memory-capture-title",className:"min-w-0 scroll-mt-24 px-5 py-5 sm:px-6",children:[(0,s.jsx)("h3",{id:"memory-capture-title",className:"text-base font-semibold",children:N(w?"twinMemory.reviseTitle":"twinMemory.captureTitle")}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-smoke",children:N(w?"twinMemory.reviseHint":"twinMemory.captureHint")}),(0,s.jsx)("div",{role:"status","aria-live":"polite",children:f&&(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-3 rounded-lg border border-edge bg-ground px-3 py-3",children:[(0,s.jsx)("p",{className:"text-xs leading-relaxed text-smoke",children:N("twinMemory.unsavedDraft")}),(0,s.jsx)(o.rA,{type:"button",tone:"surface",disabled:I,onClick:v,children:N("twinMemory.clearDraft")})]})}),(0,s.jsxs)("div",{className:"mt-4 space-y-3",children:[Y("goal"),Y("decision"),(0,s.jsxs)(o.l6,{label:N("twinMemory.projectContext"),value:C,disabled:I||null!==w,onChange:e=>L(e.target.value),children:[(0,s.jsx)("option",{value:"",children:(null==w?void 0:w.identity)&&!C?null!=(u=w.projectName)?u:N("twinMemory.originalProject"):N("twinMemory.noProject")}),x.map(e=>(0,s.jsx)("option",{value:e.slug,children:e.label},e.slug))]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.D0,{label:N("twinMemory.validUntilLabel"),type:"date",value:A,disabled:I,"aria-describedby":"memory-valid-until-hint",onChange:e=>{E(e.target.value),F(!0),b.current=!0}}),(0,s.jsx)("p",{id:"memory-valid-until-hint",className:"mt-1 text-xs leading-relaxed text-smoke",children:N("twinMemory.validUntilHint")})]}),H.map(Y),G.length>0&&(0,s.jsxs)("div",{className:"rounded-lg border border-edge px-3 py-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:N("twinMemory.moreFields")}),(0,s.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:G.map(e=>(0,s.jsx)(o.rA,{type:"button",tone:"surface",disabled:I,"aria-label":N("twinMemory.addField",{field:N(c[e].label).toLocaleLowerCase()}),onClick:()=>{O(t=>new Set(t).add(e)),R(e)},children:N(c[e].label)},e))})]})]}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-3",children:[(0,s.jsx)(o.rA,{type:"submit",tone:"accent",busy:I,busyLabel:N("twinMemory.saving"),disabled:I||!_,children:N(w?"twinMemory.saveRevision":"twinMemory.saveEpisode")}),w&&(0,s.jsx)(o.rA,{type:"button",tone:"plain",disabled:I,onClick:j,children:N("twinMemory.cancelRevision")}),(0,s.jsx)("span",{className:"text-xs text-smoke",children:N("twinMemory.localSave")})]}),D&&(0,s.jsx)(o.lZ,{text:D,className:"mt-3"}),(0,s.jsx)("div",{role:"status","aria-live":"polite",children:y&&!B&&(0,s.jsx)("p",{className:"mt-3 text-sm text-smoke",children:y})})]})}function y(e){var t,n;let{pendingCount:d,deferred:c,dailyCalls:m}=e,u=(0,r.kj)(),x=(0,l.useRouter)(),[w,f]=(0,i.useState)(null),[b,y]=(0,i.useState)(null),[g,j]=(0,i.useState)(null),[v,N]=(0,i.useState)(null),k=(0,i.useRef)(!1),M=m>0&&d>0?Math.max(1,Math.ceil(d/(12*m))):null;async function S(e){if(k.current||"learn"===e&&(!b||!b.selected||b.remainingCalls<b.calls))return;k.current=!0,f(e),j(null),N(null);let t=u("twinMemory.requestFailed");try{var n,s,i,l,a;if("capture"===e){let e=await p("/api/twin/mine",{captureNarratives:!0},t);y(null),N([u("twinMemory.capturedNew",{n:null!=(s=e.narrativesSaved)?s:0}),e.saved?u("twin.minedQuotes",{n:e.saved}):"",(null==(n=e.denied)?void 0:n.length)?u("twinMemory.capturedDenied",{n:e.denied.length}):"",e.narrativesUnmatched?u("twinMemory.capturedUnmatched",{n:e.narrativesUnmatched}):"",e.narrativesUndated?u("twinMemory.capturedUndated",{n:e.narrativesUndated}):""].filter(Boolean).join(" ")),x.refresh()}else if("preview"===e)y(await p("/api/twin/episodes/learn",{dryRun:!0},t));else{let e=await p("/api/twin/episodes/learn",{},t);y(null),N([u("twinMemory.learnStored",{stored:null!=(i=e.stored)?i:0,processed:null!=(l=e.processed)?l:0,remaining:null!=(a=e.remaining)?a:0}),e.dropped?u("twinMemory.learnDropped",{n:e.dropped}):"",e.failed?u("cut"===e.failed.reason?"twinMemory.learnCut":"twinMemory.learnUnsupported"):"",e.failed?u("twinMemory.learnDeferred",{n:e.failed.records}):""].filter(Boolean).join(" ")),x.refresh()}}catch(t){j(h(t,u)),"learn"===e&&(y(null),x.refresh())}finally{k.current=!1,f(null)}}return(0,s.jsxs)("div",{className:"min-w-0 border-t border-edge bg-ground px-5 py-5 sm:px-6 lg:border-t-0 lg:border-l","aria-busy":null!==w,children:[(0,s.jsxs)("h3",{className:"flex items-center gap-2 text-base font-semibold",children:[(0,s.jsx)(a.tZt,{"aria-hidden":!0,className:"h-4 w-4 text-smoke"}),u("twinMemory.learnTitle")]}),(0,s.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-smoke",children:u("twinMemory.learnLead")}),(0,s.jsxs)("div",{className:"mt-5 rounded-lg border border-edge bg-surface p-4",children:[(0,s.jsx)("p",{className:"font-mono text-xs text-smoke",children:u("twinMemory.step1")}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-smoke",children:u("twinMemory.step1Hint")}),(0,s.jsxs)(o.rA,{type:"button",tone:"surface",className:"mt-3",busy:"capture"===w,busyLabel:u("twinMemory.capturing"),disabled:null!==w,onClick:()=>void S("capture"),children:[(0,s.jsx)(a.Dho,{"aria-hidden":!0,className:"h-4 w-4"}),u("twinMemory.capture")]}),(0,s.jsx)("p",{className:"mt-2 text-xs text-smoke",children:u("twinMemory.noCall")})]}),(0,s.jsxs)("div",{className:"mt-3 rounded-lg border border-edge bg-surface p-4",children:[(0,s.jsx)("p",{className:"font-mono text-xs text-smoke",children:u("twinMemory.step2")}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-smoke",children:u("twinMemory.step2Hint")}),(0,s.jsx)(o.rA,{type:"button",tone:"surface",className:"mt-3",busy:"preview"===w,busyLabel:u("twinMemory.previewing"),disabled:null!==w,onClick:()=>void S("preview"),children:u("twinMemory.preview")}),!b&&(0,s.jsxs)("div",{className:"mt-2 space-y-1 text-xs text-smoke",children:[(0,s.jsx)("p",{children:u("twinMemory.awaiting",{n:d})}),c>0&&(0,s.jsx)("p",{children:u("twinMemory.deferred",{n:c})}),m>0?(0,s.jsx)("p",{children:u("twinMemory.passReads",{n:24})}):(0,s.jsx)("p",{children:u("twinMemory.extractionOff")}),null!==M&&(0,s.jsx)("p",{children:u("twinMemory.queueDays",{n:M})})]}),b&&(0,s.jsxs)("div",{className:"mt-4 border-t border-edge pt-4",children:[(0,s.jsxs)("dl",{className:"grid grid-cols-[1fr_auto] gap-x-3 gap-y-2 text-xs",children:[(0,s.jsx)("dt",{className:"text-smoke",children:u("twinMemory.selected")}),(0,s.jsx)("dd",{className:"font-mono",children:b.selected}),(0,s.jsx)("dt",{className:"text-smoke",children:u("twinMemory.inputTokens")}),(0,s.jsx)("dd",{className:"font-mono",children:b.inputTokens}),(0,s.jsx)("dt",{className:"text-smoke",children:u("twinMemory.outputTokens")}),(0,s.jsx)("dd",{className:"font-mono",children:b.outputTokens}),(0,s.jsx)("dt",{className:"text-smoke",children:u("twinMemory.calls")}),(0,s.jsx)("dd",{className:"font-mono",children:b.calls}),(0,s.jsx)("dt",{className:"text-smoke",children:u("twinMemory.remainingCalls")}),(0,s.jsx)("dd",{className:"font-mono",children:b.remainingCalls})]}),b.contextOnly>0&&(0,s.jsx)("p",{className:"mt-2 text-xs text-smoke",children:u("twinMemory.contextOnly",{n:b.contextOnly})}),(null!=(t=b.retrying)?t:0)>0&&(0,s.jsx)("p",{className:"mt-2 text-xs text-smoke",children:u("twinMemory.learnRetrying",{n:null!=(n=b.retrying)?n:0})}),(b.provider||b.model)&&(0,s.jsx)("p",{className:"mt-3 break-words font-mono text-[11px] text-smoke",children:[b.provider,b.model].filter(Boolean).join(" / ")}),0===b.selected?(0,s.jsx)(o.pp,{variant:"note",className:"mt-3",title:u("twinMemory.nothingUnread")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.rA,{type:"button",tone:"accent",className:"mt-4",busy:"learn"===w,busyLabel:u("twinMemory.learning"),disabled:null!==w||b.remainingCalls<b.calls,onClick:()=>void S("learn"),children:u("twinMemory.learn")}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-smoke",children:u(b.remainingCalls<b.calls?"twinMemory.budgetShort":"twinMemory.learnCost")})]})]})]}),g&&(0,s.jsx)(o.lZ,{text:g,className:"mt-3"}),(0,s.jsx)("p",{role:"status","aria-live":"polite",className:"mt-3 text-xs leading-relaxed text-smoke",children:"learn"===w?u("twinMemory.extracting"):v})]})}function g(e){var t,n,a,w,f,b,y,g;let{episode:j,onRevise:v,previousAvailable:N,hasActiveSuccessor:k,onPrevious:M}=e,S=(0,r.kj)(),C=(0,r.Ym)(),L=(0,l.useRouter)(),{recorded:T,missing:O}=function(e){let t=d.filter(t=>{var n;return!!(null==(n=e.fields[t])?void 0:n.text.trim())});return{recorded:t,missing:d.filter(e=>!t.includes(e))}}(j),[P,R]=(0,i.useState)(null),[A,E]=(0,i.useState)(null),[I,U]=(0,i.useState)(null),[D,q]=(0,i.useState)(!1),[B,F]=(0,i.useState)(null),[z,Z]=(0,i.useState)(null),[_,J]=(0,i.useState)(j.validUntil),[H,G]=(0,i.useState)(null!=(a=null==(t=j.validUntil)?void 0:t.slice(0,10))?a:"");_!==j.validUntil&&(J(j.validUntil),G(null!=(f=null==(w=j.validUntil)?void 0:w.slice(0,10))?f:""));let W=(0,i.useRef)(!1),V=(0,i.useRef)(!1),Y=(0,i.useRef)(null),K=T.some(e=>{var t;return!!(null==(t=j.fields[e])?void 0:t.narrativeId)}),Q=null!=(b=m(j))?b:S("twinMemory.untitled"),X=e=>e.map(e=>S(c[e].label).toLocaleLowerCase()).join(", "),$="dismissed"===j.status&&!k,ee="active"===j.status&&k,et=u(j),en=j.validUntil?new Date(j.validUntil).toLocaleDateString(C,{timeZone:"UTC"}):null;async function es(){if(!W.current){W.current=!0,R("status"),E(null);try{await p("/api/twin/episodes",{id:j.id,status:"active"===j.status?"dismissed":"active",expectedUpdatedAt:j.updatedAt},S("twinMemory.requestFailed")),L.refresh()}catch(e){E(h(e,S))}finally{W.current=!1,R(null)}}}async function ei(e){if(!W.current){W.current=!0,R(null===e?"clearExpiry":"expiry"),E(null);try{await p("/api/twin/episodes",{id:j.id,validUntil:e,expectedUpdatedAt:j.updatedAt},S("twinMemory.requestFailed")),L.refresh()}catch(e){E(h(e,S))}finally{W.current=!1,R(null)}}}async function el(){if(null===I&&!V.current){V.current=!0,q(!0),F(null);try{let t=await fetch("/api/twin/episodes?id=".concat(encodeURIComponent(j.id))),n=await t.json();if(!t.ok||!Array.isArray(n.evidence)){var e;throw Error(null!=(e=n.error)?e:S("twinMemory.evidenceFailed"))}U(n.evidence)}catch(e){F(h(e,S))}finally{V.current=!1,q(!1)}}}return(0,i.useEffect)(()=>{var e;I&&z&&(null==(e=document.getElementById("episode-".concat(j.id,"-source-").concat(z)))||e.focus())},[I,j.id,z]),(0,s.jsxs)("li",{id:"episode-".concat(j.id),tabIndex:-1,className:"min-w-0 scroll-mt-24 rounded-lg border border-edge bg-ground p-4",children:[(0,s.jsxs)("p",{className:"flex flex-wrap gap-x-2 gap-y-1 font-mono text-[11px] text-smoke",children:[(0,s.jsx)("span",{children:S("owner"===j.origin?"twinMemory.byOwner":"twinMemory.fromHistory")}),(0,s.jsxs)("span",{children:["\xb7 ",null!=(y=j.projectName)?y:S(j.identity?"twinMemory.unlinkedProject":"twinMemory.noProject")]}),"dismissed"===j.status&&(0,s.jsxs)("span",{children:["\xb7 ",S("twinMemory.dismissed")]})]}),(0,s.jsx)("h4",{className:"mt-2 line-clamp-3 break-words text-sm font-medium leading-relaxed",children:Q}),j.supersedesId&&(0,s.jsx)("p",{className:"mt-2 text-xs text-smoke",children:N?(0,s.jsx)("a",{href:"#episode-".concat(j.supersedesId),onClick:M,className:"underline underline-offset-4",children:S("twinMemory.previousVersion")}):(0,s.jsxs)("a",{href:"/twin?episode=".concat(encodeURIComponent(j.supersedesId),"#episode-").concat(j.supersedesId),className:"underline underline-offset-4",children:[S("twinMemory.previousVersion")," ",(0,s.jsx)("span",{className:"sr-only",children:S("twinMemory.outsideView")})]})}),(0,s.jsx)("p",{className:"mt-3 font-mono text-[11px] text-smoke",children:S("twinMemory.recorded",{list:X(T)})}),(0,s.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-smoke",children:S("dismissed"===j.status?"twinMemory.reachNowhere":u(j)?"twinMemory.reachExpired":ee?"twinMemory.reachWithheld":"history"===j.origin?"twinMemory.reachLabOnly":(null==(g=j.fields.decision)?void 0:g.text.trim())?j.identity?"twinMemory.reachProject":"twinMemory.reachGeneral":"twinMemory.reachNoDecision")}),en&&(0,s.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-smoke",children:S(et?"twinMemory.expiredOn":"twinMemory.appliesThrough",{date:en})}),(0,s.jsxs)("details",{className:"mt-3",children:[(0,s.jsx)("summary",{className:"cursor-pointer text-xs font-medium underline-offset-4 hover:underline",children:S("twinMemory.explore")}),(0,s.jsx)("dl",{className:"mt-3 space-y-3",children:T.map(e=>{var t;return(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-xs font-medium",children:S(c[e].label)}),(0,s.jsxs)("dd",{className:"mt-1 whitespace-pre-wrap break-words text-sm leading-relaxed text-smoke",children:[j.fields[e].text,(null==(t=j.fields[e])?void 0:t.narrativeId)&&(0,s.jsx)("button",{type:"button",className:"mt-1 block text-xs underline underline-offset-4","aria-label":S("twinMemory.viewSourceFor",{field:S(c[e].label).toLocaleLowerCase()}),onClick:()=>{var t;let n=j.fields[e].narrativeId;Y.current&&(Y.current.open=!0),Z(n),I&&(null==(t=document.getElementById("episode-".concat(j.id,"-source-").concat(n)))||t.focus()),el()},children:S("twinMemory.viewSource")})]})]},e)})}),O.length>0&&(0,s.jsx)("p",{className:"mt-4 border-t border-edge pt-3 text-xs leading-relaxed text-smoke",children:S("twinMemory.notRecorded",{list:X(O)})}),(0,s.jsxs)("div",{className:"mt-4 border-t border-edge pt-3",children:[(0,s.jsx)("p",{className:"text-xs font-medium",children:S("twinMemory.expiryTitle")}),(0,s.jsx)(o.D0,{label:S("twinMemory.validUntilLabel"),className:"mt-2",size:"sm",type:"date",value:H,disabled:null!==P,"aria-describedby":"episode-".concat(j.id,"-expiry-hint"),onChange:e=>G(e.target.value)}),(0,s.jsx)("p",{id:"episode-".concat(j.id,"-expiry-hint"),className:"mt-1 text-xs leading-relaxed text-smoke",children:S("twinMemory.validUntilHint")}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,s.jsx)(o.rA,{type:"button",tone:"surface",busy:"expiry"===P,busyLabel:S("twinMemory.savingExpiry"),disabled:null!==P||!H||H===(null==(n=j.validUntil)?void 0:n.slice(0,10)),onClick:()=>void ei(H),children:S("twinMemory.saveExpiry")}),j.validUntil&&(0,s.jsx)(o.rA,{type:"button",tone:"plain",busy:"clearExpiry"===P,busyLabel:S("twinMemory.clearingExpiry"),disabled:null!==P,onClick:()=>void ei(null),children:S("twinMemory.clearExpiry")})]})]})]}),K&&(0,s.jsxs)("details",{ref:Y,className:"mt-3",onToggle:e=>{e.currentTarget.open&&el()},children:[(0,s.jsx)("summary",{className:"cursor-pointer text-xs font-medium underline-offset-4 hover:underline",children:S("twinMemory.viewEvidence")}),D&&(0,s.jsx)("p",{role:"status",className:"mt-2 text-xs text-smoke",children:S("twinMemory.loadingEvidence")}),B&&(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)(o.lZ,{text:B}),(0,s.jsx)(o.rA,{type:"button",tone:"surface",className:"mt-2",onClick:()=>void el(),children:S("twinMemory.retryEvidence")})]}),I&&0===I.length&&(0,s.jsx)("p",{className:"mt-2 text-xs text-smoke",children:S("twinMemory.sourceGone")}),null==I?void 0:I.map(e=>{let t=x[e.kind];return(0,s.jsxs)("div",{id:"episode-".concat(j.id,"-source-").concat(e.id),tabIndex:-1,className:"mt-3 scroll-mt-24 rounded border border-edge bg-surface p-3",children:[(0,s.jsxs)("p",{className:"break-words font-mono text-[10px] text-smoke",children:[e.source," \xb7 ",t?S(t):e.kind," \xb7 ",e.at.slice(0,10)]}),(0,s.jsx)("p",{className:"mt-2 text-xs font-medium",children:S("brief"===e.kind?"twinMemory.briefText":"twinMemory.ownerText")}),(0,s.jsx)("blockquote",{className:"mt-1 whitespace-pre-wrap break-words text-xs leading-relaxed text-smoke",children:e.text}),e.truncated&&(0,s.jsx)("p",{className:"mt-2 text-xs text-smoke",children:S("twinMemory.truncated")}),e.context&&(0,s.jsxs)("details",{className:"mt-3 border-t border-edge pt-2",children:[(0,s.jsx)("summary",{className:"cursor-pointer text-xs text-smoke",children:S("twinMemory.agentContext")}),(0,s.jsx)("p",{className:"mt-2 whitespace-pre-wrap break-words text-xs leading-relaxed text-smoke",children:e.context})]})]},e.id)})]}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-2 border-t border-edge pt-3",children:[(0,s.jsx)("time",{dateTime:j.createdAt,className:"font-mono text-[10px] text-smoke",children:j.createdAt.slice(0,10)}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(o.rA,{type:"button",tone:"surface",disabled:null!==P||k,onClick:v,children:S("twinMemory.revise")}),("active"===j.status||$)&&(0,s.jsx)(o.rA,{type:"button",tone:"plain",busy:"status"===P,busyLabel:S("twin.saving"),disabled:null!==P,onClick:()=>void es(),children:S("active"===j.status?"twinMemory.dismiss":"twinMemory.restore")})]})]}),k&&(0,s.jsxs)("p",{className:"mt-2 text-xs leading-relaxed text-smoke",children:[S(ee?"twinMemory.competingActive":"twinMemory.successorActive")," ",ee?(0,s.jsx)("a",{href:"#competing-versions",className:"underline underline-offset-4",children:S("twinMemory.competingOpen")}):(0,s.jsx)("a",{href:"/twin?episode=".concat(encodeURIComponent(j.activeRevisionId),"#episode-").concat(j.activeRevisionId),className:"underline underline-offset-4",children:S("twinMemory.currentVersion")})]}),A&&(0,s.jsx)(o.lZ,{text:A,className:"mt-2"})]})}},9144:(e,t,n)=>{"use strict";n.d(t,{I18nProvider:()=>o,Ym:()=>d,Zs:()=>c,kj:()=>m});var s=n(38657),i=n(32165),l=n(2575);let a=(0,i.createContext)("en"),r=(0,i.createContext)("panoma");function o(e){let{locale:t,cli:n,children:i}=e;return(0,s.jsx)(a.Provider,{value:t,children:(0,s.jsx)(r.Provider,{value:n,children:i})})}function d(){return(0,i.useContext)(a)}function c(){return(0,i.useContext)(r)}function m(){let e=(0,i.useContext)(a),t=(0,i.useContext)(r);return(0,i.useCallback)((n,s)=>(0,l.t)(e,n,{cli:t,...s}),[e,t])}},10354:(e,t,n)=>{"use strict";var s=n(61990);n.o(s,"usePathname")&&n.d(t,{usePathname:function(){return s.usePathname}}),n.o(s,"useRouter")&&n.d(t,{useRouter:function(){return s.useRouter}}),n.o(s,"useSearchParams")&&n.d(t,{useSearchParams:function(){return s.useSearchParams}})},15797:(e,t,n)=>{"use strict";n.d(t,{TwinSynthesize:()=>o});var s=n(38657),i=n(32165),l=n(10354),a=n(9144),r=n(52948);function o(e){let{pending:t,ready:n,compact:o}=e,d=(0,a.kj)(),c=(0,l.useRouter)(),[m,u]=(0,i.useState)(!1),[x,p]=(0,i.useState)(null);async function h(){u(!0),p(null);try{var e,n,s,i,l,a,r,o,m;let u=0;if(t>0){let t=await fetch("/api/twin/classify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),s=await t.json();if(!t.ok)return void p(null!=(e=s.error)?e:d("twin.synthFailed"));u+=null!=(n=s.truncated)?n:0}let x=await fetch("/api/twin/synthesize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),h=await x.json();if(!x.ok)return void p(null!=(s=h.error)?s:d("twin.synthFailed"));u+=null!=(i=h.truncated)?i:0;let w=null!=(l=h.created)?l:0,f=null!=(a=h.refined)?a:0,b=null!=(r=h.retired)?r:0,y=null!=(o=h.proposed)?o:0,g=w+f+b+y,j=null!=(m=h.unchanged)?m:0,v=0===h.topics?j>0?d("twin.synthUpToDate"):d("twin.synthNothing"):d("twin.synthSame"),N=d("twin.synthDone",{created:w,refined:f,retired:b}),k=0===g?v:0===y?N:"".concat(N," ").concat(d("twin.synthAsks",{n:y}));p(u>0?"".concat(k," ").concat(d("twin.synthTruncated",{n:u})):k),c.refresh()}catch(e){p(d("project.unreachable"))}finally{u(!1)}}return(0,s.jsxs)("div",{className:o?"flex items-center gap-2":"mt-3 flex flex-col gap-1",children:[(0,s.jsx)(r.rA,{tone:"plain",type:"button",onClick:h,busy:m,busyLabel:d("twin.synthesizing"),disabled:!n,"aria-describedby":n?void 0:"twin-synth-why",className:"self-start",children:d("twin.synthesize")}),n?(0,s.jsx)("div",{role:"status","aria-live":"polite",children:x?(0,s.jsx)("p",{className:"font-mono text-xs text-smoke",children:x}):o?null:(0,s.jsx)("p",{className:"text-xs leading-relaxed text-smoke",children:d("twin.synthHint")})}):(0,s.jsx)("p",{id:"twin-synth-why",className:"text-xs leading-relaxed text-smoke",children:d("twin.synthNothing")})]})}},18557:(e,t,n)=>{"use strict";n.d(t,{BeliefEditor:()=>c});var s=n(38657),i=n(32165),l=n(10354),a=n(9144),r=n(59916),o=n(52948);let d={signed:"twin.badgeSigned",standing:"twin.badgeStanding",forming:"twin.badgeForming"};function c(e){let{beliefs:t,graveyard:n,proposals:r,unpublished:d,locale:c}=e,h=(0,a.kj)(),w=(0,l.useRouter)(),[f,b]=(0,i.useState)(new Map),[y,g]=(0,i.useState)(new Map),[j,v]=(0,i.useState)(null),[N,k]=(0,i.useState)(!1),[M,S]=(0,i.useState)(null),C=(0,i.useMemo)(()=>{let e=new Map;for(let n of t){let t=e.get(n.topic);t?t.push(n):e.set(n.topic,[n])}return[...e]},[t]),L=f.size>0||y.size>0;function T(e,t){b(n=>{let s=new Map(n);return void 0===t?s.delete(e):s.set(e,t),s})}async function O(){k(!0),S(null);let e=[],t=[],n=[];for(let[s,i]of f)"sign"===i.kind?e.push({id:s,...i.statement?{statement:i.statement}:{}}):"veto"===i.kind?t.push(s):n.push({id:s,identity:i.identity});let s=[...y].map(e=>{let[t,n]=e;return{id:t,accept:n}});try{let l=await fetch("/api/twin/taste",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sign:e,veto:t,scope:n,resolve:s})}),a=await l.json();if(!l.ok){var i;S(null!=(i=a.error)?i:String(l.status));return}b(new Map),g(new Map),v(null),w.refresh()}catch(e){S(h("project.unreachable"))}finally{k(!1)}}return(0,s.jsxs)(s.Fragment,{children:[r.length>0&&(0,s.jsxs)("section",{className:"mt-8",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:h("twin.proposalsTitle")}),(0,s.jsx)("p",{className:"mt-1 max-w-2xl text-sm leading-relaxed text-smoke",children:h("twin.proposalsNote")}),(0,s.jsx)("ul",{className:"mt-4 flex flex-col gap-3",role:"list",children:r.map(e=>{var t;return(0,s.jsxs)("li",{className:"rounded-lg border px-4 py-4 ".concat(y.has(e.id)?"border-l-2 border-l-chalk border-edge":"border-edge"),children:[(0,s.jsxs)("p",{className:"eyebrow",children:[m(e.topic,h),e.supersedes&&e.supersedes.length>1?" \xb7 ".concat(h("twin.proposalJoins",{n:e.supersedes.length})):""]}),null==(t=e.supersedes)?void 0:t.map(e=>(0,s.jsx)("p",{className:"mt-1 max-w-2xl text-sm leading-relaxed text-smoke line-through decoration-faint",children:e},e)),(0,s.jsx)("p",{className:"mt-2 max-w-2xl text-base leading-relaxed",children:e.statement}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,s.jsx)(p,{label:h("twin.proposalAccept"),toggle:!0,active:!0===y.get(e.id),onClick:()=>g(u(y,e.id,!0))}),(0,s.jsx)(p,{label:h("twin.proposalReject"),toggle:!0,active:!1===y.get(e.id),onClick:()=>g(u(y,e.id,!1))})]})]},e.id)})})]}),C.map(e=>{let[t,n]=e;return(0,s.jsxs)("section",{className:"mt-8",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:m(t,h)}),(0,s.jsx)("ul",{className:"mt-4 flex flex-col gap-3",role:"list",children:n.map(e=>(0,s.jsx)(x,{belief:e,locale:c,gesture:f.get(e.id),stranded:"forming"!==e.badge&&d.has(e.id),editing:j===e.id,onEdit:t=>v(t?e.id:null),onGesture:t=>(function(e,t){let n=f.get(e),s=(null==n?void 0:n.kind)==="sign"&&void 0!==n.statement;n&&n.kind===t.kind&&!s?T(e,void 0):T(e,t)})(e.id,t),onWrite:t=>T(e.id,{kind:"sign",statement:t}),translate:h},e.id))})]},t)}),n.length>0&&(0,s.jsxs)("section",{className:"mt-8",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:h("twin.graveyardTitle")}),(0,s.jsx)("p",{className:"mt-1 max-w-2xl text-sm leading-relaxed text-smoke",children:h("twin.graveyardNote")}),(0,s.jsx)("ul",{className:"mt-4 flex flex-col gap-2",role:"list",children:n.map(e=>(0,s.jsx)("li",{className:"rounded-lg border border-edge px-4 py-3 opacity-60",children:(0,s.jsx)("p",{className:"text-sm leading-relaxed text-smoke line-through decoration-faint",children:e.statement})},e.id))})]}),L&&(0,s.jsxs)("div",{className:"sticky bottom-4 z-10 mt-8 flex flex-wrap items-center gap-3 rounded-lg border border-edge bg-surface/95 px-4 py-3 shadow-lg backdrop-blur",children:[(0,s.jsx)("span",{className:"font-mono text-xs text-smoke",children:h("twin.markedGestures",{n:f.size+y.size})}),(0,s.jsx)(o.rA,{tone:"accent",type:"button",onClick:O,busy:N,busyLabel:h("twin.saving"),children:h("twin.save")}),(0,s.jsx)(o.rA,{tone:"quiet",type:"button",onClick:()=>{b(new Map),g(new Map),v(null)},disabled:N,children:h("twin.cancel")}),M&&(0,s.jsx)("span",{className:"font-mono text-xs text-fail",children:h("twin.saveFailed",{detail:M})})]})]})}function m(e,t){let n=(0,r.Jj)(e);return n?t(n):e}function u(e,t,n){let s=new Map(e);return s.get(t)===n?s.delete(t):s.set(t,n),s}function x(e){let{belief:t,locale:n,gesture:l,stranded:a,editing:c,onEdit:m,onGesture:u,onWrite:x,translate:h}=e,[w,f]=(0,i.useState)(!1),[b,y]=(0,i.useState)(t.statement),g=(null==l?void 0:l.kind)==="sign"?l.statement:void 0;return(0,s.jsxs)("li",{id:"belief-".concat(t.id),tabIndex:-1,className:["scroll-mt-24 rounded-lg border px-4 py-4 transition-colors",(null==l?void 0:l.kind)==="sign"?"border-l-2 border-l-live border-edge bg-live/[0.05]":(null==l?void 0:l.kind)==="veto"?"border-l-2 border-l-faint border-edge opacity-60":void 0!==l?"border-l-2 border-l-chalk border-edge":"border-edge"].join(" "),children:[(0,s.jsxs)("p",{className:"eyebrow",children:[(0,s.jsx)("span",{className:"forming"===t.badge?"text-idle":"",children:h(d[t.badge])}),t.scope?" \xb7 ".concat(h("twin.scopedTag",{project:t.scope})):"",a?(0,s.jsx)("span",{className:"text-idle",children:" \xb7 ".concat(h("twin.notInFile"))}):null]}),a?(0,s.jsx)("p",{className:"mt-1 max-w-2xl text-xs leading-relaxed text-smoke",children:h("twin.notInFileWhy")}):null,c?(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)(o.fs,{label:h("twin.editText"),hideLabel:!0,rows:3,className:"max-w-2xl",value:b,onChange:e=>y(e.target.value)}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[(0,s.jsx)(p,{label:h("twin.editSave"),active:!0,onClick:()=>{""!==b.trim()&&(x(b.trim()),m(!1))}}),(0,s.jsx)(p,{label:h("twin.cancel"),onClick:()=>{y(t.statement),m(!1)}})]})]}):(0,s.jsx)("p",{className:"mt-1 max-w-2xl text-base leading-relaxed",children:null!=g?g:t.statement}),(0,s.jsxs)("p",{className:"mt-2 font-mono text-xs text-smoke",children:[t.authored?h("twinTeach.ownerEvidence"):h("twin.support",{observations:t.support.observations,projects:t.support.projects,days:t.support.days}),"forming"===t.badge?(0,s.jsx)("span",{className:"text-idle",children:" \xb7 ".concat(h("twin.formingWhy"))}):null,t.citations.length>0&&(0,s.jsxs)(s.Fragment,{children:[" \xb7 ",(0,s.jsx)("button",{type:"button",onClick:()=>f(e=>!e),className:"underline-offset-2 hover:underline",children:h(w?"twin.hideCitations":"twin.showCitations",{n:t.citations.length})})]})]}),w&&(0,s.jsx)("ul",{className:"mt-3 flex flex-col gap-2.5 border-l border-edge pl-3",role:"list",children:t.citations.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsxs)("p",{className:"line-clamp-2 text-sm italic leading-snug text-smoke",title:e.quote,children:["\xab",e.quote,"\xbb"]}),(0,s.jsxs)("p",{className:"mt-0.5 font-mono text-xs text-faint",children:[(0,r.mL)(e.at,n),e.project?" \xb7 ".concat(h("twin.citedIn",{project:e.project})):""]})]},e.verdictId))}),!c&&(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:["signed"!==t.badge&&(0,s.jsx)(p,{label:h("twin.sign"),toggle:!0,active:(null==l?void 0:l.kind)==="sign"&&void 0===g,onClick:()=>u({kind:"sign"})}),(0,s.jsx)(p,{label:h("twin.edit"),toggle:!0,active:void 0!==g,onClick:()=>{y(null!=g?g:t.statement),m(!0)}}),(0,s.jsx)(p,{label:h("twin.veto"),toggle:!0,active:(null==l?void 0:l.kind)==="veto",onClick:()=>u({kind:"veto"})}),t.scope?(0,s.jsx)(p,{label:h("twin.scopeAll"),toggle:!0,active:(null==l?void 0:l.kind)==="scope"&&null===l.identity,onClick:()=>u({kind:"scope",identity:null})}):t.learnedIn?(0,s.jsx)(p,{label:h("twin.scopeOnly",{project:t.learnedIn.name}),toggle:!0,active:(null==l?void 0:l.kind)==="scope",onClick:()=>{var e,n;return u({kind:"scope",identity:null!=(n=null==(e=t.learnedIn)?void 0:e.identity)?n:null})}}):null]})]})}function p(e){let{label:t,active:n,toggle:i=!1,onClick:l}=e;return(0,s.jsx)(o.rA,{tone:n?"accent":"plain",type:"button",...i?{"aria-pressed":null!=n&&n}:{},onClick:l,children:t})}},26488:(e,t,n)=>{"use strict";n.d(t,{P:()=>s,s:()=>i});let s=300,i=300},56684:(e,t,n)=>{"use strict";n.d(t,{k5:()=>c});var s=n(32165),i={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},l=s.createContext&&s.createContext(i),a=["attr","size","title"];function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e}).apply(null,arguments)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){var s,i,l;s=e,i=t,l=n[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!=typeof s)return s;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in s?Object.defineProperty(s,i,{value:l,enumerable:!0,configurable:!0,writable:!0}):s[i]=l}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e){return t=>s.createElement(m,r({attr:d({},e.attr)},t),function e(t){return t&&t.map((t,n)=>s.createElement(t.tag,d({key:n},t.attr),e(t.child)))}(e.child))}function m(e){var t=t=>{var n,i=e.attr,l=e.size,o=e.title,c=function(e,t){if(null==e)return{};var n,s,i=function(e,t){if(null==e)return{};var n={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;n[s]=e[s]}return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(s=0;s<l.length;s++)n=l[s],-1===t.indexOf(n)&&({}).propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,a),m=l||t.size||"1em";return t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className),s.createElement("svg",r({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,c,{className:n,style:d(d({color:e.color||t.color},t.style),e.style),height:m,width:m,xmlns:"http://www.w3.org/2000/svg"}),o&&s.createElement("title",null,o),e.children)};return void 0!==l?s.createElement(l.Consumer,null,e=>t(e)):t(i)}},59916:(e,t,n)=>{"use strict";n.d(t,{Jj:()=>i,Wv:()=>s,mL:()=>l});let s={design:"twin.topicDesign",frontend:"twin.topicFrontend",backend:"twin.topicBackend",cli:"twin.topicCli",testing:"twin.topicTesting",copy:"twin.topicCopy",workflow:"twin.topicWorkflow",tooling:"twin.topicTooling",data:"twin.topicData",other:"twin.topicOther"};function i(e){return s[e]}function l(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return e.slice(0,10);let s=String(n.getMonth()+1).padStart(2,"0"),i=String(n.getDate()).padStart(2,"0");return"en"===t?"".concat(n.getFullYear(),"-").concat(s,"-").concat(i):"".concat(i,"/").concat(s,"/").concat(n.getFullYear())}},66229:(e,t,n)=>{"use strict";n.d(t,{TwinConsent:()=>o});var s=n(38657),i=n(32165),l=n(10354),a=n(9144),r=n(52948);function o(e){let{standing:t,chars:n,cap:o}=e,d=(0,a.kj)(),c=(0,l.useRouter)(),[m,u]=(0,i.useState)(!1),[x,p]=(0,i.useState)(null);async function h(e){u(!0),p(null);try{var t;let n=await fetch("/api/twin/taste",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publishInferred:e})}),s=await n.json();n.ok||p(null!=(t=s.error)?t:String(n.status)),c.refresh()}catch(e){p(d("project.unreachable"))}finally{u(!1)}}return(0,s.jsxs)(r.Zp,{as:"section",tone:"plain",className:"mt-8","aria-labelledby":"twin-consent-title",children:[(0,s.jsx)("h2",{id:"twin-consent-title",className:"text-base font-semibold",children:d("twin.consentTitle")}),(0,s.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed",children:d("twin.consentBody")}),(0,s.jsxs)("p",{className:"mt-2 max-w-2xl font-mono text-xs ".concat(n>o?"text-idle":"text-smoke"),children:[d("twin.consentCount",{n:t,chars:n}),n>o?" \xb7 ".concat(d("twin.consentOver",{cap:o})):""]}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,s.jsx)(r.rA,{tone:"accent",type:"button",onClick:()=>h(!0),busy:m,busyLabel:d("twin.saving"),children:d("twin.consentAllow")}),(0,s.jsx)("span",{className:"font-mono text-xs text-faint",children:d("twin.consentRevoke")})]}),x&&(0,s.jsx)(r.lZ,{text:d("twin.saveFailed",{detail:x}),className:"mt-2"})]})}},73856:(e,t,n)=>{"use strict";n.d(t,{TwinTeach:()=>m});var s=n(38657),i=n(32165),l=n(10354),a=n(3043),r=n(9144),o=n(52948),d=n(59916),c=n(26488);function m(e){let{projects:t,omitted:n}=e,m=(0,r.kj)(),u=(0,l.useRouter)(),[x,p]=(0,i.useState)(""),[h,w]=(0,i.useState)("workflow"),[f,b]=(0,i.useState)(""),[y,g]=(0,i.useState)(!1),[j,v]=(0,i.useState)(null),[N,k]=(0,i.useState)(null),M=(0,i.useRef)(!1);async function S(e){if(e.preventDefault(),!M.current&&x.trim()){M.current=!0,g(!0),v(null),k(null);try{let e=await fetch("/api/twin/taste",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({teach:{statement:x,topic:h,...f?{slug:f}:{}}})}),n=await e.json();if(!e.ok||!n.beliefId){var t;v(null!=(t=n.error)?t:m("twinTeach.failed"));return}p(""),k(n.beliefId),u.refresh()}catch(e){v(m("project.unreachable"))}finally{M.current=!1,g(!1)}}}return(0,s.jsx)("section",{id:"teach",tabIndex:-1,"aria-labelledby":"twin-teach-title",className:"page-shell__section scroll-mt-24 rounded-lg border border-edge bg-surface p-5 sm:p-6",children:(0,s.jsxs)("div",{className:"grid gap-6 lg:grid-cols-[1fr_1.4fr]",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"flex items-center gap-2 font-mono text-xs text-smoke",children:[(0,s.jsx)(a.YUE,{"aria-hidden":!0,className:"h-4 w-4"}),m("twinTeach.eyebrow")]}),(0,s.jsx)("h2",{id:"twin-teach-title",className:"mt-2 text-base font-semibold",children:m("twinTeach.title")}),(0,s.jsx)("p",{className:"mt-3 max-w-md text-sm leading-relaxed text-smoke",children:m("twinTeach.lead")}),(0,s.jsx)("p",{className:"mt-3 max-w-md text-xs leading-relaxed text-smoke",children:m("twinTeach.control")})]}),(0,s.jsxs)("form",{onSubmit:S,"aria-busy":y,children:[(0,s.jsx)(o.fs,{label:m("twinTeach.statement"),value:x,onChange:e=>{p(e.target.value),k(null)},required:!0,maxLength:c.P,rows:3,disabled:y,placeholder:m("twinTeach.placeholder"),"aria-describedby":"twin-teach-count"}),(0,s.jsx)("p",{id:"twin-teach-count",className:"mt-1 text-right font-mono text-xs text-smoke",children:m("twinTeach.characters",{n:x.length,max:c.P})}),(0,s.jsxs)("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[(0,s.jsx)(o.l6,{label:m("twinTeach.topic"),value:h,disabled:y,onChange:e=>w(e.target.value),children:Object.entries(d.Wv).map(e=>{let[t,n]=e;return(0,s.jsx)("option",{value:t,children:m(n)},t)})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(o.l6,{label:m("twinTeach.scope"),value:f,disabled:y,"aria-describedby":n>0?"twin-teach-scope-note":void 0,onChange:e=>b(e.target.value),children:[(0,s.jsx)("option",{value:"",children:m("twinTeach.global")}),t.map(e=>(0,s.jsx)("option",{value:e.slug,children:e.label},e.slug))]}),n>0&&(0,s.jsx)("p",{id:"twin-teach-scope-note",className:"mt-2 text-xs leading-relaxed text-smoke",children:m("twinTeach.scopeOmitted",{n:n})})]})]}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-3",children:[(0,s.jsx)(o.rA,{type:"submit",tone:"accent",busy:y,busyLabel:m("twinTeach.saving"),disabled:y||!x.trim(),children:m("twinTeach.save")}),(0,s.jsx)("span",{className:"text-xs text-smoke",children:m("twinTeach.cost")})]}),j&&(0,s.jsx)(o.lZ,{text:j,className:"mt-3"}),(0,s.jsx)("div",{role:"status","aria-live":"polite",children:N&&(0,s.jsxs)("p",{className:"mt-3 text-sm text-smoke",children:[m("twinTeach.saved")," "," ",(0,s.jsx)("a",{href:"#belief-".concat(N),className:"underline underline-offset-4",children:m("twinTeach.view")})]})})]})]})})}},87885:(e,t,n)=>{Promise.resolve().then(n.bind(n,18557)),Promise.resolve().then(n.bind(n,66229)),Promise.resolve().then(n.bind(n,92458)),Promise.resolve().then(n.bind(n,3030)),Promise.resolve().then(n.bind(n,4733)),Promise.resolve().then(n.bind(n,88145)),Promise.resolve().then(n.bind(n,15797)),Promise.resolve().then(n.bind(n,73856)),Promise.resolve().then(n.t.bind(n,3953,23))},88145:(e,t,n)=>{"use strict";n.d(t,{TwinSources:()=>o});var s=n(38657),i=n(32165),l=n(10354),a=n(9144),r=n(52948);function o(e){let{sources:t}=e,n=(0,a.kj)(),o=(0,l.useRouter)(),[d,c]=(0,i.useState)(null),[m,u]=(0,i.useState)(null),[x,p]=(0,i.useState)(t);async function h(e,t){c(e),u(null);try{let n=await fetch("/api/twin/sources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:e,allowed:t})}),i=await n.json();if(!n.ok){var s;u(null!=(s=i.error)?s:String(n.status));return}i.sources&&p(i.sources),o.refresh()}catch(e){u(n("project.unreachable"))}finally{c(null)}}let w=x.filter(e=>"absent"!==e.state);return 0===w.length?(0,s.jsxs)(r.Zp,{as:"section",tone:"plain","aria-labelledby":"twin-sources-title",children:[(0,s.jsx)("h2",{id:"twin-sources-title",className:"text-base font-semibold",children:n("twin.sourcesTitle")}),(0,s.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed",children:n("twin.sourcesNone")})]}):(0,s.jsxs)(r.Zp,{as:"section",tone:"plain","aria-labelledby":"twin-sources-title",children:[(0,s.jsx)("h2",{id:"twin-sources-title",className:"text-base font-semibold",children:n("twin.sourcesTitle")}),(0,s.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed",children:n("twin.sourcesLead")}),(0,s.jsx)("div",{className:"mt-3 flex flex-col gap-2",children:w.map(e=>(0,s.jsxs)("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 gap-y-1",children:[(0,s.jsxs)("span",{className:"min-w-0",children:[(0,s.jsx)("span",{className:"font-mono text-xs",children:e.label})," ",(0,s.jsx)("span",{className:"font-mono text-xs text-smoke",children:e.present?n("twin.sourceSize",{files:e.files,size:(0,r.z3)(e.bytes)}):n("twin.sourceGone")})]}),"noReader"===e.state?(0,s.jsx)("span",{className:"justify-self-end font-mono text-xs text-idle",children:n("twin.sourceNoReader")}):(0,s.jsx)(r.rA,{tone:"allowed"===e.state?"plain":"accent",type:"button",onClick:()=>h(e.id,"allowed"!==e.state),busy:d===e.id,busyLabel:n("twin.saving"),disabled:null!==d,className:"justify-self-end",children:n("allowed"===e.state?"twin.sourceRevoke":"twin.sourceAllow")})]},e.id))}),(0,s.jsx)("p",{className:"mt-3 max-w-2xl font-mono text-xs text-faint",children:n("twin.sourcesRevokeNote")}),m&&(0,s.jsx)(r.lZ,{text:m,className:"mt-2"})]})}},92458:(e,t,n)=>{"use strict";n.d(t,{TwinDistill:()=>o});var s=n(38657),i=n(32165),l=n(10354),a=n(9144),r=n(52948);function o(e){let{left:t,granted:n}=e,o=(0,a.kj)(),m=(0,l.useRouter)(),[u,x]=(0,i.useState)(!1),[p,h]=(0,i.useState)(null),[w,f]=(0,i.useState)(null);async function b(){x(!0),h(null),f(null);try{var e,t,n,s,i,l,a,r;h(o("twin.mining"));let u=await d();if(u.unreachable)h(o("project.unreachable"));else if(void 0!==u.error){if(h(u.error),u.blocked)return}else{let a=null!=(t=u.saved)?t:0,r=null!=(n=null==(e=u.denied)?void 0:e.length)?n:0,d=[0===a?o("twin.minedNone"):o("twin.mined",{saved:a,duplicates:null!=(s=u.duplicates)?s:0})];(null!=(i=u.narrativesSaved)?i:0)>0&&d.push(o("twin.minedRecords",{n:null!=(l=u.narrativesSaved)?l:0})),r>0&&d.push(o("twin.minedDenied",{n:r})),h(d.join(" \xb7 "))}let x=await c({dryRun:!0});if(x.error)return void h(x.hint?"".concat(x.error," ").concat(x.hint):x.error);if(!x.verdicts)return void h(o("twin.distillNothing"));f({verdicts:x.verdicts,tokens:null!=(a=x.estimatedTokens)?a:0}),h(o("twin.distillEstimate",{verdicts:x.verdicts,tokens:null!=(r=x.estimatedTokens)?r:0})),m.refresh()}catch(e){h(o("project.unreachable"))}finally{x(!1)}}async function y(){x(!0),f(null);try{let i=0,l=0,a=0;for(let r=1;r<=20;r+=1){var e,t,n,s;let r=await c({});if(i+=null!=(e=r.verdicts)?e:0,l+=null!=(t=r.saved)?t:0,a+=null!=(n=r.truncated)?n:0,r.error){h(r.hint?"".concat(r.error," ").concat(r.hint):r.error);break}let d=r.corpus?Math.max(r.corpus.total-r.corpus.read,0):0,m=null!=(s=r.thin)?s:0,u=[o("twin.distillProgress",{read:i,saved:l,left:d})];if(m>0&&u.push(o("twin.distillThin",{n:m})),a>0&&u.push(o("twin.distillTruncated",{n:a})),h(u.join(" \xb7 ")),!r.verdicts||d<=0)break}m.refresh()}catch(e){h(o("project.unreachable"))}finally{x(!1)}}return(0,s.jsxs)("div",{className:"mt-2 flex flex-col gap-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(r.rA,{tone:"plain",type:"button",onClick:b,busy:u&&null===w,busyLabel:o("twin.distilling"),disabled:!n||u,"aria-describedby":n?void 0:"twin-distill-why",className:"self-start",children:t>0?o("twin.mineButtonLeft",{n:t}):o("twin.mineButton")}),null!==w&&(0,s.jsx)(r.rA,{tone:"accent",type:"button",onClick:y,busy:u,busyLabel:o("twin.distillingPaid"),disabled:u,children:o("twin.distillGo",{n:w.verdicts})})]}),n&&(0,s.jsx)("p",{className:"text-xs leading-relaxed text-smoke",children:o("twin.distillCost")}),!n&&(0,s.jsx)("p",{id:"twin-distill-why",className:"text-xs leading-relaxed text-smoke",children:o("twin.distillNoConsent")}),(0,s.jsx)("div",{role:"status","aria-live":"polite",children:p&&(0,s.jsx)("p",{className:"font-mono text-xs text-smoke",children:p})})]})}async function d(){try{var e;let t=await fetch("/api/twin/mine",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),n=await t.json();if(t.ok)return n;return{error:null!=(e=n.error)?e:String(t.status),...409===t.status?{blocked:!0}:{}}}catch(e){return{unreachable:!0}}}async function c(e){var t;let n=await fetch("/api/twin/distill",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await n.json();return n.ok?s:{...s,error:null!=(t=s.error)?t:String(n.status)}}}},e=>{e.O(0,[6587,3953,2575,2948,1305,6823,7358],()=>e(e.s=87885)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1162],{3030:(e,t,n)=>{"use strict";n.d(t,{TwinLab:()=>c});var s=n(38657),i=n(32165),l=n(3043),a=n(9144),r=n(26488),o=n(52948),d=n(59916);function c(e){let{projects:t,hasBeliefs:n}=e,c=(0,a.kj)(),[u,x]=(0,i.useState)(""),[p,h]=(0,i.useState)(""),[w,f]=(0,i.useState)(null),[b,y]=(0,i.useState)(null),[g,j]=(0,i.useState)(null),[v,N]=(0,i.useState)(null),k=(0,i.useRef)(!1),M=t.find(e=>e.slug===p);function S(){y(null),j(null)}async function C(e){if(k.current)return;let t=u.trim();if(!t||t.length>r.s)return void j(c("twinLab.invalidRequest",{max:r.s}));if(e||(null==b?void 0:b.status)==="preview"&&b.evidence.length){k.current=!0,f(e?"preview":"draft"),j(null),e&&y(null);try{let s=await fetch("/api/twin/rehearse",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:t,...p?{slug:p}:{},dryRun:e})}),i=await s.json();if("number"==typeof i.remainingCalls&&N(i.remainingCalls),!s.ok){var n;j(429===s.status?c("twinLab.budgetReached"):[null!=(n=i.error)?n:c("twinLab.failed"),i.hint].filter(Boolean).join(" "));return}if(!Array.isArray(i.evidence)||!["preview","drafted","abstained"].includes(i.status))return void j(c("twinLab.failed"));y(i)}catch(e){j(c("project.unreachable"))}finally{k.current=!1,f(null)}}}let L=(null==b?void 0:b.reason)==="no-beliefs"?"twinLab.noBeliefs":(null==b?void 0:b.reason)==="no-match"?"twinLab.noMatch":"twinLab.unsupported";return(0,s.jsxs)("section",{id:"decision-lab",tabIndex:-1,"aria-labelledby":"twin-lab-title",className:"page-shell__section scroll-mt-24 rounded-lg border border-edge bg-surface",children:[(0,s.jsxs)("div",{className:"border-b border-edge px-5 py-5 sm:px-6",children:[(0,s.jsxs)("p",{className:"flex items-center gap-2 font-mono text-xs text-smoke",children:[(0,s.jsx)(l.qRK,{"aria-hidden":!0,className:"h-4 w-4"}),c("twinLab.eyebrow")]}),(0,s.jsx)("h2",{id:"twin-lab-title",className:"mt-2 text-base font-semibold",children:c("twinLab.title")}),(0,s.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed text-smoke",children:c("twinLab.lead")})]}),(0,s.jsxs)("div",{className:"grid lg:grid-cols-2",children:[(0,s.jsxs)("form",{onSubmit:function(e){e.preventDefault(),C(!0)},className:"min-w-0 px-5 py-5 sm:px-6","aria-busy":null!==w,children:[(0,s.jsx)(o.fs,{label:c("twinLab.question"),value:u,onChange:e=>{x(e.target.value),S()},maxLength:r.s,rows:4,required:!0,disabled:null!==w||!n,"aria-describedby":"twin-lab-question-hint twin-lab-count".concat(n?"":" twin-lab-untrained"),placeholder:c("twinLab.placeholder")}),!n&&(0,s.jsx)("p",{id:"twin-lab-untrained",className:"mt-2 text-xs leading-relaxed text-smoke",children:c("twinLab.firstTitle")}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap justify-between gap-2 text-xs text-smoke",children:[(0,s.jsx)("p",{id:"twin-lab-question-hint",children:c("twinLab.questionHint")}),(0,s.jsx)("p",{id:"twin-lab-count",className:"font-mono",children:c("twinLab.characters",{n:u.length,max:r.s})})]}),(0,s.jsxs)(o.l6,{label:c("twinLab.project"),className:"mt-5",value:p,onChange:e=>{h(e.target.value),S()},disabled:null!==w||!n,"aria-describedby":"twin-lab-scope-hint",children:[(0,s.jsx)("option",{value:"",children:c("twinLab.global")}),t.map(e=>(0,s.jsx)("option",{value:e.slug,children:e.label},e.slug))]}),(0,s.jsx)("p",{id:"twin-lab-scope-hint",className:"mt-2 text-xs leading-relaxed text-smoke",children:c("twinLab.scopeHint")}),(0,s.jsxs)("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[(0,s.jsx)(o.rA,{type:"submit",tone:"surface",busy:"preview"===w,busyLabel:c("twinLab.previewing"),disabled:null!==w||!u.trim()||!n,children:c("twinLab.preview")}),(0,s.jsx)("span",{className:"text-xs text-smoke",children:c("twinLab.previewCost")})]}),g&&(0,s.jsx)(o.lZ,{text:g,className:"mt-4"})]}),(0,s.jsxs)("div",{className:"min-w-0 border-t border-edge bg-ground px-5 py-5 sm:px-6 lg:border-t-0 lg:border-l",children:[(0,s.jsx)("p",{role:"status","aria-live":"polite",className:"font-mono text-xs text-smoke",children:"preview"===w?c("twinLab.previewing"):"draft"===w?c("twinLab.drafting"):(null==b?void 0:b.status)==="drafted"?c("twinLab.draftReady"):(null==b?void 0:b.status)==="abstained"?c("twinLab.abstained"):(null==b?void 0:b.status)==="preview"?c("twinLab.evidenceCount",{n:b.evidence.length}):c("twinLab.waiting")}),!b&&(0,s.jsx)(o.pp,{variant:"bare",className:"mt-4 max-w-md",title:c(n?"twinLab.emptyTitle":"twinLab.firstTitle"),action:!n&&(0,s.jsx)(m,{}),children:c(n?"twinLab.emptyBody":"twinLab.noBeliefs")}),(null==b?void 0:b.status)==="abstained"&&(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsx)("h3",{className:"text-base font-semibold",children:c("twinLab.abstainedTitle")}),(0,s.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-smoke",children:c(L)}),(0,s.jsx)(m,{className:"mt-3"})]}),(null==b?void 0:b.status)==="drafted"&&(0,s.jsxs)(o.Zp,{className:"mt-3",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:c("twinLab.draftTitle")}),(0,s.jsx)("p",{className:"mt-2 whitespace-pre-wrap break-words text-base leading-relaxed",children:b.answer}),(0,s.jsx)("p",{className:"mt-3 text-xs leading-relaxed text-smoke",children:c("twinLab.draftHint")}),(0,s.jsx)("p",{className:"mt-3 text-xs leading-relaxed text-smoke",children:c("twinLab.disagree")}),(0,s.jsx)(m,{className:"mt-3"})]}),b&&b.evidence.length>0&&(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:c("drafted"===b.status?"twinLab.citations":"twinLab.evidence")}),(0,s.jsx)("ol",{className:"mt-3 flex flex-col gap-2",role:"list",children:b.evidence.map((e,t)=>{var n;let i=(0,d.Jj)(e.topic);return(0,s.jsxs)(o.Zp,{as:"li",pad:"sm",children:[(0,s.jsxs)("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 font-mono text-[11px] text-smoke",children:[(0,s.jsx)("span",{"aria-hidden":!0,children:String(t+1).padStart(2,"0")}),(0,s.jsx)("span",{children:c("episode"===e.kind?"twinLab.episode":"signed"===e.state?"twin.badgeSigned":"twin.badgeStanding")}),"episode"!==e.kind&&(0,s.jsxs)("span",{children:["\xb7 ",i?c(i):e.topic]})]}),(0,s.jsxs)("a",{href:"episode"===e.kind?"/twin?episode=".concat(encodeURIComponent(e.id),"#episode-").concat(e.id):"#belief-".concat(e.id),className:"mt-1.5 flex items-start gap-2 text-sm leading-relaxed underline-offset-4 hover:underline",children:[(0,s.jsx)("span",{className:"min-w-0 flex-1 whitespace-pre-line break-words",children:e.statement}),(0,s.jsx)(l.OvC,{"aria-hidden":!0,className:"mt-0.5 h-4 w-4 shrink-0 text-smoke"}),(0,s.jsx)("span",{className:"sr-only",children:c("episode"===e.kind?"twinLab.openEpisode":"twinLab.openEvidence")})]}),(0,s.jsx)("p",{className:"mt-2 text-xs text-smoke",children:"episode"===e.kind?c("twinLab.episodeScope"):e.scope?c("twinLab.projectRule",{project:null!=(n=null==M?void 0:M.label)?n:e.scope}):c("twinLab.globalRule")})]},e.id)})})]}),b&&b.omittedBeliefs>0&&(0,s.jsx)("p",{className:"mt-3 font-mono text-xs text-smoke",children:c("twinLab.omitted",{n:b.omittedBeliefs})}),null!==v&&(0,s.jsx)("p",{className:"mt-3 font-mono text-xs text-smoke",children:c("twinLab.remaining",{n:v})}),(null==b?void 0:b.status)==="preview"&&b.evidence.length>0&&(0,s.jsxs)("div",{className:"mt-5 border-t border-edge pt-4",children:[(0,s.jsx)(o.rA,{type:"button",tone:"accent",busy:"draft"===w,busyLabel:c("twinLab.drafting"),disabled:null!==w||0===v,onClick:()=>void C(!1),children:c("twinLab.rehearse")}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-smoke",children:c(0===v?"twinLab.budgetReached":"twinLab.draftCost")})]})]})]}),(0,s.jsx)("p",{className:"border-t border-edge px-5 py-3 text-xs leading-relaxed text-smoke sm:px-6",children:c("twinLab.boundary")})]})}function m(e){let{className:t}=e,n=(0,a.kj)();return(0,s.jsxs)("a",{href:"#teach",className:"inline-flex items-center gap-1 text-sm underline underline-offset-4".concat(t?" ".concat(t):""),children:[n("twinLab.teach"),(0,s.jsx)(l.OvC,{"aria-hidden":!0,className:"h-4 w-4"})]})}},4733:(e,t,n)=>{"use strict";n.d(t,{TwinMemory:()=>w});var s=n(38657),i=n(32165),l=n(10354),a=n(3043),r=n(9144),o=n(52948);let d=["goal","context","constraints","alternatives","decision","rationale","outcome","conditions","exceptions"],c={goal:{label:"twinMemory.fieldGoal",hint:"twinMemory.hintGoal"},context:{label:"twinMemory.fieldContext",hint:"twinMemory.hintContext"},constraints:{label:"twinMemory.fieldConstraints",hint:"twinMemory.hintConstraints"},alternatives:{label:"twinMemory.fieldAlternatives",hint:"twinMemory.hintAlternatives"},decision:{label:"twinMemory.fieldDecision",hint:"twinMemory.hintDecision"},rationale:{label:"twinMemory.fieldRationale",hint:"twinMemory.hintRationale"},outcome:{label:"twinMemory.fieldOutcome",hint:"twinMemory.hintOutcome"},conditions:{label:"twinMemory.fieldConditions",hint:"twinMemory.hintConditions"},exceptions:{label:"twinMemory.fieldExceptions",hint:"twinMemory.hintExceptions"}};function m(e){var t,n,s;return(null==(t=e.fields.decision)?void 0:t.text.trim())||(null==(n=e.fields.goal)?void 0:n.text.trim())||(null==(s=e.fields.context)?void 0:s.text.trim())||null}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();return null!==e.validUntil&&Date.parse(e.validUntil)<=t}let x={opening:"twinMemory.kindOpening",reaction:"twinMemory.kindReaction",brief:"twinMemory.kindBrief"};async function p(e,t,n){let s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),i=await s.json();if(!s.ok){var l;throw Error([null!=(l=i.error)?l:n,i.hint].filter(Boolean).join(" "))}return i}function h(e,t){return e instanceof Error?e.message:t("project.unreachable")}function w(e){var t;let{projects:n,episodes:l,coverage:d,dailyCalls:c,focusId:m,olderCursor:u,conflicts:x}=e,p=(0,r.kj)(),w=(null==(t=l.find(e=>e.id===m))?void 0:t.status)==="dismissed",[j,v]=(0,i.useState)(w),[N,k]=(0,i.useState)(null),[M,S]=(0,i.useState)(null),[C,L]=(0,i.useState)(null),[T,O]=(0,i.useState)(null),P=(0,i.useRef)(!1),[R,A]=(0,i.useState)(l),[E,I]=(0,i.useState)(l),[U,D]=(0,i.useState)(u),[q,B]=(0,i.useState)(""),[F,z]=(0,i.useState)(""),[Z,_]=(0,i.useState)(null),[J,H]=(0,i.useState)(null),G=(0,i.useRef)(!1);R!==l&&(A(l),I(l),D(u));let W=E.filter(e=>j||"active"===e.status),V=E.filter(e=>"dismissed"===e.status).length;function Y(e){var t,s;return{...e,projectName:e.identity&&null!=(s=null==(t=n.find(t=>t.identity===e.identity))?void 0:t.label)?s:null}}async function K(e,t){var n,s;let i=new URLSearchParams;e&&i.set("q",e),t&&i.set("before",t);let l=i.toString(),a=await fetch("/api/twin/episodes".concat(l?"?".concat(l):"")),r=await a.json();if(!a.ok||!Array.isArray(r.episodes))throw Error(null!=(n=r.error)?n:p("twinMemory.requestFailed"));return{episodes:r.episodes.map(Y),nextCursor:null!=(s=r.nextCursor)?s:null}}async function Q(e){if(G.current)return;let t=e.trim();if(!t){z(""),I(l),D(u),H(null);return}G.current=!0,_("search"),H(null);try{let e=await K(t,null);z(t),I(e.episodes),D(e.nextCursor)}catch(e){H(h(e,p))}finally{G.current=!1,_(null)}}async function X(){if(!G.current&&U){G.current=!0,_("older"),H(null);try{let e=await K(F,U);I(t=>{let n=new Set(t.map(e=>e.id));return[...t,...e.episodes.filter(e=>!n.has(e.id))]}),D(e.nextCursor)}catch(e){H(h(e,p))}finally{G.current=!1,_(null)}}}return(0,i.useEffect)(()=>{var e;m&&(w&&v(!0),O(m),null==(e=document.getElementById("episode-".concat(m)))||e.focus())},[m,w]),(0,i.useEffect)(()=>{var e;T&&(null==(e=document.getElementById("episode-".concat(T)))||e.focus())},[T,j]),(0,i.useEffect)(()=>{F&&Q(F)},[l]),(0,s.jsxs)("section",{id:"decision-memory",tabIndex:-1,"aria-labelledby":"twin-memory-title",className:"page-shell__section scroll-mt-24 overflow-hidden rounded-lg border border-edge bg-surface",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4 border-b border-edge px-5 py-5 sm:px-6",children:[(0,s.jsxs)("div",{className:"max-w-2xl",children:[(0,s.jsxs)("p",{className:"flex items-center gap-2 font-mono text-xs text-smoke",children:[(0,s.jsx)(a.lPA,{"aria-hidden":!0,className:"h-4 w-4"}),p("twinMemory.eyebrow")]}),(0,s.jsx)("h2",{id:"twin-memory-title",className:"mt-2 text-base font-semibold",children:p("twinMemory.title")}),(0,s.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-smoke",children:p("twinMemory.lead")})]}),(0,s.jsxs)("div",{className:"rounded-lg border border-edge bg-ground px-3 py-2 font-mono text-xs text-smoke",children:[(0,s.jsx)("p",{children:p("twinMemory.captured",{n:d.total})}),(0,s.jsx)("p",{className:"mt-1",children:p("twinMemory.awaiting",{n:d.pending})})]})]}),(0,s.jsxs)("div",{className:"grid lg:grid-cols-[1.3fr_1fr]",children:[(0,s.jsx)(b,{projects:n,revision:N,blocked:M,dirty:P,savedMessage:C,onCancel:()=>{k(null),S(null),L(null)},onClear:()=>{k(M),S(null)},onSaved:()=>{L(p(N?"twinMemory.savedRevision":"twinMemory.savedNew")),k(null),S(null)}}),(0,s.jsx)(y,{pendingCount:d.pending,deferred:d.deferred,dailyCalls:c})]}),x.length>0&&(0,s.jsxs)("div",{id:"competing-versions",tabIndex:-1,"aria-labelledby":"twin-competing-title",className:"scroll-mt-24 border-t border-edge px-5 py-5 sm:px-6",children:[(0,s.jsx)("h3",{id:"twin-competing-title",className:"text-base font-semibold",children:p("twinMemory.competingTitle")}),(0,s.jsx)("p",{className:"mt-2 max-w-2xl text-xs leading-relaxed text-smoke",children:p("twinMemory.competingLead")}),(0,s.jsx)("p",{className:"mt-2 font-mono text-xs text-smoke",children:p("twinMemory.competingFamilies",{n:x.length})}),(0,s.jsx)("ul",{className:"mt-4 grid items-start gap-3 xl:grid-cols-2",role:"list",children:x.map(e=>(0,s.jsx)(f,{family:e},e.map(e=>e.id).join(",")))})]}),(0,s.jsxs)("div",{className:"border-t border-edge px-5 py-5 sm:px-6",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,s.jsx)("h3",{className:"text-base font-semibold",children:p("twinMemory.recentTitle")}),V>0&&(0,s.jsx)(o.Jl,{size:"sm",checked:j,onChange:e=>v(e.target.checked),children:p("twinMemory.includeDismissed",{n:V})})]}),(0,s.jsxs)("form",{role:"search","aria-busy":"search"===Z,className:"mt-3 flex flex-wrap items-end gap-2",onSubmit:e=>{e.preventDefault(),Q(q)},children:[(0,s.jsx)(o.D0,{label:p("twinMemory.searchLabel"),className:"min-w-0 grow sm:max-w-md",type:"search",value:q,maxLength:200,disabled:null!==Z,"aria-describedby":"memory-search-hint",onChange:e=>{B(e.target.value),!e.target.value.trim()&&F&&Q("")}}),(0,s.jsx)(o.rA,{type:"submit",tone:"surface",busy:"search"===Z,busyLabel:p("twinMemory.searching"),disabled:null!==Z,children:p("twinMemory.search")}),F&&(0,s.jsx)(o.rA,{type:"button",tone:"plain",disabled:null!==Z,onClick:()=>{B(""),Q("")},children:p("twinMemory.clearSearch")})]}),(0,s.jsx)("p",{id:"memory-search-hint",className:"mt-1 text-xs leading-relaxed text-smoke",children:p("twinMemory.searchHint")}),J&&(0,s.jsx)(o.lZ,{text:J,className:"mt-2"}),(0,s.jsx)("p",{className:"mt-3 text-xs text-smoke",children:F?p("twinMemory.shownMatches",{query:F,n:W.length}):p("twinMemory.shown",{n:W.length})}),0===W.length&&F?(0,s.jsx)(o.pp,{variant:"note",role:"status",className:"mt-4",title:p("twinMemory.noMatches",{query:F})}):0===W.length?(0,s.jsx)(o.pp,{className:"mt-4",title:p("twinMemory.emptyTitle"),children:p("twinMemory.emptyBody")}):(0,s.jsx)("ul",{className:"mt-4 grid items-start gap-3 xl:grid-cols-2",role:"list",children:W.map(e=>(0,s.jsx)(g,{episode:e,previousAvailable:!!(e.supersedesId&&E.some(t=>t.id===e.supersedesId)),hasActiveSuccessor:!!e.activeRevisionId,onPrevious:()=>{var t,n;v(!0),O(null!=(n=e.supersedesId)?n:null),null==(t=document.getElementById("episode-".concat(e.supersedesId)))||t.focus()},onRevise:()=>{var t;L(null),e.id!==(null==N?void 0:N.id)&&(P.current?S(e):(S(null),k(e))),null==(t=document.getElementById("memory-capture-form"))||t.scrollIntoView({block:"start",behavior:"instant"})}},e.id))}),U&&(0,s.jsx)(o.rA,{type:"button",tone:"surface",className:"mt-4",busy:"older"===Z,busyLabel:p("twinMemory.loadingOlder"),disabled:null!==Z,onClick:()=>void X(),children:p("twinMemory.loadOlder")}),(0,s.jsx)("p",{className:"mt-4 text-xs leading-relaxed text-smoke",children:p("twinMemory.boundary")})]})]})}function f(e){let{family:t}=e,n=(0,r.kj)(),a=(0,l.useRouter)(),[d,c]=(0,i.useState)(null),[u,x]=(0,i.useState)(null),w=(0,i.useRef)(!1);async function f(e){if(w.current)return;w.current=!0,c(e.id),x(null);let s=!1;try{for(let i of t)i.id!==e.id&&(await p("/api/twin/episodes",{id:i.id,status:"dismissed",expectedUpdatedAt:i.updatedAt},n("twinMemory.requestFailed")),s=!0)}catch(e){x(h(e,n))}finally{w.current=!1,c(null),s&&a.refresh()}}return(0,s.jsxs)("li",{className:"min-w-0 rounded-lg border border-edge bg-ground p-4",children:[(0,s.jsx)("ol",{className:"space-y-3",role:"list",children:t.map(e=>{var t,i;return(0,s.jsxs)("li",{className:"flex flex-wrap items-start justify-between gap-3 border-t border-edge pt-3 first:border-t-0 first:pt-0",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsxs)("p",{className:"flex flex-wrap gap-x-2 gap-y-1 font-mono text-[11px] text-smoke",children:[(0,s.jsx)("span",{children:n("owner"===e.origin?"twinMemory.byOwner":"twinMemory.fromHistory")}),(0,s.jsxs)("span",{children:["\xb7 ",null!=(t=e.projectName)?t:n(e.identity?"twinMemory.unlinkedProject":"twinMemory.noProject")]}),(0,s.jsxs)("time",{dateTime:e.createdAt,children:["\xb7 ",e.createdAt.slice(0,10)]})]}),(0,s.jsx)("p",{className:"mt-1 line-clamp-3 break-words text-sm leading-relaxed",children:null!=(i=m(e))?i:n("twinMemory.untitled")}),(0,s.jsx)("a",{href:"#episode-".concat(e.id),className:"mt-1 inline-block text-xs underline underline-offset-4",children:n("twinMemory.explore")})]}),(0,s.jsx)(o.rA,{type:"button",tone:"surface",busy:d===e.id,busyLabel:n("twinMemory.keeping"),disabled:null!==d,onClick:()=>void f(e),children:n("twinMemory.keepThis")})]},e.id)})}),u&&(0,s.jsx)(o.lZ,{text:u,className:"mt-3"})]})}function b(e){var t,n,a,m,u;let{projects:x,revision:w,blocked:f,dirty:b,savedMessage:y,onSaved:g,onCancel:j,onClear:v}=e,N=(0,r.kj)(),k=(0,l.useRouter)(),[M,S]=(0,i.useState)({}),[C,L]=(0,i.useState)(""),[T,O]=(0,i.useState)(new Set),[P,R]=(0,i.useState)(null),[A,E]=(0,i.useState)(""),[I,U]=(0,i.useState)(!1),[D,q]=(0,i.useState)(null),[B,F]=(0,i.useState)(!1),z=(0,i.useRef)(!1),Z=(0,i.useRef)(null),_=!!((null==(t=M.goal)?void 0:t.trim())||(null==(n=M.decision)?void 0:n.trim())),J=d.filter(e=>"goal"!==e&&"decision"!==e),H=J.filter(e=>{var t;return T.has(e)||!!(null==(t=M[e])?void 0:t.trim())}),G=J.filter(e=>!H.includes(e)),W=(null==w?void 0:w.identity)&&null!=(m=null==(a=x.find(e=>e.identity===w.identity))?void 0:a.slug)?m:"";async function V(e){if(e.preventDefault(),!z.current&&_){z.current=!0,U(!0),q(null);try{await p("/api/twin/episodes",{fields:M,...A?{validUntil:A}:{},...w?{replacesId:w.id,expectedUpdatedAt:w.updatedAt}:C?{slug:C}:{}},N("twinMemory.requestFailed")),S({}),O(new Set),R(null),E(""),F(!1),b.current=!1,g(),k.refresh()}catch(e){q(h(e,N))}finally{z.current=!1,U(!1)}}}function Y(e){var t;let n=null!=(t=M[e])?t:"";return(0,s.jsxs)("div",{children:[(0,s.jsx)(o.fs,{label:N(c[e].label),id:"memory-".concat(e),value:n,maxLength:1200,rows:"decision"===e?3:2,disabled:I,placeholder:N(c[e].hint),"aria-describedby":"memory-".concat(e,"-count"),onChange:t=>{S(n=>({...n,[e]:t.target.value})),F(!0),b.current=!0}}),(0,s.jsx)("p",{id:"memory-".concat(e,"-count"),className:"mt-1 text-right font-mono text-[11px] text-smoke",children:N("twinMemory.characters",{n:n.length,max:1200})})]},e)}return(0,i.useEffect)(()=>{var e,t,n,s;S(w?Object.fromEntries(d.map(e=>{var t,n;return[e,null!=(n=null==(t=w.fields[e])?void 0:t.text)?n:""]})):{}),O(new Set(w?d.filter(e=>{var t;return null==(t=w.fields[e])?void 0:t.text.trim()}):[])),R(null),E(null!=(s=null==w||null==(e=w.validUntil)?void 0:e.slice(0,10))?s:""),L(W),F(!1),b.current=!1,w&&(null==(n=Z.current)||null==(t=n.querySelector("textarea"))||t.focus({preventScroll:!0}))},[w,W,b]),(0,i.useEffect)(()=>{var e;P&&(null==(e=document.getElementById("memory-".concat(P)))||e.focus())},[P]),(0,s.jsxs)("form",{id:"memory-capture-form",ref:Z,onSubmit:V,"aria-busy":I,"aria-labelledby":"memory-capture-title",className:"min-w-0 scroll-mt-24 px-5 py-5 sm:px-6",children:[(0,s.jsx)("h3",{id:"memory-capture-title",className:"text-base font-semibold",children:N(w?"twinMemory.reviseTitle":"twinMemory.captureTitle")}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-smoke",children:N(w?"twinMemory.reviseHint":"twinMemory.captureHint")}),(0,s.jsx)("div",{role:"status","aria-live":"polite",children:f&&(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-3 rounded-lg border border-edge bg-ground px-3 py-3",children:[(0,s.jsx)("p",{className:"text-xs leading-relaxed text-smoke",children:N("twinMemory.unsavedDraft")}),(0,s.jsx)(o.rA,{type:"button",tone:"surface",disabled:I,onClick:v,children:N("twinMemory.clearDraft")})]})}),(0,s.jsxs)("div",{className:"mt-4 space-y-3",children:[Y("goal"),Y("decision"),(0,s.jsxs)(o.l6,{label:N("twinMemory.projectContext"),value:C,disabled:I||null!==w,onChange:e=>L(e.target.value),children:[(0,s.jsx)("option",{value:"",children:(null==w?void 0:w.identity)&&!C?null!=(u=w.projectName)?u:N("twinMemory.originalProject"):N("twinMemory.noProject")}),x.map(e=>(0,s.jsx)("option",{value:e.slug,children:e.label},e.slug))]}),(0,s.jsxs)("div",{children:[(0,s.jsx)(o.D0,{label:N("twinMemory.validUntilLabel"),type:"date",value:A,disabled:I,"aria-describedby":"memory-valid-until-hint",onChange:e=>{E(e.target.value),F(!0),b.current=!0}}),(0,s.jsx)("p",{id:"memory-valid-until-hint",className:"mt-1 text-xs leading-relaxed text-smoke",children:N("twinMemory.validUntilHint")})]}),H.map(Y),G.length>0&&(0,s.jsxs)("div",{className:"rounded-lg border border-edge px-3 py-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:N("twinMemory.moreFields")}),(0,s.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:G.map(e=>(0,s.jsx)(o.rA,{type:"button",tone:"surface",disabled:I,"aria-label":N("twinMemory.addField",{field:N(c[e].label).toLocaleLowerCase()}),onClick:()=>{O(t=>new Set(t).add(e)),R(e)},children:N(c[e].label)},e))})]})]}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-3",children:[(0,s.jsx)(o.rA,{type:"submit",tone:"accent",busy:I,busyLabel:N("twinMemory.saving"),disabled:I||!_,children:N(w?"twinMemory.saveRevision":"twinMemory.saveEpisode")}),w&&(0,s.jsx)(o.rA,{type:"button",tone:"plain",disabled:I,onClick:j,children:N("twinMemory.cancelRevision")}),(0,s.jsx)("span",{className:"text-xs text-smoke",children:N("twinMemory.localSave")})]}),D&&(0,s.jsx)(o.lZ,{text:D,className:"mt-3"}),(0,s.jsx)("div",{role:"status","aria-live":"polite",children:y&&!B&&(0,s.jsx)("p",{className:"mt-3 text-sm text-smoke",children:y})})]})}function y(e){var t,n;let{pendingCount:d,deferred:c,dailyCalls:m}=e,u=(0,r.kj)(),x=(0,l.useRouter)(),[w,f]=(0,i.useState)(null),[b,y]=(0,i.useState)(null),[g,j]=(0,i.useState)(null),[v,N]=(0,i.useState)(null),k=(0,i.useRef)(!1),M=m>0&&d>0?Math.max(1,Math.ceil(d/(12*m))):null;async function S(e){if(k.current||"learn"===e&&(!b||!b.selected||b.remainingCalls<b.calls))return;k.current=!0,f(e),j(null),N(null);let t=u("twinMemory.requestFailed");try{var n,s,i,l,a;if("capture"===e){let e=await p("/api/twin/mine",{captureNarratives:!0},t);y(null),N([u("twinMemory.capturedNew",{n:null!=(s=e.narrativesSaved)?s:0}),e.saved?u("twin.minedQuotes",{n:e.saved}):"",(null==(n=e.denied)?void 0:n.length)?u("twinMemory.capturedDenied",{n:e.denied.length}):"",e.narrativesUnmatched?u("twinMemory.capturedUnmatched",{n:e.narrativesUnmatched}):"",e.narrativesUndated?u("twinMemory.capturedUndated",{n:e.narrativesUndated}):""].filter(Boolean).join(" ")),x.refresh()}else if("preview"===e)y(await p("/api/twin/episodes/learn",{dryRun:!0},t));else{let e=await p("/api/twin/episodes/learn",{},t);y(null),N([u("twinMemory.learnStored",{stored:null!=(i=e.stored)?i:0,processed:null!=(l=e.processed)?l:0,remaining:null!=(a=e.remaining)?a:0}),e.dropped?u("twinMemory.learnDropped",{n:e.dropped}):"",e.failed?u("cut"===e.failed.reason?"twinMemory.learnCut":"twinMemory.learnUnsupported"):"",e.failed?u("twinMemory.learnDeferred",{n:e.failed.records}):""].filter(Boolean).join(" ")),x.refresh()}}catch(t){j(h(t,u)),"learn"===e&&(y(null),x.refresh())}finally{k.current=!1,f(null)}}return(0,s.jsxs)("div",{className:"min-w-0 border-t border-edge bg-ground px-5 py-5 sm:px-6 lg:border-t-0 lg:border-l","aria-busy":null!==w,children:[(0,s.jsxs)("h3",{className:"flex items-center gap-2 text-base font-semibold",children:[(0,s.jsx)(a.tZt,{"aria-hidden":!0,className:"h-4 w-4 text-smoke"}),u("twinMemory.learnTitle")]}),(0,s.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-smoke",children:u("twinMemory.learnLead")}),(0,s.jsxs)("div",{className:"mt-5 rounded-lg border border-edge bg-surface p-4",children:[(0,s.jsx)("p",{className:"font-mono text-xs text-smoke",children:u("twinMemory.step1")}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-smoke",children:u("twinMemory.step1Hint")}),(0,s.jsxs)(o.rA,{type:"button",tone:"surface",className:"mt-3",busy:"capture"===w,busyLabel:u("twinMemory.capturing"),disabled:null!==w,onClick:()=>void S("capture"),children:[(0,s.jsx)(a.Dho,{"aria-hidden":!0,className:"h-4 w-4"}),u("twinMemory.capture")]}),(0,s.jsx)("p",{className:"mt-2 text-xs text-smoke",children:u("twinMemory.noCall")})]}),(0,s.jsxs)("div",{className:"mt-3 rounded-lg border border-edge bg-surface p-4",children:[(0,s.jsx)("p",{className:"font-mono text-xs text-smoke",children:u("twinMemory.step2")}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-smoke",children:u("twinMemory.step2Hint")}),(0,s.jsx)(o.rA,{type:"button",tone:"surface",className:"mt-3",busy:"preview"===w,busyLabel:u("twinMemory.previewing"),disabled:null!==w,onClick:()=>void S("preview"),children:u("twinMemory.preview")}),!b&&(0,s.jsxs)("div",{className:"mt-2 space-y-1 text-xs text-smoke",children:[(0,s.jsx)("p",{children:u("twinMemory.awaiting",{n:d})}),c>0&&(0,s.jsx)("p",{children:u("twinMemory.deferred",{n:c})}),m>0?(0,s.jsx)("p",{children:u("twinMemory.passReads",{n:24})}):(0,s.jsx)("p",{children:u("twinMemory.extractionOff")}),null!==M&&(0,s.jsx)("p",{children:u("twinMemory.queueDays",{n:M})})]}),b&&(0,s.jsxs)("div",{className:"mt-4 border-t border-edge pt-4",children:[(0,s.jsxs)("dl",{className:"grid grid-cols-[1fr_auto] gap-x-3 gap-y-2 text-xs",children:[(0,s.jsx)("dt",{className:"text-smoke",children:u("twinMemory.selected")}),(0,s.jsx)("dd",{className:"font-mono",children:b.selected}),(0,s.jsx)("dt",{className:"text-smoke",children:u("twinMemory.inputTokens")}),(0,s.jsx)("dd",{className:"font-mono",children:b.inputTokens}),(0,s.jsx)("dt",{className:"text-smoke",children:u("twinMemory.outputTokens")}),(0,s.jsx)("dd",{className:"font-mono",children:b.outputTokens}),(0,s.jsx)("dt",{className:"text-smoke",children:u("twinMemory.calls")}),(0,s.jsx)("dd",{className:"font-mono",children:b.calls}),(0,s.jsx)("dt",{className:"text-smoke",children:u("twinMemory.remainingCalls")}),(0,s.jsx)("dd",{className:"font-mono",children:b.remainingCalls})]}),b.contextOnly>0&&(0,s.jsx)("p",{className:"mt-2 text-xs text-smoke",children:u("twinMemory.contextOnly",{n:b.contextOnly})}),(null!=(t=b.retrying)?t:0)>0&&(0,s.jsx)("p",{className:"mt-2 text-xs text-smoke",children:u("twinMemory.learnRetrying",{n:null!=(n=b.retrying)?n:0})}),(b.provider||b.model)&&(0,s.jsx)("p",{className:"mt-3 break-words font-mono text-[11px] text-smoke",children:[b.provider,b.model].filter(Boolean).join(" / ")}),0===b.selected?(0,s.jsx)(o.pp,{variant:"note",className:"mt-3",title:u("twinMemory.nothingUnread")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.rA,{type:"button",tone:"accent",className:"mt-4",busy:"learn"===w,busyLabel:u("twinMemory.learning"),disabled:null!==w||b.remainingCalls<b.calls,onClick:()=>void S("learn"),children:u("twinMemory.learn")}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-smoke",children:u(b.remainingCalls<b.calls?"twinMemory.budgetShort":"twinMemory.learnCost")})]})]})]}),g&&(0,s.jsx)(o.lZ,{text:g,className:"mt-3"}),(0,s.jsx)("p",{role:"status","aria-live":"polite",className:"mt-3 text-xs leading-relaxed text-smoke",children:"learn"===w?u("twinMemory.extracting"):v})]})}function g(e){var t,n,a,w,f,b,y,g;let{episode:j,onRevise:v,previousAvailable:N,hasActiveSuccessor:k,onPrevious:M}=e,S=(0,r.kj)(),C=(0,r.Ym)(),L=(0,l.useRouter)(),{recorded:T,missing:O}=function(e){let t=d.filter(t=>{var n;return!!(null==(n=e.fields[t])?void 0:n.text.trim())});return{recorded:t,missing:d.filter(e=>!t.includes(e))}}(j),[P,R]=(0,i.useState)(null),[A,E]=(0,i.useState)(null),[I,U]=(0,i.useState)(null),[D,q]=(0,i.useState)(!1),[B,F]=(0,i.useState)(null),[z,Z]=(0,i.useState)(null),[_,J]=(0,i.useState)(j.validUntil),[H,G]=(0,i.useState)(null!=(a=null==(t=j.validUntil)?void 0:t.slice(0,10))?a:"");_!==j.validUntil&&(J(j.validUntil),G(null!=(f=null==(w=j.validUntil)?void 0:w.slice(0,10))?f:""));let W=(0,i.useRef)(!1),V=(0,i.useRef)(!1),Y=(0,i.useRef)(null),K=T.some(e=>{var t;return!!(null==(t=j.fields[e])?void 0:t.narrativeId)}),Q=null!=(b=m(j))?b:S("twinMemory.untitled"),X=e=>e.map(e=>S(c[e].label).toLocaleLowerCase()).join(", "),$="dismissed"===j.status&&!k,ee="active"===j.status&&k,et=u(j),en=j.validUntil?new Date(j.validUntil).toLocaleDateString(C,{timeZone:"UTC"}):null;async function es(){if(!W.current){W.current=!0,R("status"),E(null);try{await p("/api/twin/episodes",{id:j.id,status:"active"===j.status?"dismissed":"active",expectedUpdatedAt:j.updatedAt},S("twinMemory.requestFailed")),L.refresh()}catch(e){E(h(e,S))}finally{W.current=!1,R(null)}}}async function ei(e){if(!W.current){W.current=!0,R(null===e?"clearExpiry":"expiry"),E(null);try{await p("/api/twin/episodes",{id:j.id,validUntil:e,expectedUpdatedAt:j.updatedAt},S("twinMemory.requestFailed")),L.refresh()}catch(e){E(h(e,S))}finally{W.current=!1,R(null)}}}async function el(){if(null===I&&!V.current){V.current=!0,q(!0),F(null);try{let t=await fetch("/api/twin/episodes?id=".concat(encodeURIComponent(j.id))),n=await t.json();if(!t.ok||!Array.isArray(n.evidence)){var e;throw Error(null!=(e=n.error)?e:S("twinMemory.evidenceFailed"))}U(n.evidence)}catch(e){F(h(e,S))}finally{V.current=!1,q(!1)}}}return(0,i.useEffect)(()=>{var e;I&&z&&(null==(e=document.getElementById("episode-".concat(j.id,"-source-").concat(z)))||e.focus())},[I,j.id,z]),(0,s.jsxs)("li",{id:"episode-".concat(j.id),tabIndex:-1,className:"min-w-0 scroll-mt-24 rounded-lg border border-edge bg-ground p-4",children:[(0,s.jsxs)("p",{className:"flex flex-wrap gap-x-2 gap-y-1 font-mono text-[11px] text-smoke",children:[(0,s.jsx)("span",{children:S("owner"===j.origin?"twinMemory.byOwner":"twinMemory.fromHistory")}),(0,s.jsxs)("span",{children:["\xb7 ",null!=(y=j.projectName)?y:S(j.identity?"twinMemory.unlinkedProject":"twinMemory.noProject")]}),"dismissed"===j.status&&(0,s.jsxs)("span",{children:["\xb7 ",S("twinMemory.dismissed")]})]}),(0,s.jsx)("h4",{className:"mt-2 line-clamp-3 break-words text-sm font-medium leading-relaxed",children:Q}),j.supersedesId&&(0,s.jsx)("p",{className:"mt-2 text-xs text-smoke",children:N?(0,s.jsx)("a",{href:"#episode-".concat(j.supersedesId),onClick:M,className:"underline underline-offset-4",children:S("twinMemory.previousVersion")}):(0,s.jsxs)("a",{href:"/twin?episode=".concat(encodeURIComponent(j.supersedesId),"#episode-").concat(j.supersedesId),className:"underline underline-offset-4",children:[S("twinMemory.previousVersion")," ",(0,s.jsx)("span",{className:"sr-only",children:S("twinMemory.outsideView")})]})}),(0,s.jsx)("p",{className:"mt-3 font-mono text-[11px] text-smoke",children:S("twinMemory.recorded",{list:X(T)})}),(0,s.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-smoke",children:S("dismissed"===j.status?"twinMemory.reachNowhere":u(j)?"twinMemory.reachExpired":ee?"twinMemory.reachWithheld":"history"===j.origin?"twinMemory.reachLabOnly":(null==(g=j.fields.decision)?void 0:g.text.trim())?j.identity?"twinMemory.reachProject":"twinMemory.reachGeneral":"twinMemory.reachNoDecision")}),en&&(0,s.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-smoke",children:S(et?"twinMemory.expiredOn":"twinMemory.appliesThrough",{date:en})}),(0,s.jsxs)("details",{className:"mt-3",children:[(0,s.jsx)("summary",{className:"cursor-pointer text-xs font-medium underline-offset-4 hover:underline",children:S("twinMemory.explore")}),(0,s.jsx)("dl",{className:"mt-3 space-y-3",children:T.map(e=>{var t;return(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{className:"text-xs font-medium",children:S(c[e].label)}),(0,s.jsxs)("dd",{className:"mt-1 whitespace-pre-wrap break-words text-sm leading-relaxed text-smoke",children:[j.fields[e].text,(null==(t=j.fields[e])?void 0:t.narrativeId)&&(0,s.jsx)("button",{type:"button",className:"mt-1 block text-xs underline underline-offset-4","aria-label":S("twinMemory.viewSourceFor",{field:S(c[e].label).toLocaleLowerCase()}),onClick:()=>{var t;let n=j.fields[e].narrativeId;Y.current&&(Y.current.open=!0),Z(n),I&&(null==(t=document.getElementById("episode-".concat(j.id,"-source-").concat(n)))||t.focus()),el()},children:S("twinMemory.viewSource")})]})]},e)})}),O.length>0&&(0,s.jsx)("p",{className:"mt-4 border-t border-edge pt-3 text-xs leading-relaxed text-smoke",children:S("twinMemory.notRecorded",{list:X(O)})}),(0,s.jsxs)("div",{className:"mt-4 border-t border-edge pt-3",children:[(0,s.jsx)("p",{className:"text-xs font-medium",children:S("twinMemory.expiryTitle")}),(0,s.jsx)(o.D0,{label:S("twinMemory.validUntilLabel"),className:"mt-2",size:"sm",type:"date",value:H,disabled:null!==P,"aria-describedby":"episode-".concat(j.id,"-expiry-hint"),onChange:e=>G(e.target.value)}),(0,s.jsx)("p",{id:"episode-".concat(j.id,"-expiry-hint"),className:"mt-1 text-xs leading-relaxed text-smoke",children:S("twinMemory.validUntilHint")}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,s.jsx)(o.rA,{type:"button",tone:"surface",busy:"expiry"===P,busyLabel:S("twinMemory.savingExpiry"),disabled:null!==P||!H||H===(null==(n=j.validUntil)?void 0:n.slice(0,10)),onClick:()=>void ei(H),children:S("twinMemory.saveExpiry")}),j.validUntil&&(0,s.jsx)(o.rA,{type:"button",tone:"plain",busy:"clearExpiry"===P,busyLabel:S("twinMemory.clearingExpiry"),disabled:null!==P,onClick:()=>void ei(null),children:S("twinMemory.clearExpiry")})]})]})]}),K&&(0,s.jsxs)("details",{ref:Y,className:"mt-3",onToggle:e=>{e.currentTarget.open&&el()},children:[(0,s.jsx)("summary",{className:"cursor-pointer text-xs font-medium underline-offset-4 hover:underline",children:S("twinMemory.viewEvidence")}),D&&(0,s.jsx)("p",{role:"status",className:"mt-2 text-xs text-smoke",children:S("twinMemory.loadingEvidence")}),B&&(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)(o.lZ,{text:B}),(0,s.jsx)(o.rA,{type:"button",tone:"surface",className:"mt-2",onClick:()=>void el(),children:S("twinMemory.retryEvidence")})]}),I&&0===I.length&&(0,s.jsx)("p",{className:"mt-2 text-xs text-smoke",children:S("twinMemory.sourceGone")}),null==I?void 0:I.map(e=>{let t=x[e.kind];return(0,s.jsxs)("div",{id:"episode-".concat(j.id,"-source-").concat(e.id),tabIndex:-1,className:"mt-3 scroll-mt-24 rounded border border-edge bg-surface p-3",children:[(0,s.jsxs)("p",{className:"break-words font-mono text-[10px] text-smoke",children:[e.source," \xb7 ",t?S(t):e.kind," \xb7 ",e.at.slice(0,10)]}),(0,s.jsx)("p",{className:"mt-2 text-xs font-medium",children:S("brief"===e.kind?"twinMemory.briefText":"twinMemory.ownerText")}),(0,s.jsx)("blockquote",{className:"mt-1 whitespace-pre-wrap break-words text-xs leading-relaxed text-smoke",children:e.text}),e.truncated&&(0,s.jsx)("p",{className:"mt-2 text-xs text-smoke",children:S("twinMemory.truncated")}),e.context&&(0,s.jsxs)("details",{className:"mt-3 border-t border-edge pt-2",children:[(0,s.jsx)("summary",{className:"cursor-pointer text-xs text-smoke",children:S("twinMemory.agentContext")}),(0,s.jsx)("p",{className:"mt-2 whitespace-pre-wrap break-words text-xs leading-relaxed text-smoke",children:e.context})]})]},e.id)})]}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap items-center justify-between gap-2 border-t border-edge pt-3",children:[(0,s.jsx)("time",{dateTime:j.createdAt,className:"font-mono text-[10px] text-smoke",children:j.createdAt.slice(0,10)}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(o.rA,{type:"button",tone:"surface",disabled:null!==P||k,onClick:v,children:S("twinMemory.revise")}),("active"===j.status||$)&&(0,s.jsx)(o.rA,{type:"button",tone:"plain",busy:"status"===P,busyLabel:S("twin.saving"),disabled:null!==P,onClick:()=>void es(),children:S("active"===j.status?"twinMemory.dismiss":"twinMemory.restore")})]})]}),k&&(0,s.jsxs)("p",{className:"mt-2 text-xs leading-relaxed text-smoke",children:[S(ee?"twinMemory.competingActive":"twinMemory.successorActive")," ",ee?(0,s.jsx)("a",{href:"#competing-versions",className:"underline underline-offset-4",children:S("twinMemory.competingOpen")}):(0,s.jsx)("a",{href:"/twin?episode=".concat(encodeURIComponent(j.activeRevisionId),"#episode-").concat(j.activeRevisionId),className:"underline underline-offset-4",children:S("twinMemory.currentVersion")})]}),A&&(0,s.jsx)(o.lZ,{text:A,className:"mt-2"})]})}},9144:(e,t,n)=>{"use strict";n.d(t,{I18nProvider:()=>o,Ym:()=>d,Zs:()=>c,kj:()=>m});var s=n(38657),i=n(32165),l=n(2575);let a=(0,i.createContext)("en"),r=(0,i.createContext)("panoma");function o(e){let{locale:t,cli:n,children:i}=e;return(0,s.jsx)(a.Provider,{value:t,children:(0,s.jsx)(r.Provider,{value:n,children:i})})}function d(){return(0,i.useContext)(a)}function c(){return(0,i.useContext)(r)}function m(){let e=(0,i.useContext)(a),t=(0,i.useContext)(r);return(0,i.useCallback)((n,s)=>(0,l.t)(e,n,{cli:t,...s}),[e,t])}},10354:(e,t,n)=>{"use strict";var s=n(61990);n.o(s,"usePathname")&&n.d(t,{usePathname:function(){return s.usePathname}}),n.o(s,"useRouter")&&n.d(t,{useRouter:function(){return s.useRouter}}),n.o(s,"useSearchParams")&&n.d(t,{useSearchParams:function(){return s.useSearchParams}})},15797:(e,t,n)=>{"use strict";n.d(t,{TwinSynthesize:()=>o});var s=n(38657),i=n(32165),l=n(10354),a=n(9144),r=n(52948);function o(e){let{pending:t,ready:n,compact:o}=e,d=(0,a.kj)(),c=(0,l.useRouter)(),[m,u]=(0,i.useState)(!1),[x,p]=(0,i.useState)(null);async function h(){u(!0),p(null);try{var e,n,s,i,l,a,r,o,m;let u=0;if(t>0){let t=await fetch("/api/twin/classify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),s=await t.json();if(!t.ok)return void p(null!=(e=s.error)?e:d("twin.synthFailed"));u+=null!=(n=s.truncated)?n:0}let x=await fetch("/api/twin/synthesize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),h=await x.json();if(!x.ok)return void p(null!=(s=h.error)?s:d("twin.synthFailed"));u+=null!=(i=h.truncated)?i:0;let w=null!=(l=h.created)?l:0,f=null!=(a=h.refined)?a:0,b=null!=(r=h.retired)?r:0,y=null!=(o=h.proposed)?o:0,g=w+f+b+y,j=null!=(m=h.unchanged)?m:0,v=0===h.topics?j>0?d("twin.synthUpToDate"):d("twin.synthNothing"):d("twin.synthSame"),N=d("twin.synthDone",{created:w,refined:f,retired:b}),k=0===g?v:0===y?N:"".concat(N," ").concat(d("twin.synthAsks",{n:y}));p(u>0?"".concat(k," ").concat(d("twin.synthTruncated",{n:u})):k),c.refresh()}catch(e){p(d("project.unreachable"))}finally{u(!1)}}return(0,s.jsxs)("div",{className:o?"flex items-center gap-2":"mt-3 flex flex-col gap-1",children:[(0,s.jsx)(r.rA,{tone:"plain",type:"button",onClick:h,busy:m,busyLabel:d("twin.synthesizing"),disabled:!n,"aria-describedby":n?void 0:"twin-synth-why",className:"self-start",children:d("twin.synthesize")}),n?(0,s.jsx)("div",{role:"status","aria-live":"polite",children:x?(0,s.jsx)("p",{className:"font-mono text-xs text-smoke",children:x}):o?null:(0,s.jsx)("p",{className:"text-xs leading-relaxed text-smoke",children:d("twin.synthHint")})}):(0,s.jsx)("p",{id:"twin-synth-why",className:"text-xs leading-relaxed text-smoke",children:d("twin.synthNothing")})]})}},18557:(e,t,n)=>{"use strict";n.d(t,{BeliefEditor:()=>c});var s=n(38657),i=n(32165),l=n(10354),a=n(9144),r=n(59916),o=n(52948);let d={signed:"twin.badgeSigned",standing:"twin.badgeStanding",forming:"twin.badgeForming"};function c(e){let{beliefs:t,graveyard:n,proposals:r,unpublished:d,locale:c}=e,h=(0,a.kj)(),w=(0,l.useRouter)(),[f,b]=(0,i.useState)(new Map),[y,g]=(0,i.useState)(new Map),[j,v]=(0,i.useState)(null),[N,k]=(0,i.useState)(!1),[M,S]=(0,i.useState)(null),C=(0,i.useMemo)(()=>{let e=new Map;for(let n of t){let t=e.get(n.topic);t?t.push(n):e.set(n.topic,[n])}return[...e]},[t]),L=f.size>0||y.size>0;function T(e,t){b(n=>{let s=new Map(n);return void 0===t?s.delete(e):s.set(e,t),s})}async function O(){k(!0),S(null);let e=[],t=[],n=[];for(let[s,i]of f)"sign"===i.kind?e.push({id:s,...i.statement?{statement:i.statement}:{}}):"veto"===i.kind?t.push(s):n.push({id:s,identity:i.identity});let s=[...y].map(e=>{let[t,n]=e;return{id:t,accept:n}});try{let l=await fetch("/api/twin/taste",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sign:e,veto:t,scope:n,resolve:s})}),a=await l.json();if(!l.ok){var i;S(null!=(i=a.error)?i:String(l.status));return}b(new Map),g(new Map),v(null),w.refresh()}catch(e){S(h("project.unreachable"))}finally{k(!1)}}return(0,s.jsxs)(s.Fragment,{children:[r.length>0&&(0,s.jsxs)("section",{className:"mt-8",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:h("twin.proposalsTitle")}),(0,s.jsx)("p",{className:"mt-1 max-w-2xl text-sm leading-relaxed text-smoke",children:h("twin.proposalsNote")}),(0,s.jsx)("ul",{className:"mt-4 flex flex-col gap-3",role:"list",children:r.map(e=>{var t;return(0,s.jsxs)("li",{className:"rounded-lg border px-4 py-4 ".concat(y.has(e.id)?"border-l-2 border-l-chalk border-edge":"border-edge"),children:[(0,s.jsxs)("p",{className:"eyebrow",children:[m(e.topic,h),e.supersedes&&e.supersedes.length>1?" \xb7 ".concat(h("twin.proposalJoins",{n:e.supersedes.length})):""]}),null==(t=e.supersedes)?void 0:t.map(e=>(0,s.jsx)("p",{className:"mt-1 max-w-2xl text-sm leading-relaxed text-smoke line-through decoration-faint",children:e},e)),(0,s.jsx)("p",{className:"mt-2 max-w-2xl text-base leading-relaxed",children:e.statement}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,s.jsx)(p,{label:h("twin.proposalAccept"),toggle:!0,active:!0===y.get(e.id),onClick:()=>g(u(y,e.id,!0))}),(0,s.jsx)(p,{label:h("twin.proposalReject"),toggle:!0,active:!1===y.get(e.id),onClick:()=>g(u(y,e.id,!1))})]})]},e.id)})})]}),C.map(e=>{let[t,n]=e;return(0,s.jsxs)("section",{className:"mt-8",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:m(t,h)}),(0,s.jsx)("ul",{className:"mt-4 flex flex-col gap-3",role:"list",children:n.map(e=>(0,s.jsx)(x,{belief:e,locale:c,gesture:f.get(e.id),stranded:"forming"!==e.badge&&d.has(e.id),editing:j===e.id,onEdit:t=>v(t?e.id:null),onGesture:t=>(function(e,t){let n=f.get(e),s=(null==n?void 0:n.kind)==="sign"&&void 0!==n.statement;n&&n.kind===t.kind&&!s?T(e,void 0):T(e,t)})(e.id,t),onWrite:t=>T(e.id,{kind:"sign",statement:t}),translate:h},e.id))})]},t)}),n.length>0&&(0,s.jsxs)("section",{className:"mt-8",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:h("twin.graveyardTitle")}),(0,s.jsx)("p",{className:"mt-1 max-w-2xl text-sm leading-relaxed text-smoke",children:h("twin.graveyardNote")}),(0,s.jsx)("ul",{className:"mt-4 flex flex-col gap-2",role:"list",children:n.map(e=>(0,s.jsx)("li",{className:"rounded-lg border border-edge px-4 py-3 opacity-60",children:(0,s.jsx)("p",{className:"text-sm leading-relaxed text-smoke line-through decoration-faint",children:e.statement})},e.id))})]}),L&&(0,s.jsxs)("div",{className:"sticky bottom-4 z-10 mt-8 flex flex-wrap items-center gap-3 rounded-lg border border-edge bg-surface/95 px-4 py-3 shadow-lg backdrop-blur",children:[(0,s.jsx)("span",{className:"font-mono text-xs text-smoke",children:h("twin.markedGestures",{n:f.size+y.size})}),(0,s.jsx)(o.rA,{tone:"accent",type:"button",onClick:O,busy:N,busyLabel:h("twin.saving"),children:h("twin.save")}),(0,s.jsx)(o.rA,{tone:"quiet",type:"button",onClick:()=>{b(new Map),g(new Map),v(null)},disabled:N,children:h("twin.cancel")}),M&&(0,s.jsx)("span",{className:"font-mono text-xs text-fail",children:h("twin.saveFailed",{detail:M})})]})]})}function m(e,t){let n=(0,r.Jj)(e);return n?t(n):e}function u(e,t,n){let s=new Map(e);return s.get(t)===n?s.delete(t):s.set(t,n),s}function x(e){let{belief:t,locale:n,gesture:l,stranded:a,editing:c,onEdit:m,onGesture:u,onWrite:x,translate:h}=e,[w,f]=(0,i.useState)(!1),[b,y]=(0,i.useState)(t.statement),g=(null==l?void 0:l.kind)==="sign"?l.statement:void 0;return(0,s.jsxs)("li",{id:"belief-".concat(t.id),tabIndex:-1,className:["scroll-mt-24 rounded-lg border px-4 py-4 transition-colors",(null==l?void 0:l.kind)==="sign"?"border-l-2 border-l-live border-edge bg-live/[0.05]":(null==l?void 0:l.kind)==="veto"?"border-l-2 border-l-faint border-edge opacity-60":void 0!==l?"border-l-2 border-l-chalk border-edge":"border-edge"].join(" "),children:[(0,s.jsxs)("p",{className:"eyebrow",children:[(0,s.jsx)("span",{className:"forming"===t.badge?"text-idle":"",children:h(d[t.badge])}),t.scope?" \xb7 ".concat(h("twin.scopedTag",{project:t.scope})):"",a?(0,s.jsx)("span",{className:"text-idle",children:" \xb7 ".concat(h("twin.notInFile"))}):null]}),a?(0,s.jsx)("p",{className:"mt-1 max-w-2xl text-xs leading-relaxed text-smoke",children:h("twin.notInFileWhy")}):null,c?(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)(o.fs,{label:h("twin.editText"),hideLabel:!0,rows:3,className:"max-w-2xl",value:b,onChange:e=>y(e.target.value)}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[(0,s.jsx)(p,{label:h("twin.editSave"),active:!0,onClick:()=>{""!==b.trim()&&(x(b.trim()),m(!1))}}),(0,s.jsx)(p,{label:h("twin.cancel"),onClick:()=>{y(t.statement),m(!1)}})]})]}):(0,s.jsx)("p",{className:"mt-1 max-w-2xl text-base leading-relaxed",children:null!=g?g:t.statement}),(0,s.jsxs)("p",{className:"mt-2 font-mono text-xs text-smoke",children:[t.authored?h("twinTeach.ownerEvidence"):h("twin.support",{observations:t.support.observations,projects:t.support.projects,days:t.support.days}),"forming"===t.badge?(0,s.jsx)("span",{className:"text-idle",children:" \xb7 ".concat(h("twin.formingWhy"))}):null,t.citations.length>0&&(0,s.jsxs)(s.Fragment,{children:[" \xb7 ",(0,s.jsx)("button",{type:"button",onClick:()=>f(e=>!e),className:"underline-offset-2 hover:underline",children:h(w?"twin.hideCitations":"twin.showCitations",{n:t.citations.length})})]})]}),w&&(0,s.jsx)("ul",{className:"mt-3 flex flex-col gap-2.5 border-l border-edge pl-3",role:"list",children:t.citations.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsxs)("p",{className:"line-clamp-2 text-sm italic leading-snug text-smoke",title:e.quote,children:["\xab",e.quote,"\xbb"]}),(0,s.jsxs)("p",{className:"mt-0.5 font-mono text-xs text-faint",children:[(0,r.mL)(e.at,n),e.project?" \xb7 ".concat(h("twin.citedIn",{project:e.project})):""]})]},e.verdictId))}),!c&&(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:["signed"!==t.badge&&(0,s.jsx)(p,{label:h("twin.sign"),toggle:!0,active:(null==l?void 0:l.kind)==="sign"&&void 0===g,onClick:()=>u({kind:"sign"})}),(0,s.jsx)(p,{label:h("twin.edit"),toggle:!0,active:void 0!==g,onClick:()=>{y(null!=g?g:t.statement),m(!0)}}),(0,s.jsx)(p,{label:h("twin.veto"),toggle:!0,active:(null==l?void 0:l.kind)==="veto",onClick:()=>u({kind:"veto"})}),t.scope?(0,s.jsx)(p,{label:h("twin.scopeAll"),toggle:!0,active:(null==l?void 0:l.kind)==="scope"&&null===l.identity,onClick:()=>u({kind:"scope",identity:null})}):t.learnedIn?(0,s.jsx)(p,{label:h("twin.scopeOnly",{project:t.learnedIn.name}),toggle:!0,active:(null==l?void 0:l.kind)==="scope",onClick:()=>{var e,n;return u({kind:"scope",identity:null!=(n=null==(e=t.learnedIn)?void 0:e.identity)?n:null})}}):null]})]})}function p(e){let{label:t,active:n,toggle:i=!1,onClick:l}=e;return(0,s.jsx)(o.rA,{tone:n?"accent":"plain",type:"button",...i?{"aria-pressed":null!=n&&n}:{},onClick:l,children:t})}},26488:(e,t,n)=>{"use strict";n.d(t,{P:()=>s,s:()=>i});let s=300,i=300},56684:(e,t,n)=>{"use strict";n.d(t,{k5:()=>c});var s=n(32165),i={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},l=s.createContext&&s.createContext(i),a=["attr","size","title"];function r(){return(r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e}).apply(null,arguments)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){var s,i,l;s=e,i=t,l=n[t],(i=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!=typeof s)return s;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(i))in s?Object.defineProperty(s,i,{value:l,enumerable:!0,configurable:!0,writable:!0}):s[i]=l}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e){return t=>s.createElement(m,r({attr:d({},e.attr)},t),function e(t){return t&&t.map((t,n)=>s.createElement(t.tag,d({key:n},t.attr),e(t.child)))}(e.child))}function m(e){var t=t=>{var n,i=e.attr,l=e.size,o=e.title,c=function(e,t){if(null==e)return{};var n,s,i=function(e,t){if(null==e)return{};var n={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;n[s]=e[s]}return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(s=0;s<l.length;s++)n=l[s],-1===t.indexOf(n)&&({}).propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,a),m=l||t.size||"1em";return t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className),s.createElement("svg",r({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,c,{className:n,style:d(d({color:e.color||t.color},t.style),e.style),height:m,width:m,xmlns:"http://www.w3.org/2000/svg"}),o&&s.createElement("title",null,o),e.children)};return void 0!==l?s.createElement(l.Consumer,null,e=>t(e)):t(i)}},59916:(e,t,n)=>{"use strict";n.d(t,{Jj:()=>i,Wv:()=>s,mL:()=>l});let s={design:"twin.topicDesign",frontend:"twin.topicFrontend",backend:"twin.topicBackend",cli:"twin.topicCli",testing:"twin.topicTesting",copy:"twin.topicCopy",workflow:"twin.topicWorkflow",tooling:"twin.topicTooling",data:"twin.topicData",other:"twin.topicOther"};function i(e){return s[e]}function l(e,t){let n=new Date(e);if(Number.isNaN(n.getTime()))return e.slice(0,10);let s=String(n.getMonth()+1).padStart(2,"0"),i=String(n.getDate()).padStart(2,"0");return"en"===t?"".concat(n.getFullYear(),"-").concat(s,"-").concat(i):"".concat(i,"/").concat(s,"/").concat(n.getFullYear())}},66229:(e,t,n)=>{"use strict";n.d(t,{TwinConsent:()=>o});var s=n(38657),i=n(32165),l=n(10354),a=n(9144),r=n(52948);function o(e){let{standing:t,chars:n,cap:o}=e,d=(0,a.kj)(),c=(0,l.useRouter)(),[m,u]=(0,i.useState)(!1),[x,p]=(0,i.useState)(null);async function h(e){u(!0),p(null);try{var t;let n=await fetch("/api/twin/taste",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publishInferred:e})}),s=await n.json();n.ok||p(null!=(t=s.error)?t:String(n.status)),c.refresh()}catch(e){p(d("project.unreachable"))}finally{u(!1)}}return(0,s.jsxs)(r.Zp,{as:"section",tone:"plain",className:"mt-8","aria-labelledby":"twin-consent-title",children:[(0,s.jsx)("h2",{id:"twin-consent-title",className:"text-base font-semibold",children:d("twin.consentTitle")}),(0,s.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed",children:d("twin.consentBody")}),(0,s.jsxs)("p",{className:"mt-2 max-w-2xl font-mono text-xs ".concat(n>o?"text-idle":"text-smoke"),children:[d("twin.consentCount",{n:t,chars:n}),n>o?" \xb7 ".concat(d("twin.consentOver",{cap:o})):""]}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,s.jsx)(r.rA,{tone:"accent",type:"button",onClick:()=>h(!0),busy:m,busyLabel:d("twin.saving"),children:d("twin.consentAllow")}),(0,s.jsx)("span",{className:"font-mono text-xs text-faint",children:d("twin.consentRevoke")})]}),x&&(0,s.jsx)(r.lZ,{text:d("twin.saveFailed",{detail:x}),className:"mt-2"})]})}},73856:(e,t,n)=>{"use strict";n.d(t,{TwinTeach:()=>m});var s=n(38657),i=n(32165),l=n(10354),a=n(3043),r=n(9144),o=n(52948),d=n(59916),c=n(26488);function m(e){let{projects:t,omitted:n}=e,m=(0,r.kj)(),u=(0,l.useRouter)(),[x,p]=(0,i.useState)(""),[h,w]=(0,i.useState)("workflow"),[f,b]=(0,i.useState)(""),[y,g]=(0,i.useState)(!1),[j,v]=(0,i.useState)(null),[N,k]=(0,i.useState)(null),M=(0,i.useRef)(!1);async function S(e){if(e.preventDefault(),!M.current&&x.trim()){M.current=!0,g(!0),v(null),k(null);try{let e=await fetch("/api/twin/taste",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({teach:{statement:x,topic:h,...f?{slug:f}:{}}})}),n=await e.json();if(!e.ok||!n.beliefId){var t;v(null!=(t=n.error)?t:m("twinTeach.failed"));return}p(""),k(n.beliefId),u.refresh()}catch(e){v(m("project.unreachable"))}finally{M.current=!1,g(!1)}}}return(0,s.jsx)("section",{id:"teach",tabIndex:-1,"aria-labelledby":"twin-teach-title",className:"page-shell__section scroll-mt-24 rounded-lg border border-edge bg-surface p-5 sm:p-6",children:(0,s.jsxs)("div",{className:"grid gap-6 lg:grid-cols-[1fr_1.4fr]",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"flex items-center gap-2 font-mono text-xs text-smoke",children:[(0,s.jsx)(a.YUE,{"aria-hidden":!0,className:"h-4 w-4"}),m("twinTeach.eyebrow")]}),(0,s.jsx)("h2",{id:"twin-teach-title",className:"mt-2 text-base font-semibold",children:m("twinTeach.title")}),(0,s.jsx)("p",{className:"mt-3 max-w-md text-sm leading-relaxed text-smoke",children:m("twinTeach.lead")}),(0,s.jsx)("p",{className:"mt-3 max-w-md text-xs leading-relaxed text-smoke",children:m("twinTeach.control")})]}),(0,s.jsxs)("form",{onSubmit:S,"aria-busy":y,children:[(0,s.jsx)(o.fs,{label:m("twinTeach.statement"),value:x,onChange:e=>{p(e.target.value),k(null)},required:!0,maxLength:c.P,rows:3,disabled:y,placeholder:m("twinTeach.placeholder"),"aria-describedby":"twin-teach-count"}),(0,s.jsx)("p",{id:"twin-teach-count",className:"mt-1 text-right font-mono text-xs text-smoke",children:m("twinTeach.characters",{n:x.length,max:c.P})}),(0,s.jsxs)("div",{className:"mt-3 grid gap-3 sm:grid-cols-2",children:[(0,s.jsx)(o.l6,{label:m("twinTeach.topic"),value:h,disabled:y,onChange:e=>w(e.target.value),children:Object.entries(d.Wv).map(e=>{let[t,n]=e;return(0,s.jsx)("option",{value:t,children:m(n)},t)})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)(o.l6,{label:m("twinTeach.scope"),value:f,disabled:y,"aria-describedby":n>0?"twin-teach-scope-note":void 0,onChange:e=>b(e.target.value),children:[(0,s.jsx)("option",{value:"",children:m("twinTeach.global")}),t.map(e=>(0,s.jsx)("option",{value:e.slug,children:e.label},e.slug))]}),n>0&&(0,s.jsx)("p",{id:"twin-teach-scope-note",className:"mt-2 text-xs leading-relaxed text-smoke",children:m("twinTeach.scopeOmitted",{n:n})})]})]}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-3",children:[(0,s.jsx)(o.rA,{type:"submit",tone:"accent",busy:y,busyLabel:m("twinTeach.saving"),disabled:y||!x.trim(),children:m("twinTeach.save")}),(0,s.jsx)("span",{className:"text-xs text-smoke",children:m("twinTeach.cost")})]}),j&&(0,s.jsx)(o.lZ,{text:j,className:"mt-3"}),(0,s.jsx)("div",{role:"status","aria-live":"polite",children:N&&(0,s.jsxs)("p",{className:"mt-3 text-sm text-smoke",children:[m("twinTeach.saved")," "," ",(0,s.jsx)("a",{href:"#belief-".concat(N),className:"underline underline-offset-4",children:m("twinTeach.view")})]})})]})]})})}},83268:(e,t,n)=>{Promise.resolve().then(n.bind(n,18557)),Promise.resolve().then(n.bind(n,66229)),Promise.resolve().then(n.bind(n,92458)),Promise.resolve().then(n.bind(n,3030)),Promise.resolve().then(n.bind(n,4733)),Promise.resolve().then(n.bind(n,88145)),Promise.resolve().then(n.bind(n,15797)),Promise.resolve().then(n.bind(n,73856)),Promise.resolve().then(n.t.bind(n,3953,23))},88145:(e,t,n)=>{"use strict";n.d(t,{TwinSources:()=>o});var s=n(38657),i=n(32165),l=n(10354),a=n(9144),r=n(52948);function o(e){let{sources:t}=e,n=(0,a.kj)(),o=(0,l.useRouter)(),[d,c]=(0,i.useState)(null),[m,u]=(0,i.useState)(null),[x,p]=(0,i.useState)(t);async function h(e,t){c(e),u(null);try{let n=await fetch("/api/twin/sources",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:e,allowed:t})}),i=await n.json();if(!n.ok){var s;u(null!=(s=i.error)?s:String(n.status));return}i.sources&&p(i.sources),o.refresh()}catch(e){u(n("project.unreachable"))}finally{c(null)}}let w=x.filter(e=>"absent"!==e.state);return 0===w.length?(0,s.jsxs)(r.Zp,{as:"section",tone:"plain","aria-labelledby":"twin-sources-title",children:[(0,s.jsx)("h2",{id:"twin-sources-title",className:"text-base font-semibold",children:n("twin.sourcesTitle")}),(0,s.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed",children:n("twin.sourcesNone")})]}):(0,s.jsxs)(r.Zp,{as:"section",tone:"plain","aria-labelledby":"twin-sources-title",children:[(0,s.jsx)("h2",{id:"twin-sources-title",className:"text-base font-semibold",children:n("twin.sourcesTitle")}),(0,s.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-relaxed",children:n("twin.sourcesLead")}),(0,s.jsx)("div",{className:"mt-3 flex flex-col gap-2",children:w.map(e=>(0,s.jsxs)("div",{className:"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 gap-y-1",children:[(0,s.jsxs)("span",{className:"min-w-0",children:[(0,s.jsx)("span",{className:"font-mono text-xs",children:e.label})," ",(0,s.jsx)("span",{className:"font-mono text-xs text-smoke",children:e.present?n("twin.sourceSize",{files:e.files,size:(0,r.z3)(e.bytes)}):n("twin.sourceGone")})]}),"noReader"===e.state?(0,s.jsx)("span",{className:"justify-self-end font-mono text-xs text-idle",children:n("twin.sourceNoReader")}):(0,s.jsx)(r.rA,{tone:"allowed"===e.state?"plain":"accent",type:"button",onClick:()=>h(e.id,"allowed"!==e.state),busy:d===e.id,busyLabel:n("twin.saving"),disabled:null!==d,className:"justify-self-end",children:n("allowed"===e.state?"twin.sourceRevoke":"twin.sourceAllow")})]},e.id))}),(0,s.jsx)("p",{className:"mt-3 max-w-2xl font-mono text-xs text-faint",children:n("twin.sourcesRevokeNote")}),m&&(0,s.jsx)(r.lZ,{text:m,className:"mt-2"})]})}},92458:(e,t,n)=>{"use strict";n.d(t,{TwinDistill:()=>o});var s=n(38657),i=n(32165),l=n(10354),a=n(9144),r=n(52948);function o(e){let{left:t,granted:n}=e,o=(0,a.kj)(),m=(0,l.useRouter)(),[u,x]=(0,i.useState)(!1),[p,h]=(0,i.useState)(null),[w,f]=(0,i.useState)(null);async function b(){x(!0),h(null),f(null);try{var e,t,n,s,i,l,a,r;h(o("twin.mining"));let u=await d();if(u.unreachable)h(o("project.unreachable"));else if(void 0!==u.error){if(h(u.error),u.blocked)return}else{let a=null!=(t=u.saved)?t:0,r=null!=(n=null==(e=u.denied)?void 0:e.length)?n:0,d=[0===a?o("twin.minedNone"):o("twin.mined",{saved:a,duplicates:null!=(s=u.duplicates)?s:0})];(null!=(i=u.narrativesSaved)?i:0)>0&&d.push(o("twin.minedRecords",{n:null!=(l=u.narrativesSaved)?l:0})),r>0&&d.push(o("twin.minedDenied",{n:r})),h(d.join(" \xb7 "))}let x=await c({dryRun:!0});if(x.error)return void h(x.hint?"".concat(x.error," ").concat(x.hint):x.error);if(!x.verdicts)return void h(o("twin.distillNothing"));f({verdicts:x.verdicts,tokens:null!=(a=x.estimatedTokens)?a:0}),h(o("twin.distillEstimate",{verdicts:x.verdicts,tokens:null!=(r=x.estimatedTokens)?r:0})),m.refresh()}catch(e){h(o("project.unreachable"))}finally{x(!1)}}async function y(){x(!0),f(null);try{let i=0,l=0,a=0;for(let r=1;r<=20;r+=1){var e,t,n,s;let r=await c({});if(i+=null!=(e=r.verdicts)?e:0,l+=null!=(t=r.saved)?t:0,a+=null!=(n=r.truncated)?n:0,r.error){h(r.hint?"".concat(r.error," ").concat(r.hint):r.error);break}let d=r.corpus?Math.max(r.corpus.total-r.corpus.read,0):0,m=null!=(s=r.thin)?s:0,u=[o("twin.distillProgress",{read:i,saved:l,left:d})];if(m>0&&u.push(o("twin.distillThin",{n:m})),a>0&&u.push(o("twin.distillTruncated",{n:a})),h(u.join(" \xb7 ")),!r.verdicts||d<=0)break}m.refresh()}catch(e){h(o("project.unreachable"))}finally{x(!1)}}return(0,s.jsxs)("div",{className:"mt-2 flex flex-col gap-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(r.rA,{tone:"plain",type:"button",onClick:b,busy:u&&null===w,busyLabel:o("twin.distilling"),disabled:!n||u,"aria-describedby":n?void 0:"twin-distill-why",className:"self-start",children:t>0?o("twin.mineButtonLeft",{n:t}):o("twin.mineButton")}),null!==w&&(0,s.jsx)(r.rA,{tone:"accent",type:"button",onClick:y,busy:u,busyLabel:o("twin.distillingPaid"),disabled:u,children:o("twin.distillGo",{n:w.verdicts})})]}),n&&(0,s.jsx)("p",{className:"text-xs leading-relaxed text-smoke",children:o("twin.distillCost")}),!n&&(0,s.jsx)("p",{id:"twin-distill-why",className:"text-xs leading-relaxed text-smoke",children:o("twin.distillNoConsent")}),(0,s.jsx)("div",{role:"status","aria-live":"polite",children:p&&(0,s.jsx)("p",{className:"font-mono text-xs text-smoke",children:p})})]})}async function d(){try{var e;let t=await fetch("/api/twin/mine",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}),n=await t.json();if(t.ok)return n;return{error:null!=(e=n.error)?e:String(t.status),...409===t.status?{blocked:!0}:{}}}catch(e){return{unreachable:!0}}}async function c(e){var t;let n=await fetch("/api/twin/distill",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await n.json();return n.ok?s:{...s,error:null!=(t=s.error)?t:String(n.status)}}}},e=>{e.O(0,[6587,3953,2575,2948,1305,6823,7358],()=>e(e.s=83268)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4406],{12991:(e,t,r)=>{"use strict";r.d(t,{OpenFolder:()=>c});var n=r(38657),o=r(32165),i=r(3043),a=r(2575),l=r(91635);let s={folder:{idle:"open.folder",busy:"open.busy",done:"open.doneFolder"},editor:{idle:"open.editor",busy:"open.busy",done:"open.done"},terminal:{idle:"open.terminal",busy:"open.busy",done:"open.done"}};function c(e){let{projectId:t,path:r,tool:c="folder",appearance:u="inline",locale:d}=e,[p,f]=(0,o.useState)("ready"),[y,m]=(0,o.useState)(null);async function b(){f("opening"),m(null);let e=await (0,l.A)({id:t,tool:c},(0,a.t)(d,"open.unreachable"));e.ok?(f("open"),setTimeout(()=>f("ready"),2e3)):(f("ready"),m(e.message))}let v=s[c],h=(0,a.t)(d,v.idle),g="editor"===c?i.KQe:"terminal"===c?i.Jhl:i.mUU;return(0,n.jsxs)("span",{className:"open-project-action open-project-action--".concat(u),children:[(0,n.jsxs)("button",{type:"button",onClick:b,disabled:"opening"===p,title:"".concat(h," \xb7 ").concat(r),children:[(0,n.jsx)(g,{"aria-hidden":!0}),"opening"===p?(0,a.t)(d,v.busy):"open"===p?(0,a.t)(d,v.done):h]}),y&&(0,n.jsx)("span",{className:"open-project-action__error",children:y})]})}},14262:(e,t,r)=>{"use strict";r.d(t,{CopyCommand:()=>l});var n=r(38657),o=r(2575),i=r(19014),a=r(52948);function l(e){let{command:t,label:r,locale:l}=e,{copied:s,copy:c}=(0,i.K)();return(0,n.jsxs)(a.rA,{tone:"raised",size:"sm",type:"button",onClick:()=>c(t),title:(0,o.t)(l,"copy.command",{command:t}),children:[(0,n.jsx)("span",{children:null!=r?r:t}),(0,n.jsx)("span",{className:"text-faint",children:s?(0,o.t)(l,"copy.done"):"⧉"})]})}},19014:(e,t,r)=>{"use strict";r.d(t,{K:()=>o});var n=r(32165);function o(){let[e,t]=(0,n.useState)(!1),[r,o]=(0,n.useState)(!1);return{copied:e,failed:r,copy:(0,n.useCallback)(async e=>{try{await navigator.clipboard.writeText(e),o(!1),t(!0),setTimeout(()=>t(!1),1600)}catch(e){o(!0)}},[])}}},35261:(e,t,r)=>{"use strict";async function n(e,t,r,n){let o,i;try{o=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}catch(e){return{ok:!1,message:r}}try{i=await o.json()}catch(e){return{ok:!1,message:String(o.status)}}return o.ok&&(null==i?void 0:i.ok)?{ok:!0,data:i}:{ok:!1,message:(null==n?void 0:n(null!=i?i:{}))||(null==i?void 0:i.error)||String(o.status)}}r.d(t,{B:()=>n})},56684:(e,t,r)=>{"use strict";r.d(t,{k5:()=>u});var n=r(32165),o={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},i=n.createContext&&n.createContext(o),a=["attr","size","title"];function l(){return(l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(null,arguments)}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach(function(t){var n,o,i;n=e,o=t,i=r[t],(o=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(o))in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function u(e){return t=>n.createElement(d,l({attr:c({},e.attr)},t),function e(t){return t&&t.map((t,r)=>n.createElement(t.tag,c({key:r},t.attr),e(t.child)))}(e.child))}function d(e){var t=t=>{var r,o=e.attr,i=e.size,s=e.title,u=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,a),d=i||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),n.createElement("svg",l({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,u,{className:r,style:c(c({color:e.color||t.color},t.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),s&&n.createElement("title",null,s),e.children)};return void 0!==i?n.createElement(i.Consumer,null,e=>t(e)):t(o)}},70659:(e,t,r)=>{Promise.resolve().then(r.bind(r,14262)),Promise.resolve().then(r.bind(r,12991)),Promise.resolve().then(r.t.bind(r,3953,23))},91635:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(35261);async function o(e,t){let r=await (0,n.B)("/api/open",{id:e.id,tool:e.tool,...e.with?{with:e.with}:{}},t,e=>[e.error,e.hint].filter(Boolean).join(" "));return r.ok?{ok:!0}:{ok:!1,message:r.message}}}},e=>{e.O(0,[6587,3953,2575,2948,1305,6823,7358],()=>e(e.s=70659)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2229,2966,4345,4709],{75206:(e,s,_)=>{Promise.resolve().then(_.t.bind(_,3953,23))}},e=>{e.O(0,[3953,1305,6823,7358],()=>e(e.s=75206)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2229,2966,4345,4709],{75206:(e,s,_)=>{Promise.resolve().then(_.t.bind(_,3953,23))}},e=>{e.O(0,[3953,1305,6823,7358],()=>e(e.s=75206)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7358],{52561:()=>{},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7358],{52561:()=>{},83377:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,75164,23)),Promise.resolve().then(n.t.bind(n,54941,23)),Promise.resolve().then(n.t.bind(n,6143,23)),Promise.resolve().then(n.t.bind(n,76004,23)),Promise.resolve().then(n.t.bind(n,18304,23)),Promise.resolve().then(n.t.bind(n,98584,23)),Promise.resolve().then(n.t.bind(n,72646,23)),Promise.resolve().then(n.t.bind(n,3181,23)),Promise.resolve().then(n.bind(n,56984))}},e=>{var s=s=>e(e.s=s);e.O(0,[1305,6823],()=>(s(39628),s(83377))),_N_E=e.O()}]);
|
package/app/apps/web/server.js
CHANGED
|
@@ -15,7 +15,7 @@ const currentPort = parseInt(process.env.PORT, 10) || 3000
|
|
|
15
15
|
const hostname = process.env.HOSTNAME || '0.0.0.0'
|
|
16
16
|
|
|
17
17
|
let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
|
|
18
|
-
const nextConfig = {"env":{},"eslint":{"ignoreDuringBuilds":false},"typescript":{"ignoreBuildErrors":true,"tsconfigPath":"tsconfig.json"},"typedRoutes":false,"distDir":"./.next-bundle","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":60,"formats":["image/webp"],"maximumResponseBody":50000000,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","remotePatterns":[],"unoptimized":true},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"amp":{"canonicalBase":""},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"serverRuntimeConfig":{},"publicRuntimeConfig":{},"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/private/tmp/panoma-0.10.
|
|
18
|
+
const nextConfig = {"env":{},"eslint":{"ignoreDuringBuilds":false},"typescript":{"ignoreBuildErrors":true,"tsconfigPath":"tsconfig.json"},"typedRoutes":false,"distDir":"./.next-bundle","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[16,32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":60,"formats":["image/webp"],"maximumResponseBody":50000000,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","remotePatterns":[],"unoptimized":true},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"amp":{"canonicalBase":""},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"serverRuntimeConfig":{},"publicRuntimeConfig":{},"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/private/tmp/panoma-0.10.3/","experimental":{"useSkewCookie":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":4294967294}},"cacheHandlers":{},"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"serverSourceMaps":false,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"clientSegmentCache":false,"clientParamParsing":false,"dynamicOnHover":false,"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","middlewarePrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":9,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"viewTransition":false,"routerBFCache":false,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":false,"staleTimes":{"dynamic":0,"static":300},"serverComponentsHmrCache":true,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"cacheComponents":false,"inlineCss":false,"useCache":false,"globalNotFound":true,"devtoolSegmentExplorer":true,"browserDebugInfoInTerminal":false,"optimizeRouterScrolling":false,"middlewareClientMaxBodySize":25165824,"optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","outputFileTracingIncludes":{"/**":["../../packages/db/dist/**","../../packages/db/migrations/**","../../packages/db/package.json","../../packages/apps/dist/**","../../packages/apps/package.json","../../node_modules/.pnpm/@electric-sql+pglite@*/node_modules/@electric-sql/pglite/dist/**","../../node_modules/.pnpm/@electric-sql+pglite@*/node_modules/@electric-sql/pglite/package.json","../../node_modules/.pnpm/drizzle-orm@*/node_modules/drizzle-orm/**","../../node_modules/.pnpm/next@15.5.25_@babel+core@7.29.7_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/*.js","../../node_modules/.pnpm/next@15.5.25_@babel+core@7.29.7_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/server/**","../../node_modules/.pnpm/next@15.5.25_@babel+core@7.29.7_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/client/**","../../node_modules/.pnpm/next@15.5.25_@babel+core@7.29.7_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/next/dist/shared/**"]},"outputFileTracingExcludes":{"/**":["**/node_modules/.pnpm/@img+*/**","**/node_modules/.pnpm/sharp@*/**","**/next/dist/esm/**"]},"transpilePackages":["@panoma/core","@panoma/db","@panoma/enrich","@panoma/runner","@panoma/ai","@panoma/apps","@panoma/handoff"],"turbopack":{"root":"/private/tmp/panoma-0.10.3/"}}
|
|
19
19
|
|
|
20
20
|
process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
|
|
21
21
|
|
|
@@ -37,9 +37,9 @@ case `uname -a` in
|
|
|
37
37
|
esac
|
|
38
38
|
|
|
39
39
|
if [ -z "$NODE_PATH" ]; then
|
|
40
|
-
export NODE_PATH="/private/tmp/panoma-0.10.
|
|
40
|
+
export NODE_PATH="/private/tmp/panoma-0.10.3/node_modules/.pnpm/gel@2.2.0/node_modules/gel/node_modules:/private/tmp/panoma-0.10.3/node_modules/.pnpm/gel@2.2.0/node_modules:/private/tmp/panoma-0.10.3/node_modules/.pnpm/node_modules"
|
|
41
41
|
else
|
|
42
|
-
export NODE_PATH="/private/tmp/panoma-0.10.
|
|
42
|
+
export NODE_PATH="/private/tmp/panoma-0.10.3/node_modules/.pnpm/gel@2.2.0/node_modules/gel/node_modules:/private/tmp/panoma-0.10.3/node_modules/.pnpm/gel@2.2.0/node_modules:/private/tmp/panoma-0.10.3/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
43
43
|
fi
|
|
44
44
|
if [ -n "$exe" ] && [ -x "$basedir/node.exe" ]; then
|
|
45
45
|
exec "$basedir/node.exe" "$basedir_win/../../../../../gel@2.2.0/node_modules/gel/dist/cli.mjs" "$@"
|
|
@@ -52,4 +52,4 @@ elif [ -n "$exe" ] && command -v node.exe >/dev/null 2>&1; then
|
|
|
52
52
|
else
|
|
53
53
|
exec node "$basedir/../../../../../gel@2.2.0/node_modules/gel/dist/cli.mjs" "$@"
|
|
54
54
|
fi
|
|
55
|
-
# cmd-shim-target=/private/tmp/panoma-0.10.
|
|
55
|
+
# cmd-shim-target=/private/tmp/panoma-0.10.3/node_modules/.pnpm/gel@2.2.0/node_modules/gel/dist/cli.mjs
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
appsFetch,
|
|
4
4
|
confirmApps,
|
|
5
5
|
followAppJob
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-U2FAFPLA.js";
|
|
7
|
+
import "./chunk-R3D5NBHW.js";
|
|
8
|
+
import "./chunk-CTWQQWH7.js";
|
|
9
9
|
import "./chunk-DITTKJ7U.js";
|
|
10
10
|
import "./chunk-3T3WTSPS.js";
|
|
11
11
|
import "./chunk-MLKGABMK.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
search
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FI2ZMO24.js";
|
|
4
4
|
import {
|
|
5
5
|
catalogFetch,
|
|
6
6
|
unreachable
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-R3D5NBHW.js";
|
|
8
8
|
import {
|
|
9
9
|
say
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CTWQQWH7.js";
|
|
11
11
|
import "./chunk-DITTKJ7U.js";
|
|
12
12
|
import "./chunk-3T3WTSPS.js";
|
|
13
13
|
import "./chunk-MLKGABMK.js";
|
|
@@ -146,6 +146,7 @@ var MESSAGES = {
|
|
|
146
146
|
"apps.job": "Job: {id}",
|
|
147
147
|
"apps.jobProgress": "{status} \xB7 {message}",
|
|
148
148
|
"apps.jobDone": "Job complete: {id}",
|
|
149
|
+
"apps.nothingNewer": "Nothing newer: {version} is the latest version the registry reports. If you just published one, run `panoma apps check` again in a moment, then update.",
|
|
149
150
|
"apps.jobFailed": "Job failed: {detail}",
|
|
150
151
|
"apps.jobDetached": "The job continues in the catalog: {id}",
|
|
151
152
|
"apps.requirement": "{name}: {status}",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
catalogFetch,
|
|
3
3
|
unreachable
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-R3D5NBHW.js";
|
|
5
5
|
import {
|
|
6
6
|
appFaultText,
|
|
7
7
|
say
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-CTWQQWH7.js";
|
|
9
9
|
|
|
10
10
|
// src/apps.ts
|
|
11
11
|
import { createInterface } from "readline/promises";
|
|
@@ -53,6 +53,11 @@ async function followAppJob(api, id, json, quiet = false) {
|
|
|
53
53
|
if (!quiet) process.stdout.write(json ? `${JSON.stringify(job, null, 2)}
|
|
54
54
|
` : `${say("apps.jobDone", { id })}
|
|
55
55
|
`);
|
|
56
|
+
const result = job.result;
|
|
57
|
+
if (!quiet && !json && result?.unchanged === true && typeof result.version === "string") {
|
|
58
|
+
process.stdout.write(`${say("apps.nothingNewer", { version: result.version })}
|
|
59
|
+
`);
|
|
60
|
+
}
|
|
56
61
|
return 0;
|
|
57
62
|
}
|
|
58
63
|
if (job.status === "cancelled") {
|