@opendikw/web-client 0.1.0-rc.1 → 0.1.0-rc.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.md CHANGED
@@ -29,3 +29,7 @@ this README and the MIT license. Import through `exports`, not package source pa
29
29
  Source provenance: extracted from OpenDIKW/dikw-web at
30
30
  `c924b157747f737be56f8c3361068d3d543c86e9`; original commit history and authors
31
31
  remain in that repository.
32
+
33
+ For document Q&A, createSession(signal, { pagePath: "sources/paper.md" }) binds an
34
+ immutable evidence scope to the session. Omit the second argument for existing
35
+ whole-base conversations. Session.scope exposes the server-confirmed path.
@@ -1,4 +1,4 @@
1
- import type { AgentSession, AgentStreamEvent, SessionSummary } from "../types/agent.js";
1
+ import type { AgentSession, AgentSessionScope, AgentStreamEvent, SessionSummary } from "../types/agent.js";
2
2
  import type { SessionTraceView } from "../types/trace.js";
3
3
  export interface AgentClientOptions {
4
4
  coreUrl?: string;
@@ -13,7 +13,7 @@ export declare class AgentClient {
13
13
  private readonly options;
14
14
  constructor(options?: AgentClientOptions);
15
15
  listSessions(signal?: AbortSignal): Promise<SessionSummary[]>;
16
- createSession(signal?: AbortSignal): Promise<AgentSession>;
16
+ createSession(signal?: AbortSignal, scope?: AgentSessionScope): Promise<AgentSession>;
17
17
  getSession(sessionId: string, signal?: AbortSignal): Promise<AgentSession>;
18
18
  getSessionTraces(sessionId: string, signal?: AbortSignal): Promise<SessionTraceView>;
19
19
  renameSession(sessionId: string, title: string, signal?: AbortSignal): Promise<AgentSession>;
@@ -17,8 +17,12 @@ export class AgentClient {
17
17
  async listSessions(signal) {
18
18
  return requestJson("/agent/sessions", { signal });
19
19
  }
20
- async createSession(signal) {
21
- return requestJson("/agent/sessions", { method: "POST", signal });
20
+ async createSession(signal, scope) {
21
+ return requestJson("/agent/sessions", {
22
+ method: "POST",
23
+ ...(scope ? { body: JSON.stringify({ scope }) } : {}),
24
+ signal,
25
+ });
22
26
  }
23
27
  async getSession(sessionId, signal) {
24
28
  return requestJson(`/agent/sessions/${encodeURIComponent(sessionId)}`, {
@@ -46,7 +46,12 @@ export interface SessionSummary {
46
46
  messageCount: number;
47
47
  lastMessagePreview: string;
48
48
  }
49
+ export interface AgentSessionScope {
50
+ /** Immutable evidence scope; omitted sessions retain whole-base retrieval. */
51
+ pagePath: string;
52
+ }
49
53
  export interface AgentSession extends SessionSummary {
54
+ scope?: AgentSessionScope;
50
55
  messages: AgentMessage[];
51
56
  toolEvents: AgentToolEvent[];
52
57
  sources: AgentSource[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendikw/web-client",
3
- "version": "0.1.0-rc.1",
3
+ "version": "0.1.0-rc.2",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "engines": {