instar 1.3.598 → 1.3.599

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 (37) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +30 -0
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/core/MachinePoolRegistry.d.ts +4 -0
  5. package/dist/core/MachinePoolRegistry.d.ts.map +1 -1
  6. package/dist/core/MachinePoolRegistry.js +1 -0
  7. package/dist/core/MachinePoolRegistry.js.map +1 -1
  8. package/dist/core/PeerPresencePuller.d.ts +4 -1
  9. package/dist/core/PeerPresencePuller.d.ts.map +1 -1
  10. package/dist/core/PeerPresencePuller.js +3 -1
  11. package/dist/core/PeerPresencePuller.js.map +1 -1
  12. package/dist/core/PlacementExecutor.d.ts +8 -0
  13. package/dist/core/PlacementExecutor.d.ts.map +1 -1
  14. package/dist/core/PlacementExecutor.js +29 -0
  15. package/dist/core/PlacementExecutor.js.map +1 -1
  16. package/dist/core/RebalancePlanner.d.ts.map +1 -1
  17. package/dist/core/RebalancePlanner.js +6 -0
  18. package/dist/core/RebalancePlanner.js.map +1 -1
  19. package/dist/core/SessionRouter.d.ts +8 -0
  20. package/dist/core/SessionRouter.d.ts.map +1 -1
  21. package/dist/core/SessionRouter.js +4 -0
  22. package/dist/core/SessionRouter.js.map +1 -1
  23. package/dist/core/machineServesChannel.d.ts +42 -0
  24. package/dist/core/machineServesChannel.d.ts.map +1 -0
  25. package/dist/core/machineServesChannel.js +48 -0
  26. package/dist/core/machineServesChannel.js.map +1 -0
  27. package/dist/core/types.d.ts +7 -0
  28. package/dist/core/types.d.ts.map +1 -1
  29. package/dist/core/types.js.map +1 -1
  30. package/dist/messaging/slack/SlackAdapter.d.ts +6 -0
  31. package/dist/messaging/slack/SlackAdapter.d.ts.map +1 -1
  32. package/dist/messaging/slack/SlackAdapter.js +12 -0
  33. package/dist/messaging/slack/SlackAdapter.js.map +1 -1
  34. package/package.json +1 -1
  35. package/src/data/builtin-manifest.json +2 -2
  36. package/upgrades/1.3.599.md +21 -0
  37. package/upgrades/side-effects/placement-platform-workspace-aware.md +43 -0
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmCH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAwBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAkH7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAsBtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,OAAO,CAUT;AAyID,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAg4CD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,EACzB,cAAc,EAAE,cAAc,EAC9B,YAAY,CAAC,EAAE,YAAY,EAC3B,WAAW,CAAC,EAAE,WAAW,EACzB,WAAW,CAAC,EAAE,WAAW,EACzB,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAGvE,UAAU,CAAC,EAAE,MAAM,OAAO,8BAA8B,EAAE,WAAW,GAAG,IAAI,EAK5E,qBAAqB,CAAC,EAAE,MAAM,OAAO,gCAAgC,EAAE,kBAAkB,GAAG,IAAI,EAKhG,mBAAmB,CAAC,EAA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AAE,WAAW,EACzB,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAGvE,UAAU,CAAC,EAAE,MAAM,OAAO,8BAA8B,EAAE,WAAW,GAAG,IAAI,EAK5E,qBAAqB,CAAC,EAAE,MAAM,OAAO,gCAAgC,EAAE,kBAAkB,GAAG,IAAI,EAKhG,mBAAmB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,GACpD,IAAI,CA8eN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAsrdtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
@@ -5947,6 +5947,10 @@ export async function startServer(options) {
5947
5947
  userId: message.metadata?.slackUserId || undefined,
5948
5948
  firstName: message.metadata?.senderName || undefined,
5949
5949
  },
5950
+ // Thread the Slack channel scope so placement never owns this channel on a
5951
+ // machine not connected to its workspace (the live-test bug, a failover placement).
5952
+ // workspaceId from the live adapter; channelId is the raw Slack channel.
5953
+ channel: { platform: 'slack', workspaceId: _slackAdapter?.getWorkspaceId(), channelId },
5950
5954
  });
5951
5955
  console.log(`[session-pool] slack route key=${routingKey} → action=${outcome.action} owner=${outcome.owner ?? '?'} self=${_meshSelfId ?? '?'} acked=${outcome.acked}`);
5952
5956
  if (isRemotelyHandled(outcome, _meshSelfId)) {
@@ -13689,6 +13693,31 @@ export async function startServer(options) {
13689
13693
  return undefined; /* unknown ≠ blocked */
13690
13694
  }
13691
13695
  };
13696
+ // Platform/workspace reachability block riding the capacity heartbeat
13697
+ // (spec: placement-platform-workspace-aware). ADAPTER-DERIVED: a slack
13698
+ // workspaceId is reported ONLY while the Socket-Mode adapter is genuinely
13699
+ // connected (cleared on disconnect — recomputed each beat). Telegram is a
13700
+ // SHARED chat (every machine reports the same chatId → placement no-op), so
13701
+ // it's included when its chatId is a concrete value; the FILTER's value is the
13702
+ // slack per-workspace case. Absent block (this returns undefined) = older peer
13703
+ // = placement treats as `unknown`/fail-open.
13704
+ const selfServesChannels = () => {
13705
+ // No try/catch (avoids a silent-fallback catch): these reads don't throw on normal
13706
+ // input, and a wrong-shaped value is guarded inline (typeof / optional chaining), so an
13707
+ // unresolvable field simply omits its block → placement treats it as unknown/fail-open.
13708
+ const out = {};
13709
+ const tg = config.messaging.find((m) => m.type === 'telegram' && m.enabled);
13710
+ const rawChatId = tg ? tg.config.chatId : undefined;
13711
+ if (typeof rawChatId === 'string' || typeof rawChatId === 'number') {
13712
+ out.telegram = { chatIds: [String(rawChatId)] };
13713
+ }
13714
+ if (_slackAdapter && _slackAdapter.isConnected()) {
13715
+ const ws = _slackAdapter.getWorkspaceId();
13716
+ if (ws)
13717
+ out.slack = { workspaceIds: [ws] };
13718
+ }
13719
+ return (out.telegram || out.slack) ? out : undefined;
13720
+ };
13692
13721
  // Self guard-posture block riding the capacity heartbeat (spec §2.3).
13693
13722
  // Computed per beat from the same one-read snapshot GET /guards uses;
13694
13723
  // a failed compute omits the block (older-peer semantics), never throws.
@@ -13737,6 +13766,7 @@ export async function startServer(options) {
13737
13766
  selfReportedLastSeen: new Date().toISOString(),
13738
13767
  loadAvg: osMod.loadavg()[0],
13739
13768
  quotaState: selfQuotaState(),
13769
+ servesChannels: selfServesChannels(),
13740
13770
  guardPosture: selfGuardPosture(),
13741
13771
  // WS1.1 capability advertisement (spec invariant 5): a bounded
13742
13772
  // fixed-size summary, never an inventory. Reported live each