@rubytech/create-maxy-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.
Files changed (56) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/plugins/admin/skills/channel-instruction/SKILL.md +26 -12
  3. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +3 -1
  4. package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +5 -0
  5. package/payload/platform/plugins/docs/references/channel-wake-and-prompt.md +2 -0
  6. package/payload/platform/plugins/scheduling/PLUGIN.md +1 -1
  7. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/availability-snapshot.test.d.ts +2 -0
  8. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/availability-snapshot.test.d.ts.map +1 -0
  9. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/availability-snapshot.test.js +80 -0
  10. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/availability-snapshot.test.js.map +1 -0
  11. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/publish-availability-logging.test.d.ts +2 -0
  12. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/publish-availability-logging.test.d.ts.map +1 -0
  13. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/publish-availability-logging.test.js +32 -0
  14. package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/publish-availability-logging.test.js.map +1 -0
  15. package/payload/platform/plugins/scheduling/mcp/dist/lib/availability-snapshot.d.ts +67 -0
  16. package/payload/platform/plugins/scheduling/mcp/dist/lib/availability-snapshot.d.ts.map +1 -0
  17. package/payload/platform/plugins/scheduling/mcp/dist/lib/availability-snapshot.js +88 -0
  18. package/payload/platform/plugins/scheduling/mcp/dist/lib/availability-snapshot.js.map +1 -0
  19. package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.d.ts +2 -1
  20. package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.d.ts.map +1 -1
  21. package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.js +59 -54
  22. package/payload/platform/plugins/scheduling/mcp/dist/scripts/publish-availability.js.map +1 -1
  23. package/payload/platform/services/telegram-channel/dist/instructions.d.ts +1 -0
  24. package/payload/platform/services/telegram-channel/dist/instructions.d.ts.map +1 -1
  25. package/payload/platform/services/telegram-channel/dist/instructions.js +47 -0
  26. package/payload/platform/services/telegram-channel/dist/instructions.js.map +1 -1
  27. package/payload/platform/services/telegram-channel/dist/notification.d.ts +8 -14
  28. package/payload/platform/services/telegram-channel/dist/notification.d.ts.map +1 -1
  29. package/payload/platform/services/telegram-channel/dist/notification.js +13 -19
  30. package/payload/platform/services/telegram-channel/dist/notification.js.map +1 -1
  31. package/payload/platform/services/telegram-channel/dist/server.d.ts.map +1 -1
  32. package/payload/platform/services/telegram-channel/dist/server.js +3 -10
  33. package/payload/platform/services/telegram-channel/dist/server.js.map +1 -1
  34. package/payload/platform/services/webchat-channel/dist/instructions.d.ts +1 -0
  35. package/payload/platform/services/webchat-channel/dist/instructions.d.ts.map +1 -1
  36. package/payload/platform/services/webchat-channel/dist/instructions.js +60 -0
  37. package/payload/platform/services/webchat-channel/dist/instructions.js.map +1 -1
  38. package/payload/platform/services/webchat-channel/dist/notification.d.ts +9 -14
  39. package/payload/platform/services/webchat-channel/dist/notification.d.ts.map +1 -1
  40. package/payload/platform/services/webchat-channel/dist/notification.js +13 -19
  41. package/payload/platform/services/webchat-channel/dist/notification.js.map +1 -1
  42. package/payload/platform/services/webchat-channel/dist/server.d.ts.map +1 -1
  43. package/payload/platform/services/webchat-channel/dist/server.js +5 -10
  44. package/payload/platform/services/webchat-channel/dist/server.js.map +1 -1
  45. package/payload/platform/services/whatsapp-channel/dist/notification.d.ts +60 -7
  46. package/payload/platform/services/whatsapp-channel/dist/notification.d.ts.map +1 -1
  47. package/payload/platform/services/whatsapp-channel/dist/notification.js +144 -17
  48. package/payload/platform/services/whatsapp-channel/dist/notification.js.map +1 -1
  49. package/payload/platform/services/whatsapp-channel/dist/server.d.ts.map +1 -1
  50. package/payload/platform/services/whatsapp-channel/dist/server.js +14 -6
  51. package/payload/platform/services/whatsapp-channel/dist/server.js.map +1 -1
  52. package/payload/platform/services/whatsapp-channel/dist/targets.d.ts +12 -2
  53. package/payload/platform/services/whatsapp-channel/dist/targets.d.ts.map +1 -1
  54. package/payload/platform/services/whatsapp-channel/dist/targets.js +13 -2
  55. package/payload/platform/services/whatsapp-channel/dist/targets.js.map +1 -1
  56. package/payload/server/server.js +16 -43
@@ -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.source === "absent") {
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
- turnInstruction: instruction.body,
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, turnInstruction, scheduleProvenance: input.scheduleProvenance },
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 2331the account's own `## Instruction` body, read from that
32502
- // account's admin agent files. Same resolver and same async wrapping as the
32503
- // WhatsApp gateway above; the resolver is synchronous on disk.
32504
- fetchTurnInstruction: async (accountId, agentDir) => resolveTurnInstruction(accountId, agentDir),
32476
+ // Task 2353no 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 2336the account's own `## Instruction` body, read from that
32606
- // account's admin agent files. Same resolver and same async wrapping as the
32607
- // WhatsApp and webchat gateways above; the resolver is synchronous on disk.
32608
- fetchTurnInstruction: async (accountId, agentDir) => resolveTurnInstruction(accountId, agentDir),
32579
+ // Task 2353no 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(),