@a2anet/a2a-utils 0.1.0 → 0.3.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/README.md +1412 -2
- package/dist/artifacts/data.d.ts +118 -0
- package/dist/artifacts/data.d.ts.map +1 -0
- package/dist/artifacts/data.js +583 -0
- package/dist/artifacts/data.js.map +1 -0
- package/dist/artifacts/index.d.ts +33 -0
- package/dist/artifacts/index.d.ts.map +1 -0
- package/dist/artifacts/index.js +131 -0
- package/dist/artifacts/index.js.map +1 -0
- package/dist/artifacts/text.d.ts +54 -0
- package/dist/artifacts/text.d.ts.map +1 -0
- package/dist/artifacts/text.js +151 -0
- package/dist/artifacts/text.js.map +1 -0
- package/dist/client/a2a-session.d.ts +94 -0
- package/dist/client/a2a-session.d.ts.map +1 -0
- package/dist/client/a2a-session.js +264 -0
- package/dist/client/a2a-session.js.map +1 -0
- package/dist/client/a2a-tools.d.ts +152 -0
- package/dist/client/a2a-tools.d.ts.map +1 -0
- package/dist/client/a2a-tools.js +470 -0
- package/dist/client/a2a-tools.js.map +1 -0
- package/dist/client/agent-manager.d.ts +94 -0
- package/dist/client/agent-manager.d.ts.map +1 -0
- package/dist/client/agent-manager.js +243 -0
- package/dist/client/agent-manager.js.map +1 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +7 -0
- package/dist/client/index.js.map +1 -0
- package/dist/files/file-store.d.ts +24 -0
- package/dist/files/file-store.d.ts.map +1 -0
- package/dist/files/file-store.js +5 -0
- package/dist/files/file-store.js.map +1 -0
- package/dist/files/index.d.ts +3 -0
- package/dist/files/index.d.ts.map +1 -0
- package/dist/files/index.js +5 -0
- package/dist/files/index.js.map +1 -0
- package/dist/files/local-file-store.d.ts +26 -0
- package/dist/files/local-file-store.d.ts.map +1 -0
- package/dist/files/local-file-store.js +99 -0
- package/dist/files/local-file-store.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/tasks/index.d.ts +2 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +5 -0
- package/dist/tasks/index.js.map +1 -0
- package/dist/tasks/json-task-store.d.ts +32 -0
- package/dist/tasks/json-task-store.d.ts.map +1 -0
- package/dist/tasks/json-task-store.js +66 -0
- package/dist/tasks/json-task-store.js.map +1 -0
- package/dist/types.d.ts +65 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +23 -0
- package/dist/types.js.map +1 -0
- package/package.json +17 -4
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/** Data artifact operations: viewing and minimization. */
|
|
2
|
+
export declare class DataArtifacts {
|
|
3
|
+
/**
|
|
4
|
+
* View structured data with optional filtering.
|
|
5
|
+
*
|
|
6
|
+
* @param data - The data to view.
|
|
7
|
+
* @param opts.jsonPath - Optional dot-separated path to extract specific fields.
|
|
8
|
+
* @param opts.rows - Optional row selection.
|
|
9
|
+
* @param opts.columns - Optional column selection.
|
|
10
|
+
* @param opts.characterLimit - Maximum output size in characters.
|
|
11
|
+
*
|
|
12
|
+
* @returns Filtered data.
|
|
13
|
+
*
|
|
14
|
+
* @throws Error if parameters are invalid.
|
|
15
|
+
*/
|
|
16
|
+
static view(data: unknown, opts?: {
|
|
17
|
+
jsonPath?: string | null;
|
|
18
|
+
rows?: number | number[] | string | null;
|
|
19
|
+
columns?: string | string[] | null;
|
|
20
|
+
characterLimit?: number;
|
|
21
|
+
}): unknown;
|
|
22
|
+
/**
|
|
23
|
+
* Minimize data content for display based on type.
|
|
24
|
+
*
|
|
25
|
+
* @param data - The data to minimize.
|
|
26
|
+
* @param opts.characterLimit - Character limit above which to minimize.
|
|
27
|
+
* @param opts.minimizedObjectStringLength - Max length for string values in objects.
|
|
28
|
+
* @param opts.tip - Tip to include. Defaults to null (no tip); pass a string to include one.
|
|
29
|
+
*
|
|
30
|
+
* @returns Minimized representation with "data" or "text" key.
|
|
31
|
+
*/
|
|
32
|
+
static minimize(data: unknown, opts?: {
|
|
33
|
+
characterLimit?: number;
|
|
34
|
+
minimizedObjectStringLength?: number;
|
|
35
|
+
tip?: string | null;
|
|
36
|
+
}): Record<string, unknown>;
|
|
37
|
+
/**
|
|
38
|
+
* Generate a comprehensive summary of tabular data (list of objects).
|
|
39
|
+
*
|
|
40
|
+
* @param data - List of objects representing table rows.
|
|
41
|
+
*
|
|
42
|
+
* @returns List of column summaries, or the original data if the summary
|
|
43
|
+
* would be larger (inflation guard).
|
|
44
|
+
*/
|
|
45
|
+
static summarizeTable(data: Record<string, unknown>[]): Record<string, unknown>[] | Record<string, unknown>[];
|
|
46
|
+
/**
|
|
47
|
+
* Generate a summary of a list of values (like a single column).
|
|
48
|
+
*
|
|
49
|
+
* @param values - List of values to summarize.
|
|
50
|
+
*
|
|
51
|
+
* @returns Object with column-like statistics, or the original list if
|
|
52
|
+
* the summary would be larger (inflation guard).
|
|
53
|
+
*/
|
|
54
|
+
static summarizeValues(values: unknown[]): Record<string, unknown> | unknown[];
|
|
55
|
+
/**
|
|
56
|
+
* Minimize an object for display.
|
|
57
|
+
*
|
|
58
|
+
* If JSON-stringified length is <= characterLimit chars, return it in full.
|
|
59
|
+
* If > characterLimit chars, show all keys but truncate string values and summarize lists.
|
|
60
|
+
*
|
|
61
|
+
* @param obj - The object to minimize.
|
|
62
|
+
* @param opts.characterLimit - Character limit above which to minimize.
|
|
63
|
+
* @param opts.minimizedObjectStringLength - Max length for string values.
|
|
64
|
+
* @param opts.tip - Tip to include. Defaults to null (no tip); pass a string to include one.
|
|
65
|
+
*
|
|
66
|
+
* @returns Object with "data" key containing the minimized content.
|
|
67
|
+
*/
|
|
68
|
+
private static minimizeObject;
|
|
69
|
+
/**
|
|
70
|
+
* Evaluate a JSONPath-like expression for field access only.
|
|
71
|
+
*
|
|
72
|
+
* Supports:
|
|
73
|
+
* - "field" - top-level field
|
|
74
|
+
* - "field.nested" - nested field access
|
|
75
|
+
*
|
|
76
|
+
* Does NOT support array indexing - use rows/columns parameters instead.
|
|
77
|
+
*
|
|
78
|
+
* @param data - The data to query.
|
|
79
|
+
* @param path - The dot-separated field path.
|
|
80
|
+
*
|
|
81
|
+
* @returns The extracted value.
|
|
82
|
+
*
|
|
83
|
+
* @throws TypeError if trying to access field on non-object.
|
|
84
|
+
* @throws Error if field doesn't exist.
|
|
85
|
+
*/
|
|
86
|
+
private static evaluateJsonPath;
|
|
87
|
+
/**
|
|
88
|
+
* Parse the row selection parameter into a list of row indices.
|
|
89
|
+
*
|
|
90
|
+
* @param rows - Can be a single row index (number), list of indices, range string ("0-10"), or "all".
|
|
91
|
+
* @param totalRows - Total number of rows in the dataset.
|
|
92
|
+
*
|
|
93
|
+
* @returns List of row indices to include.
|
|
94
|
+
*/
|
|
95
|
+
private static parseRowSelection;
|
|
96
|
+
/**
|
|
97
|
+
* Parse the column selection parameter into a list of column names.
|
|
98
|
+
*
|
|
99
|
+
* @param columns - Can be a single column name (string), list of column names, or "all".
|
|
100
|
+
* @param availableColumns - List of all available column names in the dataset.
|
|
101
|
+
*
|
|
102
|
+
* @returns List of column names to include.
|
|
103
|
+
*/
|
|
104
|
+
private static parseColumnSelection;
|
|
105
|
+
/**
|
|
106
|
+
* Filter data by row indices and column names.
|
|
107
|
+
*
|
|
108
|
+
* @param data - The full dataset.
|
|
109
|
+
* @param rowIndices - List of row indices to include.
|
|
110
|
+
* @param columnNames - List of column names to include.
|
|
111
|
+
*
|
|
112
|
+
* @returns Filtered data.
|
|
113
|
+
*/
|
|
114
|
+
private static filterDataByRowsAndColumns;
|
|
115
|
+
/** Recursively minimize values in an object. */
|
|
116
|
+
private static minimizeObjectValues;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/artifacts/data.ts"],"names":[],"mappings":"AAiEA,0DAA0D;AA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