psadk 1.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/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +205 -0
- package/build/main/index.d.ts +6 -0
- package/build/main/index.js +23 -0
- package/build/main/lib/ILogger.d.ts +9 -0
- package/build/main/lib/ILogger.js +25 -0
- package/build/main/lib/PSAI.d.ts +29 -0
- package/build/main/lib/PSAI.js +383 -0
- package/build/main/lib/PSAgent.d.ts +215 -0
- package/build/main/lib/PSAgent.js +990 -0
- package/build/main/lib/PSAgentConfig.d.ts +23 -0
- package/build/main/lib/PSAgentConfig.js +3 -0
- package/build/main/lib/PSAgentLogger.d.ts +13 -0
- package/build/main/lib/PSAgentLogger.js +33 -0
- package/build/main/lib/PSAgentTask.d.ts +12 -0
- package/build/main/lib/PSAgentTask.js +30 -0
- package/build/main/lib/PSAgentTool.d.ts +56 -0
- package/build/main/lib/PSAgentTool.js +84 -0
- package/build/main/lib/ai.d.ts +11 -0
- package/build/main/lib/ai.js +127 -0
- package/build/main/lib/async.d.ts +20 -0
- package/build/main/lib/async.js +36 -0
- package/build/main/lib/getServiceToken.d.ts +1 -0
- package/build/main/lib/getServiceToken.js +3 -0
- package/build/main/lib/jwt.d.ts +41 -0
- package/build/main/lib/jwt.js +73 -0
- package/build/main/lib/number.d.ts +43 -0
- package/build/main/lib/number.js +56 -0
- package/build/main/lib/tools/PSAentTool.d.ts +7 -0
- package/build/main/lib/tools/PSAentTool.js +78 -0
- package/build/main/lib/tools/PSArtifactTool copy.d.ts +7 -0
- package/build/main/lib/tools/PSArtifactTool copy.js +78 -0
- package/build/main/lib/tools/PSArtifactTool.d.ts +7 -0
- package/build/main/lib/tools/PSArtifactTool.js +79 -0
- package/build/main/lib/tools/PSSubAgentTool.d.ts +20 -0
- package/build/main/lib/tools/PSSubAgentTool.js +163 -0
- package/build/module/index.d.ts +6 -0
- package/build/module/index.js +7 -0
- package/build/module/lib/PSAI.d.ts +25 -0
- package/build/module/lib/PSAI.js +314 -0
- package/build/module/lib/PSAgent.d.ts +215 -0
- package/build/module/lib/PSAgent.js +992 -0
- package/build/module/lib/async.d.ts +20 -0
- package/build/module/lib/async.js +32 -0
- package/build/module/lib/number.d.ts +43 -0
- package/build/module/lib/number.js +51 -0
- package/package.json +122 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A sample async function (to demo Typescript's es7 async/await down-leveling).
|
|
3
|
+
*
|
|
4
|
+
* ### Example (es imports)
|
|
5
|
+
* ```js
|
|
6
|
+
* import { asyncABC } from 'typescript-starter'
|
|
7
|
+
* console.log(await asyncABC())
|
|
8
|
+
* // => ['a','b','c']
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* ### Example (commonjs)
|
|
12
|
+
* ```js
|
|
13
|
+
* var double = require('typescript-starter').asyncABC;
|
|
14
|
+
* asyncABC().then(console.log);
|
|
15
|
+
* // => ['a','b','c']
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @returns a Promise which should contain `['a','b','c']`
|
|
19
|
+
*/
|
|
20
|
+
export declare const asyncABC: () => Promise<string[]>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A sample async function (to demo Typescript's es7 async/await down-leveling).
|
|
3
|
+
*
|
|
4
|
+
* ### Example (es imports)
|
|
5
|
+
* ```js
|
|
6
|
+
* import { asyncABC } from 'typescript-starter'
|
|
7
|
+
* console.log(await asyncABC())
|
|
8
|
+
* // => ['a','b','c']
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* ### Example (commonjs)
|
|
12
|
+
* ```js
|
|
13
|
+
* var double = require('typescript-starter').asyncABC;
|
|
14
|
+
* asyncABC().then(console.log);
|
|
15
|
+
* // => ['a','b','c']
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @returns a Promise which should contain `['a','b','c']`
|
|
19
|
+
*/
|
|
20
|
+
export const asyncABC = async () => {
|
|
21
|
+
const somethingSlow = (index) => {
|
|
22
|
+
const storage = 'abc'.charAt(index);
|
|
23
|
+
return new Promise((resolve) =>
|
|
24
|
+
// later...
|
|
25
|
+
resolve(storage));
|
|
26
|
+
};
|
|
27
|
+
const a = await somethingSlow(0);
|
|
28
|
+
const b = await somethingSlow(1);
|
|
29
|
+
const c = await somethingSlow(2);
|
|
30
|
+
return [a, b, c];
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXN5bmMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL2FzeW5jLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FrQkc7QUFDSCxNQUFNLENBQUMsTUFBTSxRQUFRLEdBQUcsS0FBSyxJQUFJLEVBQUU7SUFDakMsTUFBTSxhQUFhLEdBQUcsQ0FBQyxLQUFnQixFQUFFLEVBQUU7UUFDekMsTUFBTSxPQUFPLEdBQUcsS0FBSyxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUNwQyxPQUFPLElBQUksT0FBTyxDQUFTLENBQUMsT0FBTyxFQUFFLEVBQUU7UUFDckMsV0FBVztRQUNYLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FDakIsQ0FBQztJQUNKLENBQUMsQ0FBQztJQUNGLE1BQU0sQ0FBQyxHQUFHLE1BQU0sYUFBYSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ2pDLE1BQU0sQ0FBQyxHQUFHLE1BQU0sYUFBYSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ2pDLE1BQU0sQ0FBQyxHQUFHLE1BQU0sYUFBYSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ2pDLE9BQU8sQ0FBQyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQ25CLENBQUMsQ0FBQyJ9
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multiplies a value by 2. (Also a full example of TypeDoc's functionality.)
|
|
3
|
+
*
|
|
4
|
+
* ### Example (es module)
|
|
5
|
+
* ```js
|
|
6
|
+
* import { double } from 'typescript-starter'
|
|
7
|
+
* console.log(double(4))
|
|
8
|
+
* // => 8
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* ### Example (commonjs)
|
|
12
|
+
* ```js
|
|
13
|
+
* var double = require('typescript-starter').double;
|
|
14
|
+
* console.log(double(4))
|
|
15
|
+
* // => 8
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @param value - Comment describing the `value` parameter.
|
|
19
|
+
* @returns Comment describing the return type.
|
|
20
|
+
* @anotherNote Some other value.
|
|
21
|
+
*/
|
|
22
|
+
export declare const double: (value: number) => number;
|
|
23
|
+
/**
|
|
24
|
+
* Raise the value of the first parameter to the power of the second using the
|
|
25
|
+
* es7 exponentiation operator (`**`).
|
|
26
|
+
*
|
|
27
|
+
* ### Example (es module)
|
|
28
|
+
* ```js
|
|
29
|
+
* import { power } from 'typescript-starter'
|
|
30
|
+
* console.log(power(2,3))
|
|
31
|
+
* // => 8
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* ### Example (commonjs)
|
|
35
|
+
* ```js
|
|
36
|
+
* var power = require('typescript-starter').power;
|
|
37
|
+
* console.log(power(2,3))
|
|
38
|
+
* // => 8
|
|
39
|
+
* ```
|
|
40
|
+
* @param base - the base to exponentiate
|
|
41
|
+
* @param exponent - the power to which to raise the base
|
|
42
|
+
*/
|
|
43
|
+
export declare const power: (base: number, exponent: number) => number;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multiplies a value by 2. (Also a full example of TypeDoc's functionality.)
|
|
3
|
+
*
|
|
4
|
+
* ### Example (es module)
|
|
5
|
+
* ```js
|
|
6
|
+
* import { double } from 'typescript-starter'
|
|
7
|
+
* console.log(double(4))
|
|
8
|
+
* // => 8
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* ### Example (commonjs)
|
|
12
|
+
* ```js
|
|
13
|
+
* var double = require('typescript-starter').double;
|
|
14
|
+
* console.log(double(4))
|
|
15
|
+
* // => 8
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @param value - Comment describing the `value` parameter.
|
|
19
|
+
* @returns Comment describing the return type.
|
|
20
|
+
* @anotherNote Some other value.
|
|
21
|
+
*/
|
|
22
|
+
export const double = (value) => {
|
|
23
|
+
return value * 2;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Raise the value of the first parameter to the power of the second using the
|
|
27
|
+
* es7 exponentiation operator (`**`).
|
|
28
|
+
*
|
|
29
|
+
* ### Example (es module)
|
|
30
|
+
* ```js
|
|
31
|
+
* import { power } from 'typescript-starter'
|
|
32
|
+
* console.log(power(2,3))
|
|
33
|
+
* // => 8
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* ### Example (commonjs)
|
|
37
|
+
* ```js
|
|
38
|
+
* var power = require('typescript-starter').power;
|
|
39
|
+
* console.log(power(2,3))
|
|
40
|
+
* // => 8
|
|
41
|
+
* ```
|
|
42
|
+
* @param base - the base to exponentiate
|
|
43
|
+
* @param exponent - the power to which to raise the base
|
|
44
|
+
*/
|
|
45
|
+
export const power = (base, exponent) => {
|
|
46
|
+
/**
|
|
47
|
+
* This es7 exponentiation operator is transpiled by TypeScript
|
|
48
|
+
*/
|
|
49
|
+
return base ** exponent;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnVtYmVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9udW1iZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBb0JHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sTUFBTSxHQUFHLENBQUMsS0FBYSxFQUFFLEVBQUU7SUFDdEMsT0FBTyxLQUFLLEdBQUcsQ0FBQyxDQUFDO0FBQ25CLENBQUMsQ0FBQztBQUVGOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBbUJHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sS0FBSyxHQUFHLENBQUMsSUFBWSxFQUFFLFFBQWdCLEVBQUUsRUFBRTtJQUN0RDs7T0FFRztJQUNILE9BQU8sSUFBSSxJQUFJLFFBQVEsQ0FBQztBQUMxQixDQUFDLENBQUMifQ==
|
package/package.json
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "psadk",
|
|
3
|
+
"email": "rakesh.ravuri@publicissapient.com",
|
|
4
|
+
"version": "1.1.0",
|
|
5
|
+
"description": "ps adk adapter",
|
|
6
|
+
"main": "build/main/index.js",
|
|
7
|
+
"typings": "build/main/index.d.ts",
|
|
8
|
+
"module": "build/module/index.js",
|
|
9
|
+
"repository": "https://pscode.lioncloud.net/psadk",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "run-p build:*",
|
|
14
|
+
"build:main": "tsc -p tsconfig.json",
|
|
15
|
+
"build:module": "tsc -p tsconfig.module.json",
|
|
16
|
+
"fix": "run-s fix:*",
|
|
17
|
+
"fix:prettier": "prettier \"src/**/*.ts\" --write",
|
|
18
|
+
"fix:lint": "eslint src --ext .ts --fix",
|
|
19
|
+
"test": "run-s build test:*",
|
|
20
|
+
"test:lint": "eslint src --ext .ts",
|
|
21
|
+
"test:prettier": "prettier \"src/**/*.ts\" --list-different",
|
|
22
|
+
"test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.ts}\"",
|
|
23
|
+
"test:unit": "nyc --silent ava",
|
|
24
|
+
"check-cli": "run-s test diff-integration-tests check-integration-tests",
|
|
25
|
+
"check-integration-tests": "run-s check-integration-test:*",
|
|
26
|
+
"diff-integration-tests": "mkdir -p diff && rm -rf diff/test && cp -r test diff/test && rm -rf diff/test/test-*/.git && cd diff && git init --quiet && git add -A && git commit --quiet --no-verify --allow-empty -m 'WIP' && echo '\\n\\nCommitted most recent integration test output in the \"diff\" directory. Review the changes with \"cd diff && git diff HEAD\" or your preferred git diff viewer.'",
|
|
27
|
+
"watch:build": "tsc -p tsconfig.json -w",
|
|
28
|
+
"watch:test": "nyc --silent ava --watch",
|
|
29
|
+
"cov": "run-s build test:unit cov:html cov:lcov && open-cli coverage/index.html",
|
|
30
|
+
"cov:html": "nyc report --reporter=html",
|
|
31
|
+
"cov:lcov": "nyc report --reporter=lcov",
|
|
32
|
+
"cov:send": "run-s cov:lcov && codecov",
|
|
33
|
+
"cov:check": "nyc report && nyc check-coverage --lines 100 --functions 100 --branches 100",
|
|
34
|
+
"doc": "run-s doc:html && open-cli docs/index.html",
|
|
35
|
+
"doc:md": "typedoc src/ --plugin typedoc-plugin-markdown --exclude **/*.spec.ts --out docs",
|
|
36
|
+
"doc:html": "typedoc src/ --exclude **/*.spec.ts --out docs",
|
|
37
|
+
"doc:json": "typedoc src/ --exclude **/*.spec.ts --json build/typedoc.json",
|
|
38
|
+
"doc:publish": "gh-pages -m \"[ci skip] Updates\" -d build/docs",
|
|
39
|
+
"version": "standard-version",
|
|
40
|
+
"reset-hard": "git clean -dfx && git reset --hard && yarn",
|
|
41
|
+
"prepare-release": "run-s reset-hard test cov:check doc:html version doc:publish"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=10"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@a2a-js/sdk": "^0.3.4",
|
|
48
|
+
"@modelcontextprotocol/sdk": "^1.18.0",
|
|
49
|
+
"debug": "^4.4.1",
|
|
50
|
+
"express": "^5.1.0",
|
|
51
|
+
"fetch-retry": "^6.0.0",
|
|
52
|
+
"jsonwebtoken": "^9.0.2",
|
|
53
|
+
"uuid": "^13.0.0",
|
|
54
|
+
"yaml": "^2.8.1",
|
|
55
|
+
"zod": "^4.1.5"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@ava/typescript": "^6.0.0",
|
|
59
|
+
"@eslint/compat": "^1.3.2",
|
|
60
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
61
|
+
"@eslint/js": "^9.35.0",
|
|
62
|
+
"@istanbuljs/nyc-config-typescript": "^1.0.1",
|
|
63
|
+
"@types/debug": "^4.1.12",
|
|
64
|
+
"@types/express": "^5.0.3",
|
|
65
|
+
"@types/jsonwebtoken": "^9.0.10",
|
|
66
|
+
"@typescript-eslint/eslint-plugin": "^8.42.0",
|
|
67
|
+
"@typescript-eslint/parser": "^8.42.0",
|
|
68
|
+
"ava": "^6.4.1",
|
|
69
|
+
"codecov": "^3.8.3",
|
|
70
|
+
"cspell": "^9.2.1",
|
|
71
|
+
"cz-conventional-changelog": "^3.3.0",
|
|
72
|
+
"eslint": "^9.35.0",
|
|
73
|
+
"eslint-config-prettier": "^10.1.8",
|
|
74
|
+
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
75
|
+
"eslint-plugin-functional": "^9.0.2",
|
|
76
|
+
"eslint-plugin-import": "^2.32.0",
|
|
77
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
78
|
+
"gh-pages": "^6.3.0",
|
|
79
|
+
"npm-run-all": "^4.1.5",
|
|
80
|
+
"nyc": "^17.1.0",
|
|
81
|
+
"open-cli": "^8.0.0",
|
|
82
|
+
"prettier": "^3.6.2",
|
|
83
|
+
"standard-version": "^9.0.0",
|
|
84
|
+
"ts-node": "^10.9.2",
|
|
85
|
+
"tsdoc-markdown": "^1.4.1",
|
|
86
|
+
"typedoc": "^0.28.12",
|
|
87
|
+
"typedoc-plugin-markdown": "^4.8.1",
|
|
88
|
+
"typescript": "^5.9.2"
|
|
89
|
+
},
|
|
90
|
+
"files": [
|
|
91
|
+
"build/main",
|
|
92
|
+
"build/module",
|
|
93
|
+
"!**/*.spec.*",
|
|
94
|
+
"!**/*.json",
|
|
95
|
+
"CHANGELOG.md",
|
|
96
|
+
"LICENSE",
|
|
97
|
+
"README.md"
|
|
98
|
+
],
|
|
99
|
+
"ava": {
|
|
100
|
+
"failFast": true,
|
|
101
|
+
"timeout": "60s",
|
|
102
|
+
"typescript": {
|
|
103
|
+
"rewritePaths": {
|
|
104
|
+
"src/": "build/main/"
|
|
105
|
+
},
|
|
106
|
+
"compile": false
|
|
107
|
+
},
|
|
108
|
+
"files": [
|
|
109
|
+
"!build/module/**"
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"config": {},
|
|
113
|
+
"prettier": {
|
|
114
|
+
"singleQuote": true
|
|
115
|
+
},
|
|
116
|
+
"nyc": {
|
|
117
|
+
"extends": "@istanbuljs/nyc-config-typescript",
|
|
118
|
+
"exclude": [
|
|
119
|
+
"**/*.spec.js"
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
}
|