@rubytech/create-sitedesk-code 0.1.612 → 0.1.613
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/package.json +1 -1
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +22 -10
- package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +5 -0
- package/payload/platform/plugins/docs/references/telegram-guide.md +21 -9
- package/payload/platform/plugins/telegram/mcp/dist/index.js +6 -4
- package/payload/platform/plugins/telegram/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/telegram/mcp/dist/tools/instruct.d.ts +7 -5
- package/payload/platform/plugins/telegram/mcp/dist/tools/instruct.d.ts.map +1 -1
- package/payload/platform/plugins/telegram/mcp/dist/tools/instruct.js +14 -12
- package/payload/platform/plugins/telegram/mcp/dist/tools/instruct.js.map +1 -1
- package/payload/server/server.js +141 -104
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: platform-architecture
|
|
3
3
|
description: Use when grounding any documented-surface claim about what SiteDesk ships — plugins, skills, specialists, install/deploy flows, internals. This is the install catalogue, not evidence of what is enabled on the current account. For install state on this account, call `capabilities-here`; for documented surface, cite the `Source:` URL inline.
|
|
4
|
-
content-hash: sha256:
|
|
4
|
+
content-hash: sha256:dd970e559e6b9700cae9faed47266544d99d0dd482436ec7dcee4b7ff40b35b2
|
|
5
5
|
brand: sitedesk-code
|
|
6
6
|
product-name: SiteDesk
|
|
7
7
|
---
|
|
@@ -2961,10 +2961,10 @@ Telegram profile name and will tell you plainly that it cannot put a name to the
|
|
|
2961
2961
|
Ask SiteDesk to save the Telegram ID against the contact. It is one change to one contact, and
|
|
2962
2962
|
it takes effect on the very next message.
|
|
2963
2963
|
|
|
2964
|
-
## Correcting what
|
|
2964
|
+
## Correcting what an agent told someone
|
|
2965
2965
|
|
|
2966
|
-
When one of your
|
|
2967
|
-
|
|
2966
|
+
When one of your bots tells someone something wrong, the fix is to instruct the agent that is talking
|
|
2967
|
+
to them, not to message that person yourself.
|
|
2968
2968
|
|
|
2969
2969
|
The reason is worth understanding, because the obvious approach quietly fails. Every conversation is
|
|
2970
2970
|
its own separate agent with its own memory. If you send the visitor a correction from your chat, they
|
|
@@ -2979,16 +2979,28 @@ own conversation. The agent writes the message itself, in the same voice it has
|
|
|
2979
2979
|
own memory now holds what it said, so it will not contradict it a moment later. The visitor sees a
|
|
2980
2980
|
normal message from the assistant they have been talking to, with no sign that anybody stepped in.
|
|
2981
2981
|
|
|
2982
|
+
The same is true of your specialist bots. If a specialist relays for a driver, a supplier or a
|
|
2983
|
+
colleague, and you card that person yourself, the specialist never learns you did. It answers their
|
|
2984
|
+
next message with no idea what they are replying to. That happened on a live conversation: a driver
|
|
2985
|
+
was sent a job by card, and when he came back twelve minutes later with his prices, the bot filed
|
|
2986
|
+
them as a passing remark and thanked him. Instruct it the same way, naming its bot and their chat,
|
|
2987
|
+
and it writes the message and remembers writing it.
|
|
2988
|
+
|
|
2982
2989
|
Write the intent rather than the exact sentence. This is an instruction to the agent, not text
|
|
2983
2990
|
delivered word for word, so "tell them we can do Thursday morning but not the afternoon" works better
|
|
2984
2991
|
than a script.
|
|
2985
2992
|
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
- The bot is
|
|
2989
|
-
|
|
2990
|
-
- The
|
|
2991
|
-
|
|
2993
|
+
Six situations are refused, and each one says why rather than failing quietly:
|
|
2994
|
+
|
|
2995
|
+
- The bot is your own admin bot. That chat is your conversation with the agent, so instructing it
|
|
2996
|
+
there is the agent talking to itself.
|
|
2997
|
+
- The bot is bound to nothing. It answers nobody, so there is no agent to instruct.
|
|
2998
|
+
- The agent has been switched off, or a specialist's card has been renamed or deleted. Nothing is
|
|
2999
|
+
resurrected behind your back; turn it back on, or message the person yourself.
|
|
3000
|
+
- The bot is not allowed to talk to that person. Every bot has its own rule about who it answers, and
|
|
3001
|
+
a specialist answers a named list and nobody else. Starting a conversation the bot would refuse to
|
|
3002
|
+
continue leaves the person holding a message nobody can follow up, so it is refused instead. Most
|
|
3003
|
+
often this is a mistyped chat ID.
|
|
2992
3004
|
- The chat belongs to a connected business account. Those conversations are held separately and this
|
|
2993
3005
|
route cannot reach them.
|
|
2994
3006
|
- The chat is a broadcast channel the bot does not allow. A channel post reaches every subscriber and
|
|
@@ -9,6 +9,11 @@ Invoked by the admin agent directly.
|
|
|
9
9
|
|
|
10
10
|
This is the platform's release timeline, newest first. Each entry shows the date it shipped and the version it shipped in, so you can tell the operator how current their install is. To compare, read the installed version from `capabilities-here` and match it against the versions below. Keep answers high level and in plain English; this is a summary, not a full commit log.
|
|
11
11
|
|
|
12
|
+
## 2026-08-16 (0.1.613)
|
|
13
|
+
|
|
14
|
+
- You can now tell the assistant what to say to someone one of your specialist bots is handling, the same way you already could for a public bot. Until now that was refused, so the only way through was to message the person yourself, and the specialist never learned you had. It would answer their next message with no idea what they were replying to.
|
|
15
|
+
- A bot will no longer start a conversation with someone it is set up never to answer. A mistyped chat ID used to send one message and then go silent, because every reply came back to a bot that refused it.
|
|
16
|
+
|
|
12
17
|
## 2026-08-15 (0.1.612)
|
|
13
18
|
|
|
14
19
|
- A conversation opened from the dashboard could show as completely empty even though the agent had answered in it. The reader was discarding the agent's replies instead of drawing them, so the thread looked like nothing had ever been said. Those replies now appear.
|
|
@@ -138,10 +138,10 @@ Telegram profile name and will tell you plainly that it cannot put a name to the
|
|
|
138
138
|
Ask {{productName}} to save the Telegram ID against the contact. It is one change to one contact, and
|
|
139
139
|
it takes effect on the very next message.
|
|
140
140
|
|
|
141
|
-
## Correcting what
|
|
141
|
+
## Correcting what an agent told someone
|
|
142
142
|
|
|
143
|
-
When one of your
|
|
144
|
-
|
|
143
|
+
When one of your bots tells someone something wrong, the fix is to instruct the agent that is talking
|
|
144
|
+
to them, not to message that person yourself.
|
|
145
145
|
|
|
146
146
|
The reason is worth understanding, because the obvious approach quietly fails. Every conversation is
|
|
147
147
|
its own separate agent with its own memory. If you send the visitor a correction from your chat, they
|
|
@@ -156,16 +156,28 @@ own conversation. The agent writes the message itself, in the same voice it has
|
|
|
156
156
|
own memory now holds what it said, so it will not contradict it a moment later. The visitor sees a
|
|
157
157
|
normal message from the assistant they have been talking to, with no sign that anybody stepped in.
|
|
158
158
|
|
|
159
|
+
The same is true of your specialist bots. If a specialist relays for a driver, a supplier or a
|
|
160
|
+
colleague, and you card that person yourself, the specialist never learns you did. It answers their
|
|
161
|
+
next message with no idea what they are replying to. That happened on a live conversation: a driver
|
|
162
|
+
was sent a job by card, and when he came back twelve minutes later with his prices, the bot filed
|
|
163
|
+
them as a passing remark and thanked him. Instruct it the same way, naming its bot and their chat,
|
|
164
|
+
and it writes the message and remembers writing it.
|
|
165
|
+
|
|
159
166
|
Write the intent rather than the exact sentence. This is an instruction to the agent, not text
|
|
160
167
|
delivered word for word, so "tell them we can do Thursday morning but not the afternoon" works better
|
|
161
168
|
than a script.
|
|
162
169
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
- The bot is
|
|
166
|
-
|
|
167
|
-
- The
|
|
168
|
-
|
|
170
|
+
Six situations are refused, and each one says why rather than failing quietly:
|
|
171
|
+
|
|
172
|
+
- The bot is your own admin bot. That chat is your conversation with the agent, so instructing it
|
|
173
|
+
there is the agent talking to itself.
|
|
174
|
+
- The bot is bound to nothing. It answers nobody, so there is no agent to instruct.
|
|
175
|
+
- The agent has been switched off, or a specialist's card has been renamed or deleted. Nothing is
|
|
176
|
+
resurrected behind your back; turn it back on, or message the person yourself.
|
|
177
|
+
- The bot is not allowed to talk to that person. Every bot has its own rule about who it answers, and
|
|
178
|
+
a specialist answers a named list and nobody else. Starting a conversation the bot would refuse to
|
|
179
|
+
continue leaves the person holding a message nobody can follow up, so it is refused instead. Most
|
|
180
|
+
often this is a mistyped chat ID.
|
|
169
181
|
- The chat belongs to a connected business account. Those conversations are held separately and this
|
|
170
182
|
route cannot reach them.
|
|
171
183
|
- The chat is a broadcast channel the bot does not allow. A channel post reaches every subscriber and
|
|
@@ -220,14 +220,16 @@ tool("telegram-messages", "Read one Telegram conversation back, both directions,
|
|
|
220
220
|
...(result.isError ? { isError: true } : {}),
|
|
221
221
|
};
|
|
222
222
|
});
|
|
223
|
-
tool("telegram-instruct", "Tell one of this account's
|
|
223
|
+
tool("telegram-instruct", "Tell one of this account's Telegram agents what to say to the person it is already talking to — a public agent with a visitor, or a specialist bot with the counterparty it relays for. The instruction runs inside that conversation, so the agent says it AND remembers saying it, and cannot contradict it on the next message. Use this instead of messaging the person yourself whenever the agent got something wrong: a card you send lands in your own chat and never enters that agent's context, so it keeps repeating the mistake. This is an instruction, not text sent word for word — the agent writes the message itself. Refused by name, with the reason, when the bot is the admin bot or is bound to nothing, when its agent or specialist card is switched off or missing, when the bot's own policy does not let it talk to that chat (a specialist answers a named list and nobody else, so this usually means a mistyped chat id), when the chat belongs to a connected business account, or when the chat is a broadcast channel that bot does not allowlist. Use telegram-reach first if you need the chat id.", {
|
|
224
224
|
botId: z
|
|
225
225
|
.string()
|
|
226
|
-
.describe("The
|
|
227
|
-
chatId: z
|
|
226
|
+
.describe("The bot whose conversation this is (its numeric Telegram id, the token's colon-prefix). Public and specialist bots only. telegram-reach lists them."),
|
|
227
|
+
chatId: z
|
|
228
|
+
.string()
|
|
229
|
+
.describe("The chat id of the person the agent is talking to, as telegram-reach reports it."),
|
|
228
230
|
instruction: z
|
|
229
231
|
.string()
|
|
230
|
-
.describe("What the agent should do or tell the
|
|
232
|
+
.describe("What the agent should do or tell the person, in your own words. The agent acts on it and composes the message itself, so write the intent rather than the exact sentence."),
|
|
231
233
|
}, async ({ botId, chatId, instruction }) => {
|
|
232
234
|
const result = await telegramInstruct({ botId, chatId, instruction }, {
|
|
233
235
|
port: process.env.PLATFORM_PORT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;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EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,IAAI,CACnF,CAAC;AAEF,6EAA6E;AAC7E,4EAA4E;AAC5E,+EAA+E;AAC/E,0EAA0E;AAC1E,wEAAwE;AACxE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;AAExE,+EAA+E;AAC/E,6EAA6E;AAC7E,6EAA6E;AAC7E,0BAA0B;AAC1B,8EAA8E;AAC9E,+EAA+E;AAC/E,8CAA8C;AAC9C,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,cAAc,CACZ,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,EAC/B,OAAO,CAAC,GAAG,CAAC,UAAU,EACtB,OAAO,CAAC,GAAG,CAAC,OAAO,CACpB,GAAG,IAAI,CACT,CAAC;AAEF,8EAA8E;AAC9E,2EAA2E;AAC3E,6EAA6E;AAC7E,4EAA4E;AAC5E,mBAAmB,EAAE,CAAC;AAEtB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Task 2724 — tell one of this account's
|
|
3
|
-
*
|
|
2
|
+
* Task 2724, extended by Task 2773 — tell one of this account's Telegram agents
|
|
3
|
+
* what to say to the person it is already talking to. A public agent with a
|
|
4
|
+
* visitor, or a specialist bot with the counterparty it relays for.
|
|
4
5
|
*
|
|
5
|
-
* WHY IT EXISTS. An operator who
|
|
6
|
+
* WHY IT EXISTS. An operator who answers that person directly is speaking from
|
|
6
7
|
* their OWN session, and a card sent from one session never enters another
|
|
7
8
|
* session's context: nothing seeds a session from the message store. On
|
|
8
9
|
* 2026-08-15 the admin door corrected a visitor and the public agent quoted the
|
|
9
|
-
* wrong price again 97 seconds later
|
|
10
|
-
*
|
|
10
|
+
* wrong price again 97 seconds later; the same day it carded a driver on a
|
|
11
|
+
* specialist bot, and his reply twelve minutes later reached a session that had
|
|
12
|
+
* never seen the question.
|
|
11
13
|
*
|
|
12
14
|
* WHY IT IS A THIN CLIENT. Every decision belongs to the platform, not here. The
|
|
13
15
|
* bot registry, whether the agent is active, whether the chat is a business
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instruct.d.ts","sourceRoot":"","sources":["../../src/tools/instruct.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"instruct.d.ts","sourceRoot":"","sources":["../../src/tools/instruct.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAKH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;qEAGqE;AACrE,MAAM,MAAM,aAAa,GAAG,CAC1B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,KACpE,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAA;CAAE,CAAC,CAAC;AAE5E,MAAM,WAAW,YAAY;IAC3B;;sDAEkD;IAClD,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,SAAS,EAAE,aAAa,CAAC;IACzB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAWD,wBAAsB,gBAAgB,CACpC,CAAC,EAAE,cAAc,EACjB,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,cAAc,CAAC,CAwEzB"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Task 2724 — tell one of this account's
|
|
3
|
-
*
|
|
2
|
+
* Task 2724, extended by Task 2773 — tell one of this account's Telegram agents
|
|
3
|
+
* what to say to the person it is already talking to. A public agent with a
|
|
4
|
+
* visitor, or a specialist bot with the counterparty it relays for.
|
|
4
5
|
*
|
|
5
|
-
* WHY IT EXISTS. An operator who
|
|
6
|
+
* WHY IT EXISTS. An operator who answers that person directly is speaking from
|
|
6
7
|
* their OWN session, and a card sent from one session never enters another
|
|
7
8
|
* session's context: nothing seeds a session from the message store. On
|
|
8
9
|
* 2026-08-15 the admin door corrected a visitor and the public agent quoted the
|
|
9
|
-
* wrong price again 97 seconds later
|
|
10
|
-
*
|
|
10
|
+
* wrong price again 97 seconds later; the same day it carded a driver on a
|
|
11
|
+
* specialist bot, and his reply twelve minutes later reached a session that had
|
|
12
|
+
* never seen the question.
|
|
11
13
|
*
|
|
12
14
|
* WHY IT IS A THIN CLIENT. Every decision belongs to the platform, not here. The
|
|
13
15
|
* bot registry, whether the agent is active, whether the chat is a business
|
|
@@ -31,7 +33,7 @@ export async function telegramInstruct(p, deps) {
|
|
|
31
33
|
deps.log(`${TAG} op=call tool=${TOOL} accepted=no reason=blank-instruction`);
|
|
32
34
|
return {
|
|
33
35
|
isError: true,
|
|
34
|
-
text: "An instruction cannot be blank. Say what the agent should do or tell the
|
|
36
|
+
text: "An instruction cannot be blank. Say what the agent should do or tell the person.",
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
39
|
if (!deps.port) {
|
|
@@ -39,7 +41,7 @@ export async function telegramInstruct(p, deps) {
|
|
|
39
41
|
return {
|
|
40
42
|
isError: true,
|
|
41
43
|
text: "telegram-instruct cannot reach this install's own server: no platform port is set for " +
|
|
42
|
-
"this session. Instructing
|
|
44
|
+
"this session. Instructing an agent needs the running server, so nothing was sent.",
|
|
43
45
|
};
|
|
44
46
|
}
|
|
45
47
|
let res;
|
|
@@ -77,15 +79,15 @@ export async function telegramInstruct(p, deps) {
|
|
|
77
79
|
? `The server refused the instruction: ${body.error}.`
|
|
78
80
|
: `The server refused the instruction (status ${res.status}).`;
|
|
79
81
|
deps.log(`${TAG} op=call tool=${TOOL} accepted=no reason=${typeof body.error === "string" && body.error.length > 0 ? body.error : `status-${res.status}`}`);
|
|
80
|
-
return { isError: true, text: `${detail} Nothing was sent
|
|
82
|
+
return { isError: true, text: `${detail} Nothing was sent.` };
|
|
81
83
|
}
|
|
82
84
|
const sessionId = typeof body.sessionId === "string" ? body.sessionId : "unknown";
|
|
83
85
|
deps.log(`${TAG} op=call tool=${TOOL} accepted=yes sessionId=${sessionId}`);
|
|
84
86
|
return {
|
|
85
|
-
text: `The instruction is running inside that
|
|
86
|
-
`(session ${sessionId}). The agent writes the message
|
|
87
|
-
`
|
|
88
|
-
`
|
|
87
|
+
text: `The instruction is running inside that conversation with the agent ` +
|
|
88
|
+
`(session ${sessionId}). The agent writes the message itself, in its own words, and its ` +
|
|
89
|
+
`context now holds what it said, so it will not contradict this on the next message. ` +
|
|
90
|
+
`Nothing further is needed from you.`,
|
|
89
91
|
};
|
|
90
92
|
}
|
|
91
93
|
//# sourceMappingURL=instruct.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instruct.js","sourceRoot":"","sources":["../../src/tools/instruct.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"instruct.js","sourceRoot":"","sources":["../../src/tools/instruct.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,MAAM,GAAG,GAAG,qBAAqB,CAAC;AAClC,MAAM,IAAI,GAAG,mBAAmB,CAAC;AAwCjC,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,CAAiB,EACjB,IAAkB;IAElB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G,iBAAiB,IAAI,2BAA2B,SAAS,EAAE,CAAC,CAAC;IAC5E,OAAO;QACL,IAAI,EACF,qEAAqE;YACrE,YAAY,SAAS,oEAAoE;YACzF,sFAAsF;YACtF,qCAAqC;KACxC,CAAC;AACJ,CAAC"}
|
package/payload/server/server.js
CHANGED
|
@@ -6248,6 +6248,82 @@ function parseTelegramChannelKey(key2) {
|
|
|
6248
6248
|
return { botId, senderId: rest, business: false };
|
|
6249
6249
|
}
|
|
6250
6250
|
|
|
6251
|
+
// app/lib/telegram/access-control.ts
|
|
6252
|
+
function checkTelegramAccess(params) {
|
|
6253
|
+
const { senderId, entry: entry3, chatId, chatType } = params;
|
|
6254
|
+
const isGroup = chatType === "group" || chatType === "supergroup";
|
|
6255
|
+
const isChannel = chatType === "channel";
|
|
6256
|
+
if (isChannel && entry3.role !== "public") {
|
|
6257
|
+
return {
|
|
6258
|
+
allowed: false,
|
|
6259
|
+
reason: entry3.role === "admin" ? "admin-entry-no-channels" : entry3.role === "specialist" ? "specialist-entry-no-channels" : "unbound-entry-no-channels",
|
|
6260
|
+
agentType: entry3.role === "admin" ? "admin" : entry3.role === "specialist" ? "specialist" : "public"
|
|
6261
|
+
};
|
|
6262
|
+
}
|
|
6263
|
+
if (isGroup && entry3.role !== "public") {
|
|
6264
|
+
return {
|
|
6265
|
+
allowed: false,
|
|
6266
|
+
reason: entry3.role === "admin" ? "admin-entry-no-groups" : entry3.role === "specialist" ? "specialist-entry-no-groups" : "unbound-entry-no-groups",
|
|
6267
|
+
agentType: entry3.role === "admin" ? "admin" : entry3.role === "specialist" ? "specialist" : "public"
|
|
6268
|
+
};
|
|
6269
|
+
}
|
|
6270
|
+
if (entry3.role === "admin") {
|
|
6271
|
+
const adminUsers = entry3.adminUsers ?? [];
|
|
6272
|
+
if (adminUsers.includes(senderId)) {
|
|
6273
|
+
return { allowed: true, reason: "admin-binding", agentType: "admin" };
|
|
6274
|
+
}
|
|
6275
|
+
return { allowed: false, reason: "not-admin-user", agentType: "admin" };
|
|
6276
|
+
}
|
|
6277
|
+
if (isGroup && entry3.role === "public") {
|
|
6278
|
+
const groupPolicy = entry3.groupPolicy ?? "disabled";
|
|
6279
|
+
if (groupPolicy === "allowlist") {
|
|
6280
|
+
const allowGroups = entry3.allowGroups ?? [];
|
|
6281
|
+
if (allowGroups.includes(chatId)) {
|
|
6282
|
+
return { allowed: true, reason: "group-allowlist-match", agentType: "public" };
|
|
6283
|
+
}
|
|
6284
|
+
return { allowed: false, reason: "not-in-allowGroups", agentType: "public" };
|
|
6285
|
+
}
|
|
6286
|
+
return { allowed: false, reason: "group-policy-disabled", agentType: "public" };
|
|
6287
|
+
}
|
|
6288
|
+
if (isChannel && entry3.role === "public") {
|
|
6289
|
+
const channelPolicy = entry3.channelPolicy ?? "disabled";
|
|
6290
|
+
if (channelPolicy === "allowlist") {
|
|
6291
|
+
const allowChannels = entry3.allowChannels ?? [];
|
|
6292
|
+
if (allowChannels.includes(chatId)) {
|
|
6293
|
+
return { allowed: true, reason: "channel-allowlist-match", agentType: "public" };
|
|
6294
|
+
}
|
|
6295
|
+
return { allowed: false, reason: "not-in-allowChannels", agentType: "public" };
|
|
6296
|
+
}
|
|
6297
|
+
return { allowed: false, reason: "channel-policy-disabled", agentType: "public" };
|
|
6298
|
+
}
|
|
6299
|
+
if (entry3.role === "unbound") {
|
|
6300
|
+
return { allowed: false, reason: "bot-unbound", agentType: "public" };
|
|
6301
|
+
}
|
|
6302
|
+
if (entry3.role === "specialist") {
|
|
6303
|
+
const allowFrom = entry3.allowFrom ?? [];
|
|
6304
|
+
if (allowFrom.includes(senderId)) {
|
|
6305
|
+
return { allowed: true, reason: "specialist-allowlist-match", agentType: "specialist" };
|
|
6306
|
+
}
|
|
6307
|
+
return { allowed: false, reason: "not-in-allowlist", agentType: "specialist" };
|
|
6308
|
+
}
|
|
6309
|
+
const policy = entry3.dmPolicy ?? "disabled";
|
|
6310
|
+
switch (policy) {
|
|
6311
|
+
case "open":
|
|
6312
|
+
return { allowed: true, reason: "dm-policy-open", agentType: "public" };
|
|
6313
|
+
case "allowlist": {
|
|
6314
|
+
const allowFrom = entry3.allowFrom ?? [];
|
|
6315
|
+
if (allowFrom.includes(senderId)) {
|
|
6316
|
+
return { allowed: true, reason: "allowlist-match", agentType: "public" };
|
|
6317
|
+
}
|
|
6318
|
+
return { allowed: false, reason: "not-in-allowlist", agentType: "public" };
|
|
6319
|
+
}
|
|
6320
|
+
case "disabled":
|
|
6321
|
+
return { allowed: false, reason: "dm-policy-disabled", agentType: "public" };
|
|
6322
|
+
default:
|
|
6323
|
+
return { allowed: false, reason: "unknown-dm-policy", agentType: "public" };
|
|
6324
|
+
}
|
|
6325
|
+
}
|
|
6326
|
+
|
|
6251
6327
|
// app/lib/telegram/chat-send-policy.ts
|
|
6252
6328
|
var BROADCAST_PREFIX = "-100";
|
|
6253
6329
|
function checkTelegramChatSend(params) {
|
|
@@ -6263,6 +6339,21 @@ function chatSendAllowlists(entry3) {
|
|
|
6263
6339
|
if (!entry3 || entry3.role !== "public") return { allowChannels: [], allowGroups: [] };
|
|
6264
6340
|
return { allowChannels: entry3.allowChannels ?? [], allowGroups: entry3.allowGroups ?? [] };
|
|
6265
6341
|
}
|
|
6342
|
+
function checkTelegramOutboundTarget(params) {
|
|
6343
|
+
const { chatId, entry: entry3 } = params;
|
|
6344
|
+
if (String(chatId).startsWith(BROADCAST_PREFIX)) {
|
|
6345
|
+
const lists = chatSendAllowlists(entry3);
|
|
6346
|
+
const verdict2 = checkTelegramChatSend({
|
|
6347
|
+
chatId,
|
|
6348
|
+
allowChannels: lists.allowChannels,
|
|
6349
|
+
allowGroups: lists.allowGroups
|
|
6350
|
+
});
|
|
6351
|
+
return { allowed: verdict2.allowed, reason: verdict2.reason, kind: "broadcast" };
|
|
6352
|
+
}
|
|
6353
|
+
const kind = chatId < 0 ? "group" : "private";
|
|
6354
|
+
const verdict = checkTelegramAccess({ senderId: chatId, entry: entry3, chatId, chatType: kind });
|
|
6355
|
+
return { allowed: verdict.allowed, reason: verdict.reason, kind };
|
|
6356
|
+
}
|
|
6266
6357
|
|
|
6267
6358
|
// app/lib/channel-pty-bridge/admin-session-id.ts
|
|
6268
6359
|
import { createHash } from "crypto";
|
|
@@ -7732,13 +7823,24 @@ function createOperatorInjectRoutes(deps) {
|
|
|
7732
7823
|
const { accountId, accountDir, entry: entry3 } = resolved;
|
|
7733
7824
|
const role = entry3.role;
|
|
7734
7825
|
const agent = agentOf(entry3);
|
|
7735
|
-
if (role
|
|
7736
|
-
report({ botId, chatId, sessionId: "none", role, agent, accepted: false, reason: "
|
|
7826
|
+
if (role === "admin") {
|
|
7827
|
+
report({ botId, chatId, sessionId: "none", role, agent, accepted: false, reason: "admin-bot" });
|
|
7737
7828
|
return c.json(
|
|
7738
7829
|
{
|
|
7739
7830
|
ok: false,
|
|
7740
|
-
error: "
|
|
7741
|
-
detail: `Bot ${botId} is
|
|
7831
|
+
error: "admin-bot",
|
|
7832
|
+
detail: `Bot ${botId} is this account's admin bot. Its chat is your own conversation with the agent, so there is nothing to instruct.`
|
|
7833
|
+
},
|
|
7834
|
+
403
|
|
7835
|
+
);
|
|
7836
|
+
}
|
|
7837
|
+
if (role === "unbound") {
|
|
7838
|
+
report({ botId, chatId, sessionId: "none", role, agent, accepted: false, reason: "unbound-bot" });
|
|
7839
|
+
return c.json(
|
|
7840
|
+
{
|
|
7841
|
+
ok: false,
|
|
7842
|
+
error: "unbound-bot",
|
|
7843
|
+
detail: `Bot ${botId} is not bound to an agent or a specialist card, so it answers nobody. Bind it before instructing it.`
|
|
7742
7844
|
},
|
|
7743
7845
|
403
|
|
7744
7846
|
);
|
|
@@ -7771,30 +7873,18 @@ function createOperatorInjectRoutes(deps) {
|
|
|
7771
7873
|
403
|
|
7772
7874
|
);
|
|
7773
7875
|
}
|
|
7774
|
-
const
|
|
7775
|
-
const verdict = checkTelegramChatSend({
|
|
7776
|
-
chatId: Number(chatId),
|
|
7777
|
-
allowChannels: lists.allowChannels,
|
|
7778
|
-
allowGroups: lists.allowGroups
|
|
7779
|
-
});
|
|
7876
|
+
const verdict = checkTelegramOutboundTarget({ chatId: Number(chatId), entry: entry3 });
|
|
7780
7877
|
console.error(
|
|
7781
7878
|
`[telegram-outbound] op=channel-send botId=${logValue2(botId)} chatId=${logValue2(chatId)} allowed=${verdict.allowed ? "yes" : "no"} reason=${verdict.reason} messageId=none`
|
|
7782
7879
|
);
|
|
7783
7880
|
if (!verdict.allowed) {
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
chatId,
|
|
7787
|
-
sessionId: "none",
|
|
7788
|
-
role,
|
|
7789
|
-
agent,
|
|
7790
|
-
accepted: false,
|
|
7791
|
-
reason: "chat-not-allowlisted"
|
|
7792
|
-
});
|
|
7881
|
+
const outcome = verdict.kind === "broadcast" ? "chat-not-allowlisted" : "chat-not-permitted";
|
|
7882
|
+
report({ botId, chatId, sessionId: "none", role, agent, accepted: false, reason: outcome });
|
|
7793
7883
|
return c.json(
|
|
7794
7884
|
{
|
|
7795
7885
|
ok: false,
|
|
7796
|
-
error:
|
|
7797
|
-
detail: `Chat ${chatId} is a broadcast channel that bot ${botId} does not allowlist, so nothing was sent.`
|
|
7886
|
+
error: outcome,
|
|
7887
|
+
detail: verdict.kind === "broadcast" ? `Chat ${chatId} is a broadcast channel that bot ${botId} does not allowlist, so nothing was sent.` : `Bot ${botId} may not talk to chat ${chatId} (${verdict.reason}), so nothing was sent. It would refuse that chat's own messages too.`
|
|
7798
7888
|
},
|
|
7799
7889
|
403
|
|
7800
7890
|
);
|
|
@@ -7823,13 +7913,22 @@ function createOperatorInjectRoutes(deps) {
|
|
|
7823
7913
|
accountDir,
|
|
7824
7914
|
botId,
|
|
7825
7915
|
botToken: entry3.token,
|
|
7826
|
-
|
|
7916
|
+
// Task 2773 — `entryAgentSlug`, not `entry.agent`: a specialist entry
|
|
7917
|
+
// carries a card name and no `agent` field at all, so the property read
|
|
7918
|
+
// is `undefined` there. The webhook resolves the same way
|
|
7919
|
+
// (`routes/telegram.ts`), so both doors name the spawn's agent from one
|
|
7920
|
+
// definition.
|
|
7921
|
+
agentSlug: entryAgentSlug(entry3),
|
|
7827
7922
|
senderId: chatId,
|
|
7828
7923
|
conversationSubject: chatId,
|
|
7829
7924
|
businessChatId: null,
|
|
7830
|
-
role
|
|
7925
|
+
// Task 2773 — the entry's OWN role, replacing a hardcoded 'public'. This
|
|
7926
|
+
// picks the session derivation in `sessionIdFor` and the framing in the
|
|
7927
|
+
// channel server; a value disagreeing with the registry would land the
|
|
7928
|
+
// instruction in a session the counterparty's real messages never reach.
|
|
7929
|
+
role,
|
|
7831
7930
|
personId: null,
|
|
7832
|
-
specialist: null,
|
|
7931
|
+
specialist: entry3.role === "specialist" ? entry3.specialist : null,
|
|
7833
7932
|
chatId,
|
|
7834
7933
|
text: instruction,
|
|
7835
7934
|
// An instruction carries no file by construction: there is no message to
|
|
@@ -15516,11 +15615,19 @@ async function recordManualSendContext(input, deps) {
|
|
|
15516
15615
|
mechanism,
|
|
15517
15616
|
reason
|
|
15518
15617
|
});
|
|
15519
|
-
if (input.entry.role
|
|
15618
|
+
if (input.entry.role === "admin") return refuse2("admin-bot");
|
|
15619
|
+
if (input.entry.role === "unbound") return refuse2("unbound-bot");
|
|
15520
15620
|
const businessKey = telegramBusinessChannelKey(input.botId, String(input.chatId));
|
|
15521
15621
|
if (deps.newestInboundTelegramDate(input.accountId, businessKey) !== null) {
|
|
15522
15622
|
return refuse2("business-chat");
|
|
15523
15623
|
}
|
|
15624
|
+
const target = checkTelegramOutboundTarget({ chatId: input.chatId, entry: input.entry });
|
|
15625
|
+
if (!target.allowed) {
|
|
15626
|
+
deps.log(
|
|
15627
|
+
`[telegram-manual-send] op=target-refused botId=${input.botId} chatId=${input.chatId} kind=${target.kind} reason=${target.reason}`
|
|
15628
|
+
);
|
|
15629
|
+
return refuse2("chat-not-permitted");
|
|
15630
|
+
}
|
|
15524
15631
|
const projectDir = deps.findSessionProjectDir(input.sessionId);
|
|
15525
15632
|
if (projectDir === null) return refuse2("no-transcript");
|
|
15526
15633
|
const live = deps.isLive(input.channelKey);
|
|
@@ -15541,16 +15648,22 @@ async function recordManualSendContext(input, deps) {
|
|
|
15541
15648
|
accountDir: input.accountDir,
|
|
15542
15649
|
botId: input.botId,
|
|
15543
15650
|
botToken: input.entry.token,
|
|
15544
|
-
|
|
15651
|
+
// Task 2773 — `entryAgentSlug`, not `entry.agent`: a specialist entry has
|
|
15652
|
+
// no `agent` field, so the property read is `undefined` there.
|
|
15653
|
+
agentSlug: entryAgentSlug(input.entry),
|
|
15545
15654
|
senderId: input.senderId,
|
|
15546
15655
|
// The route admits only a private chat, where the conversation's subject IS
|
|
15547
15656
|
// the sender. Passed explicitly so the gateway's key and its session id are
|
|
15548
15657
|
// derived from the same value the store row already carries.
|
|
15549
15658
|
conversationSubject: input.senderId,
|
|
15550
15659
|
businessChatId: null,
|
|
15551
|
-
role
|
|
15660
|
+
// Task 2773 — the entry's OWN role, replacing a hardcoded 'public'. It
|
|
15661
|
+
// picks the session derivation in `sessionIdFor`, which for a specialist is
|
|
15662
|
+
// `telegramAdminSessionId` — the same value the caller already derived for
|
|
15663
|
+
// `input.sessionId`.
|
|
15664
|
+
role: input.entry.role,
|
|
15552
15665
|
personId: null,
|
|
15553
|
-
specialist: null,
|
|
15666
|
+
specialist: input.entry.role === "specialist" ? input.entry.specialist : null,
|
|
15554
15667
|
chatId: String(input.chatId),
|
|
15555
15668
|
text: input.text,
|
|
15556
15669
|
// No file by construction: this is text the operator typed into the send
|
|
@@ -18842,82 +18955,6 @@ async function setManagedBotAccessSettings(managingBotToken, userId, isAccessRes
|
|
|
18842
18955
|
return r.ok ? { ok: true } : { ok: false, error: r.error };
|
|
18843
18956
|
}
|
|
18844
18957
|
|
|
18845
|
-
// app/lib/telegram/access-control.ts
|
|
18846
|
-
function checkTelegramAccess(params) {
|
|
18847
|
-
const { senderId, entry: entry3, chatId, chatType } = params;
|
|
18848
|
-
const isGroup = chatType === "group" || chatType === "supergroup";
|
|
18849
|
-
const isChannel = chatType === "channel";
|
|
18850
|
-
if (isChannel && entry3.role !== "public") {
|
|
18851
|
-
return {
|
|
18852
|
-
allowed: false,
|
|
18853
|
-
reason: entry3.role === "admin" ? "admin-entry-no-channels" : entry3.role === "specialist" ? "specialist-entry-no-channels" : "unbound-entry-no-channels",
|
|
18854
|
-
agentType: entry3.role === "admin" ? "admin" : entry3.role === "specialist" ? "specialist" : "public"
|
|
18855
|
-
};
|
|
18856
|
-
}
|
|
18857
|
-
if (isGroup && entry3.role !== "public") {
|
|
18858
|
-
return {
|
|
18859
|
-
allowed: false,
|
|
18860
|
-
reason: entry3.role === "admin" ? "admin-entry-no-groups" : entry3.role === "specialist" ? "specialist-entry-no-groups" : "unbound-entry-no-groups",
|
|
18861
|
-
agentType: entry3.role === "admin" ? "admin" : entry3.role === "specialist" ? "specialist" : "public"
|
|
18862
|
-
};
|
|
18863
|
-
}
|
|
18864
|
-
if (entry3.role === "admin") {
|
|
18865
|
-
const adminUsers = entry3.adminUsers ?? [];
|
|
18866
|
-
if (adminUsers.includes(senderId)) {
|
|
18867
|
-
return { allowed: true, reason: "admin-binding", agentType: "admin" };
|
|
18868
|
-
}
|
|
18869
|
-
return { allowed: false, reason: "not-admin-user", agentType: "admin" };
|
|
18870
|
-
}
|
|
18871
|
-
if (isGroup && entry3.role === "public") {
|
|
18872
|
-
const groupPolicy = entry3.groupPolicy ?? "disabled";
|
|
18873
|
-
if (groupPolicy === "allowlist") {
|
|
18874
|
-
const allowGroups = entry3.allowGroups ?? [];
|
|
18875
|
-
if (allowGroups.includes(chatId)) {
|
|
18876
|
-
return { allowed: true, reason: "group-allowlist-match", agentType: "public" };
|
|
18877
|
-
}
|
|
18878
|
-
return { allowed: false, reason: "not-in-allowGroups", agentType: "public" };
|
|
18879
|
-
}
|
|
18880
|
-
return { allowed: false, reason: "group-policy-disabled", agentType: "public" };
|
|
18881
|
-
}
|
|
18882
|
-
if (isChannel && entry3.role === "public") {
|
|
18883
|
-
const channelPolicy = entry3.channelPolicy ?? "disabled";
|
|
18884
|
-
if (channelPolicy === "allowlist") {
|
|
18885
|
-
const allowChannels = entry3.allowChannels ?? [];
|
|
18886
|
-
if (allowChannels.includes(chatId)) {
|
|
18887
|
-
return { allowed: true, reason: "channel-allowlist-match", agentType: "public" };
|
|
18888
|
-
}
|
|
18889
|
-
return { allowed: false, reason: "not-in-allowChannels", agentType: "public" };
|
|
18890
|
-
}
|
|
18891
|
-
return { allowed: false, reason: "channel-policy-disabled", agentType: "public" };
|
|
18892
|
-
}
|
|
18893
|
-
if (entry3.role === "unbound") {
|
|
18894
|
-
return { allowed: false, reason: "bot-unbound", agentType: "public" };
|
|
18895
|
-
}
|
|
18896
|
-
if (entry3.role === "specialist") {
|
|
18897
|
-
const allowFrom = entry3.allowFrom ?? [];
|
|
18898
|
-
if (allowFrom.includes(senderId)) {
|
|
18899
|
-
return { allowed: true, reason: "specialist-allowlist-match", agentType: "specialist" };
|
|
18900
|
-
}
|
|
18901
|
-
return { allowed: false, reason: "not-in-allowlist", agentType: "specialist" };
|
|
18902
|
-
}
|
|
18903
|
-
const policy = entry3.dmPolicy ?? "disabled";
|
|
18904
|
-
switch (policy) {
|
|
18905
|
-
case "open":
|
|
18906
|
-
return { allowed: true, reason: "dm-policy-open", agentType: "public" };
|
|
18907
|
-
case "allowlist": {
|
|
18908
|
-
const allowFrom = entry3.allowFrom ?? [];
|
|
18909
|
-
if (allowFrom.includes(senderId)) {
|
|
18910
|
-
return { allowed: true, reason: "allowlist-match", agentType: "public" };
|
|
18911
|
-
}
|
|
18912
|
-
return { allowed: false, reason: "not-in-allowlist", agentType: "public" };
|
|
18913
|
-
}
|
|
18914
|
-
case "disabled":
|
|
18915
|
-
return { allowed: false, reason: "dm-policy-disabled", agentType: "public" };
|
|
18916
|
-
default:
|
|
18917
|
-
return { allowed: false, reason: "unknown-dm-policy", agentType: "public" };
|
|
18918
|
-
}
|
|
18919
|
-
}
|
|
18920
|
-
|
|
18921
18958
|
// app/lib/telegram/managed-bot.ts
|
|
18922
18959
|
function parseManagedBotUpdate(u) {
|
|
18923
18960
|
const id = u?.bot?.id;
|