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

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
@@ -27,6 +27,13 @@ A Ycodium server. The plugin asks to:
27
27
  - spawn Codex binaries the host names
28
28
  - dispatch `thread.import` and `thread.external-messages.append` on threads
29
29
  it imported
30
+ - declare `thread.session.stop` and `threads.user` to stop idle project sessions on this machine after syncing external history
31
+
32
+ Sync requests a stop through `ctx.threads.session.stop` with `onlyIfNoTurnInFlight: true` and a fresh request id each time.
33
+ The command checks for in-flight work when it decides the stop. Sync returns after acceptance and does not wait for the process to exit.
34
+
35
+ 权限说明:插件读取 provider 目录、运行宿主指定的 Codex 程序、导入和追加历史;`threads.user` 允许它在同步外部历史后停止这台机器上的项目会话。
36
+ 停止命令一律只在没有在途轮次时生效,每次同步使用新请求号;同步返回表示停止请求已受理,进程退出由宿主异步完成。
30
37
 
31
38
  ## Install
32
39
 
package/dist/index.js CHANGED
@@ -2657,7 +2657,11 @@ var NativeSessionTail = class {
2657
2657
  const current = await threadOrNull2(this.ctx.threads, threadId);
2658
2658
  if (current?.session == null || current.session.status === "stopped" || current.session.activeTurnId !== null || current.session.status === "running" || current.session.status === "starting")
2659
2659
  return { status: "synced", appended: history.appendedMessageCount };
2660
- await this.ctx.providers.sessions.stop(threadId).catch((error) => {
2660
+ await this.ctx.threads.session.stop({
2661
+ threadId,
2662
+ requestId: NodeCrypto4.randomUUID(),
2663
+ onlyIfNoTurnInFlight: true
2664
+ }).catch((error) => {
2661
2665
  this.ctx.log.warn("session-import sync could not stop the session", {
2662
2666
  threadId,
2663
2667
  detail: describeError(error)
@@ -2670,7 +2674,7 @@ var NativeSessionTail = class {
2670
2674
  // src/index.ts
2671
2675
  var index_default = definePlugin({
2672
2676
  id: "session-import",
2673
- apiVersion: 12,
2677
+ apiVersion: 14,
2674
2678
  activate: (ctx) => {
2675
2679
  ctx.command({
2676
2680
  name: "scan",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-session-import",
3
- "version": "0.2.3120",
3
+ "version": "0.2.3130",
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-ai/plugin-api": "0.2.3120",
24
- "ycodium-jsonl-stream": "0.0.0"
23
+ "ycodium-jsonl-stream": "0.0.0",
24
+ "@ycodium-ai/plugin-api": "0.2.3130"
25
25
  },
26
26
  "ycodium": {
27
27
  "plugin": "./dist/index.js",
@@ -29,6 +29,9 @@
29
29
  "description": "Brings a session you started in a terminal into Ycodium.",
30
30
  "icon": "blocks",
31
31
  "permissions": [
32
+ {
33
+ "kind": "threads.user"
34
+ },
32
35
  {
33
36
  "kind": "providers.homes"
34
37
  },
@@ -42,7 +45,8 @@
42
45
  "kind": "commands.dispatch",
43
46
  "commands": [
44
47
  "thread.import",
45
- "thread.external-messages.append"
48
+ "thread.external-messages.append",
49
+ "thread.session.stop"
46
50
  ]
47
51
  }
48
52
  ]