@wrongstack/core 0.283.0 → 0.283.1

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.
@@ -607,7 +607,7 @@ declare function createHqPersistence(dataDir: string): HqPersistence;
607
607
  */
608
608
 
609
609
  /** HQ_COMMAND_TYPES — the full set of recognized command `type` strings. */
610
- declare const HQ_COMMAND_TYPES: readonly ["steer", "abort", "spawn", "broadcast", "run-command"];
610
+ declare const HQ_COMMAND_TYPES: readonly ["steer", "btw", "queue", "abort", "spawn", "broadcast", "run-command"];
611
611
  type HqCommandType = (typeof HQ_COMMAND_TYPES)[number];
612
612
  /** Inject a steer text into a target agent's conversation. */
613
613
  interface HqSteerCommand {
@@ -618,6 +618,32 @@ interface HqSteerCommand {
618
618
  body: string;
619
619
  priority?: 'low' | 'normal' | 'high';
620
620
  }
621
+ /**
622
+ * Post a non-urgent FYI (`btw`) into a target agent's mailbox. Unlike a steer,
623
+ * a btw is absorbed as context — it does not demand the agent change course.
624
+ * Same wire shape as steer; only the emitted mailbox `type` differs.
625
+ */
626
+ interface HqBtwCommand {
627
+ type: 'btw';
628
+ /** Target agent address: a unique id (`leader@<tag>`), an alias (`leader`), or `*` for all. */
629
+ to: string;
630
+ subject: string;
631
+ body: string;
632
+ priority?: 'low' | 'normal' | 'high';
633
+ }
634
+ /**
635
+ * Queue a prompt/note (`queue`) for a target agent. Delivered as a plain
636
+ * `note` mailbox message the agent picks up before its next step — used when
637
+ * the prompt should wait its turn rather than steer the current operation.
638
+ */
639
+ interface HqQueueCommand {
640
+ type: 'queue';
641
+ /** Target agent address: a unique id (`leader@<tag>`), an alias (`leader`), or `*` for all. */
642
+ to: string;
643
+ subject: string;
644
+ body: string;
645
+ priority?: 'low' | 'normal' | 'high';
646
+ }
621
647
  /** Abort a running agent run or fleet. */
622
648
  interface HqAbortCommand {
623
649
  type: 'abort';
@@ -646,7 +672,7 @@ interface HqRunCommandCommand {
646
672
  /** Optional working directory (defaults to the agent's project root). */
647
673
  cwd?: string;
648
674
  }
649
- type HqCommand = HqSteerCommand | HqAbortCommand | HqSpawnCommand | HqBroadcastCommand | HqRunCommandCommand;
675
+ type HqCommand = HqSteerCommand | HqBtwCommand | HqQueueCommand | HqAbortCommand | HqSpawnCommand | HqBroadcastCommand | HqRunCommandCommand;
650
676
  /**
651
677
  * Validate that an inbound `HqQueuedCommand` has a recognized `type` and a
652
678
  * minimally well-formed payload. Returns the narrowed command on success, or
@@ -787,4 +813,4 @@ declare function mergeToolResults(flat: readonly HqTranscriptEntry[]): HqTranscr
787
813
  */
788
814
  declare function buildTranscriptFromEvents(events: Iterable<Record<string, unknown>>): HqTranscriptEntry[];
789
815
 
790
- export { type AgentMonitorEventBridgeOptions, type BrainTelemetryBridgeOptions, type CostTelemetryBridgeOptions, type CreateGlobalMailboxOptions, type CreateHqPublisherOptions, type EnsureHqFirstRunAuthResult, type FleetTelemetryBridgeOptions, HQ_AUTH_FILE_VERSION, HQ_COMMAND_TYPES, type HqAbortCommand, type HqAgentEventPublisher, type HqAlert, HqAlertEngine, HqAlertMessage, type HqAlertRuleConfig, type HqAlertSeverity, type HqAuthFile, type HqBroadcastCommand, type HqBrowserToken, HqClientCapability, HqClientIdentity, type HqCommand, type HqCommandAuditEntry, HqCommandAuditLog, type HqCommandType, HqEventEnvelope, HqEventLog, type HqEventLogOptions, type HqPersistence, HqPublisher, HqPublisherCommandHandler, type HqPublisherEnvConfig, HqQueuedCommand, type HqRedactOptions, HqRedactionPolicy, type HqRedactionResult, type HqRunCommandCommand, type HqRuntimeFile, HqSnapshot, HqSnapshotStore, type HqSnapshotStoreOptions, HqSocketFactory, type HqSpawnCommand, type HqSteerCommand, type HqTimeseriesSample, HqTimeseriesStore, type HqTimeseriesStoreOptions, type HqToken, HqTranscriptEntry, type SessionTelemetryBridgeOptions, type ToolTelemetryBridgeOptions, type WorktreeTelemetryBridgeOptions, buildTranscriptFromEvents, createGlobalMailbox, createHqPersistence, createHqPublisherFromEnv, defaultHqDataDir, discoverLocalHqEndpoint, emptyHqAuthFile, ensureHqFirstRunAuthFile, hqAuthFilePath, hqRuntimeFilePath, mapSessionEventToEntries, mergeToolResults, mintHqBrowserToken, mintHqToken, mutateHqAuthFile, readHqAuthFile, readHqRuntimeFileSync, redactHqEvent, redactHqValue, resolveHqConfig, resolveHqConfigFromEnv, resolveHqDataDir, scrubAndTruncateHqPreview, startAgentMonitorEventBridge, startBrainTelemetryBridge, startCostTelemetryBridge, startFleetTelemetryBridge, startSessionTelemetryBridge, startToolTelemetryBridge, startWorktreeTelemetryBridge, summarizeHqToolArgs, toAlertMessage, tokenHasCapability, validateHqCommand, watchHqAuthFile, writeHqAuthFile, writeHqRuntimeFile };
816
+ export { type AgentMonitorEventBridgeOptions, type BrainTelemetryBridgeOptions, type CostTelemetryBridgeOptions, type CreateGlobalMailboxOptions, type CreateHqPublisherOptions, type EnsureHqFirstRunAuthResult, type FleetTelemetryBridgeOptions, HQ_AUTH_FILE_VERSION, HQ_COMMAND_TYPES, type HqAbortCommand, type HqAgentEventPublisher, type HqAlert, HqAlertEngine, HqAlertMessage, type HqAlertRuleConfig, type HqAlertSeverity, type HqAuthFile, type HqBroadcastCommand, type HqBrowserToken, type HqBtwCommand, HqClientCapability, HqClientIdentity, type HqCommand, type HqCommandAuditEntry, HqCommandAuditLog, type HqCommandType, HqEventEnvelope, HqEventLog, type HqEventLogOptions, type HqPersistence, HqPublisher, HqPublisherCommandHandler, type HqPublisherEnvConfig, type HqQueueCommand, HqQueuedCommand, type HqRedactOptions, HqRedactionPolicy, type HqRedactionResult, type HqRunCommandCommand, type HqRuntimeFile, HqSnapshot, HqSnapshotStore, type HqSnapshotStoreOptions, HqSocketFactory, type HqSpawnCommand, type HqSteerCommand, type HqTimeseriesSample, HqTimeseriesStore, type HqTimeseriesStoreOptions, type HqToken, HqTranscriptEntry, type SessionTelemetryBridgeOptions, type ToolTelemetryBridgeOptions, type WorktreeTelemetryBridgeOptions, buildTranscriptFromEvents, createGlobalMailbox, createHqPersistence, createHqPublisherFromEnv, defaultHqDataDir, discoverLocalHqEndpoint, emptyHqAuthFile, ensureHqFirstRunAuthFile, hqAuthFilePath, hqRuntimeFilePath, mapSessionEventToEntries, mergeToolResults, mintHqBrowserToken, mintHqToken, mutateHqAuthFile, readHqAuthFile, readHqRuntimeFileSync, redactHqEvent, redactHqValue, resolveHqConfig, resolveHqConfigFromEnv, resolveHqDataDir, scrubAndTruncateHqPreview, startAgentMonitorEventBridge, startBrainTelemetryBridge, startCostTelemetryBridge, startFleetTelemetryBridge, startSessionTelemetryBridge, startToolTelemetryBridge, startWorktreeTelemetryBridge, summarizeHqToolArgs, toAlertMessage, tokenHasCapability, validateHqCommand, watchHqAuthFile, writeHqAuthFile, writeHqRuntimeFile };
package/dist/hq/index.js CHANGED
@@ -3542,6 +3542,8 @@ function createHqPersistence(dataDir) {
3542
3542
  // src/hq/commands.ts
3543
3543
  var HQ_COMMAND_TYPES = [
3544
3544
  "steer",
3545
+ "btw",
3546
+ "queue",
3545
3547
  "abort",
3546
3548
  "spawn",
3547
3549
  "broadcast",
@@ -3563,6 +3565,26 @@ function validateHqCommand(queued) {
3563
3565
  }
3564
3566
  return result;
3565
3567
  }
3568
+ case "btw": {
3569
+ if (typeof p["to"] !== "string" || typeof p["subject"] !== "string" || typeof p["body"] !== "string") {
3570
+ return null;
3571
+ }
3572
+ const result = { type: "btw", to: p["to"], subject: p["subject"], body: p["body"] };
3573
+ if (p["priority"] === "low" || p["priority"] === "normal" || p["priority"] === "high") {
3574
+ result.priority = p["priority"];
3575
+ }
3576
+ return result;
3577
+ }
3578
+ case "queue": {
3579
+ if (typeof p["to"] !== "string" || typeof p["subject"] !== "string" || typeof p["body"] !== "string") {
3580
+ return null;
3581
+ }
3582
+ const result = { type: "queue", to: p["to"], subject: p["subject"], body: p["body"] };
3583
+ if (p["priority"] === "low" || p["priority"] === "normal" || p["priority"] === "high") {
3584
+ result.priority = p["priority"];
3585
+ }
3586
+ return result;
3587
+ }
3566
3588
  case "abort":
3567
3589
  if (typeof p["target"] !== "string") return null;
3568
3590
  return { type: "abort", target: p["target"] };