@scitrera/aether-client 0.2.0 → 0.2.2

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/README.md CHANGED
@@ -458,7 +458,7 @@ uniqueTaskTopic("prod", "report", "daily"); // "tu.prod.report.daily"
458
458
  taskBroadcastTopic("prod", "worker"); // "tb.prod.worker"
459
459
  globalAgentsTopic("prod"); // "ga.prod"
460
460
  eventTopic("task.completed"); // "event.task.completed"
461
- bridgeTopic("aether-msgbridge", "discord-1"); // "br.aether-msgbridge.discord-1"
461
+ bridgeTopic("example-bridge", "instance-1"); // "br.example-bridge.instance-1"
462
462
  ```
463
463
 
464
464
  ## Principal Types
@@ -574,8 +574,8 @@ import { BridgeClient, MessageType } from "@scitrera/aether-client";
574
574
 
575
575
  const bridge = new BridgeClient({
576
576
  address: "localhost:50051",
577
- implementation: "aether-msgbridge",
578
- specifier: "discord-1",
577
+ implementation: "example-bridge",
578
+ specifier: "instance-1",
579
579
  });
580
580
 
581
581
  bridge.onMessage((msg) => {
package/dist/index.cjs CHANGED
@@ -71,6 +71,7 @@ __export(index_exports, {
71
71
  TOPIC_PREFIX_TASK_BROADCAST: () => TOPIC_PREFIX_TASK_BROADCAST,
72
72
  TOPIC_PREFIX_UNIQUE_TASK: () => TOPIC_PREFIX_UNIQUE_TASK,
73
73
  TOPIC_PREFIX_USER: () => TOPIC_PREFIX_USER,
74
+ TOPIC_PREFIX_USER_BROADCAST: () => TOPIC_PREFIX_USER_BROADCAST,
74
75
  TOPIC_PREFIX_USER_WORKSPACE: () => TOPIC_PREFIX_USER_WORKSPACE,
75
76
  TaskAssignmentMode: () => TaskAssignmentMode,
76
77
  TaskClient: () => TaskClient,
@@ -97,6 +98,7 @@ __export(index_exports, {
97
98
  taskTopic: () => taskTopic,
98
99
  tunnelDial: () => tunnelDial,
99
100
  uniqueTaskTopic: () => uniqueTaskTopic,
101
+ userBroadcastTopic: () => userBroadcastTopic,
100
102
  userTopic: () => userTopic,
101
103
  userWorkspaceTopic: () => userWorkspaceTopic,
102
104
  withAPIKey: () => withAPIKey,
@@ -1451,7 +1453,7 @@ function extractGrant(response) {
1451
1453
  // package.json
1452
1454
  var package_default = {
1453
1455
  name: "@scitrera/aether-client",
1454
- version: "0.2.0",
1456
+ version: "0.2.2",
1455
1457
  description: "TypeScript/JavaScript SDK for the Aether distributed control plane",
1456
1458
  license: "Apache-2.0",
1457
1459
  author: "scitrera.ai",
@@ -1494,9 +1496,9 @@ var package_default = {
1494
1496
  "@grpc/proto-loader": "0.8.1"
1495
1497
  },
1496
1498
  devDependencies: {
1497
- typescript: "^5.4.0",
1498
1499
  tsup: "^8.0.0",
1499
- vitest: "^1.4.0"
1500
+ typescript: "^5.4.0",
1501
+ vitest: "^3.2.7"
1500
1502
  },
1501
1503
  engines: {
1502
1504
  node: ">=18.0.0"
@@ -3921,6 +3923,7 @@ var TOPIC_PREFIX_TASK = "ta";
3921
3923
  var TOPIC_PREFIX_TASK_BROADCAST = "tb";
3922
3924
  var TOPIC_PREFIX_USER = "us";
3923
3925
  var TOPIC_PREFIX_USER_WORKSPACE = "uw";
3926
+ var TOPIC_PREFIX_USER_BROADCAST = "uu";
3924
3927
  var TOPIC_PREFIX_GLOBAL_AGENTS = "ga";
3925
3928
  var TOPIC_PREFIX_GLOBAL_USERS = "gu";
3926
3929
  var TOPIC_PREFIX_EVENT = "event";
@@ -3948,6 +3951,9 @@ function userTopic(userId, windowId) {
3948
3951
  function userWorkspaceTopic(userId, workspace) {
3949
3952
  return `${TOPIC_PREFIX_USER_WORKSPACE}${IDENTITY_SEP}${userId}${IDENTITY_SEP}${workspace}`;
3950
3953
  }
3954
+ function userBroadcastTopic(userId) {
3955
+ return `${TOPIC_PREFIX_USER_BROADCAST}${IDENTITY_SEP}${userId}`;
3956
+ }
3951
3957
  function globalUsersTopic(workspace) {
3952
3958
  return `${TOPIC_PREFIX_GLOBAL_USERS}${IDENTITY_SEP}${workspace}`;
3953
3959
  }
@@ -4189,7 +4195,8 @@ var AgentClient = class extends AetherClient {
4189
4195
  targetAgentId: opts.targetAgentId ?? "",
4190
4196
  targetImplementation: opts.targetImplementation ?? "",
4191
4197
  launchParamOverrides: opts.launchParamOverrides ?? {},
4192
- metadata: opts.metadata ?? {}
4198
+ metadata: opts.metadata ?? {},
4199
+ priority: opts.priority ?? 0 /* Unspecified */
4193
4200
  }
4194
4201
  });
4195
4202
  }
@@ -4851,6 +4858,20 @@ var WorkflowEngineClient = class extends AetherClient {
4851
4858
  sendToUser(userId, windowId, payload, messageType = 6 /* Opaque */) {
4852
4859
  this._sendMessage(userTopic(userId, windowId), payload, messageType);
4853
4860
  }
4861
+ /**
4862
+ * Sends a message to every one of a user's windows, regardless of which
4863
+ * workspace each window is viewing (topic uu::{userId}).
4864
+ *
4865
+ * This is the workspace-agnostic, non-progress channel for platform→user
4866
+ * notifications.
4867
+ *
4868
+ * @param userId - Target user's ID
4869
+ * @param payload - Message payload (bytes)
4870
+ * @param messageType - Message type. Default: Opaque
4871
+ */
4872
+ sendToUserBroadcast(userId, payload, messageType = 6 /* Opaque */) {
4873
+ this._sendMessage(userBroadcastTopic(userId), payload, messageType);
4874
+ }
4854
4875
  /**
4855
4876
  * Publishes a metric to the metrics bridge.
4856
4877
  *
@@ -5071,6 +5092,20 @@ var BridgeClient = class extends AetherClient {
5071
5092
  sendToUserWorkspace(userId, workspace, payload, messageType = 6 /* Opaque */) {
5072
5093
  this._sendMessage(userWorkspaceTopic(userId, workspace), payload, messageType);
5073
5094
  }
5095
+ /**
5096
+ * Sends a message to every one of a user's windows, regardless of which
5097
+ * workspace each window is viewing (topic uu::{userId}).
5098
+ *
5099
+ * This is the workspace-agnostic, non-progress channel for platform→user
5100
+ * notifications.
5101
+ *
5102
+ * @param userId - Target user's ID
5103
+ * @param payload - Message payload (bytes)
5104
+ * @param messageType - Message type. Default: Opaque
5105
+ */
5106
+ sendToUserBroadcast(userId, payload, messageType = 6 /* Opaque */) {
5107
+ this._sendMessage(userBroadcastTopic(userId), payload, messageType);
5108
+ }
5074
5109
  // ===========================================================================
5075
5110
  // Broadcast Helpers
5076
5111
  // ===========================================================================
@@ -5377,6 +5412,7 @@ var AetherFetchTransport = class {
5377
5412
  TOPIC_PREFIX_TASK_BROADCAST,
5378
5413
  TOPIC_PREFIX_UNIQUE_TASK,
5379
5414
  TOPIC_PREFIX_USER,
5415
+ TOPIC_PREFIX_USER_BROADCAST,
5380
5416
  TOPIC_PREFIX_USER_WORKSPACE,
5381
5417
  TaskAssignmentMode,
5382
5418
  TaskClient,
@@ -5403,6 +5439,7 @@ var AetherFetchTransport = class {
5403
5439
  taskTopic,
5404
5440
  tunnelDial,
5405
5441
  uniqueTaskTopic,
5442
+ userBroadcastTopic,
5406
5443
  userTopic,
5407
5444
  userWorkspaceTopic,
5408
5445
  withAPIKey,