@gatherthread/dsh-host 0.1.0-alpha.4 → 0.1.0-alpha.5

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
@@ -19,7 +19,7 @@ The package does not install a DSH runtime dependency.
19
19
  After `@gatherthread/dsh-host` is published, the ordinary three-step path is:
20
20
 
21
21
  ```text
22
- npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add @gatherthread/dsh-host@0.1.0-alpha.4
22
+ npx @deepseek-ai/dsh@0.1.2-rc.1 plugin --profile web add @gatherthread/dsh-host@0.1.0-alpha.5
23
23
  npx @deepseek-ai/dsh@0.1.2-rc.1 web
24
24
  # In DSH: Settings -> GatherThread / 共序 -> Sign in and pair
25
25
  ```
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "@gatherthread/dsh-host",
4
- "version": "0.1.0-alpha.4",
4
+ "version": "0.1.0-alpha.5",
5
5
  "license": "Apache-2.0",
6
6
  "defaultEnabled": false,
7
7
  "hostEntry": "@gatherthread/dsh-host",
@@ -191,10 +191,10 @@ var HttpCollaborationClient = class {
191
191
  const body = requiredObject(await this.#request(`/snapshot-requests/${encodeURIComponent(requestId)}`));
192
192
  return fromWireSnapshotRequest(body.snapshot_request ?? body);
193
193
  }
194
- async createSnapshotRequest(sessionId, kind = "immutable") {
194
+ async createSnapshotRequest(sessionId, kind = "immutable", targetRuntimeId) {
195
195
  const body = requiredObject(await this.#request(`/sessions/${encodeURIComponent(sessionId)}/snapshot-requests`, {
196
196
  method: "POST",
197
- body: JSON.stringify({ kind })
197
+ body: JSON.stringify({ kind, ...targetRuntimeId === void 0 ? {} : { target_runtime_id: targetRuntimeId } })
198
198
  }));
199
199
  return fromWireSnapshotRequest(body.snapshot_request ?? body);
200
200
  }
@@ -312,10 +312,22 @@ function fromWireSnapshotRequest(value) {
312
312
  message: requiredString(failureInput.message, "snapshot_request.failure.message")
313
313
  } : void 0;
314
314
  const createdAt = optionalWireString(input.created_at) ?? optionalWireString(input.requested_at);
315
+ const kind = requiredString(input.kind, "snapshot_request.kind");
316
+ if (![
317
+ "immutable",
318
+ "visible_history_replace",
319
+ "local_sync_status",
320
+ "local_auto_upload_enable",
321
+ "local_auto_upload_disable",
322
+ "local_turn_upload"
323
+ ].includes(kind)) {
324
+ throw new Error("Collaboration API returned an invalid snapshot request kind");
325
+ }
315
326
  return {
316
327
  id: requiredString(input.id, "snapshot_request.id"),
317
328
  sessionId: requiredString(input.session_id, "snapshot_request.session_id"),
318
- kind: input.kind === "visible_history_replace" ? "visible_history_replace" : "immutable",
329
+ kind,
330
+ ...typeof input.target_runtime_id === "string" ? { targetRuntimeId: input.target_runtime_id } : {},
319
331
  throughSequence: requiredNumber(input.through_sequence, "snapshot_request.through_sequence"),
320
332
  status,
321
333
  ...createdAt === void 0 ? {} : { createdAt },
@@ -512,10 +512,10 @@ var HttpCollaborationClient = class {
512
512
  const body = requiredObject2(await this.#request(`/snapshot-requests/${encodeURIComponent(requestId)}`));
513
513
  return fromWireSnapshotRequest(body.snapshot_request ?? body);
514
514
  }
515
- async createSnapshotRequest(sessionId, kind = "immutable") {
515
+ async createSnapshotRequest(sessionId, kind = "immutable", targetRuntimeId) {
516
516
  const body = requiredObject2(await this.#request(`/sessions/${encodeURIComponent(sessionId)}/snapshot-requests`, {
517
517
  method: "POST",
518
- body: JSON.stringify({ kind })
518
+ body: JSON.stringify({ kind, ...targetRuntimeId === void 0 ? {} : { target_runtime_id: targetRuntimeId } })
519
519
  }));
520
520
  return fromWireSnapshotRequest(body.snapshot_request ?? body);
521
521
  }
@@ -633,10 +633,22 @@ function fromWireSnapshotRequest(value) {
633
633
  message: requiredString2(failureInput.message, "snapshot_request.failure.message")
634
634
  } : void 0;
635
635
  const createdAt = optionalWireString(input.created_at) ?? optionalWireString(input.requested_at);
636
+ const kind = requiredString2(input.kind, "snapshot_request.kind");
637
+ if (![
638
+ "immutable",
639
+ "visible_history_replace",
640
+ "local_sync_status",
641
+ "local_auto_upload_enable",
642
+ "local_auto_upload_disable",
643
+ "local_turn_upload"
644
+ ].includes(kind)) {
645
+ throw new Error("Collaboration API returned an invalid snapshot request kind");
646
+ }
636
647
  return {
637
648
  id: requiredString2(input.id, "snapshot_request.id"),
638
649
  sessionId: requiredString2(input.session_id, "snapshot_request.session_id"),
639
- kind: input.kind === "visible_history_replace" ? "visible_history_replace" : "immutable",
650
+ kind,
651
+ ...typeof input.target_runtime_id === "string" ? { targetRuntimeId: input.target_runtime_id } : {},
640
652
  throughSequence: requiredNumber(input.through_sequence, "snapshot_request.through_sequence"),
641
653
  status,
642
654
  ...createdAt === void 0 ? {} : { createdAt },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gatherthread/dsh-host",
3
- "version": "0.1.0-alpha.4",
3
+ "version": "0.1.0-alpha.5",
4
4
  "description": "Opt-in GatherThread integration for the DeepSeek Harness Web profile",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {