@hailer/mcp 1.3.21 → 1.3.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/create-and-publish-app/SKILL.md +44 -56
- package/.claude/skills/hailer-app-builder/SKILL.md +414 -970
- package/.claude/skills/hailer-app-primitives/SKILL.md +742 -0
- package/.claude/skills/hailer-apps-pictures/SKILL.md +191 -87
- package/.claude/skills/hailer-design-patterns/SKILL.md +317 -0
- package/.claude/skills/hailer-design-system/SKILL.md +202 -149
- package/.claude/skills/hailer-docs-search/SKILL.md +75 -0
- package/.claude/skills/hailer-workflow-archetypes/SKILL.md +301 -0
- package/.claude/skills/insight-join-patterns/SKILL.md +313 -0
- package/.claude/skills/publish-hailer-app/SKILL.md +211 -0
- package/.claude/skills/sdk-activity-patterns/SKILL.md +257 -105
- package/.claude/skills/sdk-function-fields/SKILL.md +253 -492
- package/.claude/skills/sdk-insight-calculations/SKILL.md +364 -0
- package/.claude/skills/sdk-insight-queries/SKILL.md +192 -397
- package/.claude/skills/sdk-ws-config-skill/SKILL.md +265 -720
- package/.claude/skills/tool-response-verification/SKILL.md +143 -0
- package/CLAUDE.md +45 -19
- package/dist/bot/bot.d.ts.map +1 -1
- package/dist/bot/bot.js +21 -1
- package/dist/bot/bot.js.map +1 -1
- package/dist/bot/services/helper-prompt.d.ts +1 -1
- package/dist/bot/services/helper-prompt.d.ts.map +1 -1
- package/dist/bot/services/helper-prompt.js +4 -6
- package/dist/bot/services/helper-prompt.js.map +1 -1
- package/dist/bot/services/message-formatter.d.ts.map +1 -1
- package/dist/bot/services/message-formatter.js +2 -1
- package/dist/bot/services/message-formatter.js.map +1 -1
- package/dist/bot/services/system-prompt.d.ts.map +1 -1
- package/dist/bot/services/system-prompt.js +21 -34
- package/dist/bot/services/system-prompt.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +6 -0
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -0
- package/dist/config.js.map +1 -1
- package/dist/lib/object-id.d.ts +9 -0
- package/dist/lib/object-id.d.ts.map +1 -0
- package/dist/lib/object-id.js +15 -0
- package/dist/lib/object-id.js.map +1 -0
- package/dist/mcp/hailer-rpc.d.ts +3 -0
- package/dist/mcp/hailer-rpc.d.ts.map +1 -1
- package/dist/mcp/hailer-rpc.js +7 -0
- package/dist/mcp/hailer-rpc.js.map +1 -1
- package/dist/mcp/tool-profiles.d.ts +1 -0
- package/dist/mcp/tool-profiles.d.ts.map +1 -1
- package/dist/mcp/tool-profiles.js +21 -4
- package/dist/mcp/tool-profiles.js.map +1 -1
- package/dist/mcp/tools/aliases.d.ts.map +1 -1
- package/dist/mcp/tools/aliases.js +14 -6
- package/dist/mcp/tools/aliases.js.map +1 -1
- package/dist/mcp/tools/app-core.d.ts.map +1 -1
- package/dist/mcp/tools/app-core.js +6 -3
- package/dist/mcp/tools/app-core.js.map +1 -1
- package/dist/mcp/tools/app-marketplace.d.ts.map +1 -1
- package/dist/mcp/tools/app-marketplace.js +7 -2
- package/dist/mcp/tools/app-marketplace.js.map +1 -1
- package/dist/mcp/tools/docs.d.ts +20 -0
- package/dist/mcp/tools/docs.d.ts.map +1 -0
- package/dist/mcp/tools/docs.js +87 -0
- package/dist/mcp/tools/docs.js.map +1 -0
- package/dist/mcp/tools/function-fields.d.ts +17 -0
- package/dist/mcp/tools/function-fields.d.ts.map +1 -0
- package/dist/mcp/tools/function-fields.js +717 -0
- package/dist/mcp/tools/function-fields.js.map +1 -0
- package/dist/mcp/tools/index.d.ts.map +1 -1
- package/dist/mcp/tools/index.js +4 -0
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/workflow.d.ts +0 -1
- package/dist/mcp/tools/workflow.d.ts.map +1 -1
- package/dist/mcp/tools/workflow.js +1 -190
- package/dist/mcp/tools/workflow.js.map +1 -1
- package/dist/public-chat/graduate.d.ts +5 -4
- package/dist/public-chat/graduate.d.ts.map +1 -1
- package/dist/public-chat/graduate.js +226 -76
- package/dist/public-chat/graduate.js.map +1 -1
- package/dist/public-chat/handler.d.ts.map +1 -1
- package/dist/public-chat/handler.js +10 -2
- package/dist/public-chat/handler.js.map +1 -1
- package/dist/public-chat/index.d.ts.map +1 -1
- package/dist/public-chat/index.js +12 -1
- package/dist/public-chat/index.js.map +1 -1
- package/dist/public-chat/session-store.d.ts +22 -1
- package/dist/public-chat/session-store.d.ts.map +1 -1
- package/dist/public-chat/session-store.js +56 -2
- package/dist/public-chat/session-store.js.map +1 -1
- package/dist/public-chat/studio-prewarm.js +1 -1
- package/dist/public-chat/studio-prewarm.js.map +1 -1
- package/dist/public-chat/system-prompt.d.ts +1 -1
- package/dist/public-chat/system-prompt.d.ts.map +1 -1
- package/dist/public-chat/system-prompt.js +161 -83
- package/dist/public-chat/system-prompt.js.map +1 -1
- package/package.json +1 -1
- package/.claude/skills/hailer-project-protocol/SKILL.md +0 -398
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tool-response-verification
|
|
3
|
+
description: Verify MCP tool execution results before reporting success. Load when creating activities, updating activities, listing activities, or any MCP tool call where a silent failure could cause incorrect reporting. Covers the two distinct response envelopes (MCP wire result vs agent delegation report), create vs update response shapes, error asymmetry, empty-list shape, and MCP connection error detection.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Tool Response Verification
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Ensure agents verify actual tool execution results before reporting success. Prevents fabricated responses when MCP servers are disconnected or tools fail silently.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Pattern 1: Always Check Tool Results
|
|
15
|
+
|
|
16
|
+
Every MCP tool call returns a result. Read it before proceeding.
|
|
17
|
+
|
|
18
|
+
## Pattern 2: Never Assume Success
|
|
19
|
+
|
|
20
|
+
If you didn't see confirmation in the result, it didn't happen.
|
|
21
|
+
|
|
22
|
+
## Pattern 3: Report Actual Errors
|
|
23
|
+
|
|
24
|
+
If a tool returned an error, report error status — don't fabricate success.
|
|
25
|
+
|
|
26
|
+
## Pattern 4: No Fabrication
|
|
27
|
+
|
|
28
|
+
Never claim "created 5 activities" if you didn't see 5 activity IDs returned.
|
|
29
|
+
|
|
30
|
+
## Pattern 5: Verification Checklist
|
|
31
|
+
|
|
32
|
+
Before returning success:
|
|
33
|
+
- Did the tool return a result (not an error)?
|
|
34
|
+
- Does the result contain expected data (IDs, counts, etc.)?
|
|
35
|
+
- Am I reporting data FROM the result, not data I expected?
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Pattern 6: Two Distinct Envelopes — Don't Confuse Them
|
|
40
|
+
|
|
41
|
+
**MCP tool wire result** — what the tool actually returns:
|
|
42
|
+
```
|
|
43
|
+
{ content: [{ type: "text", text: "..." }], isError?: boolean }
|
|
44
|
+
```
|
|
45
|
+
Success and error both arrive as `text` content. Errors are signalled by a ❌ prefix in the text (e.g. `"❌ Activity not found"`), not by a structured status field. Activity/discussion tools do not set `isError: true` — read the text to determine outcome.
|
|
46
|
+
|
|
47
|
+
**Agent delegation report** — what the agent returns to the orchestrator after verifying the tool result:
|
|
48
|
+
```json
|
|
49
|
+
{ "status": "success|error", "result": { ... }, "summary": "..." }
|
|
50
|
+
```
|
|
51
|
+
This `{status, result, summary}` shape is the agent's own output. It is NOT the MCP tool return value.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Pattern 7: Runtime-Verified Wire Shapes for Activity Tools
|
|
56
|
+
|
|
57
|
+
The following shapes are runtime-verified against testspace 2026-06-07.
|
|
58
|
+
|
|
59
|
+
### Success — create_activity (single and bulk)
|
|
60
|
+
|
|
61
|
+
Both single and bulk creates emit a fenced JSON block:
|
|
62
|
+
```json
|
|
63
|
+
{"created_ids":["<24-hex-id>", ...]}
|
|
64
|
+
```
|
|
65
|
+
Single create also includes a `discussionId` field alongside `created_ids`. There is NO prose-only success path for create — if you don't see `created_ids`, the create did not succeed.
|
|
66
|
+
|
|
67
|
+
### Success — update_activity (single and bulk)
|
|
68
|
+
|
|
69
|
+
Update success is **prose only** — there is NO `created_ids` on update responses.
|
|
70
|
+
|
|
71
|
+
- Single: `✅ Successfully updated activity <id>!` + `API Response: 1`
|
|
72
|
+
- Bulk: `🎉 Successfully updated N activities!` + `Total Updated: N`
|
|
73
|
+
|
|
74
|
+
### Error Envelope — Asymmetry Between create and update
|
|
75
|
+
|
|
76
|
+
Both create and update errors are prefixed with `❌`. There is no structured `isError`/`status` field on activity tool responses — read the text.
|
|
77
|
+
|
|
78
|
+
**create_activity errors are RICH:**
|
|
79
|
+
- 191 (field-level): full JSON `{"msg":"...","code":191,"details":{...},"debug":...}`
|
|
80
|
+
- Zod validation: structured `**Validation Error for create_activity**` block, e.g. `name: Activity name cannot be empty` / `workflowId: Required, phaseId: Required`
|
|
81
|
+
|
|
82
|
+
**update_activity errors are LOSSY:**
|
|
83
|
+
- Any rejection collapses to `❌ Error updating activity: [object Object]` — the underlying message is swallowed. Verify update outcomes via read-back (`show_activity_by_id`) rather than relying on the error text.
|
|
84
|
+
|
|
85
|
+
### Empty-List Shape
|
|
86
|
+
|
|
87
|
+
`list_activities` with zero results returns:
|
|
88
|
+
```
|
|
89
|
+
✅ Found 0 activities in workflow "X"
|
|
90
|
+
📊 PAGINATION INFO ... Activities on this page: 0
|
|
91
|
+
[]
|
|
92
|
+
```
|
|
93
|
+
A human-readable string + a bare `[]` — NOT a `{activities:[]}` JSON envelope. Do not flag a bare `[]` as a parse error or an offline-server symptom.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Pattern 8: Detect MCP Connection Errors
|
|
98
|
+
|
|
99
|
+
When an MCP server is offline, tools may return unexpected text or transport-level errors.
|
|
100
|
+
|
|
101
|
+
**Red flags in the text content:**
|
|
102
|
+
- "0 Workflows Found" / "Activities on this page: 0" when the workspace is known to have data AND transport-layer error strings are present
|
|
103
|
+
- Error strings containing: "connection", "ECONNREFUSED", "timeout", "unavailable", "ENOTFOUND"
|
|
104
|
+
|
|
105
|
+
**Note:** `describe_workflows` returns a text blob like `"📋 N Workflows Found"` — there is no `workflows: []` JSON array. Read the text for the count and workflow names.
|
|
106
|
+
|
|
107
|
+
**What to do:**
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"status": "error",
|
|
112
|
+
"result": { "tool": "tool_name", "error": "MCP server appears offline" },
|
|
113
|
+
"summary": "Cannot proceed: MCP server not responding"
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Examples
|
|
120
|
+
|
|
121
|
+
### Correct — Verify Before Reporting
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
GOOD: Call create_activity → read result → if result.created_ids has entries → return success
|
|
125
|
+
GOOD: "Created customer with ID abc123" (ID from actual result)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Wrong — Fabricating Success
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
BAD: Call create_activity → immediately return {"status": "success", "created": 1}
|
|
132
|
+
BAD: "I created the customer" (without checking result)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Correct — Error Reporting
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"status": "error",
|
|
140
|
+
"result": { "tool": "create_activity", "error": "code 191: 'priority' must be a string" },
|
|
141
|
+
"summary": "Tool failed: field validation error"
|
|
142
|
+
}
|
|
143
|
+
```
|
package/CLAUDE.md
CHANGED
|
@@ -65,7 +65,7 @@ workspace/
|
|
|
65
65
|
├── templates/ # Document templates
|
|
66
66
|
└── <WorkflowName>_<id>/
|
|
67
67
|
├── fields.ts # Field definitions (type, label, key, options, required)
|
|
68
|
-
├── phases.ts # Phases (name, key, isInitial, isEndpoint,
|
|
68
|
+
├── phases.ts # Phases (name, key, isInitial, isEndpoint, possibleNextPhase)
|
|
69
69
|
├── main.ts # Workflow config
|
|
70
70
|
└── functions/ # Function field code (one file per function)
|
|
71
71
|
```
|
|
@@ -95,13 +95,27 @@ Always use `:force` — the non-force variants prompt interactively.
|
|
|
95
95
|
|--------|---------|-------|
|
|
96
96
|
| New entities | Omit `_id` — server assigns it | Don't add `_id` manually |
|
|
97
97
|
| After push | `npm run pull` to get server-assigned IDs | Don't assume local IDs are final |
|
|
98
|
-
| Function fields | `npm run fields-push:force`
|
|
98
|
+
| Function fields | `npm run fields-push:force` — function code + `functionVariables` push from `functions/` regardless of force | non-force only prompts on deletes and hangs agents |
|
|
99
99
|
| Enum imports | Verify after pull — identical hex suffixes can collide | Don't blindly trust auto-generated imports |
|
|
100
100
|
| `linkedfrom` fields | Don't work in isolated-vm; use `<` backlink dependency | Don't use in function fields |
|
|
101
101
|
| Function field code | Plain JavaScript only | Not TypeScript |
|
|
102
|
-
| Phase transitions |
|
|
102
|
+
| Phase transitions | Move with the target `phaseId` (hex or key) from `describe_workflows` / enums | Don't pass the phase name string — it's not resolved |
|
|
103
103
|
| Activity field values (MCP) | Date: Unix ms (`1730937600000`); Dropdown: exact string; ActivityLink: string ID; fields keyed by field ID, never label | Not ISO dates, not arrays, not field names |
|
|
104
104
|
|
|
105
|
+
### New-workflow pull-wipe guard
|
|
106
|
+
|
|
107
|
+
`npm run pull` after `npm run workflows-sync` **wipes** any locally-staged field/phase edits on other workflows. Safe sequence:
|
|
108
|
+
|
|
109
|
+
1. `npm run workflows-sync` → check CLI output for `✨ Created: N` (N ≥ 1). If N = 0, the create was a no-op — do NOT pull.
|
|
110
|
+
2. `npm run pull` — only after confirming the workflow was created.
|
|
111
|
+
3. Complete the new workflow end-to-end (fields-push → phases-push) before pulling for any other reason.
|
|
112
|
+
|
|
113
|
+
Never mix un-pushed field edits on existing workflows into the same batch as a new-workflow create-then-pull.
|
|
114
|
+
|
|
115
|
+
### No multi-select field types
|
|
116
|
+
|
|
117
|
+
Hailer fields hold **one value**. There is no multi-select for activitylink, dropdown (textpredefinedoptions), users, or teams. Writing `["id1", "id2"]` for any of these is a bug — it will silently fail or be rejected. To attach multiple linked activities, use multiple separate ActivityLink fields (or the inverse backlink). To assign multiple users, use multiple user fields.
|
|
118
|
+
|
|
105
119
|
## App Lifecycle
|
|
106
120
|
|
|
107
121
|
| Step | How |
|
|
@@ -132,25 +146,37 @@ Tools not in this list are either SDK-shadowed (see matrix above) or admin/dange
|
|
|
132
146
|
|
|
133
147
|
## Skills
|
|
134
148
|
|
|
135
|
-
|
|
149
|
+
Skills live in `.claude/skills/`. Load the relevant skill before starting that kind of work — it carries the patterns, gotchas, and correct formats for that domain.
|
|
150
|
+
|
|
151
|
+
### Skill routing
|
|
152
|
+
|
|
153
|
+
| Task / symptom | Load this skill |
|
|
154
|
+
|----------------|-----------------|
|
|
155
|
+
| Creating or editing workflows, fields, phases, teams, groups — or debugging push errors, field-not-visible issues, phase ordering | `sdk-ws-config-skill` |
|
|
156
|
+
| Writing or debugging any function (calculated) field; code 191 compile errors; null returns; cross-workflow aggregation | `sdk-function-fields` |
|
|
157
|
+
| Creating or updating activities via MCP; bulk create; field format questions; `createMany`/`updateMany`; silent write failures | `sdk-activity-patterns` |
|
|
158
|
+
| Writing or debugging any insight SQL query; timestamp unit confusion (seconds vs ms); reserved column names; NULL aggregates | `sdk-insight-queries` |
|
|
159
|
+
| Insight calculations beyond plain SUM/COUNT — weighted sums, CASE bucketing, conversion rates, date truncation, top-N, percentage of total | `sdk-insight-calculations` |
|
|
160
|
+
| Cross-workflow insight JOINs; NULL join results; ActivityLink display values; row multiplication from one-to-many | `insight-join-patterns` |
|
|
161
|
+
| Verifying MCP tool results; checking create/update actually succeeded; detecting silent failures | `tool-response-verification` |
|
|
162
|
+
| Building a Hailer app UI — components, hooks, reads/writes, v1↔v2 migration, ActivityLink shapes | `hailer-app-builder` |
|
|
163
|
+
| Scaffolding and publishing an app — `@hailer/create-app`, `prep-app`, publish scripts, auth, marketplace publish | `create-and-publish-app` |
|
|
164
|
+
| Theme, colors, Chakra tokens, icons, layout patterns | `hailer-design-system` |
|
|
165
|
+
| Adding images or media to an app | `hailer-apps-pictures` |
|
|
166
|
+
| Chakra UI primitives — Select, ConfirmDialog, date pickers, state machines, REST calls from app | `hailer-app-primitives` |
|
|
167
|
+
| Publish script flags, `--market`, `--create`, post-publish app registration | `publish-hailer-app` |
|
|
168
|
+
| Any question the local skills don't answer — API endpoint arguments/returns, RPC names, REST routes, SDK/CLI usage, end-user how-tos: search the official docs at docs.hailer.com | `hailer-docs-search` |
|
|
169
|
+
|
|
170
|
+
### Field-by-key resolver (apps)
|
|
136
171
|
|
|
137
|
-
|
|
138
|
-
|-------|------|
|
|
139
|
-
| `sdk-ws-config-skill` | Workflows, fields, phases, teams, groups |
|
|
140
|
-
| `sdk-function-fields` | Calculated fields, nameFunction |
|
|
141
|
-
| `sdk-activity-patterns` | Creating/updating activities via MCP |
|
|
142
|
-
| `sdk-insight-queries` | SQL insight queries |
|
|
143
|
-
| `hailer-app-builder` | Building Hailer apps (React/Chakra) |
|
|
144
|
-
| `hailer-design-system` | Theme, colors, icons, layout |
|
|
145
|
-
| `create-and-publish-app` | Scaffolding + publishing apps (dev/prod/marketplace) |
|
|
146
|
-
| `testing-patterns` | Vitest/playwright tests |
|
|
172
|
+
In app code, reference fields by their **key** via the generated field resolver — never hardcode hex field IDs. A field with `key: "status"` is accessible as `activity.fields.status` (with `returnFlat: true`) or via the resolver. This keeps apps workspace-portable if fields are recreated.
|
|
147
173
|
|
|
148
|
-
|
|
174
|
+
Fields without a `key` fall back to hex ID lookup. Assign meaningful keys when creating fields.
|
|
149
175
|
|
|
150
|
-
|
|
176
|
+
## Design before building
|
|
151
177
|
|
|
152
|
-
|
|
178
|
+
Before building a workspace, load `hailer-workflow-archetypes` to pick the structural shape (Register, Pipeline, Header+LineItems, etc.), then `hailer-design-patterns` for parent/child lifecycle, row progression, and integration patterns. Design the structure first — flat field-piles without archetype thinking cause expensive rework later.
|
|
153
179
|
|
|
154
|
-
|
|
180
|
+
## Build strategy
|
|
155
181
|
|
|
156
|
-
Build apps with a single agent + the `hailer-app-builder` / `create-and-publish-app` skills —
|
|
182
|
+
Build apps with a single agent (`agent-giuseppe-app-builder`) + the `hailer-app-builder` / `create-and-publish-app` skills — a focused agent dispatch is more efficient than multi-agent fan-out for app builds (no shared-contract prep, no cross-agent integration fixups).
|
package/dist/bot/bot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../../src/bot/bot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,YAAY,EAAa,MAAM,sBAAsB,CAAC;AAwB/D,OAAO,EAAkC,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAEH,SAAS,EAMZ,MAAM,eAAe,CAAC;AAIvB,iEAAiE;AACjE,UAAU,aAAa;IACrB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;CAC7D;AAED,mEAAmE;AACnE,MAAM,WAAW,UAAU;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;
|
|
1
|
+
{"version":3,"file":"bot.d.ts","sourceRoot":"","sources":["../../src/bot/bot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,YAAY,EAAa,MAAM,sBAAsB,CAAC;AAwB/D,OAAO,EAAkC,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAEH,SAAS,EAMZ,MAAM,eAAe,CAAC;AAIvB,iEAAiE;AACjE,UAAU,aAAa;IACrB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC;CAC7D;AAED,mEAAmE;AACnE,MAAM,WAAW,UAAU;IACzB,eAA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,cAAc;YA4Cd,oBAAoB;IAiBlC,OAAO,CAAC,yBAAyB;IAcjC,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,iBAAiB;YAiBX,WAAW;IAazB,OAAO,CAAC,cAAc;IAOtB,oGAAoG;YACtF,uBAAuB;IAerC,OAAO,CAAC,eAAe;CAiB1B"}
|
package/dist/bot/bot.js
CHANGED
|
@@ -119,8 +119,28 @@ function parseSeedTurns(raw, log) {
|
|
|
119
119
|
const namesHint = templateNames.length > 0
|
|
120
120
|
? `\n\n[INSTALL THESE PRODUCTS BY NAME: ${templateNames.join(', ')}]`
|
|
121
121
|
: '';
|
|
122
|
+
// Append discovery brief if available
|
|
123
|
+
const briefRaw = parsed.discoveryBrief;
|
|
124
|
+
let briefHint = '';
|
|
125
|
+
if (briefRaw && typeof briefRaw === 'object') {
|
|
126
|
+
const b = briefRaw;
|
|
127
|
+
const parts = [];
|
|
128
|
+
if (b.industry)
|
|
129
|
+
parts.push(`Industry: ${b.industry}`);
|
|
130
|
+
if (b.job)
|
|
131
|
+
parts.push(`Needs: ${b.job}`);
|
|
132
|
+
if (b.today)
|
|
133
|
+
parts.push(`Current tools: ${b.today}`);
|
|
134
|
+
if (b.door)
|
|
135
|
+
parts.push(`Experience: ${b.door}`);
|
|
136
|
+
if (b.must_haves)
|
|
137
|
+
parts.push(`Must-haves: ${b.must_haves}`);
|
|
138
|
+
if (parts.length > 0) {
|
|
139
|
+
briefHint = `\n\n[DISCOVERY BRIEF]\n${parts.join('\n')}`;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
122
142
|
return {
|
|
123
|
-
turns: [{ role: 'user', content: `[Demo conversation summary]\n${summary}${namesHint}` }],
|
|
143
|
+
turns: [{ role: 'user', content: `[Demo conversation summary]\n${summary}${namesHint}${briefHint}` }],
|
|
124
144
|
viewedSlides,
|
|
125
145
|
templateIds,
|
|
126
146
|
templateNames,
|