@aigentyc/mcp 0.1.0 → 0.1.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.
- package/AGENTS.md +29 -0
- package/README.md +27 -6
- package/context7.json +1 -1
- package/dist/llms-full.txt +111 -12
- package/dist/tools/documents.js +1 -1
- package/dist/tools/documents.js.map +1 -1
- package/dist/tools/embed.d.ts +4 -0
- package/dist/tools/embed.d.ts.map +1 -0
- package/dist/tools/embed.js +216 -0
- package/dist/tools/embed.js.map +1 -0
- package/dist/tools/files.js +1 -1
- package/dist/tools/files.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -1
- package/llms.txt +38 -3
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -43,9 +43,15 @@ npx @aigentyc/mcp login --api-key ... --project-id ... \
|
|
|
43
43
|
|
|
44
44
|
---
|
|
45
45
|
|
|
46
|
+
## Default conversation opener
|
|
47
|
+
|
|
48
|
+
**Always call `aigentyc_get_started` first** in any new conversation about an aiGentyc project. It returns project state + a prioritised `nextSteps` list that tells you which of the tools below to call next. Don't guess at the user's progress — ask the project.
|
|
49
|
+
|
|
46
50
|
## Decision tree: which tool to use
|
|
47
51
|
|
|
48
52
|
```
|
|
53
|
+
First contact in a conversation? → aigentyc_get_started
|
|
54
|
+
|
|
49
55
|
Need to add markdown / text content to the KB? → files_upload (paths)
|
|
50
56
|
Need to add raw text without a file? → documents_create_from_text
|
|
51
57
|
Need to crawl a public website into the KB? → link_sources_create + jobs_wait
|
|
@@ -58,7 +64,30 @@ Need to tweak system prompt or chat model? → config_update
|
|
|
58
64
|
Need to back up before a risky change? → backups_create + jobs_wait
|
|
59
65
|
Need to inspect what's already in the KB? → search_kb_search (read-only, non-streaming)
|
|
60
66
|
Need to see analytics? → analytics_overview / sessions / comments
|
|
67
|
+
|
|
68
|
+
Ready to put chat on the user's site?
|
|
69
|
+
- User has an existing app already? → chat_widget_setup → paste snippet
|
|
70
|
+
- User wants a fresh starter? → chat_widget_scaffold (runs npm create)
|
|
71
|
+
- User just wants the code, no readiness check? → chat_widget_get_snippet
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## End-to-end flow (the "vibe coder one-shot")
|
|
75
|
+
|
|
76
|
+
This is the canonical journey from "I have docs" to "chat is live on my site":
|
|
77
|
+
|
|
61
78
|
```
|
|
79
|
+
1. aigentyc_get_started → tells you what's missing
|
|
80
|
+
2. files_upload / documents_create_from_text / extract_from_urls
|
|
81
|
+
→ fill the KB
|
|
82
|
+
3. config_update → set systemPrompt + chatModel
|
|
83
|
+
4. tools_create (optional) → expose REST/JS actions to chat
|
|
84
|
+
5. aigentyc_get_started → confirm snippetReady=true
|
|
85
|
+
6. chat_widget_scaffold (greenfield) → npm create aigentyc-chat@latest
|
|
86
|
+
OR
|
|
87
|
+
chat_widget_setup (existing app) → returns paste-ready snippet
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
When the user asks "how do I get started" or "set this up for me", run the journey from the top. Don't try to skip steps — `aigentyc_get_started` will tell you which steps are already done.
|
|
62
91
|
|
|
63
92
|
---
|
|
64
93
|
|
package/README.md
CHANGED
|
@@ -63,15 +63,36 @@ aigentyc-mcp logout Remove a profile
|
|
|
63
63
|
aigentyc-mcp doctor Verify config + dashboard reachability
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
## Tools (
|
|
66
|
+
## Tools (86 total, 20 domains)
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
End-to-end coverage. Highlights:
|
|
69
69
|
|
|
70
|
-
-
|
|
71
|
-
|
|
70
|
+
- **`aigentyc_get_started`** — call this first. Returns project status + a
|
|
71
|
+
prioritised list of next steps the agent should walk the user through.
|
|
72
|
+
- **Embed the chat** — `chat_widget_setup` (paste snippet for existing app),
|
|
73
|
+
`chat_widget_scaffold` (runs `npm create aigentyc-chat@latest` for a fresh
|
|
74
|
+
starter), `chat_widget_get_snippet` (just the code).
|
|
75
|
+
- **Add content** — `files_upload`, `documents_create_from_text`,
|
|
76
|
+
`extract_from_urls`, `link_sources_create`, `data_stores_*`.
|
|
77
|
+
- **Configure** — `config_update` (system prompt, model, …),
|
|
78
|
+
`personas_upsert`, `tools_create` + `flows_create` (custom tool actions).
|
|
79
|
+
- **Operate** — `backups_*`, `analytics_*`, `jobs_status` / `jobs_wait`.
|
|
72
80
|
|
|
73
|
-
|
|
74
|
-
|
|
81
|
+
See `llms.txt` for the full tool inventory and recipes.
|
|
82
|
+
|
|
83
|
+
## Vibe-coder one-shot
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
You: "Add my docs/ folder, set the system prompt, and scaffold a Next.js
|
|
87
|
+
chat app at ./my-app."
|
|
88
|
+
|
|
89
|
+
Claude: aigentyc_get_started → "kb empty, no system prompt"
|
|
90
|
+
files_upload({ paths: [...] })
|
|
91
|
+
config_update({ patch: { systemPrompt: "..." } })
|
|
92
|
+
chat_widget_scaffold({ destination: "./my-app", template: "next",
|
|
93
|
+
confirm: true })
|
|
94
|
+
→ ✓ done. cd my-app && npm install && npm run dev
|
|
95
|
+
```
|
|
75
96
|
|
|
76
97
|
## Security
|
|
77
98
|
|
package/context7.json
CHANGED
package/dist/llms-full.txt
CHANGED
|
@@ -71,15 +71,36 @@ aigentyc-mcp logout Remove a profile
|
|
|
71
71
|
aigentyc-mcp doctor Verify config + dashboard reachability
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
## Tools (
|
|
74
|
+
## Tools (86 total, 20 domains)
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
End-to-end coverage. Highlights:
|
|
77
77
|
|
|
78
|
-
-
|
|
79
|
-
|
|
78
|
+
- **`aigentyc_get_started`** — call this first. Returns project status + a
|
|
79
|
+
prioritised list of next steps the agent should walk the user through.
|
|
80
|
+
- **Embed the chat** — `chat_widget_setup` (paste snippet for existing app),
|
|
81
|
+
`chat_widget_scaffold` (runs `npm create aigentyc-chat@latest` for a fresh
|
|
82
|
+
starter), `chat_widget_get_snippet` (just the code).
|
|
83
|
+
- **Add content** — `files_upload`, `documents_create_from_text`,
|
|
84
|
+
`extract_from_urls`, `link_sources_create`, `data_stores_*`.
|
|
85
|
+
- **Configure** — `config_update` (system prompt, model, …),
|
|
86
|
+
`personas_upsert`, `tools_create` + `flows_create` (custom tool actions).
|
|
87
|
+
- **Operate** — `backups_*`, `analytics_*`, `jobs_status` / `jobs_wait`.
|
|
80
88
|
|
|
81
|
-
|
|
82
|
-
|
|
89
|
+
See `llms.txt` for the full tool inventory and recipes.
|
|
90
|
+
|
|
91
|
+
## Vibe-coder one-shot
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
You: "Add my docs/ folder, set the system prompt, and scaffold a Next.js
|
|
95
|
+
chat app at ./my-app."
|
|
96
|
+
|
|
97
|
+
Claude: aigentyc_get_started → "kb empty, no system prompt"
|
|
98
|
+
files_upload({ paths: [...] })
|
|
99
|
+
config_update({ patch: { systemPrompt: "..." } })
|
|
100
|
+
chat_widget_scaffold({ destination: "./my-app", template: "next",
|
|
101
|
+
confirm: true })
|
|
102
|
+
→ ✓ done. cd my-app && npm install && npm run dev
|
|
103
|
+
```
|
|
83
104
|
|
|
84
105
|
## Security
|
|
85
106
|
|
|
@@ -168,9 +189,15 @@ npx @aigentyc/mcp login --api-key ... --project-id ... \
|
|
|
168
189
|
|
|
169
190
|
---
|
|
170
191
|
|
|
192
|
+
## Default conversation opener
|
|
193
|
+
|
|
194
|
+
**Always call `aigentyc_get_started` first** in any new conversation about an aiGentyc project. It returns project state + a prioritised `nextSteps` list that tells you which of the tools below to call next. Don't guess at the user's progress — ask the project.
|
|
195
|
+
|
|
171
196
|
## Decision tree: which tool to use
|
|
172
197
|
|
|
173
198
|
```
|
|
199
|
+
First contact in a conversation? → aigentyc_get_started
|
|
200
|
+
|
|
174
201
|
Need to add markdown / text content to the KB? → files_upload (paths)
|
|
175
202
|
Need to add raw text without a file? → documents_create_from_text
|
|
176
203
|
Need to crawl a public website into the KB? → link_sources_create + jobs_wait
|
|
@@ -183,8 +210,31 @@ Need to tweak system prompt or chat model? → config_update
|
|
|
183
210
|
Need to back up before a risky change? → backups_create + jobs_wait
|
|
184
211
|
Need to inspect what's already in the KB? → search_kb_search (read-only, non-streaming)
|
|
185
212
|
Need to see analytics? → analytics_overview / sessions / comments
|
|
213
|
+
|
|
214
|
+
Ready to put chat on the user's site?
|
|
215
|
+
- User has an existing app already? → chat_widget_setup → paste snippet
|
|
216
|
+
- User wants a fresh starter? → chat_widget_scaffold (runs npm create)
|
|
217
|
+
- User just wants the code, no readiness check? → chat_widget_get_snippet
|
|
186
218
|
```
|
|
187
219
|
|
|
220
|
+
## End-to-end flow (the "vibe coder one-shot")
|
|
221
|
+
|
|
222
|
+
This is the canonical journey from "I have docs" to "chat is live on my site":
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
1. aigentyc_get_started → tells you what's missing
|
|
226
|
+
2. files_upload / documents_create_from_text / extract_from_urls
|
|
227
|
+
→ fill the KB
|
|
228
|
+
3. config_update → set systemPrompt + chatModel
|
|
229
|
+
4. tools_create (optional) → expose REST/JS actions to chat
|
|
230
|
+
5. aigentyc_get_started → confirm snippetReady=true
|
|
231
|
+
6. chat_widget_scaffold (greenfield) → npm create aigentyc-chat@latest
|
|
232
|
+
OR
|
|
233
|
+
chat_widget_setup (existing app) → returns paste-ready snippet
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
When the user asks "how do I get started" or "set this up for me", run the journey from the top. Don't try to skip steps — `aigentyc_get_started` will tell you which steps are already done.
|
|
237
|
+
|
|
188
238
|
---
|
|
189
239
|
|
|
190
240
|
## Important behaviors agents should know
|
|
@@ -327,7 +377,31 @@ Requires npm credentials with publish rights on `@aigentyc`.
|
|
|
327
377
|
|
|
328
378
|
# @aigentyc/mcp
|
|
329
379
|
|
|
330
|
-
> Model Context Protocol server for the Aigentyc platform. Lets Claude Code, Cursor, Windsurf, Claude Desktop, and any MCP-compatible agent drive
|
|
380
|
+
> Model Context Protocol server for the Aigentyc platform. Lets Claude Code, Cursor, Windsurf, Claude Desktop, and any MCP-compatible agent drive an Aigentyc project end-to-end: add documents, configure the chat agent, build custom tools — and scaffold or embed the front-end chat widget (`@aigentyc/chat-sdk`) — all from one conversation. The output is a working chat experience on the user's site.
|
|
381
|
+
|
|
382
|
+
## Zero-to-chat in one conversation
|
|
383
|
+
|
|
384
|
+
```
|
|
385
|
+
You: "Add my docs/ folder, set the system prompt to be terse and helpful,
|
|
386
|
+
and scaffold a Next.js chat app at ./my-app."
|
|
387
|
+
|
|
388
|
+
Claude: aigentyc_get_started → "kb empty, no system prompt"
|
|
389
|
+
files_upload({ paths: [...] }) → 14 docs ingested
|
|
390
|
+
config_update({ patch: { systemPrompt: "..." } })
|
|
391
|
+
aigentyc_get_started → "snippetReady: true"
|
|
392
|
+
chat_widget_scaffold({ destination: "./my-app", template: "next" })
|
|
393
|
+
→ ✓ done. cd my-app && npm install && npm run dev
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
## End-to-end recipe
|
|
397
|
+
|
|
398
|
+
1. **Discover state** — `aigentyc_get_started` returns project status + prioritised `nextSteps`. Always call this first in a new conversation.
|
|
399
|
+
2. **Add content** — pick the right ingest tool: `files_upload` (local files), `documents_create_from_text` (raw text), `extract_from_urls` (batch URLs), `link_sources_create` (crawl a website).
|
|
400
|
+
3. **Tune the chat** — `config_update` for the system prompt + chat model, `personas_upsert` for audience-specific tone, `tools_create` for custom REST/JS actions exposed to chat.
|
|
401
|
+
4. **Embed** — three options:
|
|
402
|
+
- **`chat_widget_setup`** — confirms readiness, returns paste-ready snippet + install commands. Use when user has an app already.
|
|
403
|
+
- **`chat_widget_scaffold`** — runs `npm create aigentyc-chat@latest <dir>` to bootstrap a fresh Vite or Next.js starter wired to the project. For greenfield apps.
|
|
404
|
+
- **`chat_widget_get_snippet`** — just the snippet, no readiness check. For when you've already verified setup.
|
|
331
405
|
|
|
332
406
|
## Install
|
|
333
407
|
|
|
@@ -382,8 +456,9 @@ aigentyc-mcp logout Remove a profile
|
|
|
382
456
|
aigentyc-mcp doctor Verify config + transport + clock skew + reachability
|
|
383
457
|
```
|
|
384
458
|
|
|
385
|
-
## Tools (
|
|
459
|
+
## Tools (86 total, 20 domains)
|
|
386
460
|
|
|
461
|
+
- **embed (E2E entry points)** — aigentyc_get_started, chat_widget_setup, chat_widget_get_snippet, chat_widget_scaffold
|
|
387
462
|
- **documents** — list, get, delete, create_from_text, merge, versions
|
|
388
463
|
- **files** — list, get, upload (path-based), delete, reprocess, versions, bulk_audience
|
|
389
464
|
- **extract** — from_urls (jobified for api-key)
|
|
@@ -428,13 +503,23 @@ Concurrency cap: 3 active jobs per project.
|
|
|
428
503
|
|
|
429
504
|
## Recipes
|
|
430
505
|
|
|
506
|
+
### Vibe-coder one-shot — docs to embedded chat in 60 seconds
|
|
507
|
+
|
|
508
|
+
```
|
|
509
|
+
1. aigentyc_get_started()
|
|
510
|
+
2. files_upload({ paths: ["docs/**/*.md"], indexAsDocuments: true })
|
|
511
|
+
3. config_update({ patch: { systemPrompt: "You are the support agent for ACME. Cite sources from docs." } })
|
|
512
|
+
4. chat_widget_scaffold({ destination: "./acme-chat", template: "next", confirm: true })
|
|
513
|
+
5. → cd acme-chat && npm install && npm run dev
|
|
514
|
+
```
|
|
515
|
+
|
|
431
516
|
### Add a markdown KB from local files
|
|
432
517
|
|
|
433
518
|
```
|
|
434
519
|
files_upload({ paths: ["docs/intro.md", "docs/api.md"], indexAsDocuments: true })
|
|
435
520
|
```
|
|
436
521
|
|
|
437
|
-
The MCP reads each file (text formats only — `.md`, `.txt`, `.json`, `.csv`, `.html`, …), uploads metadata to `uploaded_files`, then chunks + embeds + indexes via `documents/create`.
|
|
522
|
+
The MCP reads each file (text formats only — `.md`, `.txt`, `.json`, `.csv`, `.html`, …), uploads metadata to `uploaded_files`, then chunks + embeds + indexes via `documents/create`. After ingest, `chat_widget_setup` returns paste-ready snippet.
|
|
438
523
|
|
|
439
524
|
### Crawl a website + dedupe before adding more docs
|
|
440
525
|
|
|
@@ -483,9 +568,15 @@ Server (`@aigentyc/mcp` on npm) and platform (`app.aigentyc.com`) version indepe
|
|
|
483
568
|
All MCP tools registered at server startup, grouped by domain prefix. Use these names verbatim when invoking via an MCP client.
|
|
484
569
|
|
|
485
570
|
|
|
486
|
-
_Total tools: **
|
|
571
|
+
_Total tools: **86**_
|
|
487
572
|
|
|
488
573
|
|
|
574
|
+
### `aigentyc`
|
|
575
|
+
|
|
576
|
+
| tool | description |
|
|
577
|
+
| ---- | ----------- |
|
|
578
|
+
| `aigentyc_get_started` | Read the current state of the active project (KB readiness, config, custom tools, embedding status) and return a prioritised list of next steps the agent should walk the user through. Call this FIRST in any new conversation about an aiGentyc project — it tells you whether to add content, set a system prompt, or skip straight to embedding chat. |
|
|
579
|
+
|
|
489
580
|
### `analytics`
|
|
490
581
|
|
|
491
582
|
| tool | description |
|
|
@@ -513,6 +604,14 @@ _Total tools: **82**_
|
|
|
513
604
|
| ---- | ----------- |
|
|
514
605
|
| `branches_list` | List named branches of the knowledge base (draft vs published workspaces). |
|
|
515
606
|
|
|
607
|
+
### `chat`
|
|
608
|
+
|
|
609
|
+
| tool | description |
|
|
610
|
+
| ---- | ----------- |
|
|
611
|
+
| `chat_widget_get_snippet` | Return install command + framework-specific code snippet for embedding the aiGentyc chat widget into an existing app. Public chat works with just projectId — no api key required. For URL-sourced content + custom tools to actually do anything, the project must be configured (see aigentyc_get_started). |
|
|
612
|
+
| `chat_widget_setup` | One-shot setup for embedding chat: confirms the project is ready (KB has content, system prompt set), returns a paste-ready snippet, and warns about anything still missing. Use this AFTER adding content. For pure code-snippet generation without status checks, use chat_widget_get_snippet. |
|
|
613
|
+
| `chat_widget_scaffold` | Run `npm create aigentyc-chat@latest` in a chosen directory to scaffold a Vite or Next.js starter wired to this project. Refuses paths that escape $CWD or $HOME. Asks for confirmation. After scaffolding, the user runs `cd <dir> && npm install && npm run dev`. |
|
|
614
|
+
|
|
516
615
|
### `config`
|
|
517
616
|
|
|
518
617
|
| tool | description |
|
|
@@ -554,7 +653,7 @@ _Total tools: **82**_
|
|
|
554
653
|
| `documents_list` | List documents in a project with pagination, search, and filtering. Returns document summaries (name, chunk count, source). |
|
|
555
654
|
| `documents_get` | Get all chunks of a single document by name, including enrichment metadata. |
|
|
556
655
|
| `documents_delete` | Delete all chunks of a document (including non-current versions) from MySQL and Qdrant. Destructive. |
|
|
557
|
-
| `documents_create_from_text` | Create a new manual-text document in the knowledge base. Chunks, embeds, and indexes synchronously. Shows up under the dashboard's 'Text' tab. For URL-sourced content use extract_from_urls instead (it goes through the crawler and links to a link_source). For file uploads use files_upload. |
|
|
656
|
+
| `documents_create_from_text` | Create a new manual-text document in the knowledge base. Chunks, embeds, and indexes synchronously. Shows up under the dashboard's 'Text' tab. For URL-sourced content use extract_from_urls instead (it goes through the crawler and links to a link_source). For file uploads use files_upload. After adding content, run aigentyc_get_started — once snippetReady is true, embed chat with chat_widget_setup. |
|
|
558
657
|
| `documents_merge` | Merge two consecutive chunks of the same document into one. Re-embeds the merged content and updates Qdrant. Provide the merged content verbatim. |
|
|
559
658
|
| `documents_versions` | action=list → return version history for a specific chunk (documentName + chunkIndex). action=create → create a new version of a chunk (documentId + newContent + changeReason). |
|
|
560
659
|
|
|
@@ -573,7 +672,7 @@ _Total tools: **82**_
|
|
|
573
672
|
| `files_versions` | List all versions of a file (same sourceUrl / family). |
|
|
574
673
|
| `files_delete` | Delete an uploaded file and (optionally) its derived documents. Destructive. |
|
|
575
674
|
| `files_reprocess` | Re-run embedding for all current document chunks derived from this file. Use after changing embedding model or chunk settings. |
|
|
576
|
-
| `files_upload` | Read text-based files (.md, .txt, .json, .csv, .html, …) from the user's local filesystem and ingest them into the project. Binary formats (pdf/doc/docx) are not supported in v0.1. Paths must be absolute or relative to CWD, cannot escape \$HOME, and are capped at 50MB/file and 500MB/batch. |
|
|
675
|
+
| `files_upload` | Read text-based files (.md, .txt, .json, .csv, .html, …) from the user's local filesystem and ingest them into the project. Binary formats (pdf/doc/docx) are not supported in v0.1. Paths must be absolute or relative to CWD, cannot escape \$HOME, and are capped at 50MB/file and 500MB/batch. After ingesting, run aigentyc_get_started — once the KB is ready, embed chat with chat_widget_setup or chat_widget_scaffold. |
|
|
577
676
|
| `files_bulk_audience` | Assign an audience tag to multiple files at once. Audiences gate document visibility in search. |
|
|
578
677
|
|
|
579
678
|
### `flows`
|
package/dist/tools/documents.js
CHANGED
|
@@ -83,7 +83,7 @@ export function documentsTools(client) {
|
|
|
83
83
|
defineTool({
|
|
84
84
|
name: "documents_create_from_text",
|
|
85
85
|
title: "Create document from text",
|
|
86
|
-
description: "Create a new manual-text document in the knowledge base. Chunks, embeds, and indexes synchronously. Shows up under the dashboard's 'Text' tab. For URL-sourced content use extract_from_urls instead (it goes through the crawler and links to a link_source). For file uploads use files_upload.",
|
|
86
|
+
description: "Create a new manual-text document in the knowledge base. Chunks, embeds, and indexes synchronously. Shows up under the dashboard's 'Text' tab. For URL-sourced content use extract_from_urls instead (it goes through the crawler and links to a link_source). For file uploads use files_upload. After adding content, run aigentyc_get_started — once snippetReady is true, embed chat with chat_widget_setup.",
|
|
87
87
|
inputSchema: z.object({
|
|
88
88
|
projectId: projectIdArg,
|
|
89
89
|
title: z.string().min(1).max(200),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/tools/documents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAgB,MAAM,YAAY,CAAC;AAEtD,MAAM,YAAY,GAAG,CAAC;KACnB,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,QAAQ,EAAE;KACV,QAAQ,CACP,oEAAoE,CACrE,CAAC;AAEJ,SAAS,GAAG,CAAC,MAAuB,EAAE,SAA6B;IACjE,OAAO,SAAS,IAAI,MAAM,CAAC,OAAO,CAAC,SAA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CAAC;wBACxD,MAAM,IAAI,KAAK,CACb,kDAAkD,CACnD,CAAC;oBACJ,CAAC;oBACD,OAAO,MAAM,CAAC,GAAG,CACf,kBAAkB,SAAS,qBAAqB,EAChD;wBACE,YAAY,EAAE,IAAI,CAAC,YAAY;wBAC/B,UAAU,EAAE,IAAI,CAAC,UAAU;qBAC5B,CACF,CAAC;gBACJ,CAAC;gBACD,IACE,IAAI,CAAC,UAAU,KAAK,SAAS;oBAC7B,CAAC,IAAI,CAAC,UAAU;oBAChB,CAAC,IAAI,CAAC,YAAY,EAClB,CAAC;oBACD,MAAM,IAAI,KAAK,CACb,iEAAiE,CAClE,CAAC;gBACJ,CAAC;gBACD,OAAO,MAAM,CAAC,IAAI,CAAC,kBAAkB,SAAS,qBAAqB,EAAE;oBACnE,UAAU,EAAE,IAAI,CAAC,UAAU;oBAC3B,UAAU,EAAE,IAAI,CAAC,UAAU;oBAC3B,YAAY,EAAE,IAAI,CAAC,YAAY;iBAChC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.d.ts","sourceRoot":"","sources":["../../src/tools/embed.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AA6FtD,wBAAgB,UAAU,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,EAAE,CAoK7D"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { resolve, sep } from "node:path";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { pid, projectIdArg } from "./helpers.js";
|
|
6
|
+
import { defineTool } from "./types.js";
|
|
7
|
+
const SUPPORTED_FRAMEWORKS = ["next", "vite", "react", "html"];
|
|
8
|
+
const PUBLIC_API_DEFAULT = "https://app.aigentyc.com";
|
|
9
|
+
function snippet(framework, projectId, apiEndpoint) {
|
|
10
|
+
const common = {
|
|
11
|
+
install: "npm install @aigentyc/chat-sdk",
|
|
12
|
+
cssImport: 'import "@aigentyc/chat-sdk/theme/styles.css";',
|
|
13
|
+
notes: [
|
|
14
|
+
"react>=19 and react-dom>=19 are the only required peers.",
|
|
15
|
+
"The CSS import is required — the widget renders unstyled without it.",
|
|
16
|
+
"No apiKey is needed for public chat. Add one only if your setup requires authenticated tool execution.",
|
|
17
|
+
],
|
|
18
|
+
};
|
|
19
|
+
switch (framework) {
|
|
20
|
+
case "next":
|
|
21
|
+
return {
|
|
22
|
+
...common,
|
|
23
|
+
code: `// app/page.tsx (or any client component)
|
|
24
|
+
"use client";
|
|
25
|
+
import { Chat } from "@aigentyc/chat-sdk";
|
|
26
|
+
import "@aigentyc/chat-sdk/theme/styles.css";
|
|
27
|
+
|
|
28
|
+
export default function Page() {
|
|
29
|
+
return (
|
|
30
|
+
<Chat
|
|
31
|
+
projectId="${projectId}"
|
|
32
|
+
apiEndpoint="${apiEndpoint}"
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}`,
|
|
36
|
+
};
|
|
37
|
+
case "vite":
|
|
38
|
+
case "react":
|
|
39
|
+
return {
|
|
40
|
+
...common,
|
|
41
|
+
code: `// src/App.tsx
|
|
42
|
+
import { Chat } from "@aigentyc/chat-sdk";
|
|
43
|
+
import "@aigentyc/chat-sdk/theme/styles.css";
|
|
44
|
+
|
|
45
|
+
export default function App() {
|
|
46
|
+
return (
|
|
47
|
+
<Chat
|
|
48
|
+
projectId="${projectId}"
|
|
49
|
+
apiEndpoint="${apiEndpoint}"
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}`,
|
|
53
|
+
};
|
|
54
|
+
case "html":
|
|
55
|
+
return {
|
|
56
|
+
install: "Use a build tool (Vite/Webpack/etc.). The SDK is React 19; raw <script> tag distribution is not provided.",
|
|
57
|
+
code: "// Not supported as a drop-in <script>. Use the React snippet above with Vite or Next.js.",
|
|
58
|
+
notes: [
|
|
59
|
+
"If you need a script-tag option, file an issue on the chat-sdk repo.",
|
|
60
|
+
],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function normalizeBaseForChat(baseUrl) {
|
|
65
|
+
const url = baseUrl.replace(/\/$/, "");
|
|
66
|
+
return url || PUBLIC_API_DEFAULT;
|
|
67
|
+
}
|
|
68
|
+
export function embedTools(client) {
|
|
69
|
+
return [
|
|
70
|
+
defineTool({
|
|
71
|
+
name: "aigentyc_get_started",
|
|
72
|
+
title: "Get started — project status + recommended next steps",
|
|
73
|
+
description: "Read the current state of the active project (KB readiness, config, custom tools, embedding status) and return a prioritised list of next steps the agent should walk the user through. Call this FIRST in any new conversation about an aiGentyc project — it tells you whether to add content, set a system prompt, or skip straight to embedding chat.",
|
|
74
|
+
inputSchema: z.object({ projectId: projectIdArg }),
|
|
75
|
+
handler: async (args) => {
|
|
76
|
+
const projectId = pid(client, args.projectId);
|
|
77
|
+
return client.get(`/api/dashboard/${projectId}/get-started`);
|
|
78
|
+
},
|
|
79
|
+
}),
|
|
80
|
+
defineTool({
|
|
81
|
+
name: "chat_widget_get_snippet",
|
|
82
|
+
title: "Get a paste-ready @aigentyc/chat-sdk snippet",
|
|
83
|
+
description: "Return install command + framework-specific code snippet for embedding the aiGentyc chat widget into an existing app. Public chat works with just projectId — no api key required. For URL-sourced content + custom tools to actually do anything, the project must be configured (see aigentyc_get_started).",
|
|
84
|
+
inputSchema: z.object({
|
|
85
|
+
projectId: projectIdArg,
|
|
86
|
+
framework: z.enum(SUPPORTED_FRAMEWORKS).default("next"),
|
|
87
|
+
}),
|
|
88
|
+
handler: async (args) => {
|
|
89
|
+
const projectId = pid(client, args.projectId);
|
|
90
|
+
const apiEndpoint = normalizeBaseForChat(client.profile.baseUrl);
|
|
91
|
+
const parts = snippet(args.framework, projectId, apiEndpoint);
|
|
92
|
+
return {
|
|
93
|
+
framework: args.framework,
|
|
94
|
+
projectId,
|
|
95
|
+
apiEndpoint,
|
|
96
|
+
...parts,
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
}),
|
|
100
|
+
defineTool({
|
|
101
|
+
name: "chat_widget_setup",
|
|
102
|
+
title: "Embed-ready chat widget setup",
|
|
103
|
+
description: "One-shot setup for embedding chat: confirms the project is ready (KB has content, system prompt set), returns a paste-ready snippet, and warns about anything still missing. Use this AFTER adding content. For pure code-snippet generation without status checks, use chat_widget_get_snippet.",
|
|
104
|
+
inputSchema: z.object({
|
|
105
|
+
projectId: projectIdArg,
|
|
106
|
+
framework: z.enum(SUPPORTED_FRAMEWORKS).default("next"),
|
|
107
|
+
}),
|
|
108
|
+
handler: async (args) => {
|
|
109
|
+
const projectId = pid(client, args.projectId);
|
|
110
|
+
const apiEndpoint = normalizeBaseForChat(client.profile.baseUrl);
|
|
111
|
+
const status = await client.get(`/api/dashboard/${projectId}/get-started`);
|
|
112
|
+
const parts = snippet(args.framework, projectId, apiEndpoint);
|
|
113
|
+
const blockers = [];
|
|
114
|
+
if (!status.kb.ready) {
|
|
115
|
+
blockers.push(`KB is empty — add documents first (files_upload, documents_create_from_text, or extract_from_urls).`);
|
|
116
|
+
}
|
|
117
|
+
if (!status.config.systemPromptSet) {
|
|
118
|
+
blockers.push(`System prompt is empty — set with config_update({ patch: { systemPrompt: "..." } }).`);
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
ready: blockers.length === 0,
|
|
122
|
+
framework: args.framework,
|
|
123
|
+
projectId,
|
|
124
|
+
apiEndpoint,
|
|
125
|
+
publicChatPreviewUrl: status.embedding.publicChatUrl,
|
|
126
|
+
blockers,
|
|
127
|
+
nextSteps: status.nextSteps,
|
|
128
|
+
...parts,
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
}),
|
|
132
|
+
defineTool({
|
|
133
|
+
name: "chat_widget_scaffold",
|
|
134
|
+
title: "Scaffold a new chat-sdk starter app on the user's machine",
|
|
135
|
+
description: "Run `npm create aigentyc-chat@latest` in a chosen directory to scaffold a Vite or Next.js starter wired to this project. Refuses paths that escape $CWD or $HOME. Asks for confirmation. After scaffolding, the user runs `cd <dir> && npm install && npm run dev`.",
|
|
136
|
+
inputSchema: z.object({
|
|
137
|
+
projectId: projectIdArg,
|
|
138
|
+
destination: z
|
|
139
|
+
.string()
|
|
140
|
+
.min(1)
|
|
141
|
+
.describe("Directory to create. Relative paths resolve from CWD. Will be refused if it escapes CWD or $HOME."),
|
|
142
|
+
template: z.enum(["next", "vite-react"]).default("next"),
|
|
143
|
+
confirm: z
|
|
144
|
+
.boolean()
|
|
145
|
+
.default(false)
|
|
146
|
+
.describe("Required true. Show the user the full command first; only pass true after they OK it."),
|
|
147
|
+
}),
|
|
148
|
+
handler: async (args) => {
|
|
149
|
+
const projectId = pid(client, args.projectId);
|
|
150
|
+
// Resolve + sandbox the destination path. Refuse anything outside
|
|
151
|
+
// the allowed roots (CWD, HOME). We can't `realpath` because the
|
|
152
|
+
// dir doesn't exist yet, so check the resolved absolute path.
|
|
153
|
+
const absolute = resolve(args.destination);
|
|
154
|
+
const allowedRoots = [process.cwd(), homedir()].map((p) => resolve(p) + (resolve(p).endsWith(sep) ? "" : sep));
|
|
155
|
+
const inRoot = allowedRoots.some((root) => (absolute + sep).startsWith(root));
|
|
156
|
+
if (!inRoot) {
|
|
157
|
+
return {
|
|
158
|
+
scaffolded: false,
|
|
159
|
+
error: `Refusing destination: ${absolute} is outside CWD (${process.cwd()}) and $HOME (${homedir()}).`,
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
const command = "npm";
|
|
163
|
+
const cmdArgs = [
|
|
164
|
+
"create",
|
|
165
|
+
"aigentyc-chat@latest",
|
|
166
|
+
args.destination,
|
|
167
|
+
"--",
|
|
168
|
+
`--template=${args.template}`,
|
|
169
|
+
`--project-id=${projectId}`,
|
|
170
|
+
];
|
|
171
|
+
const fullCommand = `${command} ${cmdArgs.join(" ")}`;
|
|
172
|
+
if (!args.confirm) {
|
|
173
|
+
return {
|
|
174
|
+
scaffolded: false,
|
|
175
|
+
reason: "Destructive (creates files on disk). Show the user the command + destination, get OK, then re-invoke with confirm=true.",
|
|
176
|
+
wouldRun: fullCommand,
|
|
177
|
+
destination: absolute,
|
|
178
|
+
template: args.template,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
const result = await runCmd(command, cmdArgs);
|
|
182
|
+
return {
|
|
183
|
+
scaffolded: result.code === 0,
|
|
184
|
+
destination: absolute,
|
|
185
|
+
template: args.template,
|
|
186
|
+
command: fullCommand,
|
|
187
|
+
exitCode: result.code,
|
|
188
|
+
stdout: result.stdout.slice(-4000),
|
|
189
|
+
stderr: result.stderr.slice(-4000),
|
|
190
|
+
nextSteps: [
|
|
191
|
+
`cd ${args.destination}`,
|
|
192
|
+
"npm install",
|
|
193
|
+
"npm run dev",
|
|
194
|
+
],
|
|
195
|
+
};
|
|
196
|
+
},
|
|
197
|
+
}),
|
|
198
|
+
];
|
|
199
|
+
}
|
|
200
|
+
function runCmd(cmd, args) {
|
|
201
|
+
return new Promise((resolveP) => {
|
|
202
|
+
const proc = spawn(cmd, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
203
|
+
let stdout = "";
|
|
204
|
+
let stderr = "";
|
|
205
|
+
proc.stdout.on("data", (c) => {
|
|
206
|
+
stdout += c.toString();
|
|
207
|
+
});
|
|
208
|
+
proc.stderr.on("data", (c) => {
|
|
209
|
+
stderr += c.toString();
|
|
210
|
+
});
|
|
211
|
+
proc.on("close", (code) => {
|
|
212
|
+
resolveP({ code: code ?? 1, stdout, stderr });
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=embed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embed.js","sourceRoot":"","sources":["../../src/tools/embed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EA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AAE,EAAE;QAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;QACrE,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE;YACnC,MAAM,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE;YACnC,MAAM,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACxB,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/tools/files.js
CHANGED
|
@@ -84,7 +84,7 @@ export function filesTools(client) {
|
|
|
84
84
|
defineTool({
|
|
85
85
|
name: "files_upload",
|
|
86
86
|
title: "Upload text files from local FS",
|
|
87
|
-
description: "Read text-based files (.md, .txt, .json, .csv, .html, …) from the user's local filesystem and ingest them into the project. Binary formats (pdf/doc/docx) are not supported in v0.1. Paths must be absolute or relative to CWD, cannot escape \\$HOME, and are capped at 50MB/file and 500MB/batch.",
|
|
87
|
+
description: "Read text-based files (.md, .txt, .json, .csv, .html, …) from the user's local filesystem and ingest them into the project. Binary formats (pdf/doc/docx) are not supported in v0.1. Paths must be absolute or relative to CWD, cannot escape \\$HOME, and are capped at 50MB/file and 500MB/batch. After ingesting, run aigentyc_get_started — once the KB is ready, embed chat with chat_widget_setup or chat_widget_scaffold.",
|
|
88
88
|
inputSchema: z.object({
|
|
89
89
|
projectId: projectIdArg,
|
|
90
90
|
paths: z
|
package/dist/tools/files.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/tools/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,eAAe,EACf,eAAe,EACf,YAAY,EACZ,eAAe,EAEf,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,UAAU,EAAgB,MAAM,YAAY,CAAC;AAEtD,MAAM,UAAU,UAAU,CAAC,MAAuB;IAChD,OAAO;QACL,UAAU,CAAC;YACT,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,qBAAqB;YAC5B,WAAW,EAAE,4DAA4D;YACzE,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;gBACpB,SAAS,EAAE,YAAY;gBACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;gBACxC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;aACvD,CAAC;YACF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;gBACtB,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;gBAC9C,OAAO,MAAM,CAAC,GAAG,CAAC,kBAAkB,SAAS,QAAQ,EAAE;oBACrD,IAAI,EAAE,IAA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,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAiBpD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,wBAAgB,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,EAAE,CAyB3D"}
|
package/dist/tools/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { configTools } from "./config.js";
|
|
|
4
4
|
import { correctionsTools } from "./corrections.js";
|
|
5
5
|
import { dataStoresTools } from "./data_stores.js";
|
|
6
6
|
import { documentsTools } from "./documents.js";
|
|
7
|
+
import { embedTools } from "./embed.js";
|
|
7
8
|
import { extractTools } from "./extract.js";
|
|
8
9
|
import { filesTools } from "./files.js";
|
|
9
10
|
import { goldenAnswersTools } from "./golden_answers.js";
|
|
@@ -15,18 +16,25 @@ import { personasTools } from "./personas.js";
|
|
|
15
16
|
import { toolsCrudTools } from "./tools_crud.js";
|
|
16
17
|
export function allTools(client) {
|
|
17
18
|
return [
|
|
19
|
+
// End-to-end discovery + embedding entry points (call these first).
|
|
20
|
+
...embedTools(client),
|
|
21
|
+
// Content authoring
|
|
18
22
|
...documentsTools(client),
|
|
19
23
|
...filesTools(client),
|
|
20
24
|
...extractTools(client),
|
|
21
25
|
...linkSourcesTools(client),
|
|
22
26
|
...pageQuestionsTools(client),
|
|
23
27
|
...dataStoresTools(client),
|
|
28
|
+
// Custom tools / flows
|
|
24
29
|
...toolsCrudTools(client),
|
|
30
|
+
// Curation
|
|
25
31
|
...goldenAnswersTools(client),
|
|
26
32
|
...correctionsTools(client),
|
|
27
33
|
...personasTools(client),
|
|
34
|
+
// Project ops
|
|
28
35
|
...configTools(client),
|
|
29
36
|
...backupsTools(client),
|
|
37
|
+
// Read / observability
|
|
30
38
|
...miscTools(client),
|
|
31
39
|
...jobsTools(client),
|
|
32
40
|
...analyticsTools(client),
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,MAAM,UAAU,QAAQ,CAAC,MAAuB;IAC9C,OAAO;QACL,GAAG,cAAc,CAAC,MAAM,CAAC;QACzB,GAAG,UAAU,CAAC,MAAM,CAAC;QACrB,GAAG,YAAY,CAAC,MAAM,CAAC;QACvB,GAAG,gBAAgB,CAA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D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,MAAM,UAAU,QAAQ,CAAC,MAAuB;IAC9C,OAAO;QACL,oEAAoE;QACpE,GAAG,UAAU,CAAC,MAAM,CAAC;QACrB,oBAAoB;QACpB,GAAG,cAAc,CAAC,MAAM,CAAC;QACzB,GAAG,UAAU,CAAC,MAAM,CAAC;QACrB,GAAG,YAAY,CAAC,MAAM,CAAC;QACvB,GAAG,gBAAgB,CAAC,MAAM,CAAC;QAC3B,GAAG,kBAAkB,CAAC,MAAM,CAAC;QAC7B,GAAG,eAAe,CAAC,MAAM,CAAC;QAC1B,uBAAuB;QACvB,GAAG,cAAc,CAAC,MAAM,CAAC;QACzB,WAAW;QACX,GAAG,kBAAkB,CAAC,MAAM,CAAC;QAC7B,GAAG,gBAAgB,CAAC,MAAM,CAAC;QAC3B,GAAG,aAAa,CAAC,MAAM,CAAC;QACxB,cAAc;QACd,GAAG,WAAW,CAAC,MAAM,CAAC;QACtB,GAAG,YAAY,CAAC,MAAM,CAAC;QACvB,uBAAuB;QACvB,GAAG,SAAS,CAAC,MAAM,CAAC;QACpB,GAAG,SAAS,CAAC,MAAM,CAAC;QACpB,GAAG,cAAc,CAAC,MAAM,CAAC;KAC1B,CAAC;AACJ,CAAC"}
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
# @aigentyc/mcp
|
|
2
2
|
|
|
3
|
-
> Model Context Protocol server for the Aigentyc platform. Lets Claude Code, Cursor, Windsurf, Claude Desktop, and any MCP-compatible agent drive
|
|
3
|
+
> Model Context Protocol server for the Aigentyc platform. Lets Claude Code, Cursor, Windsurf, Claude Desktop, and any MCP-compatible agent drive an Aigentyc project end-to-end: add documents, configure the chat agent, build custom tools — and scaffold or embed the front-end chat widget (`@aigentyc/chat-sdk`) — all from one conversation. The output is a working chat experience on the user's site.
|
|
4
|
+
|
|
5
|
+
## Zero-to-chat in one conversation
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
You: "Add my docs/ folder, set the system prompt to be terse and helpful,
|
|
9
|
+
and scaffold a Next.js chat app at ./my-app."
|
|
10
|
+
|
|
11
|
+
Claude: aigentyc_get_started → "kb empty, no system prompt"
|
|
12
|
+
files_upload({ paths: [...] }) → 14 docs ingested
|
|
13
|
+
config_update({ patch: { systemPrompt: "..." } })
|
|
14
|
+
aigentyc_get_started → "snippetReady: true"
|
|
15
|
+
chat_widget_scaffold({ destination: "./my-app", template: "next" })
|
|
16
|
+
→ ✓ done. cd my-app && npm install && npm run dev
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## End-to-end recipe
|
|
20
|
+
|
|
21
|
+
1. **Discover state** — `aigentyc_get_started` returns project status + prioritised `nextSteps`. Always call this first in a new conversation.
|
|
22
|
+
2. **Add content** — pick the right ingest tool: `files_upload` (local files), `documents_create_from_text` (raw text), `extract_from_urls` (batch URLs), `link_sources_create` (crawl a website).
|
|
23
|
+
3. **Tune the chat** — `config_update` for the system prompt + chat model, `personas_upsert` for audience-specific tone, `tools_create` for custom REST/JS actions exposed to chat.
|
|
24
|
+
4. **Embed** — three options:
|
|
25
|
+
- **`chat_widget_setup`** — confirms readiness, returns paste-ready snippet + install commands. Use when user has an app already.
|
|
26
|
+
- **`chat_widget_scaffold`** — runs `npm create aigentyc-chat@latest <dir>` to bootstrap a fresh Vite or Next.js starter wired to the project. For greenfield apps.
|
|
27
|
+
- **`chat_widget_get_snippet`** — just the snippet, no readiness check. For when you've already verified setup.
|
|
4
28
|
|
|
5
29
|
## Install
|
|
6
30
|
|
|
@@ -55,8 +79,9 @@ aigentyc-mcp logout Remove a profile
|
|
|
55
79
|
aigentyc-mcp doctor Verify config + transport + clock skew + reachability
|
|
56
80
|
```
|
|
57
81
|
|
|
58
|
-
## Tools (
|
|
82
|
+
## Tools (86 total, 20 domains)
|
|
59
83
|
|
|
84
|
+
- **embed (E2E entry points)** — aigentyc_get_started, chat_widget_setup, chat_widget_get_snippet, chat_widget_scaffold
|
|
60
85
|
- **documents** — list, get, delete, create_from_text, merge, versions
|
|
61
86
|
- **files** — list, get, upload (path-based), delete, reprocess, versions, bulk_audience
|
|
62
87
|
- **extract** — from_urls (jobified for api-key)
|
|
@@ -101,13 +126,23 @@ Concurrency cap: 3 active jobs per project.
|
|
|
101
126
|
|
|
102
127
|
## Recipes
|
|
103
128
|
|
|
129
|
+
### Vibe-coder one-shot — docs to embedded chat in 60 seconds
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
1. aigentyc_get_started()
|
|
133
|
+
2. files_upload({ paths: ["docs/**/*.md"], indexAsDocuments: true })
|
|
134
|
+
3. config_update({ patch: { systemPrompt: "You are the support agent for ACME. Cite sources from docs." } })
|
|
135
|
+
4. chat_widget_scaffold({ destination: "./acme-chat", template: "next", confirm: true })
|
|
136
|
+
5. → cd acme-chat && npm install && npm run dev
|
|
137
|
+
```
|
|
138
|
+
|
|
104
139
|
### Add a markdown KB from local files
|
|
105
140
|
|
|
106
141
|
```
|
|
107
142
|
files_upload({ paths: ["docs/intro.md", "docs/api.md"], indexAsDocuments: true })
|
|
108
143
|
```
|
|
109
144
|
|
|
110
|
-
The MCP reads each file (text formats only — `.md`, `.txt`, `.json`, `.csv`, `.html`, …), uploads metadata to `uploaded_files`, then chunks + embeds + indexes via `documents/create`.
|
|
145
|
+
The MCP reads each file (text formats only — `.md`, `.txt`, `.json`, `.csv`, `.html`, …), uploads metadata to `uploaded_files`, then chunks + embeds + indexes via `documents/create`. After ingest, `chat_widget_setup` returns paste-ready snippet.
|
|
111
146
|
|
|
112
147
|
### Crawl a website + dedupe before adding more docs
|
|
113
148
|
|