plugin-agent-orchestrator 1.1.0 → 1.1.2
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/externalVersion.js +6 -6
- package/dist/locale/en-US.json +7 -1
- package/dist/locale/vi-VN.json +7 -1
- package/dist/locale/zh-CN.json +7 -1
- package/dist/node_modules/ajv/.tonic_example.js +20 -0
- package/dist/node_modules/ajv/LICENSE +22 -0
- package/dist/node_modules/ajv/dist/ajv.bundle.js +7189 -0
- package/dist/node_modules/ajv/dist/ajv.min.js +3 -0
- package/dist/node_modules/ajv/lib/ajv.d.ts +397 -0
- package/dist/node_modules/ajv/lib/ajv.js +3 -0
- package/dist/node_modules/ajv/lib/cache.js +26 -0
- package/dist/node_modules/ajv/lib/compile/async.js +90 -0
- package/dist/node_modules/ajv/lib/compile/equal.js +5 -0
- package/dist/node_modules/ajv/lib/compile/error_classes.js +34 -0
- package/dist/node_modules/ajv/lib/compile/formats.js +142 -0
- package/dist/node_modules/ajv/lib/compile/index.js +387 -0
- package/dist/node_modules/ajv/lib/compile/resolve.js +270 -0
- package/dist/node_modules/ajv/lib/compile/rules.js +66 -0
- package/dist/node_modules/ajv/lib/compile/schema_obj.js +9 -0
- package/dist/node_modules/ajv/lib/compile/ucs2length.js +20 -0
- package/dist/node_modules/ajv/lib/compile/util.js +239 -0
- package/dist/node_modules/ajv/lib/data.js +49 -0
- package/dist/node_modules/ajv/lib/definition_schema.js +37 -0
- package/dist/node_modules/ajv/lib/dot/_limit.jst +113 -0
- package/dist/node_modules/ajv/lib/dot/_limitItems.jst +12 -0
- package/dist/node_modules/ajv/lib/dot/_limitLength.jst +12 -0
- package/dist/node_modules/ajv/lib/dot/_limitProperties.jst +12 -0
- package/dist/node_modules/ajv/lib/dot/allOf.jst +32 -0
- package/dist/node_modules/ajv/lib/dot/anyOf.jst +46 -0
- package/dist/node_modules/ajv/lib/dot/coerce.def +51 -0
- package/dist/node_modules/ajv/lib/dot/comment.jst +9 -0
- package/dist/node_modules/ajv/lib/dot/const.jst +11 -0
- package/dist/node_modules/ajv/lib/dot/contains.jst +55 -0
- package/dist/node_modules/ajv/lib/dot/custom.jst +191 -0
- package/dist/node_modules/ajv/lib/dot/defaults.def +47 -0
- package/dist/node_modules/ajv/lib/dot/definitions.def +203 -0
- package/dist/node_modules/ajv/lib/dot/dependencies.jst +79 -0
- package/dist/node_modules/ajv/lib/dot/enum.jst +30 -0
- package/dist/node_modules/ajv/lib/dot/errors.def +194 -0
- package/dist/node_modules/ajv/lib/dot/format.jst +106 -0
- package/dist/node_modules/ajv/lib/dot/if.jst +73 -0
- package/dist/node_modules/ajv/lib/dot/items.jst +98 -0
- package/dist/node_modules/ajv/lib/dot/missing.def +39 -0
- package/dist/node_modules/ajv/lib/dot/multipleOf.jst +22 -0
- package/dist/node_modules/ajv/lib/dot/not.jst +43 -0
- package/dist/node_modules/ajv/lib/dot/oneOf.jst +54 -0
- package/dist/node_modules/ajv/lib/dot/pattern.jst +14 -0
- package/dist/node_modules/ajv/lib/dot/properties.jst +245 -0
- package/dist/node_modules/ajv/lib/dot/propertyNames.jst +52 -0
- package/dist/node_modules/ajv/lib/dot/ref.jst +85 -0
- package/dist/node_modules/ajv/lib/dot/required.jst +108 -0
- package/dist/node_modules/ajv/lib/dot/uniqueItems.jst +62 -0
- package/dist/node_modules/ajv/lib/dot/validate.jst +276 -0
- package/dist/node_modules/ajv/lib/dotjs/_limit.js +163 -0
- package/dist/node_modules/ajv/lib/dotjs/_limitItems.js +80 -0
- package/dist/node_modules/ajv/lib/dotjs/_limitLength.js +85 -0
- package/dist/node_modules/ajv/lib/dotjs/_limitProperties.js +80 -0
- package/dist/node_modules/ajv/lib/dotjs/allOf.js +42 -0
- package/dist/node_modules/ajv/lib/dotjs/anyOf.js +73 -0
- package/dist/node_modules/ajv/lib/dotjs/comment.js +14 -0
- package/dist/node_modules/ajv/lib/dotjs/const.js +56 -0
- package/dist/node_modules/ajv/lib/dotjs/contains.js +81 -0
- package/dist/node_modules/ajv/lib/dotjs/custom.js +228 -0
- package/dist/node_modules/ajv/lib/dotjs/dependencies.js +168 -0
- package/dist/node_modules/ajv/lib/dotjs/enum.js +66 -0
- package/dist/node_modules/ajv/lib/dotjs/format.js +150 -0
- package/dist/node_modules/ajv/lib/dotjs/if.js +103 -0
- package/dist/node_modules/ajv/lib/dotjs/index.js +33 -0
- package/dist/node_modules/ajv/lib/dotjs/items.js +140 -0
- package/dist/node_modules/ajv/lib/dotjs/multipleOf.js +80 -0
- package/dist/node_modules/ajv/lib/dotjs/not.js +84 -0
- package/dist/node_modules/ajv/lib/dotjs/oneOf.js +73 -0
- package/dist/node_modules/ajv/lib/dotjs/pattern.js +75 -0
- package/dist/node_modules/ajv/lib/dotjs/properties.js +335 -0
- package/dist/node_modules/ajv/lib/dotjs/propertyNames.js +81 -0
- package/dist/node_modules/ajv/lib/dotjs/ref.js +124 -0
- package/dist/node_modules/ajv/lib/dotjs/required.js +270 -0
- package/dist/node_modules/ajv/lib/dotjs/uniqueItems.js +86 -0
- package/dist/node_modules/ajv/lib/dotjs/validate.js +482 -0
- package/dist/node_modules/ajv/lib/keyword.js +146 -0
- package/dist/node_modules/ajv/lib/refs/data.json +17 -0
- package/dist/node_modules/ajv/lib/refs/json-schema-draft-04.json +149 -0
- package/dist/node_modules/ajv/lib/refs/json-schema-draft-06.json +154 -0
- package/dist/node_modules/ajv/lib/refs/json-schema-draft-07.json +168 -0
- package/dist/node_modules/ajv/lib/refs/json-schema-secure.json +94 -0
- package/dist/node_modules/ajv/node_modules/json-schema-traverse/.eslintrc.yml +27 -0
- package/dist/node_modules/ajv/node_modules/json-schema-traverse/.travis.yml +8 -0
- package/dist/node_modules/ajv/node_modules/json-schema-traverse/index.js +89 -0
- package/dist/node_modules/ajv/node_modules/json-schema-traverse/package.json +43 -0
- package/dist/node_modules/ajv/node_modules/json-schema-traverse/spec/.eslintrc.yml +6 -0
- package/dist/node_modules/ajv/node_modules/json-schema-traverse/spec/fixtures/schema.js +125 -0
- package/dist/node_modules/ajv/node_modules/json-schema-traverse/spec/index.spec.js +171 -0
- package/dist/node_modules/ajv/package.json +1 -0
- package/dist/node_modules/ajv/scripts/.eslintrc.yml +3 -0
- package/dist/node_modules/ajv/scripts/bundle.js +61 -0
- package/dist/node_modules/ajv/scripts/compile-dots.js +73 -0
- package/dist/node_modules/ajv/scripts/info +10 -0
- package/dist/node_modules/ajv/scripts/prepare-tests +12 -0
- package/dist/node_modules/ajv/scripts/publish-built-version +32 -0
- package/dist/node_modules/ajv/scripts/travis-gh-pages +23 -0
- package/dist/server/collections/skill-definitions.js +31 -0
- package/dist/server/collections/skill-executions.js +19 -0
- package/dist/server/collections/skill-registry-installations.js +70 -0
- package/dist/server/migrations/20260727010000-backfill-skill-tool-names.js +66 -0
- package/dist/server/plugin.js +96 -1
- package/dist/server/services/AgentExecutionContext.js +45 -0
- package/dist/server/services/CodeValidator.js +1 -0
- package/dist/server/services/ExecutionSpanService.js +10 -2
- package/dist/server/services/InputSchemaValidator.js +83 -0
- package/dist/server/services/NativeSubAgentObserver.js +55 -8
- package/dist/server/services/SandboxRunner.js +6 -2
- package/dist/server/services/SkillAccessService.js +109 -0
- package/dist/server/services/SkillManager.js +2 -0
- package/dist/server/services/SkillRepositoryService.js +70 -0
- package/dist/server/skill-hub/actions/git-import.js +479 -216
- package/dist/server/skill-hub/mcp/McpController.js +8 -5
- package/dist/server/skill-hub/middlewares/git-import-request-method-policy.js +69 -0
- package/dist/server/skill-hub/plugin.js +68 -14
- package/dist/server/skill-hub/services/RegistrySkillInstallationService.js +249 -0
- package/dist/server/skill-hub/services/RegistrySkillSnapshotService.js +228 -0
- package/dist/server/skill-hub/tasks/SkillExecutionTask.js +15 -3
- package/dist/server/tools/skill-execute.js +23 -2
- package/dist/server/utils/ctx-utils.js +2 -2
- package/dist/server/utils/skill-tool-name.js +73 -0
- package/package.json +9 -3
- package/src/locale/en-US.json +7 -1
- package/src/locale/vi-VN.json +7 -1
- package/src/locale/zh-CN.json +7 -1
- package/src/server/__tests__/agent-execution-context.test.ts +18 -0
- package/src/server/__tests__/input-schema-validator.test.ts +26 -0
- package/src/server/__tests__/native-sub-agent-observer.test.ts +52 -2
- package/src/server/__tests__/skill-access-service.test.ts +64 -0
- package/src/server/__tests__/skill-execute.test.ts +37 -0
- package/src/server/__tests__/skill-tool-name.test.ts +23 -0
- package/src/server/collections/skill-definitions.ts +31 -0
- package/src/server/collections/skill-executions.ts +19 -0
- package/src/server/collections/skill-registry-installations.ts +41 -0
- package/src/server/migrations/20260727010000-backfill-skill-tool-names.ts +45 -0
- package/src/server/plugin.ts +104 -1
- package/src/server/services/AgentExecutionContext.ts +23 -0
- package/src/server/services/CodeValidator.ts +1 -0
- package/src/server/services/ExecutionSpanService.ts +119 -110
- package/src/server/services/InputSchemaValidator.ts +44 -0
- package/src/server/services/NativeSubAgentObserver.ts +64 -10
- package/src/server/services/SandboxRunner.ts +6 -0
- package/src/server/services/SkillAccessService.ts +100 -0
- package/src/server/services/SkillManager.ts +2 -0
- package/src/server/services/SkillRepositoryService.ts +98 -2
- package/src/server/services/__tests__/SkillRepositoryService.test.ts +33 -0
- package/src/server/skill-hub/actions/__tests__/git-import.test.ts +501 -0
- package/src/server/skill-hub/actions/git-import.ts +682 -236
- package/src/server/skill-hub/mcp/McpController.ts +8 -14
- package/src/server/skill-hub/middlewares/git-import-request-method-policy.ts +51 -0
- package/src/server/skill-hub/plugin.ts +79 -13
- package/src/server/skill-hub/services/RegistrySkillInstallationService.ts +281 -0
- package/src/server/skill-hub/services/RegistrySkillSnapshotService.ts +239 -0
- package/src/server/skill-hub/services/__tests__/RegistrySkillInstallationService.test.ts +295 -0
- package/src/server/skill-hub/services/__tests__/RegistrySkillSnapshotService.test.ts +63 -0
- package/src/server/skill-hub/tasks/SkillExecutionTask.ts +14 -2
- package/src/server/tools/skill-execute.ts +24 -2
- package/src/server/utils/ctx-utils.ts +1 -1
- package/src/server/utils/skill-tool-name.ts +58 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "http://json-schema.org/draft-04/schema#",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
4
|
+
"description": "Core schema meta-schema",
|
|
5
|
+
"definitions": {
|
|
6
|
+
"schemaArray": {
|
|
7
|
+
"type": "array",
|
|
8
|
+
"minItems": 1,
|
|
9
|
+
"items": { "$ref": "#" }
|
|
10
|
+
},
|
|
11
|
+
"positiveInteger": {
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"minimum": 0
|
|
14
|
+
},
|
|
15
|
+
"positiveIntegerDefault0": {
|
|
16
|
+
"allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
|
|
17
|
+
},
|
|
18
|
+
"simpleTypes": {
|
|
19
|
+
"enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
|
|
20
|
+
},
|
|
21
|
+
"stringArray": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": { "type": "string" },
|
|
24
|
+
"minItems": 1,
|
|
25
|
+
"uniqueItems": true
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"type": "object",
|
|
29
|
+
"properties": {
|
|
30
|
+
"id": {
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
"$schema": {
|
|
34
|
+
"type": "string"
|
|
35
|
+
},
|
|
36
|
+
"title": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
"description": {
|
|
40
|
+
"type": "string"
|
|
41
|
+
},
|
|
42
|
+
"default": {},
|
|
43
|
+
"multipleOf": {
|
|
44
|
+
"type": "number",
|
|
45
|
+
"minimum": 0,
|
|
46
|
+
"exclusiveMinimum": true
|
|
47
|
+
},
|
|
48
|
+
"maximum": {
|
|
49
|
+
"type": "number"
|
|
50
|
+
},
|
|
51
|
+
"exclusiveMaximum": {
|
|
52
|
+
"type": "boolean",
|
|
53
|
+
"default": false
|
|
54
|
+
},
|
|
55
|
+
"minimum": {
|
|
56
|
+
"type": "number"
|
|
57
|
+
},
|
|
58
|
+
"exclusiveMinimum": {
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"default": false
|
|
61
|
+
},
|
|
62
|
+
"maxLength": { "$ref": "#/definitions/positiveInteger" },
|
|
63
|
+
"minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
|
64
|
+
"pattern": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"format": "regex"
|
|
67
|
+
},
|
|
68
|
+
"additionalItems": {
|
|
69
|
+
"anyOf": [
|
|
70
|
+
{ "type": "boolean" },
|
|
71
|
+
{ "$ref": "#" }
|
|
72
|
+
],
|
|
73
|
+
"default": {}
|
|
74
|
+
},
|
|
75
|
+
"items": {
|
|
76
|
+
"anyOf": [
|
|
77
|
+
{ "$ref": "#" },
|
|
78
|
+
{ "$ref": "#/definitions/schemaArray" }
|
|
79
|
+
],
|
|
80
|
+
"default": {}
|
|
81
|
+
},
|
|
82
|
+
"maxItems": { "$ref": "#/definitions/positiveInteger" },
|
|
83
|
+
"minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
|
84
|
+
"uniqueItems": {
|
|
85
|
+
"type": "boolean",
|
|
86
|
+
"default": false
|
|
87
|
+
},
|
|
88
|
+
"maxProperties": { "$ref": "#/definitions/positiveInteger" },
|
|
89
|
+
"minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
|
|
90
|
+
"required": { "$ref": "#/definitions/stringArray" },
|
|
91
|
+
"additionalProperties": {
|
|
92
|
+
"anyOf": [
|
|
93
|
+
{ "type": "boolean" },
|
|
94
|
+
{ "$ref": "#" }
|
|
95
|
+
],
|
|
96
|
+
"default": {}
|
|
97
|
+
},
|
|
98
|
+
"definitions": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"additionalProperties": { "$ref": "#" },
|
|
101
|
+
"default": {}
|
|
102
|
+
},
|
|
103
|
+
"properties": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"additionalProperties": { "$ref": "#" },
|
|
106
|
+
"default": {}
|
|
107
|
+
},
|
|
108
|
+
"patternProperties": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"additionalProperties": { "$ref": "#" },
|
|
111
|
+
"default": {}
|
|
112
|
+
},
|
|
113
|
+
"dependencies": {
|
|
114
|
+
"type": "object",
|
|
115
|
+
"additionalProperties": {
|
|
116
|
+
"anyOf": [
|
|
117
|
+
{ "$ref": "#" },
|
|
118
|
+
{ "$ref": "#/definitions/stringArray" }
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"enum": {
|
|
123
|
+
"type": "array",
|
|
124
|
+
"minItems": 1,
|
|
125
|
+
"uniqueItems": true
|
|
126
|
+
},
|
|
127
|
+
"type": {
|
|
128
|
+
"anyOf": [
|
|
129
|
+
{ "$ref": "#/definitions/simpleTypes" },
|
|
130
|
+
{
|
|
131
|
+
"type": "array",
|
|
132
|
+
"items": { "$ref": "#/definitions/simpleTypes" },
|
|
133
|
+
"minItems": 1,
|
|
134
|
+
"uniqueItems": true
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
"format": { "type": "string" },
|
|
139
|
+
"allOf": { "$ref": "#/definitions/schemaArray" },
|
|
140
|
+
"anyOf": { "$ref": "#/definitions/schemaArray" },
|
|
141
|
+
"oneOf": { "$ref": "#/definitions/schemaArray" },
|
|
142
|
+
"not": { "$ref": "#" }
|
|
143
|
+
},
|
|
144
|
+
"dependencies": {
|
|
145
|
+
"exclusiveMaximum": [ "maximum" ],
|
|
146
|
+
"exclusiveMinimum": [ "minimum" ]
|
|
147
|
+
},
|
|
148
|
+
"default": {}
|
|
149
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-06/schema#",
|
|
3
|
+
"$id": "http://json-schema.org/draft-06/schema#",
|
|
4
|
+
"title": "Core schema meta-schema",
|
|
5
|
+
"definitions": {
|
|
6
|
+
"schemaArray": {
|
|
7
|
+
"type": "array",
|
|
8
|
+
"minItems": 1,
|
|
9
|
+
"items": { "$ref": "#" }
|
|
10
|
+
},
|
|
11
|
+
"nonNegativeInteger": {
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"minimum": 0
|
|
14
|
+
},
|
|
15
|
+
"nonNegativeIntegerDefault0": {
|
|
16
|
+
"allOf": [
|
|
17
|
+
{ "$ref": "#/definitions/nonNegativeInteger" },
|
|
18
|
+
{ "default": 0 }
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"simpleTypes": {
|
|
22
|
+
"enum": [
|
|
23
|
+
"array",
|
|
24
|
+
"boolean",
|
|
25
|
+
"integer",
|
|
26
|
+
"null",
|
|
27
|
+
"number",
|
|
28
|
+
"object",
|
|
29
|
+
"string"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"stringArray": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"items": { "type": "string" },
|
|
35
|
+
"uniqueItems": true,
|
|
36
|
+
"default": []
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"type": ["object", "boolean"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"$id": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"format": "uri-reference"
|
|
44
|
+
},
|
|
45
|
+
"$schema": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"format": "uri"
|
|
48
|
+
},
|
|
49
|
+
"$ref": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"format": "uri-reference"
|
|
52
|
+
},
|
|
53
|
+
"title": {
|
|
54
|
+
"type": "string"
|
|
55
|
+
},
|
|
56
|
+
"description": {
|
|
57
|
+
"type": "string"
|
|
58
|
+
},
|
|
59
|
+
"default": {},
|
|
60
|
+
"examples": {
|
|
61
|
+
"type": "array",
|
|
62
|
+
"items": {}
|
|
63
|
+
},
|
|
64
|
+
"multipleOf": {
|
|
65
|
+
"type": "number",
|
|
66
|
+
"exclusiveMinimum": 0
|
|
67
|
+
},
|
|
68
|
+
"maximum": {
|
|
69
|
+
"type": "number"
|
|
70
|
+
},
|
|
71
|
+
"exclusiveMaximum": {
|
|
72
|
+
"type": "number"
|
|
73
|
+
},
|
|
74
|
+
"minimum": {
|
|
75
|
+
"type": "number"
|
|
76
|
+
},
|
|
77
|
+
"exclusiveMinimum": {
|
|
78
|
+
"type": "number"
|
|
79
|
+
},
|
|
80
|
+
"maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
81
|
+
"minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
82
|
+
"pattern": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"format": "regex"
|
|
85
|
+
},
|
|
86
|
+
"additionalItems": { "$ref": "#" },
|
|
87
|
+
"items": {
|
|
88
|
+
"anyOf": [
|
|
89
|
+
{ "$ref": "#" },
|
|
90
|
+
{ "$ref": "#/definitions/schemaArray" }
|
|
91
|
+
],
|
|
92
|
+
"default": {}
|
|
93
|
+
},
|
|
94
|
+
"maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
95
|
+
"minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
96
|
+
"uniqueItems": {
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"default": false
|
|
99
|
+
},
|
|
100
|
+
"contains": { "$ref": "#" },
|
|
101
|
+
"maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
102
|
+
"minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
103
|
+
"required": { "$ref": "#/definitions/stringArray" },
|
|
104
|
+
"additionalProperties": { "$ref": "#" },
|
|
105
|
+
"definitions": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"additionalProperties": { "$ref": "#" },
|
|
108
|
+
"default": {}
|
|
109
|
+
},
|
|
110
|
+
"properties": {
|
|
111
|
+
"type": "object",
|
|
112
|
+
"additionalProperties": { "$ref": "#" },
|
|
113
|
+
"default": {}
|
|
114
|
+
},
|
|
115
|
+
"patternProperties": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"additionalProperties": { "$ref": "#" },
|
|
118
|
+
"default": {}
|
|
119
|
+
},
|
|
120
|
+
"dependencies": {
|
|
121
|
+
"type": "object",
|
|
122
|
+
"additionalProperties": {
|
|
123
|
+
"anyOf": [
|
|
124
|
+
{ "$ref": "#" },
|
|
125
|
+
{ "$ref": "#/definitions/stringArray" }
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"propertyNames": { "$ref": "#" },
|
|
130
|
+
"const": {},
|
|
131
|
+
"enum": {
|
|
132
|
+
"type": "array",
|
|
133
|
+
"minItems": 1,
|
|
134
|
+
"uniqueItems": true
|
|
135
|
+
},
|
|
136
|
+
"type": {
|
|
137
|
+
"anyOf": [
|
|
138
|
+
{ "$ref": "#/definitions/simpleTypes" },
|
|
139
|
+
{
|
|
140
|
+
"type": "array",
|
|
141
|
+
"items": { "$ref": "#/definitions/simpleTypes" },
|
|
142
|
+
"minItems": 1,
|
|
143
|
+
"uniqueItems": true
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
"format": { "type": "string" },
|
|
148
|
+
"allOf": { "$ref": "#/definitions/schemaArray" },
|
|
149
|
+
"anyOf": { "$ref": "#/definitions/schemaArray" },
|
|
150
|
+
"oneOf": { "$ref": "#/definitions/schemaArray" },
|
|
151
|
+
"not": { "$ref": "#" }
|
|
152
|
+
},
|
|
153
|
+
"default": {}
|
|
154
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"title": "Core schema meta-schema",
|
|
5
|
+
"definitions": {
|
|
6
|
+
"schemaArray": {
|
|
7
|
+
"type": "array",
|
|
8
|
+
"minItems": 1,
|
|
9
|
+
"items": { "$ref": "#" }
|
|
10
|
+
},
|
|
11
|
+
"nonNegativeInteger": {
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"minimum": 0
|
|
14
|
+
},
|
|
15
|
+
"nonNegativeIntegerDefault0": {
|
|
16
|
+
"allOf": [
|
|
17
|
+
{ "$ref": "#/definitions/nonNegativeInteger" },
|
|
18
|
+
{ "default": 0 }
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"simpleTypes": {
|
|
22
|
+
"enum": [
|
|
23
|
+
"array",
|
|
24
|
+
"boolean",
|
|
25
|
+
"integer",
|
|
26
|
+
"null",
|
|
27
|
+
"number",
|
|
28
|
+
"object",
|
|
29
|
+
"string"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"stringArray": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"items": { "type": "string" },
|
|
35
|
+
"uniqueItems": true,
|
|
36
|
+
"default": []
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"type": ["object", "boolean"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"$id": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"format": "uri-reference"
|
|
44
|
+
},
|
|
45
|
+
"$schema": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"format": "uri"
|
|
48
|
+
},
|
|
49
|
+
"$ref": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"format": "uri-reference"
|
|
52
|
+
},
|
|
53
|
+
"$comment": {
|
|
54
|
+
"type": "string"
|
|
55
|
+
},
|
|
56
|
+
"title": {
|
|
57
|
+
"type": "string"
|
|
58
|
+
},
|
|
59
|
+
"description": {
|
|
60
|
+
"type": "string"
|
|
61
|
+
},
|
|
62
|
+
"default": true,
|
|
63
|
+
"readOnly": {
|
|
64
|
+
"type": "boolean",
|
|
65
|
+
"default": false
|
|
66
|
+
},
|
|
67
|
+
"examples": {
|
|
68
|
+
"type": "array",
|
|
69
|
+
"items": true
|
|
70
|
+
},
|
|
71
|
+
"multipleOf": {
|
|
72
|
+
"type": "number",
|
|
73
|
+
"exclusiveMinimum": 0
|
|
74
|
+
},
|
|
75
|
+
"maximum": {
|
|
76
|
+
"type": "number"
|
|
77
|
+
},
|
|
78
|
+
"exclusiveMaximum": {
|
|
79
|
+
"type": "number"
|
|
80
|
+
},
|
|
81
|
+
"minimum": {
|
|
82
|
+
"type": "number"
|
|
83
|
+
},
|
|
84
|
+
"exclusiveMinimum": {
|
|
85
|
+
"type": "number"
|
|
86
|
+
},
|
|
87
|
+
"maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
88
|
+
"minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
89
|
+
"pattern": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"format": "regex"
|
|
92
|
+
},
|
|
93
|
+
"additionalItems": { "$ref": "#" },
|
|
94
|
+
"items": {
|
|
95
|
+
"anyOf": [
|
|
96
|
+
{ "$ref": "#" },
|
|
97
|
+
{ "$ref": "#/definitions/schemaArray" }
|
|
98
|
+
],
|
|
99
|
+
"default": true
|
|
100
|
+
},
|
|
101
|
+
"maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
102
|
+
"minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
103
|
+
"uniqueItems": {
|
|
104
|
+
"type": "boolean",
|
|
105
|
+
"default": false
|
|
106
|
+
},
|
|
107
|
+
"contains": { "$ref": "#" },
|
|
108
|
+
"maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
|
|
109
|
+
"minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
|
|
110
|
+
"required": { "$ref": "#/definitions/stringArray" },
|
|
111
|
+
"additionalProperties": { "$ref": "#" },
|
|
112
|
+
"definitions": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"additionalProperties": { "$ref": "#" },
|
|
115
|
+
"default": {}
|
|
116
|
+
},
|
|
117
|
+
"properties": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"additionalProperties": { "$ref": "#" },
|
|
120
|
+
"default": {}
|
|
121
|
+
},
|
|
122
|
+
"patternProperties": {
|
|
123
|
+
"type": "object",
|
|
124
|
+
"additionalProperties": { "$ref": "#" },
|
|
125
|
+
"propertyNames": { "format": "regex" },
|
|
126
|
+
"default": {}
|
|
127
|
+
},
|
|
128
|
+
"dependencies": {
|
|
129
|
+
"type": "object",
|
|
130
|
+
"additionalProperties": {
|
|
131
|
+
"anyOf": [
|
|
132
|
+
{ "$ref": "#" },
|
|
133
|
+
{ "$ref": "#/definitions/stringArray" }
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"propertyNames": { "$ref": "#" },
|
|
138
|
+
"const": true,
|
|
139
|
+
"enum": {
|
|
140
|
+
"type": "array",
|
|
141
|
+
"items": true,
|
|
142
|
+
"minItems": 1,
|
|
143
|
+
"uniqueItems": true
|
|
144
|
+
},
|
|
145
|
+
"type": {
|
|
146
|
+
"anyOf": [
|
|
147
|
+
{ "$ref": "#/definitions/simpleTypes" },
|
|
148
|
+
{
|
|
149
|
+
"type": "array",
|
|
150
|
+
"items": { "$ref": "#/definitions/simpleTypes" },
|
|
151
|
+
"minItems": 1,
|
|
152
|
+
"uniqueItems": true
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"format": { "type": "string" },
|
|
157
|
+
"contentMediaType": { "type": "string" },
|
|
158
|
+
"contentEncoding": { "type": "string" },
|
|
159
|
+
"if": {"$ref": "#"},
|
|
160
|
+
"then": {"$ref": "#"},
|
|
161
|
+
"else": {"$ref": "#"},
|
|
162
|
+
"allOf": { "$ref": "#/definitions/schemaArray" },
|
|
163
|
+
"anyOf": { "$ref": "#/definitions/schemaArray" },
|
|
164
|
+
"oneOf": { "$ref": "#/definitions/schemaArray" },
|
|
165
|
+
"not": { "$ref": "#" }
|
|
166
|
+
},
|
|
167
|
+
"default": true
|
|
168
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#",
|
|
4
|
+
"title": "Meta-schema for the security assessment of JSON Schemas",
|
|
5
|
+
"description": "If a JSON Schema fails validation against this meta-schema, it may be unsafe to validate untrusted data",
|
|
6
|
+
"definitions": {
|
|
7
|
+
"schemaArray": {
|
|
8
|
+
"type": "array",
|
|
9
|
+
"minItems": 1,
|
|
10
|
+
"items": {"$ref": "#"}
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"patternProperties": {
|
|
15
|
+
"description": "prevent slow validation of large property names",
|
|
16
|
+
"required": ["propertyNames"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"propertyNames": {
|
|
19
|
+
"required": ["maxLength"]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"uniqueItems": {
|
|
24
|
+
"description": "prevent slow validation of large non-scalar arrays",
|
|
25
|
+
"if": {
|
|
26
|
+
"properties": {
|
|
27
|
+
"uniqueItems": {"const": true},
|
|
28
|
+
"items": {
|
|
29
|
+
"properties": {
|
|
30
|
+
"type": {
|
|
31
|
+
"anyOf": [
|
|
32
|
+
{
|
|
33
|
+
"enum": ["object", "array"]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": "array",
|
|
37
|
+
"contains": {"enum": ["object", "array"]}
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"then": {
|
|
46
|
+
"required": ["maxItems"]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"pattern": {
|
|
50
|
+
"description": "prevent slow pattern matching of large strings",
|
|
51
|
+
"required": ["maxLength"]
|
|
52
|
+
},
|
|
53
|
+
"format": {
|
|
54
|
+
"description": "prevent slow format validation of large strings",
|
|
55
|
+
"required": ["maxLength"]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"properties": {
|
|
59
|
+
"additionalItems": {"$ref": "#"},
|
|
60
|
+
"additionalProperties": {"$ref": "#"},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"additionalProperties": {
|
|
63
|
+
"anyOf": [
|
|
64
|
+
{"type": "array"},
|
|
65
|
+
{"$ref": "#"}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"items": {
|
|
70
|
+
"anyOf": [
|
|
71
|
+
{"$ref": "#"},
|
|
72
|
+
{"$ref": "#/definitions/schemaArray"}
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"definitions": {
|
|
76
|
+
"additionalProperties": {"$ref": "#"}
|
|
77
|
+
},
|
|
78
|
+
"patternProperties": {
|
|
79
|
+
"additionalProperties": {"$ref": "#"}
|
|
80
|
+
},
|
|
81
|
+
"properties": {
|
|
82
|
+
"additionalProperties": {"$ref": "#"}
|
|
83
|
+
},
|
|
84
|
+
"if": {"$ref": "#"},
|
|
85
|
+
"then": {"$ref": "#"},
|
|
86
|
+
"else": {"$ref": "#"},
|
|
87
|
+
"allOf": {"$ref": "#/definitions/schemaArray"},
|
|
88
|
+
"anyOf": {"$ref": "#/definitions/schemaArray"},
|
|
89
|
+
"oneOf": {"$ref": "#/definitions/schemaArray"},
|
|
90
|
+
"not": {"$ref": "#"},
|
|
91
|
+
"contains": {"$ref": "#"},
|
|
92
|
+
"propertyNames": {"$ref": "#"}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
extends: eslint:recommended
|
|
2
|
+
env:
|
|
3
|
+
node: true
|
|
4
|
+
browser: true
|
|
5
|
+
rules:
|
|
6
|
+
block-scoped-var: 2
|
|
7
|
+
complexity: [2, 13]
|
|
8
|
+
curly: [2, multi-or-nest, consistent]
|
|
9
|
+
dot-location: [2, property]
|
|
10
|
+
dot-notation: 2
|
|
11
|
+
indent: [2, 2, SwitchCase: 1]
|
|
12
|
+
linebreak-style: [2, unix]
|
|
13
|
+
new-cap: 2
|
|
14
|
+
no-console: [2, allow: [warn, error]]
|
|
15
|
+
no-else-return: 2
|
|
16
|
+
no-eq-null: 2
|
|
17
|
+
no-fallthrough: 2
|
|
18
|
+
no-invalid-this: 2
|
|
19
|
+
no-return-assign: 2
|
|
20
|
+
no-shadow: 1
|
|
21
|
+
no-trailing-spaces: 2
|
|
22
|
+
no-use-before-define: [2, nofunc]
|
|
23
|
+
quotes: [2, single, avoid-escape]
|
|
24
|
+
semi: [2, always]
|
|
25
|
+
strict: [2, global]
|
|
26
|
+
valid-jsdoc: [2, requireReturn: false]
|
|
27
|
+
no-control-regex: 0
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var traverse = module.exports = function (schema, opts, cb) {
|
|
4
|
+
// Legacy support for v0.3.1 and earlier.
|
|
5
|
+
if (typeof opts == 'function') {
|
|
6
|
+
cb = opts;
|
|
7
|
+
opts = {};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
cb = opts.cb || cb;
|
|
11
|
+
var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};
|
|
12
|
+
var post = cb.post || function() {};
|
|
13
|
+
|
|
14
|
+
_traverse(opts, pre, post, schema, '', schema);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
traverse.keywords = {
|
|
19
|
+
additionalItems: true,
|
|
20
|
+
items: true,
|
|
21
|
+
contains: true,
|
|
22
|
+
additionalProperties: true,
|
|
23
|
+
propertyNames: true,
|
|
24
|
+
not: true
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
traverse.arrayKeywords = {
|
|
28
|
+
items: true,
|
|
29
|
+
allOf: true,
|
|
30
|
+
anyOf: true,
|
|
31
|
+
oneOf: true
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
traverse.propsKeywords = {
|
|
35
|
+
definitions: true,
|
|
36
|
+
properties: true,
|
|
37
|
+
patternProperties: true,
|
|
38
|
+
dependencies: true
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
traverse.skipKeywords = {
|
|
42
|
+
default: true,
|
|
43
|
+
enum: true,
|
|
44
|
+
const: true,
|
|
45
|
+
required: true,
|
|
46
|
+
maximum: true,
|
|
47
|
+
minimum: true,
|
|
48
|
+
exclusiveMaximum: true,
|
|
49
|
+
exclusiveMinimum: true,
|
|
50
|
+
multipleOf: true,
|
|
51
|
+
maxLength: true,
|
|
52
|
+
minLength: true,
|
|
53
|
+
pattern: true,
|
|
54
|
+
format: true,
|
|
55
|
+
maxItems: true,
|
|
56
|
+
minItems: true,
|
|
57
|
+
uniqueItems: true,
|
|
58
|
+
maxProperties: true,
|
|
59
|
+
minProperties: true
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
|
|
64
|
+
if (schema && typeof schema == 'object' && !Array.isArray(schema)) {
|
|
65
|
+
pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
66
|
+
for (var key in schema) {
|
|
67
|
+
var sch = schema[key];
|
|
68
|
+
if (Array.isArray(sch)) {
|
|
69
|
+
if (key in traverse.arrayKeywords) {
|
|
70
|
+
for (var i=0; i<sch.length; i++)
|
|
71
|
+
_traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);
|
|
72
|
+
}
|
|
73
|
+
} else if (key in traverse.propsKeywords) {
|
|
74
|
+
if (sch && typeof sch == 'object') {
|
|
75
|
+
for (var prop in sch)
|
|
76
|
+
_traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
|
|
77
|
+
}
|
|
78
|
+
} else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {
|
|
79
|
+
_traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
function escapeJsonPtr(str) {
|
|
88
|
+
return str.replace(/~/g, '~0').replace(/\//g, '~1');
|
|
89
|
+
}
|