insightcrm 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/LICENSE +21 -0
- package/README.md +1 -1
- package/SKILL.md +14 -9
- package/dist/cli.js +42 -47
- package/package.json +2 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 shadowcz007
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ crm login https://<你的服务器> # 浏览器里点「允许」(设备
|
|
|
10
10
|
crm schema --json # 字段契约,含每个字段的填写指引
|
|
11
11
|
echo '{"name":"王小明","company":"ACME"}' | crm add - --json
|
|
12
12
|
crm list --due-today --json
|
|
13
|
-
crm skill
|
|
13
|
+
crm skill # 打印给 agent 的使用说明;在 agent 指令里加一句「先运行 crm skill」
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
- `--json` 时 stdout 只有一个 JSON 对象,过程信息走 stderr。
|
package/SKILL.md
CHANGED
|
@@ -89,16 +89,20 @@ crm list -q 跨境 --json # 关键词:姓名、公司
|
|
|
89
89
|
crm get <id> --json
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
##
|
|
92
|
+
## 推荐库(是用户的库存,不是聊天里挖出来的东西)
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
推荐库是**用户自己的待推荐库存**:他要推给客户的产品、服务、文章、活动。内容只来自用户本人。
|
|
95
|
+
|
|
96
|
+
- **平时只读**:`crm rec list --json`,用来给某个客户挑合适的推荐。
|
|
97
|
+
- **只在用户明确要求时才添加**(比如「把这个产品加到推荐库」,并且信息是他给的)。**不要**因为聊天里提到了某个产品、服务或链接就自己往里加,也不要编造产品、卖点或链接。
|
|
98
|
+
- 聊天里验证有效的话术**不是**推荐,那是钩子,用 `crm hook add`(见上面「成功钩子」)。两个库别混:钩子 = 从对话里总结出来的话术;推荐 = 用户要卖或要推的东西。
|
|
95
99
|
|
|
96
100
|
```bash
|
|
97
101
|
crm rec list --json
|
|
98
|
-
crm rec add --title "..." --type Article|Product|Service|Event --desc "适合什么样的客户" --link https://...
|
|
102
|
+
crm rec add --title "..." --type Article|Product|Service|Event --desc "适合什么样的客户" --link https://... # 仅在用户明确要求时
|
|
99
103
|
```
|
|
100
104
|
|
|
101
|
-
|
|
105
|
+
给客户挑推荐时:只推荐高度相关的,并说明为什么适合这个客户(对应客户的哪个痛点或目标);库里没有合适的就直说没有,不要硬凑,更不要编一个。
|
|
102
106
|
|
|
103
107
|
## Prompt 模板
|
|
104
108
|
|
|
@@ -136,9 +140,10 @@ crm import backup.json # 重复导入同一份是安全的(相同 id
|
|
|
136
140
|
|
|
137
141
|
`crm rm <id> --yes` 删除客户,**先问用户**。客户的钩子会保留在钩子库里。
|
|
138
142
|
|
|
139
|
-
##
|
|
143
|
+
## 这份说明从哪来
|
|
140
144
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
+
`crm skill` 把这份说明打印出来,内容永远和当前安装的 CLI 版本一致。**处理客户相关的事(录入、更新、查询、推荐)之前先运行一次 `crm skill`,并按它执行。**
|
|
146
|
+
|
|
147
|
+
想让你的 agent 每次都这样做,在它的指令里(`CLAUDE.md`、`AGENTS.md` 或系统提示)加一句:
|
|
148
|
+
|
|
149
|
+
> 处理客户档案之前,先运行 `crm skill` 读最新说明,并按它执行。
|
package/dist/cli.js
CHANGED
|
@@ -7,9 +7,8 @@ var __export = (target, all) => {
|
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
9
|
import { spawn } from "child_process";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import path3 from "path";
|
|
10
|
+
import { readFile as readFile3, writeFile as writeFile3 } from "fs/promises";
|
|
11
|
+
import { hostname as hostname3, platform } from "os";
|
|
13
12
|
import { fileURLToPath } from "url";
|
|
14
13
|
import { createInterface } from "readline/promises";
|
|
15
14
|
import { Command, Option } from "commander";
|
|
@@ -849,10 +848,10 @@ function mergeDefs(...defs) {
|
|
|
849
848
|
function cloneDef(schema) {
|
|
850
849
|
return mergeDefs(schema._zod.def);
|
|
851
850
|
}
|
|
852
|
-
function getElementAtPath(obj,
|
|
853
|
-
if (!
|
|
851
|
+
function getElementAtPath(obj, path3) {
|
|
852
|
+
if (!path3)
|
|
854
853
|
return obj;
|
|
855
|
-
return
|
|
854
|
+
return path3.reduce((acc, key) => acc?.[key], obj);
|
|
856
855
|
}
|
|
857
856
|
function promiseAllObject(promisesObj) {
|
|
858
857
|
const keys = Object.keys(promisesObj);
|
|
@@ -1192,11 +1191,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
1192
1191
|
}
|
|
1193
1192
|
return false;
|
|
1194
1193
|
}
|
|
1195
|
-
function prefixIssues(
|
|
1194
|
+
function prefixIssues(path3, issues) {
|
|
1196
1195
|
return issues.map((iss) => {
|
|
1197
1196
|
var _a3;
|
|
1198
1197
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
1199
|
-
iss.path.unshift(
|
|
1198
|
+
iss.path.unshift(path3);
|
|
1200
1199
|
return iss;
|
|
1201
1200
|
});
|
|
1202
1201
|
}
|
|
@@ -1658,16 +1657,16 @@ function flattenError(error62, mapper = (issue2) => issue2.message) {
|
|
|
1658
1657
|
}
|
|
1659
1658
|
function formatError(error62, mapper = (issue2) => issue2.message) {
|
|
1660
1659
|
const fieldErrors = { _errors: [] };
|
|
1661
|
-
const processError = (error63,
|
|
1660
|
+
const processError = (error63, path3 = []) => {
|
|
1662
1661
|
for (const issue2 of error63.issues) {
|
|
1663
1662
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1664
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1663
|
+
issue2.errors.map((issues) => processError({ issues }, [...path3, ...issue2.path]));
|
|
1665
1664
|
} else if (issue2.code === "invalid_key") {
|
|
1666
|
-
processError({ issues: issue2.issues }, [...
|
|
1665
|
+
processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
|
|
1667
1666
|
} else if (issue2.code === "invalid_element") {
|
|
1668
|
-
processError({ issues: issue2.issues }, [...
|
|
1667
|
+
processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
|
|
1669
1668
|
} else {
|
|
1670
|
-
const fullpath = [...
|
|
1669
|
+
const fullpath = [...path3, ...issue2.path];
|
|
1671
1670
|
if (fullpath.length === 0) {
|
|
1672
1671
|
fieldErrors._errors.push(mapper(issue2));
|
|
1673
1672
|
} else {
|
|
@@ -1706,17 +1705,17 @@ function formatError(error62, mapper = (issue2) => issue2.message) {
|
|
|
1706
1705
|
}
|
|
1707
1706
|
function treeifyError(error62, mapper = (issue2) => issue2.message) {
|
|
1708
1707
|
const result = { errors: [] };
|
|
1709
|
-
const processError = (error63,
|
|
1708
|
+
const processError = (error63, path3 = []) => {
|
|
1710
1709
|
var _a3;
|
|
1711
1710
|
for (const issue2 of error63.issues) {
|
|
1712
1711
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1713
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1712
|
+
issue2.errors.map((issues) => processError({ issues }, [...path3, ...issue2.path]));
|
|
1714
1713
|
} else if (issue2.code === "invalid_key") {
|
|
1715
|
-
processError({ issues: issue2.issues }, [...
|
|
1714
|
+
processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
|
|
1716
1715
|
} else if (issue2.code === "invalid_element") {
|
|
1717
|
-
processError({ issues: issue2.issues }, [...
|
|
1716
|
+
processError({ issues: issue2.issues }, [...path3, ...issue2.path]);
|
|
1718
1717
|
} else {
|
|
1719
|
-
const fullpath = [...
|
|
1718
|
+
const fullpath = [...path3, ...issue2.path];
|
|
1720
1719
|
if (fullpath.length === 0) {
|
|
1721
1720
|
result.errors.push(mapper(issue2));
|
|
1722
1721
|
continue;
|
|
@@ -1755,8 +1754,8 @@ function treeifyError(error62, mapper = (issue2) => issue2.message) {
|
|
|
1755
1754
|
}
|
|
1756
1755
|
function toDotPath(_path) {
|
|
1757
1756
|
const segs = [];
|
|
1758
|
-
const
|
|
1759
|
-
for (const seg of
|
|
1757
|
+
const path3 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1758
|
+
for (const seg of path3) {
|
|
1760
1759
|
if (typeof seg === "number")
|
|
1761
1760
|
segs.push(`[${seg}]`);
|
|
1762
1761
|
else if (typeof seg === "symbol")
|
|
@@ -18894,13 +18893,13 @@ function resolveRef(ref, ctx) {
|
|
|
18894
18893
|
if (!ref.startsWith("#")) {
|
|
18895
18894
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
18896
18895
|
}
|
|
18897
|
-
const
|
|
18898
|
-
if (
|
|
18896
|
+
const path3 = ref.slice(1).split("/").filter(Boolean);
|
|
18897
|
+
if (path3.length === 0) {
|
|
18899
18898
|
return ctx.rootSchema;
|
|
18900
18899
|
}
|
|
18901
18900
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
18902
|
-
if (
|
|
18903
|
-
const key =
|
|
18901
|
+
if (path3[0] === defsKey) {
|
|
18902
|
+
const key = path3[1] === void 0 ? void 0 : decodeJSONPointerSegment(path3[1]);
|
|
18904
18903
|
if (!key || !ctx.defs[key]) {
|
|
18905
18904
|
throw new Error(`Reference not found: ${ref}`);
|
|
18906
18905
|
}
|
|
@@ -19832,7 +19831,7 @@ var SCHEMA = {
|
|
|
19832
19831
|
]
|
|
19833
19832
|
},
|
|
19834
19833
|
hook: {
|
|
19835
|
-
description: "\u6210\u529F\u94A9\u5B50\u5E93\uFF1A\u8BB0\u5F55\u300C\u54EA\u53E5\u8BDD\u3001\u54EA\u79CD\u8BF4\u6CD5\u300D\u6210\u529F\u5F15\u8D77\u5BA2\u6237\u6CE8\u610F\u3002\u8FD9\u662F\u8DE8\u5BA2\u6237\u590D\u7528\u7684\
|
|
19834
|
+
description: "\u6210\u529F\u94A9\u5B50\u5E93\uFF1A\u8BB0\u5F55\u300C\u54EA\u53E5\u8BDD\u3001\u54EA\u79CD\u8BF4\u6CD5\u300D\u5728\u5BF9\u8BDD\u91CC\u6210\u529F\u5F15\u8D77\u4E86\u5BA2\u6237\u6CE8\u610F\u3002\u8FD9\u662F\u4ECE\u5BF9\u8BDD\u91CC\u603B\u7ED3\u51FA\u6765\u7684\u8BDD\u672F\u8D44\u4EA7\uFF0C\u53EF\u4EE5\u8DE8\u5BA2\u6237\u590D\u7528\u3002\u5B83\u4E0D\u662F\u7528\u6237\u8981\u5356\u6216\u8981\u63A8\u7684\u4E1C\u897F\uFF1A\u90A3\u4E9B\u5728\u63A8\u8350\u5E93\uFF08rec\uFF09\u3002",
|
|
19836
19835
|
fields: [
|
|
19837
19836
|
...hookFields,
|
|
19838
19837
|
{ name: "customerId", type: "uuid", nullable: true, guide: "\u8FD9\u6761\u94A9\u5B50\u6765\u81EA\u54EA\u4E2A\u5BA2\u6237\uFF1B\u4E0D\u5173\u8054\u5C31\u7701\u7565" },
|
|
@@ -19840,13 +19839,13 @@ var SCHEMA = {
|
|
|
19840
19839
|
]
|
|
19841
19840
|
},
|
|
19842
19841
|
rec: {
|
|
19843
|
-
description: "\u63A8\u8350\u5E93\uFF1A\
|
|
19842
|
+
description: "\u63A8\u8350\u5E93\uFF1A\u7528\u6237\u81EA\u5DF1\u7684\u5F85\u63A8\u8350\u5E93\u5B58\uFF0C\u4E5F\u5C31\u662F\u4ED6\u8981\u63A8\u7ED9\u5BA2\u6237\u7684\u4EA7\u54C1\u3001\u670D\u52A1\u3001\u6587\u7AE0\u3001\u6D3B\u52A8\u3002\u5185\u5BB9\u53EA\u6765\u81EA\u7528\u6237\uFF1A\u53EA\u5728\u7528\u6237\u660E\u786E\u8981\u6C42\u65F6\u6DFB\u52A0\uFF0C\u4E0D\u8981\u4ECE\u804A\u5929\u8BB0\u5F55\u91CC\u63D0\u53D6\uFF0C\u4E5F\u4E0D\u8981\u7F16\u9020\u3002\u5E73\u65F6\u53EA\u662F\u8BFB\u5B83\uFF0C\u7528\u6765\u7ED9\u5BA2\u6237\u6311\u5408\u9002\u7684\u63A8\u8350\u3002\u804A\u5929\u91CC\u9A8C\u8BC1\u6709\u6548\u7684\u8BDD\u672F\u4E0D\u5C5E\u4E8E\u8FD9\u91CC\uFF0C\u90A3\u662F\u94A9\u5B50\u5E93\uFF08hook\uFF09\u3002",
|
|
19844
19843
|
fields: [
|
|
19845
|
-
{ name: "title", type: "string", required: true, guide: "\
|
|
19846
|
-
{ name: "type", type: "enum", required: true, values: RECOMMENDATION_TYPES, guide: "Article
|
|
19847
|
-
{ name: "description", type: "string", guide: "\u4E00\u4E24\u53E5\u8BDD\u8BF4\u660E\u9002\u5408\u4EC0\u4E48\u6837\u7684\u5BA2\u6237\u3001\u89E3\u51B3\u4EC0\u4E48\u95EE\u9898" },
|
|
19848
|
-
{ name: "link", type: "string", nullable: true, guide: "\u94FE\u63A5" },
|
|
19849
|
-
{ name: "isEnabled", type: "boolean", guide: "\u662F\u5426\u542F\u7528\uFF0C\u9ED8\u8BA4 true" }
|
|
19844
|
+
{ name: "title", type: "string", required: true, guide: "\u4EA7\u54C1 / \u670D\u52A1 / \u6587\u7AE0 / \u6D3B\u52A8\u7684\u540D\u79F0\uFF0C\u7528\u7528\u6237\u81EA\u5DF1\u7684\u53EB\u6CD5\uFF0C\u4E0D\u8981\u6539\u5199" },
|
|
19845
|
+
{ name: "type", type: "enum", required: true, values: RECOMMENDATION_TYPES, guide: "Article=\u6587\u7AE0\uFF0CProduct=\u4EA7\u54C1\uFF0CService=\u670D\u52A1\uFF0CEvent=\u6D3B\u52A8" },
|
|
19846
|
+
{ name: "description", type: "string", guide: "\u4E00\u4E24\u53E5\u8BDD\u8BF4\u660E\u9002\u5408\u4EC0\u4E48\u6837\u7684\u5BA2\u6237\u3001\u89E3\u51B3\u4EC0\u4E48\u95EE\u9898\u3002\u53EA\u7528\u7528\u6237\u63D0\u4F9B\u7684\u4FE1\u606F\uFF0C\u4E0D\u8981\u81EA\u5DF1\u7F16\u5356\u70B9" },
|
|
19847
|
+
{ name: "link", type: "string", nullable: true, guide: "\u7528\u6237\u7ED9\u7684\u94FE\u63A5\uFF1B\u6CA1\u6709\u5C31\u7701\u7565\uFF0C\u4E0D\u8981\u731C" },
|
|
19848
|
+
{ name: "isEnabled", type: "boolean", guide: "\u662F\u5426\u542F\u7528\uFF08\u53C2\u4E0E\u63A8\u8350\uFF09\uFF0C\u9ED8\u8BA4 true" }
|
|
19850
19849
|
]
|
|
19851
19850
|
}
|
|
19852
19851
|
};
|
|
@@ -20059,8 +20058,9 @@ function defaultLang(env = process.env) {
|
|
|
20059
20058
|
// package.json
|
|
20060
20059
|
var package_default = {
|
|
20061
20060
|
name: "insightcrm",
|
|
20062
|
-
version: "0.1.
|
|
20061
|
+
version: "0.1.2",
|
|
20063
20062
|
description: "Command line and agent skill for InsightCRM: file customers from chats and screenshots with your own AI agent. Non-interactive, --json output, stable exit codes.",
|
|
20063
|
+
license: "MIT",
|
|
20064
20064
|
type: "module",
|
|
20065
20065
|
bin: {
|
|
20066
20066
|
insightcrm: "dist/cli.js",
|
|
@@ -20111,12 +20111,14 @@ var program = new Command().name("crm").description("InsightCRM command line: re
|
|
|
20111
20111
|
"after",
|
|
20112
20112
|
`
|
|
20113
20113
|
Recommended workflow (for agents):
|
|
20114
|
+
Read first skill (prints the full agent instructions; do this before your first task)
|
|
20114
20115
|
First time login <server-url> (a human approves in the browser)
|
|
20115
20116
|
Learn the fields schema --json (field types AND how to fill each one: read the "guide" texts)
|
|
20116
20117
|
Before adding search <name> --json (avoid duplicates; if the customer exists, update instead of add)
|
|
20117
20118
|
Record a customer add - --json < profile.json (or: add --name ... --potential High)
|
|
20118
20119
|
Update update <id> --add-pain "budget" --add-event 2026-10-20:follow_up:send quote --json
|
|
20119
20120
|
Reuse what works hook list --json (successful phrasings from other customers)
|
|
20121
|
+
Recommend rec list --json (the user's OWN inventory: pick what fits; add items only when the user asks, never from chat)
|
|
20120
20122
|
House rules prompts show extraction-rules (the user's own extraction rules: follow them when extracting)
|
|
20121
20123
|
Task templates prompts show draft --customer <id> (also: gift, starters, advice; "prompts list" for all)
|
|
20122
20124
|
|
|
@@ -20345,18 +20347,11 @@ program.command("whoami").description("Show the current server and account").act
|
|
|
20345
20347
|
const { user } = await (await client()).me();
|
|
20346
20348
|
out(`${user.email} (${user.role}${user.emailVerified ? "" : ", email NOT verified: read-only"}) on ${name ?? apiUrl} \xB7 ${apiUrl}`, { server: name ?? null, url: apiUrl, user });
|
|
20347
20349
|
});
|
|
20348
|
-
program.command("skill").description("Print the agent
|
|
20350
|
+
program.command("skill").description("Print the agent instructions (SKILL.md) for this CLI. Agents: run this before your first task and follow it. Nothing is installed anywhere.").action(async () => {
|
|
20349
20351
|
const src = fileURLToPath(new URL("../SKILL.md", import.meta.url));
|
|
20350
|
-
|
|
20351
|
-
|
|
20352
|
-
|
|
20353
|
-
else process.stdout.write(text);
|
|
20354
|
-
return;
|
|
20355
|
-
}
|
|
20356
|
-
const dest = path3.join(o.dir ? path3.resolve(o.dir) : path3.join(homedir2(), ".claude", "skills"), "insightcrm");
|
|
20357
|
-
await mkdir3(dest, { recursive: true });
|
|
20358
|
-
await cp(src, path3.join(dest, "SKILL.md"));
|
|
20359
|
-
out(`Installed skill to ${dest}/SKILL.md. Restart Claude Code to pick it up.`, { ok: true, path: path3.join(dest, "SKILL.md") });
|
|
20352
|
+
const text = await readFile3(src, "utf8");
|
|
20353
|
+
if (g().json) out("", { path: src, content: text });
|
|
20354
|
+
else process.stdout.write(text);
|
|
20360
20355
|
});
|
|
20361
20356
|
program.command("schema").description('Field definitions AND filling guidance: the contract for writing records. Read the "guide" of every field before you add.').addOption(new Option("--entity <name>", "only this entity").choices([...ENTITIES])).action(async (o) => {
|
|
20362
20357
|
const entities = (o.entity ? [o.entity] : [...ENTITIES]).map((e) => ({ entity: e, ...SCHEMA[e] }));
|
|
@@ -20417,7 +20412,7 @@ program.command("tags").description("List pain-point tags in use, most used firs
|
|
|
20417
20412
|
const { tags: tags2 } = await (await client()).tags();
|
|
20418
20413
|
out(tags2.length ? tags2.map((t) => `${String(t.count).padStart(4)} ${t.tag}`).join("\n") : "No tags yet.", { tags: tags2 });
|
|
20419
20414
|
});
|
|
20420
|
-
var hook = program.command("hook").description("Successful-hook library: phrasings that worked, reusable across customers");
|
|
20415
|
+
var hook = program.command("hook").description("Successful-hook library: phrasings that demonstrably worked in a conversation, reusable across customers. Not the user's product inventory (that is `crm rec`).");
|
|
20421
20416
|
hook.command("add").description("Add a hook. Only record what actually worked in the conversation: don't invent one.").requiredOption("--title <s>").requiredOption("--desc <s>", "the reusable phrasing or logic, and why it worked").option("--customer <id>", "the customer it came from").option("--disabled", "add it switched off").action(async (o) => {
|
|
20422
20417
|
const { hook: h } = await (await client()).addHook({ title: o.title, description: o.desc, customerId: o.customer ?? null, isEnabled: !o.disabled });
|
|
20423
20418
|
out(`Added hook ${h.id} ${h.title}`, { hook: h, created: true });
|
|
@@ -20432,12 +20427,12 @@ hook.command("rm").argument("<id>").option("-y, --yes").action(async (id, o) =>
|
|
|
20432
20427
|
await (await client()).removeHook(id);
|
|
20433
20428
|
out(`Deleted ${id}`, { ok: true, id });
|
|
20434
20429
|
});
|
|
20435
|
-
var rec = program.command("rec").description("Recommendation library:
|
|
20436
|
-
rec.command("add").requiredOption("--title <s>").addOption(new Option("--type <type>").choices([...RECOMMENDATION_TYPES]).makeOptionMandatory()).option("--desc <s>", "who it suits and what it solves").option("--link <url>").option("--disabled", "add it switched off").action(async (o) => {
|
|
20430
|
+
var rec = program.command("rec").description("Recommendation library: the USER'S OWN inventory of products, services, articles and events to recommend. Read it to pick recommendations for a customer; add to it only when the user explicitly asks. Never invent entries or mine them from chats (phrasings that worked belong in `crm hook`).");
|
|
20431
|
+
rec.command("add").description("Add an item to the user's inventory. Only when the user asked for it, with details they gave: do not extract items from chat logs or make up selling points or links.").requiredOption("--title <s>").addOption(new Option("--type <type>").choices([...RECOMMENDATION_TYPES]).makeOptionMandatory()).option("--desc <s>", "who it suits and what it solves").option("--link <url>").option("--disabled", "add it switched off").action(async (o) => {
|
|
20437
20432
|
const { recommendation: r } = await (await client()).addRec({ title: o.title, type: o.type, description: o.desc, link: o.link ?? null, isEnabled: !o.disabled });
|
|
20438
20433
|
out(`Added ${r.type} ${r.id} ${r.title}`, { recommendation: r, created: true });
|
|
20439
20434
|
});
|
|
20440
|
-
rec.command("list").action(async () => {
|
|
20435
|
+
rec.command("list").description("List the user's inventory. Use it to choose what to recommend to a customer; say so if nothing fits instead of inventing something.").action(async () => {
|
|
20441
20436
|
const { recommendations } = await (await client()).listRecs();
|
|
20442
20437
|
out(recommendations.length ? recommendations.map((r) => `${r.id} ${r.isEnabled ? " " : "\xD7"} [${r.type}] ${r.title}${r.link ? ` ${r.link}` : ""}`).join("\n") : "No recommendations yet.", { recommendations, count: recommendations.length });
|
|
20443
20438
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "insightcrm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Command line and agent skill for InsightCRM: file customers from chats and screenshots with your own AI agent. Non-interactive, --json output, stable exit codes.",
|
|
5
|
+
"license": "MIT",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"bin": {
|
|
7
8
|
"insightcrm": "dist/cli.js",
|