dsh-a2a-server 0.1.1 → 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/CHANGELOG.md +28 -0
- package/CHANGELOG.zh-CN.md +28 -0
- package/README.md +151 -54
- package/README.zh-CN.md +113 -53
- package/cordis.patch.yml +10 -6
- package/lib/briefing.d.ts +39 -0
- package/lib/briefing.d.ts.map +1 -0
- package/lib/briefing.js +108 -0
- package/lib/briefing.js.map +1 -0
- package/lib/config.d.ts +69 -22
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +76 -6
- package/lib/config.js.map +1 -1
- package/lib/contexts.d.ts +9 -4
- package/lib/contexts.d.ts.map +1 -1
- package/lib/contexts.js +7 -13
- package/lib/contexts.js.map +1 -1
- package/lib/index.d.ts +1 -26
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +420 -408
- package/lib/index.js.map +1 -1
- package/lib/management.d.ts +5 -0
- package/lib/management.d.ts.map +1 -0
- package/lib/management.js +74 -0
- package/lib/management.js.map +1 -0
- package/lib/projection.d.ts +67 -22
- package/lib/projection.d.ts.map +1 -1
- package/lib/projection.js +30 -11
- package/lib/projection.js.map +1 -1
- package/lib/protocol/card.d.ts +25 -7
- package/lib/protocol/card.d.ts.map +1 -1
- package/lib/protocol/card.js +35 -14
- package/lib/protocol/card.js.map +1 -1
- package/lib/protocol/index.d.ts +10 -10
- package/lib/protocol/index.d.ts.map +1 -1
- package/lib/protocol/index.js +8 -8
- package/lib/protocol/index.js.map +1 -1
- package/lib/protocol/jsonrpc.d.ts +54 -6
- package/lib/protocol/jsonrpc.d.ts.map +1 -1
- package/lib/protocol/jsonrpc.js +70 -8
- package/lib/protocol/jsonrpc.js.map +1 -1
- package/lib/protocol/parse.d.ts +79 -0
- package/lib/protocol/parse.d.ts.map +1 -0
- package/lib/protocol/parse.js +249 -0
- package/lib/protocol/parse.js.map +1 -0
- package/lib/protocol/sse.d.ts +6 -3
- package/lib/protocol/sse.d.ts.map +1 -1
- package/lib/protocol/sse.js +4 -2
- package/lib/protocol/sse.js.map +1 -1
- package/lib/protocol/wire.d.ts +165 -54
- package/lib/protocol/wire.d.ts.map +1 -1
- package/lib/protocol/wire.js +54 -9
- package/lib/protocol/wire.js.map +1 -1
- package/lib/router.d.ts +55 -1
- package/lib/router.d.ts.map +1 -1
- package/lib/router.js +419 -137
- package/lib/router.js.map +1 -1
- package/lib/security.d.ts +37 -3
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +48 -4
- package/lib/security.js.map +1 -1
- package/lib/state.d.ts +37 -0
- package/lib/state.d.ts.map +1 -0
- package/lib/state.js +146 -0
- package/lib/state.js.map +1 -0
- package/lib/tasks.d.ts +4 -0
- package/lib/tasks.d.ts.map +1 -1
- package/lib/tasks.js +23 -5
- package/lib/tasks.js.map +1 -1
- package/lib/types.d.ts +12 -3
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js +1 -1
- package/lib/types.js.map +1 -1
- package/lib/version.d.ts +20 -0
- package/lib/version.d.ts.map +1 -0
- package/lib/version.js +20 -0
- package/lib/version.js.map +1 -0
- package/lib/workspace-read.d.ts +9 -0
- package/lib/workspace-read.d.ts.map +1 -0
- package/lib/workspace-read.js +152 -0
- package/lib/workspace-read.js.map +1 -0
- package/package.json +39 -30
- package/lib/protocol/normalize.d.ts +0 -72
- package/lib/protocol/normalize.d.ts.map +0 -1
- package/lib/protocol/normalize.js +0 -278
- package/lib/protocol/normalize.js.map +0 -1
package/lib/version.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The version this server publishes on its Agent Card.
|
|
3
|
+
*
|
|
4
|
+
* `AgentCard.version` is the AGENT's version, not the protocol's — that one
|
|
5
|
+
* lives in `supportedInterfaces[].protocolVersion`. Here the agent IS the
|
|
6
|
+
* plugin, so the card version and the npm version are one fact, and a card
|
|
7
|
+
* claiming a version npm never shipped points a peer at source that cannot
|
|
8
|
+
* explain the behaviour it is seeing.
|
|
9
|
+
*
|
|
10
|
+
* It stays a literal rather than an import of `package.json` because
|
|
11
|
+
* `rootDir` is `src`: the manifest sits outside the compiled tree, so
|
|
12
|
+
* importing it would move the emitted entry point. `tests/version.spec.ts` is
|
|
13
|
+
* what keeps the two in step instead — drift becomes a failing test rather
|
|
14
|
+
* than a card nobody rereads.
|
|
15
|
+
*
|
|
16
|
+
* @module dsh-a2a/version
|
|
17
|
+
*/
|
|
18
|
+
/** Must equal `version` in package.json. */
|
|
19
|
+
export declare const SERVER_VERSION = "0.3.0";
|
|
20
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,4CAA4C;AAC5C,eAAO,MAAM,cAAc,UAAU,CAAA"}
|
package/lib/version.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The version this server publishes on its Agent Card.
|
|
3
|
+
*
|
|
4
|
+
* `AgentCard.version` is the AGENT's version, not the protocol's — that one
|
|
5
|
+
* lives in `supportedInterfaces[].protocolVersion`. Here the agent IS the
|
|
6
|
+
* plugin, so the card version and the npm version are one fact, and a card
|
|
7
|
+
* claiming a version npm never shipped points a peer at source that cannot
|
|
8
|
+
* explain the behaviour it is seeing.
|
|
9
|
+
*
|
|
10
|
+
* It stays a literal rather than an import of `package.json` because
|
|
11
|
+
* `rootDir` is `src`: the manifest sits outside the compiled tree, so
|
|
12
|
+
* importing it would move the emitted entry point. `tests/version.spec.ts` is
|
|
13
|
+
* what keeps the two in step instead — drift becomes a failing test rather
|
|
14
|
+
* than a card nobody rereads.
|
|
15
|
+
*
|
|
16
|
+
* @module dsh-a2a/version
|
|
17
|
+
*/
|
|
18
|
+
/** Must equal `version` in package.json. */
|
|
19
|
+
export const SERVER_VERSION = '0.3.0';
|
|
20
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,4CAA4C;AAC5C,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
2
|
+
export declare const WORKSPACE_READ_TOOL = "read_file";
|
|
3
|
+
/**
|
|
4
|
+
* Pin a canonical root for this activation. Never mount the host's general read
|
|
5
|
+
* tool: its path policy is different. State directories remain private even
|
|
6
|
+
* when an operator puts them inside the shared data root.
|
|
7
|
+
*/
|
|
8
|
+
export declare function workspaceReadTool(directory: string, privateDirectories: readonly string[]): Promise<ToolDefinition>;
|
|
9
|
+
//# sourceMappingURL=workspace-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-read.d.ts","sourceRoot":"","sources":["../src/workspace-read.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAG5D,eAAO,MAAM,mBAAmB,cAAc,CAAA;AAe9C;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CA0GzH"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/** A single read capability rooted in the owner's configured data directory. */
|
|
2
|
+
import { constants } from 'node:fs';
|
|
3
|
+
import { lstat, open, opendir, realpath } from 'node:fs/promises';
|
|
4
|
+
import { isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export const WORKSPACE_READ_TOOL = 'read_file';
|
|
7
|
+
const MAX_FILE_BYTES = 2 * 1024 * 1024;
|
|
8
|
+
const MAX_TEXT_CHARS = 32_000;
|
|
9
|
+
const MAX_DIRECTORY_SCAN = 1000;
|
|
10
|
+
const argsSchema = z.object({
|
|
11
|
+
path: z.string().min(1).max(4096),
|
|
12
|
+
offset: z.number().int().min(1).max(10_000_000).default(1),
|
|
13
|
+
limit: z.number().int().min(1).max(500).default(200),
|
|
14
|
+
}).strict();
|
|
15
|
+
function within(root, target) {
|
|
16
|
+
const suffix = relative(root, target);
|
|
17
|
+
return suffix === '' || (!isAbsolute(suffix) && suffix !== '..' && !suffix.startsWith(`..${sep}`));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Pin a canonical root for this activation. Never mount the host's general read
|
|
21
|
+
* tool: its path policy is different. State directories remain private even
|
|
22
|
+
* when an operator puts them inside the shared data root.
|
|
23
|
+
*/
|
|
24
|
+
export async function workspaceReadTool(directory, privateDirectories) {
|
|
25
|
+
const configuredRoot = resolve(directory);
|
|
26
|
+
const root = await realpath(directory);
|
|
27
|
+
const privatePaths = await Promise.all(privateDirectories.map(async (path) => {
|
|
28
|
+
const absolute = resolve(path);
|
|
29
|
+
return { absolute, canonical: await realpath(absolute).catch(() => absolute) };
|
|
30
|
+
}));
|
|
31
|
+
const isPrivate = (path) => privatePaths.some(p => within(p.absolute, path) || within(p.canonical, path));
|
|
32
|
+
const validatePath = async (input) => {
|
|
33
|
+
if (input.includes('\0'))
|
|
34
|
+
throw new Error('Invalid file path');
|
|
35
|
+
// Reject NT device namespaces and alternate data streams before normalization.
|
|
36
|
+
if (process.platform === 'win32' && (/^[/\\]{2}[?.][/\\]/.test(input) || input.replace(/^[a-z]:/i, '').includes(':'))) {
|
|
37
|
+
throw new Error('Device paths and alternate data streams are not available');
|
|
38
|
+
}
|
|
39
|
+
const absolute = resolve(root, input);
|
|
40
|
+
// Windows may return an expanded path for a configured 8.3 directory alias.
|
|
41
|
+
const candidate = isAbsolute(input) && within(configuredRoot, absolute)
|
|
42
|
+
? resolve(root, relative(configuredRoot, absolute)) : absolute;
|
|
43
|
+
if (!within(root, candidate) || isPrivate(candidate))
|
|
44
|
+
throw new Error('Path is outside the authorized data directory');
|
|
45
|
+
const canonical = await realpath(candidate);
|
|
46
|
+
if (!within(root, canonical) || isPrivate(canonical))
|
|
47
|
+
throw new Error('Path is outside the authorized data directory');
|
|
48
|
+
// Refuse links/junctions along the entire relative path, even when a link
|
|
49
|
+
// currently targets this root. An authorized directory is not a link portal.
|
|
50
|
+
let current = root;
|
|
51
|
+
for (const component of ['', ...relative(root, candidate).split(sep).filter(Boolean)]) {
|
|
52
|
+
if (component)
|
|
53
|
+
current = join(current, component);
|
|
54
|
+
if ((await lstat(current)).isSymbolicLink())
|
|
55
|
+
throw new Error('Symbolic links and junctions are not available');
|
|
56
|
+
}
|
|
57
|
+
return candidate;
|
|
58
|
+
};
|
|
59
|
+
return {
|
|
60
|
+
name: WORKSPACE_READ_TOOL,
|
|
61
|
+
description: 'Read a UTF-8 text file from the owner-authorized data directory. Paths are relative to that directory (not the agent cwd); absolute paths must remain inside it. Use path "." to list its entries, or a subdirectory path to list that directory. offset is a 1-based line/entry offset; limit is at most 500. Other tools and writes are unavailable.',
|
|
62
|
+
parameters: {
|
|
63
|
+
type: 'object', additionalProperties: false, required: ['path'], properties: {
|
|
64
|
+
path: { type: 'string', minLength: 1, maxLength: 4096 },
|
|
65
|
+
offset: { type: 'integer', minimum: 1, maximum: 10_000_000 },
|
|
66
|
+
limit: { type: 'integer', minimum: 1, maximum: 500 },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
output: {
|
|
70
|
+
schema: { type: 'object', required: ['kind', 'path', 'content', 'truncated'], properties: {
|
|
71
|
+
kind: { type: 'string' }, path: { type: 'string' }, content: { type: 'string' }, truncated: { type: 'boolean' },
|
|
72
|
+
} },
|
|
73
|
+
render: (_args, value) => [{ type: 'text', text: JSON.stringify(value) }],
|
|
74
|
+
},
|
|
75
|
+
execute: async (raw, { signal }) => {
|
|
76
|
+
const args = argsSchema.parse(raw);
|
|
77
|
+
signal.throwIfAborted();
|
|
78
|
+
const path = await validatePath(args.path);
|
|
79
|
+
const before = await lstat(path);
|
|
80
|
+
if (before.isDirectory()) {
|
|
81
|
+
const entries = [];
|
|
82
|
+
let scanned = 0;
|
|
83
|
+
let truncated = false;
|
|
84
|
+
// Read at most a bounded prefix; do not build an unbounded directory tree.
|
|
85
|
+
const dir = await opendir(path);
|
|
86
|
+
for await (const entry of dir) {
|
|
87
|
+
signal.throwIfAborted();
|
|
88
|
+
if (++scanned > MAX_DIRECTORY_SCAN) {
|
|
89
|
+
truncated = true;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
if (entry.isSymbolicLink() || isPrivate(join(path, entry.name)))
|
|
93
|
+
continue;
|
|
94
|
+
if (!entry.isFile() && !entry.isDirectory())
|
|
95
|
+
continue;
|
|
96
|
+
entries.push(`${entry.name}${entry.isDirectory() ? '/' : ''}`);
|
|
97
|
+
}
|
|
98
|
+
const after = await lstat(await validatePath(args.path));
|
|
99
|
+
if (before.dev !== after.dev || before.ino !== after.ino)
|
|
100
|
+
throw new Error('Directory changed during read; retry');
|
|
101
|
+
entries.sort();
|
|
102
|
+
const selected = entries.slice(args.offset - 1, args.offset - 1 + args.limit).join('\n');
|
|
103
|
+
return { kind: 'directory', path: relative(root, path) || '.', content: selected.slice(0, MAX_TEXT_CHARS),
|
|
104
|
+
truncated: truncated || entries.length > args.offset - 1 + args.limit || selected.length > MAX_TEXT_CHARS };
|
|
105
|
+
}
|
|
106
|
+
if (!before.isFile())
|
|
107
|
+
throw new Error('Only regular text files and directories can be read');
|
|
108
|
+
if (before.nlink > 1)
|
|
109
|
+
throw new Error('Hard-linked files are not available');
|
|
110
|
+
if (before.size > MAX_FILE_BYTES)
|
|
111
|
+
throw new Error('File exceeds the 2 MiB read limit');
|
|
112
|
+
// O_NOFOLLOW is supported on Unix. Windows is covered by the component
|
|
113
|
+
// checks and comparing the opened file's identity before reading any bytes.
|
|
114
|
+
const handle = await open(path, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));
|
|
115
|
+
try {
|
|
116
|
+
const opened = await handle.stat();
|
|
117
|
+
if (!opened.isFile() || opened.nlink > 1 || opened.dev !== before.dev || opened.ino !== before.ino)
|
|
118
|
+
throw new Error('File changed during open; retry');
|
|
119
|
+
if (opened.size > MAX_FILE_BYTES)
|
|
120
|
+
throw new Error('File exceeds the 2 MiB read limit');
|
|
121
|
+
await validatePath(args.path);
|
|
122
|
+
// Explicit byte limit also bounds reads if a local writer grows the file.
|
|
123
|
+
const bytes = Buffer.alloc(MAX_FILE_BYTES + 1);
|
|
124
|
+
let used = 0;
|
|
125
|
+
while (used < bytes.length) {
|
|
126
|
+
signal.throwIfAborted();
|
|
127
|
+
const part = await handle.read(bytes, used, bytes.length - used, used);
|
|
128
|
+
if (!part.bytesRead)
|
|
129
|
+
break;
|
|
130
|
+
used += part.bytesRead;
|
|
131
|
+
}
|
|
132
|
+
if (used > MAX_FILE_BYTES)
|
|
133
|
+
throw new Error('File exceeds the 2 MiB read limit');
|
|
134
|
+
const after = await lstat(await validatePath(args.path));
|
|
135
|
+
if (opened.dev !== after.dev || opened.ino !== after.ino || after.nlink > 1)
|
|
136
|
+
throw new Error('File changed during read; retry');
|
|
137
|
+
signal.throwIfAborted();
|
|
138
|
+
const content = new TextDecoder('utf-8', { fatal: true }).decode(bytes.subarray(0, used));
|
|
139
|
+
if (content.includes('\0'))
|
|
140
|
+
throw new Error('Binary files are not supported by read_file');
|
|
141
|
+
const lines = content.split(/\r?\n/);
|
|
142
|
+
const selected = lines.slice(args.offset - 1, args.offset - 1 + args.limit).join('\n');
|
|
143
|
+
return { kind: 'file', path: relative(root, path), content: selected.slice(0, MAX_TEXT_CHARS),
|
|
144
|
+
truncated: lines.length > args.offset - 1 + args.limit || selected.length > MAX_TEXT_CHARS };
|
|
145
|
+
}
|
|
146
|
+
finally {
|
|
147
|
+
await handle.close();
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|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CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAA;gBACzF,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;oBAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;gBAC1F,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;gBACpC,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;gBACtF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC;oBAC3F,SAAS,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,QAAQ,CAAC,MAAM,GAAG,cAAc,EAAE,CAAA;YAChG,CAAC;oBAAS,CAAC;gBAAC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAA;YAAC,CAAC;QACpC,CAAC;KACF,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-a2a-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Inbound A2A (Agent2Agent) protocol server for DeepSeek Harness: publish an Agent Card and let any A2A-compliant peer submit tasks to a harness agent",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
@@ -27,57 +27,66 @@
|
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"lib",
|
|
30
|
-
"cordis.patch.yml"
|
|
30
|
+
"cordis.patch.yml",
|
|
31
|
+
"CHANGELOG.md",
|
|
32
|
+
"CHANGELOG.zh-CN.md"
|
|
31
33
|
],
|
|
32
34
|
"dsh": {
|
|
33
35
|
"bundle": {
|
|
34
36
|
"patch": "./cordis.patch.yml"
|
|
35
37
|
}
|
|
36
38
|
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"dsh": ">=0.2.1-rc.2 <0.3.0"
|
|
41
|
+
},
|
|
37
42
|
"scripts": {
|
|
38
43
|
"build": "tsc -p tsconfig.build.json",
|
|
39
44
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
40
45
|
"test": "vitest run",
|
|
41
46
|
"test:watch": "vitest",
|
|
47
|
+
"test:package": "pnpm build && node scripts/test-package.mjs",
|
|
42
48
|
"serve": "tsx example/serve.ts",
|
|
43
49
|
"probe": "node example/probe.mjs",
|
|
44
|
-
"prepublishOnly": "pnpm typecheck && pnpm test && pnpm
|
|
50
|
+
"prepublishOnly": "pnpm typecheck && pnpm test && pnpm test:package"
|
|
45
51
|
},
|
|
46
52
|
"peerDependencies": {
|
|
47
|
-
"@deepseek-ai/cordis": "4.0.
|
|
48
|
-
"@deepseek-ai/dsh-agent": "0.1
|
|
49
|
-
"@deepseek-ai/dsh-credentials": "0.1
|
|
50
|
-
"@deepseek-ai/dsh-host-webserver": "0.1
|
|
51
|
-
"@deepseek-ai/dsh-llm": "0.1
|
|
52
|
-
"@deepseek-ai/dsh-session": "0.1
|
|
53
|
+
"@deepseek-ai/cordis": "^4.0.5",
|
|
54
|
+
"@deepseek-ai/dsh-agent": ">=0.2.1-rc.2 <0.3.0",
|
|
55
|
+
"@deepseek-ai/dsh-credentials": ">=0.2.1-rc.2 <0.3.0",
|
|
56
|
+
"@deepseek-ai/dsh-host-webserver": ">=0.2.1-rc.2 <0.3.0",
|
|
57
|
+
"@deepseek-ai/dsh-llm": ">=0.2.1-rc.2 <0.3.0",
|
|
58
|
+
"@deepseek-ai/dsh-session": ">=0.2.1-rc.2 <0.3.0",
|
|
59
|
+
"@deepseek-ai/dsh-session-projection": ">=0.2.1-rc.2 <0.3.0",
|
|
60
|
+
"@deepseek-ai/dsh-tools": ">=0.2.1-rc.2 <0.3.0",
|
|
61
|
+
"@deepseek-ai/dsh-system-prompt": ">=0.2.1-rc.2 <0.3.0"
|
|
53
62
|
},
|
|
54
63
|
"dependencies": {
|
|
55
|
-
"@deepseek-ai/schemastery": "3.18.
|
|
64
|
+
"@deepseek-ai/schemastery": "^3.18.5",
|
|
65
|
+
"zod": "^4.4.3"
|
|
56
66
|
},
|
|
57
67
|
"devDependencies": {
|
|
58
|
-
"@deepseek-ai/cordis": "4.0.
|
|
59
|
-
"@deepseek-ai/cordis-plugin-loader": "1.0.
|
|
60
|
-
"@deepseek-ai/dsh-agent": "0.1
|
|
61
|
-
"@deepseek-ai/dsh-agent-loop": "0.1
|
|
62
|
-
"@deepseek-ai/dsh-agent-loop-testkit": "0.1
|
|
63
|
-
"@deepseek-ai/dsh-brand": "0.1
|
|
64
|
-
"@deepseek-ai/dsh-credentials": "0.1
|
|
65
|
-
"@deepseek-ai/dsh-credentials-local": "0.1
|
|
66
|
-
"@deepseek-ai/dsh-host-webserver": "0.1
|
|
67
|
-
"@deepseek-ai/dsh-
|
|
68
|
-
"@deepseek-ai/dsh-llm": "0.1
|
|
69
|
-
"@deepseek-ai/dsh-llm-deepseek": "0.1
|
|
70
|
-
"@deepseek-ai/dsh-llm-replay": "0.1
|
|
71
|
-
"@deepseek-ai/dsh-scope": "0.1
|
|
72
|
-
"@deepseek-ai/dsh-session": "0.1
|
|
73
|
-
"@deepseek-ai/dsh-session-projection": "0.1
|
|
74
|
-
"@deepseek-ai/dsh-system-prompt": "0.1
|
|
75
|
-
"@deepseek-ai/dsh-tools": "0.1
|
|
68
|
+
"@deepseek-ai/cordis": "4.0.5",
|
|
69
|
+
"@deepseek-ai/cordis-plugin-loader": "1.0.6",
|
|
70
|
+
"@deepseek-ai/dsh-agent": "0.2.1-rc.2",
|
|
71
|
+
"@deepseek-ai/dsh-agent-loop": "0.2.1-rc.2",
|
|
72
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-rc.2",
|
|
73
|
+
"@deepseek-ai/dsh-brand": "0.2.1-rc.2",
|
|
74
|
+
"@deepseek-ai/dsh-credentials": "0.2.1-rc.2",
|
|
75
|
+
"@deepseek-ai/dsh-credentials-local": "0.2.1-rc.2",
|
|
76
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.1-rc.2",
|
|
77
|
+
"@deepseek-ai/dsh-llm": "0.2.1-rc.2",
|
|
78
|
+
"@deepseek-ai/dsh-llm-deepseek": "0.2.1-rc.2",
|
|
79
|
+
"@deepseek-ai/dsh-llm-deepseek-api-key": "0.2.1-rc.2",
|
|
80
|
+
"@deepseek-ai/dsh-llm-replay": "0.2.1-rc.2",
|
|
81
|
+
"@deepseek-ai/dsh-scope": "0.2.1-rc.2",
|
|
82
|
+
"@deepseek-ai/dsh-session": "0.2.1-rc.2",
|
|
83
|
+
"@deepseek-ai/dsh-session-projection": "0.2.1-rc.2",
|
|
84
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.1-rc.2",
|
|
85
|
+
"@deepseek-ai/dsh-tools": "0.2.1-rc.2",
|
|
76
86
|
"@types/node": "^22.10.0",
|
|
77
87
|
"tsx": "^4.19.2",
|
|
78
88
|
"typescript": "^5.7.2",
|
|
79
|
-
"vitest": "^2.1.8"
|
|
80
|
-
"zod": "^4.4.3"
|
|
89
|
+
"vitest": "^2.1.8"
|
|
81
90
|
},
|
|
82
91
|
"repository": {
|
|
83
92
|
"type": "git",
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Dialect normalization between A2A v0.3.0 and v1.0.
|
|
3
|
-
*
|
|
4
|
-
* Inbound is permissive, outbound is strict: a request in either spelling is
|
|
5
|
-
* parsed into the internal v0.3 shape, and the response is rendered back in the
|
|
6
|
-
* dialect that request declared. Nothing mixes the two spellings in one reply.
|
|
7
|
-
*
|
|
8
|
-
* @module dsh-a2a/protocol/normalize
|
|
9
|
-
*/
|
|
10
|
-
import type { A2ADialect, A2AMessageSendParams, A2APart, A2ATask, A2ATaskStatusUpdateEvent, A2ATaskArtifactUpdateEvent } from './wire.ts';
|
|
11
|
-
/** The internal operation a peer's method name resolves to. */
|
|
12
|
-
export type A2AOperation = 'send' | 'stream' | 'get' | 'cancel' | 'resubscribe' | 'push_set' | 'push_get' | 'push_list' | 'push_delete';
|
|
13
|
-
/** One row of the method table: which operation, and which dialect it implies. */
|
|
14
|
-
interface MethodEntry {
|
|
15
|
-
operation: A2AOperation;
|
|
16
|
-
dialect: A2ADialect;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Resolve a method name to its operation and implied dialect.
|
|
20
|
-
* @param method - the raw `method` string from the request.
|
|
21
|
-
* @returns the entry, or undefined for an unknown method.
|
|
22
|
-
*/
|
|
23
|
-
export declare function resolveMethod(method: string): MethodEntry | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Read a `Part` written in any of the three known spellings.
|
|
26
|
-
*
|
|
27
|
-
* v0.3 discriminates on `kind`, v1.0 on member presence, and pre-0.3 peers used
|
|
28
|
-
* `type`. Unknown shapes yield undefined rather than throwing, so one odd part
|
|
29
|
-
* cannot fail a request whose other parts are usable.
|
|
30
|
-
* @param raw - one element of a `parts` array.
|
|
31
|
-
* @returns the normalized part, or undefined when unrecognizable.
|
|
32
|
-
*/
|
|
33
|
-
export declare function parsePart(raw: unknown): A2APart | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Render every part as text the model can read.
|
|
36
|
-
*
|
|
37
|
-
* File and data parts become bracketed references rather than being dropped, so
|
|
38
|
-
* the agent knows something was attached and can ask about it. This is the same
|
|
39
|
-
* flattening `dsh-acp` applies to baseline resource links.
|
|
40
|
-
* @param parts - normalized parts, in order.
|
|
41
|
-
* @returns the joined text, empty when nothing rendered.
|
|
42
|
-
*/
|
|
43
|
-
export declare function partsToText(parts: readonly A2APart[]): string;
|
|
44
|
-
/**
|
|
45
|
-
* Parse `message/send` and `message/stream` parameters from either dialect.
|
|
46
|
-
* @param raw - the request's `params` value.
|
|
47
|
-
* @returns the normalized parameters, or undefined when the shape is unusable.
|
|
48
|
-
*/
|
|
49
|
-
export declare function parseSendParams(raw: unknown): A2AMessageSendParams | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* Render a task in the requested dialect.
|
|
52
|
-
* @param task - the internal v0.3-shaped task.
|
|
53
|
-
* @param dialect - the dialect the peer spoke.
|
|
54
|
-
* @returns the wire object to serialize.
|
|
55
|
-
*/
|
|
56
|
-
export declare function renderTask(task: A2ATask, dialect: A2ADialect): unknown;
|
|
57
|
-
/**
|
|
58
|
-
* Render a status-update stream event in the requested dialect.
|
|
59
|
-
* @param event - the internal event.
|
|
60
|
-
* @param dialect - the dialect the peer spoke.
|
|
61
|
-
* @returns the wire object to serialize.
|
|
62
|
-
*/
|
|
63
|
-
export declare function renderStatusUpdate(event: A2ATaskStatusUpdateEvent, dialect: A2ADialect): unknown;
|
|
64
|
-
/**
|
|
65
|
-
* Render an artifact-update stream event in the requested dialect.
|
|
66
|
-
* @param event - the internal event.
|
|
67
|
-
* @param dialect - the dialect the peer spoke.
|
|
68
|
-
* @returns the wire object to serialize.
|
|
69
|
-
*/
|
|
70
|
-
export declare function renderArtifactUpdate(event: A2ATaskArtifactUpdateEvent, dialect: A2ADialect): unknown;
|
|
71
|
-
export {};
|
|
72
|
-
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/protocol/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EACV,UAAU,EAGV,oBAAoB,EACpB,OAAO,EAEP,OAAO,EAEP,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,WAAW,CAAA;AAElB,+DAA+D;AAC/D,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,aAAa,GACb,UAAU,GACV,UAAU,GACV,WAAW,GACX,aAAa,CAAA;AAEjB,kFAAkF;AAClF,UAAU,WAAW;IACnB,SAAS,EAAE,YAAY,CAAA;IACvB,OAAO,EAAE,UAAU,CAAA;CACpB;AAiCD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAErE;AAmBD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAsB3D;AAmCD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,GAAG,MAAM,CAc7D;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,oBAAoB,GAAG,SAAS,CAqC9E;AAcD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAOtE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,wBAAwB,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAGhG;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,0BAA0B,EACjC,OAAO,EAAE,UAAU,GAClB,OAAO,CAET"}
|