@deepseek-ai/dsh-tool-session-query 0.1.2-alpha.3 → 0.1.2-alpha.4

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
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/session-query/tool-session-query/README.md
5
- README.md: 6066c8466b0d161e80f96d1e667902ef30aa1d00
6
- README.zh.md: e509e2e8546cc535c56ddf5a6a4a1d608276a252
5
+ README.md: 729e7c6874939093a1f1c6d273ca40a36187cc72
6
+ README.zh.md: db2e3fa9f5d30150ae6fc66e44bac3bf7f1e1754
package/README.md CHANGED
@@ -184,3 +184,5 @@ This Dev Note is working context for maintainers: open design questions and dire
184
184
  Exact-string `cwd` equality is deliberately conservative; symlink-aware or canonical-path workspace identity would change which sessions share authority and is undecided.
185
185
 
186
186
  </details>
187
+
188
+ **Runtime invariant:** No companion is published. This read-only model adapter owns no event or mutable data relationship beyond the registries that already validate registration.
package/README.zh.md CHANGED
@@ -184,3 +184,5 @@ Use session_search to find relevant work from prior sessions, or session_event_s
184
184
  字符串精确 `cwd` 相等是刻意保守的选择;符号链接感知或规范路径的工作区身份会改变哪些会话共享权限,尚未决定。
185
185
 
186
186
  </details>
187
+
188
+ **运行时不变式:** 不发布伴生入口。这个只读模型 adapter 不持有其所属 registry 之外的事件或可变数据关系。
package/lib/index.js CHANGED
@@ -4,6 +4,7 @@ import { defineTool } from "@deepseek-ai/dsh-tools";
4
4
  import { brandString } from "@deepseek-ai/dsh-brand";
5
5
  import { SessionQueryError, extractSessionEventText } from "@deepseek-ai/dsh-session-query";
6
6
  import { HarnessError } from "@deepseek-ai/dsh-llm";
7
+ import { SessionSeq } from "@deepseek-ai/dsh-session";
7
8
  //#region lib/types/input.js
8
9
  /**
9
10
  * Model argument schemas, normalization, and filter construction.
@@ -446,7 +447,6 @@ function callerOf(exec, ctx) {
446
447
  return {
447
448
  id: agent.session.id,
448
449
  header: agent.session.header,
449
- events: agent.session.events,
450
450
  boundary: ctx.sessionProjections.stateOf(agent.session, "turnBoundary")
451
451
  };
452
452
  }
@@ -848,12 +848,13 @@ async function executeSessionTrace(ctx, args, exec) {
848
848
  }
849
849
  async function executeEventTrace(ctx, args, exec) {
850
850
  toolInput.assertNonNegativeSafeInteger("seq", args.seq);
851
+ const seq = SessionSeq(args.seq);
851
852
  const caller = workspaceAccess.callerOf(exec, ctx);
852
853
  const sessionId = workspaceAccess.targetId(args, caller);
853
854
  await workspaceAccess.authorizeTarget(ctx, caller, sessionId, exec.signal);
854
855
  const trace = await serviceBoundary.call(ctx, exec.signal, "event trace", () => ctx.sessionQuery.traceEvent({
855
856
  sessionId,
856
- seq: args.seq
857
+ seq
857
858
  }, exec.signal));
858
859
  workspaceAccess.assertObservedTargetAuthorized(caller, sessionId, trace.session);
859
860
  const title = await workspaceAccess.readTitle(ctx, caller, sessionId, exec.signal);
@@ -861,6 +862,7 @@ async function executeEventTrace(ctx, args, exec) {
861
862
  }
862
863
  async function executeEventRead(ctx, args, exec) {
863
864
  toolInput.assertNonNegativeSafeInteger("seq", args.seq);
865
+ const seq = SessionSeq(args.seq);
864
866
  if (args.before !== void 0) toolInput.assertNonNegativeSafeInteger("before", args.before);
865
867
  if (args.after !== void 0) toolInput.assertNonNegativeSafeInteger("after", args.after);
866
868
  const caller = workspaceAccess.callerOf(exec, ctx);
@@ -868,7 +870,7 @@ async function executeEventRead(ctx, args, exec) {
868
870
  await workspaceAccess.authorizeTarget(ctx, caller, sessionId, exec.signal);
869
871
  const window = await serviceBoundary.call(ctx, exec.signal, "event read", () => ctx.sessionQuery.readEvent({
870
872
  sessionId,
871
- seq: args.seq,
873
+ seq,
872
874
  ...args.before === void 0 ? {} : { before: args.before },
873
875
  ...args.after === void 0 ? {} : { after: args.after }
874
876
  }, exec.signal));
@@ -4,14 +4,13 @@
4
4
  * @module @deepseek-ai/dsh-tool-session-query/workspace-access
5
5
  */
6
6
  import type { Context } from '@deepseek-ai/cordis';
7
- import { type SessionEvent, type SessionHeader, type SessionId as SessionIdValue } from '@deepseek-ai/dsh-session';
7
+ import { type SessionHeader, type SessionId as SessionIdValue } from '@deepseek-ai/dsh-session';
8
8
  import type { TurnBoundaryProjection } from '@deepseek-ai/dsh-agent';
9
9
  import type { SessionLineageNode, SessionRecord } from '@deepseek-ai/dsh-session-query';
10
10
  import type { ToolRunContext } from '@deepseek-ai/dsh-tools';
11
11
  interface Caller {
12
12
  readonly id: SessionIdValue;
13
13
  readonly header: SessionHeader;
14
- readonly events: readonly SessionEvent[];
15
14
  /** The caller's own-session boundary fold (the `turnBoundary` projection). */
16
15
  readonly boundary: TurnBoundaryProjection | undefined;
17
16
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-tool-session-query",
3
3
  "description": "Workspace-authorized model-facing session history search, trace, and event read tools",
4
- "version": "0.1.2-alpha.3",
4
+ "version": "0.1.2-alpha.4",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -18,51 +18,44 @@
18
18
  "types": "./lib/types/index.d.ts",
19
19
  "default": "./lib/index.js"
20
20
  },
21
- "./invariant": {
22
- "types": "./lib/types/invariant.d.ts",
23
- "default": "./lib/invariant.js"
24
- },
25
21
  "./src/*": "./src/*",
26
22
  "./package.json": "./package.json"
27
23
  },
28
24
  "files": [
29
25
  "lib/index.js",
30
- "lib/invariant.js",
31
26
  "lib/types/**/*.d.ts"
32
27
  ],
33
28
  "license": "MIT",
34
29
  "peerDependencies": {
35
- "@deepseek-ai/dsh-agent": "^0.1.2-alpha.3",
36
- "@deepseek-ai/dsh-invariants": "^0.1.2-alpha.3",
37
- "@deepseek-ai/dsh-llm": "^0.1.2-alpha.3",
38
- "@deepseek-ai/dsh-session-projection": "^0.1.2-alpha.3",
39
- "@deepseek-ai/dsh-session-query": "^0.1.2-alpha.3",
40
- "@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.3",
41
- "@deepseek-ai/dsh-timeout": "^0.1.2-alpha.3",
42
- "@deepseek-ai/dsh-tools": "^0.1.2-alpha.3",
43
- "@deepseek-ai/dsh-session": "^0.1.2-alpha.3",
44
- "@deepseek-ai/cordis": "^4.0.2"
30
+ "@deepseek-ai/dsh-agent": "^0.1.2-alpha.4",
31
+ "@deepseek-ai/cordis": "^4.0.2",
32
+ "@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
33
+ "@deepseek-ai/dsh-session-projection": "^0.1.2-alpha.4",
34
+ "@deepseek-ai/dsh-session-query": "^0.1.2-alpha.4",
35
+ "@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.4",
36
+ "@deepseek-ai/dsh-timeout": "^0.1.2-alpha.4",
37
+ "@deepseek-ai/dsh-tools": "^0.1.2-alpha.4",
38
+ "@deepseek-ai/dsh-llm": "^0.1.2-alpha.4"
45
39
  },
46
40
  "dependencies": {
47
- "@deepseek-ai/schemastery": "^3.18.2",
48
- "@deepseek-ai/dsh-brand": "^0.1.2-alpha.3"
41
+ "@deepseek-ai/dsh-brand": "^0.1.2-alpha.4",
42
+ "@deepseek-ai/schemastery": "^3.18.2"
49
43
  },
50
44
  "devDependencies": {
51
45
  "@deepseek-ai/cordis": "^4.0.2",
52
- "@deepseek-ai/dsh-agent-loop": "^0.1.2-alpha.3",
53
- "@deepseek-ai/dsh-agent": "^0.1.2-alpha.3",
54
- "@deepseek-ai/dsh-invariants": "^0.1.2-alpha.3",
55
- "@deepseek-ai/dsh-llm": "^0.1.2-alpha.3",
56
- "@deepseek-ai/dsh-session": "^0.1.2-alpha.3",
57
- "@deepseek-ai/dsh-session-persistence": "^0.1.2-alpha.3",
58
- "@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.2-alpha.3",
59
- "@deepseek-ai/dsh-session-projection": "^0.1.2-alpha.3",
60
- "@deepseek-ai/dsh-session-query": "^0.1.2-alpha.3",
61
- "@deepseek-ai/dsh-session-query-sqlite": "^0.1.2-alpha.3",
62
- "@deepseek-ai/dsh-session-title": "^0.1.2-alpha.3",
63
- "@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.3",
64
- "@deepseek-ai/dsh-timeout": "^0.1.2-alpha.3",
65
- "@deepseek-ai/dsh-tool-call-timeout-policy": "^0.1.2-alpha.3",
66
- "@deepseek-ai/dsh-tools": "^0.1.2-alpha.3"
46
+ "@deepseek-ai/dsh-agent": "^0.1.2-alpha.4",
47
+ "@deepseek-ai/dsh-agent-loop": "^0.1.2-alpha.4",
48
+ "@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
49
+ "@deepseek-ai/dsh-session-persistence": "^0.1.2-alpha.4",
50
+ "@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.2-alpha.4",
51
+ "@deepseek-ai/dsh-session-projection": "^0.1.2-alpha.4",
52
+ "@deepseek-ai/dsh-session-query": "^0.1.2-alpha.4",
53
+ "@deepseek-ai/dsh-session-title": "^0.1.2-alpha.4",
54
+ "@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.4",
55
+ "@deepseek-ai/dsh-timeout": "^0.1.2-alpha.4",
56
+ "@deepseek-ai/dsh-session-query-sqlite": "^0.1.2-alpha.4",
57
+ "@deepseek-ai/dsh-tool-call-timeout-policy": "^0.1.2-alpha.4",
58
+ "@deepseek-ai/dsh-llm": "^0.1.2-alpha.4",
59
+ "@deepseek-ai/dsh-tools": "^0.1.2-alpha.4"
67
60
  }
68
61
  }
package/lib/invariant.js DELETED
@@ -1,23 +0,0 @@
1
- //#region lib/types/invariant.js
2
- /**
3
- * Package-owned invariant companion for `@deepseek-ai/dsh-tool-session-query`.
4
- * @module @deepseek-ai/dsh-tool-session-query/invariant
5
- */
6
- const PACKAGE_NAME = "@deepseek-ai/dsh-tool-session-query";
7
- /** Cordis companion plugin name. */
8
- const name = "tool-session-query-invariant";
9
- /** Service required before the companion can reserve package ownership. */
10
- const inject = ["invariants"];
11
- /**
12
- * No runtime invariant: this read-only model adapter owns no event or mutable
13
- * data relationship beyond the registries that already validate registration.
14
- */
15
- const install = () => {};
16
- /**
17
- * Register this package's invariant companion.
18
- * @param ctx - Cordis context carrying the invariant service.
19
- * @returns the installed registration's disposer after setup succeeds.
20
- */
21
- const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
22
- //#endregion
23
- export { apply, inject, name };
@@ -1,16 +0,0 @@
1
- /**
2
- * Package-owned invariant companion for `@deepseek-ai/dsh-tool-session-query`.
3
- * @module @deepseek-ai/dsh-tool-session-query/invariant
4
- */
5
- import type { Context } from '@deepseek-ai/cordis';
6
- /** Cordis companion plugin name. */
7
- export declare const name = "tool-session-query-invariant";
8
- /** Service required before the companion can reserve package ownership. */
9
- export declare const inject: string[];
10
- /**
11
- * Register this package's invariant companion.
12
- * @param ctx - Cordis context carrying the invariant service.
13
- * @returns the installed registration's disposer after setup succeeds.
14
- */
15
- export declare const apply: (ctx: Context) => Promise<() => void>;
16
- //# sourceMappingURL=invariant.d.ts.map