agent-relay 6.0.5 → 6.0.7

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 (2) hide show
  1. package/dist/index.cjs +79 -17
  2. package/package.json +10 -10
package/dist/index.cjs CHANGED
@@ -48230,6 +48230,18 @@ function normalizeExportJsonResponse(payload) {
48230
48230
  files: Array.isArray(data.files) ? data.files : []
48231
48231
  };
48232
48232
  }
48233
+ function normalizeErrorDetails(data, explicitDetails) {
48234
+ if (explicitDetails && typeof explicitDetails === "object" && !Array.isArray(explicitDetails)) {
48235
+ return explicitDetails;
48236
+ }
48237
+ const details = {};
48238
+ for (const [key, value] of Object.entries(data)) {
48239
+ if (key !== "code" && key !== "message" && key !== "correlationId") {
48240
+ details[key] = value;
48241
+ }
48242
+ }
48243
+ return Object.keys(details).length > 0 ? details : void 0;
48244
+ }
48233
48245
  var RelayFileWebSocketConnection = class {
48234
48246
  socket;
48235
48247
  handlers = {
@@ -48312,7 +48324,8 @@ var RelayFileClient = class {
48312
48324
  const query = buildQuery({
48313
48325
  path: options.path ?? "/",
48314
48326
  depth: options.depth,
48315
- cursor: options.cursor
48327
+ cursor: options.cursor,
48328
+ forkId: options.forkId
48316
48329
  });
48317
48330
  return this.request({
48318
48331
  method: "GET",
@@ -48321,13 +48334,19 @@ var RelayFileClient = class {
48321
48334
  signal: options.signal
48322
48335
  });
48323
48336
  }
48324
- async readFile(workspaceId, path25, correlationId, signal) {
48325
- const query = buildQuery({ path: path25 });
48326
- return this.request({
48327
- method: "GET",
48328
- path: `/v1/workspaces/${encodeURIComponent(workspaceId)}/fs/file${query}`,
48337
+ async readFile(workspaceOrInput, path25, correlationId, signal) {
48338
+ const input = typeof workspaceOrInput === "string" ? {
48339
+ workspaceId: workspaceOrInput,
48340
+ path: path25 ?? "",
48329
48341
  correlationId,
48330
48342
  signal
48343
+ } : workspaceOrInput;
48344
+ const query = buildQuery({ path: input.path, forkId: input.forkId });
48345
+ return this.request({
48346
+ method: "GET",
48347
+ path: `/v1/workspaces/${encodeURIComponent(input.workspaceId)}/fs/file${query}`,
48348
+ correlationId: input.correlationId,
48349
+ signal: input.signal
48331
48350
  });
48332
48351
  }
48333
48352
  async queryFiles(workspaceId, options = {}) {
@@ -48346,6 +48365,8 @@ var RelayFileClient = class {
48346
48365
  params.set("cursor", options.cursor);
48347
48366
  if (options.limit !== void 0)
48348
48367
  params.set("limit", String(options.limit));
48368
+ if (options.forkId !== void 0)
48369
+ params.set("forkId", options.forkId);
48349
48370
  if (options.properties !== void 0) {
48350
48371
  for (const [key, value] of Object.entries(options.properties)) {
48351
48372
  if (key !== "" && value !== void 0) {
@@ -48363,8 +48384,8 @@ var RelayFileClient = class {
48363
48384
  });
48364
48385
  }
48365
48386
  async writeFile(input) {
48366
- const { workspaceId, path: path25, correlationId, baseRevision, content, contentType, encoding, semantics, signal } = input;
48367
- const query = buildQuery({ path: path25 });
48387
+ const { workspaceId, path: path25, correlationId, baseRevision, content, contentType, encoding, contentIdentity, signal } = input;
48388
+ const query = buildQuery({ path: path25, forkId: input.forkId });
48368
48389
  return this.request({
48369
48390
  method: "PUT",
48370
48391
  path: `/v1/workspaces/${encodeURIComponent(workspaceId)}/fs/file${query}`,
@@ -48377,15 +48398,17 @@ var RelayFileClient = class {
48377
48398
  contentType: contentType ?? "text/markdown",
48378
48399
  content,
48379
48400
  encoding,
48380
- semantics: input.semantics
48401
+ semantics: input.semantics,
48402
+ ...contentIdentity ? { contentIdentity } : {}
48381
48403
  },
48382
48404
  signal
48383
48405
  });
48384
48406
  }
48385
48407
  async bulkWrite(input) {
48408
+ const query = buildQuery({ forkId: input.forkId });
48386
48409
  const response = await this.performRequest({
48387
48410
  method: "POST",
48388
- path: `/v1/workspaces/${encodeURIComponent(input.workspaceId)}/fs/bulk`,
48411
+ path: `/v1/workspaces/${encodeURIComponent(input.workspaceId)}/fs/bulk${query}`,
48389
48412
  correlationId: input.correlationId,
48390
48413
  body: {
48391
48414
  files: input.files
@@ -48395,7 +48418,7 @@ var RelayFileClient = class {
48395
48418
  return this.readPayload(response);
48396
48419
  }
48397
48420
  async deleteFile(input) {
48398
- const query = buildQuery({ path: input.path });
48421
+ const query = buildQuery({ path: input.path, forkId: input.forkId });
48399
48422
  return this.request({
48400
48423
  method: "DELETE",
48401
48424
  path: `/v1/workspaces/${encodeURIComponent(input.workspaceId)}/fs/file${query}`,
@@ -48406,6 +48429,37 @@ var RelayFileClient = class {
48406
48429
  signal: input.signal
48407
48430
  });
48408
48431
  }
48432
+ async createFork(input) {
48433
+ const body = {
48434
+ proposalId: input.proposalId
48435
+ };
48436
+ if (input.ttlSeconds !== void 0) {
48437
+ body.ttlSeconds = input.ttlSeconds;
48438
+ }
48439
+ return this.request({
48440
+ method: "POST",
48441
+ path: `/v1/workspaces/${encodeURIComponent(input.workspaceId)}/forks`,
48442
+ correlationId: input.correlationId,
48443
+ body,
48444
+ signal: input.signal
48445
+ });
48446
+ }
48447
+ async discardFork(input) {
48448
+ await this.performRequest({
48449
+ method: "DELETE",
48450
+ path: `/v1/workspaces/${encodeURIComponent(input.workspaceId)}/forks/${encodeURIComponent(input.forkId)}`,
48451
+ correlationId: input.correlationId,
48452
+ signal: input.signal
48453
+ });
48454
+ }
48455
+ async commitFork(input) {
48456
+ return this.request({
48457
+ method: "POST",
48458
+ path: `/v1/workspaces/${encodeURIComponent(input.workspaceId)}/forks/${encodeURIComponent(input.forkId)}/commit`,
48459
+ correlationId: input.correlationId,
48460
+ signal: input.signal
48461
+ });
48462
+ }
48409
48463
  async getEvents(workspaceId, options = {}) {
48410
48464
  const query = buildQuery({
48411
48465
  provider: options.provider,
@@ -48791,13 +48845,15 @@ var RelayFileClient = class {
48791
48845
  };
48792
48846
  }
48793
48847
  throwForError(status, payload, headers) {
48794
- const data = payload ?? {};
48848
+ const rawData = payload ?? {};
48849
+ const data = rawData;
48850
+ const details = normalizeErrorDetails(rawData, data.details);
48795
48851
  if (status === 409 && typeof data.expectedRevision === "string" && typeof data.currentRevision === "string") {
48796
48852
  throw new RevisionConflictError(status, {
48797
48853
  code: data.code ?? "revision_conflict",
48798
48854
  message: data.message ?? "Revision conflict",
48799
48855
  correlationId: data.correlationId ?? "",
48800
- details: data.details,
48856
+ details,
48801
48857
  expectedRevision: data.expectedRevision,
48802
48858
  currentRevision: data.currentRevision,
48803
48859
  currentContentPreview: data.currentContentPreview
@@ -48808,7 +48864,7 @@ var RelayFileClient = class {
48808
48864
  code: data.code,
48809
48865
  message: data.message ?? "Invalid resource state",
48810
48866
  correlationId: data.correlationId,
48811
- details: data.details
48867
+ details
48812
48868
  });
48813
48869
  }
48814
48870
  if (status === 429 && data.code === "queue_full") {
@@ -48824,7 +48880,7 @@ var RelayFileClient = class {
48824
48880
  code: data.code,
48825
48881
  message: data.message ?? "Ingress queue full",
48826
48882
  correlationId: data.correlationId,
48827
- details: data.details
48883
+ details
48828
48884
  }, retryAfterSeconds);
48829
48885
  }
48830
48886
  if (status === 413) {
@@ -48832,18 +48888,24 @@ var RelayFileClient = class {
48832
48888
  code: data.code ?? "payload_too_large",
48833
48889
  message: data.message ?? "Request payload exceeds configured limit",
48834
48890
  correlationId: data.correlationId,
48835
- details: data.details
48891
+ details
48836
48892
  });
48837
48893
  }
48838
48894
  throw new RelayFileApiError(status, {
48839
48895
  code: data.code ?? "api_error",
48840
48896
  message: data.message ?? `HTTP ${status}`,
48841
48897
  correlationId: data.correlationId,
48842
- details: data.details
48898
+ details
48843
48899
  });
48844
48900
  }
48845
48901
  };
48846
48902
 
48903
+ // node_modules/@relayfile/sdk/dist/cloud-login.js
48904
+ var DEFAULT_LOGIN_TIMEOUT_MS = 5 * 60 * 1e3;
48905
+
48906
+ // node_modules/@relayfile/sdk/dist/setup.js
48907
+ var TOKEN_REFRESH_AGE_MS = 55 * 60 * 1e3;
48908
+
48847
48909
  // packages/sdk/dist/provisioner/seeder.js
48848
48910
  var import_node_fs14 = __toESM(require("node:fs"), 1);
48849
48911
  var import_node_path21 = __toESM(require("node:path"), 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay",
3
- "version": "6.0.5",
3
+ "version": "6.0.7",
4
4
  "description": "Real-time agent-to-agent communication system",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -130,14 +130,14 @@
130
130
  },
131
131
  "homepage": "https://github.com/AgentWorkforce/relay#readme",
132
132
  "dependencies": {
133
- "@agent-relay/cloud": "6.0.5",
134
- "@agent-relay/config": "6.0.5",
135
- "@agent-relay/hooks": "6.0.5",
136
- "@agent-relay/sdk": "6.0.5",
137
- "@agent-relay/telemetry": "6.0.5",
138
- "@agent-relay/trajectory": "6.0.5",
139
- "@agent-relay/user-directory": "6.0.5",
140
- "@agent-relay/utils": "6.0.5",
133
+ "@agent-relay/cloud": "6.0.7",
134
+ "@agent-relay/config": "6.0.7",
135
+ "@agent-relay/hooks": "6.0.7",
136
+ "@agent-relay/sdk": "6.0.7",
137
+ "@agent-relay/telemetry": "6.0.7",
138
+ "@agent-relay/trajectory": "6.0.7",
139
+ "@agent-relay/user-directory": "6.0.7",
140
+ "@agent-relay/utils": "6.0.7",
141
141
  "@aws-sdk/client-s3": "3.1020.0",
142
142
  "@modelcontextprotocol/sdk": "^1.0.0",
143
143
  "@relayauth/core": "^0.1.2",
@@ -145,7 +145,7 @@
145
145
  "@relaycast/mcp": "1.0.0",
146
146
  "@relaycast/sdk": "^1.1.0",
147
147
  "@relayfile/local-mount": "^0.2.2",
148
- "@relayfile/sdk": "^0.1.2",
148
+ "@relayfile/sdk": "^0.6.0",
149
149
  "@sinclair/typebox": "^0.34.14",
150
150
  "agent-trajectories": "^0.5.4",
151
151
  "chalk": "^4.1.2",