elanous 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-53fe7ab5dbd19607.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-c9e997416c86c8dd.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/autopilot/page-4e24912975188223.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/board/{page-26941f067e899ed3.js → page-b117b7ee316afe86.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/botlab/{page-3c29b0e0d681e33d.js → page-a447a17fd887c68e.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/bots/page-2b3e0df385eba76f.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ceo/{page-1224ce11e2a2eef5.js → page-409ed1d2f2c5f706.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/chat/{page-940b44876305fac2.js → page-1e90543da0a66b63.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/consult/{page-c5b8f3b77568a8e9.js → page-f68c84b50dee9796.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/control/page-afefb7fac0047855.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/decisions/{page-3048505d466ec98a.js → page-79f9d6ae042c07b4.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/design-check/{page-8d97da172a2cd552.js → page-9726864cd21303a2.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/editor/page-ab0febcc6695f4e4.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/exec/page-6f6b157c52869db0.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/field/{page-c4f1095489266f97.js → page-78aef36734ddd588.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/inside/page-6a634383e6247c6b.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/intake/{page-111a4245428caa84.js → page-66f0dc569bce5230.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/{layout-956789c8340e289e.js → layout-fda2f39e4d21744c.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/live/page-a6fd7cb710d80092.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/live-run/page-2a7c714e7f65229d.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/loops/page-a71ad5f5b075be8d.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/market/page-df7f2d252ff836b5.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-7f38deb0998488bf.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/morning/{page-afa5068541a55cd1.js → page-7e80f3b354be205e.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/not-found-5ea0e042882e87de.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/observatory/{page-527a398eac0b4699.js → page-f3df76408c930b99.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-88996ccc31edf06c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ops/release/page-d95db9df4a907fe1.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ops/resources/{page-da8f855dc25cae3d.js → page-5a518950f4136aad.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-d9e070e009e1a521.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/outputs/{page-905013106f55daad.js → page-167c44a8ff378706.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/page-4763cf1b0e52e28b.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/reflection/{page-3b0434a6fc1154e1.js → page-a5bcd883385064d4.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/scheduler/{page-9deae0524ce7a7e2.js → page-f9ef43f59ba98937.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/sessions/{page-4f4f0858754f73a4.js → page-43c5d7004582f888.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-20dfe2b5bca855eb.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/settings/page-7c022f7edf3203d5.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/setup/done/{page-2e8cc4d212f1ca01.js → page-adc6daed842128e6.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/page-683c175da53e9ec3.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/share/page-a91d9cbaf50cc8b4.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-376f3a03f4d31706.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/tasks/{page-aedaede687cc293d.js → page-256d83e84ed55191.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/term/{page-bb5c95ce68358be2.js → page-5e1fb7a8e0927cf6.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/today/page-95994b2b507ee120.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/trace/{page-45967d78c1748112.js → page-486b1d3605dbd5f3.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/vault/{page-9a1cdd7c5a50bf73.js → page-0159591688c45cae.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-e640489e459c2789.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workflows/page-89c00bebfb27b5d5.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workspace/{page-8f291522cb3d91a6.js → page-edf90eaa6d354fee.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/worktrees/page-2f2bd38085305ef0.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/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-traversal.ts +3 -3
- 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/prompt-library/session-guidance.ts +7 -6
- 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/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/bots/page-d1cdb65c4ceb5c33.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/control/page-77db1e47b120b94e.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/editor/page-6a36535d413596b1.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/inside/page-ea374796ca2317b9.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/loops/page-e911bcd2bfb5c305.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/market/page-52b55f54c9d8e0fb.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/not-found-3eb72a4f6788a903.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-c9e4ca5025534239.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/page-f95beb047d743d09.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/share/page-b8c0c73c2e5a8917.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/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/worktrees/page-52b36e1c8acd087f.js +0 -1
- /package/apps/pwa/out/_next/static/{5URFQKPO21SIgTlLvb1Jv → K-ckEB9hu9tXQ6iqnl27L}/_buildManifest.js +0 -0
- /package/apps/pwa/out/_next/static/{5URFQKPO21SIgTlLvb1Jv → K-ckEB9hu9tXQ6iqnl27L}/_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
|
{
|
|
@@ -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;
|
|
@@ -220,8 +220,8 @@ export function buildRunTraversal(runId: string, entries: readonly RunLedgerEntr
|
|
|
220
220
|
const contract = sorted.find((entry) => entry.event === 'graph-run-contract-resolved')?.data;
|
|
221
221
|
const pr = [...sorted].reverse().find((entry) => entry.event === 'pr-opened')?.data;
|
|
222
222
|
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');
|
|
223
|
+
const graphEvents = projected.steps.filter((step): step is Extract<RunStep, { type: 'node-added' | 'edge-rerouted' | 'priority-changed' | 'unit-expanded' | 'unit-collapsed' }> =>
|
|
224
|
+
step.type === 'node-added' || step.type === 'edge-rerouted' || step.type === 'priority-changed' || step.type === 'unit-expanded' || step.type === 'unit-collapsed');
|
|
225
225
|
const journeyEdges = sorted.flatMap((entry) => {
|
|
226
226
|
const source = entry.data.source;
|
|
227
227
|
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);
|
|
@@ -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
|
|
|
@@ -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,
|
|
@@ -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
|
+
}
|