@rubytech/create-sitedesk-code 0.1.544 → 0.1.545
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/channel-instruction/SKILL.md +26 -12
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +3 -1
- package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +5 -0
- package/payload/platform/plugins/docs/references/channel-wake-and-prompt.md +2 -0
- package/payload/platform/plugins/scheduling/PLUGIN.md +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/availability-snapshot.test.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/availability-snapshot.test.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/availability-snapshot.test.js +80 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/availability-snapshot.test.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/publish-availability-logging.test.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/publish-availability-logging.test.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/publish-availability-logging.test.js +32 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/publish-availability-logging.test.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/availability-snapshot.d.ts +67 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/availability-snapshot.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/availability-snapshot.js +88 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/availability-snapshot.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.d.ts +2 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.js +59 -54
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.js.map +1 -1
- package/payload/platform/services/telegram-channel/dist/instructions.d.ts +1 -0
- package/payload/platform/services/telegram-channel/dist/instructions.d.ts.map +1 -1
- package/payload/platform/services/telegram-channel/dist/instructions.js +47 -0
- package/payload/platform/services/telegram-channel/dist/instructions.js.map +1 -1
- package/payload/platform/services/telegram-channel/dist/notification.d.ts +8 -14
- package/payload/platform/services/telegram-channel/dist/notification.d.ts.map +1 -1
- package/payload/platform/services/telegram-channel/dist/notification.js +13 -19
- package/payload/platform/services/telegram-channel/dist/notification.js.map +1 -1
- package/payload/platform/services/telegram-channel/dist/server.d.ts.map +1 -1
- package/payload/platform/services/telegram-channel/dist/server.js +3 -10
- package/payload/platform/services/telegram-channel/dist/server.js.map +1 -1
- package/payload/platform/services/webchat-channel/dist/instructions.d.ts +1 -0
- package/payload/platform/services/webchat-channel/dist/instructions.d.ts.map +1 -1
- package/payload/platform/services/webchat-channel/dist/instructions.js +60 -0
- package/payload/platform/services/webchat-channel/dist/instructions.js.map +1 -1
- package/payload/platform/services/webchat-channel/dist/notification.d.ts +9 -14
- package/payload/platform/services/webchat-channel/dist/notification.d.ts.map +1 -1
- package/payload/platform/services/webchat-channel/dist/notification.js +13 -19
- package/payload/platform/services/webchat-channel/dist/notification.js.map +1 -1
- package/payload/platform/services/webchat-channel/dist/server.d.ts.map +1 -1
- package/payload/platform/services/webchat-channel/dist/server.js +5 -10
- package/payload/platform/services/webchat-channel/dist/server.js.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/notification.d.ts +60 -7
- package/payload/platform/services/whatsapp-channel/dist/notification.d.ts.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/notification.js +144 -17
- package/payload/platform/services/whatsapp-channel/dist/notification.js.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/server.d.ts.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/server.js +14 -6
- package/payload/platform/services/whatsapp-channel/dist/server.js.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/targets.d.ts +12 -2
- package/payload/platform/services/whatsapp-channel/dist/targets.d.ts.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/targets.js +13 -2
- package/payload/platform/services/whatsapp-channel/dist/targets.js.map +1 -1
- package/payload/server/server.js +16 -43
package/payload/server/server.js
CHANGED
|
@@ -29312,8 +29312,9 @@ var WaGateway = class {
|
|
|
29312
29312
|
console.error(
|
|
29313
29313
|
`[whatsapp-native] op=doc-context senderId=${senderId} accountId=${input.accountId} maxyAccountId=${input.effectiveAccountId}`
|
|
29314
29314
|
);
|
|
29315
|
+
const isRelay = input.source === "public-relay";
|
|
29315
29316
|
let standingRules;
|
|
29316
|
-
if (this.deps.fetchStandingRules) {
|
|
29317
|
+
if (this.deps.fetchStandingRules && !isRelay) {
|
|
29317
29318
|
const res = await this.deps.fetchStandingRules(input.effectiveAccountId);
|
|
29318
29319
|
standingRules = res.block || void 0;
|
|
29319
29320
|
const injected = res.block ? (res.block.match(/^- /gm) ?? []).length : 0;
|
|
@@ -29322,12 +29323,14 @@ var WaGateway = class {
|
|
|
29322
29323
|
`[preference-inject] op=inject channel=wa accountId=${input.effectiveAccountId} injected=${injected} owner=${owner8} source=${res.source}`
|
|
29323
29324
|
);
|
|
29324
29325
|
}
|
|
29326
|
+
const instructionKind = input.role === "public" || isRelay ? "account" : "platform";
|
|
29325
29327
|
const agentDir = input.role === "public" ? input.publicAgentSlug : "admin";
|
|
29326
|
-
const instruction = await this.deps.fetchTurnInstruction(input.effectiveAccountId, agentDir);
|
|
29328
|
+
const instruction = instructionKind === "account" ? await this.deps.fetchTurnInstruction(input.effectiveAccountId, agentDir) : null;
|
|
29329
|
+
const turnLabel = input.role === "public" ? "public" : isRelay ? "relay" : "direct";
|
|
29327
29330
|
console.error(
|
|
29328
|
-
`[whatsapp-native] op=instruction-source accountId=${input.effectiveAccountId} agentDir=${agentDir ?? "none"} source=${instruction.source} bytes=${instruction.bytes}`
|
|
29331
|
+
`[whatsapp-native] op=instruction-source accountId=${input.effectiveAccountId} agentDir=${instruction ? agentDir ?? "none" : "-"} turn=${turnLabel} source=${instruction ? instruction.source : "platform"} bytes=${instruction ? instruction.bytes : 0}`
|
|
29329
29332
|
);
|
|
29330
|
-
if (instruction
|
|
29333
|
+
if (instruction?.source === "absent") {
|
|
29331
29334
|
console.error(
|
|
29332
29335
|
`[whatsapp-native] op=inbound senderId=${senderId} accountId=${input.accountId} effectiveAccountId=${input.effectiveAccountId} bytes=${bytes} ${mediaField} source=${source} delivery=refused sessionId=${this.sessionIdFor(input, senderId)}`
|
|
29333
29336
|
);
|
|
@@ -29345,7 +29348,8 @@ var WaGateway = class {
|
|
|
29345
29348
|
media: input.media,
|
|
29346
29349
|
source,
|
|
29347
29350
|
standingRules,
|
|
29348
|
-
|
|
29351
|
+
instructionKind,
|
|
29352
|
+
...instruction ? { turnInstruction: instruction.body } : {},
|
|
29349
29353
|
scheduleProvenance: input.scheduleProvenance,
|
|
29350
29354
|
// Task 1897 — the quoted message rides the SSE frame to the channel
|
|
29351
29355
|
// server, which renders it at the top of the reframed payload.
|
|
@@ -30400,27 +30404,12 @@ var WebchatGateway = class _WebchatGateway {
|
|
|
30400
30404
|
);
|
|
30401
30405
|
}
|
|
30402
30406
|
const messageId = `wc-${++this.seq}`;
|
|
30403
|
-
let turnInstruction;
|
|
30404
|
-
if (input.role === "admin") {
|
|
30405
|
-
const instruction = await this.deps.fetchTurnInstruction(input.accountId, "admin");
|
|
30406
|
-
console.error(
|
|
30407
|
-
`[webchat:inbound] op=instruction-source accountId=${input.accountId} channel=webchat source=${instruction.source} bytes=${instruction.bytes}`
|
|
30408
|
-
);
|
|
30409
|
-
if (instruction.source === "absent") {
|
|
30410
|
-
console.error(
|
|
30411
|
-
`[webchat:inbound] op=received key=${keyDisplay(input.key)} messageId=${messageId} role=${input.role} bytes=${bytes} delivery=refused`
|
|
30412
|
-
);
|
|
30413
|
-
return { spawn: null };
|
|
30414
|
-
}
|
|
30415
|
-
turnInstruction = instruction.body;
|
|
30416
|
-
}
|
|
30417
30407
|
this.hub.deliver(
|
|
30418
30408
|
{
|
|
30419
30409
|
key: input.key,
|
|
30420
30410
|
text: input.text,
|
|
30421
30411
|
messageId,
|
|
30422
30412
|
standingRules,
|
|
30423
|
-
...turnInstruction !== void 0 ? { turnInstruction } : {},
|
|
30424
30413
|
...input.replyContext ? { replyContext: input.replyContext } : {}
|
|
30425
30414
|
},
|
|
30426
30415
|
Date.now()
|
|
@@ -31322,22 +31311,8 @@ var TelegramGateway = class {
|
|
|
31322
31311
|
`[preference-inject] op=inject channel=tg accountId=${input.accountId} injected=${injected} owner=${owner8} source=${res.source}`
|
|
31323
31312
|
);
|
|
31324
31313
|
}
|
|
31325
|
-
let turnInstruction;
|
|
31326
|
-
if (input.role === "admin") {
|
|
31327
|
-
const instruction = await this.deps.fetchTurnInstruction(input.accountId, "admin");
|
|
31328
|
-
console.error(
|
|
31329
|
-
`[telegram-native] op=instruction-source accountId=${input.accountId} channel=telegram source=${instruction.source} bytes=${instruction.bytes}`
|
|
31330
|
-
);
|
|
31331
|
-
if (instruction.source === "absent") {
|
|
31332
|
-
console.error(
|
|
31333
|
-
`[telegram-native] op=inbound key=${input.senderId} accountId=${input.accountId} botType=${input.role} bytes=${bytes} source=${source} delivery=refused sessionId=${this.sessionIdFor(input)}`
|
|
31334
|
-
);
|
|
31335
|
-
return;
|
|
31336
|
-
}
|
|
31337
|
-
turnInstruction = instruction.body;
|
|
31338
|
-
}
|
|
31339
31314
|
this.hub.deliver(
|
|
31340
|
-
{ key: input.senderId, text: input.text, messageId: `tg-${++this.seq}`, source, standingRules,
|
|
31315
|
+
{ key: input.senderId, text: input.text, messageId: `tg-${++this.seq}`, source, standingRules, scheduleProvenance: input.scheduleProvenance },
|
|
31341
31316
|
Date.now()
|
|
31342
31317
|
);
|
|
31343
31318
|
const resolvedSessionId = this.sessionIdFor(input);
|
|
@@ -32498,10 +32473,9 @@ var webchatGateway = new WebchatGateway({
|
|
|
32498
32473
|
if (acct) notify("webchat-pointer", acct);
|
|
32499
32474
|
},
|
|
32500
32475
|
fetchStandingRules: fetchAccountStandingRules,
|
|
32501
|
-
// Task
|
|
32502
|
-
//
|
|
32503
|
-
//
|
|
32504
|
-
fetchTurnInstruction: async (accountId, agentDir) => resolveTurnInstruction(accountId, agentDir),
|
|
32476
|
+
// Task 2353 — no turn-instruction resolver on this door. See the dep comment
|
|
32477
|
+
// in webchat-gateway.ts: the account file governs the relay turn, which only
|
|
32478
|
+
// the WhatsApp door raises.
|
|
32505
32479
|
gatewayUrl: webchatGatewayUrl(),
|
|
32506
32480
|
serverPath: webchatServerPath(),
|
|
32507
32481
|
ensureChannelSession: async ({ accountId, key, role, adminUserId, gatewayUrl, serverPath, sessionId, public: pub }) => {
|
|
@@ -32602,10 +32576,9 @@ webchatGateway.startPublicReaper();
|
|
|
32602
32576
|
var telegramFileFollowers = /* @__PURE__ */ new Map();
|
|
32603
32577
|
var telegramGateway = new TelegramGateway({
|
|
32604
32578
|
fetchStandingRules: fetchAccountStandingRules,
|
|
32605
|
-
// Task
|
|
32606
|
-
//
|
|
32607
|
-
// WhatsApp
|
|
32608
|
-
fetchTurnInstruction: async (accountId, agentDir) => resolveTurnInstruction(accountId, agentDir),
|
|
32579
|
+
// Task 2353 — no turn-instruction resolver on this door. See the dep comment in
|
|
32580
|
+
// telegram-gateway.ts: the account file governs the relay turn, which only the
|
|
32581
|
+
// WhatsApp door raises.
|
|
32609
32582
|
resolveSessionOverride: (accountId, senderId) => resolveChannelOverride(accountId, "telegram", senderId),
|
|
32610
32583
|
gatewayUrl: telegramGatewayUrl(),
|
|
32611
32584
|
serverPath: telegramServerPath(),
|