@deepseek-ai/dsh-tmux-context 0.2.1-rc.3 → 0.2.2-alpha.2

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.i18n.yaml CHANGED
@@ -36,8 +36,8 @@
36
36
  en: 14bc5e3279f9da27
37
37
  zh: 90953dfbf892033a
38
38
  /deepseek-ai-dsh-tmux-context/understand-the-implementation/main-flow:
39
- en: 2d5768fe44120780
40
- zh: cd601c59d9604e6e
39
+ en: ffe590c1e3c46225
40
+ zh: 5c0acd97c4bad094
41
41
  /deepseek-ai-dsh-tmux-context/further-exploration:
42
42
  en: 08c09f5eb13c30e6
43
43
  zh: 1b34ef9ca42ac9e7
package/README.md CHANGED
@@ -73,6 +73,8 @@ The plugin prepends an `agent/pre-step` listener that runs only on the first ste
73
73
 
74
74
  ### Main flow
75
75
 
76
+ The pre-step listener is installed before awaiting projection registration. Steps arriving during activation wait for the reader; registration failure or owner disposal stops the request, and cancellation while waiting performs no shell query or context injection.
77
+
76
78
  At the first step of a turn, the listener checks whether an injection is due, queries the location through `ctx.shell`, and compares the rendered state with the latest durable injection of this source. Change suppression and interval scheduling scan the raw durable session events, so the schedule survives compaction and resumed processes without process-local cache state; sessions schedule independently. A downstream pre-step listener that rejects or fails prevents the reading from being recorded.
77
79
 
78
80
  </details>
package/README.zh.md CHANGED
@@ -73,6 +73,8 @@ kind: "package-reference"
73
73
 
74
74
  ### 主要流程
75
75
 
76
+ pre-step 监听器在等待投影注册前安装。激活期间到达的步骤会等待读取句柄;注册失败或所属插件释放会终止请求,等待期间取消不会执行 shell 查询或注入上下文。
77
+
76
78
  在每轮的第一个步骤,监听器检查注入是否到期,通过 `ctx.shell` 查询位置,并把渲染状态与该来源最近一次持久注入比较。变化抑制与间隔调度会扫描原始持久会话事件,因此调度可跨压缩(compaction)与恢复的进程存续,无需进程内缓存状态;各会话独立调度。下游在步骤前运行的监听器拒绝或失败时,该读数不会被记录。
77
79
 
78
80
  </details>
package/lib/index.js CHANGED
@@ -1770,12 +1770,17 @@ var LlmError = class extends HarnessError {
1770
1770
  if (typeof model.provider !== "string" || model.provider !== provider || typeof model.id !== "string" || model.id.length === 0 || typeof model.name !== "string" || model.name.length === 0 || model.description !== void 0 && typeof model.description !== "string" || seen.has(model.id)) throw new LlmError(`adapter returned invalid or duplicate model metadata for provider "${provider}"`, "INVALID_CATALOG");
1771
1771
  seen.add(model.id);
1772
1772
  const inputModalities = this.detachedModalities(model.inputModalities);
1773
+ const badge = model.badge;
1773
1774
  return {
1774
1775
  provider: model.provider,
1775
1776
  id: model.id,
1776
1777
  name: model.name,
1777
1778
  ...model.description === void 0 ? {} : { description: model.description },
1778
- ...inputModalities === void 0 ? {} : { inputModalities }
1779
+ ...inputModalities === void 0 ? {} : { inputModalities },
1780
+ ...badge === void 0 ? {} : { badge: {
1781
+ text: typeof badge.text === "string" ? badge.text : { ...badge.text },
1782
+ tone: badge.tone
1783
+ } }
1779
1784
  };
1780
1785
  });
1781
1786
  }
@@ -2243,10 +2248,19 @@ const tmuxContextStateSchema = z$1.object({
2243
2248
  state: z$1.string(),
2244
2249
  time: z$1.number()
2245
2250
  }).nullable();
2246
- function apply(ctx, config) {
2251
+ /**
2252
+ * Register a prepended pre-step listener for the lifetime of `ctx`.
2253
+ * Steps admitted during activation await the projection registration; a
2254
+ * registration failure or owner disposal prevents the request from proceeding.
2255
+ * @param ctx - plugin context; the listener is disposed with it.
2256
+ * @param config - durable refresh scheduling configuration.
2257
+ * @returns when the listener and projection are ready.
2258
+ * @throws when the refresh interval is invalid.
2259
+ */
2260
+ async function apply(ctx, config) {
2247
2261
  const refreshIntervalMs = config.refreshIntervalMs;
2248
2262
  validateRefreshInterval(refreshIntervalMs);
2249
- ctx.sessionProjections.register({
2263
+ const projectionReady = ctx.sessionProjections.register({
2250
2264
  key: "tmuxContext",
2251
2265
  stateVersion: 1,
2252
2266
  stateSchema: tmuxContextStateSchema,
@@ -2263,11 +2277,13 @@ function apply(ctx, config) {
2263
2277
  }
2264
2278
  });
2265
2279
  ctx.on("agent/pre-step", async ({ agent, turn, step, signal }, next) => {
2280
+ const tmuxContextProjectionHandle = await projectionReady;
2281
+ ctx.fiber.assertActive();
2266
2282
  const decision = await next();
2267
2283
  if (decision.kind === "reject" || signal.aborted || step !== 1) return decision;
2268
2284
  const bash = ctx.get("shell");
2269
2285
  if (bash === void 0) return decision;
2270
- const previous = ctx.sessionProjections.stateOf(agent.session, "tmuxContext");
2286
+ const previous = tmuxContextProjectionHandle.stateOf(agent.session);
2271
2287
  if (refreshIntervalMs !== void 0 && refreshIntervalMs > 0 && previous !== null) {
2272
2288
  const now = Date.now();
2273
2289
  if (now >= previous.time && now - previous.time < refreshIntervalMs) return decision;
@@ -2295,6 +2311,7 @@ function apply(ctx, config) {
2295
2311
  }), ...decision.messages]
2296
2312
  };
2297
2313
  }, { prepend: true });
2314
+ await projectionReady;
2298
2315
  }
2299
2316
  //#endregion
2300
2317
  export { Config, apply, inject, name };
@@ -19,7 +19,6 @@
19
19
  */
20
20
  import type { Context } from '@deepseek-ai/cordis';
21
21
  import z from '@deepseek-ai/schemastery';
22
- import { z as zod } from 'zod';
23
22
  import type { ContextFormed } from '@deepseek-ai/dsh-llm';
24
23
  declare module '@deepseek-ai/dsh-llm' {
25
24
  interface MessageSourceMap {
@@ -43,23 +42,14 @@ export interface Config {
43
42
  }
44
43
  /** Schemastery validation for {@link Config}. */
45
44
  export declare const Config: z<Config>;
46
- declare const tmuxContextStateSchema: zod.ZodNullable<zod.ZodObject<{
47
- state: zod.ZodString;
48
- time: zod.ZodNumber;
49
- }, zod.core.$strip>>;
50
- type TmuxContextState = zod.infer<typeof tmuxContextStateSchema>;
51
45
  /**
52
46
  * Register a prepended pre-step listener for the lifetime of `ctx`.
47
+ * Steps admitted during activation await the projection registration; a
48
+ * registration failure or owner disposal prevents the request from proceeding.
53
49
  * @param ctx - plugin context; the listener is disposed with it.
54
50
  * @param config - durable refresh scheduling configuration.
51
+ * @returns when the listener and projection are ready.
55
52
  * @throws when the refresh interval is invalid.
56
53
  */
57
- declare module '@deepseek-ai/dsh-session-projection/types' {
58
- interface SessionProjectionStateMap {
59
- /** The stable state block of this plugin's latest durable injection, or null. */
60
- tmuxContext: TmuxContextState;
61
- }
62
- }
63
- export declare function apply(ctx: Context, config: Config): void;
64
- export {};
54
+ export declare function apply(ctx: Context, config: Config): Promise<void>;
65
55
  //# sourceMappingURL=index.d.ts.map
package/locale/de.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "tmux-Kontext",
4
+ "description": "Speichern Sie bei Bedarf die tmux-Bereichs- und Fensterpositionen für jeden Schritt."
5
+ }
6
+ }
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "tmux context",
4
+ "description": "Save tmux pane and window locations for each step when needed."
5
+ }
6
+ }
package/locale/es.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "contexto tmux",
4
+ "description": "Guarde las ubicaciones de las ventanas y paneles tmux para cada paso cuando sea necesario."
5
+ }
6
+ }
package/locale/fr.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "contexte tmux",
4
+ "description": "Enregistrez les emplacements du volet tmux et des fenêtres pour chaque étape si nécessaire."
5
+ }
6
+ }
package/locale/ja.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "tmux コンテキスト",
4
+ "description": "必要に応じて、各ステップの tmux ペインとウィンドウの位置情報を保存します。"
5
+ }
6
+ }
package/locale/pt.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "contexto tmux",
4
+ "description": "Salve os locais do painel e da janela do tmux para cada etapa, quando necessário."
5
+ }
6
+ }
package/locale/ru.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "контекст tmux",
4
+ "description": "При необходимости сохраняйте расположение панели tmux и окон для каждого шага."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "tmux 上下文",
4
+ "description": "按需保存每一步的 tmux 窗格与窗口位置信息。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-tmux-context",
3
3
  "description": "Opt-in durable per-step context with this agent's tmux pane and window location",
4
- "version": "0.2.1-rc.3",
4
+ "version": "0.2.2-alpha.2",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -19,32 +19,34 @@
19
19
  "default": "./lib/index.js"
20
20
  },
21
21
  "./src/*": "./src/*",
22
+ "./locale/*.json": "./locale/*.json",
22
23
  "./package.json": "./package.json"
23
24
  },
24
25
  "files": [
26
+ "locale/*.json",
25
27
  "lib/index.js",
26
28
  "lib/types/**/*.d.ts"
27
29
  ],
28
30
  "license": "MIT",
29
31
  "dependencies": {
30
- "@deepseek-ai/schemastery": "~3.18.5",
32
+ "@deepseek-ai/schemastery": "~3.18.6-alpha.1",
31
33
  "zod": "4.4.3"
32
34
  },
33
35
  "peerDependencies": {
34
- "@deepseek-ai/dsh-agent": "0.2.1-rc.3",
35
- "@deepseek-ai/dsh-shell": "0.2.1-rc.3",
36
- "@deepseek-ai/dsh-session": "0.2.1-rc.3",
37
- "@deepseek-ai/cordis": "~4.0.5",
38
- "@deepseek-ai/dsh-session-projection": "0.2.1-rc.3"
36
+ "@deepseek-ai/dsh-agent": "0.2.2-alpha.2",
37
+ "@deepseek-ai/dsh-shell": "0.2.2-alpha.2",
38
+ "@deepseek-ai/dsh-session": "0.2.2-alpha.2",
39
+ "@deepseek-ai/cordis": "~4.0.6-alpha.1",
40
+ "@deepseek-ai/dsh-session-projection": "0.2.2-alpha.2"
39
41
  },
40
42
  "devDependencies": {
41
- "@deepseek-ai/dsh-agent": "0.2.1-rc.3",
42
- "@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-rc.3",
43
- "@deepseek-ai/dsh-shell": "0.2.1-rc.3",
44
- "@deepseek-ai/dsh-llm": "0.2.1-rc.3",
45
- "@deepseek-ai/dsh-session": "0.2.1-rc.3",
46
- "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.3",
47
- "@deepseek-ai/cordis": "~4.0.5",
48
- "@deepseek-ai/dsh-session-projection": "0.2.1-rc.3"
43
+ "@deepseek-ai/dsh-agent": "0.2.2-alpha.2",
44
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.2.2-alpha.2",
45
+ "@deepseek-ai/dsh-shell": "0.2.2-alpha.2",
46
+ "@deepseek-ai/dsh-llm": "0.2.2-alpha.2",
47
+ "@deepseek-ai/dsh-session": "0.2.2-alpha.2",
48
+ "@deepseek-ai/dsh-system-prompt": "0.2.2-alpha.2",
49
+ "@deepseek-ai/cordis": "~4.0.6-alpha.1",
50
+ "@deepseek-ai/dsh-session-projection": "0.2.2-alpha.2"
49
51
  }
50
52
  }