@ycodium-ai/plugin-session-import 0.2.3130 → 0.2.3158

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 (3) hide show
  1. package/README.md +3 -2
  2. package/dist/index.js +16 -15
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -25,8 +25,9 @@ A Ycodium server. The plugin asks to:
25
25
 
26
26
  - read every provider instance's home, transcript, and config directories
27
27
  - spawn Codex binaries the host names
28
- - dispatch `thread.import` and `thread.external-messages.append` on threads
29
- it imported
28
+ - import and append history through `ctx.threads.import` and
29
+ `ctx.threads.externalMessages.append`, declaring `thread.import` and
30
+ `thread.external-messages.append` in `commands.dispatch`
30
31
  - declare `thread.session.stop` and `threads.user` to stop idle project sessions on this machine after syncing external history
31
32
 
32
33
  Sync requests a stop through `ctx.threads.session.stop` with `onlyIfNoTurnInFlight: true` and a fresh request id each time.
package/dist/index.js CHANGED
@@ -2463,21 +2463,24 @@ async function runImportOnce(ctx, input, emit) {
2463
2463
  if (existing === null && batches.length === 0) batches.push({ messages: [], activities: [] });
2464
2464
  try {
2465
2465
  for (const batch of batches) {
2466
- await ctx.commands.dispatch({
2467
- ...threadCreated ? { type: "thread.external-messages.append" } : {
2468
- type: "thread.import",
2466
+ const historyInput = {
2467
+ requestId: historyCommandId(input.threadId, batch),
2468
+ threadId: input.threadId,
2469
+ ...batch
2470
+ };
2471
+ if (threadCreated) {
2472
+ await ctx.threads.externalMessages.append(historyInput);
2473
+ } else {
2474
+ await ctx.threads.import({
2475
+ ...historyInput,
2469
2476
  projectId: input.projectId,
2470
2477
  title: resolveImportedTitle(transcript),
2471
2478
  modelSelection,
2472
2479
  runtimeMode: "full-access",
2473
2480
  branch: null,
2474
2481
  worktreePath: null
2475
- },
2476
- commandId: historyCommandId(input.threadId, batch),
2477
- threadId: input.threadId,
2478
- ...batch,
2479
- createdAt: now
2480
- });
2482
+ });
2483
+ }
2481
2484
  threadCreated = true;
2482
2485
  }
2483
2486
  } catch (error) {
@@ -2630,12 +2633,10 @@ var NativeSessionTail = class {
2630
2633
  }
2631
2634
  try {
2632
2635
  for (const batch of batches) {
2633
- await this.ctx.commands.dispatch({
2634
- type: "thread.external-messages.append",
2635
- commandId: historyCommandId(threadId, batch),
2636
+ await this.ctx.threads.externalMessages.append({
2637
+ requestId: historyCommandId(threadId, batch),
2636
2638
  threadId,
2637
- ...batch,
2638
- createdAt: appendedAt
2639
+ ...batch
2639
2640
  });
2640
2641
  }
2641
2642
  } catch (error) {
@@ -2674,7 +2675,7 @@ var NativeSessionTail = class {
2674
2675
  // src/index.ts
2675
2676
  var index_default = definePlugin({
2676
2677
  id: "session-import",
2677
- apiVersion: 14,
2678
+ apiVersion: 15,
2678
2679
  activate: (ctx) => {
2679
2680
  ctx.command({
2680
2681
  name: "scan",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-session-import",
3
- "version": "0.2.3130",
3
+ "version": "0.2.3158",
4
4
  "description": "Brings a session you started in a terminal into Ycodium.",
5
5
  "keywords": [
6
6
  "session-import",
@@ -20,8 +20,8 @@
20
20
  "effect": "4.0.0-beta.103",
21
21
  "esbuild": "0.28.1",
22
22
  "vite-plus": "0.2.2",
23
- "ycodium-jsonl-stream": "0.0.0",
24
- "@ycodium-ai/plugin-api": "0.2.3130"
23
+ "@ycodium-ai/plugin-api": "0.2.3158",
24
+ "ycodium-jsonl-stream": "0.0.0"
25
25
  },
26
26
  "ycodium": {
27
27
  "plugin": "./dist/index.js",