@openagentpack/sdk 0.3.2 → 0.4.0-beta-2472720-20260827

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.
@@ -19,6 +19,8 @@ function toSessionEvent(raw) {
19
19
  const event = { type, raw_type: rawType, raw };
20
20
  if (typeof raw.id === "string") event.id = raw.id;
21
21
  if (typeof raw.role === "string") event.role = raw.role;
22
+ const threadId = extractSessionThreadId(raw);
23
+ if (threadId) event.session_thread_id = threadId;
22
24
  if (type === "message") {
23
25
  if (event.role === void 0) {
24
26
  if (rawType === "thread_message_sent") event.role = "user";
@@ -46,6 +48,17 @@ function toSessionEvent(raw) {
46
48
  }
47
49
  return event;
48
50
  }
51
+ function extractSessionThreadId(raw) {
52
+ if (typeof raw.session_thread_id === "string") return raw.session_thread_id;
53
+ const metadata = raw.metadata;
54
+ if (metadata && typeof metadata === "object" && !Array.isArray(metadata)) {
55
+ const value = metadata.session_thread_id;
56
+ if (typeof value === "string") return value;
57
+ }
58
+ const data = firstContentData(raw);
59
+ if (typeof data?.session_thread_id === "string") return data.session_thread_id;
60
+ return void 0;
61
+ }
49
62
  function extractContentText(raw) {
50
63
  const content = raw.content;
51
64
  if (typeof content === "string") return content;
@@ -7,6 +7,11 @@ interface ProviderFileInfo {
7
7
  downloadable?: boolean;
8
8
  status?: string;
9
9
  purpose?: string;
10
+ scope?: {
11
+ type?: string;
12
+ id?: string;
13
+ };
14
+ attributes?: Record<string, unknown>;
10
15
  }
11
16
 
12
17
  export type { ProviderFileInfo as P };
@@ -1,4 +1,4 @@
1
- import { P as ProviderFileInfo } from './file-URqwlxLf.js';
1
+ import { P as ProviderFileInfo } from './file-Cj5-Vx27.js';
2
2
 
3
3
  /** Neutral file scan status after provider wire normalization. */
4
4
  type NeutralFileStatus = "available" | "checking" | "rejected" | "type_rejected";