@a2anet/a2a-utils 0.1.0 → 0.4.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-agents.d.ts +94 -0
- package/dist/client/a2a-agents.d.ts.map +1 -0
- package/dist/client/a2a-agents.js +243 -0
- package/dist/client/a2a-agents.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/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,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FileStore abstract interface.
|
|
3
|
+
*/
|
|
4
|
+
import type { Artifact } from "@a2a-js/sdk";
|
|
5
|
+
/** Abstract interface for file storage. */
|
|
6
|
+
export interface FileStore {
|
|
7
|
+
/**
|
|
8
|
+
* Save file parts from an artifact.
|
|
9
|
+
*
|
|
10
|
+
* Returns list of storage locations where files were saved
|
|
11
|
+
* (e.g. local paths, cloud URIs, etc.).
|
|
12
|
+
*/
|
|
13
|
+
save(taskId: string, artifact: Artifact): Promise<string[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Get storage locations for a saved artifact's files.
|
|
16
|
+
* Returns empty list if not found.
|
|
17
|
+
*/
|
|
18
|
+
get(taskId: string, artifactId: string): Promise<string[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Delete saved files for an artifact.
|
|
21
|
+
*/
|
|
22
|
+
delete(taskId: string, artifactId: string): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=file-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-store.d.ts","sourceRoot":"","sources":["../../src/files/file-store.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,2CAA2C;AAC3C,MAAM,WAAW,SAAS;IACtB;;;;;OAKG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE5D;;;OAGG;IACH,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE3D;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-store.js","sourceRoot":"","sources":["../../src/files/file-store.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,sCAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/files/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/files/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,sCAAsC;AAGtC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Artifact } from "@a2a-js/sdk";
|
|
2
|
+
import type { FileStore } from "./file-store.js";
|
|
3
|
+
/**
|
|
4
|
+
* Store artifact files on the local filesystem.
|
|
5
|
+
*
|
|
6
|
+
* Files are saved to ``storageDir/taskId/artifactId/filename``.
|
|
7
|
+
*/
|
|
8
|
+
export declare class LocalFileStore implements FileStore {
|
|
9
|
+
private readonly storageDir;
|
|
10
|
+
constructor(storageDir: string);
|
|
11
|
+
/**
|
|
12
|
+
* Save file parts from an artifact to disk.
|
|
13
|
+
*
|
|
14
|
+
* Returns list of local file paths where files were saved.
|
|
15
|
+
*/
|
|
16
|
+
save(taskId: string, artifact: Artifact): Promise<string[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Get file paths for a saved artifact.
|
|
19
|
+
*
|
|
20
|
+
* Returns list of paths, or empty list if directory does not exist.
|
|
21
|
+
*/
|
|
22
|
+
get(taskId: string, artifactId: string): Promise<string[]>;
|
|
23
|
+
/** Delete saved files for an artifact. */
|
|
24
|
+
delete(taskId: string, artifactId: string): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=local-file-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-file-store.d.ts","sourceRoot":"","sources":["../../src/files/local-file-store.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;GAIG;AACH,qBAAa,cAAe,YAAW,SAAS;IAC5C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAExB,UAAU,EAAE,MAAM;IAM9B;;;;OAIG;IACG,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IA8CjE;;;;OAIG;IACG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAkBhE,0CAA0C;IACpC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAQlE"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2025-present A2A Net <hello@a2anet.com>
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
/**
|
|
5
|
+
* LocalFileStore — filesystem-backed file storage.
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from "node:fs/promises";
|
|
8
|
+
import * as path from "node:path";
|
|
9
|
+
/**
|
|
10
|
+
* Store artifact files on the local filesystem.
|
|
11
|
+
*
|
|
12
|
+
* Files are saved to ``storageDir/taskId/artifactId/filename``.
|
|
13
|
+
*/
|
|
14
|
+
export class LocalFileStore {
|
|
15
|
+
storageDir;
|
|
16
|
+
constructor(storageDir) {
|
|
17
|
+
this.storageDir = storageDir;
|
|
18
|
+
// Ensure storage dir exists (sync in constructor, matching Python)
|
|
19
|
+
fs.mkdir(storageDir, { recursive: true }).catch(() => { });
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Save file parts from an artifact to disk.
|
|
23
|
+
*
|
|
24
|
+
* Returns list of local file paths where files were saved.
|
|
25
|
+
*/
|
|
26
|
+
async save(taskId, artifact) {
|
|
27
|
+
const savedPaths = [];
|
|
28
|
+
const artifactDir = path.join(this.storageDir, taskId, artifact.artifactId);
|
|
29
|
+
for (let i = 0; i < artifact.parts.length; i++) {
|
|
30
|
+
const part = artifact.parts[i];
|
|
31
|
+
if (part.kind !== "file") {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
const fileObj = part.file;
|
|
35
|
+
let name = fileObj.name ? path.basename(fileObj.name) : `file_${i}`;
|
|
36
|
+
name = name.replace(/\.\./g, "").replace(/^\.+/, "");
|
|
37
|
+
if (!name) {
|
|
38
|
+
name = `file_${i}`;
|
|
39
|
+
}
|
|
40
|
+
await fs.mkdir(artifactDir, { recursive: true });
|
|
41
|
+
const filePath = path.join(artifactDir, name);
|
|
42
|
+
// Path traversal check
|
|
43
|
+
const resolvedPath = path.resolve(filePath);
|
|
44
|
+
const resolvedDir = path.resolve(artifactDir);
|
|
45
|
+
const relative = path.relative(resolvedDir, resolvedPath);
|
|
46
|
+
if (relative.startsWith("..") || path.isAbsolute(relative)) {
|
|
47
|
+
throw new Error(`Filename '${fileObj.name}' resolves outside storage directory`);
|
|
48
|
+
}
|
|
49
|
+
if ("bytes" in fileObj) {
|
|
50
|
+
const data = Buffer.from(fileObj.bytes, "base64");
|
|
51
|
+
await fs.writeFile(filePath, data);
|
|
52
|
+
}
|
|
53
|
+
else if ("uri" in fileObj) {
|
|
54
|
+
const response = await fetch(fileObj.uri);
|
|
55
|
+
if (!response.ok) {
|
|
56
|
+
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
57
|
+
}
|
|
58
|
+
const buffer = Buffer.from(await response.arrayBuffer());
|
|
59
|
+
await fs.writeFile(filePath, buffer);
|
|
60
|
+
}
|
|
61
|
+
savedPaths.push(filePath);
|
|
62
|
+
}
|
|
63
|
+
return savedPaths;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get file paths for a saved artifact.
|
|
67
|
+
*
|
|
68
|
+
* Returns list of paths, or empty list if directory does not exist.
|
|
69
|
+
*/
|
|
70
|
+
async get(taskId, artifactId) {
|
|
71
|
+
const artifactDir = path.join(this.storageDir, taskId, artifactId);
|
|
72
|
+
try {
|
|
73
|
+
const entries = await fs.readdir(artifactDir);
|
|
74
|
+
const files = [];
|
|
75
|
+
for (const entry of entries.sort()) {
|
|
76
|
+
const filePath = path.join(artifactDir, entry);
|
|
77
|
+
const stat = await fs.stat(filePath);
|
|
78
|
+
if (stat.isFile()) {
|
|
79
|
+
files.push(filePath);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return files;
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** Delete saved files for an artifact. */
|
|
89
|
+
async delete(taskId, artifactId) {
|
|
90
|
+
const artifactDir = path.join(this.storageDir, taskId, artifactId);
|
|
91
|
+
try {
|
|
92
|
+
await fs.rm(artifactDir, { recursive: true, force: true });
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
// Ignore if doesn't exist
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=local-file-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-file-store.js","sourceRoot":"","sources":["../../src/files/local-file-store.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,sCAAsC;AAEtC;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC;;;;GAIG;AACH,MAAM,OAAO,cAAc;IACN,UAAU,CAAS;IAEpC,YAAY,UAAkB;QAC1B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,mEAAmE;QACnE,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,IAAI,CAAC,MAAc,EAAE,QAAkB;QACzC,MAAM,UAAU,GAAa,EAAE,CAAC;QAChC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;QAE5E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC/B,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBACvB,SAAS;YACb,CAAC;YAED,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC;YAC1B,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,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G,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QACnE,IAAI,CAAC;YACD,MAAM,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/D,CAAC;QAAC,MAAM,CAAC;YACL,0BAA0B;QAC9B,CAAC;IACL,CAAC;CACJ"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const VERSION = "0.4.0";
|
|
2
|
+
export { A2ASession } from "./client/a2a-session.js";
|
|
3
|
+
export { A2ATools } from "./client/a2a-tools.js";
|
|
4
|
+
export { A2AAgents } from "./client/a2a-agents.js";
|
|
5
|
+
export { JSONTaskStore } from "./tasks/json-task-store.js";
|
|
6
|
+
export { DataArtifacts, TextArtifacts, minimizeArtifacts } from "./artifacts/index.js";
|
|
7
|
+
export type { FileStore } from "./files/file-store.js";
|
|
8
|
+
export { LocalFileStore } from "./files/local-file-store.js";
|
|
9
|
+
export type { AgentURLAndCustomHeaders, ArtifactForLLM, DataPartForLLM, FilePartForLLM, MessageForLLM, TaskForLLM, TaskStatusForLLM, TextPartForLLM, } from "./types.js";
|
|
10
|
+
export { ArtifactSettings, TERMINAL_OR_ACTIONABLE_STATES } from "./types.js";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,UAAU,CAAC;AAG/B,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGvF,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,YAAY,EACR,wBAAwB,EACxB,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,cAAc,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2025-present A2A Net <hello@a2anet.com>
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
export const VERSION = "0.4.0"; // x-release-please-version
|
|
5
|
+
// Core
|
|
6
|
+
export { A2ASession } from "./client/a2a-session.js";
|
|
7
|
+
export { A2ATools } from "./client/a2a-tools.js";
|
|
8
|
+
export { A2AAgents } from "./client/a2a-agents.js";
|
|
9
|
+
export { JSONTaskStore } from "./tasks/json-task-store.js";
|
|
10
|
+
// Artifacts
|
|
11
|
+
export { DataArtifacts, TextArtifacts, minimizeArtifacts } from "./artifacts/index.js";
|
|
12
|
+
export { LocalFileStore } from "./files/local-file-store.js";
|
|
13
|
+
export { ArtifactSettings, TERMINAL_OR_ACTIONABLE_STATES } from "./types.js";
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,sCAAsC;AAEtC,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B;AAE3D,OAAO;AACP,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,YAAY;AACZ,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIvF,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAa7D,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tasks/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tasks/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,sCAAsC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Task } from "@a2a-js/sdk";
|
|
2
|
+
import type { TaskStore } from "@a2a-js/sdk/server";
|
|
3
|
+
/**
|
|
4
|
+
* Persists Task objects as individual JSON files.
|
|
5
|
+
*
|
|
6
|
+
* Each task is stored at ``{storageDir}/{taskId}.json``.
|
|
7
|
+
*/
|
|
8
|
+
export declare class JSONTaskStore implements TaskStore {
|
|
9
|
+
readonly _storageDir: string;
|
|
10
|
+
constructor(storageDir: string);
|
|
11
|
+
/**
|
|
12
|
+
* Save a task to disk.
|
|
13
|
+
*
|
|
14
|
+
* @param task - The Task object to persist.
|
|
15
|
+
*/
|
|
16
|
+
save(task: Task): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Load a task from disk.
|
|
19
|
+
*
|
|
20
|
+
* @param taskId - The task ID to look up.
|
|
21
|
+
*
|
|
22
|
+
* @returns Task if found, undefined otherwise.
|
|
23
|
+
*/
|
|
24
|
+
load(taskId: string): Promise<Task | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* Delete a task from disk.
|
|
27
|
+
*
|
|
28
|
+
* @param taskId - The task ID to delete.
|
|
29
|
+
*/
|
|
30
|
+
delete(taskId: string): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=json-task-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-task-store.d.ts","sourceRoot":"","sources":["../../src/tasks/json-task-store.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;GAIG;AACH,qBAAa,aAAc,YAAW,SAAS;IAC3C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBAEjB,UAAU,EAAE,MAAM;IAM9B;;;;OAIG;IACG,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrC;;;;;;OAMG;IACG,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC;IAUrD;;;;OAIG;IACG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAS9C"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2025-present A2A Net <hello@a2anet.com>
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
/**
|
|
5
|
+
* JSON file-based task store implementing the A2A SDK TaskStore interface.
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from "node:fs/promises";
|
|
8
|
+
import * as path from "node:path";
|
|
9
|
+
/**
|
|
10
|
+
* Persists Task objects as individual JSON files.
|
|
11
|
+
*
|
|
12
|
+
* Each task is stored at ``{storageDir}/{taskId}.json``.
|
|
13
|
+
*/
|
|
14
|
+
export class JSONTaskStore {
|
|
15
|
+
_storageDir;
|
|
16
|
+
constructor(storageDir) {
|
|
17
|
+
this._storageDir = storageDir;
|
|
18
|
+
// Ensure storage dir exists
|
|
19
|
+
fs.mkdir(storageDir, { recursive: true }).catch(() => { });
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Save a task to disk.
|
|
23
|
+
*
|
|
24
|
+
* @param task - The Task object to persist.
|
|
25
|
+
*/
|
|
26
|
+
async save(task) {
|
|
27
|
+
await fs.mkdir(this._storageDir, { recursive: true });
|
|
28
|
+
const filePath = path.join(this._storageDir, `${task.id}.json`);
|
|
29
|
+
const data = JSON.stringify(task, null, 2);
|
|
30
|
+
await fs.writeFile(filePath, data);
|
|
31
|
+
console.debug(`Saved task ${task.id} to ${filePath}`);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Load a task from disk.
|
|
35
|
+
*
|
|
36
|
+
* @param taskId - The task ID to look up.
|
|
37
|
+
*
|
|
38
|
+
* @returns Task if found, undefined otherwise.
|
|
39
|
+
*/
|
|
40
|
+
async load(taskId) {
|
|
41
|
+
const filePath = path.join(this._storageDir, `${taskId}.json`);
|
|
42
|
+
try {
|
|
43
|
+
const text = await fs.readFile(filePath, "utf-8");
|
|
44
|
+
return JSON.parse(text);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Delete a task from disk.
|
|
52
|
+
*
|
|
53
|
+
* @param taskId - The task ID to delete.
|
|
54
|
+
*/
|
|
55
|
+
async delete(taskId) {
|
|
56
|
+
const filePath = path.join(this._storageDir, `${taskId}.json`);
|
|
57
|
+
try {
|
|
58
|
+
await fs.unlink(filePath);
|
|
59
|
+
console.debug(`Deleted task ${taskId}`);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
// Ignore if doesn't exist
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=json-task-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-task-store.js","sourceRoot":"","sources":["../../src/tasks/json-task-store.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,sCAAsC;AAEtC;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAIlC;;;;GAIG;AACH,MAAM,OAAO,aAAa;IACb,WAAW,CAAS;IAE7B,YAAY,UAAkB;QAC1B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,4BAA4B;QAC5B,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,IAAI,CAAC,IAAU;QACjB,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;QAChE,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC3C,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACnC,OAAO,CAAC,KAAK,CAAC,cAAc,IAAI,CAAC,EAAE,OAAO,QAAQ,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CAAC,MAAc;QACrB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,MAAM,OAAO,CAAC,CAAC;QAC/D,IAAI,CAAC;YACD,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YAClD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAS,CAAC;QACpC,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,SAAS,CAAC;QACrB,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,MAAc;QACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,MAAM,OAAO,CAAC,CAAC;QAC/D,IAAI,CAAC;YACD,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC1B,OAAO,CAAC,KAAK,CAAC,gBAAgB,MAAM,EAAE,CAAC,CAAC;QAC5C,CAAC;QAAC,MAAM,CAAC;YACL,0BAA0B;QAC9B,CAAC;IACL,CAAC;CACJ"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed interfaces for LLM-facing A2A responses.
|
|
3
|
+
*/
|
|
4
|
+
import type { AgentCard, TaskState } from "@a2a-js/sdk";
|
|
5
|
+
export interface AgentURLAndCustomHeaders {
|
|
6
|
+
readonly agentCard: AgentCard;
|
|
7
|
+
readonly customHeaders: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export declare const TERMINAL_OR_ACTIONABLE_STATES: ReadonlySet<string>;
|
|
10
|
+
/** Configuration for artifact minimization and viewing. */
|
|
11
|
+
export declare class ArtifactSettings {
|
|
12
|
+
readonly sendMessageCharacterLimit: number;
|
|
13
|
+
readonly minimizedObjectStringLength: number;
|
|
14
|
+
readonly viewArtifactCharacterLimit: number;
|
|
15
|
+
constructor(opts?: {
|
|
16
|
+
sendMessageCharacterLimit?: number;
|
|
17
|
+
minimizedObjectStringLength?: number;
|
|
18
|
+
viewArtifactCharacterLimit?: number;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
export interface TextPartForLLM {
|
|
22
|
+
readonly kind: "text";
|
|
23
|
+
readonly text: string;
|
|
24
|
+
readonly _total_lines?: number;
|
|
25
|
+
readonly _total_characters?: number;
|
|
26
|
+
readonly _start_line_range?: string;
|
|
27
|
+
readonly _end_line_range?: string;
|
|
28
|
+
readonly _start_character_range?: string;
|
|
29
|
+
readonly _end_character_range?: string;
|
|
30
|
+
readonly _tip?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface DataPartForLLM {
|
|
33
|
+
readonly kind: "data";
|
|
34
|
+
readonly data: unknown;
|
|
35
|
+
}
|
|
36
|
+
export interface FilePartForLLM {
|
|
37
|
+
readonly kind: "file";
|
|
38
|
+
readonly name: string | null;
|
|
39
|
+
readonly mimeType: string | null;
|
|
40
|
+
readonly uri: string | Record<string, unknown> | null;
|
|
41
|
+
readonly bytes: Record<string, unknown> | null;
|
|
42
|
+
}
|
|
43
|
+
export interface ArtifactForLLM {
|
|
44
|
+
readonly artifactId: string;
|
|
45
|
+
readonly description: string | null;
|
|
46
|
+
readonly name: string | null;
|
|
47
|
+
readonly parts: ReadonlyArray<TextPartForLLM | DataPartForLLM | FilePartForLLM>;
|
|
48
|
+
}
|
|
49
|
+
export interface MessageForLLM {
|
|
50
|
+
readonly contextId: string | null;
|
|
51
|
+
readonly kind: "message";
|
|
52
|
+
readonly parts: ReadonlyArray<TextPartForLLM | DataPartForLLM | FilePartForLLM>;
|
|
53
|
+
}
|
|
54
|
+
export interface TaskStatusForLLM {
|
|
55
|
+
readonly state: TaskState;
|
|
56
|
+
readonly message: MessageForLLM | null;
|
|
57
|
+
}
|
|
58
|
+
export interface TaskForLLM {
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly contextId: string;
|
|
61
|
+
readonly kind: "task";
|
|
62
|
+
readonly status: TaskStatusForLLM;
|
|
63
|
+
readonly artifacts: ReadonlyArray<ArtifactForLLM>;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,WAAW,wBAAwB;IACrC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClD;AAED,eAAO,MAAM,6BAA6B,EAAE,WAAW,CAAC,MAAM,CAO5D,CAAC;AAEH,2DAA2D;AAC3D,qBAAa,gBAAgB;IACzB,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAC;IAC3C,QAAQ,CAAC,2BAA2B,EAAE,MAAM,CAAC;IAC7C,QAAQ,CAAC,0BAA0B,EAAE,MAAM,CAAC;gBAEhC,IAAI,CAAC,EAAE;QACf,yBAAyB,CAAC,EAAE,MAAM,CAAC;QACnC,2BAA2B,CAAC,EAAE,MAAM,CAAC;QACrC,0BAA0B,CAAC,EAAE,MAAM,CAAC;KACvC;CAKJ;AAID,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IACzC,QAAQ,CAAC,oBAAoB,CAAC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AAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CACrD"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2025-present A2A Net <hello@a2anet.com>
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
export const TERMINAL_OR_ACTIONABLE_STATES = new Set([
|
|
5
|
+
"completed",
|
|
6
|
+
"canceled",
|
|
7
|
+
"failed",
|
|
8
|
+
"rejected",
|
|
9
|
+
"input-required",
|
|
10
|
+
"auth-required",
|
|
11
|
+
]);
|
|
12
|
+
/** Configuration for artifact minimization and viewing. */
|
|
13
|
+
export class ArtifactSettings {
|
|
14
|
+
sendMessageCharacterLimit;
|
|
15
|
+
minimizedObjectStringLength;
|
|
16
|
+
viewArtifactCharacterLimit;
|
|
17
|
+
constructor(opts) {
|
|
18
|
+
this.sendMessageCharacterLimit = opts?.sendMessageCharacterLimit ?? 50_000;
|
|
19
|
+
this.minimizedObjectStringLength = opts?.minimizedObjectStringLength ?? 5_000;
|
|
20
|
+
this.viewArtifactCharacterLimit = opts?.viewArtifactCharacterLimit ?? 50_000;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,sCAAsC;AAatC,MAAM,CAAC,MAAM,6BAA6B,GAAwB,IAAI,GAAG,CAAS;IAC9E,WAAW;IACX,UAAU;IACV,QAAQ;IACR,UAAU;IACV,gBAAgB;IAChB,eAAe;CAClB,CAAC,CAAC;AAEH,2DAA2D;AAC3D,MAAM,OAAO,gBAAgB;IAChB,yBAAyB,CAAS;IAClC,2BAA2B,CAAS;IACpC,0BAA0B,CAAS;IAE5C,YAAY,IAIX;QACG,IAAI,CAAC,yBAAyB,GAAG,IAAI,EAAE,yBAAyB,IAAI,MAAM,CAAC;QAC3E,IAAI,CAAC,2BAA2B,GAAG,IAAI,EAAE,2BAA2B,IAAI,KAAK,CAAC;QAC9E,IAAI,CAAC,0BAA0B,GAAG,IAAI,EAAE,0BAA0B,IAAI,MAAM,CAAC;IACjF,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a2anet/a2a-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "A collection of utilities for discovering, communicating, and authenticating with A2A Servers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
},
|
|
12
12
|
"main": "./dist/index.js",
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
|
-
"files": [
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
15
17
|
"scripts": {
|
|
16
18
|
"build": "tsc",
|
|
17
19
|
"check": "biome check .",
|
|
@@ -20,7 +22,11 @@
|
|
|
20
22
|
"test": "bun test",
|
|
21
23
|
"test:coverage": "bun test --coverage"
|
|
22
24
|
},
|
|
23
|
-
"keywords": [
|
|
25
|
+
"keywords": [
|
|
26
|
+
"a2a",
|
|
27
|
+
"agent-to-agent",
|
|
28
|
+
"utilities"
|
|
29
|
+
],
|
|
24
30
|
"author": "A2A Net <hello@a2anet.com>",
|
|
25
31
|
"license": "Apache-2.0",
|
|
26
32
|
"repository": {
|
|
@@ -31,10 +37,17 @@
|
|
|
31
37
|
"url": "https://github.com/a2anet/a2a-utils/issues"
|
|
32
38
|
},
|
|
33
39
|
"homepage": "https://github.com/a2anet/a2a-utils#readme",
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@a2a-js/sdk": "^0.3.10",
|
|
42
|
+
"uuid": "^11.1.0"
|
|
43
|
+
},
|
|
34
44
|
"devDependencies": {
|
|
35
45
|
"@biomejs/biome": "^1.9.0",
|
|
36
46
|
"@types/bun": "latest",
|
|
47
|
+
"@types/uuid": "^10.0.0",
|
|
37
48
|
"typescript": "^5.7.0"
|
|
38
49
|
},
|
|
39
|
-
"trustedDependencies": [
|
|
50
|
+
"trustedDependencies": [
|
|
51
|
+
"@biomejs/biome"
|
|
52
|
+
]
|
|
40
53
|
}
|