@massa-ai/opencode-plugin 1.9.0 → 1.9.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/config-cli.js +15 -1
- package/dist/index.js +15 -1
- package/package.json +3 -3
package/dist/config-cli.js
CHANGED
|
@@ -808,6 +808,20 @@ function validateCapturePolicyConfig(raw) {
|
|
|
808
808
|
...p.maxIgnorePatterns !== undefined && { maxIgnorePatterns: p.maxIgnorePatterns }
|
|
809
809
|
};
|
|
810
810
|
}
|
|
811
|
+
function validateAllowedExtensionsConfig(raw) {
|
|
812
|
+
if (!Array.isArray(raw)) {
|
|
813
|
+
throw new TypeError("security.allowedExtensions must be an array of strings");
|
|
814
|
+
}
|
|
815
|
+
if (raw.length === 0) {
|
|
816
|
+
throw new TypeError("security.allowedExtensions must not be empty \u2014 an empty allow-list indexes nothing; omit the key to use the defaults");
|
|
817
|
+
}
|
|
818
|
+
for (const ext of raw) {
|
|
819
|
+
if (typeof ext !== "string" || !ext.startsWith(".") || ext.length < 2) {
|
|
820
|
+
throw new TypeError(`security.allowedExtensions[] must be dot-prefixed extensions (got ${JSON.stringify(ext)})`);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
return [...raw];
|
|
824
|
+
}
|
|
811
825
|
function getGlobalDataDir() {
|
|
812
826
|
const envOverride = process.env.MASSA_AI_DATA_DIR;
|
|
813
827
|
if (envOverride && envOverride.trim())
|
|
@@ -965,7 +979,7 @@ var defaultConfig = {
|
|
|
965
979
|
sanitizeInputs: process.env.SANITIZE_INPUTS !== "false",
|
|
966
980
|
maxIndexSize: 1e5,
|
|
967
981
|
maxFileSize: 1024 * 1024,
|
|
968
|
-
allowedExtensions: [...DEFAULT_ALLOWED_EXTENSIONS],
|
|
982
|
+
allowedExtensions: fileConfig.security?.allowedExtensions ? validateAllowedExtensionsConfig(fileConfig.security.allowedExtensions) : [...DEFAULT_ALLOWED_EXTENSIONS],
|
|
969
983
|
excludePatterns: [
|
|
970
984
|
"node_modules/**",
|
|
971
985
|
".git/**",
|
package/dist/index.js
CHANGED
|
@@ -13127,6 +13127,20 @@ function validateCapturePolicyConfig(raw) {
|
|
|
13127
13127
|
...p.maxIgnorePatterns !== undefined && { maxIgnorePatterns: p.maxIgnorePatterns }
|
|
13128
13128
|
};
|
|
13129
13129
|
}
|
|
13130
|
+
function validateAllowedExtensionsConfig(raw) {
|
|
13131
|
+
if (!Array.isArray(raw)) {
|
|
13132
|
+
throw new TypeError("security.allowedExtensions must be an array of strings");
|
|
13133
|
+
}
|
|
13134
|
+
if (raw.length === 0) {
|
|
13135
|
+
throw new TypeError("security.allowedExtensions must not be empty \u2014 an empty allow-list indexes nothing; omit the key to use the defaults");
|
|
13136
|
+
}
|
|
13137
|
+
for (const ext of raw) {
|
|
13138
|
+
if (typeof ext !== "string" || !ext.startsWith(".") || ext.length < 2) {
|
|
13139
|
+
throw new TypeError(`security.allowedExtensions[] must be dot-prefixed extensions (got ${JSON.stringify(ext)})`);
|
|
13140
|
+
}
|
|
13141
|
+
}
|
|
13142
|
+
return [...raw];
|
|
13143
|
+
}
|
|
13130
13144
|
function getGlobalDataDir() {
|
|
13131
13145
|
const envOverride = process.env.MASSA_AI_DATA_DIR;
|
|
13132
13146
|
if (envOverride && envOverride.trim())
|
|
@@ -13284,7 +13298,7 @@ var defaultConfig = {
|
|
|
13284
13298
|
sanitizeInputs: process.env.SANITIZE_INPUTS !== "false",
|
|
13285
13299
|
maxIndexSize: 1e5,
|
|
13286
13300
|
maxFileSize: 1024 * 1024,
|
|
13287
|
-
allowedExtensions: [...DEFAULT_ALLOWED_EXTENSIONS],
|
|
13301
|
+
allowedExtensions: fileConfig.security?.allowedExtensions ? validateAllowedExtensionsConfig(fileConfig.security.allowedExtensions) : [...DEFAULT_ALLOWED_EXTENSIONS],
|
|
13288
13302
|
excludePatterns: [
|
|
13289
13303
|
"node_modules/**",
|
|
13290
13304
|
".git/**",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@massa-ai/opencode-plugin",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "massa-ai plugin for OpenCode - Semantic code search, memory, and context compression",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@opencode-ai/plugin": "^1.2.15",
|
|
23
23
|
"@opencode-ai/sdk": "^1.2.15",
|
|
24
|
-
"@massa-ai/core": "^1.9.
|
|
25
|
-
"@massa-ai/shared": "^1.9.
|
|
24
|
+
"@massa-ai/core": "^1.9.1",
|
|
25
|
+
"@massa-ai/shared": "^1.9.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^22.10.5",
|