@myspec/mcp-server 1.1.1-next.171 → 1.1.1-next.172

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.js +24 -15
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2954,11 +2954,11 @@ var HttpFileClient = class {
2954
2954
  const raw = await this.httpClient.get(path4, jwtToken, {});
2955
2955
  return transformFileListResult(raw);
2956
2956
  }
2957
- async trashFile(fileId, jwtToken) {
2957
+ async trashFile(fileId, jwtToken, opts) {
2958
2958
  await this.httpClient.delete(
2959
2959
  `/project/v1/files/${fileId}`,
2960
2960
  jwtToken,
2961
- {}
2961
+ opts?.actorKind ? { headers: { [HEADER_ACTOR_KIND]: opts.actorKind } } : {}
2962
2962
  );
2963
2963
  }
2964
2964
  async restoreFile(fileId, jwtToken) {
@@ -3125,6 +3125,7 @@ var HttpProjectClient = class {
3125
3125
  };
3126
3126
 
3127
3127
  // ../../packages/platform-client/project/http/session.http-client.ts
3128
+ var HEADER_ACTOR_KIND2 = "X-Actor-Kind";
3128
3129
  var HttpSpecSessionClient = class {
3129
3130
  httpClient;
3130
3131
  constructor(httpClient) {
@@ -3188,12 +3189,12 @@ var HttpSpecSessionClient = class {
3188
3189
  const response = await this.httpClient.post(`/project/v1/sessions/${sessionId}/messages`, body, jwtToken, {});
3189
3190
  return { messageCount: response.message_count };
3190
3191
  }
3191
- async archiveSpecSession(sessionId, jwtToken) {
3192
+ async archiveSpecSession(sessionId, jwtToken, opts) {
3192
3193
  const raw = await this.httpClient.post(
3193
3194
  `/project/v1/sessions/${sessionId}/archive`,
3194
3195
  {},
3195
3196
  jwtToken,
3196
- {}
3197
+ opts?.actorKind ? { headers: { [HEADER_ACTOR_KIND2]: opts.actorKind } } : {}
3197
3198
  );
3198
3199
  return transformSpecSessionResponse(raw);
3199
3200
  }
@@ -3228,7 +3229,7 @@ var HttpSpecSessionClient = class {
3228
3229
 
3229
3230
  // ../../packages/platform-client/project/http/comment.http-client.ts
3230
3231
  var HEADER_EXPECTED_VERSION2 = "X-Expected-Version";
3231
- var HEADER_ACTOR_KIND2 = "X-Actor-Kind";
3232
+ var HEADER_ACTOR_KIND3 = "X-Actor-Kind";
3232
3233
  function segment(value) {
3233
3234
  return encodeURIComponent(value);
3234
3235
  }
@@ -3253,7 +3254,7 @@ var HttpSpecFileCommentClient = class {
3253
3254
  headers[HEADER_EXPECTED_VERSION2] = String(opts.expectedVersion);
3254
3255
  }
3255
3256
  if (opts?.actorKind) {
3256
- headers[HEADER_ACTOR_KIND2] = opts.actorKind;
3257
+ headers[HEADER_ACTOR_KIND3] = opts.actorKind;
3257
3258
  }
3258
3259
  return headers;
3259
3260
  }
@@ -3361,7 +3362,7 @@ var HttpSpecFileCommentClient = class {
3361
3362
  };
3362
3363
 
3363
3364
  // ../../packages/platform-client/project/http/task.http-client.ts
3364
- var HEADER_ACTOR_KIND3 = "X-Actor-Kind";
3365
+ var HEADER_ACTOR_KIND4 = "X-Actor-Kind";
3365
3366
  function tasksPath(projectId) {
3366
3367
  return `/project/v1/projects/${encodeURIComponent(projectId)}/tasks`;
3367
3368
  }
@@ -3403,7 +3404,7 @@ var HttpProjectTaskClient = class {
3403
3404
  `${tasksPath(projectId)}/status`,
3404
3405
  body,
3405
3406
  jwtToken,
3406
- opts?.actorKind ? { headers: { [HEADER_ACTOR_KIND3]: opts.actorKind } } : {}
3407
+ opts?.actorKind ? { headers: { [HEADER_ACTOR_KIND4]: opts.actorKind } } : {}
3407
3408
  );
3408
3409
  return transformSetTaskStatusResult(raw);
3409
3410
  }
@@ -3412,7 +3413,7 @@ var HttpProjectTaskClient = class {
3412
3413
  `${tasksPath(projectId)}/batch`,
3413
3414
  toRawApplyTaskChangesRequest(changes, opts?.expectedVersions),
3414
3415
  jwtToken,
3415
- opts?.actorKind ? { headers: { [HEADER_ACTOR_KIND3]: opts.actorKind } } : {}
3416
+ opts?.actorKind ? { headers: { [HEADER_ACTOR_KIND4]: opts.actorKind } } : {}
3416
3417
  );
3417
3418
  return transformApplyTaskChangesResult(raw);
3418
3419
  }
@@ -3549,14 +3550,14 @@ function buildUpdateArtifactBody(request) {
3549
3550
  // ../../packages/platform-client/artifact/http/artifact.http-client.ts
3550
3551
  var BASE_PATH = "/artifact/v1";
3551
3552
  var HEADER_EXPECTED_VERSION3 = "X-Expected-Version";
3552
- var HEADER_ACTOR_KIND4 = "X-Actor-Kind";
3553
+ var HEADER_ACTOR_KIND5 = "X-Actor-Kind";
3553
3554
  function writeHeaders(opts) {
3554
3555
  const headers = {};
3555
3556
  if (opts?.expectedVersion !== void 0) {
3556
3557
  headers[HEADER_EXPECTED_VERSION3] = String(opts.expectedVersion);
3557
3558
  }
3558
3559
  if (opts?.actorKind) {
3559
- headers[HEADER_ACTOR_KIND4] = opts.actorKind;
3560
+ headers[HEADER_ACTOR_KIND5] = opts.actorKind;
3560
3561
  }
3561
3562
  return headers;
3562
3563
  }
@@ -3892,9 +3893,15 @@ var PlatformClient = class {
3892
3893
  async updateSpecSessionContext(sessionId, context) {
3893
3894
  return this.withTokenRetry((jwt, c) => c.session.updateSpecSession(sessionId, { context }, jwt));
3894
3895
  }
3895
- /** Idempotent: re-archiving keeps the original archivedAt. */
3896
+ /**
3897
+ * Idempotent: re-archiving keeps the original archivedAt. Attributed
3898
+ * `actorKind: 'ai'`, so the activity feed credits the archive to the
3899
+ * assistant rather than the user (issue #1814).
3900
+ */
3896
3901
  async archiveSpecSession(sessionId) {
3897
- return this.withTokenRetry((jwt, c) => c.session.archiveSpecSession(sessionId, jwt));
3902
+ return this.withTokenRetry(
3903
+ (jwt, c) => c.session.archiveSpecSession(sessionId, jwt, { actorKind: "ai" })
3904
+ );
3898
3905
  }
3899
3906
  async unarchiveSpecSession(sessionId) {
3900
3907
  return this.withTokenRetry((jwt, c) => c.session.unarchiveSpecSession(sessionId, jwt));
@@ -4024,10 +4031,12 @@ var PlatformClient = class {
4024
4031
  /**
4025
4032
  * Moves a spec file to the Trash Bin (recoverable). The platform hides a
4026
4033
  * trashed file from the default file list and all AI-agent tools, but keeps
4027
- * it restorable indefinitely via {@link restoreFile}.
4034
+ * it restorable indefinitely via {@link restoreFile}. Attributed
4035
+ * `actorKind: 'ai'`, so the activity feed credits the trash to the
4036
+ * assistant rather than the user (issue #1814).
4028
4037
  */
4029
4038
  async trashFile(fileId) {
4030
- await this.withTokenRetry((jwt, c) => c.file.trashFile(fileId, jwt));
4039
+ await this.withTokenRetry((jwt, c) => c.file.trashFile(fileId, jwt, { actorKind: "ai" }));
4031
4040
  }
4032
4041
  /** Restores a spec file from the Trash Bin back to the active file list. */
4033
4042
  async restoreFile(fileId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myspec/mcp-server",
3
- "version": "1.1.1-next.171",
3
+ "version": "1.1.1-next.172",
4
4
  "description": "MySpec MCP server — exposes MySpec platform projects, files and attachments to MCP-aware clients via OAuth-authenticated access tokens.",
5
5
  "type": "module",
6
6
  "repository": {