universal-agent-protocol 0.9.1 → 0.10.1
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/dist/memory/generic-uap-patterns.d.ts +7 -0
- package/dist/memory/generic-uap-patterns.d.ts.map +1 -0
- package/dist/memory/generic-uap-patterns.js +43 -0
- package/dist/memory/generic-uap-patterns.js.map +1 -0
- package/package.json +4 -4
- package/tools/agents/scripts/__pycache__/qwen_tool_call_wrapper.cpython-313.pyc +0 -0
- package/tools/agents/scripts/fix-qwen-template.js +47 -0
- package/tools/agents/scripts/init_qdrant.py +0 -0
- package/tools/agents/scripts/memory_migration.py +0 -0
- package/tools/agents/scripts/query_memory.py +0 -0
- package/tools/agents/scripts/qwen-tool-call-test.js +47 -0
- package/tools/agents/scripts/qwen-tool-call-wrapper.js +47 -0
- package/tools/agents/scripts/qwen_tool_call_test.py +1 -0
- package/tools/agents/scripts/qwen_tool_call_wrapper.py +0 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic UAP Patterns - Domain-agnostic best practices
|
|
3
|
+
* NOT specific to any benchmark or test scenario
|
|
4
|
+
*/
|
|
5
|
+
export declare const GENERIC_UAP_PATTERNS: Record<string, string>;
|
|
6
|
+
export declare function getGenericContext(category: string): string;
|
|
7
|
+
//# sourceMappingURL=generic-uap-patterns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic-uap-patterns.d.ts","sourceRoot":"","sources":["../../src/memory/generic-uap-patterns.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAyCvD,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic UAP Patterns - Domain-agnostic best practices
|
|
3
|
+
* NOT specific to any benchmark or test scenario
|
|
4
|
+
*/
|
|
5
|
+
export const GENERIC_UAP_PATTERNS = {
|
|
6
|
+
security: `### Security Best Practices (Generic)
|
|
7
|
+
- **Input Validation**: Always sanitize user input before processing
|
|
8
|
+
- **Credential Handling**: Use established tools/libraries for cryptographic operations
|
|
9
|
+
- **Pattern Recognition**: Understand common attack vectors (injection, XSS, CSRF)
|
|
10
|
+
- **Defense in Depth**: Layer security controls rather than relying on single mechanisms`,
|
|
11
|
+
passwordCracking: `### Password Security Analysis (Generic)
|
|
12
|
+
- **Hash Identification**: Identify hash format before attempting recovery
|
|
13
|
+
- **Tool Chain**: Extract hash first, then apply appropriate cracking method
|
|
14
|
+
- **Method Selection**: Choose between wordlist attacks and brute force`,
|
|
15
|
+
xssFiltering: `### HTML Sanitization (Generic)
|
|
16
|
+
- **Tag Removal**: Strip all script-related tags
|
|
17
|
+
- **Attribute Cleaning**: Remove event handlers
|
|
18
|
+
- **Protocol Blocking**: Block javascript:, data: URL schemes`,
|
|
19
|
+
binaryParsing: `### Binary File Parsing (Generic)
|
|
20
|
+
- **Format Documentation**: Study file format specification first
|
|
21
|
+
- **Byte Order Awareness**: Handle endianness correctly
|
|
22
|
+
- **Offset Calculation**: Use documented offsets for headers`,
|
|
23
|
+
databaseRecovery: `### Database Recovery (Generic)
|
|
24
|
+
- **Log Replay**: Use checkpoint operations to apply transactions
|
|
25
|
+
- **WAL Handling**: Checkpoint before truncating write-ahead logs
|
|
26
|
+
- **Data Integrity**: Verify consistency after recovery`,
|
|
27
|
+
legacyCode: `### Legacy Code Modernization (Generic)
|
|
28
|
+
- **Format Preservation**: Understand original code structure
|
|
29
|
+
- **Semantic Mapping**: Map legacy constructs to modern equivalents
|
|
30
|
+
- **Behavior Verification**: Test with original inputs`,
|
|
31
|
+
mlTraining: `### Machine Learning Development (Generic)
|
|
32
|
+
- **Incremental Validation**: Test with minimal config first
|
|
33
|
+
- **Resource Monitoring**: Track GPU/CPU/memory usage
|
|
34
|
+
- **Early Verification**: Validate data shapes and outputs early`,
|
|
35
|
+
fileOperations: `### File System Operations (Generic)
|
|
36
|
+
- **Path Consistency**: Use absolute paths for reliability
|
|
37
|
+
- **Existence Verification**: Check files before operations
|
|
38
|
+
- **Error Handling**: Handle missing files gracefully`
|
|
39
|
+
};
|
|
40
|
+
export function getGenericContext(category) {
|
|
41
|
+
return GENERIC_UAP_PATTERNS[category] || 'Follow standard development best practices';
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=generic-uap-patterns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic-uap-patterns.js","sourceRoot":"","sources":["../../src/memory/generic-uap-patterns.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAA2B;IAC1D,QAAQ,EAAE;;;;yFAI6E;IAEvF,gBAAgB,EAAE;;;wEAGoD;IAEtE,YAAY,EAAE;;;8DAG8C;IAE5D,aAAa,EAAE;;;6DAG4C;IAE3D,gBAAgB,EAAE;;;wDAGoC;IAEtD,UAAU,EAAE;;;uDAGyC;IAErD,UAAU,EAAE;;;iEAGmD;IAE/D,cAAc,EAAE;;;sDAGoC;CACrD,CAAC;AAEF,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,IAAI,4CAA4C,CAAC;AACxF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "universal-agent-protocol",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Autonomous AI agent memory system with CLAUDE.md protocol enforcement",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
9
|
+
"qwen-tool-call-test": "./tools/agents/scripts/qwen-tool-call-test.js",
|
|
10
|
+
"qwen-tool-call-wrapper": "./tools/agents/scripts/qwen-tool-call-wrapper.js",
|
|
11
|
+
"fix-qwen-template": "./tools/agents/scripts/fix-qwen-template.js"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "tsc",
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Fix Qwen Chat Template - Node.js Wrapper
|
|
4
|
+
*
|
|
5
|
+
* This wrapper script allows the Python CLI to be executed
|
|
6
|
+
* reliably across all platforms and installation methods.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
const { execFileSync } = require('child_process');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const os = require('os');
|
|
14
|
+
|
|
15
|
+
// Determine Python executable based on platform
|
|
16
|
+
const getPythonExecutable = () => {
|
|
17
|
+
if (os.platform() === 'win32') {
|
|
18
|
+
return 'python';
|
|
19
|
+
}
|
|
20
|
+
// Try python3 first, then fall back to python
|
|
21
|
+
try {
|
|
22
|
+
execFileSync('python3', ['--version'], { stdio: 'ignore' });
|
|
23
|
+
return 'python3';
|
|
24
|
+
} catch (e) {
|
|
25
|
+
return 'python';
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Get the directory where this script is located
|
|
30
|
+
const scriptDir = __dirname;
|
|
31
|
+
|
|
32
|
+
// Build the path to the Python script
|
|
33
|
+
const pythonScript = path.join(scriptDir, 'fix_qwen_chat_template.py');
|
|
34
|
+
|
|
35
|
+
// Get command line arguments (skip first two: node, script path)
|
|
36
|
+
const args = process.argv.slice(2);
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
// Execute the Python script with all arguments passed through
|
|
40
|
+
execFileSync(getPythonExecutable(), [pythonScript, ...args], {
|
|
41
|
+
stdio: 'inherit',
|
|
42
|
+
cwd: process.cwd()
|
|
43
|
+
});
|
|
44
|
+
} catch (error) {
|
|
45
|
+
// Exit with the same code as the Python script
|
|
46
|
+
process.exit(error.status || 1);
|
|
47
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Qwen3.5 Tool Call Test - Node.js Wrapper
|
|
4
|
+
*
|
|
5
|
+
* This wrapper script allows the Python CLI to be executed
|
|
6
|
+
* reliably across all platforms and installation methods.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
const { execFileSync } = require('child_process');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const os = require('os');
|
|
14
|
+
|
|
15
|
+
// Determine Python executable based on platform
|
|
16
|
+
const getPythonExecutable = () => {
|
|
17
|
+
if (os.platform() === 'win32') {
|
|
18
|
+
return 'python';
|
|
19
|
+
}
|
|
20
|
+
// Try python3 first, then fall back to python
|
|
21
|
+
try {
|
|
22
|
+
execFileSync('python3', ['--version'], { stdio: 'ignore' });
|
|
23
|
+
return 'python3';
|
|
24
|
+
} catch (e) {
|
|
25
|
+
return 'python';
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Get the directory where this script is located
|
|
30
|
+
const scriptDir = __dirname;
|
|
31
|
+
|
|
32
|
+
// Build the path to the Python script
|
|
33
|
+
const pythonScript = path.join(scriptDir, 'qwen_tool_call_test.py');
|
|
34
|
+
|
|
35
|
+
// Get command line arguments (skip first two: node, script path)
|
|
36
|
+
const args = process.argv.slice(2);
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
// Execute the Python script with all arguments passed through
|
|
40
|
+
execFileSync(getPythonExecutable(), [pythonScript, ...args], {
|
|
41
|
+
stdio: 'inherit',
|
|
42
|
+
cwd: process.cwd()
|
|
43
|
+
});
|
|
44
|
+
} catch (error) {
|
|
45
|
+
// Exit with the same code as the Python script
|
|
46
|
+
process.exit(error.status || 1);
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Qwen3.5 Tool Call Wrapper - Node.js Wrapper
|
|
4
|
+
*
|
|
5
|
+
* This wrapper script allows the Python CLI to be executed
|
|
6
|
+
* reliably across all platforms and installation methods.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
'use strict';
|
|
10
|
+
|
|
11
|
+
const { execFileSync } = require('child_process');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const os = require('os');
|
|
14
|
+
|
|
15
|
+
// Determine Python executable based on platform
|
|
16
|
+
const getPythonExecutable = () => {
|
|
17
|
+
if (os.platform() === 'win32') {
|
|
18
|
+
return 'python';
|
|
19
|
+
}
|
|
20
|
+
// Try python3 first, then fall back to python
|
|
21
|
+
try {
|
|
22
|
+
execFileSync('python3', ['--version'], { stdio: 'ignore' });
|
|
23
|
+
return 'python3';
|
|
24
|
+
} catch (e) {
|
|
25
|
+
return 'python';
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Get the directory where this script is located
|
|
30
|
+
const scriptDir = __dirname;
|
|
31
|
+
|
|
32
|
+
// Build the path to the Python script
|
|
33
|
+
const pythonScript = path.join(scriptDir, 'qwen_tool_call_wrapper.py');
|
|
34
|
+
|
|
35
|
+
// Get command line arguments (skip first two: node, script path)
|
|
36
|
+
const args = process.argv.slice(2);
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
// Execute the Python script with all arguments passed through
|
|
40
|
+
execFileSync(getPythonExecutable(), [pythonScript, ...args], {
|
|
41
|
+
stdio: 'inherit',
|
|
42
|
+
cwd: process.cwd()
|
|
43
|
+
});
|
|
44
|
+
} catch (error) {
|
|
45
|
+
// Exit with the same code as the Python script
|
|
46
|
+
process.exit(error.status || 1);
|
|
47
|
+
}
|
|
@@ -83,7 +83,6 @@ class Qwen35ToolCallClient:
|
|
|
83
83
|
DEFAULT_CONFIG = {
|
|
84
84
|
"temperature": 0.6,
|
|
85
85
|
"top_p": 0.95,
|
|
86
|
-
"top_k": 20,
|
|
87
86
|
"presence_penalty": 1.5,
|
|
88
87
|
"max_tokens": 32768,
|
|
89
88
|
"enable_thinking": False,
|
|
@@ -172,7 +171,6 @@ class Qwen35ToolCallClient:
|
|
|
172
171
|
"tools": tools,
|
|
173
172
|
"temperature": self.config["temperature"],
|
|
174
173
|
"top_p": self.config["top_p"],
|
|
175
|
-
"top_k": self.config["top_k"],
|
|
176
174
|
"presence_penalty": self.config["presence_penalty"],
|
|
177
175
|
"max_tokens": self.config["max_tokens"],
|
|
178
176
|
"timeout": timeout,
|