@dmsfe/data-agent-sdk 0.1.0
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/CHANGES.md +33 -0
- package/LICENSE +201 -0
- package/README.md +212 -0
- package/lib/index.cjs +30 -0
- package/lib/index.d.cts +60 -0
- package/lib/index.d.ts +60 -0
- package/lib/index.js +30 -0
- package/lib/render/index.cjs +24 -0
- package/lib/render/index.d.cts +31 -0
- package/lib/render/index.d.ts +31 -0
- package/lib/render/index.js +24 -0
- package/lib/task-finish-CMXO70b5.d.cts +52 -0
- package/lib/task-finish-CMXO70b5.d.ts +52 -0
- package/package.json +65 -0
package/lib/index.d.cts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { T as TaskFinishToolArgs, C as ContentType, a as TaskFinishChart, b as ChartData } from './task-finish-CMXO70b5.cjs';
|
|
2
|
+
export { c as ChartType, e as TaskFinishChartData, d as TaskFinishCharts } from './task-finish-CMXO70b5.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* COPIED FROM apps/data-agent/src/browser/model/agent-messages/schemas/data-agent-message-chunk-schema.ts
|
|
6
|
+
* on 2026-05-16. Reduced to P1-needed fields; MessageCategoryEnum is collapsed
|
|
7
|
+
* to a passthrough string so any non-task_finish category routes to
|
|
8
|
+
* { type: 'unknown', raw: chunk } in the parser.
|
|
9
|
+
*
|
|
10
|
+
* If you modify this file, run `pnpm run check:schema-drift`.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
interface DataAgentMessagesChunk {
|
|
14
|
+
event_type: string;
|
|
15
|
+
category: string;
|
|
16
|
+
content: string;
|
|
17
|
+
content_type: 'str' | 'json';
|
|
18
|
+
checkpoint: number;
|
|
19
|
+
level: number;
|
|
20
|
+
timestamp?: string | number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface TaskFinishEvent {
|
|
24
|
+
type: 'task_finish';
|
|
25
|
+
payload: TaskFinishToolArgs;
|
|
26
|
+
}
|
|
27
|
+
interface UnknownEvent {
|
|
28
|
+
type: 'unknown';
|
|
29
|
+
raw: DataAgentMessagesChunk | {
|
|
30
|
+
error: unknown;
|
|
31
|
+
rawValue?: unknown;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
type DataAgentEvent = TaskFinishEvent | UnknownEvent;
|
|
35
|
+
|
|
36
|
+
declare function parseDataAgentSSE(stream: ReadableStream<Uint8Array>, options?: {
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
}): AsyncGenerator<DataAgentEvent>;
|
|
39
|
+
|
|
40
|
+
declare function parseDataAgentChunks(chunks: unknown[]): DataAgentEvent[];
|
|
41
|
+
declare function parseDataAgentChunks(chunks: AsyncIterable<unknown> | Iterable<unknown>, options?: {
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
}): AsyncIterable<DataAgentEvent>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* COPIED logic FROM apps/data-agent/src/browser/view/components/chat/tools/task-finish/utils.ts
|
|
47
|
+
* on 2026-05-16. Adapted to remove app-internal imports.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
type ParsedTaskFinishContent = {
|
|
51
|
+
type: 'markdown';
|
|
52
|
+
content: string;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'charts';
|
|
55
|
+
charts: TaskFinishChart[];
|
|
56
|
+
};
|
|
57
|
+
declare function parseTaskFinishContent(content: string, contentType?: ContentType): ParsedTaskFinishContent;
|
|
58
|
+
declare function parseChartData(jsonString: string): ChartData | null;
|
|
59
|
+
|
|
60
|
+
export { ChartData, ContentType, type DataAgentEvent, type ParsedTaskFinishContent, TaskFinishChart, type TaskFinishEvent, TaskFinishToolArgs, type UnknownEvent, parseChartData, parseDataAgentChunks, parseDataAgentSSE, parseTaskFinishContent };
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { T as TaskFinishToolArgs, C as ContentType, a as TaskFinishChart, b as ChartData } from './task-finish-CMXO70b5.js';
|
|
2
|
+
export { c as ChartType, e as TaskFinishChartData, d as TaskFinishCharts } from './task-finish-CMXO70b5.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* COPIED FROM apps/data-agent/src/browser/model/agent-messages/schemas/data-agent-message-chunk-schema.ts
|
|
6
|
+
* on 2026-05-16. Reduced to P1-needed fields; MessageCategoryEnum is collapsed
|
|
7
|
+
* to a passthrough string so any non-task_finish category routes to
|
|
8
|
+
* { type: 'unknown', raw: chunk } in the parser.
|
|
9
|
+
*
|
|
10
|
+
* If you modify this file, run `pnpm run check:schema-drift`.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
interface DataAgentMessagesChunk {
|
|
14
|
+
event_type: string;
|
|
15
|
+
category: string;
|
|
16
|
+
content: string;
|
|
17
|
+
content_type: 'str' | 'json';
|
|
18
|
+
checkpoint: number;
|
|
19
|
+
level: number;
|
|
20
|
+
timestamp?: string | number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface TaskFinishEvent {
|
|
24
|
+
type: 'task_finish';
|
|
25
|
+
payload: TaskFinishToolArgs;
|
|
26
|
+
}
|
|
27
|
+
interface UnknownEvent {
|
|
28
|
+
type: 'unknown';
|
|
29
|
+
raw: DataAgentMessagesChunk | {
|
|
30
|
+
error: unknown;
|
|
31
|
+
rawValue?: unknown;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
type DataAgentEvent = TaskFinishEvent | UnknownEvent;
|
|
35
|
+
|
|
36
|
+
declare function parseDataAgentSSE(stream: ReadableStream<Uint8Array>, options?: {
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
}): AsyncGenerator<DataAgentEvent>;
|
|
39
|
+
|
|
40
|
+
declare function parseDataAgentChunks(chunks: unknown[]): DataAgentEvent[];
|
|
41
|
+
declare function parseDataAgentChunks(chunks: AsyncIterable<unknown> | Iterable<unknown>, options?: {
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
}): AsyncIterable<DataAgentEvent>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* COPIED logic FROM apps/data-agent/src/browser/view/components/chat/tools/task-finish/utils.ts
|
|
47
|
+
* on 2026-05-16. Adapted to remove app-internal imports.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
type ParsedTaskFinishContent = {
|
|
51
|
+
type: 'markdown';
|
|
52
|
+
content: string;
|
|
53
|
+
} | {
|
|
54
|
+
type: 'charts';
|
|
55
|
+
charts: TaskFinishChart[];
|
|
56
|
+
};
|
|
57
|
+
declare function parseTaskFinishContent(content: string, contentType?: ContentType): ParsedTaskFinishContent;
|
|
58
|
+
declare function parseChartData(jsonString: string): ChartData | null;
|
|
59
|
+
|
|
60
|
+
export { ChartData, ContentType, type DataAgentEvent, type ParsedTaskFinishContent, TaskFinishChart, type TaskFinishEvent, TaskFinishToolArgs, type UnknownEvent, parseChartData, parseDataAgentChunks, parseDataAgentSSE, parseTaskFinishContent };
|