elanous 0.3.2 → 0.3.4
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/apps/pwa/out/404/index.html +1 -1
- package/apps/pwa/out/404.html +1 -1
- package/apps/pwa/out/_next/static/chunks/{280-f880696e14bc1032.js → 280-66f2ebc166517702.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/{5359-11952bdf39bae0c7.js → 5359-7aa498ded308ea17.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/approvals/{page-822c5395a88eb1e5.js → page-538c811d4da4d7b8.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/autopilot/page-32cb397d044bb5aa.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/board/page-02d148f66a3da6bb.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/botlab/page-42b7211f972c6001.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/bots/{page-d1cdb65c4ceb5c33.js → page-46bac74d4ce82733.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/ceo/page-10e7ee66dc7c3d8a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/chat/page-391a9ecbfb541e68.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/consult/{page-c5b8f3b77568a8e9.js → page-6b69baa42370ba35.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/control/{page-77db1e47b120b94e.js → page-58960a34c0fa8f97.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/decisions/{page-3048505d466ec98a.js → page-9b16ae10bbe63997.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/design-check/page-417a7b86f7eceeea.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/editor/{page-6a36535d413596b1.js → page-09f86a64836617b7.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/exec/page-cb640bac3150eb4c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/field/page-e80fc997e0c589d5.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/inside/page-173d296c2127560a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/intake/page-358c3e0c2ce7184c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/{layout-956789c8340e289e.js → layout-09c6e6033ddb1605.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/live/page-11a4763fe20fe116.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/live-run/page-e7e02e459ca54062.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/loops/{page-e911bcd2bfb5c305.js → page-b0c21fcb45c049d0.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/market/{page-52b55f54c9d8e0fb.js → page-f331955e0ca9bf84.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-c4c4b4333b24e505.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/morning/{page-afa5068541a55cd1.js → page-7cab7257602fe967.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/{not-found-3eb72a4f6788a903.js → not-found-a0dc43b385fba1b5.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/observatory/page-65ecf674fc5e9d19.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ops/checklist/{page-c9e4ca5025534239.js → page-d34cea406f837407.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/release/page-7d69cc10c33882b7.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ops/resources/{page-da8f855dc25cae3d.js → page-c2b69a4da710ccee.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-80adac335abc5070.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/outputs/page-10b7dbd205510a67.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/{page-f95beb047d743d09.js → page-5f3c9b795a225d8c.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/reflection/{page-3b0434a6fc1154e1.js → page-68ece02272941b6c.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/scheduler/{page-9deae0524ce7a7e2.js → page-21d4e1472f806b1e.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/sessions/{page-4f4f0858754f73a4.js → page-1156870631db0555.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-4fc726c790e6a7bf.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/settings/page-e0dc9ec9ac537906.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/setup/done/{page-2e8cc4d212f1ca01.js → page-83138c236444d7d5.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/page-61133c103b342d2b.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/share/{page-b8c0c73c2e5a8917.js → page-40cac04d8f4822c6.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-ecb7be39ce14845a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/tasks/{page-aedaede687cc293d.js → page-a288059ee8ed73fb.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/term/{page-bb5c95ce68358be2.js → page-31ed388024d4f660.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/today/page-29d28b05a7ddede3.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/trace/page-b39bdb4ce095ccfc.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/vault/{page-9a1cdd7c5a50bf73.js → page-ecbc7b9f31d195b7.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-059b94e88f91e73f.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workflows/page-ca29c405228c72b9.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workspace/page-ff99da4e3ff50503.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/worktrees/page-2aa0c6cdb2ef7ea8.js +1 -0
- package/apps/pwa/out/approvals/index.html +1 -1
- package/apps/pwa/out/approvals/index.txt +13 -13
- package/apps/pwa/out/autopilot/index.html +1 -1
- package/apps/pwa/out/autopilot/index.txt +13 -13
- package/apps/pwa/out/board/index.html +1 -1
- package/apps/pwa/out/board/index.txt +13 -13
- package/apps/pwa/out/botlab/index.html +1 -1
- package/apps/pwa/out/botlab/index.txt +13 -13
- package/apps/pwa/out/bots/index.html +1 -1
- package/apps/pwa/out/bots/index.txt +13 -13
- package/apps/pwa/out/ceo/index.html +1 -1
- package/apps/pwa/out/ceo/index.txt +13 -13
- package/apps/pwa/out/chat/index.html +1 -1
- package/apps/pwa/out/chat/index.txt +13 -13
- package/apps/pwa/out/consult/index.html +1 -1
- package/apps/pwa/out/consult/index.txt +13 -13
- package/apps/pwa/out/control/index.html +1 -1
- package/apps/pwa/out/control/index.txt +13 -13
- package/apps/pwa/out/decisions/index.html +1 -1
- package/apps/pwa/out/decisions/index.txt +13 -13
- package/apps/pwa/out/design-check/index.html +1 -1
- package/apps/pwa/out/design-check/index.txt +13 -13
- package/apps/pwa/out/editor/index.html +1 -1
- package/apps/pwa/out/editor/index.txt +13 -13
- package/apps/pwa/out/exec/index.html +1 -1
- package/apps/pwa/out/exec/index.txt +13 -13
- package/apps/pwa/out/field/index.html +1 -1
- package/apps/pwa/out/field/index.txt +13 -13
- package/apps/pwa/out/healthz +1 -1
- package/apps/pwa/out/index.html +1 -1
- package/apps/pwa/out/index.txt +13 -13
- package/apps/pwa/out/inside/index.html +1 -1
- package/apps/pwa/out/inside/index.txt +13 -13
- package/apps/pwa/out/intake/index.html +1 -1
- package/apps/pwa/out/intake/index.txt +13 -13
- package/apps/pwa/out/live/index.html +1 -1
- package/apps/pwa/out/live/index.txt +13 -13
- package/apps/pwa/out/live-run/index.html +1 -1
- package/apps/pwa/out/live-run/index.txt +13 -13
- package/apps/pwa/out/loops/index.html +1 -1
- package/apps/pwa/out/loops/index.txt +13 -13
- package/apps/pwa/out/market/index.html +1 -1
- package/apps/pwa/out/market/index.txt +13 -13
- package/apps/pwa/out/missions/placeholder/index.html +1 -1
- package/apps/pwa/out/missions/placeholder/index.txt +13 -13
- package/apps/pwa/out/morning/index.html +1 -1
- package/apps/pwa/out/morning/index.txt +13 -13
- package/apps/pwa/out/observatory/index.html +1 -1
- package/apps/pwa/out/observatory/index.txt +13 -13
- package/apps/pwa/out/ops/checklist/index.html +1 -1
- package/apps/pwa/out/ops/checklist/index.txt +13 -13
- package/apps/pwa/out/ops/release/index.html +1 -1
- package/apps/pwa/out/ops/release/index.txt +13 -13
- package/apps/pwa/out/ops/resources/index.html +1 -1
- package/apps/pwa/out/ops/resources/index.txt +13 -13
- package/apps/pwa/out/ops/seats/index.html +1 -1
- package/apps/pwa/out/ops/seats/index.txt +13 -13
- package/apps/pwa/out/outputs/index.html +1 -1
- package/apps/pwa/out/outputs/index.txt +13 -13
- package/apps/pwa/out/reflection/index.html +1 -1
- package/apps/pwa/out/reflection/index.txt +14 -14
- package/apps/pwa/out/scheduler/index.html +1 -1
- package/apps/pwa/out/scheduler/index.txt +13 -13
- package/apps/pwa/out/sessions/index.html +1 -1
- package/apps/pwa/out/sessions/index.txt +13 -13
- package/apps/pwa/out/settings/devices/index.html +1 -1
- package/apps/pwa/out/settings/devices/index.txt +13 -13
- package/apps/pwa/out/settings/index.html +1 -1
- package/apps/pwa/out/settings/index.txt +13 -13
- package/apps/pwa/out/setup/done/index.html +1 -1
- package/apps/pwa/out/setup/done/index.txt +13 -13
- package/apps/pwa/out/setup/index.html +1 -1
- package/apps/pwa/out/setup/index.txt +13 -13
- package/apps/pwa/out/share/index.html +1 -1
- package/apps/pwa/out/share/index.txt +13 -13
- package/apps/pwa/out/showroom/index.html +1 -1
- package/apps/pwa/out/showroom/index.txt +13 -13
- package/apps/pwa/out/tasks/index.html +1 -1
- package/apps/pwa/out/tasks/index.txt +13 -13
- package/apps/pwa/out/term/index.html +1 -1
- package/apps/pwa/out/term/index.txt +13 -13
- package/apps/pwa/out/today/index.html +1 -1
- package/apps/pwa/out/today/index.txt +13 -13
- package/apps/pwa/out/trace/index.html +1 -1
- package/apps/pwa/out/trace/index.txt +13 -13
- package/apps/pwa/out/vault/index.html +1 -1
- package/apps/pwa/out/vault/index.txt +13 -13
- package/apps/pwa/out/workflows/chat-ui/index.html +1 -1
- package/apps/pwa/out/workflows/chat-ui/index.txt +13 -13
- package/apps/pwa/out/workflows/index.html +1 -1
- package/apps/pwa/out/workflows/index.txt +13 -13
- package/apps/pwa/out/workspace/index.html +1 -1
- package/apps/pwa/out/workspace/index.txt +13 -13
- package/apps/pwa/out/worktrees/index.html +1 -1
- package/apps/pwa/out/worktrees/index.txt +13 -13
- package/graphs/natural-language-research.yaml +38 -0
- package/package.json +1 -1
- package/personas/botlab-4.yaml +8 -0
- package/src/acp/core-turn-bridge.ts +5 -0
- package/src/auto-research/research-turn.ts +120 -5
- package/src/cli/intake-source-cli.ts +9 -4
- package/src/cli/release-cli.ts +7 -2
- package/src/cli/setup-cli.ts +2 -2
- package/src/cli/setup-keys.ts +8 -5
- package/src/core-turn/run-core-turn.ts +93 -14
- package/src/dashboard/first-screen-band.ts +2 -6
- package/src/dashboard/index.ts +41 -13
- package/src/dashboard/plugin-wizard-runtime.ts +15 -1
- package/src/dashboard/plugin-wizard-tool.ts +16 -2
- package/src/dashboard/turn-preamble.ts +8 -0
- package/src/index.ts +26 -0
- package/src/intake-plane/actions.ts +20 -12
- package/src/intake-plane/intake-sources.ts +32 -11
- package/src/intake-plane/items.ts +1 -1
- package/src/mcp/server.ts +7 -2
- package/src/native-tool-catalog.ts +3 -0
- package/src/nexus/api/harness-api.ts +17 -2
- package/src/nexus/api/harness-traversal.ts +14 -4
- package/src/nexus/api/meta-api.ts +3 -1
- package/src/nexus/api/research-run-observer.ts +59 -0
- package/src/onboarding/first-run-doctor-test-control.ts +42 -0
- package/src/onboarding/first-run-doctor.ts +1 -0
- package/src/plugins/core/host.ts +12 -0
- package/src/prompt-library/session-guidance.ts +7 -6
- package/src/self-implement/orchestrator.ts +13 -0
- package/src/self-implement/run-ledger.ts +1 -1
- package/src/self-implement/run-step-projection.ts +10 -2
- package/src/session/chat.ts +2 -0
- package/src/session-runtime/index.ts +47 -5
- package/src/setup/service-key-catalog.ts +4 -2
- package/src/setup/service-keys.ts +34 -10
- package/src/terminal/coding-agent.ts +12 -1
- package/src/tool-hints/gate.ts +7 -3
- package/src/tool-hints/signals.ts +43 -1
- package/src/tool-runtime/browser-hand-runtime.ts +19 -9
- package/src/tool-runtime/elanous-linear-issue-runtime.ts +13 -3
- package/src/tui.ts +97 -4
- package/src/ux-sim/classic-tui-seat-scenarios.ts +54 -4
- package/src/ux-sim/mock-scenario-catalog.json +8 -3
- package/src/version/packed-revision.json +1 -1
- package/apps/pwa/out/_next/static/chunks/app/autopilot/page-9d7432ad7cb155ce.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/board/page-26941f067e899ed3.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/botlab/page-3c29b0e0d681e33d.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ceo/page-1224ce11e2a2eef5.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/chat/page-940b44876305fac2.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/design-check/page-8d97da172a2cd552.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/exec/page-8696a777c88bacc2.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/field/page-c4f1095489266f97.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/inside/page-ea374796ca2317b9.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/intake/page-111a4245428caa84.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/live/page-7645ef6d17d2314b.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/live-run/page-3448160192777209.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-6a904a7d1b3aee11.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/observatory/page-527a398eac0b4699.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/release/page-63c8938149254e9d.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-f48403ffee4c4b77.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/outputs/page-905013106f55daad.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-73857fa536e7c832.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/page-c0bdee145df0f6c9.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/page-fe67b4e66f496b3a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-2e8ed69b1a70c746.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/today/page-c6b096777f73c43a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/trace/page-45967d78c1748112.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-c54c8b957ebf94e2.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/page-9dc19aee0932542a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workspace/page-8f291522cb3d91a6.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/worktrees/page-52b36e1c8acd087f.js +0 -1
- /package/apps/pwa/out/_next/static/{5URFQKPO21SIgTlLvb1Jv → v4GHQkFrQs8lzZY_KFv9_}/_buildManifest.js +0 -0
- /package/apps/pwa/out/_next/static/{5URFQKPO21SIgTlLvb1Jv → v4GHQkFrQs8lzZY_KFv9_}/_ssgManifest.js +0 -0
|
@@ -4,6 +4,8 @@ export interface ServiceKeyCatalogEntry {
|
|
|
4
4
|
label: string;
|
|
5
5
|
kind: 'api-key' | 'subscription' | 'oauth' | 'cli' | 'local';
|
|
6
6
|
envNames: readonly string[];
|
|
7
|
+
/** Secret-store IDs read by the runtime consumer for this service. */
|
|
8
|
+
storeIds?: readonly string[];
|
|
7
9
|
setupUrl: string;
|
|
8
10
|
usedBy: string;
|
|
9
11
|
cost: 'account-plan' | 'usage-based' | 'plan-dependent' | 'local';
|
|
@@ -19,7 +21,7 @@ export const SERVICE_KEY_CATALOG: readonly ServiceKeyCatalogEntry[] = [
|
|
|
19
21
|
{ id: 'xai', label: 'xAI / Grok API', kind: 'api-key', envNames: ['XAI_API_KEY', 'GROK_API_KEY'], setupUrl: 'https://console.x.ai/', usedBy: '씬 2 흡수 · Grok API', cost: 'usage-based', verification: 'GET /v1/models · 상태 코드만', demoRequired: true },
|
|
20
22
|
{ id: 'tavily', label: 'Tavily', kind: 'api-key', envNames: ['TAVILY_API_KEY', 'TAVILY_KEY'], setupUrl: 'https://app.tavily.com/home', usedBy: '웹 검색 대체 경로', cost: 'usage-based', verification: 'POST /search · 상태 코드만', demoRequired: false },
|
|
21
23
|
{ id: 'openrouter', label: 'OpenRouter · GLM', kind: 'api-key', envNames: ['OPENROUTER_API_KEY'], setupUrl: 'https://openrouter.ai/keys', usedBy: 'GLM · OpenRouter 모델', cost: 'usage-based', verification: 'GET /api/v1/key · 상태 코드만', demoRequired: true },
|
|
22
|
-
{ id: 'linear', label: 'Linear API', kind: 'api-key', envNames: ['LINEAR_API_KEY'], setupUrl: 'https://linear.app/settings/api', usedBy: '씬 2 능동 비서', cost: 'plan-dependent', verification: 'GraphQL viewer · 상태 코드만', demoRequired: true },
|
|
24
|
+
{ id: 'linear', label: 'Linear API', kind: 'api-key', envNames: ['LINEAR_API_KEY'], storeIds: ['connector.linear.apiKey'], setupUrl: 'https://linear.app/settings/api', usedBy: '씬 2 능동 비서', cost: 'plan-dependent', verification: 'GraphQL viewer · 상태 코드만', demoRequired: true },
|
|
23
25
|
{ id: 'telegram', label: 'Telegram bot', kind: 'api-key', envNames: ['ELANOUS_TELEGRAM_BOT_TOKEN'], setupUrl: 'https://t.me/BotFather', usedBy: '씬 2 · 씬 3 채널', cost: 'local', verification: 'getMe · 상태 코드만', demoRequired: true },
|
|
24
26
|
{ id: 'telegram-chat', label: 'Telegram chat ID', kind: 'api-key', envNames: ['ELANOUS_TELEGRAM_CHAT_ID'], setupUrl: 'https://core.telegram.org/bots/features#botfather', usedBy: '데모 알림 대상', cost: 'local', verification: 'getChat · 상태 코드만 · 미발송', demoRequired: true },
|
|
25
27
|
{ id: 'google-workspace', label: 'Google Workspace', kind: 'oauth', envNames: [], setupUrl: 'https://developers.google.com/workspace/guides/get-started', usedBy: 'Gmail · Drive 커넥터', cost: 'account-plan', verification: '로그인 상태 확인 · 토큰 미표시', demoRequired: false },
|
|
@@ -41,6 +43,6 @@ export const SERVICE_KEY_CATALOG: readonly ServiceKeyCatalogEntry[] = [
|
|
|
41
43
|
] as const;
|
|
42
44
|
|
|
43
45
|
export function renderServiceKeyCatalogMarkdown(): string {
|
|
44
|
-
const rows = SERVICE_KEY_CATALOG.map(item => `| ${item.id} | ${item.label} | ${item.kind} | ${item.envNames.join(', ') || '로그인/설치'} | ${item.setupUrl} | ${item.cost} | ${item.usedBy} | ${item.verification} | ${item.demoRequired ? '씬 사용' : '선택'} |`);
|
|
46
|
+
const rows = SERVICE_KEY_CATALOG.map(item => `| ${item.id} | ${item.label} | ${item.kind} | ${[...item.envNames, ...(item.storeIds ?? [])].join(', ') || '로그인/설치'} | ${item.setupUrl} | ${item.cost} | ${item.usedBy} | ${item.verification} | ${item.demoRequired ? '씬 사용' : '선택'} |`);
|
|
45
47
|
return ['| id | 서비스 | 인증 | 환경 이름 | 설정 위치 | 비용 유형 | 사용처 | 최소 확인 | 판정 |', '|---|---|---|---|---|---|---|---|---|', ...rows].join('\n');
|
|
46
48
|
}
|
|
@@ -95,6 +95,10 @@ export interface ServiceKeyStatus {
|
|
|
95
95
|
label: string;
|
|
96
96
|
envNames: string[];
|
|
97
97
|
configured: boolean;
|
|
98
|
+
/** Names of sources that currently contain a usable value; secret values are never returned. */
|
|
99
|
+
sources: string[];
|
|
100
|
+
/** True when at least one secret-store source could not be checked. */
|
|
101
|
+
sourceCheckFailed: boolean;
|
|
98
102
|
kind: string;
|
|
99
103
|
}
|
|
100
104
|
|
|
@@ -113,20 +117,40 @@ function cachedValue(name: string, cacheDir: string): string | undefined {
|
|
|
113
117
|
} catch { return undefined; }
|
|
114
118
|
}
|
|
115
119
|
|
|
116
|
-
export function serviceKeyStatus(options: {
|
|
120
|
+
export async function serviceKeyStatus(options: {
|
|
117
121
|
env?: NodeJS.ProcessEnv;
|
|
118
122
|
cacheDir?: string;
|
|
119
|
-
|
|
123
|
+
getSecret?: (id: string) => Promise<string | undefined>;
|
|
124
|
+
} = {}): Promise<ServiceKeyStatus[]> {
|
|
120
125
|
const env = options.env ?? process.env;
|
|
121
126
|
const cacheDir = options.cacheDir ?? (process.env.ELANOUS_KEY_CACHE_DIR?.trim() || join(homedir(), '.cache'));
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
// Keep bare CLI startup independent of the NEXUS secret backend; load it
|
|
128
|
+
// only when explicit status inspection needs a secret-store entry.
|
|
129
|
+
const getSecret = options.getSecret ?? (async (id: string) => {
|
|
130
|
+
const { getSecretAsync } = await import('../nexus/config/secrets/index.js');
|
|
131
|
+
return getSecretAsync(id);
|
|
132
|
+
});
|
|
133
|
+
return Promise.all(SERVICE_KEY_CATALOG.map(async item => {
|
|
134
|
+
const envSources = item.envNames.filter(name => Boolean(env[name]?.trim()));
|
|
135
|
+
const cacheSources = item.storeIds?.length
|
|
136
|
+
? [] // A cached LINEAR_API_KEY is not one of the runtime credential sources.
|
|
137
|
+
: item.envNames.filter(name => Boolean(cachedValue(name, cacheDir))).map(name => `cache:${name}`);
|
|
138
|
+
const secretSources: string[] = [];
|
|
139
|
+
let sourceCheckFailed = false;
|
|
140
|
+
for (const id of item.storeIds ?? []) {
|
|
141
|
+
try { if ((await getSecret(id))?.trim()) secretSources.push(id); }
|
|
142
|
+
catch { sourceCheckFailed = true; }
|
|
143
|
+
}
|
|
144
|
+
const sources = [...envSources, ...cacheSources, ...secretSources];
|
|
145
|
+
return {
|
|
146
|
+
id: item.id,
|
|
147
|
+
label: item.label,
|
|
148
|
+
envNames: [...item.envNames],
|
|
149
|
+
kind: item.kind,
|
|
150
|
+
sources,
|
|
151
|
+
sourceCheckFailed,
|
|
152
|
+
configured: item.kind === 'api-key' && sources.length > 0,
|
|
153
|
+
};
|
|
130
154
|
}));
|
|
131
155
|
}
|
|
132
156
|
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
// not found"
|
|
15
15
|
|
|
16
16
|
import { spawnSync } from 'node:child_process';
|
|
17
|
+
import { resolve } from 'node:path';
|
|
17
18
|
import type { CodingAgentBrand, TerminalSession, TerminalSessionRegistry } from './session-registry.js';
|
|
18
19
|
import { wrapCommandForKeychainUnlock } from './keychain-unlock.js';
|
|
19
20
|
import { buildPtyEnv } from '../agent/identity-env.js';
|
|
@@ -76,7 +77,12 @@ export function spawnCodingAgent(
|
|
|
76
77
|
|
|
77
78
|
const cwdName = basenameSafe(opts.cwd);
|
|
78
79
|
const title = opts.title ?? `${opts.brand} [${cwdName}]`;
|
|
79
|
-
const extraArgs = opts.extraArgs ?? (opts.brand === 'grok' ? ['--always-approve'] :
|
|
80
|
+
const extraArgs = [...(opts.extraArgs ?? (opts.brand === 'grok' ? ['--always-approve'] : []))];
|
|
81
|
+
// Codex asks for workspace trust in a fresh worktree before it reads the mission.
|
|
82
|
+
// Scope trust to this absolute path via a CLI override; never mutate ~/.codex/config.toml.
|
|
83
|
+
if (opts.brand === 'codex') {
|
|
84
|
+
extraArgs.unshift('-c', shellQuote(`projects.${JSON.stringify(resolve(opts.cwd))}.trust_level="trusted"`));
|
|
85
|
+
}
|
|
80
86
|
const rawCommand = extraArgs && extraArgs.length > 0
|
|
81
87
|
? `${binary} ${extraArgs.join(' ')}`
|
|
82
88
|
: binary;
|
|
@@ -164,3 +170,8 @@ function basenameSafe(p: string): string {
|
|
|
164
170
|
const parts = p.split('/').filter(Boolean);
|
|
165
171
|
return parts[parts.length - 1] ?? p;
|
|
166
172
|
}
|
|
173
|
+
|
|
174
|
+
/** Quote one generated argument for the interactive shell command. */
|
|
175
|
+
function shellQuote(value: string): string {
|
|
176
|
+
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
177
|
+
}
|
package/src/tool-hints/gate.ts
CHANGED
|
@@ -199,14 +199,18 @@ export function evaluateGate(
|
|
|
199
199
|
const requiredResearchTools = signals.intentResearch
|
|
200
200
|
? ['web_search', 'web_fetch'].filter(id => enabled.has(id))
|
|
201
201
|
: [];
|
|
202
|
-
const
|
|
202
|
+
const requiredLinearTools = signals.intentLinearIssue && enabled.has('elanous_linear_issue')
|
|
203
|
+
? ['elanous_linear_issue']
|
|
204
|
+
: [];
|
|
205
|
+
const requiredTools = [...requiredResearchTools, ...requiredLinearTools];
|
|
206
|
+
const required = new Set(requiredTools);
|
|
203
207
|
const ranked = keep
|
|
204
208
|
.filter(id => !required.has(id))
|
|
205
209
|
.map(id => ({ id, score: boost.get(id) ?? 0 }))
|
|
206
210
|
.sort((a, b) => b.score - a.score || a.id.localeCompare(b.id))
|
|
207
|
-
.slice(0, Math.max(0, cap -
|
|
211
|
+
.slice(0, Math.max(0, cap - requiredTools.length))
|
|
208
212
|
.map(x => x.id);
|
|
209
|
-
keep = [...
|
|
213
|
+
keep = [...requiredTools, ...ranked];
|
|
210
214
|
const selectedBeforeStableSort = new Set(keep);
|
|
211
215
|
for (const id of enabled) {
|
|
212
216
|
if (!selectedBeforeStableSort.has(id)) excludedReasons.set(id, 'model-family-cap');
|
|
@@ -43,6 +43,8 @@ export interface SignalSnapshot {
|
|
|
43
43
|
/** Arc H follow-up — remote/fleet management intent (acp · agent
|
|
44
44
|
* room · iphone · budget · policy · llm nodes · team · hitl). */
|
|
45
45
|
intentOpsFleet: boolean;
|
|
46
|
+
/** Explicit Linear issue action; keeps the native issue tool in capped pools. */
|
|
47
|
+
intentLinearIssue?: boolean;
|
|
46
48
|
/** Arc H follow-up — local dashboard UI intent (windows · panes ·
|
|
47
49
|
* terminal matrix/modal · context inspector · layout · vw ·
|
|
48
50
|
* widget · scenario). */
|
|
@@ -146,6 +148,43 @@ export function isResearchAgentIntent(text: string | undefined): boolean {
|
|
|
146
148
|
return RESEARCH_SKILL_RE.test(text)
|
|
147
149
|
|| (RESEARCH_EXPLANATION_RE.test(text) && RESEARCH_TOPIC_RE.test(text));
|
|
148
150
|
}
|
|
151
|
+
|
|
152
|
+
const ORDERED_WORKFLOW_STEP_RE = /(?:\bfirst\b|\bthen\b|\bfinally\b|먼저|그\s*다음|다음으로|마지막(?:에|으로)?)/i;
|
|
153
|
+
const ORDERED_WORKFLOW_SPLIT_RE = /\b(?:first|then|finally|and)\b|먼저|그\s*다음|다음으로|마지막(?:에|으로)?|그리고|및/i;
|
|
154
|
+
const RESEARCH_STEP_RE = /\b(?:research|investigate|search)\b|리서치|조사|검색/i;
|
|
155
|
+
const NON_RESEARCH_STEP_ACTIONS = [
|
|
156
|
+
/\b(?:send|email|message)\s+(?:(?:an?|the)\s+)?(?:e-?mail|message|issue|ticket|report|post)\b/i,
|
|
157
|
+
/\b(?:deploy|restart|reboot|start|stop|install|launch|publish|register|schedule|book|submit|delete|remove|update|change|modify)\b/i,
|
|
158
|
+
/\b(?:capture|screenshot|take)\s+(?:(?:an?|the)\s+)?(?:screenshot|aside|browser|page|screen)\b/i,
|
|
159
|
+
/\b(?:aside|browser|page|screen)\b.{0,20}\b(?:capture|screenshot)\b/i,
|
|
160
|
+
/\b(?:create|open|file|submit|update|close)\s+(?:(?:an?|the)\s+)?(?:linear\s+)?(?:issue|ticket)\b/i,
|
|
161
|
+
/(?:리니어|linear).{0,18}(?:이슈|issue|ticket).{0,12}(?:만들|생성|열|등록|추가)|(?:만들|생성|열|등록|추가).{0,12}(?:리니어|linear).{0,18}(?:이슈|issue|ticket)/i,
|
|
162
|
+
/(?:이메일|메일).{0,12}(?:보내|발송)|(?:보내|발송).{0,12}(?:이메일|메일)/,
|
|
163
|
+
/(?:캡처|촬영).{0,12}(?:aside|화면|브라우저|페이지)|(?:aside|브라우저|페이지).{0,12}(?:캡처|촬영)/i,
|
|
164
|
+
/(?:배포|재시작|다시\s*시작|중지|설치|실행|등록)/,
|
|
165
|
+
];
|
|
166
|
+
const LINEAR_ISSUE_ASCII_RE = /\b(?:linear|linear\.app)\b.{0,48}(?:\b(?:issue|ticket)\b|이슈|티켓).{0,32}(?:\b(?:create|open|file|make)\b|만들|생성|작성|등록|열어)|\b(?:create|open|file|make)\b.{0,32}\b(?:a\s+)?linear\s+(?:issue|ticket)\b/i;
|
|
167
|
+
const LINEAR_ISSUE_KO_RE = /리니어.{0,24}(?:이슈|티켓).{0,16}(?:만들|생성|작성|등록|열어)/;
|
|
168
|
+
|
|
169
|
+
/** Keep ordered operational workflows on the normal tool pool even when they mention research. */
|
|
170
|
+
export function isOrderedNonResearchWorkflow(text: string | undefined): boolean {
|
|
171
|
+
if (!text || !ORDERED_WORKFLOW_STEP_RE.test(text)) return false;
|
|
172
|
+
return text.split(ORDERED_WORKFLOW_SPLIT_RE)
|
|
173
|
+
.some((step) => !RESEARCH_STEP_RE.test(step) && NON_RESEARCH_STEP_ACTIONS.some((pattern) => pattern.test(step)));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** An ordered Linear action needs its native tool before any later stage. */
|
|
177
|
+
export function isOrderedLinearIssueStep(text: string | undefined): boolean {
|
|
178
|
+
if (!text || !ORDERED_WORKFLOW_STEP_RE.test(text)) return false;
|
|
179
|
+
return /(?:\blinear\b|리니어)/i.test(text)
|
|
180
|
+
&& /(?:\bissue\b|\bticket\b|이슈|티켓)/i.test(text)
|
|
181
|
+
&& /(?:\bcreate\b|\bopen\b|\bfile\b|\bmake\b|만들|생성|작성|등록|열어)/i.test(text);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** Mixed ordered issue-creation plus research must keep both native and research routes. */
|
|
185
|
+
export function isOrderedLinearResearchWorkflow(text: string | undefined): boolean {
|
|
186
|
+
return isOrderedLinearIssueStep(text) && isResearchAgentIntent(text);
|
|
187
|
+
}
|
|
149
188
|
const DIAGRAM_ASCII_RE = /\b(diagrams?|flowcharts?|sequence|mermaid|graphs?|charts?|visuali[sz]e|architecture)\b/i;
|
|
150
189
|
const DIAGRAM_KO_RE = /(시퀀스|플로우|다이어그램|도식|그래프|시각화|아키텍처|구조도)/;
|
|
151
190
|
|
|
@@ -254,7 +293,9 @@ export function collectSignals(ctx: SignalContext = {}): SignalSnapshot {
|
|
|
254
293
|
&& (CODING_ASCII_RE.test(ctx.recentUserText) || koCodingIntent(ctx.recentUserText)),
|
|
255
294
|
intentViz: matchesIntent(ctx.recentUserText, VIZ_ASCII_RE, VIZ_KO_RE),
|
|
256
295
|
intentCapture: matchesIntent(ctx.recentUserText, CAPTURE_ASCII_RE, CAPTURE_KO_RE),
|
|
257
|
-
intentOpsFleet: matchesIntent(ctx.recentUserText, OPS_FLEET_ASCII_RE, OPS_FLEET_KO_RE)
|
|
296
|
+
intentOpsFleet: matchesIntent(ctx.recentUserText, OPS_FLEET_ASCII_RE, OPS_FLEET_KO_RE)
|
|
297
|
+
|| matchesIntent(ctx.recentUserText, LINEAR_ISSUE_ASCII_RE, LINEAR_ISSUE_KO_RE),
|
|
298
|
+
intentLinearIssue: matchesIntent(ctx.recentUserText, LINEAR_ISSUE_ASCII_RE, LINEAR_ISSUE_KO_RE),
|
|
258
299
|
intentOpsUi: matchesIntent(ctx.recentUserText, OPS_UI_ASCII_RE, OPS_UI_KO_RE),
|
|
259
300
|
|
|
260
301
|
modelFamily: ctx.modelFamily,
|
|
@@ -330,6 +371,7 @@ function fingerprintOf(s: SignalSnapshot): string {
|
|
|
330
371
|
s.intentViz ? 'viz' : '-',
|
|
331
372
|
s.intentCapture ? 'capture' : '-',
|
|
332
373
|
s.intentOpsFleet ? 'ops-fleet' : '-',
|
|
374
|
+
s.intentLinearIssue ? 'linear-issue' : '-',
|
|
333
375
|
s.intentOpsUi ? 'ops-ui' : '-',
|
|
334
376
|
].join('|');
|
|
335
377
|
return createHash('sha1').update(pieces).digest('hex').slice(0, 12);
|
|
@@ -109,7 +109,7 @@ function blockedKind(value: string | undefined): 'login' | 'paywall' | undefined
|
|
|
109
109
|
function isBrowserSessionUnavailableError(error: unknown): boolean {
|
|
110
110
|
if (!(error instanceof Error)) return false;
|
|
111
111
|
if (['CdpUnavailable', 'AsideSessionUnavailableError', 'BrowserSessionUnavailableError'].includes(error.name)) return true;
|
|
112
|
-
return /^aside\s+session\
|
|
112
|
+
return /^aside\s+session\s+(?:is\s+)?(?:unavailable|disconnected|closed|refused|timed?\s*out)\b/i.test(error.message);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
function failureBlockKind(action: BrowserActionResult): 'login' | 'paywall' | 'session' | undefined {
|
|
@@ -157,6 +157,7 @@ function recordRepairNode(node: BrowserHandRepairNode, deps: BrowserHandDeps): v
|
|
|
157
157
|
|
|
158
158
|
function createRepairNode(input: {
|
|
159
159
|
block: 'login' | 'paywall' | 'session';
|
|
160
|
+
failureReason?: string;
|
|
160
161
|
sourceUrl: string;
|
|
161
162
|
detourUrl: string;
|
|
162
163
|
outcome: 'detoured' | 'detour-failed';
|
|
@@ -174,7 +175,7 @@ function createRepairNode(input: {
|
|
|
174
175
|
kind: 'hand' as const,
|
|
175
176
|
decider: 'browser-hand' as const,
|
|
176
177
|
reason: input.block === 'session'
|
|
177
|
-
?
|
|
178
|
+
? `browser session unavailable${input.failureReason ? ` (${input.failureReason})` : ''}; one alternate source checked`
|
|
178
179
|
: `${input.block} blocked source; one alternate source checked`,
|
|
179
180
|
who: 'Elanous' as const,
|
|
180
181
|
what: input.outcome === 'detoured' ? `Continue browser work from ${input.detourUrl}` : 'Stop after blocked browser source',
|
|
@@ -273,7 +274,9 @@ export async function dispatchBrowserHand(args: BrowserHandArgs, _ctx?: ToolRunt
|
|
|
273
274
|
url: actionUrl,
|
|
274
275
|
target,
|
|
275
276
|
reason: sessionUnavailable ? 'load-unavailable' as const : 'execution-failed' as const,
|
|
276
|
-
error: sessionUnavailable
|
|
277
|
+
error: sessionUnavailable
|
|
278
|
+
? (error instanceof Error ? error.message : String(error))
|
|
279
|
+
: 'browser action failed',
|
|
277
280
|
};
|
|
278
281
|
}
|
|
279
282
|
};
|
|
@@ -307,17 +310,24 @@ export async function dispatchBrowserHand(args: BrowserHandArgs, _ctx?: ToolRunt
|
|
|
307
310
|
let action = await runBrowserAction(actionUrl);
|
|
308
311
|
if (!action.ok && !blocked) {
|
|
309
312
|
block = failureBlockKind(action);
|
|
313
|
+
const failureReason = block === 'session' ? action.reason : undefined;
|
|
310
314
|
const alternate = args.alternateUrl?.trim() ?? '';
|
|
311
315
|
let alternateParsed: URL | undefined;
|
|
312
316
|
try { alternateParsed = new URL(alternate); } catch { /* no valid fallback */ }
|
|
313
317
|
let alternateText: string | undefined;
|
|
314
|
-
|
|
315
|
-
&& decideActionBoundary({ hosts: persona.actionHosts, url: alternate, href: null }).allowed
|
|
318
|
+
const alternateAllowed = !!block && !!alternateParsed && ['http:', 'https:'].includes(alternateParsed.protocol)
|
|
319
|
+
&& decideActionBoundary({ hosts: persona.actionHosts, url: alternate, href: null }).allowed;
|
|
320
|
+
if (alternateAllowed) {
|
|
316
321
|
try { alternateText = await inspect(alternate, pagePort); } catch { /* unknown is allowed after an explicit login/paywall error */ }
|
|
317
322
|
}
|
|
318
|
-
if (block &&
|
|
319
|
-
|
|
320
|
-
|
|
323
|
+
if (block === 'session' && alternateAllowed && !blockedKind(alternateText)) {
|
|
324
|
+
// A session loss selects the production hand adapter (BrowserHand on the
|
|
325
|
+
// explicitly allowlisted alternate); ordinary action errors never enter here.
|
|
326
|
+
action = await runBrowserAction(alternate);
|
|
327
|
+
blocked = true;
|
|
328
|
+
actionUrl = alternate;
|
|
329
|
+
detoured = true;
|
|
330
|
+
} else if (block && alternateAllowed && !blockedKind(alternateText)) {
|
|
321
331
|
blocked = true;
|
|
322
332
|
actionUrl = alternate;
|
|
323
333
|
action = await runBrowserAction(actionUrl);
|
|
@@ -326,7 +336,7 @@ export async function dispatchBrowserHand(args: BrowserHandArgs, _ctx?: ToolRunt
|
|
|
326
336
|
blocked = true;
|
|
327
337
|
}
|
|
328
338
|
if (block) {
|
|
329
|
-
repairNode = createRepairNode({ block, sourceUrl: url, detourUrl: detoured ? alternate : '', outcome: detoured && action.ok ? 'detoured' : 'detour-failed', issueId, deps });
|
|
339
|
+
repairNode = createRepairNode({ block, ...(failureReason ? { failureReason } : {}), sourceUrl: url, detourUrl: detoured ? alternate : '', outcome: detoured && action.ok ? 'detoured' : 'detour-failed', issueId, deps });
|
|
330
340
|
recordRepairNode(repairNode, deps);
|
|
331
341
|
}
|
|
332
342
|
}
|
|
@@ -2,16 +2,18 @@ import { debug } from '../debug/log.js';
|
|
|
2
2
|
import { commentLinearIssue, createLinearTeamIssue, moveLinearIssueToStateType } from '../connectors/linear.js';
|
|
3
3
|
import { getSecretAsync } from '../nexus/config/secrets/index.js';
|
|
4
4
|
import type { LLMToolSpec } from '../llm.js';
|
|
5
|
+
import { getUserConfig } from '../user-config.js';
|
|
5
6
|
import type { ToolRuntime, ToolRuntimeContext } from './types.js';
|
|
6
7
|
|
|
7
8
|
export type ElanousLinearIssueArgs =
|
|
8
|
-
| { action: 'create'; teamKey
|
|
9
|
+
| { action: 'create'; teamKey?: string; title: string; description?: string }
|
|
9
10
|
| { action: 'comment'; issueId: string; body: string }
|
|
10
11
|
| { action: 'complete'; issueId: string };
|
|
11
12
|
export interface ElanousLinearIssueResult extends Record<string, unknown> { ok: boolean; output: string }
|
|
12
13
|
|
|
13
14
|
type Deps = {
|
|
14
15
|
getApiKey?: (id: string) => Promise<string | undefined>;
|
|
16
|
+
getConfig?: () => Record<string, unknown>;
|
|
15
17
|
create?: typeof createLinearTeamIssue;
|
|
16
18
|
comment?: typeof commentLinearIssue;
|
|
17
19
|
complete?: typeof moveLinearIssueToStateType;
|
|
@@ -29,7 +31,7 @@ export function createElanousLinearIssueRuntime(deps: Deps = {}): ToolRuntime<El
|
|
|
29
31
|
type: 'object',
|
|
30
32
|
properties: {
|
|
31
33
|
action: { type: 'string', enum: ['create', 'comment', 'complete'] },
|
|
32
|
-
teamKey: { type: 'string', description: '
|
|
34
|
+
teamKey: { type: 'string', description: 'Optional for create; defaults to connector.linear.team or connector.linear.teamKey.' },
|
|
33
35
|
title: { type: 'string', description: 'Required only for create.' },
|
|
34
36
|
description: { type: 'string', description: 'Optional create description.' },
|
|
35
37
|
issueId: { type: 'string', description: 'Required for comment and complete.' },
|
|
@@ -45,7 +47,15 @@ export function createElanousLinearIssueRuntime(deps: Deps = {}): ToolRuntime<El
|
|
|
45
47
|
const fetch = deps.fetch ?? globalThis.fetch;
|
|
46
48
|
try {
|
|
47
49
|
if (args?.action === 'create') {
|
|
48
|
-
const
|
|
50
|
+
const connector = (deps.getConfig ?? (() => getUserConfig().raw))().connector;
|
|
51
|
+
const linear = connector && typeof connector === 'object'
|
|
52
|
+
? (connector as Record<string, unknown>).linear
|
|
53
|
+
: undefined;
|
|
54
|
+
const linearConfig = linear && typeof linear === 'object' ? linear as Record<string, unknown> : {};
|
|
55
|
+
const configuredTeam = [linearConfig.team, linearConfig.teamKey]
|
|
56
|
+
.find((value): value is string => typeof value === 'string' && value.trim().length > 0);
|
|
57
|
+
const explicitTeam = typeof args.teamKey === 'string' ? args.teamKey.trim() : '';
|
|
58
|
+
const teamKey = explicitTeam || (typeof configuredTeam === 'string' ? configuredTeam.trim() : '');
|
|
49
59
|
const title = typeof args.title === 'string' ? args.title.trim() : '';
|
|
50
60
|
if (!teamKey || !title) return { ok: false, output: 'Linear issue 생성에는 teamKey와 title이 필요합니다.' };
|
|
51
61
|
const issueId = await (deps.create ?? createLinearTeamIssue)({ apiKey, teamKey, title,
|
package/src/tui.ts
CHANGED
|
@@ -445,7 +445,27 @@ let _cancelReadKey: (() => void) | undefined;
|
|
|
445
445
|
/** TUI-SIGTTIN-SUSPEND — stops the tty-foreground guard (src/tty-foreground.ts). */
|
|
446
446
|
let _stopForegroundGuard: (() => void) | undefined;
|
|
447
447
|
|
|
448
|
+
/**
|
|
449
|
+
* TUI-CONSOLE-ERROR-LEAK (0.3.3 · 11-04 대표 라이브 실물) — 화면을 TUI 가 쥔 동안 console.error·warn 이
|
|
450
|
+
* 그대로 터미널에 쓰여 하단이 깨졌다([outbound] 폴백·Codex 회전 알림). 그 구간에는 로그로만 보내고 cleanup 에서 원복한다.
|
|
451
|
+
*/
|
|
452
|
+
let _restoreConsole: (() => void) | undefined;
|
|
453
|
+
export function muteConsoleWhileTui(target: Pick<Console, 'error' | 'warn'> = console): () => void {
|
|
454
|
+
const origError = target.error;
|
|
455
|
+
const origWarn = target.warn;
|
|
456
|
+
const route = (kind: 'error' | 'warn') => (...args: unknown[]): void => {
|
|
457
|
+
try {
|
|
458
|
+
debug.log('tui.console', kind, { text: args.map(a => (a instanceof Error ? a.message : String(a))).join(' ').slice(0, 2000) });
|
|
459
|
+
} catch { /* 로그 실패가 화면을 깨지 않는다 */ }
|
|
460
|
+
};
|
|
461
|
+
target.error = route('error') as typeof console.error;
|
|
462
|
+
target.warn = route('warn') as typeof console.warn;
|
|
463
|
+
return () => { target.error = origError; target.warn = origWarn; };
|
|
464
|
+
}
|
|
465
|
+
|
|
448
466
|
function cleanup(): void {
|
|
467
|
+
_restoreConsole?.();
|
|
468
|
+
_restoreConsole = undefined;
|
|
449
469
|
_stopForegroundGuard?.();
|
|
450
470
|
_stopForegroundGuard = undefined;
|
|
451
471
|
resetRenderCache();
|
|
@@ -537,6 +557,7 @@ export function initTui(altScreen = true): void {
|
|
|
537
557
|
// this is safe to turn on globally. Cleanup in `cleanup()` writes
|
|
538
558
|
// the matching "off" sequences.
|
|
539
559
|
process.stdout.write(ansi.mouseOn + ansi.pasteOn + ansi.kittyKbOn + ansi.modKeysOn);
|
|
560
|
+
_restoreConsole ??= muteConsoleWhileTui();
|
|
540
561
|
if (altScreen) {
|
|
541
562
|
process.stdout.write(ansi.altOn + ansi.hideCursor);
|
|
542
563
|
_alt = true;
|
|
@@ -1081,6 +1102,9 @@ export interface RenderOptions {
|
|
|
1081
1102
|
/** Absolute-positioned draw commands emitted after changed base rows.
|
|
1082
1103
|
* Used for modal overlays so the whole frame flushes as one write. */
|
|
1083
1104
|
overlay?: string;
|
|
1105
|
+
/** Modal cells are painted by `overlay`; base-row updates must leave
|
|
1106
|
+
* these columns resident so an uncovered frame never exposes the base. */
|
|
1107
|
+
preserveBounds?: { row: number; col: number; width: number; height: number };
|
|
1084
1108
|
/** Drop the cached frame and repaint every row. Use after resize or
|
|
1085
1109
|
* when an overlay closes and the covered rows must be restored. */
|
|
1086
1110
|
force?: boolean;
|
|
@@ -1137,18 +1161,38 @@ export function render(lines: string[], opts: RenderOptions = {}): void {
|
|
|
1137
1161
|
const { rows, cols } = termSize();
|
|
1138
1162
|
const resized = rows !== _lastFrameRows || cols !== _lastFrameCols;
|
|
1139
1163
|
const force = opts.force || resized || _lastFrameLines.length === 0;
|
|
1164
|
+
const preserveBounds = opts.preserveBounds;
|
|
1140
1165
|
const maxRows = Math.max(0, rows);
|
|
1141
1166
|
const lineCount = Math.min(lines.length, maxRows);
|
|
1142
1167
|
const dirtyRows = Math.max(lineCount, Math.min(_lastFrameLines.length, maxRows));
|
|
1143
1168
|
|
|
1144
|
-
|
|
1169
|
+
// A forced dashboard repaint still keeps an active modal's cells intact:
|
|
1170
|
+
// its overlay is appended below in this same write. Once the modal closes,
|
|
1171
|
+
// preserveBounds is absent and the normal full reset restores the base.
|
|
1172
|
+
let buf = force && !preserveBounds
|
|
1173
|
+
? (ansi.hideCursor + ansi.moveTo(1, 1) + ansi.eraseDown)
|
|
1174
|
+
: ansi.hideCursor;
|
|
1145
1175
|
for (let i = 0; i < dirtyRows; i++) {
|
|
1146
1176
|
const next = i < lineCount ? lines[i]! : '';
|
|
1147
1177
|
const prev = _lastFrameLines[i] ?? '';
|
|
1148
1178
|
if (force || next !== prev) {
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1179
|
+
const bounds = preserveBounds;
|
|
1180
|
+
const row = i + 1;
|
|
1181
|
+
if (bounds && row >= bounds.row && row < bounds.row + bounds.height) {
|
|
1182
|
+
const leftWidth = Math.max(0, bounds.col - 1);
|
|
1183
|
+
const rightStart = Math.max(0, bounds.col - 1 + bounds.width);
|
|
1184
|
+
const rightWidth = Math.max(0, cols - rightStart);
|
|
1185
|
+
const left = padAnsiToColumns(sliceAnsiByColumns(next, 0, leftWidth), leftWidth);
|
|
1186
|
+
const right = padAnsiToColumns(sliceAnsiByColumns(next, rightStart, rightStart + rightWidth), rightWidth);
|
|
1187
|
+
// Update only visible base columns. The popup overlay is appended
|
|
1188
|
+
// below and paints the preserved middle cells last in this frame.
|
|
1189
|
+
if (leftWidth > 0) buf += ansi.moveTo(row, 1) + left;
|
|
1190
|
+
if (rightWidth > 0) buf += ansi.moveTo(row, rightStart + 1) + right;
|
|
1191
|
+
} else {
|
|
1192
|
+
// Clear only rows that changed. tmux shows full-screen erase/repaint
|
|
1193
|
+
// as visible flicker, so keep unchanged rows resident.
|
|
1194
|
+
buf += ansi.moveTo(row, 1) + ansi.clearLine + next;
|
|
1195
|
+
}
|
|
1152
1196
|
}
|
|
1153
1197
|
}
|
|
1154
1198
|
if (opts.overlay) buf += opts.overlay;
|
|
@@ -1197,6 +1241,55 @@ export function stripAnsi(s: string): string {
|
|
|
1197
1241
|
return s.replace(/\x1b\[[0-9;]*m/g, '');
|
|
1198
1242
|
}
|
|
1199
1243
|
|
|
1244
|
+
/** Return an ANSI SGR-preserving slice by terminal columns. Wide graphemes
|
|
1245
|
+
* crossing a slice edge become spaces so the neighboring overlay keeps
|
|
1246
|
+
* ownership of those cells. */
|
|
1247
|
+
export function sliceAnsiByColumns(text: string, start: number, end: number): string {
|
|
1248
|
+
const lo = Math.max(0, start);
|
|
1249
|
+
const hi = Math.max(lo, end);
|
|
1250
|
+
const sgr = /\x1b\[[0-9;]*m/g;
|
|
1251
|
+
let out = '';
|
|
1252
|
+
let activeSgr = '';
|
|
1253
|
+
let offset = 0;
|
|
1254
|
+
let column = 0;
|
|
1255
|
+
let started = false;
|
|
1256
|
+
let match: RegExpExecArray | null;
|
|
1257
|
+
const appendText = (chunk: string): void => {
|
|
1258
|
+
for (const grapheme of graphemeSegments(chunk)) {
|
|
1259
|
+
const width = Math.max(0, visibleWidth(grapheme));
|
|
1260
|
+
const nextColumn = column + width;
|
|
1261
|
+
const overlapStart = Math.max(column, lo);
|
|
1262
|
+
const overlapEnd = Math.min(nextColumn, hi);
|
|
1263
|
+
if (overlapEnd > overlapStart) {
|
|
1264
|
+
if (!started) {
|
|
1265
|
+
out += activeSgr;
|
|
1266
|
+
started = true;
|
|
1267
|
+
}
|
|
1268
|
+
out += overlapStart === column && overlapEnd === nextColumn
|
|
1269
|
+
? grapheme
|
|
1270
|
+
: ' '.repeat(overlapEnd - overlapStart);
|
|
1271
|
+
}
|
|
1272
|
+
column = nextColumn;
|
|
1273
|
+
}
|
|
1274
|
+
};
|
|
1275
|
+
while ((match = sgr.exec(text)) !== null) {
|
|
1276
|
+
if (column >= hi) break;
|
|
1277
|
+
if (match.index > offset) appendText(text.slice(offset, match.index));
|
|
1278
|
+
const sequence = match[0];
|
|
1279
|
+
if (sequence === '\x1b[m' || sequence === '\x1b[0m') activeSgr = '';
|
|
1280
|
+
else activeSgr += sequence;
|
|
1281
|
+
if (started) out += sequence;
|
|
1282
|
+
offset = match.index + sequence.length;
|
|
1283
|
+
}
|
|
1284
|
+
if (column < hi && offset < text.length) appendText(text.slice(offset));
|
|
1285
|
+
if (started && activeSgr) out += '\x1b[0m';
|
|
1286
|
+
return out;
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
function padAnsiToColumns(text: string, width: number): string {
|
|
1290
|
+
return text + ' '.repeat(Math.max(0, width - visibleWidth(text)));
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1200
1293
|
/**
|
|
1201
1294
|
* Calculate visible terminal width of a string.
|
|
1202
1295
|
* Handles ANSI codes (0 width), CJK / fullwidth chars (2 width),
|
|
@@ -27,6 +27,7 @@ import { spawnSync } from 'node:child_process';
|
|
|
27
27
|
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
|
|
28
28
|
import { join, resolve } from 'node:path';
|
|
29
29
|
import { openMsgStore } from '../msg/msg-store.js';
|
|
30
|
+
import { resolveInstance } from '../instance/resolve.js';
|
|
30
31
|
import { SEAT_MEMORY_RECALL_MAX_CHARS, SEAT_MEMORY_RECALL_PREFIX } from '../dashboard/seat-boot-preamble.js';
|
|
31
32
|
import { AUTOHEAL_MAX_ATTEMPTS } from '../self-health/autoheal.js';
|
|
32
33
|
import { mockSeatPtySequence, type SeatPtySequenceEvidence, type SeatPtyStep } from './mock-seat-pty-sequence.js';
|
|
@@ -37,7 +38,7 @@ import {
|
|
|
37
38
|
import { pasteFoldToken } from '../chat/paste-fold.js';
|
|
38
39
|
import { bracketedPaste, CLIP_TEXT, GOAL_CONTINUE_PLEDGE_REPLY, GOAL_INTERIM_NOT_DONE_REPLY, GOAL_INTERIM_TOOL_CALL, goalInterimScreenCounts, INTERNAL_TURN_USER_HEADER, clipboardShimPath, PASTE_LONG, PASTE_LONG_TOKEN, PASTE_SHORT, parseData, readLogs } from './next-tui-seat-scenarios.js';
|
|
39
40
|
|
|
40
|
-
export const CLASSIC_TUI_SCENARIOS = ['classic-400-heal', 'classic-400-exhausted', 'classic-seat-boot', 'classic-typing-lag', 'classic-mcp-calltool', 'classic-wakeup', 'classic-goal-continue', 'classic-goal-interim', 'classic-paste', 'classic-orphan-autostop'] as const;
|
|
41
|
+
export const CLASSIC_TUI_SCENARIOS = ['classic-first-screen-noise', 'classic-400-heal', 'classic-400-exhausted', 'classic-seat-boot', 'classic-typing-lag', 'classic-mcp-calltool', 'classic-wakeup', 'classic-goal-continue', 'classic-goal-interim', 'classic-paste', 'classic-orphan-autostop'] as const;
|
|
41
42
|
export type ClassicTuiScenario = (typeof CLASSIC_TUI_SCENARIOS)[number];
|
|
42
43
|
|
|
43
44
|
export interface ClassicTuiScenarioSpec {
|
|
@@ -115,7 +116,7 @@ const AUTOHEAL_CAP = AUTOHEAL_MAX_ATTEMPTS;
|
|
|
115
116
|
|
|
116
117
|
type Row = { category?: string; event?: string; data?: unknown };
|
|
117
118
|
|
|
118
|
-
const classicReady = (s: string) => s.includes('elanous | daemon') && s.includes('실행 ') && s.includes('❯');
|
|
119
|
+
const classicReady = (s: string) => (s.includes('elanous | daemon') || s.includes('Opening web setup…') || s.includes('웹 화면을 여는 중…')) && s.includes('실행 ') && s.includes('❯');
|
|
119
120
|
const turnDone = (s: string) => /✔ 완료|✘ 실패/.test(s);
|
|
120
121
|
|
|
121
122
|
type CapturedRequest = { messages: Array<{ role: string; content: string | null }> };
|
|
@@ -141,7 +142,9 @@ function onlyFake(rows: Row[]): boolean {
|
|
|
141
142
|
export async function runClassicTuiScenario(spec: ClassicTuiScenarioSpec): Promise<ClassicTuiScenarioResult> {
|
|
142
143
|
const root = resolve(spec.root);
|
|
143
144
|
mkdirSync(root, { recursive: true });
|
|
144
|
-
|
|
145
|
+
if (spec.scenario !== 'classic-first-screen-noise') {
|
|
146
|
+
writeFileSync(join(root, 'config.json'), JSON.stringify({ onboarding: { completed: true }, errorReports: { enabled: false } }));
|
|
147
|
+
}
|
|
145
148
|
const env: Record<string, string> = {
|
|
146
149
|
ELANOUS_SESSION_ROOT: join(root, 'sessions'),
|
|
147
150
|
[TEST_FAKE_LLM_ENV]: '1',
|
|
@@ -155,7 +158,9 @@ export async function runClassicTuiScenario(spec: ClassicTuiScenarioSpec): Promi
|
|
|
155
158
|
rows: 30,
|
|
156
159
|
cols: 100,
|
|
157
160
|
...(spec.expectedBinarySha256 ? { expectedBinarySha256: spec.expectedBinarySha256 } : {}),
|
|
158
|
-
ready:
|
|
161
|
+
ready: spec.scenario === 'classic-first-screen-noise'
|
|
162
|
+
? { label: 'first-run provider chooser', until: (screen: string) => screen.includes('처음 실행 LLM 설정') && screen.includes('선택:'), timeoutMs: 90_000 }
|
|
163
|
+
: { label: 'boot', until: classicReady, timeoutMs: 90_000 },
|
|
159
164
|
// Ctrl+C tears down slower than the device's default window; `/exit` is the clean path.
|
|
160
165
|
quitKeys: '/exit\r',
|
|
161
166
|
exitTimeoutMs: 20_000,
|
|
@@ -166,6 +171,51 @@ export async function runClassicTuiScenario(spec: ClassicTuiScenarioSpec): Promi
|
|
|
166
171
|
return { scenario: spec.scenario, universe: root, run, store, logs, checks: checks(rowsOf(logs)) };
|
|
167
172
|
};
|
|
168
173
|
|
|
174
|
+
if (spec.scenario === 'classic-first-screen-noise') {
|
|
175
|
+
const run = await mockSeatPtySequence({
|
|
176
|
+
...base,
|
|
177
|
+
env,
|
|
178
|
+
steps: [{ label: 'enter skips first-run provider setup', keys: '\r', until: (screen) => screen.includes('Try typing:') && screen.includes('❯') }],
|
|
179
|
+
});
|
|
180
|
+
const initial = run.frames[0]?.screen ?? '';
|
|
181
|
+
const afterSkip = run.frames.at(-1)?.screen ?? '';
|
|
182
|
+
const debugPath = join(root, '.elanous', 'debug');
|
|
183
|
+
const readDebugRows = (): Row[] => {
|
|
184
|
+
const lines = existsSync(debugPath)
|
|
185
|
+
? readdirSync(debugPath).filter((name) => name.endsWith('.log'))
|
|
186
|
+
.flatMap((name) => readFileSync(join(debugPath, name), 'utf8').split('\n').filter(Boolean))
|
|
187
|
+
: [];
|
|
188
|
+
return lines.flatMap((line) => { try { return [JSON.parse(line) as Row]; } catch { return []; } });
|
|
189
|
+
};
|
|
190
|
+
const tuiDebugRows = readDebugRows();
|
|
191
|
+
const tuiDoctorStarts = tuiDebugRows.filter((row) => row.category === 'doctor.first-run' && row.event === 'started').length;
|
|
192
|
+
// Positive control invokes the exact CLI entry and executable under test. Its test-only route calls
|
|
193
|
+
// this package's production Doctor implementation with inert filesystem/install edges.
|
|
194
|
+
const doctorInstance = resolveInstance({ explicitFlagRoot: root, prodRoot: join(root, '.elanous') });
|
|
195
|
+
const doctorEnv: NodeJS.ProcessEnv = {
|
|
196
|
+
HOME: root, ELANOUS_STATE_DIR: root, ELANOUS_SESSION_ROOT: join(root, 'sessions'),
|
|
197
|
+
ELANOUS_STATE_DIR_SOURCE: doctorInstance.layer === 'default' ? 'derived' : 'explicit',
|
|
198
|
+
PATH: join(root, 'bin'), NODE_ENV: 'test', ELANOUS_TEST_FIRSTRUN_DOCTOR_PROBE: '1',
|
|
199
|
+
};
|
|
200
|
+
const doctorControl = spawnSync(spec.executable, [
|
|
201
|
+
spec.entry, '--config-dir', root, '--test-state-dir', root, '__test-first-run-doctor-control',
|
|
202
|
+
], { cwd: root, env: doctorEnv, encoding: 'utf8', timeout: 15_000 });
|
|
203
|
+
const afterControlRows = readDebugRows();
|
|
204
|
+
const afterDoctorStarts = afterControlRows.filter((row) => row.category === 'doctor.first-run' && row.event === 'started').length;
|
|
205
|
+
return finish(run, { initial, afterSkip, testedEntry: resolve(spec.entry), doctorControlStatus: doctorControl.status, tuiDebugRows: tuiDebugRows.length }, () => ({
|
|
206
|
+
initialScreenCaptured: initial.length > 0,
|
|
207
|
+
promptBankInternalLineHidden: !initial.includes('[prompt-bank]') && !afterSkip.includes('[prompt-bank]'),
|
|
208
|
+
daemonSetupCommandHidden: !initial.includes('--test') && !afterSkip.includes('--test')
|
|
209
|
+
&& !initial.includes('--hmr') && !afterSkip.includes('--hmr') && !afterSkip.includes('nexus run'),
|
|
210
|
+
humanWebSetupMessage: initial.includes('웹 화면을 여는 중…') || afterSkip.includes('웹 화면을 여는 중…')
|
|
211
|
+
|| initial.includes('Opening web setup…') || afterSkip.includes('Opening web setup…'),
|
|
212
|
+
enterSkipReachedChat: afterSkip.includes('Try typing:') && afterSkip.includes('❯'),
|
|
213
|
+
firstRunDoctorNotInvoked: tuiDebugRows.length > 0 && tuiDoctorStarts === 0,
|
|
214
|
+
doctorStartPositiveControl: doctorControl.status === 0 && afterDoctorStarts === tuiDoctorStarts + 1,
|
|
215
|
+
exitedClean: run.exitCode === 0,
|
|
216
|
+
}));
|
|
217
|
+
}
|
|
218
|
+
|
|
169
219
|
if (spec.scenario === 'classic-400-heal' || spec.scenario === 'classic-400-exhausted') {
|
|
170
220
|
const heal = spec.scenario === 'classic-400-heal';
|
|
171
221
|
// The fake throws the real «No tool call found for function call output» 400 shape per script cell.
|
|
@@ -985,7 +985,7 @@
|
|
|
985
985
|
"src/ux-sim/classic-tui-seat-scenarios.test.ts",
|
|
986
986
|
"src/ux-sim/next-tui-seat-scenarios.test.ts"
|
|
987
987
|
],
|
|
988
|
-
"target": "first-run, authoring, scripted TUI flows,
|
|
988
|
+
"target": "first-run, authoring, scripted TUI flows, persisted same-build seminar freeze state, and first-screen noise regression through a real isolated PTY",
|
|
989
989
|
"inputs": [
|
|
990
990
|
"mock author response",
|
|
991
991
|
"scenario steps",
|
|
@@ -993,7 +993,8 @@
|
|
|
993
993
|
"build identifier",
|
|
994
994
|
"three consecutive rehearsal verdicts",
|
|
995
995
|
"owner approval receipt",
|
|
996
|
-
"private simulation world"
|
|
996
|
+
"private simulation world",
|
|
997
|
+
"first-run Enter skip"
|
|
997
998
|
],
|
|
998
999
|
"observations": [
|
|
999
1000
|
"step result",
|
|
@@ -1002,7 +1003,11 @@
|
|
|
1002
1003
|
"persisted same-build pass count",
|
|
1003
1004
|
"frozen state after the third pass",
|
|
1004
1005
|
"changed build rejected before rehearsal without owner approval",
|
|
1005
|
-
"approved build transition and owner receipt"
|
|
1006
|
+
"approved build transition and owner receipt",
|
|
1007
|
+
"internal prompt-bank event absent from the screen",
|
|
1008
|
+
"daemon setup command absent from the screen",
|
|
1009
|
+
"human web setup guidance visible",
|
|
1010
|
+
"Doctor start event absent after Enter skip"
|
|
1006
1011
|
],
|
|
1007
1012
|
"entryCommands": [
|
|
1008
1013
|
"bun test src/ux-sim/mock-authoring-first-run.test.ts src/ux-sim/seminar-rehearsal.test.ts src/ux-sim/classic-tui-seat-scenarios.test.ts src/ux-sim/next-tui-seat-scenarios.test.ts"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"commit":"
|
|
1
|
+
{"commit":"fb4111875f6ae16361ff44914d03019b669a4b3a"}
|