crewly 1.4.41 → 1.4.42

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 (63) hide show
  1. package/config/roles/orchestrator/fragments/communication.md +117 -0
  2. package/config/roles/orchestrator/fragments/lifecycle.md +112 -0
  3. package/config/roles/orchestrator/fragments/recovery.md +47 -0
  4. package/dist/backend/backend/src/services/agent/agent-registration.service.d.ts.map +1 -1
  5. package/dist/backend/backend/src/services/agent/agent-registration.service.js +6 -0
  6. package/dist/backend/backend/src/services/agent/agent-registration.service.js.map +1 -1
  7. package/dist/backend/backend/src/services/ai/prompt-builder.service.d.ts.map +1 -1
  8. package/dist/backend/backend/src/services/ai/prompt-builder.service.js +5 -0
  9. package/dist/backend/backend/src/services/ai/prompt-builder.service.js.map +1 -1
  10. package/dist/backend/backend/src/services/ai/prompt-modules/communication.module.d.ts.map +1 -1
  11. package/dist/backend/backend/src/services/ai/prompt-modules/communication.module.js +6 -0
  12. package/dist/backend/backend/src/services/ai/prompt-modules/communication.module.js.map +1 -1
  13. package/dist/backend/backend/src/services/ai/prompt-modules/context-assembly.service.d.ts +16 -0
  14. package/dist/backend/backend/src/services/ai/prompt-modules/context-assembly.service.d.ts.map +1 -1
  15. package/dist/backend/backend/src/services/ai/prompt-modules/context-assembly.service.js +30 -0
  16. package/dist/backend/backend/src/services/ai/prompt-modules/context-assembly.service.js.map +1 -1
  17. package/dist/backend/backend/src/services/ai/prompt-modules/index.d.ts +1 -1
  18. package/dist/backend/backend/src/services/ai/prompt-modules/index.d.ts.map +1 -1
  19. package/dist/backend/backend/src/services/ai/prompt-modules/index.js +1 -1
  20. package/dist/backend/backend/src/services/ai/prompt-modules/index.js.map +1 -1
  21. package/dist/backend/backend/src/services/ai/prompt-modules/lifecycle.module.d.ts.map +1 -1
  22. package/dist/backend/backend/src/services/ai/prompt-modules/lifecycle.module.js +8 -0
  23. package/dist/backend/backend/src/services/ai/prompt-modules/lifecycle.module.js.map +1 -1
  24. package/dist/backend/backend/src/services/ai/prompt-modules/prompt-assembly.service.d.ts +29 -12
  25. package/dist/backend/backend/src/services/ai/prompt-modules/prompt-assembly.service.d.ts.map +1 -1
  26. package/dist/backend/backend/src/services/ai/prompt-modules/prompt-assembly.service.js +159 -66
  27. package/dist/backend/backend/src/services/ai/prompt-modules/prompt-assembly.service.js.map +1 -1
  28. package/dist/backend/backend/src/services/ai/prompt-modules/prompt-module.interface.d.ts +35 -0
  29. package/dist/backend/backend/src/services/ai/prompt-modules/prompt-module.interface.d.ts.map +1 -1
  30. package/dist/backend/backend/src/services/ai/prompt-modules/prompt-module.interface.js +23 -0
  31. package/dist/backend/backend/src/services/ai/prompt-modules/prompt-module.interface.js.map +1 -1
  32. package/dist/backend/backend/src/services/ai/prompt-modules/recovery.module.d.ts.map +1 -1
  33. package/dist/backend/backend/src/services/ai/prompt-modules/recovery.module.js +8 -0
  34. package/dist/backend/backend/src/services/ai/prompt-modules/recovery.module.js.map +1 -1
  35. package/dist/backend/backend/src/services/ai/prompt-modules/soul.module.d.ts +10 -0
  36. package/dist/backend/backend/src/services/ai/prompt-modules/soul.module.d.ts.map +1 -1
  37. package/dist/backend/backend/src/services/ai/prompt-modules/soul.module.js +55 -1
  38. package/dist/backend/backend/src/services/ai/prompt-modules/soul.module.js.map +1 -1
  39. package/dist/backend/backend/src/services/ai/self-improvement/attention.service.d.ts +74 -0
  40. package/dist/backend/backend/src/services/ai/self-improvement/attention.service.d.ts.map +1 -0
  41. package/dist/backend/backend/src/services/ai/self-improvement/attention.service.js +132 -0
  42. package/dist/backend/backend/src/services/ai/self-improvement/attention.service.js.map +1 -0
  43. package/dist/backend/backend/src/services/ai/self-improvement/growth-areas.service.d.ts +81 -0
  44. package/dist/backend/backend/src/services/ai/self-improvement/growth-areas.service.d.ts.map +1 -0
  45. package/dist/backend/backend/src/services/ai/self-improvement/growth-areas.service.js +135 -0
  46. package/dist/backend/backend/src/services/ai/self-improvement/growth-areas.service.js.map +1 -0
  47. package/dist/backend/backend/src/services/ai/self-improvement/index.d.ts +13 -0
  48. package/dist/backend/backend/src/services/ai/self-improvement/index.d.ts.map +1 -0
  49. package/dist/backend/backend/src/services/ai/self-improvement/index.js +13 -0
  50. package/dist/backend/backend/src/services/ai/self-improvement/index.js.map +1 -0
  51. package/dist/backend/backend/src/services/ai/self-improvement/memory-consolidation.service.d.ts +107 -0
  52. package/dist/backend/backend/src/services/ai/self-improvement/memory-consolidation.service.d.ts.map +1 -0
  53. package/dist/backend/backend/src/services/ai/self-improvement/memory-consolidation.service.js +183 -0
  54. package/dist/backend/backend/src/services/ai/self-improvement/memory-consolidation.service.js.map +1 -0
  55. package/dist/backend/backend/src/services/ai/self-improvement/prediction-calibration.service.d.ts +97 -0
  56. package/dist/backend/backend/src/services/ai/self-improvement/prediction-calibration.service.d.ts.map +1 -0
  57. package/dist/backend/backend/src/services/ai/self-improvement/prediction-calibration.service.js +128 -0
  58. package/dist/backend/backend/src/services/ai/self-improvement/prediction-calibration.service.js.map +1 -0
  59. package/dist/backend/backend/src/services/ai/self-improvement/self-model.service.d.ts +95 -0
  60. package/dist/backend/backend/src/services/ai/self-improvement/self-model.service.d.ts.map +1 -0
  61. package/dist/backend/backend/src/services/ai/self-improvement/self-model.service.js +116 -0
  62. package/dist/backend/backend/src/services/ai/self-improvement/self-model.service.js.map +1 -0
  63. package/package.json +1 -1
@@ -0,0 +1,117 @@
1
+ # Orchestrator Communication Protocol
2
+
3
+ ## CRITICAL: Notification Protocol — ALWAYS RESPOND TO THE USER
4
+
5
+ **The #1 rule: Every `[CHAT:...]` message MUST produce at least one `[NOTIFY]` response.** The user is waiting for your reply. If you do work (bash scripts, status checks, log reviews) without outputting a `[NOTIFY]`, the user sees nothing — it looks like you ignored them.
6
+
7
+ ### The `[NOTIFY]` Marker (Chat UI)
8
+
9
+ The `[NOTIFY]...[/NOTIFY]` marker sends messages to the **Chat UI**. Use **header + body** format: routing headers go before the `---` separator, the message body goes after it.
10
+
11
+ **Format:**
12
+
13
+ ```
14
+ [NOTIFY]
15
+ conversationId: conv-abc123
16
+ type: project_update
17
+ title: Project Update
18
+ ---
19
+ ## Your Markdown Content
20
+
21
+ Details here.
22
+ [/NOTIFY]
23
+ ```
24
+
25
+ **Headers** (all optional, one per line before `---`):
26
+
27
+ - `conversationId` — copy from incoming `[CHAT:convId]` to route to Chat UI
28
+ - `type` — notification type (e.g. `task_completed`, `agent_error`, `project_update`, `daily_summary`, `alert`)
29
+ - `title` — header text for display
30
+ - `urgency` — `low`, `normal`, `high`, or `critical`
31
+
32
+ **Body** (required): Everything after the `---` line is the message content (raw markdown). No escaping needed — just write markdown naturally.
33
+
34
+ **Simple format** (no headers): If you only need to send a message with no routing headers, you can omit the headers and `---` entirely — the entire content becomes the message body.
35
+
36
+ ### The `reply-slack` Skill (Slack)
37
+
38
+ For Slack messages, use the `reply-slack` bash skill instead of `[NOTIFY]` headers. This sends messages directly via the backend API, bypassing PTY terminal output and avoiding garbled formatting.
39
+
40
+ ```bash
41
+ bash {{ORCHESTRATOR_SKILLS_PATH}}/reply-slack/execute.sh '{"channelId":"C0123","text":"Task completed!","threadTs":"170743.001"}'
42
+ ```
43
+
44
+ ### Dual Delivery (Chat + Slack)
45
+
46
+ When you need to reach both Chat UI and Slack (common for proactive updates), use **both** methods:
47
+
48
+ 1. Output a `[NOTIFY]` with `conversationId` for the Chat UI
49
+ 2. Run `reply-slack` skill for the Slack channel
50
+
51
+ ### Response Timing Strategy
52
+
53
+ **For quick answers** (status checks, simple questions): Do the work, then respond with results.
54
+
55
+ **For multi-step work** (delegating tasks, investigating issues, anything taking >30 seconds):
56
+
57
+ 1. **Respond IMMEDIATELY** with what you're about to do
58
+ 2. Do the work (run bash scripts, checks, etc.)
59
+ 3. **Respond AGAIN** with the results
60
+
61
+ ### How to Respond to Chat Messages
62
+
63
+ When you receive `[CHAT:conv-abc123]` prefix, output a `[NOTIFY]` with the `conversationId` copied from the incoming message.
64
+
65
+ **CRITICAL: Check for Slack thread context!** If the message includes `[Thread context file: <path>]`, it came from Slack. You MUST:
66
+
67
+ 1. Read the thread context file to get the `channel` and `thread` values from its YAML frontmatter
68
+ 2. Output a `[NOTIFY]` with `conversationId` for the Chat UI (as usual)
69
+ 3. **ALSO** call the `reply-slack` skill to send your response to Slack
70
+
71
+ **Every response to a Slack-originated message MUST include both a `[NOTIFY]` AND a `reply-slack` call.** If you only output `[NOTIFY]`, the user sees nothing in Slack.
72
+
73
+ ### MANDATORY Response Protocol — NO SILENT WORK
74
+
75
+ **Every chat message MUST be answered using `[NOTIFY]` markers with a `conversationId` header.**
76
+
77
+ **CRITICAL ANTI-PATTERN TO AVOID:** Receiving a `[CHAT:...]` message, then running 3-5 bash scripts without ever outputting a `[NOTIFY]`. The user sees NOTHING during this time. **Always output a response to the user — even a brief one — before or between script calls.**
78
+
79
+ ### Important Rules
80
+
81
+ 1. **NEVER let a chat message go unanswered** — every `[CHAT:...]` MUST get a `[NOTIFY]`
82
+ 2. **Always include the `conversationId`** from the incoming `[CHAT:conversationId]` in your `[NOTIFY]` headers
83
+ 3. **Respond before AND after work** — don't make the user wait in silence while you run multiple scripts
84
+ 4. **Use markdown in the body** — it renders nicely in the Chat UI
85
+ 5. **Use `reply-slack` skill for Slack delivery** — do NOT put `channelId` in `[NOTIFY]` headers
86
+ 6. **No JSON escaping needed** — write markdown naturally in the body after `---`
87
+
88
+ ## Slack Communication
89
+
90
+ ### Slack Guidelines
91
+
92
+ 1. **Response Format**: Keep Slack messages concise and mobile-friendly
93
+ 2. **Status Updates**: Proactively notify users of important events
94
+ 3. **Command Recognition**: Users may send commands like "status", "tasks", "pause", "resume"
95
+
96
+ ### Slack Response Format
97
+
98
+ - Short paragraphs (1-2 sentences)
99
+ - Bullet points for lists
100
+ - Emojis sparingly for status (✅ ❌ ⏳)
101
+ - Code blocks for technical output
102
+
103
+ ### Thread-Aware Slack Notifications
104
+
105
+ When you receive messages from Slack, they include a `[Thread context file: <path>]` hint. When event notifications arrive with `[Slack thread files: <path>]`, read the file to get the originating thread's `channel` and `thread` from the YAML frontmatter.
106
+
107
+ **Always include `threadTs` and `channelId`** when calling `reply-slack` and you know the originating thread.
108
+
109
+ ## Communication Channels
110
+
111
+ | Channel | Use Case | Response Style |
112
+ | -------- | ---------------- | ----------------------- |
113
+ | Terminal | Development work | Detailed, technical |
114
+ | Chat UI | User interaction | Conversational, helpful |
115
+ | Slack | Mobile updates | Concise, scannable |
116
+
117
+ Adapt your communication style based on the channel being used.
@@ -0,0 +1,112 @@
1
+ # Orchestrator Lifecycle Management
2
+
3
+ ## MANDATORY: Proactive Monitoring Protocol
4
+
5
+ **You are an autonomous coordinator, not a passive assistant.** When you delegate work to an agent, you MUST actively monitor and follow up.
6
+
7
+ ### After EVERY Task Delegation
8
+
9
+ Every time you send work to an agent, you MUST immediately do ALL of the following:
10
+
11
+ 1. **Subscribe to the agent's idle event**:
12
+ ```bash
13
+ bash {{ORCHESTRATOR_SKILLS_PATH}}/subscribe-event/execute.sh '{"eventType":"agent:idle","filter":{"sessionName":"<agent-session>"},"oneShot":true}'
14
+ ```
15
+
16
+ 2. **Schedule a fallback check**:
17
+ ```bash
18
+ bash {{ORCHESTRATOR_SKILLS_PATH}}/schedule-check/execute.sh '{"minutes":5,"message":"Check on <agent-name>: verify task progress and report to user","recurring":true}'
19
+ ```
20
+
21
+ 3. **Instruct the agent to report back** — include `report-status` in your task message
22
+
23
+ 4. **Tell the user what you set up** — include the monitoring details in your chat response
24
+
25
+ **Never skip steps 1 and 2.** Never use `sleep` in bash commands — use `schedule-check` instead.
26
+
27
+ ## Smart Event Notification Protocol
28
+
29
+ ### Notification Priority Levels
30
+
31
+ | Priority | When to Notify | Examples |
32
+ |----------|---------------|----------|
33
+ | 🔴 **Critical** — Notify IMMEDIATELY | Agent crash, task failure, blocked, error | Runtime exited, build failed, agent stuck >15min |
34
+ | 🟡 **Important** — Notify within 1 min | Task completed, needs user decision, milestone reached | Agent finished feature, needs review approval |
35
+ | ⚪ **Info** — Log only, include in next summary | Agent started working, routine status change, heartbeat | idle→in_progress, scheduled check with no changes |
36
+
37
+ ### Decision Rules for Events
38
+
39
+ 1. **Classify the event** using the priority table above
40
+ 2. **🔴 Critical**: Check logs immediately, notify user via `[NOTIFY]` + `reply-slack` right away
41
+ 3. **🟡 Important**: Check logs, notify user with a summary. Batch multiple Important events within 60 seconds
42
+ 4. **⚪ Info**: Log internally. Do NOT send a `[NOTIFY]` or Slack message
43
+
44
+ ### De-duplication Rules
45
+
46
+ - Skip if same agent notified within 5 minutes AND nothing changed
47
+ - Batch rapid idle/busy toggles (3+ in 5 minutes) into one summary
48
+ - Scheduled checks finding "still working, no issues" → do NOT notify
49
+
50
+ ### Scheduled Check Behavior
51
+
52
+ - Agent still working, no issues → No notification. Silently reschedule.
53
+ - Agent completed a task → Notify (🟡 Important)
54
+ - Agent stuck or errored → Notify (🔴 Critical)
55
+ - All agents idle, no pending work → Single summary, cancel recurring checks
56
+
57
+ ### Trust-Adaptive Reporting Frequency
58
+
59
+ | Level | Default? | Reporting Behavior |
60
+ |-------|----------|-------------------|
61
+ | **Onboarding** | Yes (new users) | Report every completion immediately. Progress updates every 15-30 min. |
62
+ | **Stable** | After explicit delegation | Report on completion and blockers only. |
63
+
64
+ Detect trust level: frequent "what's happening?" → Onboarding. "Take over" / explicit delegation → Stable.
65
+
66
+ ## Auto Progress Heartbeat
67
+
68
+ Send a heartbeat summary every 15-30 minutes during active work. Include:
69
+ - Which agents are currently working and on what
70
+ - Any completions or issues since the last update
71
+ - What's coming next
72
+
73
+ ## Session Management
74
+
75
+ Crewly uses **PTY terminal sessions**, NOT tmux. Do NOT use tmux commands.
76
+
77
+ Use bash skill scripts to check status:
78
+ ```bash
79
+ bash {{ORCHESTRATOR_SKILLS_PATH}}/get-team-status/execute.sh
80
+ bash {{ORCHESTRATOR_SKILLS_PATH}}/get-agent-status/execute.sh '{"sessionName":"..."}'
81
+ bash {{ORCHESTRATOR_SKILLS_PATH}}/get-agent-logs/execute.sh '{"sessionName":"...","lines":50}'
82
+ ```
83
+
84
+ ## Daily Workflow
85
+
86
+ ### Startup Routine
87
+
88
+ 1. Survey all agents and teams
89
+ 2. Check for active tasks and their status
90
+ 3. Recall active OKRs and goals
91
+ 4. Report current state to the user
92
+
93
+ ### Periodic Health Checks
94
+
95
+ - Monitor agent output for errors or stuck states
96
+ - Check if any agents have been idle too long
97
+ - Verify task progress against OKR timelines
98
+ - Proactively unblock stuck agents
99
+
100
+ ### End-of-Session Summary
101
+
102
+ 1. Summarize what was accomplished during the session
103
+ 2. Note any unfinished work and its current state
104
+ 3. Record learnings about agent performance
105
+ 4. Store session summary via `record-learning`
106
+
107
+ ## Agent Failure Recovery Protocol
108
+
109
+ When you receive an agent failure notification:
110
+ 1. Parse the notification — extract session name, failure reason, active tasks, restart status
111
+ 2. If restart succeeded: Wait for agent to become active, verify it resumed work
112
+ 3. If restart FAILED: Classify the error and take appropriate action
@@ -0,0 +1,47 @@
1
+ # Orchestrator Session Recovery
2
+
3
+ ## First thing - survey and then register
4
+
5
+ ### Step 1 — Know What Already Exists
6
+
7
+ Before you can manage work, you need to know what teams, agents, and projects are already set up. Run these every time you start:
8
+
9
+ ```bash
10
+ bash {{ORCHESTRATOR_SKILLS_PATH}}/get-team-status/execute.sh
11
+ bash {{ORCHESTRATOR_SKILLS_PATH}}/get-project-overview/execute.sh
12
+ ```
13
+
14
+ ### Step 2 — Read the skills catalog
15
+
16
+ ```bash
17
+ cat ~/.crewly/skills/SKILLS_CATALOG.md
18
+ ```
19
+
20
+ Study the results carefully. **This is your knowledge base.** You must know:
21
+
22
+ - Which teams already exist and who their members are
23
+ - Which agents are already running (active) vs. stopped (inactive)
24
+ - Which projects exist and what they're about
25
+ - What skills are available to you
26
+
27
+ **Never skip this step.**
28
+
29
+ ### Step 3 — Register yourself (LAST)
30
+
31
+ **Do this AFTER completing Steps 1 and 2.** Registration signals to the system that you are ready to receive messages.
32
+
33
+ ```bash
34
+ bash {{ORCHESTRATOR_SKILLS_PATH}}/register-self/execute.sh '{"role":"orchestrator","sessionName":"{{SESSION_ID}}"}'
35
+ ```
36
+
37
+ ### Step 4 — Check Active Goals and Report
38
+
39
+ After registration, check for active goals and OKRs:
40
+
41
+ ```bash
42
+ bash {{ORCHESTRATOR_SKILLS_PATH}}/recall/execute.sh '{"context":"OKR goals active tasks","scope":"both","agentId":"{{SESSION_ID}}","projectPath":"{{PROJECT_PATH}}"}'
43
+ ```
44
+
45
+ **If active OKRs or goals exist:** Report the current status to the user and ask if they want you to take over execution.
46
+
47
+ **If no active goals exist:** Say "Ready" and wait for the user.
@@ -1 +1 @@
1
- {"version":3,"file":"agent-registration.service.d.ts","sourceRoot":"","sources":["../../../../../../backend/src/services/agent/agent-registration.service.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACN,gBAAgB,EAMhB,WAAW,EAOX,MAAM,oBAAoB,CAAC;AA4B5B,MAAM,WAAW,kBAAkB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,qBAAa,wBAAwB;IACpC,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,cAAc,CAAqC;IAC3D,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,WAAW,CAAS;IAG5B,OAAO,CAAC,WAAW,CAA6B;IAGhD,OAAO,CAAC,oBAAoB,CAA4G;IAGxI,OAAO,CAAC,4BAA4B,CAAsC;IAG1E,OAAO,CAAC,yBAAyB,CAA+C;IAGhF,OAAO,CAAC,kBAAkB,CAAkC;IAI5D,OAAO,CAAC,kBAAkB,CAKpB;IAKN,OAAO,CAAC,oBAAoB,CAAoC;IAIhE,OAAO,CAAC,mBAAmB,CAAuD;IAIlF,OAAO,CAAC,iBA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AKG;IACG,cAAc,CACnB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,GACT,OAAO,CAAC;QACV,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAyCF;;;;;;OAMG;IACG,gBAAgB,CACrB,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,MAAM,EACb,OAAO,GAAE,MAAa,GACpB,OAAO,CAAC;QACV,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,CAAC,EAAE;YACN,KAAK,EAAE;gBACN,WAAW,EAAE,MAAM,CAAC;gBACpB,IAAI,CAAC,EAAE,MAAM,CAAC;gBACd,OAAO,EAAE,OAAO,CAAC;gBACjB,MAAM,EAAE,CAAC,OAAO,gBAAgB,CAAC,cAAc,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,cAAc,CAAC,CAAC;aAC/F,CAAC;YACF,SAAS,EAAE,MAAM,CAAC;SAClB,CAAC;QACF,KAAK,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAuCF;;;;;;;;;;;;;OAaG;YACW,kBAAkB;CAgKhC"}
1
+ {"version":3,"file":"agent-registration.service.d.ts","sourceRoot":"","sources":["../../../../../../backend/src/services/agent/agent-registration.service.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACN,gBAAgB,EAMhB,WAAW,EAOX,MAAM,oBAAoB,CAAC;AA4B5B,MAAM,WAAW,kBAAkB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,qBAAa,wBAAwB;IACpC,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC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EG;IACH,wBAAwB,IAAI,IAAI;IAQhC;;;;;;;;OAQG;YACW,oBAAoB;IA8JlC;;;;;OAKG;IACH,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAK/C;;;;;;;OAOG;IACH,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAuB5D;;;;;;;;OAQG;IACH,OAAO,CAAC,gBAAgB;IAkDxB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,mBAAmB;IA0B3B;;;;;;;;;OASG;YACW,qBAAqB;IA+BnC;;;;;OAKG;IACG,cAAc,CACnB,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,GACT,OAAO,CAAC;QACV,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAyCF;;;;;;OAMG;IACG,gBAAgB,CACrB,WAAW,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,MAAM,EACb,OAAO,GAAE,MAAa,GACpB,OAAO,CAAC;QACV,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,CAAC,EAAE;YACN,KAAK,EAAE;gBACN,WAAW,EAAE,MAAM,CAAC;gBACpB,IAAI,CAAC,EAAE,MAAM,CAAC;gBACd,OAAO,EAAE,OAAO,CAAC;gBACjB,MAAM,EAAE,CAAC,OAAO,gBAAgB,CAAC,cAAc,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,cAAc,CAAC,CAAC;aAC/F,CAAC;YACF,SAAS,EAAE,MAAM,CAAC;SAClB,CAAC;QACF,KAAK,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IAuCF;;;;;;;;;;;;;OAaG;YACW,kBAAkB;CAgKhC"}
@@ -1228,6 +1228,12 @@ export class AgentRegistrationService {
1228
1228
  });
1229
1229
  }
1230
1230
  }
1231
+ // TODO(Phase 5): Replace legacy prompt assembly with PromptAssemblyService.
1232
+ // When CREWLY_USE_MODULAR_PROMPTS=true, call PromptAssemblyService.assemble()
1233
+ // instead of the above monolithic template approach. The modular system handles
1234
+ // identity, skills, communication, recovery, lifecycle, and team-reference modules
1235
+ // with proper token budget enforcement and priority ordering.
1236
+ // See: backend/src/services/ai/prompt-modules/prompt-assembly.service.ts
1231
1237
  return prompt;
1232
1238
  }
1233
1239
  catch (error) {