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
|
@@ -8,7 +8,7 @@ import { findTrack } from '../autopilot/mission-phase-track.js';
|
|
|
8
8
|
import { appendGithubStarSnapshots, collectGithubStars, ghApiSearchRepos, type SearchGithubRepos } from './collect-github.js';
|
|
9
9
|
import { ingestIntakeItems, parseRawIntakeJsonl, type IntakeSource, type RegisteredIntakeSourceKind, type RawIntakeItem } from './items.js';
|
|
10
10
|
|
|
11
|
-
export type SourceKind = 'github-query' | 'rss' | 'command' | 'topic-search';
|
|
11
|
+
export type SourceKind = 'github-query' | 'rss' | 'command' | 'topic-search' | 'markdown';
|
|
12
12
|
export interface RegisteredIntakeSource {
|
|
13
13
|
id: string;
|
|
14
14
|
seat: string;
|
|
@@ -112,18 +112,19 @@ function commandArgv(spec: string): string[] {
|
|
|
112
112
|
|
|
113
113
|
export function addSource(input: RegisteredIntakeSource, stateDir = effectiveInstanceRoot()): RegisteredIntakeSource {
|
|
114
114
|
const seat = canonicalSeat(input.seat);
|
|
115
|
-
if (!['github-query', 'rss', 'command', 'topic-search'].includes(input.kind)) throw new Error(`알 수 없는 원천 종류: ${input.kind}`);
|
|
115
|
+
if (!['github-query', 'rss', 'command', 'topic-search', 'markdown'].includes(input.kind)) throw new Error(`알 수 없는 원천 종류: ${input.kind}`);
|
|
116
116
|
cadenceMs(input.every);
|
|
117
117
|
if (input.until !== undefined) untilMs(input.until);
|
|
118
118
|
if (!input.id?.trim() || !/^[\w.-]+$/.test(input.id)) throw new Error('원천 id 는 영문·숫자·_·-·. 만 허용한다');
|
|
119
119
|
if (!input.spec?.trim()) throw new Error('원천 spec 이 비었다');
|
|
120
|
-
if (input.linearIssueId !== undefined && (
|
|
120
|
+
if (input.linearIssueId !== undefined && (!['topic-search', 'markdown'].includes(input.kind)
|
|
121
121
|
|| !/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(input.linearIssueId))) {
|
|
122
|
-
throw new Error('
|
|
122
|
+
throw new Error('관련 issue linearIssueId 는 부모 Linear issue UUID여야 한다');
|
|
123
123
|
}
|
|
124
124
|
if (input.kind === 'topic-search' && (!input.linearIssueId || !input.scheduleCron || !cron.validate(input.scheduleCron))) {
|
|
125
125
|
throw new Error('topic-search 는 부모 Linear UUID와 유효한 개별 schedule cron 이 필요하다');
|
|
126
126
|
}
|
|
127
|
+
if (input.kind === 'markdown' && !input.linearIssueId) throw new Error('markdown 원천은 관련 Linear issue UUID가 필요하다');
|
|
127
128
|
if (input.kind !== 'topic-search' && input.scheduleCron !== undefined) throw new Error('scheduleCron 은 topic-search 원천만 가질 수 있다');
|
|
128
129
|
if (input.kind === 'rss') {
|
|
129
130
|
let protocol = '';
|
|
@@ -131,6 +132,7 @@ export function addSource(input: RegisteredIntakeSource, stateDir = effectiveIns
|
|
|
131
132
|
if (protocol !== 'http:' && protocol !== 'https:') throw new Error('RSS spec 은 HTTP(S) URL 이어야 한다');
|
|
132
133
|
}
|
|
133
134
|
if (input.kind === 'command') commandArgv(input.spec);
|
|
135
|
+
if (input.kind === 'markdown' && !input.spec.startsWith('/')) throw new Error('markdown spec 은 절대 경로여야 한다');
|
|
134
136
|
const sources = readSources(stateDir);
|
|
135
137
|
if (sources.some((source) => source.id === input.id)) throw new Error(`이미 등록된 원천 id: ${input.id}`);
|
|
136
138
|
const source = { ...input, seat };
|
|
@@ -224,6 +226,7 @@ export interface RunDueDeps {
|
|
|
224
226
|
stateDir?: string;
|
|
225
227
|
searchGithub?: SearchGithubRepos;
|
|
226
228
|
fetchFeed?: (url: string) => Promise<string>;
|
|
229
|
+
readMarkdown?: (path: string) => string;
|
|
227
230
|
runCommand?: (command: string) => Promise<string>;
|
|
228
231
|
searchTopic?: (topic: string) => Promise<RawIntakeItem[]>;
|
|
229
232
|
addBriefItem?: (input: import('../briefing/brief-items.js').AddBriefItem) => unknown;
|
|
@@ -248,9 +251,12 @@ async function addTopicBriefItems(stateDir: string, source: RegisteredIntakeSour
|
|
|
248
251
|
const ledger = addBriefItem ? null : new (await import('../briefing/brief-items.js')).BriefItemsLedger({ stateDir });
|
|
249
252
|
for (const item of items) {
|
|
250
253
|
if (!item.url) continue;
|
|
251
|
-
const
|
|
254
|
+
const title = (item.title ?? item.text ?? item.url).replace(/[\r\n]+/g, ' ').trim();
|
|
255
|
+
const detail = source.kind === 'markdown' && item.title && item.text && item.text !== item.title
|
|
256
|
+
? ` — ${item.text.replace(/[\r\n]+/g, ' ').trim()}` : '';
|
|
257
|
+
const text = `새 토픽 자료: ${title}${detail}`;
|
|
252
258
|
const input = {
|
|
253
|
-
text, domain: '흡수' as const, priority: 'P1' as const, source: `intake.
|
|
259
|
+
text, domain: '흡수' as const, priority: 'P1' as const, source: `intake.${source.kind}:${source.id}`,
|
|
254
260
|
evidence: item.url, createdAt,
|
|
255
261
|
...(source.linearIssueId ? { linearIssueId: source.linearIssueId } : {}),
|
|
256
262
|
dedupeKey: `${source.linearIssueId ?? source.id}:${item.url}`, dedupeWithinMs: Math.max(86_400_000, cadenceMs(source.every)),
|
|
@@ -260,6 +266,16 @@ async function addTopicBriefItems(stateDir: string, source: RegisteredIntakeSour
|
|
|
260
266
|
}
|
|
261
267
|
}
|
|
262
268
|
|
|
269
|
+
/** Parse curated scenario news rows without interpreting the factual summaries. */
|
|
270
|
+
export function parseMarkdownNews(markdown: string): RawIntakeItem[] {
|
|
271
|
+
return markdown.split(/\r?\n/).flatMap((line) => {
|
|
272
|
+
const match = /^\s*\d+\.\s+\*\*(.+?)\*\*\s+—\s+(.+?)(?:\s+\[[^\]]+\]\((https?:\/\/[^)]+)\))?\s*$/.exec(line);
|
|
273
|
+
if (!match) return [];
|
|
274
|
+
return [{ title: match[1]!.trim(), text: match[2]!.trim(), kind: 'article' as const,
|
|
275
|
+
...(match[3] ? { url: match[3] } : {}) }];
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
|
|
263
279
|
function xmlText(value: string): string {
|
|
264
280
|
return value.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g, '$1').replace(/<[^>]+>/g, '')
|
|
265
281
|
.replace(/&(?:amp|lt|gt|quot|apos|#(\d+)|#x([a-f\d]+));/gi, (entity, dec: string | undefined, hex: string | undefined) => {
|
|
@@ -289,7 +305,7 @@ export async function runDue({ now = new Date(), seat, sourceId, deps = {} }: {
|
|
|
289
305
|
const ran: Array<{ id: string; items: number; error?: string }> = [];
|
|
290
306
|
for (const source of dueSources(now, stateDir, sourceId).filter((source) =>
|
|
291
307
|
(selectedSeat === undefined || source.seat === selectedSeat)
|
|
292
|
-
&& (
|
|
308
|
+
&& (!['topic-search', 'markdown'].includes(source.kind) || !source.linearIssueId || !!deps.projectTopicBriefing))) {
|
|
293
309
|
try {
|
|
294
310
|
let raws: RawIntakeItem[];
|
|
295
311
|
let githubSnapshots: { day: string; repo: string; stars: number }[] | undefined;
|
|
@@ -314,6 +330,11 @@ export async function runDue({ now = new Date(), seat, sourceId, deps = {} }: {
|
|
|
314
330
|
} else if (source.kind === 'topic-search') {
|
|
315
331
|
raws = await (deps.searchTopic ?? searchTopicWithResearchBridge)(source.spec);
|
|
316
332
|
intakeSource = 'topic-search';
|
|
333
|
+
} else if (source.kind === 'markdown') {
|
|
334
|
+
const contents = (deps.readMarkdown ?? ((path: string) => readFileSync(path, 'utf8')))(source.spec);
|
|
335
|
+
raws = parseMarkdownNews(contents);
|
|
336
|
+
if (!raws.length) throw new Error('markdown 원천에서 뉴스 항목을 찾지 못했다');
|
|
337
|
+
intakeSource = 'markdown';
|
|
317
338
|
} else {
|
|
318
339
|
const argv = commandArgv(source.spec);
|
|
319
340
|
const stdout = await (deps.runCommand ?? (async () => execFileSync(argv[0]!, argv.slice(1), { encoding: 'utf8', timeout: 600_000, maxBuffer: 16 * 1024 * 1024 })))(source.spec);
|
|
@@ -328,19 +349,19 @@ export async function runDue({ now = new Date(), seat, sourceId, deps = {} }: {
|
|
|
328
349
|
}
|
|
329
350
|
raws = raws.map((raw) => ({ ...raw, seat: source.seat,
|
|
330
351
|
...(source.briefingTopic ? { briefingTopic: source.briefingTopic } : {}),
|
|
331
|
-
...(source.kind === 'topic-search' && source.linearIssueId ? { linearIssueId: source.linearIssueId } : {}) }));
|
|
352
|
+
...((source.kind === 'topic-search' || source.kind === 'markdown') && source.linearIssueId ? { linearIssueId: source.linearIssueId } : {}) }));
|
|
332
353
|
const publishers = new Set(raws.map((raw) => {
|
|
333
354
|
if (raw.publisher?.trim()) return raw.publisher.trim().toLowerCase();
|
|
334
355
|
try { return new URL(raw.url!).hostname.toLowerCase().replace(/^www\./, ''); } catch { return undefined; }
|
|
335
356
|
}).filter((host): host is string => !!host));
|
|
336
357
|
const items = (deps.ingest ?? ingestIntakeItems)(stateDir, intakeSource, raws, now.toISOString()).shaped;
|
|
337
|
-
if (source.kind === 'topic-search') await addTopicBriefItems(stateDir, source, raws, now.toISOString(), deps.addBriefItem);
|
|
358
|
+
if (source.kind === 'topic-search' || (source.kind === 'markdown' && source.linearIssueId)) await addTopicBriefItems(stateDir, source, raws, now.toISOString(), deps.addBriefItem);
|
|
338
359
|
await deps.onCollected?.(source, raws, now);
|
|
339
360
|
if (githubSnapshots) appendGithubStarSnapshots(stateDir, githubSnapshots);
|
|
340
|
-
if (source.kind === 'topic-search' && source.linearIssueId && deps.projectTopicBriefing) {
|
|
361
|
+
if ((source.kind === 'topic-search' || source.kind === 'markdown') && source.linearIssueId && deps.projectTopicBriefing) {
|
|
341
362
|
const { BriefItemsLedger } = await import('../briefing/brief-items.js');
|
|
342
363
|
const ledger = new BriefItemsLedger({ stateDir });
|
|
343
|
-
const pending = ledger.list().filter(item => item.source === `intake.
|
|
364
|
+
const pending = ledger.list().filter(item => item.source === `intake.${source.kind}:${source.id}`
|
|
344
365
|
&& item.linearIssueId?.toLowerCase() === source.linearIssueId!.toLowerCase() && item.sent_at === null);
|
|
345
366
|
if (pending.length) {
|
|
346
367
|
await deps.projectTopicBriefing(source, pending, stateDir);
|
|
@@ -8,7 +8,7 @@ import { findTrack } from '../autopilot/mission-phase-track.js';
|
|
|
8
8
|
import { wasIntakeEventScheduled } from './route.js';
|
|
9
9
|
|
|
10
10
|
export const INTAKE_SOURCES = ['x', 'youtube', 'github', 'telegram-saved', 'telegram-bot', 'memo', 'pwa'] as const;
|
|
11
|
-
export type RegisteredIntakeSourceKind = 'rss' | 'command' | 'topic-search';
|
|
11
|
+
export type RegisteredIntakeSourceKind = 'rss' | 'command' | 'topic-search' | 'markdown';
|
|
12
12
|
export type IntakeSource = typeof INTAKE_SOURCES[number];
|
|
13
13
|
export type IntakeKind = 'video' | 'repo' | 'post' | 'article' | 'note' | 'rss';
|
|
14
14
|
export type IntakePrivacy = 'public' | 'user-private';
|
package/src/mcp/server.ts
CHANGED
|
@@ -113,6 +113,10 @@ function mcpRunId(params: Record<string, unknown> | undefined): string | undefin
|
|
|
113
113
|
return normalized === value ? value : undefined;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
function isAsideMcpClient(clientName: string | undefined): boolean {
|
|
117
|
+
return clientName?.trim().toLowerCase() === 'aside';
|
|
118
|
+
}
|
|
119
|
+
|
|
116
120
|
function logAsideRunIdDrop(toolName: string, params: Record<string, unknown> | undefined): void {
|
|
117
121
|
const meta = params?._meta;
|
|
118
122
|
const raw = meta && typeof meta === 'object' && !Array.isArray(meta)
|
|
@@ -202,8 +206,9 @@ export async function handleMcpRequest(
|
|
|
202
206
|
const args = (req.params?.arguments as Record<string, unknown>) ?? {};
|
|
203
207
|
const surface = ctx.surface ?? 'mcp';
|
|
204
208
|
const rt = getToolRuntime(name);
|
|
205
|
-
const
|
|
206
|
-
|
|
209
|
+
const isAsideClient = isAsideMcpClient(ctx.clientName);
|
|
210
|
+
const runId = isAsideClient ? mcpRunId(req.params) : undefined;
|
|
211
|
+
if (isAsideClient && !runId) logAsideRunIdDrop(name, req.params);
|
|
207
212
|
const asideReturn = runId !== undefined;
|
|
208
213
|
const isExposedOnSurface = listToolRuntimes(surface).some(runtime => runtime.id === rt?.id);
|
|
209
214
|
if (!rt || !isExposedOnSurface) {
|
|
@@ -750,6 +750,9 @@ export const nativeToolCatalog: NativeToolCatalogEntry[] = [
|
|
|
750
750
|
description: 'DEMO-only grounded Linear secretary. Create a dated evidence-backed parent with 3–5 subtasks, record a child progress/Done transition using actual intake records and approved browser evidence, or open one local pending approval per parent. Repeated approval calls return the existing card state; no external notifications are sent.',
|
|
751
751
|
promptSummary: '`elanous_linear_secretary` (DEMO create/progress/Done/evidence/approval; approval is local and sends nothing externally)',
|
|
752
752
|
host: ['tui', 'mcp'], safety: ['mutating', 'network'], supportsParallel: false, defaultEnabled: true,
|
|
753
|
+
// Multi-step secretary workflow is discoverable on demand; direct action tools stay in the TUI catalog.
|
|
754
|
+
alwaysLoad: false,
|
|
755
|
+
shouldDefer: true,
|
|
753
756
|
intentScope: 'ops-fleet',
|
|
754
757
|
},
|
|
755
758
|
{
|
|
@@ -37,6 +37,8 @@ const ASK_STATUS_EVENT_TO_PHASE = {
|
|
|
37
37
|
const ASK_STATUS_EVENTS = new Set<string>(Object.keys(ASK_STATUS_EVENT_TO_PHASE));
|
|
38
38
|
const ACCEPTED_ASK_REGISTRY_LIMIT = 1_000;
|
|
39
39
|
const acceptedAskIssuedAt = new Map<string, number>();
|
|
40
|
+
const RUNNING_RUNS_HTTP_CACHE_TTL_MS = 120_000; // 0.3.4: federated 스캔 25~34초 — 3초는 매번 놓쳤다
|
|
41
|
+
const runningRunsHttpCache = new WeakMap<typeof queryRunningRuns, { at: number; result: RunningRunsResult; body: string }>();
|
|
40
42
|
|
|
41
43
|
export function rememberAcceptedAsk(acceptanceId: string, issuedAt = Date.now()): void {
|
|
42
44
|
acceptedAskIssuedAt.delete(acceptanceId);
|
|
@@ -111,6 +113,8 @@ export interface HarnessApiDeps {
|
|
|
111
113
|
readonly ledgerDir?: string;
|
|
112
114
|
/** 시험 심 — `?finishedSince=` 의 `landed`(gh 실행기·저장소·시간 초과). */
|
|
113
115
|
readonly landed?: LandedPrsDeps;
|
|
116
|
+
/** 시계 주입 — `GET /v1/harness/runs`의 3초 스냅샷 TTL 시험용. */
|
|
117
|
+
readonly now?: () => number;
|
|
114
118
|
}
|
|
115
119
|
|
|
116
120
|
function json(body: unknown, status = 200): Response {
|
|
@@ -121,6 +125,16 @@ function message(error: unknown): string {
|
|
|
121
125
|
return error instanceof Error ? error.message : String(error);
|
|
122
126
|
}
|
|
123
127
|
|
|
128
|
+
function cachedRunningRuns(query: typeof queryRunningRuns, now: () => number): { result: RunningRunsResult; body: string } {
|
|
129
|
+
const cached = runningRunsHttpCache.get(query);
|
|
130
|
+
const requestedAt = now();
|
|
131
|
+
if (cached && requestedAt - cached.at < RUNNING_RUNS_HTTP_CACHE_TTL_MS) return cached;
|
|
132
|
+
const result = query({ includeTest: false, timeBudgetMs: 3_000 }); // PWA 런 목록 — federated 스캔이 25~34초라 3초 예산 안의 부분 결과로 답한다
|
|
133
|
+
const snapshot = { at: now(), result, body: JSON.stringify(result) };
|
|
134
|
+
runningRunsHttpCache.set(query, snapshot);
|
|
135
|
+
return snapshot;
|
|
136
|
+
}
|
|
137
|
+
|
|
124
138
|
export function queryHarnessAskLifecycle(store: Pick<LogStore, 'query'>, acceptanceId: string) {
|
|
125
139
|
return store.query({
|
|
126
140
|
exactCategories: ['harness-http'],
|
|
@@ -533,10 +547,11 @@ export async function listLandedPrs(sinceMs: number, deps: LandedPrsDeps = {}):
|
|
|
533
547
|
export function handleHarnessRunsGet(req: Request, _metaApi: HarnessMetaApi, deps: HarnessApiDeps = {}): Response | Promise<Response> {
|
|
534
548
|
const totalStarted = performance.now();
|
|
535
549
|
const runningStarted = performance.now();
|
|
536
|
-
const
|
|
550
|
+
const runningRuns = cachedRunningRuns(deps.queryRunningRuns ?? queryRunningRuns, deps.now ?? Date.now);
|
|
551
|
+
const runs = runningRuns.result;
|
|
537
552
|
const runningMs = Math.max(0, Math.round(performance.now() - runningStarted));
|
|
538
553
|
const raw = new URL(req.url).searchParams.get('finishedSince');
|
|
539
|
-
if (raw === null) return
|
|
554
|
+
if (raw === null) return new Response(runningRuns.body, { status: 200, headers: JSON_HEADERS });
|
|
540
555
|
const sinceMs = Number(raw);
|
|
541
556
|
if (!raw.trim() || !Number.isFinite(sinceMs) || sinceMs < 0) {
|
|
542
557
|
return json({ error: 'usage: GET /v1/harness/runs?finishedSince=<epoch ms>' }, 400);
|
|
@@ -49,7 +49,7 @@ export interface RunTraversalWire {
|
|
|
49
49
|
substrate: string | null;
|
|
50
50
|
steps: TraversalStepWire[];
|
|
51
51
|
/** Structural graph changes in the same per-run sequence domain as `steps[].sourceSeq`. */
|
|
52
|
-
graphEvents?: Extract<RunStep, { type: 'node-added' | 'edge-rerouted' | 'unit-expanded' | 'unit-collapsed' }>[];
|
|
52
|
+
graphEvents?: Extract<RunStep, { type: 'node-added' | 'edge-rerouted' | 'priority-changed' | 'unit-expanded' | 'unit-collapsed' }>[];
|
|
53
53
|
/** Outcome edges read from this run's graph.path ledger rows, including injected fixture provenance. */
|
|
54
54
|
journeyEdges?: Array<{ seq?: number; from: string; label: string; taken: string; source: 'graph' | 'code-default'; injected?: boolean; mockOutcome?: string; scene?: string; demo1104Scene?: string }>;
|
|
55
55
|
ledgerEvents: number;
|
|
@@ -84,11 +84,11 @@ function safeResource(value: unknown): string | undefined {
|
|
|
84
84
|
function resourcesFor(window: readonly RunLedgerEntry[], origin: RunLedgerEntry | undefined) {
|
|
85
85
|
const resources: NonNullable<TraversalStepWire['resources']> = {};
|
|
86
86
|
const models = new Set<string>();
|
|
87
|
+
const plugins = new Set<string>();
|
|
87
88
|
const originData = origin?.data ?? {};
|
|
88
89
|
resources.host = safeResource(originData.hostname) ?? safeResource(originData.hostId);
|
|
89
90
|
resources.pod = safeResource(originData.podName);
|
|
90
91
|
const requestedModel = safeResource(originData.childModel);
|
|
91
|
-
if (requestedModel) models.add(requestedModel);
|
|
92
92
|
const events = window;
|
|
93
93
|
for (const entry of events) {
|
|
94
94
|
const data = entry.data;
|
|
@@ -107,8 +107,18 @@ function resourcesFor(window: readonly RunLedgerEntry[], origin: RunLedgerEntry
|
|
|
107
107
|
const model = safeResource(value);
|
|
108
108
|
if (model) models.add(model);
|
|
109
109
|
}
|
|
110
|
+
if (entry.event === 'plugin-tool-call') {
|
|
111
|
+
const plugin = safeResource(data.plugin);
|
|
112
|
+
const tool = safeResource(data.tool);
|
|
113
|
+
const name = plugin && tool ? `${plugin}/${tool}` : plugin ?? tool;
|
|
114
|
+
if (name) plugins.add(name);
|
|
115
|
+
}
|
|
110
116
|
}
|
|
117
|
+
// Prefer the model consumed during this node over the launch request. The latter
|
|
118
|
+
// remains a compatibility fallback for older ledgers without consume events.
|
|
119
|
+
if (!models.size && requestedModel) models.add(requestedModel);
|
|
111
120
|
if (models.size) resources.models = [...models];
|
|
121
|
+
if (plugins.size) resources.plugins = [...plugins];
|
|
112
122
|
return Object.values(resources).some(Boolean) ? resources : undefined;
|
|
113
123
|
}
|
|
114
124
|
|
|
@@ -220,8 +230,8 @@ export function buildRunTraversal(runId: string, entries: readonly RunLedgerEntr
|
|
|
220
230
|
const contract = sorted.find((entry) => entry.event === 'graph-run-contract-resolved')?.data;
|
|
221
231
|
const pr = [...sorted].reverse().find((entry) => entry.event === 'pr-opened')?.data;
|
|
222
232
|
const projected = projectRunLedgerSteps(runId, sorted);
|
|
223
|
-
const graphEvents = projected.steps.filter((step): step is Extract<RunStep, { type: 'node-added' | 'edge-rerouted' | 'unit-expanded' | 'unit-collapsed' }> =>
|
|
224
|
-
step.type === 'node-added' || step.type === 'edge-rerouted' || step.type === 'unit-expanded' || step.type === 'unit-collapsed');
|
|
233
|
+
const graphEvents = projected.steps.filter((step): step is Extract<RunStep, { type: 'node-added' | 'edge-rerouted' | 'priority-changed' | 'unit-expanded' | 'unit-collapsed' }> =>
|
|
234
|
+
step.type === 'node-added' || step.type === 'edge-rerouted' || step.type === 'priority-changed' || step.type === 'unit-expanded' || step.type === 'unit-collapsed');
|
|
225
235
|
const journeyEdges = sorted.flatMap((entry) => {
|
|
226
236
|
const source = entry.data.source;
|
|
227
237
|
if (entry.event !== 'graph.path' || entry.data.event !== 'edge-taken'
|
|
@@ -261,7 +261,9 @@ function setupRouteAllowed(req: Request): boolean {
|
|
|
261
261
|
if (path.startsWith('/v1/setup/')) return true;
|
|
262
262
|
return (req.method === 'POST' && path === '/v1/prompt/stream')
|
|
263
263
|
|| (req.method === 'GET' && (
|
|
264
|
-
/^\/v1\/sessions\/store\/[^/]+$/.test(path)
|
|
264
|
+
/^\/v1\/sessions\/store\/[^/]+$/.test(path)
|
|
265
|
+
|| path === '/v1/chat/events'
|
|
266
|
+
|| path === '/v1/harness/runs'
|
|
265
267
|
));
|
|
266
268
|
}
|
|
267
269
|
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { appendRunLedgerEntry } from '../../self-implement/run-ledger.js';
|
|
2
|
+
import { publishInsideEvent } from './inside-events.js';
|
|
3
|
+
|
|
4
|
+
export const RESEARCH_GRAPH_ID = 'natural-language-research';
|
|
5
|
+
|
|
6
|
+
export type ResearchGraphEvent =
|
|
7
|
+
| { type: 'enter'; node: string }
|
|
8
|
+
| { type: 'exit'; node: string; outcome: string }
|
|
9
|
+
| { type: 'node-added'; node: string; kind: string; reason: string }
|
|
10
|
+
| { type: 'edge-rerouted'; from: string; outcome: string; to: string; was: string; reason: string }
|
|
11
|
+
| { type: 'priority-changed'; node: string; from: number; to: number; reason: string };
|
|
12
|
+
|
|
13
|
+
export interface ResearchRunObserver {
|
|
14
|
+
event(event: ResearchGraphEvent): void;
|
|
15
|
+
finish(outcome: 'completed' | 'failed'): void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Register one natural-language research run in the same ledger read by Nexus /live-run. */
|
|
19
|
+
export function registerResearchRun(runId: string, deps: {
|
|
20
|
+
append?: typeof appendRunLedgerEntry;
|
|
21
|
+
publish?: typeof publishInsideEvent;
|
|
22
|
+
} = {}): ResearchRunObserver {
|
|
23
|
+
const append = deps.append ?? appendRunLedgerEntry;
|
|
24
|
+
const publish = deps.publish ?? publishInsideEvent;
|
|
25
|
+
let finished = false;
|
|
26
|
+
const emit = (event: string, data: Record<string, unknown>): void => {
|
|
27
|
+
if (!runId) return;
|
|
28
|
+
const record = { runId, event, data: { graphId: RESEARCH_GRAPH_ID, ...data }, timestamp: new Date().toISOString() };
|
|
29
|
+
try { append(record); } catch { /* ledger failure must not suppress the live event */ }
|
|
30
|
+
try { publish({ kind: 'harness-run', event, runId, ...record.data }); } catch { /* observation is fail-soft */ }
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
emit('start', { feature: '자연어 리서치', graphId: RESEARCH_GRAPH_ID });
|
|
34
|
+
emit('graph-run-contract-resolved', { graphId: RESEARCH_GRAPH_ID });
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
event(event) {
|
|
38
|
+
if (finished) return;
|
|
39
|
+
switch (event.type) {
|
|
40
|
+
case 'enter':
|
|
41
|
+
emit('pipeline-node-entry', { node: event.node, visit: 1, round: 0 });
|
|
42
|
+
break;
|
|
43
|
+
case 'exit':
|
|
44
|
+
emit('pipeline-node-exit', { node: event.node, outcome: event.outcome });
|
|
45
|
+
break;
|
|
46
|
+
case 'node-added':
|
|
47
|
+
case 'edge-rerouted':
|
|
48
|
+
case 'priority-changed':
|
|
49
|
+
emit(event.type, { ...event, decider: 'research-runtime' });
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
finish(outcome) {
|
|
54
|
+
if (finished) return;
|
|
55
|
+
finished = true;
|
|
56
|
+
emit('run-status', { runStatus: outcome, stage: 'research' });
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { runFirstRunDoctor } from './first-run-doctor.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Safe control for production-entry UX probes. The CLI gates this behind NODE_ENV=test
|
|
5
|
+
* and ELANOUS_TEST_FIRSTRUN_DOCTOR_PROBE=1; all filesystem and install edges are inert.
|
|
6
|
+
*/
|
|
7
|
+
export function runFirstRunDoctorTestControl(): void {
|
|
8
|
+
if (process.env.NODE_ENV !== 'test' || process.env.ELANOUS_TEST_FIRSTRUN_DOCTOR_PROBE !== '1') {
|
|
9
|
+
throw new Error('first-run Doctor control requires the explicit test environment');
|
|
10
|
+
}
|
|
11
|
+
const bin = process.env.PATH ?? '';
|
|
12
|
+
runFirstRunDoctor({
|
|
13
|
+
home: process.env.HOME ?? '',
|
|
14
|
+
configDir: process.env.HOME ?? '',
|
|
15
|
+
cacheDir: process.env.HOME ?? '',
|
|
16
|
+
env: process.env,
|
|
17
|
+
readiness: {
|
|
18
|
+
platform: 'linux',
|
|
19
|
+
installPrefix: bin,
|
|
20
|
+
pathEntries: bin.split(':'),
|
|
21
|
+
tmpdirSameFsAsBunCache: true,
|
|
22
|
+
distro: 'amzn2',
|
|
23
|
+
rgOnPath: true,
|
|
24
|
+
pythonEnv: { status: 'ok', evidence: 'fixture' },
|
|
25
|
+
},
|
|
26
|
+
exists: () => true,
|
|
27
|
+
lstat: () => ({ mode: 0o700, isFile: () => false, isSymbolicLink: () => false }),
|
|
28
|
+
readdir: () => [],
|
|
29
|
+
readFile: () => '',
|
|
30
|
+
writeFile: () => {},
|
|
31
|
+
appendFile: () => {},
|
|
32
|
+
mkdir: () => {},
|
|
33
|
+
chmod: () => {},
|
|
34
|
+
rename: () => {},
|
|
35
|
+
remove: () => {},
|
|
36
|
+
removeTree: () => {},
|
|
37
|
+
installStaticTool: () => ({ ok: true, detail: 'fixture' }),
|
|
38
|
+
smokeCheck: () => true,
|
|
39
|
+
pythonSetup: () => 0,
|
|
40
|
+
installManagedPython: () => ({ python: null, detail: 'fixture' }),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -24,6 +24,7 @@ export interface FirstRunDoctorResult {
|
|
|
24
24
|
|
|
25
25
|
/** 첫 실행에서는 동의가 필요 없는 수리만 실행하고, 셸 시작 파일은 손대지 않는다. */
|
|
26
26
|
export function runFirstRunDoctor(deps: DoctorFixDeps): FirstRunDoctorResult {
|
|
27
|
+
try { debug.log('doctor.first-run', 'started', {}); } catch { /* observation must not block setup */ }
|
|
27
28
|
const result: FirstRunDoctorResult = { fixed: [], skipped: [], failed: [], later: [], lines: [] };
|
|
28
29
|
const record = (id: string, outcome: 'fixed' | 'skipped' | 'failed', reason?: string) => {
|
|
29
30
|
result[outcome].push(id);
|
package/src/plugins/core/host.ts
CHANGED
|
@@ -1090,6 +1090,18 @@ export class PluginHost {
|
|
|
1090
1090
|
}
|
|
1091
1091
|
const started = Date.now();
|
|
1092
1092
|
debug.log('plugin.tool', name, { args, plugin: this.activeEntry?.name ?? null });
|
|
1093
|
+
const runId = process.env.ELANOUS_RUN_ID?.trim();
|
|
1094
|
+
if (runId) {
|
|
1095
|
+
try {
|
|
1096
|
+
const { appendRunLedgerEntry } = await import('../../self-implement/run-ledger.js');
|
|
1097
|
+
appendRunLedgerEntry({
|
|
1098
|
+
timestamp: new Date().toISOString(),
|
|
1099
|
+
runId,
|
|
1100
|
+
event: 'plugin-tool-call',
|
|
1101
|
+
data: { plugin: this.activeEntry?.name ?? null, tool: name },
|
|
1102
|
+
});
|
|
1103
|
+
} catch { /* resource observation must not change tool dispatch */ }
|
|
1104
|
+
}
|
|
1093
1105
|
try {
|
|
1094
1106
|
// Host tools can run outside any plugin context — buildContext
|
|
1095
1107
|
// falls back to a minimal stub when activeEntry is null.
|
|
@@ -86,13 +86,14 @@ export function buildSessionGuidanceAddendum(
|
|
|
86
86
|
);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
// Name the progress tool that is actually active. Ordered requests
|
|
90
|
+
// keep the user's sequence intact and start at step one.
|
|
91
|
+
const updatePlanTool = enabledTools.find((name) => ['update_plan', 'updateplan'].includes(name.toLowerCase()));
|
|
92
|
+
const taskCreateTool = enabledTools.find((name) => ['taskcreate', 'task_create'].includes(name.toLowerCase()));
|
|
93
|
+
const planTool = updatePlanTool ?? taskCreateTool;
|
|
94
|
+
if (planTool) {
|
|
94
95
|
items.push(
|
|
95
|
-
|
|
96
|
+
`When the user lists steps in order, use \`${planTool}\` with those steps in the same order before starting; begin with step one and update progress as you go.`,
|
|
96
97
|
);
|
|
97
98
|
}
|
|
98
99
|
|
|
@@ -5663,6 +5663,19 @@ async function runSelfImplementInner(
|
|
|
5663
5663
|
...(opts.childLlm ? { configuredProvider: configuredProvider.provider ?? null, configuredModel: configuredProvider.model ?? null, modelSelectionSource: 'child' } : {}),
|
|
5664
5664
|
...(opts.correlationId !== undefined ? { correlationId: opts.correlationId } : {}),
|
|
5665
5665
|
});
|
|
5666
|
+
// The traversal resource panel is scoped to the node window. Record the selected
|
|
5667
|
+
// implementation model there as an explicit consume event, using the same provider
|
|
5668
|
+
// resolved for this run (after child selection), rather than the requested/default model.
|
|
5669
|
+
observe('llm-consume-start', {
|
|
5670
|
+
provider: activeProvider.provider ?? null,
|
|
5671
|
+
model: activeProvider.model ?? null,
|
|
5672
|
+
childProvider: activeProvider.provider ?? null,
|
|
5673
|
+
childModel: activeProvider.model ?? null,
|
|
5674
|
+
llmConsumeStart: {
|
|
5675
|
+
...(activeProvider.provider ? { provider: activeProvider.provider } : {}),
|
|
5676
|
+
...(activeProvider.model ? { model: activeProvider.model } : {}),
|
|
5677
|
+
},
|
|
5678
|
+
});
|
|
5666
5679
|
try {
|
|
5667
5680
|
await (s.refreshCodexQuotaSignals ?? refreshCodexQuotaSignals)();
|
|
5668
5681
|
observe('quota-refresh', { status: 'completed' });
|
|
@@ -39,7 +39,7 @@ export function pathSignatureOf(steps: readonly { readonly from: string; readonl
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
const RUN_GRAPH_STEP_EVENTS = new Set([
|
|
42
|
-
'node-enter', 'node-exit', 'edge-taken', 'node-skipped', 'node-added', 'edge-rerouted',
|
|
42
|
+
'node-enter', 'node-exit', 'edge-taken', 'node-skipped', 'node-added', 'edge-rerouted', 'priority-changed',
|
|
43
43
|
'unit-expanded', 'unit-collapsed', 'pipeline-node-entry', 'pipeline-node-exit', 'graph-edge-taken',
|
|
44
44
|
'graph.path',
|
|
45
45
|
]);
|
|
@@ -7,6 +7,7 @@ export type RunStep =
|
|
|
7
7
|
| { seq: number; ts: string; type: 'node-skipped'; node: string; reason: string; condition?: string }
|
|
8
8
|
| { seq: number; ts: string; type: 'node-added'; node: string; kind: string; decider: string; reason: string; trigger?: unknown; undo?: unknown; source?: string; injected?: boolean; scene?: string; demo1104Scene?: string; mockOutcome?: string }
|
|
9
9
|
| { seq: number; ts: string; type: 'edge-rerouted'; from: string; outcome: string; to: string; was: string; decider: string; reason: string; source?: string; injected?: boolean; scene?: string; demo1104Scene?: string; mockOutcome?: string }
|
|
10
|
+
| { seq: number; ts: string; type: 'priority-changed'; node: string; from: number; to: number; decider: string; reason: string }
|
|
10
11
|
| { seq: number; ts: string; type: 'unit-expanded'; node: string; unit: string; childRunId: string; resolution: number; decider: string; reason: string }
|
|
11
12
|
| { seq: number; ts: string; type: 'unit-collapsed'; node: string; resolution: number; decider: string; reason: string };
|
|
12
13
|
|
|
@@ -23,10 +24,10 @@ export interface RunStepProjection {
|
|
|
23
24
|
|
|
24
25
|
const STEP_EVENTS = new Set([
|
|
25
26
|
'node-enter', 'node-exit', 'edge-taken', 'node-skipped',
|
|
26
|
-
'node-added', 'edge-rerouted', 'unit-expanded', 'unit-collapsed',
|
|
27
|
+
'node-added', 'edge-rerouted', 'priority-changed', 'unit-expanded', 'unit-collapsed',
|
|
27
28
|
'pipeline-node-entry', 'pipeline-node-exit', 'graph-edge-taken',
|
|
28
29
|
]);
|
|
29
|
-
const STRUCTURAL_EVENTS = new Set(['node-added', 'edge-rerouted', 'unit-expanded', 'unit-collapsed']);
|
|
30
|
+
const STRUCTURAL_EVENTS = new Set(['node-added', 'edge-rerouted', 'priority-changed', 'unit-expanded', 'unit-collapsed']);
|
|
30
31
|
|
|
31
32
|
function text(data: Record<string, unknown>, key: string): string | null {
|
|
32
33
|
const value = data[key];
|
|
@@ -104,6 +105,13 @@ function projectStep(entry: RunLedgerEntry, type: string, seq: number): RunStep
|
|
|
104
105
|
const was = text(data, 'was');
|
|
105
106
|
return from && outcome && to && was ? { seq, ts, type, from, outcome, to, was, decider: text(data, 'decider')!, reason: text(data, 'reason')!, ...structuralProvenance(data) } : 'edge-rerouted requires from, outcome, to and was';
|
|
106
107
|
}
|
|
108
|
+
case 'priority-changed': {
|
|
109
|
+
const from = data.from;
|
|
110
|
+
const to = data.to;
|
|
111
|
+
return node && typeof from === 'number' && Number.isFinite(from) && typeof to === 'number' && Number.isFinite(to)
|
|
112
|
+
? { seq, ts, type, node, from, to, decider: text(data, 'decider')!, reason: text(data, 'reason')! }
|
|
113
|
+
: 'priority-changed requires node and numeric from/to';
|
|
114
|
+
}
|
|
107
115
|
case 'unit-expanded': {
|
|
108
116
|
const unit = text(data, 'unit') ?? text(data, 'into');
|
|
109
117
|
const childRunId = text(data, 'childRunId');
|
package/src/session/chat.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
// path is untouched — wiring that in is follow-up work the user can
|
|
13
13
|
// approve separately (lots of UI surface; one bug = broken dashboard).
|
|
14
14
|
|
|
15
|
+
import { randomUUID } from 'node:crypto';
|
|
15
16
|
import {
|
|
16
17
|
createSession, appendMessage, loadSession,
|
|
17
18
|
type SessionMeta, type SerializedMessage, type CreateSessionOpts,
|
|
@@ -551,6 +552,7 @@ export async function runTurn(opts: RunTurnOpts): Promise<RunTurnResult> {
|
|
|
551
552
|
}
|
|
552
553
|
const coreCtx: CoreTurnContext = {
|
|
553
554
|
sessionId: opts.sessionId,
|
|
555
|
+
...(armResearchTurn ? { runId: randomUUID() } : {}),
|
|
554
556
|
// ⭐ 이 턴의 «사람 문장» 운반자. 없으면 표면 판정이 늘 기본값으로 떨어진다
|
|
555
557
|
// (골 루프가 라운드 사이에 기계 문장을 밀어 넣기 때문 — run-goal-loop.ts 진입 주석).
|
|
556
558
|
userText: opts.userText,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { buildGitSnapshot } from '../git-fs/index.js';
|
|
2
2
|
import { classifyTuiChatIntent } from '../core-turn/short-question.js';
|
|
3
3
|
import { debug } from '../debug/log.js';
|
|
4
|
-
import { isResearchAgentIntent } from '../tool-hints/signals.js';
|
|
4
|
+
import { isOrderedNonResearchWorkflow, isResearchAgentIntent } from '../tool-hints/signals.js';
|
|
5
5
|
import { resolve } from 'node:path';
|
|
6
6
|
import type { ModelFamily } from '../models/prompts.js';
|
|
7
7
|
import type { InputSourceKind, InputSourceRef } from '../input/input-source-kind.js';
|
|
@@ -1541,8 +1541,11 @@ export function resolveSessionSurfaceProfile(opts: {
|
|
|
1541
1541
|
const text = String(opts.userText ?? '').toLowerCase();
|
|
1542
1542
|
if (hasOpsFleetIntent(text)) return decision('ops-fleet/agent', 'ops-fleet-intent');
|
|
1543
1543
|
if (hasOpsUiIntent(text)) return decision('ops-ui/agent', 'ops-ui-intent');
|
|
1544
|
-
|
|
1545
|
-
if (
|
|
1544
|
+
const orderedNonResearchWorkflow = isOrderedNonResearchWorkflow(text);
|
|
1545
|
+
if (!orderedNonResearchWorkflow && hasResearchSearchIntent(text)) return decision('research/agent', 'research-search-intent');
|
|
1546
|
+
if (!orderedNonResearchWorkflow && (hasWebSearchIntent(text) || hasWebFetchIntent(text))) {
|
|
1547
|
+
return decision('research/turn', 'web-search-or-fetch-intent');
|
|
1548
|
+
}
|
|
1546
1549
|
if (hasDevHarnessIntent(text)) return decision('coding/agent', 'dev-harness-intent');
|
|
1547
1550
|
return decision('coding/turn', 'fallback-default');
|
|
1548
1551
|
}
|
|
@@ -1761,6 +1764,7 @@ const ESSENTIAL_HOST_FAMILY_IDS = ['self-ops', 'release-read'] as const;
|
|
|
1761
1764
|
// ScheduleWakeup (H5) is a dashboard-only host tool — present only when the TUI registered it.
|
|
1762
1765
|
const ESSENTIAL_HOST_EXTRA_NAMES = ['logs_query', 'ScheduleWakeup'] as const;
|
|
1763
1766
|
const ESSENTIAL_RUNTIME_FAMILY_IDS = ['bash', 'run-shell', 'ops-ledger', 'pty-shell', 'run-tests', 'elanous_skills_list', 'skill_exec', 'code-grounding'] as const;
|
|
1767
|
+
const ESSENTIAL_RUNTIME_EXTRA_NAMES = ['tool_search'] as const;
|
|
1764
1768
|
const ESSENTIAL_OPTIONAL_TOOL_NAMES = [
|
|
1765
1769
|
'GetDashboardState',
|
|
1766
1770
|
'TerminalModalList', 'TerminalModalObserve', 'TerminalModalFocus', 'TerminalModalDetach', 'TerminalModalKill',
|
|
@@ -1809,6 +1813,23 @@ function buildEssentialSessionRuntimeToolSpecs(opts: {
|
|
|
1809
1813
|
.map(tool => tool.spec)
|
|
1810
1814
|
: [];
|
|
1811
1815
|
});
|
|
1816
|
+
const runtimeExtras = ESSENTIAL_RUNTIME_EXTRA_NAMES
|
|
1817
|
+
.map(name => runtimeById.get(name))
|
|
1818
|
+
.filter((tool): tool is ToolRuntime<Record<string, unknown>, ToolRunResult> => !!tool)
|
|
1819
|
+
.filter(tool => isToolAvailable(tool.spec.name, opts.toolAvailability))
|
|
1820
|
+
.map(tool => tool.spec);
|
|
1821
|
+
// Keep explicit external-service actions callable in the TUI. The catalog metadata, not a service-name list, defines this lane.
|
|
1822
|
+
const explicitIntegrationSpecs = opts.runtimeTools
|
|
1823
|
+
.filter(tool => {
|
|
1824
|
+
const entry = findNativeTool(tool.id);
|
|
1825
|
+
return entry?.host.includes('tui')
|
|
1826
|
+
&& entry.safety.includes('mutating')
|
|
1827
|
+
&& entry.safety.includes('network')
|
|
1828
|
+
&& entry.intentScope === 'ops-fleet'
|
|
1829
|
+
&& entry.alwaysLoad !== false;
|
|
1830
|
+
})
|
|
1831
|
+
.filter(tool => isToolAvailable(tool.spec.name, opts.toolAvailability))
|
|
1832
|
+
.map(tool => tool.spec);
|
|
1812
1833
|
// External MCP proxy runtimes are registered asynchronously by the TUI boot
|
|
1813
1834
|
// path and carry both `mcp` and `tui` surfaces. They are intentionally not
|
|
1814
1835
|
// part of the fixed built-in family allowlist above; include these explicit
|
|
@@ -1822,7 +1843,7 @@ function buildEssentialSessionRuntimeToolSpecs(opts: {
|
|
|
1822
1843
|
.map(name => optionalByName.get(name))
|
|
1823
1844
|
.filter((tool): tool is LLMToolSpec => !!tool)
|
|
1824
1845
|
.filter(tool => isToolAvailable(tool.name, opts.toolAvailability));
|
|
1825
|
-
return [...nativeSpecs, ...hostSpecs, ...runtimeSpecs, ...mcpProxySpecs, ...optionalSpecs];
|
|
1846
|
+
return [...nativeSpecs, ...hostSpecs, ...runtimeSpecs, ...runtimeExtras, ...explicitIntegrationSpecs, ...mcpProxySpecs, ...optionalSpecs];
|
|
1826
1847
|
}
|
|
1827
1848
|
|
|
1828
1849
|
/** Build the full TUI-visible catalog for Agent children. The parent model's
|
|
@@ -1897,13 +1918,26 @@ export function buildSessionRuntimeToolSpecs(opts: {
|
|
|
1897
1918
|
.map(name => hostByName.get(name))
|
|
1898
1919
|
.filter((tool): tool is LLMToolDef => !!tool)
|
|
1899
1920
|
.map(toSpec);
|
|
1921
|
+
// classic dashboard turns use rich=false, whose essential catalog skips
|
|
1922
|
+
// intent-based native selection. Preserve the explicitly registered
|
|
1923
|
+
// Linear runtime there; put it first for ordered issue-then-research asks.
|
|
1924
|
+
const linearIssueSpec = hasAny(normalizedIntentText, ['linear', '리니어'])
|
|
1925
|
+
? (opts.runtimeTools ?? []).find(tool => tool.id === 'elanous_linear_issue')?.spec
|
|
1926
|
+
: undefined;
|
|
1927
|
+
const orderedLinear = !!linearIssueSpec && isOrderedNonResearchWorkflow(opts.userText)
|
|
1928
|
+
&& hasAny(normalizedIntentText, ['linear', '리니어']);
|
|
1900
1929
|
const droppedNames = new Set(['Edit', 'Write']);
|
|
1901
1930
|
const dropWriteTools = hasDevHarnessIntent(opts.userText);
|
|
1902
1931
|
const droppedWriteSpecs = dropWriteTools
|
|
1903
1932
|
? essentialSpecs.filter(spec => droppedNames.has(spec.name))
|
|
1904
1933
|
: [];
|
|
1905
1934
|
const finalSpecs: LLMToolSpec[] = [...new Map(
|
|
1906
|
-
[
|
|
1935
|
+
[
|
|
1936
|
+
...(orderedLinear && linearIssueSpec ? [linearIssueSpec] : []),
|
|
1937
|
+
...essentialSpecs,
|
|
1938
|
+
...intentHostSpecs,
|
|
1939
|
+
...(!orderedLinear && linearIssueSpec ? [linearIssueSpec] : []),
|
|
1940
|
+
]
|
|
1907
1941
|
.filter(spec => !dropWriteTools || !droppedNames.has(spec.name))
|
|
1908
1942
|
.map(spec => [spec.name, spec] as const),
|
|
1909
1943
|
).values()];
|
|
@@ -2755,6 +2789,14 @@ function isToolAvailable(
|
|
|
2755
2789
|
return true;
|
|
2756
2790
|
}
|
|
2757
2791
|
|
|
2792
|
+
/** Filter a surface's candidate tool specs through the same availability gate used by the session catalog. */
|
|
2793
|
+
export function filterAvailableToolSpecs(
|
|
2794
|
+
specs: readonly LLMToolSpec[],
|
|
2795
|
+
overrides?: Readonly<Record<string, boolean>>,
|
|
2796
|
+
): LLMToolSpec[] {
|
|
2797
|
+
return specs.filter(spec => isToolAvailable(spec.name, overrides));
|
|
2798
|
+
}
|
|
2799
|
+
|
|
2758
2800
|
function isNativeToolAvailable(
|
|
2759
2801
|
name: string,
|
|
2760
2802
|
rule: SessionNativeToolRule,
|