hanseol-dev 5.0.16-dev.0 → 5.1.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/README.md +80 -0
- package/dist/agents/browser/browser-sub-agent.d.ts +1 -0
- package/dist/agents/browser/browser-sub-agent.d.ts.map +1 -1
- package/dist/agents/browser/browser-sub-agent.js +2 -1
- package/dist/agents/browser/browser-sub-agent.js.map +1 -1
- package/dist/agents/browser/confluence-agent.d.ts.map +1 -1
- package/dist/agents/browser/confluence-agent.js +15 -8
- package/dist/agents/browser/confluence-agent.js.map +1 -1
- package/dist/agents/browser/jira-agent.d.ts.map +1 -1
- package/dist/agents/browser/jira-agent.js +5 -2
- package/dist/agents/browser/jira-agent.js.map +1 -1
- package/dist/agents/browser/prompts.d.ts +3 -3
- package/dist/agents/browser/prompts.d.ts.map +1 -1
- package/dist/agents/browser/prompts.js +286 -134
- package/dist/agents/browser/prompts.js.map +1 -1
- package/dist/agents/browser/search-agent.d.ts.map +1 -1
- package/dist/agents/browser/search-agent.js +16 -3
- package/dist/agents/browser/search-agent.js.map +1 -1
- package/dist/agents/planner/index.d.ts.map +1 -1
- package/dist/agents/planner/index.js +32 -7
- package/dist/agents/planner/index.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/prompts/agents/planning.d.ts +4 -1
- package/dist/prompts/agents/planning.d.ts.map +1 -1
- package/dist/prompts/agents/planning.js +32 -8
- package/dist/prompts/agents/planning.js.map +1 -1
- package/dist/tools/llm/simple/planning-tools.d.ts +1 -0
- package/dist/tools/llm/simple/planning-tools.d.ts.map +1 -1
- package/dist/tools/llm/simple/planning-tools.js +37 -0
- package/dist/tools/llm/simple/planning-tools.js.map +1 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +11 -2
- package/dist/tools/registry.js.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ https://github.com/user-attachments/assets/77cc96c9-cb22-4411-8744-3a006b00c580
|
|
|
18
18
|
- **Read/search/edit/create code** with safe, file-level changes.
|
|
19
19
|
- **Plan & Execute**: breaks tasks into TODOs and runs them step by step.
|
|
20
20
|
- **Supervised Mode**: approval required before file modifications.
|
|
21
|
+
- **Deep Research**: Built-in web search via headless Chrome — no Tavily, Google API, or external search service needed. Searches Naver & Google, visits source pages, cross-verifies facts, and returns cited answers.
|
|
21
22
|
- **Browser automation**: Chrome/Edge CDP control (navigate, click, screenshot).
|
|
22
23
|
- **Office automation**: PowerShell/COM control for Excel/Word/PowerPoint.
|
|
23
24
|
- **Session management**: save and restore conversation history.
|
|
@@ -49,6 +50,45 @@ Request approval before running file modification tools.
|
|
|
49
50
|
### Plan & Execute
|
|
50
51
|
Automatically turns requests into TODOs and executes them in order.
|
|
51
52
|
|
|
53
|
+
### Deep Research (Search Sub-Agent)
|
|
54
|
+
Performs Perplexity-level web research using its own headless Chrome engine — **no external search API (Tavily, SerpAPI, Google API) required**.
|
|
55
|
+
|
|
56
|
+
- Dual-engine search: Naver (primary) + Google (secondary)
|
|
57
|
+
- **Internal source search**: Configure additional URLs (Confluence, internal wikis) via `researchUrls` in config
|
|
58
|
+
- Visits actual source pages, extracts content, cross-verifies facts
|
|
59
|
+
- Injects today's date for recency assessment
|
|
60
|
+
- Returns comprehensive answers with source citations
|
|
61
|
+
- Handles Cloudflare-blocked sites gracefully (auto-skip + alternative sources)
|
|
62
|
+
|
|
63
|
+
### Confluence Integration
|
|
64
|
+
Edit or create Confluence pages directly via `confluence_request`:
|
|
65
|
+
|
|
66
|
+
- Opens a visible browser to access Confluence
|
|
67
|
+
- Supports macros, tables, rich text, ProseMirror/TinyMCE editors
|
|
68
|
+
- Configure `browserServices` with type `confluence` in config to enable
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"browserServices": [{ "type": "confluence", "name": "My Confluence", "url": "https://confluence.example.com" }],
|
|
73
|
+
"researchUrls": [{ "name": "My Confluence", "url": "https://confluence.example.com" }]
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Jira Integration
|
|
78
|
+
Manage Jira issues directly via `jira_request`:
|
|
79
|
+
|
|
80
|
+
- Opens a **visible browser** to access Jira (no API key needed)
|
|
81
|
+
- Fetch assigned/watching issues via JQL, create issues (Epic, Story, Task, Bug, Sub-task), add comments, transition status
|
|
82
|
+
- Two-phase issue creation: fill form → user confirmation → submit
|
|
83
|
+
- Autonomous DOM discovery — works with Cloud, Server, and Data Center
|
|
84
|
+
- Configure `browserServices` with type `jira` in config to enable
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"browserServices": [{ "type": "jira", "name": "My Jira", "url": "https://jira.example.com" }]
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
52
92
|
### Automation Extensions
|
|
53
93
|
- **Browser**: PowerShell/Chrome CDP, no external server required.
|
|
54
94
|
- **Office**: PowerShell/COM automation for Excel/Word/PowerPoint.
|
|
@@ -136,6 +176,7 @@ MIT License
|
|
|
136
176
|
- **코드 읽기/검색/수정/생성**: 파일 단위로 안전하게 수정합니다.
|
|
137
177
|
- **Plan & Execute**: 작업을 TODO로 분해하고 단계적으로 실행합니다.
|
|
138
178
|
- **Supervised Mode**: 파일 변경 전 사용자 승인 기반 작업.
|
|
179
|
+
- **Deep Research (자체 웹 검색)**: Tavily, Google API 등 외부 검색 서비스 없이 자체 headless Chrome으로 Naver/Google을 직접 검색하고 소스 페이지를 방문하여 정보를 수집·교차검증·합성합니다.
|
|
139
180
|
- **브라우저 자동화**: Chrome/Edge CDP 제어(탭 이동, 클릭, 스크린샷 등).
|
|
140
181
|
- **Office 자동화**: PowerShell/COM 기반 Excel/Word/PowerPoint 제어.
|
|
141
182
|
- **세션 관리**: 대화 및 작업 히스토리 저장/복원.
|
|
@@ -193,6 +234,45 @@ You: 로깅 시스템 추가해줘
|
|
|
193
234
|
└────────────────────────────────────────────────┘
|
|
194
235
|
```
|
|
195
236
|
|
|
237
|
+
### Deep Research (자체 웹 검색 엔진)
|
|
238
|
+
외부 검색 API(Tavily, SerpAPI, Google API) 없이 **자체 headless Chrome 엔진**으로 웹 리서치를 수행합니다.
|
|
239
|
+
|
|
240
|
+
- 듀얼 엔진: Naver(1차) + Google(2차) 동시 검색
|
|
241
|
+
- **내부 소스 검색**: config의 `researchUrls`에 Confluence, 사내 위키 등의 URL을 추가하면 웹 검색과 함께 자동 검색
|
|
242
|
+
- 검색 결과의 실제 소스 페이지를 방문하여 본문 내용 추출
|
|
243
|
+
- 복수 소스 간 교차 검증 후 출처와 함께 종합 답변 생성
|
|
244
|
+
- 오늘 날짜 자동 주입으로 최신 정보 여부 판단
|
|
245
|
+
- Cloudflare 차단 사이트 자동 우회 (블로그/뉴스 경유)
|
|
246
|
+
|
|
247
|
+
### Confluence 연동
|
|
248
|
+
`confluence_request`로 Confluence 페이지를 직접 편집하거나 생성할 수 있습니다.
|
|
249
|
+
|
|
250
|
+
- config의 `browserServices`에 Confluence URL을 추가하면 활성화
|
|
251
|
+
- config의 `researchUrls`에 추가하면 Deep Research에서도 Confluence 검색 가능
|
|
252
|
+
- 매크로, 테이블, 리치 텍스트, ProseMirror/TinyMCE 에디터 지원
|
|
253
|
+
|
|
254
|
+
```json
|
|
255
|
+
{
|
|
256
|
+
"browserServices": [{ "type": "confluence", "name": "My Confluence", "url": "https://confluence.example.com" }],
|
|
257
|
+
"researchUrls": [{ "name": "My Confluence", "url": "https://confluence.example.com" }]
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Jira 연동
|
|
262
|
+
`jira_request`로 Jira 이슈를 직접 관리할 수 있습니다.
|
|
263
|
+
|
|
264
|
+
- **가시적 브라우저**로 Jira에 직접 접속 (API 키 불필요)
|
|
265
|
+
- JQL로 할당/워처 이슈 조회, 이슈 생성(Epic/Story/Task/Bug/Sub-task), 코멘트, 상태 전환
|
|
266
|
+
- 이슈 생성 시 2단계 확인: 폼 입력 → 사용자 확인 → 제출
|
|
267
|
+
- 자율 DOM 탐색으로 Cloud, Server, Data Center 모두 지원
|
|
268
|
+
- config의 `browserServices`에 Jira URL을 추가하면 활성화
|
|
269
|
+
|
|
270
|
+
```json
|
|
271
|
+
{
|
|
272
|
+
"browserServices": [{ "type": "jira", "name": "My Jira", "url": "https://jira.example.com" }]
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
|
|
196
276
|
### 최신 자동화 확장
|
|
197
277
|
- **브라우저 자동화**: PowerShell/Chrome CDP 기반, 별도 서버 없음
|
|
198
278
|
- **Office 자동화**: PowerShell/COM 기반, Excel/Word/PowerPoint 직접 제어
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-sub-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/browser/browser-sub-agent.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIjE,OAAO,EAKL,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAGtC,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC9C,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"browser-sub-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/browser/browser-sub-agent.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIjE,OAAO,EAKL,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAGtC,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC9C,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,qBAAa,eAAe;IAExB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,MAAM;gBAJN,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,aAAa,EAAE,EACtB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,qBAAqB;IAGjC,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IA2EvE,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,0BAA0B;IAiBlC,OAAO,CAAC,iBAAiB;YAaX,qBAAqB;CAyEpC"}
|
|
@@ -25,7 +25,8 @@ export class BrowserSubAgent {
|
|
|
25
25
|
error: this.getUrlNotConfiguredMessage(),
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const headless = this.config.headless !== undefined ? this.config.headless : true;
|
|
29
|
+
const launchResult = await launchSubAgentBrowser(headless);
|
|
29
30
|
if (!launchResult.success) {
|
|
30
31
|
return {
|
|
31
32
|
success: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-sub-agent.js","sourceRoot":"","sources":["../../../src/agents/browser/browser-sub-agent.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAA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QAAQ,CAAwC,CAAC,CAAC;oBAC5G,MAAM;gBACR;oBACE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,yBAAyB,QAAQ,EAAE,EAAE,CAAC;YAC1E,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,eAAe,EAAE,CAAC;YACpE,CAAC;YAGD,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;YACpD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC;gBAC7C,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC/B,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC;YAErC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7G,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,yBAAyB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;aACzF,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confluence-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/browser/confluence-agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"confluence-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/browser/confluence-agent.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAKpD,wBAAgB,2BAA2B,IAAI,YAAY,CA6C1D"}
|
|
@@ -7,26 +7,33 @@ export function createConfluenceRequestTool() {
|
|
|
7
7
|
type: 'function',
|
|
8
8
|
function: {
|
|
9
9
|
name: 'confluence_request',
|
|
10
|
-
description: 'Delegate a task to the
|
|
10
|
+
description: 'Delegate a Confluence page edit or creation task to the specialist agent. Opens a visible browser to directly access Confluence and perform modifications. Handles macros, tables, markdown, rich text formatting, and all Confluence-specific content. Provide a specific page URL for editing, or a space URL for page creation.',
|
|
11
11
|
parameters: {
|
|
12
12
|
type: 'object',
|
|
13
13
|
properties: {
|
|
14
|
-
|
|
14
|
+
target_url: {
|
|
15
15
|
type: 'string',
|
|
16
|
-
description: '
|
|
16
|
+
description: 'Confluence page URL to edit, or space URL to create a new page in. Example: https://confluence.example.com/wiki/spaces/TEAM/pages/12345',
|
|
17
17
|
},
|
|
18
|
-
|
|
18
|
+
instruction: {
|
|
19
19
|
type: 'string',
|
|
20
|
-
description: '
|
|
20
|
+
description: 'Detailed instruction for what to edit or create. Include specific content changes, formatting requirements, macro usage, table modifications, etc.',
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
|
-
required: ['instruction'],
|
|
23
|
+
required: ['target_url', 'instruction'],
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
execute: async (args, llmClient) => {
|
|
28
|
-
const
|
|
29
|
-
|
|
28
|
+
const targetUrl = args['target_url'];
|
|
29
|
+
const instruction = args['instruction'];
|
|
30
|
+
const agent = new BrowserSubAgent(llmClient, 'confluence', BROWSER_SUB_AGENT_TOOLS, CONFLUENCE_SYSTEM_PROMPT, {
|
|
31
|
+
requiresAuth: true,
|
|
32
|
+
serviceType: 'confluence',
|
|
33
|
+
maxIterations: 30,
|
|
34
|
+
headless: false,
|
|
35
|
+
});
|
|
36
|
+
return agent.run(instruction, targetUrl);
|
|
30
37
|
},
|
|
31
38
|
categories: ['llm-agent'],
|
|
32
39
|
requiresSubLLM: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confluence-agent.js","sourceRoot":"","sources":["../../../src/agents/browser/confluence-agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"confluence-agent.js","sourceRoot":"","sources":["../../../src/agents/browser/confluence-agent.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAExD,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL,UAAU,EAAE;YACV,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE;gBACR,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EACT,oUAAoU;gBACtU,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,UAAU,EAAE;4BACV,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,yIAAyI;yBACvJ;wBACD,WAAW,EAAE;4BACX,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,oJAAoJ;yBAClK;qBACF;oBACD,QAAQ,EAAE,CAAC,YAAY,EAAE,aAAa,CAAC;iBACxC;aACF;SACF;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;YACjC,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAW,CAAC;YAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAW,CAAC;YAElD,MAAM,KAAK,GAAG,IAAI,eAAe,CAC/B,SAAS,EACT,YAAY,EACZ,uBAAuB,EACvB,wBAAwB,EACxB;gBACE,YAAY,EAAE,IAAI;gBAClB,WAAW,EAAE,YAAY;gBACzB,aAAa,EAAE,EAAE;gBACjB,QAAQ,EAAE,KAAK;aAChB,CACF,CAAC;YACF,OAAO,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QAC3C,CAAC;QACD,UAAU,EAAE,CAAC,WAAW,CAAC;QACzB,cAAc,EAAE,IAAI;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jira-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/browser/jira-agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jira-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/browser/jira-agent.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAKpD,wBAAgB,qBAAqB,IAAI,YAAY,CAwCpD"}
|
|
@@ -7,7 +7,10 @@ export function createJiraRequestTool() {
|
|
|
7
7
|
type: 'function',
|
|
8
8
|
function: {
|
|
9
9
|
name: 'jira_request',
|
|
10
|
-
description: 'Delegate a task to the Jira specialist agent.
|
|
10
|
+
description: 'Delegate a task to the Jira specialist agent. Opens a visible browser to directly access Jira and perform operations. ' +
|
|
11
|
+
'Capabilities: fetch assigned/watching issues via JQL, create issues (Epic, Story, Task, Bug, Sub-task) with user confirmation, ' +
|
|
12
|
+
'add comments, view issue details, transition status, and general JQL search. ' +
|
|
13
|
+
'Works with Jira Cloud, Server, and Data Center.',
|
|
11
14
|
parameters: {
|
|
12
15
|
type: 'object',
|
|
13
16
|
properties: {
|
|
@@ -25,7 +28,7 @@ export function createJiraRequestTool() {
|
|
|
25
28
|
},
|
|
26
29
|
},
|
|
27
30
|
execute: async (args, llmClient) => {
|
|
28
|
-
const agent = new BrowserSubAgent(llmClient, 'jira', BROWSER_SUB_AGENT_TOOLS, JIRA_SYSTEM_PROMPT, { requiresAuth: true, serviceType: 'jira' });
|
|
31
|
+
const agent = new BrowserSubAgent(llmClient, 'jira', BROWSER_SUB_AGENT_TOOLS, JIRA_SYSTEM_PROMPT, { requiresAuth: true, serviceType: 'jira', maxIterations: 30, headless: false });
|
|
29
32
|
return agent.run(args['instruction'], args['source']);
|
|
30
33
|
},
|
|
31
34
|
categories: ['llm-agent'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jira-agent.js","sourceRoot":"","sources":["../../../src/agents/browser/jira-agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jira-agent.js","sourceRoot":"","sources":["../../../src/agents/browser/jira-agent.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,UAAU,EAAE;YACV,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE;gBACR,IAAI,EAAE,cAAc;gBACpB,WAAW,EACT,wHAAwH;oBACxH,iIAAiI;oBACjI,+EAA+E;oBAC/E,iDAAiD;gBACnD,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,WAAW,EAAE;4BACX,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,2DAA2D;yBACzE;wBACD,MAAM,EAAE;4BACN,IAAI,EAAE,QAAQ;4BACd,WAAW,EAAE,mFAAmF;yBACjG;qBACF;oBACD,QAAQ,EAAE,CAAC,aAAa,CAAC;iBAC1B;aACF;SACF;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;YACjC,MAAM,KAAK,GAAG,IAAI,eAAe,CAC/B,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,kBAAkB,EAClB,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAChF,CAAC;YACF,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAW,EAAE,IAAI,CAAC,QAAQ,CAAuB,CAAC,CAAC;QACxF,CAAC;QACD,UAAU,EAAE,CAAC,WAAW,CAAC;QACzB,cAAc,EAAE,IAAI;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const CONFLUENCE_SYSTEM_PROMPT = "You are an elite browser automation agent.\nExecute the user's instruction using the available browser tools.\nWhen the task is complete, you MUST call the \"complete\" tool with a detailed summary.\nCall only one tool at a time. After each tool result, decide the next step.\nAlways respond in the same language as the user's instruction.\n\n\u2550\u2550\u2550 TOOL USAGE \u2550\u2550\u2550\n\u2022 browser_navigate: Navigate to a URL\n\u2022 browser_click: Click an element by CSS selector\n\u2022 browser_fill: Fill a value into an input field\n\u2022 browser_type: Type text character by character\n\u2022 browser_get_text: Get text from page/element (omit selector for full page)\n\u2022 browser_get_html: Get the page HTML\n\u2022 browser_get_page_info: Get current URL, title, and basic info\n\u2022 browser_screenshot: Take a screenshot (for debugging)\n\u2022 browser_execute_script: Execute JavaScript (DOM manipulation, data extraction)\n\u2022 browser_wait: Wait until a CSS selector appears\n\u2022 browser_press_key: Press a keyboard key (Enter, Tab, Escape, etc.)\n\u2022 browser_focus: Focus the browser window\n\u2022 browser_send: Send a raw CDP command\n\n\u2550\u2550\u2550 NAVIGATION STRATEGY \u2550\u2550\u2550\n1. If [Target URL] is provided, use that URL as the starting point\n2. After page load, always check current state with browser_get_page_info\n3. For dynamic pages, use browser_wait to wait for element loading before proceeding\n4. In SPAs (Single Page Apps), DOM may change without URL change \u2192 verify with browser_get_text/get_html\n\n\u2550\u2550\u2550 SELECTOR STRATEGY \u2550\u2550\u2550\nCSS selector priority:\n1. [data-testid=\"...\"], [data-test=\"...\"] \u2014 Test attributes (most stable)\n2. #id \u2014 ID selectors\n3. [aria-label=\"...\"], [role=\"...\"] \u2014 Accessibility attributes\n4. .className \u2014 Classes (may change with frameworks)\n5. Tag combinations \u2014 div > span:nth-child(2) (last resort)\nIf page structure is unknown, check with browser_get_html first.\n\n\u2550\u2550\u2550 ERROR RECOVERY \u2550\u2550\u2550\n1. Click/input fails \u2192 use browser_wait for element, then retry\n2. Selector not found \u2192 use browser_get_html to inspect actual DOM, then fix selector\n3. Page not loaded \u2192 check URL with browser_get_page_info \u2192 re-navigate if needed\n4. Try at least 2 different approaches before reporting failure\n\n\u2550\u2550\u2550 CONFLUENCE EXPERT \u2550\u2550\u2550\nYou are a Confluence automation specialist.\n\n\u2550\u2550\u2550 COMMON CONFLUENCE URLS \u2550\u2550\u2550\n\u2022 Main page: {baseUrl}/wiki/spaces/{spaceKey}/overview\n\u2022 View page: {baseUrl}/wiki/spaces/{spaceKey}/pages/{pageId}\n\u2022 Create page: {baseUrl}/wiki/spaces/{spaceKey}/pages/create\n\u2022 Search: {baseUrl}/wiki/search?text={query}\n\u2022 Space list: {baseUrl}/wiki/spaces\n\n\u2550\u2550\u2550 PAGE VIEWING \u2550\u2550\u2550\nSTEP 1: browser_navigate \u2192 target page URL\nSTEP 2: browser_wait \u2192 \"#content\" or \".wiki-content\" (wait for page content to load)\nSTEP 3: browser_get_text \u2192 \"#content\" or \"#main-content\" (extract body text)\nSTEP 4: complete \u2192 return organized content\n\n\u2550\u2550\u2550 PAGE EDITING \u2550\u2550\u2550\nSTEP 1: browser_navigate \u2192 page URL\nSTEP 2: Click edit button: browser_click \u2192 \"#editPageLink\" or \"button[aria-label='Edit']\" or \"a[href*='editpage']\"\n \u26A0 Confluence Cloud: \".css-1vdy7v\" or \"[data-testid='edit-button']\"\n \u26A0 Confluence Server: \"#editPageLink\"\nSTEP 3: Wait for editor: browser_wait \u2192 \".ProseMirror\" or \"#tinymce\" or \"#wysiwygTextarea\"\nSTEP 4: Modify content:\n \u2022 Confluence Cloud (ProseMirror editor):\n - browser_click \u2192 \".ProseMirror\" (focus editor)\n - browser_execute_script \u2192 document.querySelector('.ProseMirror').innerHTML to check current content\n - browser_type or browser_execute_script to modify content\n \u2022 Confluence Server (TinyMCE):\n - browser_execute_script \u2192 tinymce.activeEditor.getContent() to check current content\n - browser_execute_script \u2192 tinymce.activeEditor.setContent(html) to set content\nSTEP 5: Save:\n \u2022 browser_click \u2192 \"#rte-button-publish\" or \"[data-testid='publish-button']\" or \"button:has-text('Publish')\"\n \u2022 or browser_press_key \u2192 \"Control+s\" (shortcut)\nSTEP 6: Verify save, then complete\n\n\u2550\u2550\u2550 PAGE CREATION \u2550\u2550\u2550\nSTEP 1: browser_navigate \u2192 {baseUrl}/wiki/spaces/{spaceKey}/pages/create\n or \"+\" button: browser_click \u2192 \"[data-testid='create-button']\"\nSTEP 2: Wait for editor: browser_wait \u2192 \".ProseMirror\" or \"#tinymce\"\nSTEP 3: Enter title: browser_fill \u2192 \"[data-testid='title-text-area']\" or \"#content-title\"\nSTEP 4: Write body (same as EDITING STEP 4)\nSTEP 5: Save (same as EDITING STEP 5)\n\n\u2550\u2550\u2550 SEARCH \u2550\u2550\u2550\nbrowser_navigate \u2192 {baseUrl}/wiki/search?text={encodedQuery}\nbrowser_wait \u2192 \".search-results\" or \"[data-testid='search-results']\"\nbrowser_get_text \u2192 search results area\n\n\u2550\u2550\u2550 COMMENT \u2550\u2550\u2550\nPage bottom comment area:\nbrowser_click \u2192 \"#comments-section-title\" or \"button:has-text('Add comment')\"\nbrowser_wait \u2192 wait for comment editor to load\nbrowser_type \u2192 comment content\nbrowser_click \u2192 save button\n\n\u2550\u2550\u2550 IMPORTANT \u2550\u2550\u2550\n\u2022 Confluence Cloud vs Server have different DOM structures \u2192 check with browser_get_html first\n\u2022 Editor content may be inside an iframe \u2192 use browser_execute_script to access iframe content\n\u2022 After saving, always verify the page displays correctly \u2192 check URL with browser_get_page_info";
|
|
2
|
-
export declare const JIRA_SYSTEM_PROMPT = "You are an elite browser automation agent.\nExecute the user's instruction using the available browser tools.\nWhen the task is complete, you MUST call the \"complete\" tool with a detailed summary.\nCall only one tool at a time. After each tool result, decide the next step.\nAlways respond in the same language as the user's instruction.\n\n\u2550\u2550\u2550 TOOL USAGE \u2550\u2550\u2550\n\u2022 browser_navigate: Navigate to a URL\n\u2022 browser_click: Click an element by CSS selector\n\u2022 browser_fill: Fill a value into an input field\n\u2022 browser_type: Type text character by character\n\u2022 browser_get_text: Get text from page/element (omit selector for full page)\n\u2022 browser_get_html: Get the page HTML\n\u2022 browser_get_page_info: Get current URL, title, and basic info\n\u2022 browser_screenshot: Take a screenshot (for debugging)\n\u2022 browser_execute_script: Execute JavaScript (DOM manipulation, data extraction)\n\u2022 browser_wait: Wait until a CSS selector appears\n\u2022 browser_press_key: Press a keyboard key (Enter, Tab, Escape, etc.)\n\u2022 browser_focus: Focus the browser window\n\u2022 browser_send: Send a raw CDP command\n\n\u2550\u2550\u2550 NAVIGATION STRATEGY \u2550\u2550\u2550\n1. If [Target URL] is provided, use that URL as the starting point\n2. After page load, always check current state with browser_get_page_info\n3. For dynamic pages, use browser_wait to wait for element loading before proceeding\n4. In SPAs (Single Page Apps), DOM may change without URL change \u2192 verify with browser_get_text/get_html\n\n\u2550\u2550\u2550 SELECTOR STRATEGY \u2550\u2550\u2550\nCSS selector priority:\n1. [data-testid=\"...\"], [data-test=\"...\"] \u2014 Test attributes (most stable)\n2. #id \u2014 ID selectors\n3. [aria-label=\"...\"], [role=\"...\"] \u2014 Accessibility attributes\n4. .className \u2014 Classes (may change with frameworks)\n5. Tag combinations \u2014 div > span:nth-child(2) (last resort)\nIf page structure is unknown, check with browser_get_html first.\n\n\u2550\u2550\u2550 ERROR RECOVERY \u2550\u2550\u2550\n1. Click/input fails \u2192 use browser_wait for element, then retry\n2. Selector not found \u2192 use browser_get_html to inspect actual DOM, then fix selector\n3. Page not loaded \u2192 check URL with browser_get_page_info \u2192 re-navigate if needed\n4. Try at least 2 different approaches before reporting failure\n\n\u2550\u2550\u2550 JIRA
|
|
3
|
-
export declare const SEARCH_SYSTEM_PROMPT = "You are an elite browser automation agent.\nExecute the user's instruction using the available browser tools.\nWhen the task is complete, you MUST call the \"complete\" tool with a detailed summary.\nCall only one tool at a time. After each tool result, decide the next step.\nAlways respond in the same language as the user's instruction.\n\n\u2550\u2550\u2550 TOOL USAGE \u2550\u2550\u2550\n\u2022 browser_navigate: Navigate to a URL\n\u2022 browser_click: Click an element by CSS selector\n\u2022 browser_fill: Fill a value into an input field\n\u2022 browser_type: Type text character by character\n\u2022 browser_get_text: Get text from page/element (omit selector for full page)\n\u2022 browser_get_html: Get the page HTML\n\u2022 browser_get_page_info: Get current URL, title, and basic info\n\u2022 browser_screenshot: Take a screenshot (for debugging)\n\u2022 browser_execute_script: Execute JavaScript (DOM manipulation, data extraction)\n\u2022 browser_wait: Wait until a CSS selector appears\n\u2022 browser_press_key: Press a keyboard key (Enter, Tab, Escape, etc.)\n\u2022 browser_focus: Focus the browser window\n\u2022 browser_send: Send a raw CDP command\n\n\u2550\u2550\u2550 NAVIGATION STRATEGY \u2550\u2550\u2550\n1. If [Target URL] is provided, use that URL as the starting point\n2. After page load, always check current state with browser_get_page_info\n3. For dynamic pages, use browser_wait to wait for element loading before proceeding\n4. In SPAs (Single Page Apps), DOM may change without URL change \u2192 verify with browser_get_text/get_html\n\n\u2550\u2550\u2550 SELECTOR STRATEGY \u2550\u2550\u2550\nCSS selector priority:\n1. [data-testid=\"...\"], [data-test=\"...\"] \u2014 Test attributes (most stable)\n2. #id \u2014 ID selectors\n3. [aria-label=\"...\"], [role=\"...\"] \u2014 Accessibility attributes\n4. .className \u2014 Classes (may change with frameworks)\n5. Tag combinations \u2014 div > span:nth-child(2) (last resort)\nIf page structure is unknown, check with browser_get_html first.\n\n\u2550\u2550\u2550 ERROR RECOVERY \u2550\u2550\u2550\n1. Click/input fails \u2192 use browser_wait for element, then retry\n2. Selector not found \u2192 use browser_get_html to inspect actual DOM, then fix selector\n3. Page not loaded \u2192 check URL with browser_get_page_info \u2192 re-navigate if needed\n4. Try at least 2 different approaches before reporting failure\n\n\u2550\u2550\u2550 DEEP RESEARCH EXPERT \u2550\u2550\u2550\nYou are an elite web research agent that performs Perplexity-level deep research.\nYour mission: find ACCURATE, CURRENT information by searching MULTIPLE engines,\nvisiting actual source pages, cross-verifying facts, and synthesizing a comprehensive answer with citations.\n\n\u2550\u2550\u2550 CORE PRINCIPLES \u2550\u2550\u2550\n1. ALWAYS start with Naver (more reliable in headless mode), then try Google as secondary\n2. ALWAYS visit actual source pages \u2014 search snippets are incomplete/outdated\n3. Cross-verify key facts between multiple sources before reporting\n4. Include source URLs as citations in every answer\n5. Today's date is provided in [Today's Date: ...] \u2014 use it to assess recency\n6. Prefer authoritative sources: official docs, papers, .gov, .org > blogs > forums\n7. If sources conflict, report the discrepancy explicitly\n8. Be EFFICIENT \u2014 skip blocked pages immediately, never retry failed navigations\n\n\u2550\u2550\u2550 BLOCKED DOMAINS \u2014 NEVER NAVIGATE TO THESE \u2550\u2550\u2550\n\u26A0 These domains block headless browsers (Cloudflare/bot detection). Even if they appear in search results, DO NOT click them.\nBLOCKED: openai.com, platform.openai.com, anthropic.com, claude.com, docs.anthropic.com, assets.anthropic.com, aws.amazon.com, cloud.google.com\nBefore EVERY browser_navigate call, check if the URL contains any blocked domain. If it does, SKIP it.\n\u2192 Instead: Visit blog articles, news sites, Wikipedia, or comparison sites that summarize the official data.\n\n\u2550\u2550\u2550 SEARCH ENGINES \u2550\u2550\u2550\n\nNaver (PRIMARY \u2014 always start here, no CAPTCHA issues):\n\u2022 URL: https://search.naver.com/search.naver?where=web&query={encodedQuery}\n\u2022 Result extraction (browser_execute_script):\n JSON.stringify((() => {\n const r = [];\n document.querySelectorAll('.lst_total .bx').forEach(el => {\n const a = el.querySelector('.total_tit a, .api_txt_lines.total_tit a');\n const s = el.querySelector('.dsc_txt, .api_txt_lines.dsc_txt');\n if (a) r.push({ title: a.textContent||'', url: a.href||'', snippet: s?.textContent||'' });\n });\n if (!r.length) document.querySelectorAll('.webpagelist .title_area a, .total_wrap .total_tit a').forEach(a => {\n r.push({ title: a.textContent||'', url: a.href||'', snippet: '' });\n });\n return r.slice(0, 8);\n })())\n\u2022 \u26A0 Naver blog links (blog.naver.com) often fail in headless \u2192 prefer non-blog results, or extract from Naver's inline preview instead\n\nGoogle (SECONDARY \u2014 often blocked by CAPTCHA):\n\u2022 URL: https://www.google.com/search?q={encodedQuery}\n\u2022 For Korean queries: add &hl=ko\n\u2022 Result extraction (browser_execute_script):\n JSON.stringify(Array.from(document.querySelectorAll('#search .g, #rso .g')).slice(0, 8).map(el => ({\n title: el.querySelector('h3')?.textContent || '',\n url: (el.querySelector('a[href^=\"http\"]') || el.querySelector('a'))?.href || '',\n snippet: (el.querySelector('.VwiC3b') || el.querySelector('[data-sncf]') || el.querySelector('.lEBKkf'))?.textContent || ''\n })).filter(r => r.title && r.url && !r.url.includes('google.com/search')))\n\u2022 \u26A0 CAPTCHA detection: If URL contains \"/sorry/\" or page title is unchanged from search URL \u2192 Google blocked you. Do NOT retry. Move on.\n\nStackOverflow (for coding queries):\n\u2022 URL: https://stackoverflow.com/search?q={encodedQuery}\n\u2022 Result extraction: \".s-post-summary\" \u2192 title + vote count + URL\n\u2022 Deep dive: visit top answer page \u2192 extract \".answercell .s-prose\" or \"#answers .answer\"\n\nWikipedia (for factual/academic queries):\n\u2022 Reliable in headless mode, never blocks\n\u2022 URL: https://en.wikipedia.org/wiki/{topic} or search via Naver/Google\n\n\u2550\u2550\u2550 RESEARCH WORKFLOW \u2550\u2550\u2550\n\nPHASE 1: QUERY ANALYSIS (mental \u2014 no tool call)\n- Identify: primary topic, specific facts needed, recency requirements\n- Formulate 1-2 search queries optimized for Naver\n- Note any Cloudflare-blocked sites to avoid\n\nPHASE 2: NAVER SEARCH (primary)\nSTEP 1: browser_navigate \u2192 Naver search URL\nSTEP 2: browser_execute_script \u2192 extract structured results (JSON)\nSTEP 3: Pick 2-3 best results (prefer tech blogs, comparison sites, Wikipedia \u2014 avoid blog.naver.com)\n\nPHASE 3: VISIT SOURCE PAGES (Naver results)\nFor each selected result:\nSTEP 4: browser_navigate \u2192 result URL\n - If navigation fails or page is empty \u2192 SKIP immediately (do not retry)\nSTEP 5: browser_execute_script \u2192 extract main content:\n (document.querySelector('article, [role=\"main\"], main, .content, #content, .post-body, .article-body')?.innerText || document.body.innerText).substring(0, 4000)\nSTEP 6: Record key facts, numbers, dates\n\nPHASE 4: GOOGLE SEARCH (secondary, if Naver results insufficient)\nSTEP 7: browser_navigate \u2192 Google search URL\n - If CAPTCHA (\"/sorry/\" in URL) \u2192 SKIP Google entirely. Use existing Naver data.\nSTEP 8: browser_execute_script \u2192 extract structured results\nSTEP 9: Pick 2-3 results NOT already visited\n\nPHASE 5: VISIT SOURCE PAGES (Google results)\nSTEP 10-12: Same as Phase 3, cross-verify with Naver findings\n\nPHASE 6: DEEP DIVE (only if key facts still missing, ~8 iterations budget)\n- Try a refined Naver search with different keywords\n- Visit Wikipedia for factual/academic topics\n- Visit StackOverflow for coding topics\n- DO NOT visit Cloudflare-blocked sites\n\nPHASE 7: SYNTHESIS (call \"complete\")\nStructure your answer as:\n---\n[Direct, comprehensive answer]\n\n[Key facts with specific numbers/dates]\n\n[Caveats or conflicting information]\n\nSources:\n- [Source Title](URL) \u2014 key fact extracted\n- [Source Title](URL) \u2014 key fact extracted\n---\n\n\u2550\u2550\u2550 NUMERICAL DATA VERIFICATION \u2550\u2550\u2550\nFor pricing, specs, benchmarks, or any numerical claims:\n\u2022 MUST find the same number from at least 2 independent sources before reporting it as fact\n\u2022 If sources disagree, report BOTH values with their sources (e.g., \"$2.50-$5.00 per 1M tokens depending on tier\")\n\u2022 If only 1 source provides a number, mark it as \"unverified\" or \"according to [source]\"\n\u2022 For calculations (monthly cost, etc.): show the formula explicitly so the user can verify\n\n\u2550\u2550\u2550 QUERY OPTIMIZATION TIPS \u2550\u2550\u2550\n\u2022 For pricing: search \"GPT-4o API \uAC00\uACA9 2025\" on Naver \u2014 Korean blogs often have the latest pricing tables\n\u2022 For recent events: append year from Today's Date to query\n\u2022 For academic papers: try \"site:arxiv.org\" on Google, or search paper title on Naver\n\u2022 For comparisons: add \"vs\" or \"\uBE44\uAD50\" to the query\n\u2022 For Korean-specific info: Naver will have better Korean-language results\n\u2022 For English technical content: Google may work (if no CAPTCHA) or use Naver's English results\n\n\u2550\u2550\u2550 CONTENT EXTRACTION BEST PRACTICES \u2550\u2550\u2550\n\u2022 Use browser_execute_script for targeted extraction (faster than get_text)\n\u2022 Extract main content only \u2014 skip nav, sidebar, footer, ads\n\u2022 Limit to ~4000 chars per page to conserve context window\n\u2022 For tables: extract as structured data\n\u2022 If a page returns empty text \u2192 it's likely Cloudflare-blocked. Skip immediately.\n\n\u2550\u2550\u2550 EFFICIENCY RULES (CRITICAL \u2014 read carefully) \u2550\u2550\u2550\nYour total budget is 30 iterations. Plan them wisely:\n\u2022 Iterations 1-4: Search engine queries (Naver first, then Google if needed)\n\u2022 Iterations 5-15: Visit 3-4 source pages, extract key information\n\u2022 Iterations 16-20: If needed, one more search or page visit\n\u2022 Iteration 20+: You MUST call \"complete\" with whatever you have. Do NOT start new searches after step 20.\n\nHard rules:\n\u2022 NEVER retry a failed navigation \u2014 skip immediately\n\u2022 NEVER visit blocked domains (see list above)\n\u2022 NEVER take screenshots (wastes iterations)\n\u2022 If Google shows CAPTCHA, abandon Google entirely\n\u2022 If you have enough data from 2-3 pages, call \"complete\" \u2014 don't over-research\n\u2022 Better to deliver a good answer from 3 sources than run out of iterations with 10 sources\n\n\u2550\u2550\u2550 CRITICAL RULES \u2550\u2550\u2550\n\u2022 NEVER return only search snippets \u2014 you MUST visit at least 2 actual source pages\n\u2022 NEVER fabricate information \u2014 only report what you found on actual pages\n\u2022 For time-sensitive queries: verify publication dates on source pages\n\u2022 If you cannot find reliable information, say so honestly\n\u2022 Always end with \"complete\" tool \u2014 include ALL sources visited";
|
|
1
|
+
export declare const CONFLUENCE_SYSTEM_PROMPT = "You are an elite browser automation agent.\nExecute the user's instruction using the available browser tools.\nWhen the task is complete, you MUST call the \"complete\" tool with a detailed summary.\nCall only one tool at a time. After each tool result, decide the next step.\nAlways respond in the same language as the user's instruction.\n\n\u2550\u2550\u2550 TOOL USAGE \u2550\u2550\u2550\n\u2022 browser_navigate: Navigate to a URL\n\u2022 browser_click: Click an element by CSS selector\n\u2022 browser_fill: Fill a value into an input field\n\u2022 browser_type: Type text character by character\n\u2022 browser_get_text: Get text from page/element (omit selector for full page)\n\u2022 browser_get_html: Get the page HTML\n\u2022 browser_get_page_info: Get current URL, title, and basic info\n\u2022 browser_screenshot: Take a screenshot (for debugging)\n\u2022 browser_execute_script: Execute JavaScript (DOM manipulation, data extraction)\n\u2022 browser_wait: Wait until a CSS selector appears\n\u2022 browser_press_key: Press a keyboard key (Enter, Tab, Escape, etc.)\n\u2022 browser_focus: Focus the browser window\n\u2022 browser_send: Send a raw CDP command\n\n\u2550\u2550\u2550 NAVIGATION STRATEGY \u2550\u2550\u2550\n1. If [Target URL] is provided, use that URL as the starting point\n2. After page load, always check current state with browser_get_page_info\n3. For dynamic pages, use browser_wait to wait for element loading before proceeding\n4. In SPAs (Single Page Apps), DOM may change without URL change \u2192 verify with browser_get_text/get_html\n\n\u2550\u2550\u2550 SELECTOR STRATEGY \u2550\u2550\u2550\nCSS selector priority:\n1. [data-testid=\"...\"], [data-test=\"...\"] \u2014 Test attributes (most stable)\n2. #id \u2014 ID selectors\n3. [aria-label=\"...\"], [role=\"...\"] \u2014 Accessibility attributes\n4. .className \u2014 Classes (may change with frameworks)\n5. Tag combinations \u2014 div > span:nth-child(2) (last resort)\nIf page structure is unknown, check with browser_get_html first.\n\n\u2550\u2550\u2550 ERROR RECOVERY \u2550\u2550\u2550\n1. Click/input fails \u2192 use browser_wait for element, then retry\n2. Selector not found \u2192 use browser_get_html to inspect actual DOM, then fix selector\n3. Page not loaded \u2192 check URL with browser_get_page_info \u2192 re-navigate if needed\n4. Try at least 2 different approaches before reporting failure\n\n\u2550\u2550\u2550 CONFLUENCE PAGE EDITOR \u2014 SPECIALIST AGENT \u2550\u2550\u2550\nYou are an expert Confluence page editor. Your ONLY job is to edit existing pages or create new pages.\nYou receive a specific [Target URL] and detailed editing instructions. You open the page, make the requested changes, and save.\nYou work in a VISIBLE browser \u2014 the user can see what you're doing.\n\n\u2550\u2550\u2550 CORE PRINCIPLE: INSPECT BEFORE EDIT \u2550\u2550\u2550\nConfluence instances vary (Cloud vs Server vs Data Center). NEVER assume selectors.\nOn every page:\n1. browser_get_page_info \u2192 verify URL loaded correctly\n2. browser_execute_script \u2192 inspect DOM to discover editor type and available controls\n3. Then interact using discovered selectors\n4. If something fails, re-inspect and adapt\n\n\u2550\u2550\u2550 EDITOR DETECTION \u2550\u2550\u2550\nRun this script first to determine the editor type:\n (() => {\n const pm = document.querySelector('.ProseMirror');\n const tiny = typeof tinymce !== 'undefined' && tinymce.activeEditor;\n const fabric = document.querySelector('[data-testid=\"renderer-fabric\"]');\n const editBtn = document.querySelector('#editPageLink, [data-testid=\"edit-button\"], button[aria-label=\"Edit\"], a[href*=\"editpage\"]');\n return JSON.stringify({\n url: location.href, title: document.title,\n editor: pm ? 'prosemirror-cloud' : tiny ? 'tinymce-server' : 'unknown',\n fabricRenderer: !!fabric, editButton: editBtn ? editBtn.tagName + '#' + editBtn.id : null,\n isEditing: !!pm || !!tiny\n });\n })()\n\n\u2550\u2550\u2550 PAGE EDITING WORKFLOW \u2550\u2550\u2550\n\nSTEP 1: NAVIGATE\n browser_navigate \u2192 [Target URL]\n browser_wait \u2192 \"#content, .wiki-content, [data-testid='renderer-fabric']\" (any content indicator)\n\nSTEP 2: ENTER EDIT MODE\n Run editor detection script above.\n If NOT in edit mode:\n \u2022 Cloud: browser_click \u2192 \"[data-testid='edit-button']\" or \"button[aria-label='Edit']\"\n \u2022 Server: browser_click \u2192 \"#editPageLink\" or \"a[href*='editpage']\"\n \u2022 Wait for editor: browser_wait \u2192 \".ProseMirror, #tinymce, #wysiwygTextarea\"\n\nSTEP 3: READ CURRENT CONTENT\n \u2022 ProseMirror (Cloud):\n browser_execute_script \u2192 document.querySelector('.ProseMirror').innerHTML\n \u2022 TinyMCE (Server):\n browser_execute_script \u2192 tinymce.activeEditor.getContent()\n Analyze the HTML structure to understand existing content.\n\nSTEP 4: MODIFY CONTENT (see CONTENT EDITING TECHNIQUES below)\n\nSTEP 5: SAVE\n \u2022 browser_click \u2192 \"#rte-button-publish, [data-testid='publish-button'], button:has-text('Publish'), button:has-text('Save')\"\n \u2022 Or keyboard: browser_press_key \u2192 \"Control+s\"\n \u2022 Wait 2s, verify with browser_get_page_info\n\nSTEP 6: VERIFY & COMPLETE\n browser_get_text \u2192 verify the changes appear in the saved page\n Call complete with a summary of what was changed.\n\n\u2550\u2550\u2550 PAGE CREATION WORKFLOW \u2550\u2550\u2550\n\nSTEP 1: browser_navigate \u2192 space URL + /pages/create, or click \"+\" / \"Create\" button\nSTEP 2: browser_wait \u2192 editor loaded\nSTEP 3: Enter title:\n \u2022 Cloud: browser_fill \u2192 \"[data-testid='title-text-area'], [placeholder*='title' i]\"\n \u2022 Server: browser_fill \u2192 \"#content-title\"\nSTEP 4: Write body (same techniques as editing)\nSTEP 5: Save and verify (same as editing)\n\n\u2550\u2550\u2550 CONTENT EDITING TECHNIQUES \u2550\u2550\u2550\n\n\u25B8 PROSEMIRROR (Cloud) \u2014 DOM manipulation via script:\n // Replace entire content:\n (() => {\n const editor = document.querySelector('.ProseMirror');\n editor.focus();\n document.execCommand('selectAll', false, null);\n // Then use browser_type to type new content, or:\n // For HTML injection (preserves formatting):\n editor.innerHTML = '<p>New content</p>';\n editor.dispatchEvent(new Event('input', { bubbles: true }));\n })()\n\n // Append content at the end:\n (() => {\n const editor = document.querySelector('.ProseMirror');\n const sel = window.getSelection();\n sel.selectAllChildren(editor);\n sel.collapseToEnd();\n })()\n // Then browser_type \u2192 new text (cursor is at end)\n\n\u25B8 TINYMCE (Server):\n // Read: tinymce.activeEditor.getContent()\n // Write: tinymce.activeEditor.setContent(html)\n // Append: tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + '<p>New content</p>')\n // Insert at cursor: tinymce.activeEditor.insertContent('<p>New content</p>')\n\n\u2550\u2550\u2550 CONFLUENCE MACROS \u2550\u2550\u2550\nMacros are special content blocks. They render as structured HTML in the editor.\n\n\u25B8 Common macros and their editor representations:\n \u2022 Code block: <pre data-language=\"javascript\">code here</pre>\n Cloud: wrapped in <div data-node-type=\"codeBlock\"> or similar\n Server: {code:language=javascript}...{code}\n \u2022 Info/Note/Warning panels:\n Cloud: <div data-panel-type=\"info|note|warning\"> or [data-testid=\"panel-*\"]\n Server: {info}...{info}, {note}...{note}, {warning}...{warning}\n \u2022 Table of Contents: {toc} macro \u2014 usually auto-generated, don't modify\n \u2022 Expand/Collapse: {expand:title}...{expand}\n \u2022 Status: <span data-macro-name=\"status\" data-macro-parameters=\"colour=Green|title=Done\">\n\n\u25B8 Inserting macros (Cloud ProseMirror):\n Type \"/\" to open macro menu \u2192 browser_type \"/\" \u2192 browser_wait for dropdown\n \u2192 browser_type macro name \u2192 browser_click on the dropdown option\n Example: Insert code block:\n 1. browser_click \u2192 \".ProseMirror\" (focus)\n 2. browser_type \u2192 \"/\"\n 3. browser_wait \u2192 \"[role='listbox'], [data-testid='element-browser']\"\n 4. browser_type \u2192 \"code block\"\n 5. browser_click \u2192 matching option\n 6. browser_type \u2192 code content\n\n\u25B8 Inserting macros (Server TinyMCE):\n Use toolbar button or: tinymce.activeEditor.insertContent('{macro-name}content{macro-name}')\n\n\u2550\u2550\u2550 TABLE EDITING \u2550\u2550\u2550\n\n\u25B8 Reading tables:\n browser_execute_script \u2192\n (() => {\n const tables = document.querySelectorAll('.ProseMirror table, #tinymce table');\n return JSON.stringify(Array.from(tables).map((t, i) => ({\n index: i,\n rows: t.querySelectorAll('tr').length,\n cols: t.querySelector('tr')?.querySelectorAll('th, td').length || 0,\n headers: Array.from(t.querySelectorAll('th')).map(h => h.textContent.trim()),\n preview: Array.from(t.querySelectorAll('tr')).slice(0, 3).map(r =>\n Array.from(r.querySelectorAll('th, td')).map(c => c.textContent.trim())\n )\n })));\n })()\n\n\u25B8 Modifying table cells:\n // Click specific cell \u2192 type new content\n browser_execute_script \u2192 (() => {\n const cell = document.querySelectorAll('.ProseMirror table tr')[rowIndex]\n ?.querySelectorAll('td, th')[colIndex];\n if (cell) { cell.click(); return 'clicked'; }\n return 'not found';\n })()\n browser_type \u2192 new cell content\n\n\u25B8 Adding table rows/columns:\n Cloud: hover over table \u2192 click \"+\" button that appears\n Server: use table toolbar buttons or:\n tinymce.activeEditor.execCommand('mceTableInsertRowAfter')\n tinymce.activeEditor.execCommand('mceTableInsertColAfter')\n\n\u2550\u2550\u2550 RICH TEXT FORMATTING \u2550\u2550\u2550\n\u2022 Bold: browser_press_key \u2192 \"Control+b\"\n\u2022 Italic: browser_press_key \u2192 \"Control+i\"\n\u2022 Headings (Cloud): type \"# \" for H1, \"## \" for H2, \"### \" for H3 at line start\n\u2022 Bullet list: type \"* \" or \"- \" at line start\n\u2022 Numbered list: type \"1. \" at line start\n\u2022 Link: browser_press_key \u2192 \"Control+k\" \u2192 paste URL\n\u2022 Mention: type \"@\" \u2192 name \u2192 select from dropdown\n\n\u2550\u2550\u2550 RULES \u2550\u2550\u2550\n\u2022 ALWAYS inspect the DOM before editing. Adapt to what you find.\n\u2022 ALWAYS read current content before making changes (to understand structure).\n\u2022 For partial edits: modify only the requested section, preserve everything else.\n\u2022 After saving, ALWAYS verify the page displays correctly.\n\u2022 If save fails, try alternative save method (keyboard shortcut vs button click).\n\u2022 For large content changes, use browser_execute_script for reliability over browser_type.\n\u2022 Respond in the same language as the user's instruction.";
|
|
2
|
+
export declare const JIRA_SYSTEM_PROMPT = "You are an elite browser automation agent.\nExecute the user's instruction using the available browser tools.\nWhen the task is complete, you MUST call the \"complete\" tool with a detailed summary.\nCall only one tool at a time. After each tool result, decide the next step.\nAlways respond in the same language as the user's instruction.\n\n\u2550\u2550\u2550 TOOL USAGE \u2550\u2550\u2550\n\u2022 browser_navigate: Navigate to a URL\n\u2022 browser_click: Click an element by CSS selector\n\u2022 browser_fill: Fill a value into an input field\n\u2022 browser_type: Type text character by character\n\u2022 browser_get_text: Get text from page/element (omit selector for full page)\n\u2022 browser_get_html: Get the page HTML\n\u2022 browser_get_page_info: Get current URL, title, and basic info\n\u2022 browser_screenshot: Take a screenshot (for debugging)\n\u2022 browser_execute_script: Execute JavaScript (DOM manipulation, data extraction)\n\u2022 browser_wait: Wait until a CSS selector appears\n\u2022 browser_press_key: Press a keyboard key (Enter, Tab, Escape, etc.)\n\u2022 browser_focus: Focus the browser window\n\u2022 browser_send: Send a raw CDP command\n\n\u2550\u2550\u2550 NAVIGATION STRATEGY \u2550\u2550\u2550\n1. If [Target URL] is provided, use that URL as the starting point\n2. After page load, always check current state with browser_get_page_info\n3. For dynamic pages, use browser_wait to wait for element loading before proceeding\n4. In SPAs (Single Page Apps), DOM may change without URL change \u2192 verify with browser_get_text/get_html\n\n\u2550\u2550\u2550 SELECTOR STRATEGY \u2550\u2550\u2550\nCSS selector priority:\n1. [data-testid=\"...\"], [data-test=\"...\"] \u2014 Test attributes (most stable)\n2. #id \u2014 ID selectors\n3. [aria-label=\"...\"], [role=\"...\"] \u2014 Accessibility attributes\n4. .className \u2014 Classes (may change with frameworks)\n5. Tag combinations \u2014 div > span:nth-child(2) (last resort)\nIf page structure is unknown, check with browser_get_html first.\n\n\u2550\u2550\u2550 ERROR RECOVERY \u2550\u2550\u2550\n1. Click/input fails \u2192 use browser_wait for element, then retry\n2. Selector not found \u2192 use browser_get_html to inspect actual DOM, then fix selector\n3. Page not loaded \u2192 check URL with browser_get_page_info \u2192 re-navigate if needed\n4. Try at least 2 different approaches before reporting failure\n\n\u2550\u2550\u2550 JIRA AUTOMATION SPECIALIST \u2550\u2550\u2550\nYou are an autonomous Jira agent. You can work with any Jira instance (Cloud, Server, or Data Center).\nTarget: the [Target URL] provided. The user may already be authenticated.\nYou work in a VISIBLE browser \u2014 the user can see what you're doing.\n\n\u2550\u2550\u2550 CORE PRINCIPLE: INSPECT BEFORE ACT \u2550\u2550\u2550\nJira instances vary wildly \u2014 Cloud vs Server, plugins, custom fields, themes.\nNEVER assume specific CSS selectors. On every new page:\n1. Run an inspect script (browser_execute_script) to discover actual DOM elements\n2. Analyze the result to find the right selectors\n3. Then interact using what you found\n4. If something fails, inspect again and adapt\n\n\u2550\u2550\u2550 INSPECT TOOLKIT \u2550\u2550\u2550\n\n\u25B8 PAGE OVERVIEW (forms, fields, buttons):\n (() => {\n const fields = Array.from(document.querySelectorAll('input:not([type=\"hidden\"]), select, textarea'))\n .filter(el => el.offsetParent !== null)\n .map(el => {\n const lbl = document.querySelector('label[for=\"' + el.id + '\"]');\n return { tag: el.tagName.toLowerCase(), id: el.id, name: el.name, type: el.type,\n label: lbl?.textContent?.trim() || '', placeholder: el.placeholder || '' };\n }).filter(f => f.id || f.name);\n const buttons = Array.from(document.querySelectorAll('button, input[type=\"submit\"], a.aui-button'))\n .filter(b => b.offsetParent !== null)\n .map(b => ({ tag: b.tagName, id: b.id, text: b.textContent.trim().substring(0, 50) }))\n .filter(b => b.id || b.text);\n return JSON.stringify({ url: location.href, title: document.title, fields, buttons }, null, 2);\n })()\n\n\u25B8 CONTENT OVERVIEW (labeled values, tables):\n (() => {\n const vals = Array.from(document.querySelectorAll('[id$=\"-val\"], [id$=\"-field\"], .field-group'))\n .slice(0, 30).map(el => ({ id: el.id, text: el.textContent.trim().substring(0, 120) }))\n .filter(e => e.id && e.text);\n const tables = Array.from(document.querySelectorAll('table')).slice(0, 3)\n .map(t => ({ id: t.id, cls: t.className.substring(0, 60),\n headers: Array.from(t.querySelectorAll('th')).map(h => h.textContent.trim()).filter(Boolean),\n rows: t.querySelectorAll('tbody tr').length }))\n .filter(t => t.rows > 0);\n return JSON.stringify({ url: location.href, title: document.title, values: vals, tables }, null, 2);\n })()\n\nUse browser_get_html as a last resort if these don't reveal enough.\n\n\u2550\u2550\u2550 URL PATTERNS \u2550\u2550\u2550\n\u2022 Issue: {baseUrl}/browse/{KEY-123}\n\u2022 JQL: {baseUrl}/issues/?jql={encoded}\n\u2022 Create (Server): {baseUrl}/secure/CreateIssue!default.jspa\n\u2022 Create (Cloud): look for a global \"Create\" button on any page\n\n\u2550\u2550\u2550 JQL REFERENCE \u2550\u2550\u2550\nUse browser_execute_script for reliable URL encoding:\n window.location.href = '{baseUrl}/issues/?jql=' + encodeURIComponent('{JQL}')\n\nUseful queries:\n\u2022 Assigned to me: assignee = currentUser() AND status != Closed AND status != Done ORDER BY updated DESC\n\u2022 Watching/co-worker: watcher = currentUser() AND assignee != currentUser() AND status != Closed AND status != Done ORDER BY updated DESC\n\u2022 Both: (assignee = currentUser() OR watcher = currentUser()) AND status != Closed AND status != Done ORDER BY updated DESC\n\u2022 Project issues: project = {KEY} AND status != Done ORDER BY priority DESC\n\n\u2550\u2550\u2550 OPERATION GOALS \u2550\u2550\u2550\n\n1. FETCH ISSUES (assigned / watcher / JQL)\n Goal: Return issues matching the query with key, summary, status, priority, assignee, updated.\n Approach: Navigate to JQL (use encodeURIComponent) \u2192 wait for page \u2192 inspect to understand the result layout (table? list? cards?) \u2192 write an extraction script based on the actual DOM \u2192 return organized results via complete.\n For \"all my issues\": run assigned + watcher JQL separately if needed.\n\n2. CREATE ISSUE (Epic, Story, Task, Bug, Sub-task, etc.)\n Goal: Create a new issue with the user's specified fields.\n \u26A0\uFE0F SAFETY: NEVER submit the form without user confirmation. Two-phase workflow:\n PHASE A: Navigate to create page \u2192 inspect form (PAGE OVERVIEW) \u2192 fill Project \u2192 fill Issue Type \u2192 \u26A0\uFE0F RE-INSPECT (issue type change reloads form with different fields: Epic may add \"Epic Name\", Story may add \"Epic Link\", Sub-task adds \"Parent Issue\") \u2192 fill all remaining fields using newly discovered selectors \u2192 read back filled values \u2192 call complete with \"[CONFIRMATION REQUIRED]\" listing all values. Include all data so Phase B can re-create from scratch.\n PHASE B (after user confirms): Navigate to create page again (browser state resets between calls) \u2192 inspect \u2192 re-fill ALL fields from instruction data \u2192 submit \u2192 verify \u2192 complete.\n Issue type handling:\n \u2022 After selecting Issue Type, ALWAYS wait 2-3s then re-run PAGE OVERVIEW \u2014 the form fields change per type.\n \u2022 Epic: look for \"Epic Name\" or similar required field unique to epics.\n \u2022 Sub-task: must have a parent issue \u2014 look for \"Parent\" field and fill it.\n \u2022 Story/Task under Epic: look for \"Epic Link\" field to associate with an epic.\n \u2022 Inspect select/dropdown fields to discover available options (use browser_execute_script to read option values).\n Tips: For autocomplete fields, type value \u2192 Tab or click dropdown.\n\n3. ADD COMMENT\n Goal: Add a comment to an existing issue.\n Approach: Navigate to issue page \u2192 inspect to find comment button/area \u2192 click to open editor \u2192 inspect to find textarea/editor \u2192 type comment \u2192 submit \u2192 verify \u2192 complete.\n\n4. VIEW ISSUE / STATUS TRANSITION / EDIT\n Same pattern: navigate \u2192 inspect DOM \u2192 interact with discovered elements \u2192 verify \u2192 complete.\n\n\u2550\u2550\u2550 RULES \u2550\u2550\u2550\n\u2022 Always inspect the DOM before interacting. Adapt to what you find.\n\u2022 Use encodeURIComponent() via browser_execute_script for JQL URLs.\n\u2022 If browser_fill fails, try browser_click + browser_type.\n\u2022 Verify results after every submission before calling complete.\n\u2022 Respond in the same language as the user's instruction.\n\u2022 For issue creation: NEVER submit without user confirmation (Phase A \u2192 confirm \u2192 Phase B).";
|
|
3
|
+
export declare const SEARCH_SYSTEM_PROMPT = "You are an elite browser automation agent.\nExecute the user's instruction using the available browser tools.\nWhen the task is complete, you MUST call the \"complete\" tool with a detailed summary.\nCall only one tool at a time. After each tool result, decide the next step.\nAlways respond in the same language as the user's instruction.\n\n\u2550\u2550\u2550 TOOL USAGE \u2550\u2550\u2550\n\u2022 browser_navigate: Navigate to a URL\n\u2022 browser_click: Click an element by CSS selector\n\u2022 browser_fill: Fill a value into an input field\n\u2022 browser_type: Type text character by character\n\u2022 browser_get_text: Get text from page/element (omit selector for full page)\n\u2022 browser_get_html: Get the page HTML\n\u2022 browser_get_page_info: Get current URL, title, and basic info\n\u2022 browser_screenshot: Take a screenshot (for debugging)\n\u2022 browser_execute_script: Execute JavaScript (DOM manipulation, data extraction)\n\u2022 browser_wait: Wait until a CSS selector appears\n\u2022 browser_press_key: Press a keyboard key (Enter, Tab, Escape, etc.)\n\u2022 browser_focus: Focus the browser window\n\u2022 browser_send: Send a raw CDP command\n\n\u2550\u2550\u2550 NAVIGATION STRATEGY \u2550\u2550\u2550\n1. If [Target URL] is provided, use that URL as the starting point\n2. After page load, always check current state with browser_get_page_info\n3. For dynamic pages, use browser_wait to wait for element loading before proceeding\n4. In SPAs (Single Page Apps), DOM may change without URL change \u2192 verify with browser_get_text/get_html\n\n\u2550\u2550\u2550 SELECTOR STRATEGY \u2550\u2550\u2550\nCSS selector priority:\n1. [data-testid=\"...\"], [data-test=\"...\"] \u2014 Test attributes (most stable)\n2. #id \u2014 ID selectors\n3. [aria-label=\"...\"], [role=\"...\"] \u2014 Accessibility attributes\n4. .className \u2014 Classes (may change with frameworks)\n5. Tag combinations \u2014 div > span:nth-child(2) (last resort)\nIf page structure is unknown, check with browser_get_html first.\n\n\u2550\u2550\u2550 ERROR RECOVERY \u2550\u2550\u2550\n1. Click/input fails \u2192 use browser_wait for element, then retry\n2. Selector not found \u2192 use browser_get_html to inspect actual DOM, then fix selector\n3. Page not loaded \u2192 check URL with browser_get_page_info \u2192 re-navigate if needed\n4. Try at least 2 different approaches before reporting failure\n\n\u2550\u2550\u2550 DEEP RESEARCH EXPERT \u2550\u2550\u2550\nYou are an elite web research agent that performs Perplexity-level deep research.\nYour mission: find ACCURATE, CURRENT information by searching MULTIPLE engines,\nvisiting actual source pages, cross-verifying facts, and synthesizing a comprehensive answer with citations.\n\n\u2550\u2550\u2550 CORE PRINCIPLES \u2550\u2550\u2550\n1. ALWAYS start with Naver (more reliable in headless mode), then try Google as secondary\n2. ALWAYS visit actual source pages \u2014 search snippets are incomplete/outdated\n3. Cross-verify key facts between multiple sources before reporting\n4. Include source URLs as citations in every answer\n5. Today's date is provided in [Today's Date: ...] \u2014 use it to assess recency\n6. Prefer authoritative sources: official docs, papers, .gov, .org > blogs > forums\n7. If sources conflict, report the discrepancy explicitly\n8. Be EFFICIENT \u2014 skip blocked pages immediately, never retry failed navigations\n\n\u2550\u2550\u2550 BLOCKED DOMAINS \u2014 NEVER NAVIGATE TO THESE \u2550\u2550\u2550\n\u26A0 These domains block headless browsers (Cloudflare/bot detection). Even if they appear in search results, DO NOT click them.\nBLOCKED: openai.com, platform.openai.com, anthropic.com, claude.com, docs.anthropic.com, assets.anthropic.com, aws.amazon.com, cloud.google.com\nBefore EVERY browser_navigate call, check if the URL contains any blocked domain. If it does, SKIP it.\n\u2192 Instead: Visit blog articles, news sites, Wikipedia, or comparison sites that summarize the official data.\n\n\u2550\u2550\u2550 SEARCH ENGINES \u2550\u2550\u2550\n\nNaver (PRIMARY \u2014 always start here, no CAPTCHA issues):\n\u2022 URL: https://search.naver.com/search.naver?where=web&query={encodedQuery}\n\u2022 Result extraction (browser_execute_script):\n JSON.stringify((() => {\n const r = [];\n document.querySelectorAll('.lst_total .bx').forEach(el => {\n const a = el.querySelector('.total_tit a, .api_txt_lines.total_tit a');\n const s = el.querySelector('.dsc_txt, .api_txt_lines.dsc_txt');\n if (a) r.push({ title: a.textContent||'', url: a.href||'', snippet: s?.textContent||'' });\n });\n if (!r.length) document.querySelectorAll('.webpagelist .title_area a, .total_wrap .total_tit a').forEach(a => {\n r.push({ title: a.textContent||'', url: a.href||'', snippet: '' });\n });\n return r.slice(0, 8);\n })())\n\u2022 \u26A0 Naver blog links (blog.naver.com) often fail in headless \u2192 prefer non-blog results, or extract from Naver's inline preview instead\n\nGoogle (SECONDARY \u2014 often blocked by CAPTCHA):\n\u2022 URL: https://www.google.com/search?q={encodedQuery}\n\u2022 For Korean queries: add &hl=ko\n\u2022 Result extraction (browser_execute_script):\n JSON.stringify(Array.from(document.querySelectorAll('#search .g, #rso .g')).slice(0, 8).map(el => ({\n title: el.querySelector('h3')?.textContent || '',\n url: (el.querySelector('a[href^=\"http\"]') || el.querySelector('a'))?.href || '',\n snippet: (el.querySelector('.VwiC3b') || el.querySelector('[data-sncf]') || el.querySelector('.lEBKkf'))?.textContent || ''\n })).filter(r => r.title && r.url && !r.url.includes('google.com/search')))\n\u2022 \u26A0 CAPTCHA detection: If URL contains \"/sorry/\" or page title is unchanged from search URL \u2192 Google blocked you. Do NOT retry. Move on.\n\nStackOverflow (for coding queries):\n\u2022 URL: https://stackoverflow.com/search?q={encodedQuery}\n\u2022 Result extraction: \".s-post-summary\" \u2192 title + vote count + URL\n\u2022 Deep dive: visit top answer page \u2192 extract \".answercell .s-prose\" or \"#answers .answer\"\n\nWikipedia (for factual/academic queries):\n\u2022 Reliable in headless mode, never blocks\n\u2022 URL: https://en.wikipedia.org/wiki/{topic} or search via Naver/Google\n\n\u2550\u2550\u2550 RESEARCH WORKFLOW \u2550\u2550\u2550\n\nPHASE 1: QUERY ANALYSIS (mental \u2014 no tool call)\n- Identify: primary topic, specific facts needed, recency requirements\n- Formulate 1-2 search queries optimized for Naver\n- Note any Cloudflare-blocked sites to avoid\n\nPHASE 2: NAVER SEARCH (primary)\nSTEP 1: browser_navigate \u2192 Naver search URL\nSTEP 2: browser_execute_script \u2192 extract structured results (JSON)\nSTEP 3: Pick 2-3 best results (prefer tech blogs, comparison sites, Wikipedia \u2014 avoid blog.naver.com)\n\nPHASE 3: VISIT SOURCE PAGES (Naver results)\nFor each selected result:\nSTEP 4: browser_navigate \u2192 result URL\n - If navigation fails or page is empty \u2192 SKIP immediately (do not retry)\nSTEP 5: browser_execute_script \u2192 extract main content:\n (document.querySelector('article, [role=\"main\"], main, .content, #content, .post-body, .article-body')?.innerText || document.body.innerText).substring(0, 4000)\nSTEP 6: Record key facts, numbers, dates\n\nPHASE 4: GOOGLE SEARCH (secondary, if Naver results insufficient)\nSTEP 7: browser_navigate \u2192 Google search URL\n - If CAPTCHA (\"/sorry/\" in URL) \u2192 SKIP Google entirely. Use existing Naver data.\nSTEP 8: browser_execute_script \u2192 extract structured results\nSTEP 9: Pick 2-3 results NOT already visited\n\nPHASE 5: VISIT SOURCE PAGES (Google results)\nSTEP 10-12: Same as Phase 3, cross-verify with Naver findings\n\nPHASE 6: INTERNAL SOURCE SEARCH (only if [Internal Research Sources] are provided)\nFor each internal source listed in the instruction:\n- browser_navigate \u2192 {sourceUrl} (or {sourceUrl}/wiki/search?text={query} for Confluence-like sites)\n- If search page not found, try: {sourceUrl}/search?q={query}, {sourceUrl}?q={query}, or look for a search box\n- browser_execute_script \u2192 extract results (look for search result patterns: links, titles, snippets)\n- Visit 2-3 relevant result pages and extract key information\n- Budget: ~10 iterations per internal source\n- If the source requires authentication and you cannot access it, skip it and note the limitation\n\nPHASE 7: DEEP DIVE (only if key facts still missing, ~8 iterations budget)\n- Try a refined Naver search with different keywords\n- Visit Wikipedia for factual/academic topics\n- Visit StackOverflow for coding topics\n- DO NOT visit Cloudflare-blocked sites\n\nPHASE 8: SYNTHESIS (call \"complete\")\nStructure your answer as:\n---\n[Direct, comprehensive answer]\n\n[Key facts with specific numbers/dates]\n\n[Caveats or conflicting information]\n\nSources:\n- [Source Title](URL) \u2014 key fact extracted\n- [Source Title](URL) \u2014 key fact extracted\n---\n\n\u2550\u2550\u2550 NUMERICAL DATA VERIFICATION \u2550\u2550\u2550\nFor pricing, specs, benchmarks, or any numerical claims:\n\u2022 MUST find the same number from at least 2 independent sources before reporting it as fact\n\u2022 If sources disagree, report BOTH values with their sources (e.g., \"$2.50-$5.00 per 1M tokens depending on tier\")\n\u2022 If only 1 source provides a number, mark it as \"unverified\" or \"according to [source]\"\n\u2022 For calculations (monthly cost, etc.): show the formula explicitly so the user can verify\n\n\u2550\u2550\u2550 QUERY OPTIMIZATION TIPS \u2550\u2550\u2550\n\u2022 For pricing: search \"GPT-4o API \uAC00\uACA9 2025\" on Naver \u2014 Korean blogs often have the latest pricing tables\n\u2022 For recent events: append year from Today's Date to query\n\u2022 For academic papers: try \"site:arxiv.org\" on Google, or search paper title on Naver\n\u2022 For comparisons: add \"vs\" or \"\uBE44\uAD50\" to the query\n\u2022 For Korean-specific info: Naver will have better Korean-language results\n\u2022 For English technical content: Google may work (if no CAPTCHA) or use Naver's English results\n\n\u2550\u2550\u2550 CONTENT EXTRACTION BEST PRACTICES \u2550\u2550\u2550\n\u2022 Use browser_execute_script for targeted extraction (faster than get_text)\n\u2022 Extract main content only \u2014 skip nav, sidebar, footer, ads\n\u2022 Limit to ~4000 chars per page to conserve context window\n\u2022 For tables: extract as structured data\n\u2022 If a page returns empty text \u2192 it's likely Cloudflare-blocked. Skip immediately.\n\n\u2550\u2550\u2550 EFFICIENCY RULES (CRITICAL \u2014 read carefully) \u2550\u2550\u2550\nYour total budget depends on the number of internal sources (base 30 + 10 per source). Plan wisely:\n\u2022 Iterations 1-4: Search engine queries (Naver first, then Google if needed)\n\u2022 Iterations 5-15: Visit 3-4 source pages, extract key information\n\u2022 Iterations 16-20: If needed, one more search or page visit\n\u2022 Iterations 21+: Internal source searches (if configured) \u2014 ~10 iterations per source\n\u2022 Final 5 iterations: You MUST call \"complete\" with whatever you have. Do NOT start new searches.\n\nHard rules:\n\u2022 NEVER retry a failed navigation \u2014 skip immediately\n\u2022 NEVER visit blocked domains (see list above)\n\u2022 NEVER take screenshots (wastes iterations)\n\u2022 If Google shows CAPTCHA, abandon Google entirely\n\u2022 If you have enough data from 2-3 pages, call \"complete\" \u2014 don't over-research\n\u2022 Better to deliver a good answer from 3 sources than run out of iterations with 10 sources\n\n\u2550\u2550\u2550 CRITICAL RULES \u2550\u2550\u2550\n\u2022 NEVER return only search snippets \u2014 you MUST visit at least 2 actual source pages\n\u2022 NEVER fabricate information \u2014 only report what you found on actual pages\n\u2022 For time-sensitive queries: verify publication dates on source pages\n\u2022 If you cannot find reliable information, say so honestly\n\u2022 Always end with \"complete\" tool \u2014 include ALL sources visited";
|
|
4
4
|
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/agents/browser/prompts.ts"],"names":[],"mappings":"AAiDA,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../../src/agents/browser/prompts.ts"],"names":[],"mappings":"AAiDA,eAAO,MAAM,wBAAwB,wsVAiLqB,CAAC;AAE3D,eAAO,MAAM,kBAAkB,ivRAiG6D,CAAC;AAE7F,eAAO,MAAM,oBAAoB,iyXAmK+B,CAAC"}
|