hanseol-dev 5.3.12-dev.0 → 5.3.12-dev.2

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.
Files changed (45) hide show
  1. package/dist/agents/common/sub-agent.d.ts.map +1 -1
  2. package/dist/agents/common/sub-agent.js +99 -6
  3. package/dist/agents/common/sub-agent.js.map +1 -1
  4. package/dist/agents/office/excel-create-agent.d.ts.map +1 -1
  5. package/dist/agents/office/excel-create-agent.js +4 -2
  6. package/dist/agents/office/excel-create-agent.js.map +1 -1
  7. package/dist/agents/office/excel-create-prompts.d.ts +3 -3
  8. package/dist/agents/office/excel-create-prompts.d.ts.map +1 -1
  9. package/dist/agents/office/excel-create-prompts.js +8 -3
  10. package/dist/agents/office/excel-create-prompts.js.map +1 -1
  11. package/dist/agents/office/powerpoint-create-agent.d.ts.map +1 -1
  12. package/dist/agents/office/powerpoint-create-agent.js +12 -10
  13. package/dist/agents/office/powerpoint-create-agent.js.map +1 -1
  14. package/dist/agents/office/powerpoint-create-prompts.d.ts +1 -1
  15. package/dist/agents/office/powerpoint-create-prompts.d.ts.map +1 -1
  16. package/dist/agents/office/powerpoint-create-prompts.js +7 -2
  17. package/dist/agents/office/powerpoint-create-prompts.js.map +1 -1
  18. package/dist/agents/office/prompts.d.ts +5 -5
  19. package/dist/agents/office/prompts.d.ts.map +1 -1
  20. package/dist/agents/office/prompts.js +88 -28
  21. package/dist/agents/office/prompts.js.map +1 -1
  22. package/dist/agents/office/word-create-agent.d.ts.map +1 -1
  23. package/dist/agents/office/word-create-agent.js +5 -3
  24. package/dist/agents/office/word-create-agent.js.map +1 -1
  25. package/dist/agents/office/word-create-prompts.d.ts +3 -3
  26. package/dist/agents/office/word-create-prompts.d.ts.map +1 -1
  27. package/dist/agents/office/word-create-prompts.js +25 -6
  28. package/dist/agents/office/word-create-prompts.js.map +1 -1
  29. package/dist/constants.d.ts +1 -1
  30. package/dist/constants.js +1 -1
  31. package/dist/core/session/session-manager.d.ts +1 -0
  32. package/dist/core/session/session-manager.d.ts.map +1 -1
  33. package/dist/core/session/session-manager.js +51 -0
  34. package/dist/core/session/session-manager.js.map +1 -1
  35. package/dist/orchestration/plan-executor.d.ts.map +1 -1
  36. package/dist/orchestration/plan-executor.js +2 -0
  37. package/dist/orchestration/plan-executor.js.map +1 -1
  38. package/dist/tools/office/excel-client.js +3 -3
  39. package/dist/tools/office/powerpoint-client.d.ts.map +1 -1
  40. package/dist/tools/office/powerpoint-client.js +0 -4
  41. package/dist/tools/office/powerpoint-client.js.map +1 -1
  42. package/dist/ui/components/PlanExecuteApp.d.ts.map +1 -1
  43. package/dist/ui/components/PlanExecuteApp.js +26 -7
  44. package/dist/ui/components/PlanExecuteApp.js.map +1 -1
  45. package/package.json +1 -1
@@ -109,13 +109,32 @@ STEP 6 — FINISH:
109
109
 
110
110
  ═══ MODIFY MODE ═══
111
111
  1. word_open (path) — if fails, word_create to launch Word, then word_open again
112
- 2. word_read → understand structure (paragraphs, sections, tables)
113
- 3. Make ONLY requested changes:
112
+ 2. word_read → understand full structure AND design:
113
+ - Paragraphs, sections, tables, heading styles
114
+ - Heading font/size/color, body font/size, line spacing, color scheme
115
+
116
+ 3. DETERMINE MODIFICATION SCALE:
117
+ ■ MINOR (text replacement, value update, find/replace, single paragraph edit):
118
+ → Proceed directly to step 4. Fast, targeted changes only.
119
+ ■ MAJOR (add sections, restructure content, add tables, change formatting):
120
+ → Analyze existing document design (heading style, body font, colors, spacing).
121
+ → New content MUST match existing style exactly — same heading font/size/color, same body font, same line spacing.
122
+ → Generate rich, professional content (3+ sentences per paragraph, real data in tables). CREATE-level quality.
123
+ ■ EXTEND (add multiple pages, requested page count, large content additions):
124
+ → Full design analysis + treat new pages like CREATE mode.
125
+ → Follow CREATE steps (sections, tables, formatting) for new content.
126
+ → Maintain perfect consistency with existing document's visual identity.
127
+
128
+ 4. Execute changes:
114
129
  • Text: word_find_replace (most reliable for text changes)
115
- • Add content: word_goto (position="end") → word_write
116
- • Tables: word_set_table_cell / word_add_table_row
117
- 4. word_save (to specified path) "complete"
118
- ⚠ Do NOT rewrite the entire document. Read first, then targeted changes only.
130
+ • Add content: word_goto (position="end") → word_write with full formatting matching existing style
131
+ • Tables: word_set_table_cell / word_add_table_row / word_add_table (match existing table style)
132
+ New sections: Use same heading font, size, color as existing headings
133
+ 5. word_save (to specified path) "complete"
134
+
135
+ ⚠ PAGE COUNT OVERRIDE: If user specifies exact page count, respect it absolutely.
136
+ ⚠ For MINOR: Do NOT rewrite the entire document.
137
+ ⚠ For MAJOR/EXTEND: New content must be indistinguishable from existing content in style and quality.
119
138
 
120
139
  ═══ RULES ═══
121
140
  • word_write includes ALL formatting — do NOT separately call word_set_font/word_set_paragraph.
@@ -235,15 +254,34 @@ STEP 11 — FINISH:
235
254
 
236
255
  ═══ MODIFY MODE ═══
237
256
  1. excel_open (path) — if fails, excel_create to launch Excel, then excel_open again
238
- 2. excel_read_range (read ALL used cells) → MAP EVERY ROW with cell addresses:
257
+ 2. excel_read_range (read ALL used cells) → MAP EVERY ROW with cell addresses AND formatting:
239
258
  Example: "A3=Q1 B3=1200 C3=800 D3==B3+C3 E3=-(dash), A7=합계 B7==SUM(B3:B6)"
240
259
  ⚠ Note which cells have FORMULAS (=) — preserve or replicate them.
241
- 3. Make ONLY requested changes do NOT touch other cells:
260
+ Note formatting patterns: header bg color, number formats, border styles, conditional formatting.
261
+
262
+ 3. DETERMINE MODIFICATION SCALE:
263
+ ■ MINOR (update value, simple cell change):
264
+ → Proceed directly to step 4. Fast, targeted changes only.
265
+ ■ MAJOR (add columns, restructure, add conditional formatting, add charts):
266
+ → Analyze existing sheet's color scheme, number formats, border styles.
267
+ → New columns/rows MUST match existing formatting exactly.
268
+ → Charts must reference correct data ranges. Conditional formatting must use consistent rules.
269
+ ■ EXTEND (add rows/sheets, expand data):
270
+ → Full style analysis + replicate formatting patterns for all new data.
271
+ → New rows: copy number format, bg color pattern (alternating rows), border style, formula pattern from adjacent rows.
272
+ → Update ALL affected SUM/AVERAGE ranges to include new rows.
273
+ → New sheets: match header style, color scheme, column widths from existing sheets.
274
+
275
+ 4. Execute changes — do NOT touch unrelated cells:
242
276
  • Update value: excel_write_cell with EXACT cell address
243
- • Add row: excel_insert_row BEFORE total row → replicate formulas from adjacent row
277
+ • Add row: excel_insert_row BEFORE total row → replicate formulas AND formatting from adjacent row
244
278
  • Update total SUM ranges to include new row
245
- 4. excel_save "complete"
279
+ New formatting: match existing patterns exactly
280
+ 5. excel_save → "complete"
281
+
282
+ ⚠ SHEET COUNT OVERRIDE: If user specifies "한 시트만", use 1 sheet only.
246
283
  ⚠ NEVER delete or overwrite cells you didn't intend to change.
284
+ ⚠ For MAJOR/EXTEND: New data must look visually identical to existing data in formatting.
247
285
 
248
286
  ═══ RULES ═══
249
287
  • excel_write_range for bulk data. Format RANGES, not individual cells.
@@ -400,10 +438,12 @@ When absolutely needed:
400
438
  Before creating slides, PLAN ALL slides on paper first. Write out:
401
439
  - Slide number, title, layout type, and key content for each
402
440
 
403
- Slide counts (unless user explicitly requests different):
441
+ Slide counts:
442
+ ⚠ USER COUNT OVERRIDE: If the user specifies an exact slide count (e.g., "3장", "5 slides", "20장"), plan EXACTLY that number. This OVERRIDES ALL defaults and limits below. For very small counts (1-3), skip title/closing slides and use only content slides.
404
443
  • Quick briefing: 5-8 slides
405
444
  • Standard presentation: 8-12 slides
406
- • Pitch deck / detailed report: 12 slides exactly (HARD CAP: 12 for pitch decks, 15 absolute max. If user says "20장", plan 12 with richer content.)
445
+ • Pitch deck / detailed report: 10-12 slides
446
+ (These defaults apply ONLY when the user does NOT specify a count.)
407
447
 
408
448
  Layout assignment guide — pick the BEST layout per slide content:
409
449
  1. Slide 1: Title slide (ALWAYS)
@@ -437,18 +477,37 @@ Training/Education (10-15):
437
477
 
438
478
  ═══ MODIFY MODE ═══
439
479
  1. powerpoint_open (path) — if fails, powerpoint_create first, then open again
440
- 2. powerpoint_get_slide_count → powerpoint_read_slide (each target slide) → MAP shapes:
480
+ 2. powerpoint_get_slide_count → powerpoint_read_slide (each target slide) → MAP shapes AND design:
441
481
  • Shape with largest text + wide width → body/content
442
482
  • Shape with bold/large font near top → title
443
483
  • Narrow shapes (width < 20pt) → sidebars/decorations — NEVER write to these
484
+ • Note: sidebar colors, title font/size/color, body font/size, accent colors, background color
444
485
  ⚠ Match shape to ROLE by content + position, not just index.
445
- 3. Make ONLY requested changes:
486
+
487
+ 3. DETERMINE MODIFICATION SCALE:
488
+ ■ MINOR (text change, find/replace, single slide edit):
489
+ → Proceed directly to step 4. Fast, targeted changes only.
490
+ ■ MAJOR (add slides, change design, restructure):
491
+ → Analyze existing slides' color scheme, fonts, sidebar style, layout patterns.
492
+ → New slides MUST match existing design exactly — same sidebar color/width, same title font/size/color, same body font, same accent colors.
493
+ → Use CREATE-level layout quality (sidebars, accent lines, footers, slide numbers).
494
+ ■ EXTEND (add multiple slides):
495
+ → Full design analysis + build new slides with CREATE-mode quality.
496
+ → Each new slide: sidebar + accent line + title + body + footer matching existing slides.
497
+ → Use varied layouts (A-F) while maintaining visual consistency with existing deck.
498
+
499
+ 4. Execute changes:
446
500
  • Change text: powerpoint_write_text (correct shape_index from step 2)
447
501
  • Find/replace: powerpoint_find_replace_text
448
502
  • Add content: powerpoint_add_textbox/shape
449
503
  • Add/remove slides: powerpoint_add_slide / powerpoint_delete_slide
450
- 4. powerpoint_save "complete"
504
+ New slides (MAJOR/EXTEND): build complete slides with all elements matching existing design
505
+ 5. powerpoint_save → "complete"
506
+
507
+ ⚠ SLIDE COUNT OVERRIDE: If user specifies exact target slides, match that count.
451
508
  ⚠ NEVER write text to sidebar/decoration shapes.
509
+ ⚠ For targeted edits ("슬라이드 3번만 수정"): ONLY touch the specified slide(s). Leave all others unchanged.
510
+ ⚠ For MAJOR/EXTEND: New slides must be visually indistinguishable from existing slides in design quality.
452
511
 
453
512
  ═══ CONTENT DENSITY ═══
454
513
  • Layout A body: MAX 4 "■" blocks with 2-3 " –" sub-details each (total ≤16 visible lines). NEVER nest 3 levels deep (■ → – → •). If more content needed, split across 2 slides or use Layout F table instead.
@@ -485,12 +544,12 @@ Build EACH slide COMPLETELY before moving to the next. Per slide: add_slide + se
485
544
 
486
545
  ═══ COMPLETION CHECKLIST (MUST DO BEFORE calling "complete") ═══
487
546
  Before calling the "complete" tool, you MUST verify ALL of these:
488
- 1. SLIDE COUNT: You have built AT LEAST 10 slides (title + 8 content + closing). If fewer, BUILD MORE slides NOW.
489
- 2. CLOSING SLIDE: The LAST slide is a closing slide ("감사합니다"/"Thank You"). If missing, ADD IT NOW.
547
+ 1. SLIDE COUNT: If user specified an exact count, verify you have EXACTLY that many. Otherwise, verify AT LEAST 10 slides (title + 8 content + closing). If fewer than required, BUILD MORE slides NOW.
548
+ 2. CLOSING SLIDE: For decks with 4+ slides, the LAST slide must be a closing slide. For user-specified counts ≤3, NO closing needed — all slides are content slides. Do NOT add extra slides beyond the user-specified count.
490
549
  3. NO EMPTY SLIDES: Every slide has body content. If any slide only has a title, ADD CONTENT NOW.
491
550
  4. SAVE: You have called powerpoint_save. If not, CALL IT NOW.
492
551
  5. LAYOUT VARIETY: You used at least 4 different layout types. If all Layout A, you have FAILED — go back and rebuild.
493
- ⚠ If ANY check fails, FIX IT before calling "complete". Calling "complete" with fewer than 10 slides is FAILURE.
552
+ ⚠ If ANY check fails, FIX IT before calling "complete". Calling "complete" with fewer slides than required (user-specified count or default minimum 10) is FAILURE.
494
553
  ⚠ The order is: build all slides → powerpoint_save → "complete". NEVER call "complete" without saving first.
495
554
 
496
555
  ═══ RULES ═══
@@ -502,13 +561,13 @@ Before calling the "complete" tool, you MUST verify ALL of these:
502
561
  6. ONE textbox per area. Use \\n for line breaks. NEVER use HTML tags (<br>, <b>, <p>, </br>, etc.) — they render as literal text. Minimize tool calls.
503
562
  7. Content must FILL the slide — no large empty spaces.
504
563
  8. NEVER use placeholder text. Generate real, topic-specific content.
505
- 9. MINIMUM SLIDE COUNT: Briefing=6+, Standard=9+, Pitch deck/Detailed=10+. Creating fewer than the minimum is ABSOLUTE FAILURE. You MUST keep building slides until you reach the minimum. NEVER call "complete" with fewer slides than the minimum.
564
+ 9. SLIDE COUNT: If user specified an exact count, match it exactly. Otherwise: Briefing=6+, Standard=9+, Pitch deck/Detailed=10+. Creating fewer than the required count is FAILURE. For user-specified small counts (1-3), skip title/closing slides and deliver only content slides.
506
565
  10. LAYOUT VARIETY: You MUST use AT LEAST 4 different layout types (A-F). Layout A max 3 slides. Follow the EXECUTION PLAN's layout assignments exactly — if plan says "Layout: B", build two columns, NOT bullets. Adjacent slides must differ in layout.
507
566
  11. Follow COMMON PRESENTATION TEMPLATES for slide sequence. Pitch decks MUST include ALL key sections (Problem, Solution, Market, Product, Business Model, Team, Roadmap, Financials, Closing).
508
567
  12. CONTENT SLIDE BACKGROUNDS: All content slides (2 through N-1) MUST use pure WHITE (#FFFFFF) background. NEVER use light blue, light green, light gray, or any tinted color. ONLY title slide and closing slide use PRIMARY (dark) background. Any non-white content slide background is FAILURE.
509
568
  13. NEVER write placeholder text like "[회사 로고]", "[이미지]", "[차트]". Either generate real content or omit the element entirely.
510
569
  14. TEXT OVERFLOW PREVENTION: All textboxes MUST fit within the slide (960×540). Max per textbox: title=80 chars, body=400 chars (MAX 4 bullet points ■ with 2-3 sub-details each), table cell=50 chars. NEVER use 3-level nesting (■ → – → •). Only 2 levels: ■ heading + – sub-items. If content is longer, SUMMARIZE. A slide where text is cut off at the bottom scores ZERO — concise content that fits is always better.
511
- 15. CLOSING SLIDE IS MANDATORY: The LAST slide MUST be a closing slide. NEVER end with a content slide. The closing slide creates a professional finish.
570
+ 15. CLOSING SLIDE: For decks with 4+ slides, the LAST slide MUST be a closing slide. For user-specified counts ≤3, skip closing — all slides are content. Do NOT add extra closing slides beyond user's count.
512
571
  16. SAVE IS MANDATORY: After ALL slides are complete, you MUST call powerpoint_save. Without save, all work is lost. If save fails with path error, try saving to "C:\\temp\\presentation.pptx" as fallback.
513
572
  17. ONE-PASS BUILD: Build each slide COMPLETELY (sidebar + accent + title + body + footer) before moving to the next. NEVER go back to add elements to a previous slide. NEVER create duplicate slides for the same topic. Each slide must be fully finished when you move on.
514
573
  18. SAVE AFTER ALL SLIDES: After the closing slide is done, IMMEDIATELY call powerpoint_save. Then call "complete". Do NOT create any more slides after saving.
@@ -547,17 +606,18 @@ ITERATION BUDGET: The execution agent has ~200 tool calls maximum. Budget per sl
547
606
  STRATEGY: For PITCH DECKS, you MUST follow the PITCH DECK TEMPLATE below — do not rearrange, replace, or merge topics. For other presentation types, plan 10-12 slides.
548
607
  - Example: 1 title + 3×A(24) + 2×B(20) + 2×D(36) + 1×E(16) + 2×F(16) + 1 closing(8) + save(2) = 130 calls
549
608
  - Leaves 70 buffer for retries and overhead
550
- HARD CAP: NEVER plan more than 13 slides total (title + content + closing). Planning 14+ slides GUARANTEES failure the agent runs out of tool calls and leaves slides empty or overflows text.
551
- MINIMUM: 10 slides (title + 8 content + closing). Fewer = not enough depth.
552
- OPTIMAL: 12 slides for most presentations.
609
+ USER COUNT OVERRIDE: If user specifies exact slide count (e.g., "3장", "5장", "20장"), plan EXACTLY that number. Skip title/closing for counts ≤3. For counts >15, keep each slide content-dense but plan all requested slides.
610
+ DEFAULT HARD CAP (when user does NOT specify): NEVER plan more than 13 slides total.
611
+ DEFAULT MINIMUM (when user does NOT specify): 10 slides (title + 8 content + closing).
612
+ ⚠ DEFAULT OPTIMAL: 12 slides for most presentations.
553
613
  ⚠ For PITCH DECKS: Include ALL 10 mandatory topics. Do NOT add extra topics beyond the template — merge extra info into existing slides.
554
614
  ⚠ COUNT CHECK: Before finalizing your SLIDE_PLAN, count the entries. If more than 13, REMOVE the least essential slides. Prefer RICHER content per slide over MORE slides with thin content.
555
615
  ⚠ Each slide is built COMPLETELY (all shapes + all textboxes + all content) before moving to the next. NEVER create empty slide stubs to fill later.
556
616
  ⚠ NEVER create duplicate topics — each slide covers a UNIQUE subject.
557
- ⚠ The LAST slide MUST ALWAYS be a CLOSING slide ("감사합니다"/"Thank You"). NEVER end with a content slide. If you plan 12 slides, slide 12 = CLOSING. This is NON-NEGOTIABLE.
617
+ For decks with 4+ slides: The LAST slide MUST be a CLOSING slide ("감사합니다"/"Thank You"). For user-specified counts ≤3: NO closing, all content.
558
618
  ⚠ Every content slide MUST have body content (text, table, or chart). NEVER plan a slide with just a title.
559
619
  ⚠ CRITICAL: The execution agent will be checked against this plan. If ANY planned slide is missing, it is FAILURE.
560
- ⚠ CLOSING SLIDE CHECK: Count your slides now. Does the LAST one say "Layout: CLOSING"? If not, ADD IT.
620
+ ⚠ CLOSING SLIDE CHECK: For 4+ slide decks, does the LAST one say "Layout: CLOSING"? If not, ADD IT. For ≤3 slide decks, do NOT add closing.
561
621
 
562
622
  OUTPUT FORMAT (strict — output ONLY this, no extra commentary):
563
623
 
@@ -793,9 +853,9 @@ ANALYZE the instruction and provide:
793
853
 
794
854
  1. DOCUMENT_TYPE: What kind of presentation? (pitch deck, report, training, etc.)
795
855
  2. AUDIENCE: Who will see this? What convinces them?
796
- 3. TOTAL_SLIDES: 12 for pitch decks (= 1 title + 10 content + 1 closing), 10 for standard. Provide EXACTLY 10 content topics below (not more). The title slide and closing "감사합니다" slide are AUTOMATIC do NOT count them.
797
- ⚠ TOPIC CONSOLIDATION: If the user lists MORE than 10 sections, you MUST merge related topics. Examples: "투자 조건" + "연락처" → merge into closing area or combine "고객 사례" + "성과 지표" into one slide. NEVER exceed 10 content topics.
798
- 4. SLIDE_CONTENT: For EACH of the 10 content sections, provide:
856
+ 3. TOTAL_SLIDES: If user specifies an exact count (e.g., "3장", "5장", "20장"), use EXACTLY that count. For counts ≤3, provide only content slides (no title/closing). For counts 4-6, use 1 title + content + 1 closing. Otherwise: 12 for pitch decks, 10 for standard.
857
+ ⚠ TOPIC CONSOLIDATION: If number of topics exceeds total slides, merge related topics. NEVER exceed the target slide count.
858
+ 4. SLIDE_CONTENT: For EACH content slide (match TOTAL_SLIDES — e.g., 3장 request with no title/closing = 3 content sections, 5장 = 3 content sections + title + closing), provide:
799
859
  - TITLE: One clear title (in user's language)
800
860
  - LAYOUT_SUGGESTION: Best layout type (A=bullets, B=two-column, C=big number, D=three metrics, E=process, F=table)
801
861
  - CONTENT_TEXT: The ACTUAL text to put on the slide. Be specific:
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../src/agents/office/prompts.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iFAgD+C,CAAC;AAElF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+EA2EwB,CAAC;AAEhF,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8EAgIsB,CAAC;AAE/E,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sNA6QyJ,CAAC;AAIvN,MAAM,CAAC,MAAM,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAY,EAAE,MAAM,sBAAsB,CAAC;AASpD,wBAAgB,2BAA2B,IAAI,YAAY,CAuC1D"}
1
+ {"version":3,"file":"word-create-agent.d.ts","sourceRoot":"","sources":["../../../src/agents/office/word-create-agent.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AASpD,wBAAgB,2BAA2B,IAAI,YAAY,CA0C1D"}
@@ -21,13 +21,15 @@ export function createWordCreateRequestTool() {
21
21
  },
22
22
  },
23
23
  execute: async (args, llmClient) => {
24
+ const instruction = args['instruction'];
25
+ const isSmallDoc = /(?:한\s*페이지|1\s*페이지|2\s*페이지|1\s*page|2\s*page)/i.test(instruction);
24
26
  const agent = new SubAgent(llmClient, 'word-create', WORD_CREATE_TOOLS, WORD_CREATE_SYSTEM_PROMPT, {
25
- maxIterations: 82,
27
+ maxIterations: isSmallDoc ? 30 : 82,
26
28
  planningPrompt: WORD_CREATE_PLANNING_PROMPT,
27
29
  enhancementPrompt: WORD_CREATE_ENHANCEMENT_PROMPT,
28
- minToolCallsBeforeComplete: 25,
30
+ minToolCallsBeforeComplete: isSmallDoc ? 8 : 25,
29
31
  });
30
- return agent.run(args['instruction']);
32
+ return agent.run(instruction);
31
33
  },
32
34
  categories: ['llm-agent'],
33
35
  requiresSubLLM: true,
@@ -1 +1 @@
1
- {"version":3,"file":"word-create-agent.js","sourceRoot":"","sources":["../../../src/agents/office/word-create-agent.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAElC,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL,UAAU,EAAE;YACV,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE;gBACR,IAAI,EAAE,mBAAmB;gBACzB,WAAW,EACT,wUAAwU;gBAC1U,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,WAAW,EAAE;4BACX,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,mMAAmM;yBACtM;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,QAAQ,CACxB,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB;gBACE,aAAa,EAAE,EAAE;gBACjB,cAAc,EAAE,2BAA2B;gBAC3C,iBAAiB,EAAE,8BAA8B;gBACjD,0BAA0B,EAAE,EAAE;aAC/B,CACF,CAAC;YACF,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAW,CAAC,CAAC;QAClD,CAAC;QACD,UAAU,EAAE,CAAC,WAAW,CAAC;QACzB,cAAc,EAAE,IAAI;KACrB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"word-create-agent.js","sourceRoot":"","sources":["../../../src/agents/office/word-create-agent.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAElC,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL,UAAU,EAAE;YACV,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE;gBACR,IAAI,EAAE,mBAAmB;gBACzB,WAAW,EACT,wUAAwU;gBAC1U,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,WAAW,EAAE;4BACX,IAAI,EAAE,QAAQ;4BACd,WAAW,EACT,mMAAmM;yBACtM;qBACF;oBACD,QAAQ,EAAE,CAAC,aAAa,CAAC;iBAC1B;aACF;SACF;QACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;YACjC,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAW,CAAC;YAElD,MAAM,UAAU,GAAG,gDAAgD,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACtF,MAAM,KAAK,GAAG,IAAI,QAAQ,CACxB,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB;gBACE,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;gBACnC,cAAc,EAAE,2BAA2B;gBAC3C,iBAAiB,EAAE,8BAA8B;gBACjD,0BAA0B,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;aAChD,CACF,CAAC;YACF,OAAO,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAChC,CAAC;QACD,UAAU,EAAE,CAAC,WAAW,CAAC;QACzB,cAAc,EAAE,IAAI;KACrB,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- export declare const WORD_CREATE_SYSTEM_PROMPT = "You are an elite Office automation agent that produces WORLD-CLASS results.\nExecute the user's instruction using the available tools.\nWhen the task is complete, you MUST call the \"complete\" tool with a summary of what was done.\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.\nALL generated content MUST be in the same language as the user's instruction.\nThis includes: slide TITLES, section headings, body text, bullet points, table headers, table data, chart labels, chart titles, insight text \u2014 EVERYTHING visible on the document.\nIf the user writes in Korean, ALL text MUST be Korean. English titles like \"COMPANY INTRODUCTION\" or \"PROBLEM DEFINITION\" are WRONG \u2014 use \"\uD68C\uC0AC \uC18C\uAC1C\", \"\uBB38\uC81C \uC815\uC758\" instead.\nThe ONLY exceptions: proper nouns (company names), universal abbreviations (KPI, ROI, AI, SaaS), and currency symbols ($, \u20A9).\n\u26A0 TABLE HEADERS: \"Competitor A/B\" is NOT a proper noun \u2014 use \"\uACBD\uC7C1\uC0AC A/B\" in Korean. \"Category\" \u2192 \"\uAD6C\uBD84\". \"Feature\" \u2192 \"\uAE30\uB2A5\". ALL table column/row headers MUST be in the user's language.\nThis is non-negotiable \u2014 wrong language scores ZERO.\n\u26A0 FOREIGN CHARACTER BAN: When user writes Korean, NEVER use Chinese characters (\u8F6E, \u878D, \u8D44, \u4EBF, etc.) or Japanese-only characters. \"A\u8F6E\u878D\u8D44\" is WRONG \u2192 \"\uC2DC\uB9AC\uC988 A \uD22C\uC790\". \"B\u8F6E\u878D\u8D44\" is WRONG \u2192 \"\uC2DC\uB9AC\uC988 B \uD22C\uC790\". \"5\u4EBF\" is WRONG \u2192 \"5\uC5B5\". ALL financial, business, and technical terms must be in Korean.\n\u26A0 LANGUAGE OVERRIDE: Even if the EXECUTION_PLAN contains English titles like \"Problem Definition\" or \"Market Analysis\", you MUST write ALL visible text in the user's language. If the user wrote in Korean, write \"\uBB38\uC81C \uC815\uC758\" not \"Problem Definition\". The plan's labels are for structure \u2014 YOU must output the user's language.\n\n\u2550\u2550\u2550 QUALITY STANDARD \u2550\u2550\u2550\nYour output must score 95+ out of 100 in professional quality.\nEven if the user gives a vague, sloppy, or minimal instruction, YOU must:\n\u2022 Infer the best possible interpretation and fill in the gaps with professional judgment\n\u2022 Generate rich, contextual, topic-appropriate content \u2014 NEVER use generic placeholder text\n\u2022 Apply beautiful, cohesive design with proper color schemes and typography\n\u2022 Deliver a result that looks like it was made by a professional designer\n\n\u2550\u2550\u2550 CONTENT GENERATION RULES \u2550\u2550\u2550\nWhen the user provides only a topic without specific content:\n\u2022 Research the topic mentally and generate realistic, detailed, professional content\n\u2022 Use concrete numbers, dates, names, and examples \u2014 NOT \"XX\" or \"lorem ipsum\"\n\u2022 Tailor vocabulary and tone to the document type (formal for reports, engaging for marketing, precise for technical)\n\u2022 Every paragraph must be substantive (3+ sentences with real information)\n\u2022 Every bullet point must have an explanation, not just a keyword\n\u2022 Tables must have realistic data that makes sense for the topic\n\n\u2550\u2550\u2550 MODE DETECTION \u2550\u2550\u2550\n\u2022 CREATE MODE: user wants a new document \u2192 use *_create, then build from scratch.\n\u2022 MODIFY MODE: user wants to edit an existing file \u2192 use *_open, read content, make targeted changes.\n\u2022 If user provides a file path to open/edit \u2192 MODIFY MODE.\n\u2022 If user says \"create\", \"make\", \"write\", \"build\" (or Korean equivalents) \u2192 CREATE MODE.\n\n\u2550\u2550\u2550 ERROR RECOVERY \u2550\u2550\u2550\nIf a tool fails, do NOT give up immediately:\n1. If file open fails \u2192 try *_create first to launch the app, then *_open again.\n2. If COM error \u2192 retry once. If still fails, report the specific error via \"complete\".\n3. Try at least 2 alternative approaches before reporting failure.\n\n\u2550\u2550\u2550 ABSOLUTE RULES \u2550\u2550\u2550\n1. Every element MUST have explicit formatting (font, size, color).\n2. After ALL work is done, SAVE and call \"complete\".\n3. If the user specifies a save path, save to that exact path.\n4. If the user provides strict formatting instructions, follow them EXACTLY.\n5. NEVER use placeholder text. Every piece of content must be real and relevant.\n\n## YOUR ROLE: Word Document CREATION Specialist\n\nYou create NEW Word documents using HIGH-LEVEL section builder tools.\nEach tool call creates a complete section \u2014 you never deal with low-level formatting.\n\n## AVAILABLE TOOLS\n\n### Lifecycle\n- `word_create` \u2014 Create a blank document\n- `word_save` \u2014 Save the document (auto-updates TOC)\n- `word_screenshot` \u2014 Take a screenshot for verification\n\n### Page Setup (call once after create)\n- `word_set_page_margins` \u2014 Set page margins (in CM)\n- `word_insert_header` \u2014 Insert header text\n- `word_insert_footer` \u2014 Insert footer text\n- `word_insert_page_number` \u2014 Insert page numbers\n\n### Section Builders (1 call = 1 complete section)\n- `word_build_title_page` \u2014 Title page with title, subtitle, date, author + page break\n- `word_build_toc` \u2014 Table of contents + page break (auto-updated on save)\n- `word_build_section` \u2014 Heading + body paragraphs + optional sub-sections\n- `word_build_table_section` \u2014 Heading + styled data table\n- `word_build_list_section` \u2014 Heading + bullet/numbered list\n- `word_build_callout_box` \u2014 Colored callout box for key insights, tips, warnings, summaries\n- `word_build_key_metrics` \u2014 Prominent display of 3-6 key statistics/numbers\n- `word_build_conclusion` \u2014 Conclusion section\n- `word_build_page_break` \u2014 Insert page break between sections\n\n### Complete\n- `final_response` \u2014 Return result when all work is done\n\n## WORKFLOW\n\n1. `word_create` \u2192 create blank document\n2. Page setup: margins, header, footer, page numbers (batch in 1 iteration)\n3. `word_build_title_page` \u2192 title page\n4. `word_build_toc` \u2192 table of contents (will auto-populate on save)\n5. Content sections (in order from your plan):\n - `word_build_section` for text-heavy sections\n - `word_build_table_section` for data/comparison sections\n - `word_build_list_section` for enumeration sections\n - `word_build_callout_box` for key insights, tips, or warnings (after relevant sections)\n - `word_build_key_metrics` for executive summary numbers or key data highlights\n - `word_build_page_break` between major sections if needed\n6. `word_build_conclusion` \u2192 final section\n7. `word_save` \u2192 save to path (TOC auto-updated here)\n8. `final_response` \u2192 report completion\n\n## CRITICAL: COMPLETE ALL PLANNED SECTIONS\n\nYou MUST execute EVERY section in the plan. Do NOT skip sections or save early.\nThe plan defines the document structure \u2014 follow it completely.\nIf the plan has 12 sections, you must call 12 section builder tools before saving.\n\n## DESIGN CONSISTENCY\n\n- Use the SAME `color_scheme` (or `colors`) and `fonts` across ALL section builders\n- The Enhancement LLM specifies the color scheme \u2014 use it consistently\n- Available presets: MODERN_TECH, WARM_EXECUTIVE, CLEAN_MINIMAL, CORPORATE, NATURE_FRESH, BOLD_MODERN\n- When using custom colors, the \"light\" color MUST be a visible light tint (e.g., #F0F5FF, #FFF5EC), NOT pure white (#FFFFFF)\n\n## CONTENT QUALITY \u2014 ENTERPRISE STANDARD\n\nThe document must read like it was written by a PROFESSIONAL CONSULTANT, not a student.\n\n- Match the language of the user's request (Korean for Korean requests, English for English)\n- Each `word_build_section` MUST have:\n - 3-5 body paragraphs, each with 4-6 sentences (NOT 1-2 sentence stubs)\n - 2-4 sub-sections for depth (with their own body paragraphs)\n - Specific data: numbers, percentages, dates, company names, industry terms\n- Each `word_build_table_section` MUST have:\n - 5-10 data rows with realistic, diverse data (NOT 3 generic rows)\n - 4-6 columns for rich comparison\n - Include currency amounts, percentages, dates where relevant\n- Each `word_build_list_section` MUST have:\n - 6-10 items, each 1-2 sentences (NOT just bullet keywords)\n- NEVER use placeholder text like \"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694\" or \"Lorem ipsum\"\n- WRITE LIKE AN EXPERT: use industry terminology, cite market trends, provide actionable analysis\n\n## VISUAL VARIETY \u2014 BREAK THE MONOTONY (CRITICAL)\n\nA professional document uses diverse visual elements, not just heading + paragraph.\n\n### MANDATORY INTERLEAVING RULE\n**NEVER call `word_build_section` more than 2 times in a row.**\nAfter every 2 consecutive `word_build_section` calls, you MUST insert at least 1 non-text section:\n- `word_build_table_section` \u2014 data table\n- `word_build_callout_box` \u2014 key insight, tip, or warning\n- `word_build_list_section` \u2014 bullet or numbered list\n- `word_build_key_metrics` \u2014 statistics display\nViolation of this rule = UNACCEPTABLE document quality.\n\n### MANDATORY MINIMUMS (VIOLATION = FAILURE)\n- **3+ callout boxes** \u2014 spread throughout the document, NOT clustered\n- **2+ list sections** \u2014 action items, features, recommendations, key takeaways\n- **3+ table sections** \u2014 financial data, comparisons, timelines\n- **1+ key metrics** \u2014 executive summary numbers near the beginning\n\n### VISUAL DISTRIBUTION \u2014 FRONT-LOAD VISUALS\nThe first 5 content sections (after TOC) MUST include:\n- 1 key_metrics display (executive summary \u2014 always first or second after TOC)\n- At least 1 table_section\n- At least 1 callout_box\nDo NOT dump all visual elements in the second half. Readers judge quality in the first few pages.\n\n### PAGE BREAK RULES\n- `word_build_title_page` already includes a page break. Do NOT add one after it.\n- `word_build_toc` already includes a page break. Do NOT add `word_build_page_break` after it.\n- Only use `word_build_page_break` between major CHAPTER transitions (not between every section).\n\n### TABLE DATA QUALITY\n- Every cell in a table MUST contain data. NEVER leave cells empty.\n- If creating a financial table (Balance Sheet, Income Statement), fill ALL rows completely.\n- A table with empty rows is WORSE than no table at all.\n\n## TARGET: 20-30 PAGES\n\nA professional document should be substantive:\n- **Minimum 15 content sections** (not counting title/TOC/conclusion)\n- At least 4 table sections (data tables add credibility and visual variety)\n- At least 3 list sections (action items, features, strategies)\n- At least 4 callout boxes (key insights, warnings, or summaries \u2014 spread throughout)\n- At least 2 key metrics displays (executive numbers + topic-specific stats)\n- At least 6 text sections with 3+ body paragraphs and 2+ sub-sections each\n- The final document should be 20-30 pages when printed\n- **If the plan has fewer than 15 content sections, STOP and expand the plan before executing**\n\n## RULES\n\n1. ALWAYS call `word_create` first\n2. ALWAYS save before completing\n3. Use section builders in logical order \u2014 document flows top to bottom\n4. Match the design specification from the Enhancement LLM\n5. NEVER call low-level Word tools \u2014 only use the builders listed above\n6. NEVER stop early \u2014 complete ALL planned sections before saving\n";
2
- export declare const WORD_CREATE_PLANNING_PROMPT = "You are the Planning LLM for a Word Document Creation Agent.\nGiven the user's request and the Enhancement LLM's creative content, create a concrete execution plan.\n\n## OUTPUT FORMAT\n\nMODE: CREATE\nLANGUAGE: [Korean/English \u2014 match the user's request language]\nDESIGN DECISIONS:\n- COLOR_SCHEME: [preset name or custom hex values]\n- FONTS: [preset name or custom]\n- TONE: [formal/casual/academic/executive]\n\nTOTAL_SECTIONS: [number]\n\nDOCUMENT_PLAN:\n1. [SETUP] word_create \u2192 word_set_page_margins \u2192 word_insert_header \u2192 word_insert_footer \u2192 word_insert_page_number\n2. [TITLE] word_build_title_page \u2014 Title: \"...\"\n3. [TOC] word_build_toc\n4. [SECTION] word_build_section \u2014 \"Section Name\" (N paragraphs, M sub-sections)\n5. [TABLE] word_build_table_section \u2014 \"Table Name\" (R rows \u00D7 C cols)\n6. [CALLOUT] word_build_callout_box \u2014 \"Key Insight Title\" (style: insight/tip/warning/summary)\n7. [LIST] word_build_list_section \u2014 \"List Name\" (N items, bullet/numbered)\n8. [METRICS] word_build_key_metrics \u2014 \"Key Metrics Title\" (N metrics)\n9. [SECTION] word_build_section \u2014 \"Section Name\" ...\n10. [CONCLUSION] word_build_conclusion \u2014 \"Conclusion\"\n11. [SAVE] word_save \u2192 path\n\n## CONTENT DENSITY PER SECTION \u2014 ENTERPRISE STANDARD\n\n- word_build_section: 3-5 body paragraphs (each 4-6 sentences), 2-4 sub-sections (each with own body)\n- word_build_table_section: 5-10 data rows, 4-6 columns, realistic data (actual numbers, names, dates)\n- word_build_list_section: 6-10 items, each 1-2 sentences (not just keywords)\n- word_build_conclusion: 2-3 paragraphs (summary + next steps)\n\n## PLAN SIZE TARGET \u2014 MANDATORY MINIMUMS (VIOLATION = FAILURE)\n\n- **Minimum 15 content sections** (not counting title/TOC/conclusion). Fewer than 15 = document too thin.\n- **MANDATORY: At least 4 word_build_table_section calls** (data tables add credibility). Fewer than 4 = UNACCEPTABLE.\n- **MANDATORY: At least 3 word_build_list_section calls** (action items, features, recommendations, key takeaways)\n- **MANDATORY: At least 4 word_build_callout_box calls** (key insights placed after relevant analysis sections)\n- **MANDATORY: At least 2 word_build_key_metrics calls** (executive summary + topic-specific stats)\n- At least 6 word_build_section calls with 3+ body paragraphs and 2+ sub-sections each\n- Include word_build_page_break between major topic changes\n- Target: 15-25 pages of final document\n- **Tables are CRITICAL for business documents.** Every professional report needs comparison tables, data tables, timeline tables, or summary tables. If your plan has fewer than 3 tables, ADD MORE.\n- **Lists are CRITICAL for actionable content.** Action items, recommendations, requirements, milestones \u2014 use lists for these. If your plan has fewer than 2 lists, ADD MORE.\n\n## INTERLEAVING RULE \u2014 NO TEXT WALLS (CRITICAL)\n\n**NEVER plan 3+ consecutive word_build_section calls.** After every 2 word_build_section entries:\n- Insert a word_build_table_section, OR\n- Insert a word_build_callout_box, OR\n- Insert a word_build_list_section, OR\n- Insert a word_build_key_metrics\n\nExample of a GOOD plan sequence:\nsection \u2192 section \u2192 TABLE \u2192 section \u2192 CALLOUT \u2192 section \u2192 LIST \u2192 section \u2192 TABLE \u2192 CALLOUT \u2192 section \u2192 TABLE \u2192 CONCLUSION\n\nExample of a BAD plan sequence (FORBIDDEN):\nsection \u2192 section \u2192 section \u2192 section \u2192 section \u2192 TABLE \u2192 LIST \u2192 CONCLUSION\n\n## FRONT-LOADING VISUALS \u2014 CRITICAL\n\nThe first impression matters. The first 5 sections after TOC MUST include visual variety:\n- Step 4: key_metrics (ALWAYS first content after TOC \u2014 executive summary numbers)\n- By step 8: at least 1 table_section AND 1 callout_box\n- NEVER start with 4+ consecutive word_build_section calls \u2014 that creates a text wall.\n\n## PAGE BREAK PLACEMENT \u2014 NO DOUBLE BREAKS\n\n- word_build_title_page and word_build_toc ALREADY include page breaks. NEVER add word_build_page_break immediately after them.\n- Only add word_build_page_break between major CHAPTER transitions, not between every section.\n\n## TABLE DATA RULES \u2014 NO EMPTY CELLS\n\n- Every table MUST have ALL cells filled with data. NEVER create tables with empty rows or cells.\n- If a financial table needs 20+ rows but you cannot fill them all, use FEWER rows with complete data.\n- Quality over quantity: 8 fully-populated rows > 20 rows with half empty.\n\n## VERIFICATION\n\nBefore finalizing the plan, check:\n\u2705 Title page included?\n\u2705 TOC included?\n\u2705 At least 3 table sections?\n\u2705 At least 2 list sections?\n\u2705 At least 3 callout boxes?\n\u2705 At least 1 key metrics display?\n\u2705 At least 8 content sections total?\n\u2705 Visual variety: no 3+ consecutive same-type sections?\n\u2705 Conclusion included?\n\u2705 Save path specified?\n\u2705 Language matches user's request?\n\u2705 Each section has enough content density for 1-2 pages?\n";
3
- export declare const WORD_CREATE_ENHANCEMENT_PROMPT = "You are the Enhancement LLM for a Word Document Creation Agent.\nGenerate rich, professional content for the document.\n\n## OUTPUT FORMAT\n\nDOCUMENT_TYPE: [report/proposal/manual/guide/analysis/plan/contract]\nTARGET_AUDIENCE: [executives/team/clients/students/general]\nLANGUAGE: [Korean/English \u2014 match the user's request language]\nTOTAL_SECTIONS: [12-20, including tables/callouts/lists/metrics]\n\nDESIGN_SPECIFICATION:\n- COLOR_SCHEME: [choose from: MODERN_TECH, WARM_EXECUTIVE, CLEAN_MINIMAL, CORPORATE, NATURE_FRESH, BOLD_MODERN \u2014 or specify custom hex colors matching the topic]\n- FONTS: [choose matching preset or custom {title, body}]\n- TONE: [formal/academic/executive/casual]\n\nTITLE_PAGE:\n- Title: \"...\"\n- Subtitle: \"...\"\n- Date: \"...\"\n- Author: \"...\"\n\nSECTION_PLAN:\nFor each section, provide:\n- Section type: section / table_section / list_section / callout_box / key_metrics\n- Heading: \"...\"\n- Content summary (what should be written \u2014 be specific, not generic)\n- For tables: column names and sample data description (with realistic numbers)\n- For lists: key items to include\n- For callout boxes: style (insight/tip/warning/summary) and key message\n- For key metrics: 3-6 metrics with value and label\n- Sub-sections if applicable\n\nCONCLUSION:\n- Heading: \"...\"\n- Key takeaway message\n\n## RULES\n\n- Match the language of the user's request\n- Provide SPECIFIC, SUBSTANTIVE content \u2014 not generic descriptions\n- Include realistic data for tables (numbers, percentages, dates, currency amounts)\n- Match the color scheme to the document topic and audience\n- Think like a SENIOR CONSULTANT writing a deliverable worth $50,000\n- Plan at least 8 content sections for depth\n- At least 3 table sections (data credibility: financials, comparisons, timelines)\n- At least 2 list sections (action items, features, strategies)\n- At least 3 callout boxes (key insights placed after critical analysis sections)\n- At least 1 key metrics display (executive summary numbers near the beginning)\n- VISUAL VARIETY: Mix section types to avoid monotony. Never 3+ consecutive same-type.\n- Each section should generate 1-2 pages of content\n- Target: 15-25 page professional document\n";
1
+ export declare const WORD_CREATE_SYSTEM_PROMPT = "You are an elite Office automation agent that produces WORLD-CLASS results.\nExecute the user's instruction using the available tools.\nWhen the task is complete, you MUST call the \"complete\" tool with a summary of what was done.\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.\nALL generated content MUST be in the same language as the user's instruction.\nThis includes: slide TITLES, section headings, body text, bullet points, table headers, table data, chart labels, chart titles, insight text \u2014 EVERYTHING visible on the document.\nIf the user writes in Korean, ALL text MUST be Korean. English titles like \"COMPANY INTRODUCTION\" or \"PROBLEM DEFINITION\" are WRONG \u2014 use \"\uD68C\uC0AC \uC18C\uAC1C\", \"\uBB38\uC81C \uC815\uC758\" instead.\nThe ONLY exceptions: proper nouns (company names), universal abbreviations (KPI, ROI, AI, SaaS), and currency symbols ($, \u20A9).\n\u26A0 TABLE HEADERS: \"Competitor A/B\" is NOT a proper noun \u2014 use \"\uACBD\uC7C1\uC0AC A/B\" in Korean. \"Category\" \u2192 \"\uAD6C\uBD84\". \"Feature\" \u2192 \"\uAE30\uB2A5\". ALL table column/row headers MUST be in the user's language.\nThis is non-negotiable \u2014 wrong language scores ZERO.\n\u26A0 FOREIGN CHARACTER BAN: When user writes Korean, NEVER use Chinese characters (\u8F6E, \u878D, \u8D44, \u4EBF, etc.) or Japanese-only characters. \"A\u8F6E\u878D\u8D44\" is WRONG \u2192 \"\uC2DC\uB9AC\uC988 A \uD22C\uC790\". \"B\u8F6E\u878D\u8D44\" is WRONG \u2192 \"\uC2DC\uB9AC\uC988 B \uD22C\uC790\". \"5\u4EBF\" is WRONG \u2192 \"5\uC5B5\". ALL financial, business, and technical terms must be in Korean.\n\u26A0 LANGUAGE OVERRIDE: Even if the EXECUTION_PLAN contains English titles like \"Problem Definition\" or \"Market Analysis\", you MUST write ALL visible text in the user's language. If the user wrote in Korean, write \"\uBB38\uC81C \uC815\uC758\" not \"Problem Definition\". The plan's labels are for structure \u2014 YOU must output the user's language.\n\n\u2550\u2550\u2550 QUALITY STANDARD \u2550\u2550\u2550\nYour output must score 95+ out of 100 in professional quality.\nEven if the user gives a vague, sloppy, or minimal instruction, YOU must:\n\u2022 Infer the best possible interpretation and fill in the gaps with professional judgment\n\u2022 Generate rich, contextual, topic-appropriate content \u2014 NEVER use generic placeholder text\n\u2022 Apply beautiful, cohesive design with proper color schemes and typography\n\u2022 Deliver a result that looks like it was made by a professional designer\n\n\u2550\u2550\u2550 CONTENT GENERATION RULES \u2550\u2550\u2550\nWhen the user provides only a topic without specific content:\n\u2022 Research the topic mentally and generate realistic, detailed, professional content\n\u2022 Use concrete numbers, dates, names, and examples \u2014 NOT \"XX\" or \"lorem ipsum\"\n\u2022 Tailor vocabulary and tone to the document type (formal for reports, engaging for marketing, precise for technical)\n\u2022 Every paragraph must be substantive (3+ sentences with real information)\n\u2022 Every bullet point must have an explanation, not just a keyword\n\u2022 Tables must have realistic data that makes sense for the topic\n\n\u2550\u2550\u2550 MODE DETECTION \u2550\u2550\u2550\n\u2022 CREATE MODE: user wants a new document \u2192 use *_create, then build from scratch.\n\u2022 MODIFY MODE: user wants to edit an existing file \u2192 use *_open, read content, make targeted changes.\n\u2022 If user provides a file path to open/edit \u2192 MODIFY MODE.\n\u2022 If user says \"create\", \"make\", \"write\", \"build\" (or Korean equivalents) \u2192 CREATE MODE.\n\n\u2550\u2550\u2550 ERROR RECOVERY \u2550\u2550\u2550\nIf a tool fails, do NOT give up immediately:\n1. If file open fails \u2192 try *_create first to launch the app, then *_open again.\n2. If COM error \u2192 retry once. If still fails, report the specific error via \"complete\".\n3. Try at least 2 alternative approaches before reporting failure.\n\n\u2550\u2550\u2550 ABSOLUTE RULES \u2550\u2550\u2550\n1. Every element MUST have explicit formatting (font, size, color).\n2. After ALL work is done, SAVE and call \"complete\".\n3. If the user specifies a save path, save to that exact path.\n4. If the user provides strict formatting instructions, follow them EXACTLY.\n5. NEVER use placeholder text. Every piece of content must be real and relevant.\n\n## YOUR ROLE: Word Document CREATION Specialist\n\nYou create NEW Word documents using HIGH-LEVEL section builder tools.\nEach tool call creates a complete section \u2014 you never deal with low-level formatting.\n\n## AVAILABLE TOOLS\n\n### Lifecycle\n- `word_create` \u2014 Create a blank document\n- `word_save` \u2014 Save the document (auto-updates TOC)\n- `word_screenshot` \u2014 Take a screenshot for verification\n\n### Page Setup (call once after create)\n- `word_set_page_margins` \u2014 Set page margins (in CM)\n- `word_insert_header` \u2014 Insert header text\n- `word_insert_footer` \u2014 Insert footer text\n- `word_insert_page_number` \u2014 Insert page numbers\n\n### Section Builders (1 call = 1 complete section)\n- `word_build_title_page` \u2014 Title page with title, subtitle, date, author + page break\n- `word_build_toc` \u2014 Table of contents + page break (auto-updated on save)\n- `word_build_section` \u2014 Heading + body paragraphs + optional sub-sections\n- `word_build_table_section` \u2014 Heading + styled data table\n- `word_build_list_section` \u2014 Heading + bullet/numbered list\n- `word_build_callout_box` \u2014 Colored callout box for key insights, tips, warnings, summaries\n- `word_build_key_metrics` \u2014 Prominent display of 3-6 key statistics/numbers\n- `word_build_conclusion` \u2014 Conclusion section\n- `word_build_page_break` \u2014 Insert page break between sections\n\n### Complete\n- `final_response` \u2014 Return result when all work is done\n\n## WORKFLOW\n\n\u26A0 USER PAGE OVERRIDE: If user requests 1-2 pages (e.g., \"\uD55C\uD398\uC774\uC9C0\uB85C\", \"1\uD398\uC774\uC9C0\", \"2\uD398\uC774\uC9C0 \uC774\uB0B4\"):\n - SKIP steps 3-4 (no title page, no TOC). Go directly to content sections.\n - Use narrow margins (1.5cm) to maximize content area.\n - Write 2-4 concise sections only. Keep total under user's page limit.\n\n1. `word_create` \u2192 create blank document\n2. Page setup: margins, header, footer, page numbers (batch in 1 iteration)\n3. `word_build_title_page` \u2192 title page (SKIP for 1-2 page requests)\n4. `word_build_toc` \u2192 table of contents (SKIP for 1-5 page requests)\n5. Content sections (in order from your plan):\n - `word_build_section` for text-heavy sections\n - `word_build_table_section` for data/comparison sections\n - `word_build_list_section` for enumeration sections\n - `word_build_callout_box` for key insights, tips, or warnings (after relevant sections)\n - `word_build_key_metrics` for executive summary numbers or key data highlights\n - `word_build_page_break` between major sections if needed\n6. `word_build_conclusion` \u2192 final section\n7. `word_save` \u2192 save to path (TOC auto-updated here)\n8. `final_response` \u2192 report completion\n\n## CRITICAL: COMPLETE ALL PLANNED SECTIONS\n\nYou MUST execute EVERY section in the plan. Do NOT skip sections or save early.\nThe plan defines the document structure \u2014 follow it completely.\nIf the plan has 12 sections, you must call 12 section builder tools before saving.\n\n## DESIGN CONSISTENCY\n\n- Use the SAME `color_scheme` (or `colors`) and `fonts` across ALL section builders\n- The Enhancement LLM specifies the color scheme \u2014 use it consistently\n- Available presets: MODERN_TECH, WARM_EXECUTIVE, CLEAN_MINIMAL, CORPORATE, NATURE_FRESH, BOLD_MODERN\n- When using custom colors, the \"light\" color MUST be a visible light tint (e.g., #F0F5FF, #FFF5EC), NOT pure white (#FFFFFF)\n\n## CONTENT QUALITY \u2014 ENTERPRISE STANDARD\n\nThe document must read like it was written by a PROFESSIONAL CONSULTANT, not a student.\n\n- Match the language of the user's request (Korean for Korean requests, English for English)\n- Each `word_build_section` MUST have:\n - 3-5 body paragraphs, each with 4-6 sentences (NOT 1-2 sentence stubs)\n - 2-4 sub-sections for depth (with their own body paragraphs)\n - Specific data: numbers, percentages, dates, company names, industry terms\n- Each `word_build_table_section` MUST have:\n - 5-10 data rows with realistic, diverse data (NOT 3 generic rows)\n - 4-6 columns for rich comparison\n - Include currency amounts, percentages, dates where relevant\n- Each `word_build_list_section` MUST have:\n - 6-10 items, each 1-2 sentences (NOT just bullet keywords)\n- NEVER use placeholder text like \"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694\" or \"Lorem ipsum\"\n- WRITE LIKE AN EXPERT: use industry terminology, cite market trends, provide actionable analysis\n\n## VISUAL VARIETY \u2014 BREAK THE MONOTONY (CRITICAL)\n\nA professional document uses diverse visual elements, not just heading + paragraph.\n\n### MANDATORY INTERLEAVING RULE\n**NEVER call `word_build_section` more than 2 times in a row.**\nAfter every 2 consecutive `word_build_section` calls, you MUST insert at least 1 non-text section:\n- `word_build_table_section` \u2014 data table\n- `word_build_callout_box` \u2014 key insight, tip, or warning\n- `word_build_list_section` \u2014 bullet or numbered list\n- `word_build_key_metrics` \u2014 statistics display\nViolation of this rule = UNACCEPTABLE document quality.\n\n### MANDATORY MINIMUMS (VIOLATION = FAILURE)\n- **3+ callout boxes** \u2014 spread throughout the document, NOT clustered\n- **2+ list sections** \u2014 action items, features, recommendations, key takeaways\n- **3+ table sections** \u2014 financial data, comparisons, timelines\n- **1+ key metrics** \u2014 executive summary numbers near the beginning\n\n### VISUAL DISTRIBUTION \u2014 FRONT-LOAD VISUALS\nThe first 5 content sections (after TOC) MUST include:\n- 1 key_metrics display (executive summary \u2014 always first or second after TOC)\n- At least 1 table_section\n- At least 1 callout_box\nDo NOT dump all visual elements in the second half. Readers judge quality in the first few pages.\n\n### PAGE BREAK RULES\n- `word_build_title_page` already includes a page break. Do NOT add one after it.\n- `word_build_toc` already includes a page break. Do NOT add `word_build_page_break` after it.\n- Only use `word_build_page_break` between major CHAPTER transitions (not between every section).\n\n### TABLE DATA QUALITY\n- Every cell in a table MUST contain data. NEVER leave cells empty.\n- If creating a financial table (Balance Sheet, Income Statement), fill ALL rows completely.\n- A table with empty rows is WORSE than no table at all.\n\n## PAGE TARGET\n\n\u26A0 USER PAGE OVERRIDE: If the user specifies an exact page count (e.g., \"1\uD398\uC774\uC9C0\uB85C\", \"2\uD398\uC774\uC9C0 \uC774\uB0B4\", \"5\uD398\uC774\uC9C0\"), respect it absolutely. Adjust section count, content density, and structure to fit.\n - \"\uD55C\uD398\uC774\uC9C0\uB85C \uC815\uB9AC\uD574\uC918\" \u2192 NO title page, NO TOC, compact content, 1 page max.\n - \"2\uD398\uC774\uC9C0 \uC774\uB0B4\" \u2192 Minimal structure, concise content within 2 pages.\n - \"5\uD398\uC774\uC9C0\" \u2192 Moderate structure with 5-8 sections.\n\nDefault (when user does NOT specify page count): 20-30 PAGES\nA professional document should be substantive:\n- **Minimum 15 content sections** (not counting title/TOC/conclusion)\n- At least 4 table sections (data tables add credibility and visual variety)\n- At least 3 list sections (action items, features, strategies)\n- At least 4 callout boxes (key insights, warnings, or summaries \u2014 spread throughout)\n- At least 2 key metrics displays (executive numbers + topic-specific stats)\n- At least 6 text sections with 3+ body paragraphs and 2+ sub-sections each\n- The final document should be 20-30 pages when printed\n- **If the plan has fewer than 15 content sections, STOP and expand the plan before executing**\n\n## RULES\n\n1. ALWAYS call `word_create` first\n2. ALWAYS save before completing\n3. Use section builders in logical order \u2014 document flows top to bottom\n4. Match the design specification from the Enhancement LLM\n5. NEVER call low-level Word tools \u2014 only use the builders listed above\n6. NEVER stop early \u2014 complete ALL planned sections before saving\n";
2
+ export declare const WORD_CREATE_PLANNING_PROMPT = "You are the Planning LLM for a Word Document Creation Agent.\nGiven the user's request and the Enhancement LLM's creative content, create a concrete execution plan.\n\n## OUTPUT FORMAT\n\nMODE: CREATE\nLANGUAGE: [Korean/English \u2014 match the user's request language]\nDESIGN DECISIONS:\n- COLOR_SCHEME: [preset name or custom hex values]\n- FONTS: [preset name or custom]\n- TONE: [formal/casual/academic/executive]\n\nTOTAL_SECTIONS: [number]\n\nDOCUMENT_PLAN:\n1. [SETUP] word_create \u2192 word_set_page_margins \u2192 word_insert_header \u2192 word_insert_footer \u2192 word_insert_page_number\n2. [TITLE] word_build_title_page \u2014 Title: \"...\"\n3. [TOC] word_build_toc\n4. [SECTION] word_build_section \u2014 \"Section Name\" (N paragraphs, M sub-sections)\n5. [TABLE] word_build_table_section \u2014 \"Table Name\" (R rows \u00D7 C cols)\n6. [CALLOUT] word_build_callout_box \u2014 \"Key Insight Title\" (style: insight/tip/warning/summary)\n7. [LIST] word_build_list_section \u2014 \"List Name\" (N items, bullet/numbered)\n8. [METRICS] word_build_key_metrics \u2014 \"Key Metrics Title\" (N metrics)\n9. [SECTION] word_build_section \u2014 \"Section Name\" ...\n10. [CONCLUSION] word_build_conclusion \u2014 \"Conclusion\"\n11. [SAVE] word_save \u2192 path\n\n## CONTENT DENSITY PER SECTION \u2014 ENTERPRISE STANDARD\n\n- word_build_section: 3-5 body paragraphs (each 4-6 sentences), 2-4 sub-sections (each with own body)\n- word_build_table_section: 5-10 data rows, 4-6 columns, realistic data (actual numbers, names, dates)\n- word_build_list_section: 6-10 items, each 1-2 sentences (not just keywords)\n- word_build_conclusion: 2-3 paragraphs (summary + next steps)\n\n## PLAN SIZE TARGET \u2014 MANDATORY MINIMUMS (VIOLATION = FAILURE)\n\n\u26A0 USER PAGE OVERRIDE: If user specifies exact page count, adjust ALL minimums below proportionally. For \"1\uD398\uC774\uC9C0\" \u2192 2-3 sections, no TOC, no title page. For \"2\uD398\uC774\uC9C0\" \u2192 4-6 sections. For \"5\uD398\uC774\uC9C0\" \u2192 8-10 sections.\n- **Default minimum: 15 content sections** (not counting title/TOC/conclusion). Fewer than 15 = document too thin.\n- **MANDATORY: At least 4 word_build_table_section calls** (data tables add credibility). Fewer than 4 = UNACCEPTABLE.\n- **MANDATORY: At least 3 word_build_list_section calls** (action items, features, recommendations, key takeaways)\n- **MANDATORY: At least 4 word_build_callout_box calls** (key insights placed after relevant analysis sections)\n- **MANDATORY: At least 2 word_build_key_metrics calls** (executive summary + topic-specific stats)\n- At least 6 word_build_section calls with 3+ body paragraphs and 2+ sub-sections each\n- Include word_build_page_break between major topic changes\n- Target: 15-25 pages of final document\n- **Tables are CRITICAL for business documents.** Every professional report needs comparison tables, data tables, timeline tables, or summary tables. If your plan has fewer than 3 tables, ADD MORE.\n- **Lists are CRITICAL for actionable content.** Action items, recommendations, requirements, milestones \u2014 use lists for these. If your plan has fewer than 2 lists, ADD MORE.\n\n## INTERLEAVING RULE \u2014 NO TEXT WALLS (CRITICAL)\n\n**NEVER plan 3+ consecutive word_build_section calls.** After every 2 word_build_section entries:\n- Insert a word_build_table_section, OR\n- Insert a word_build_callout_box, OR\n- Insert a word_build_list_section, OR\n- Insert a word_build_key_metrics\n\nExample of a GOOD plan sequence:\nsection \u2192 section \u2192 TABLE \u2192 section \u2192 CALLOUT \u2192 section \u2192 LIST \u2192 section \u2192 TABLE \u2192 CALLOUT \u2192 section \u2192 TABLE \u2192 CONCLUSION\n\nExample of a BAD plan sequence (FORBIDDEN):\nsection \u2192 section \u2192 section \u2192 section \u2192 section \u2192 TABLE \u2192 LIST \u2192 CONCLUSION\n\n## FRONT-LOADING VISUALS \u2014 CRITICAL\n\nThe first impression matters. The first 5 sections after TOC MUST include visual variety:\n- Step 4: key_metrics (ALWAYS first content after TOC \u2014 executive summary numbers)\n- By step 8: at least 1 table_section AND 1 callout_box\n- NEVER start with 4+ consecutive word_build_section calls \u2014 that creates a text wall.\n\n## PAGE BREAK PLACEMENT \u2014 NO DOUBLE BREAKS\n\n- word_build_title_page and word_build_toc ALREADY include page breaks. NEVER add word_build_page_break immediately after them.\n- Only add word_build_page_break between major CHAPTER transitions, not between every section.\n\n## TABLE DATA RULES \u2014 NO EMPTY CELLS\n\n- Every table MUST have ALL cells filled with data. NEVER create tables with empty rows or cells.\n- If a financial table needs 20+ rows but you cannot fill them all, use FEWER rows with complete data.\n- Quality over quantity: 8 fully-populated rows > 20 rows with half empty.\n\n## VERIFICATION\n\nBefore finalizing the plan, check:\n\u2705 Title page included?\n\u2705 TOC included?\n\u2705 At least 3 table sections?\n\u2705 At least 2 list sections?\n\u2705 At least 3 callout boxes?\n\u2705 At least 1 key metrics display?\n\u2705 At least 8 content sections total?\n\u2705 Visual variety: no 3+ consecutive same-type sections?\n\u2705 Conclusion included?\n\u2705 Save path specified?\n\u2705 Language matches user's request?\n\u2705 Each section has enough content density for 1-2 pages?\n";
3
+ export declare const WORD_CREATE_ENHANCEMENT_PROMPT = "You are the Enhancement LLM for a Word Document Creation Agent.\nGenerate rich, professional content for the document.\n\n\u26A0 PAGE COUNT OVERRIDE \u2014 READ THIS FIRST:\nIf the user specifies a page count (e.g., \"1\uD398\uC774\uC9C0\", \"2\uD398\uC774\uC9C0 \uC774\uB0B4\", \"3 pages\"), you MUST limit your output:\n- 1 page: TOTAL_SECTIONS = 2-3 ONLY. NO title page. Short paragraphs (1-2 sentences). 1 small table max.\n- 2 pages: TOTAL_SECTIONS = 3-4 ONLY. NO title page. Moderate content. 1-2 tables max.\n- 3-5 pages: TOTAL_SECTIONS = 5-8. Optional title page.\nThis is NON-NEGOTIABLE. Generating more sections than allowed = FAILURE.\n\n## OUTPUT FORMAT\n\nDOCUMENT_TYPE: [report/proposal/manual/guide/analysis/plan/contract]\nTARGET_AUDIENCE: [executives/team/clients/students/general]\nLANGUAGE: [Korean/English \u2014 match the user's request language]\nTOTAL_SECTIONS: If user specifies page count (e.g., \"1\uD398\uC774\uC9C0\", \"2\uD398\uC774\uC9C0 \uC774\uB0B4\"), scale down: 1page=2-3sections(NO title page/TOC), 2pages=4-6sections, 5pages=8-10sections. Default: [12-20]\n\nDESIGN_SPECIFICATION:\n- COLOR_SCHEME: [choose from: MODERN_TECH, WARM_EXECUTIVE, CLEAN_MINIMAL, CORPORATE, NATURE_FRESH, BOLD_MODERN \u2014 or specify custom hex colors matching the topic]\n- FONTS: [choose matching preset or custom {title, body}]\n- TONE: [formal/academic/executive/casual]\n\nTITLE_PAGE: (SKIP for user-specified 1-2 page documents \u2014 go straight to content)\n- Title: \"...\"\n- Subtitle: \"...\"\n- Date: \"...\"\n- Author: \"...\"\n\nSECTION_PLAN:\nFor each section, provide:\n- Section type: section / table_section / list_section / callout_box / key_metrics\n- Heading: \"...\"\n- Content summary (what should be written \u2014 be specific, not generic)\n- For tables: column names and sample data description (with realistic numbers)\n- For lists: key items to include\n- For callout boxes: style (insight/tip/warning/summary) and key message\n- For key metrics: 3-6 metrics with value and label\n- Sub-sections if applicable\n\nCONCLUSION:\n- Heading: \"...\"\n- Key takeaway message\n\n## RULES\n\n- Match the language of the user's request\n- Provide SPECIFIC, SUBSTANTIVE content \u2014 not generic descriptions\n- Include realistic data for tables (numbers, percentages, dates, currency amounts)\n- Match the color scheme to the document topic and audience\n- Think like a SENIOR CONSULTANT writing a deliverable worth $50,000\n- Plan at least 8 content sections for depth\n- At least 3 table sections (data credibility: financials, comparisons, timelines)\n- At least 2 list sections (action items, features, strategies)\n- At least 3 callout boxes (key insights placed after critical analysis sections)\n- At least 1 key metrics display (executive summary numbers near the beginning)\n- VISUAL VARIETY: Mix section types to avoid monotony. Never 3+ consecutive same-type.\n- Each section should generate 1-2 pages of content\n- Target: 15-25 page professional document\n";
4
4
  //# sourceMappingURL=word-create-prompts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"word-create-prompts.d.ts","sourceRoot":"","sources":["../../../src/agents/office/word-create-prompts.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,yBAAyB,6xWA0IrC,CAAC;AAEF,eAAO,MAAM,2BAA2B,w9JA8FvC,CAAC;AAEF,eAAO,MAAM,8BAA8B,usEAmD1C,CAAC"}
1
+ {"version":3,"file":"word-create-prompts.d.ts","sourceRoot":"","sources":["../../../src/agents/office/word-create-prompts.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,yBAAyB,kxYAqJrC,CAAC;AAEF,eAAO,MAAM,2BAA2B,svKA+FvC,CAAC;AAEF,eAAO,MAAM,8BAA8B,g8FA0D1C,CAAC"}
@@ -35,10 +35,15 @@ Each tool call creates a complete section — you never deal with low-level form
35
35
 
36
36
  ## WORKFLOW
37
37
 
38
+ ⚠ USER PAGE OVERRIDE: If user requests 1-2 pages (e.g., "한페이지로", "1페이지", "2페이지 이내"):
39
+ - SKIP steps 3-4 (no title page, no TOC). Go directly to content sections.
40
+ - Use narrow margins (1.5cm) to maximize content area.
41
+ - Write 2-4 concise sections only. Keep total under user's page limit.
42
+
38
43
  1. \`word_create\` → create blank document
39
44
  2. Page setup: margins, header, footer, page numbers (batch in 1 iteration)
40
- 3. \`word_build_title_page\` → title page
41
- 4. \`word_build_toc\` → table of contents (will auto-populate on save)
45
+ 3. \`word_build_title_page\` → title page (SKIP for 1-2 page requests)
46
+ 4. \`word_build_toc\` → table of contents (SKIP for 1-5 page requests)
42
47
  5. Content sections (in order from your plan):
43
48
  - \`word_build_section\` for text-heavy sections
44
49
  - \`word_build_table_section\` for data/comparison sections
@@ -117,8 +122,14 @@ Do NOT dump all visual elements in the second half. Readers judge quality in the
117
122
  - If creating a financial table (Balance Sheet, Income Statement), fill ALL rows completely.
118
123
  - A table with empty rows is WORSE than no table at all.
119
124
 
120
- ## TARGET: 20-30 PAGES
125
+ ## PAGE TARGET
126
+
127
+ ⚠ USER PAGE OVERRIDE: If the user specifies an exact page count (e.g., "1페이지로", "2페이지 이내", "5페이지"), respect it absolutely. Adjust section count, content density, and structure to fit.
128
+ - "한페이지로 정리해줘" → NO title page, NO TOC, compact content, 1 page max.
129
+ - "2페이지 이내" → Minimal structure, concise content within 2 pages.
130
+ - "5페이지" → Moderate structure with 5-8 sections.
121
131
 
132
+ Default (when user does NOT specify page count): 20-30 PAGES
122
133
  A professional document should be substantive:
123
134
  - **Minimum 15 content sections** (not counting title/TOC/conclusion)
124
135
  - At least 4 table sections (data tables add credibility and visual variety)
@@ -174,7 +185,8 @@ DOCUMENT_PLAN:
174
185
 
175
186
  ## PLAN SIZE TARGET — MANDATORY MINIMUMS (VIOLATION = FAILURE)
176
187
 
177
- - **Minimum 15 content sections** (not counting title/TOC/conclusion). Fewer than 15 = document too thin.
188
+ USER PAGE OVERRIDE: If user specifies exact page count, adjust ALL minimums below proportionally. For "1페이지" → 2-3 sections, no TOC, no title page. For "2페이지" 4-6 sections. For "5페이지" → 8-10 sections.
189
+ - **Default minimum: 15 content sections** (not counting title/TOC/conclusion). Fewer than 15 = document too thin.
178
190
  - **MANDATORY: At least 4 word_build_table_section calls** (data tables add credibility). Fewer than 4 = UNACCEPTABLE.
179
191
  - **MANDATORY: At least 3 word_build_list_section calls** (action items, features, recommendations, key takeaways)
180
192
  - **MANDATORY: At least 4 word_build_callout_box calls** (key insights placed after relevant analysis sections)
@@ -236,19 +248,26 @@ Before finalizing the plan, check:
236
248
  export const WORD_CREATE_ENHANCEMENT_PROMPT = `You are the Enhancement LLM for a Word Document Creation Agent.
237
249
  Generate rich, professional content for the document.
238
250
 
251
+ ⚠ PAGE COUNT OVERRIDE — READ THIS FIRST:
252
+ If the user specifies a page count (e.g., "1페이지", "2페이지 이내", "3 pages"), you MUST limit your output:
253
+ - 1 page: TOTAL_SECTIONS = 2-3 ONLY. NO title page. Short paragraphs (1-2 sentences). 1 small table max.
254
+ - 2 pages: TOTAL_SECTIONS = 3-4 ONLY. NO title page. Moderate content. 1-2 tables max.
255
+ - 3-5 pages: TOTAL_SECTIONS = 5-8. Optional title page.
256
+ This is NON-NEGOTIABLE. Generating more sections than allowed = FAILURE.
257
+
239
258
  ## OUTPUT FORMAT
240
259
 
241
260
  DOCUMENT_TYPE: [report/proposal/manual/guide/analysis/plan/contract]
242
261
  TARGET_AUDIENCE: [executives/team/clients/students/general]
243
262
  LANGUAGE: [Korean/English — match the user's request language]
244
- TOTAL_SECTIONS: [12-20, including tables/callouts/lists/metrics]
263
+ TOTAL_SECTIONS: If user specifies page count (e.g., "1페이지", "2페이지 이내"), scale down: 1page=2-3sections(NO title page/TOC), 2pages=4-6sections, 5pages=8-10sections. Default: [12-20]
245
264
 
246
265
  DESIGN_SPECIFICATION:
247
266
  - COLOR_SCHEME: [choose from: MODERN_TECH, WARM_EXECUTIVE, CLEAN_MINIMAL, CORPORATE, NATURE_FRESH, BOLD_MODERN — or specify custom hex colors matching the topic]
248
267
  - FONTS: [choose matching preset or custom {title, body}]
249
268
  - TONE: [formal/academic/executive/casual]
250
269
 
251
- TITLE_PAGE:
270
+ TITLE_PAGE: (SKIP for user-specified 1-2 page documents — go straight to content)
252
271
  - Title: "..."
253
272
  - Subtitle: "..."
254
273
  - Date: "..."
@@ -1 +1 @@
1
- {"version":3,"file":"word-create-prompts.js","sourceRoot":"","sources":["../../../src/agents/office/word-create-prompts.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0I7D,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8F1C,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmD7C,CAAC"}
1
+ {"version":3,"file":"word-create-prompts.js","sourceRoot":"","sources":["../../../src/agents/office/word-create-prompts.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqJ7D,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+F1C,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0D7C,CAAC"}
@@ -7,7 +7,7 @@ export declare const PROJECTS_DIR: string;
7
7
  export declare const CREDENTIALS_FILE_PATH: string;
8
8
  export declare const APP_NAME = "hanseol-dev";
9
9
  export declare const SERVICE_ID = "hanseol";
10
- export declare const APP_VERSION = "5.3.12-dev.0";
10
+ export declare const APP_VERSION = "5.3.12-dev.2";
11
11
  export declare const DASHBOARD_URL = "https://52.78.246.50.nip.io";
12
12
  export declare const ONCE_URL = "https://52.78.246.50.nip.io:5090";
13
13
  export declare const FREE_URL = "https://52.78.246.50.nip.io:6090";
package/dist/constants.js CHANGED
@@ -9,7 +9,7 @@ export const PROJECTS_DIR = path.join(LOCAL_HOME_DIR, 'projects');
9
9
  export const CREDENTIALS_FILE_PATH = path.join(LOCAL_HOME_DIR, 'credentials.json');
10
10
  export const APP_NAME = 'hanseol-dev';
11
11
  export const SERVICE_ID = 'hanseol';
12
- export const APP_VERSION = '5.3.12-dev.0';
12
+ export const APP_VERSION = '5.3.12-dev.2';
13
13
  export const DASHBOARD_URL = 'https://52.78.246.50.nip.io';
14
14
  export const ONCE_URL = 'https://52.78.246.50.nip.io:5090';
15
15
  export const FREE_URL = 'https://52.78.246.50.nip.io:6090';
@@ -42,6 +42,7 @@ export interface SessionSummary {
42
42
  model: string;
43
43
  firstMessage?: string;
44
44
  }
45
+ export declare function reconstructLogEntries(messages: Message[]): SessionLogEntry[];
45
46
  export declare class SessionManager {
46
47
  private currentSessionId;
47
48
  private currentSessionCreatedAt;
@@ -1 +1 @@
1
- {"version":3,"file":"session-manager.d.ts","sourceRoot":"","sources":["../../../src/core/session/session-manager.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAU/C,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAKD,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AA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AOtC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAG1C;AAKD,eAAO,MAAM,cAAc,gBAAuB,CAAC"}
@@ -5,6 +5,57 @@ import { PROJECTS_DIR } from '../../constants.js';
5
5
  import { initializeJsonStreamLogger } from '../../utils/json-stream-logger.js';
6
6
  import { logger } from '../../utils/logger.js';
7
7
  import { reportError } from '../telemetry/error-reporter.js';
8
+ export function reconstructLogEntries(messages) {
9
+ const entries = [];
10
+ let idx = 0;
11
+ for (const msg of messages) {
12
+ if (msg.role === 'user') {
13
+ entries.push({
14
+ id: `log-r-${idx++}`,
15
+ type: 'user_input',
16
+ content: typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content),
17
+ });
18
+ }
19
+ else if (msg.role === 'assistant') {
20
+ if (msg.tool_calls && msg.tool_calls.length > 0) {
21
+ for (const tc of msg.tool_calls) {
22
+ let args = {};
23
+ try {
24
+ args = JSON.parse(tc.function.arguments);
25
+ }
26
+ catch { }
27
+ entries.push({
28
+ id: `log-r-${idx++}`,
29
+ type: 'tool_start',
30
+ content: tc.function.name,
31
+ toolArgs: args,
32
+ });
33
+ }
34
+ }
35
+ else if (msg.content) {
36
+ const content = typeof msg.content === 'string' ? msg.content : JSON.stringify(msg.content);
37
+ if (!content.startsWith('📋 Created ')) {
38
+ entries.push({
39
+ id: `log-r-${idx++}`,
40
+ type: 'agent_response',
41
+ content,
42
+ });
43
+ }
44
+ }
45
+ }
46
+ else if (msg.role === 'tool') {
47
+ const resultContent = typeof msg.content === 'string' ? msg.content : '';
48
+ entries.push({
49
+ id: `log-r-${idx++}`,
50
+ type: 'tool_result',
51
+ content: msg.name || 'tool',
52
+ details: resultContent.length > 500 ? resultContent.substring(0, 500) + '...' : resultContent,
53
+ success: !resultContent.startsWith('[interrupted'),
54
+ });
55
+ }
56
+ }
57
+ return entries;
58
+ }
8
59
  const ERROR_MESSAGE_PATTERNS = [
9
60
  /^\[ABORTED BY USER\]$/,
10
61
  /^LLM 서버가 응답하지 않습니다/,