Repository navigation
Expand file tree
/
Copy pathcases.json
More file actions
594 lines (594 loc) · 25 KB
/
Copy pathcases.json
File metadata and controls
594 lines (594 loc) · 25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
{
"version": 1,
"generated_by": "tests/consistency/generate_cases.py",
"cases": [
{
"name": "ping",
"rpc": "KclService.Ping",
"new_core": false,
"args": {
"value": "consistency"
},
"expect": {
"value": "consistency"
}
},
{
"name": "exec_program_basic",
"rpc": "KclService.ExecProgram",
"new_core": false,
"args": {
"k_code_list": [
"alice = {age = 18}"
]
},
"expect": {
"yaml_result": "alice:\n age: 18",
"json_result": "{\"alice\": {\"age\": 18}}"
}
},
{
"name": "exec_program_overrides",
"rpc": "KclService.ExecProgram",
"new_core": false,
"args": {
"k_code_list": [
"alice = {age = 1}"
],
"overrides": [
"alice.age=18"
]
},
"expect": {
"yaml_result": "alice:\n age: 18"
}
},
{
"name": "format_code",
"rpc": "KclService.FormatCode",
"new_core": false,
"args": {
"source": "a=1\n"
},
"expect": {
"formatted": "a = 1\n"
}
},
{
"name": "validate_code_ok",
"rpc": "KclService.ValidateCode",
"new_core": false,
"args": {
"data": "{\"name\": \"Alice\"}",
"code": "schema Person:\n name: str\n check:\n len(name) > 0"
},
"expect": {
"success": true,
"err_message": ""
}
},
{
"name": "validate_code_invalid",
"rpc": "KclService.ValidateCode",
"new_core": false,
"args": {
"data": "{\"name\": \"\"}",
"code": "schema Person:\n name: str\n check:\n len(name) > 0"
},
"expect": {
"success": false,
"has_error_message": true
}
},
{
"name": "generate_kcl_json",
"rpc": "KclService.GenerateKcl",
"new_core": true,
"args": {
"source": "{\"a\": {\"b\": 1}, \"c\": [1, 2.5, true, null], \"d-e\": \"x\"}",
"filename": "data.json"
},
"expect": {
"kcl": "a = {\n b = 1\n}\nc = [1, 2.5, true, None]\n\"d-e\" = \"x\"\n"
}
},
{
"name": "generate_kcl_yaml",
"rpc": "KclService.GenerateKcl",
"new_core": true,
"args": {
"source": "a: 1\nb:\n - x\n - y\n",
"filename": "data.yaml"
},
"expect": {
"kcl": "a = 1\nb = [\"x\", \"y\"]\n"
}
},
{
"name": "generate_toml",
"rpc": "KclService.GenerateToml",
"new_core": true,
"args": {
"exec_args": {
"k_code_list": [
"app = {name = \"demo\", ports = [80, 443], tls = {enabled = True}}"
]
}
},
"expect": {
"toml": "[app]\nname = \"demo\"\nports = [80, 443]\n\n[app.tls]\nenabled = true\n"
}
},
{
"name": "format_test_report",
"rpc": "KclService.FormatTestReport",
"new_core": true,
"args": {
"result": {
"info": [
{
"name": "test_pass",
"duration": "1500"
},
{
"name": "test_log",
"duration": "2500",
"log_message": "hello log"
},
{
"name": "test_fail",
"error": "Error: assert failed",
"duration": "1000"
}
]
}
},
"expect": {
"report": "test_pass: PASS (1ms)\ntest_log: PASS (2ms)\nhello log\ntest_fail: FAIL (1ms)\nError: assert failed\n--------------------------------------------------------------------------------\nPASS: 2/3\nFAIL: 1/3\n"
}
},
{
"name": "generate_openapi_v3",
"rpc": "KclService.GenerateOpenAPI",
"new_core": true,
"args": {
"parse_args": {
"paths": [
"tests/consistency/testdata/gen_openapi/main.k"
]
},
"version": "v3"
},
"expect": {
"spec": "{\n \"components\": {\n \"schemas\": {\n \"Address\": {\n \"description\": \"A postal address.\",\n \"properties\": {\n \"geo\": {\n \"additionalProperties\": {\n \"format\": \"double\",\n \"type\": \"number\"\n },\n \"description\": \"Arbitrary float coordinates keyed by name.\",\n \"type\": \"object\"\n },\n \"street\": {\n \"description\": \"The street name.\",\n \"type\": \"string\"\n },\n \"zipCode\": {\n \"description\": \"The ZIP code.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"street\",\n \"zipCode\",\n \"geo\"\n ],\n \"type\": \"object\"\n },\n \"Base\": {\n \"description\": \"Base schema carrying the shared identifier.\",\n \"properties\": {\n \"id\": {\n \"description\": \"The unique identifier.\",\n \"format\": \"int64\",\n \"type\": \"integer\"\n }\n },\n \"required\": [\n \"id\"\n ],\n \"type\": \"object\"\n },\n \"Person\": {\n \"allOf\": [\n {\n \"$ref\": \"#/components/schemas/Base\"\n },\n {\n \"description\": \"A person in the address book.\",\n \"properties\": {\n \"address\": {\n \"$ref\": \"#/components/schemas/Address\",\n \"description\": \"The home address.\"\n },\n \"age\": {\n \"default\": 18,\n \"description\": \"The age in years.\",\n \"format\": \"int64\",\n \"type\": \"integer\"\n },\n \"emails\": {\n \"description\": \"Known email addresses.\",\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n },\n \"id\": {\n \"description\": \"The unique identifier.\",\n \"format\": \"int64\",\n \"type\": \"integer\"\n },\n \"name\": {\n \"description\": \"The full name.\",\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"name\",\n \"address\",\n \"id\"\n ],\n \"type\": \"object\"\n }\n ]\n },\n \"UnionS\": {\n \"description\": \"A schema with a union attribute.\",\n \"properties\": {\n \"val\": {\n \"description\": \"An int or a str.\",\n \"oneOf\": [\n {\n \"format\": \"int64\",\n \"type\": \"integer\"\n },\n {\n \"type\": \"string\"\n }\n ]\n }\n },\n \"required\": [\n \"val\"\n ],\n \"type\": \"object\"\n }\n }\n },\n \"info\": {\n \"title\": \"__main__\",\n \"version\": \"1.0.0\"\n },\n \"openapi\": \"3.0.0\"\n}"
}
},
{
"name": "generate_proto",
"rpc": "KclService.GenerateProto",
"new_core": true,
"args": {
"parse_args": {
"paths": [
"tests/consistency/testdata/gen_openapi/main.k"
]
},
"package": "example.v1"
},
"expect": {
"proto": "syntax = \"proto3\";\n\npackage example.v1;\n\nimport \"google/protobuf/struct.proto\";\n\n// Base schema carrying the shared identifier.\nmessage Base {\n // The unique identifier.\n int64 id = 1;\n}\n\n// A postal address.\nmessage Address {\n // Arbitrary float coordinates keyed by name.\n map<string, double> geo = 1;\n // The street name.\n string street = 2;\n // The ZIP code.\n string zip_code = 3;\n}\n\n// A person in the address book.\nmessage Person {\n // The home address.\n Address address = 1;\n // The age in years.\n int64 age = 2;\n // Known email addresses.\n repeated string emails = 3;\n // The unique identifier.\n int64 id = 4;\n // The full name.\n string name = 5;\n}\n\n// A schema with a union attribute.\nmessage UnionS {\n // An int or a str.\n google.protobuf.Value val = 1;\n}\n\n"
}
},
{
"name": "generate_doc_md",
"rpc": "KclService.GenerateDoc",
"new_core": true,
"args": {
"parse_args": {
"paths": [
"tests/consistency/testdata/gen_openapi/main.k"
]
},
"format": "md"
},
"expect": {
"content": "# Schemas\n\n## Package __main__\n\n### Base\n\nBase schema carrying the shared identifier.\n\n| Name | Type | Required | Default | Description |\n| --- | --- | --- | --- | --- |\n| id | int | yes | | The unique identifier. |\n\n### Address\n\nA postal address.\n\n| Name | Type | Required | Default | Description |\n| --- | --- | --- | --- | --- |\n| geo | {str:float} | yes | | Arbitrary float coordinates keyed by name. |\n| street | str | yes | | The street name. |\n| zipCode | str | yes | | The ZIP code. |\n\n### Person\n\nA person in the address book.\n\n| Name | Type | Required | Default | Description |\n| --- | --- | --- | --- | --- |\n| address | Address | yes | | The home address. |\n| age | int | no | 18 | The age in years. |\n| emails | [str] | no | | Known email addresses. |\n| id | int | yes | | The unique identifier. |\n| name | str | yes | | The full name. |\n\n### UnionS\n\nA schema with a union attribute.\n\n| Name | Type | Required | Default | Description |\n| --- | --- | --- | --- | --- |\n| val | int \\| str | yes | | An int or a str. |\n"
}
},
{
"name": "parse_file",
"rpc": "KclService.ParseFile",
"new_core": false,
"args": {
"path": "main.k",
"source": "schema Person:\n name: str\n age?: int = 18\n\nalice = Person {name = \"Alice\"}\nnums = [i * 2 for i in [1, 2, 3]]\ntotal = sum(nums)\n"
},
"expect": {
"body_count": 4,
"error_count": 0,
"deps": []
}
},
{
"name": "parse_program",
"rpc": "KclService.ParseProgram",
"new_core": false,
"args": {
"sources": [
"schema Person:\n name: str\n age?: int = 18\n\nalice = Person {name = \"Alice\"}\nnums = [i * 2 for i in [1, 2, 3]]\ntotal = sum(nums)\n"
]
},
"expect": {
"module_count": 1,
"error_count": 0,
"paths": [
"__main__.k"
]
}
},
{
"name": "list_options",
"rpc": "KclService.ListOptions",
"new_core": false,
"args": {
"sources": [
"a = option(\"key1\")\nb = option(\"key2\", required=True)\n"
]
},
"expect": {
"option_count": 2,
"options": [
[
"key1",
false
],
[
"key2",
true
]
]
}
},
{
"name": "list_variables",
"rpc": "KclService.ListVariables",
"new_core": false,
"args": {
"files": [
"tests/consistency/testdata/variables/main.k"
],
"specs": [
"a",
"b"
]
},
"expect": {
"values": {
"a": [
"1"
],
"b": [
"{\n c = 2\n}"
]
},
"unsupported_codes": [],
"parse_error_count": 0
}
},
{
"name": "load_package",
"rpc": "KclService.LoadPackage",
"new_core": false,
"args": {
"parse_args": {
"paths": [
"tests/consistency/testdata/pkg"
]
},
"resolve_ast": true
},
"expect": {
"path_count": 1,
"type_error_count": 0,
"parse_error_count": 0,
"symbol_count": 20,
"scope_count": 5,
"has_kcl_mod": true,
"kcl_mod_name": "consistency",
"app_count": 1,
"import_count": 1
}
},
{
"name": "get_schema_type_mapping",
"rpc": "KclService.GetSchemaTypeMapping",
"new_core": false,
"args": {
"exec_args": {
"k_code_list": [
"schema Person:\n name: str\n age?: int = 18\n\nalice = Person {name = \"Alice\"}\nnums = [i * 2 for i in [1, 2, 3]]\ntotal = sum(nums)\n"
]
},
"schema_name": "Person"
},
"expect": {
"type_mapping": {
"Person": {
"pkg_path": "__main__",
"properties": {
"age": {
"default": "18",
"line": 2,
"type": "int"
},
"name": {
"line": 1,
"type": "str"
}
},
"required": [
"name"
],
"schema_name": "Person",
"type": "schema"
}
}
}
},
{
"name": "get_schema_type_mapping_under_path",
"rpc": "KclService.GetSchemaTypeMappingUnderPath",
"new_core": false,
"args": {
"exec_args": {
"work_dir": "tests/consistency/testdata/schema",
"k_filename_list": [
"main.k"
]
},
"schema_name": "Person"
},
"expect": {
"type_mapping": {
"__main__": {
"schema_type": [
{
"pkg_path": "__main__",
"properties": {
"age": {
"default": "18",
"line": 2,
"type": "int"
},
"name": {
"line": 1,
"type": "str"
}
},
"required": [
"name"
],
"schema_name": "Person",
"type": "schema"
}
]
}
}
}
},
{
"name": "get_version",
"rpc": "KclService.GetVersion",
"new_core": false,
"args": {},
"expect": {
"version": "0.13",
"has_checksum": true,
"has_git_sha": true,
"has_version_info": true
}
},
{
"name": "list_method",
"rpc": "BuiltinService.ListMethod",
"new_core": false,
"args": {},
"expect": {
"has_kclservice_ping": true,
"has_kclservice_parse_program": true,
"has_builtinservice_list_method": true,
"method_count": 33,
"has_empty_name": false
}
},
{
"name": "lint_path_clean",
"rpc": "KclService.LintPath",
"new_core": false,
"args": {
"paths": [
"tests/consistency/testdata/pkg"
]
},
"expect": {
"result_count": 0
}
},
{
"name": "lint_path_with_errors",
"rpc": "KclService.LintPath",
"new_core": false,
"args": {
"paths": [
"scratch:lint"
]
},
"expect": {
"has_result": true
}
},
{
"name": "format_path_dry_run",
"rpc": "KclService.FormatPath",
"new_core": false,
"args": {
"path": "tests/consistency/testdata/pkg",
"dry_run": true
},
"expect": {
"changed_count": 1,
"changed": [
"main.k"
]
}
},
{
"name": "test_run",
"rpc": "KclService.Test",
"new_core": false,
"args": {
"pkg_list": [
"tests/consistency/testdata/pkg"
]
},
"expect": {
"names": [
"test_replicas_positive"
],
"failed": []
}
},
{
"name": "override_file",
"rpc": "KclService.OverrideFile",
"new_core": false,
"args": {
"file": "scratch:override/main.k",
"specs": [
"app.name=overridden"
]
},
"expect": {
"result": true,
"parse_error_count": 0
}
},
{
"name": "load_settings_files",
"rpc": "KclService.LoadSettingsFiles",
"new_core": false,
"args": {
"work_dir": "scratch:settings",
"files": [
"scratch:settings/kcl.yaml"
]
},
"expect": {
"options": [
[
"myopt",
"\"myval\""
],
[
"other",
"2"
]
],
"output": "out.yaml",
"overrides": [
"app.name=overridden"
],
"strict_range_check": true,
"verbose": 1
}
},
{
"name": "update_dependencies_no_deps",
"rpc": "KclService.UpdateDependencies",
"new_core": false,
"args": {
"manifest_path": "scratch:update_dependencies"
},
"expect": {
"external_pkg_count": 0
}
},
{
"name": "generate_rust",
"rpc": "KclService.GenerateRust",
"new_core": true,
"args": {
"parse_args": {
"paths": [
"tests/consistency/testdata/dto/main.k"
]
}
},
"expect": {
"rust_source": "/// A user of the platform.\n#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)]\npub struct User {\n /// Whether the account is active.\n /// KCL default: True\n #[serde(default)]\n pub active: Option<bool>,\n /// The unique identifier.\n pub id: i64,\n /// The display name.\n pub name: String,\n /// An optional alias.\n #[serde(default)]\n pub nickname: Option<String>,\n /// A numeric score.\n /// KCL default: 1\n #[serde(default)]\n pub score: Option<f64>,\n}\nimpl User {\n pub fn validate(&self) -> Result<(), Vec<String>> {\n let errors = Vec::new();\n if errors.is_empty() {\n Ok(())\n } else {\n Err(errors)\n }\n }\n}\n\n/// Runtime settings of the platform.\n#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)]\npub struct Settings {\n /// Free-form key-value labels.\n #[serde(default)]\n pub labels: Option<std::collections::HashMap<String, String>>,\n /// The run mode.\n /// KCL default: \"auto\"\n pub mode: serde_json::Value,\n /// How many times a failed request is retried.\n /// KCL default: 3\n pub retries: i64,\n /// Free-form tags.\n #[serde(default)]\n pub tags: Option<Vec<String>>,\n}\nimpl Settings {\n pub fn validate(&self) -> Result<(), Vec<String>> {\n let errors = Vec::new();\n if errors.is_empty() {\n Ok(())\n } else {\n Err(errors)\n }\n }\n}\n\n"
}
},
{
"name": "generate_python",
"rpc": "KclService.GeneratePython",
"new_core": true,
"args": {
"parse_args": {
"paths": [
"tests/consistency/testdata/dto/main.k"
]
}
},
"expect": {
"python_source": "import dataclasses\nimport re\nimport typing\n\n\n@dataclasses.dataclass(kw_only=True)\nclass User:\n \"\"\"A user of the platform.\"\"\"\n # Whether the account is active.\n # KCL default: True\n active: typing.Optional[bool] = None\n # The unique identifier.\n id: int\n # The display name.\n name: str\n # An optional alias.\n nickname: typing.Optional[str] = None\n # A numeric score.\n # KCL default: 1\n score: typing.Optional[float] = None\n\n def validate(self) -> typing.List[str]:\n errors: typing.List[str] = []\n return errors\n\n\n@dataclasses.dataclass(kw_only=True)\nclass Settings:\n \"\"\"Runtime settings of the platform.\"\"\"\n # Free-form key-value labels.\n labels: typing.Optional[typing.Dict[str, str]] = None\n # The run mode.\n # KCL default: \"auto\"\n mode: typing.Any\n # How many times a failed request is retried.\n # KCL default: 3\n retries: int\n # Free-form tags.\n tags: typing.Optional[typing.List[str]] = None\n\n def validate(self) -> typing.List[str]:\n errors: typing.List[str] = []\n return errors\n\n\n"
}
},
{
"name": "generate_go",
"rpc": "KclService.GenerateGo",
"new_core": true,
"args": {
"parse_args": {
"paths": [
"tests/consistency/testdata/dto/main.k"
]
},
"package": "dto"
},
"expect": {
"go_source": "package dto\n\n// A user of the platform.\ntype User struct {\n\t// Whether the account is active.\n\t// KCL default: True\n\tActive *bool `json:\"active,omitempty\"`\n\t// The unique identifier.\n\tId int64 `json:\"id\"`\n\t// The display name.\n\tName string `json:\"name\"`\n\t// An optional alias.\n\tNickname *string `json:\"nickname,omitempty\"`\n\t// A numeric score.\n\t// KCL default: 1\n\tScore *float64 `json:\"score,omitempty\"`\n}\nfunc (s *User) Validate() []string {\n\terrors := []string{}\n\treturn errors\n}\n\n// Runtime settings of the platform.\ntype Settings struct {\n\t// Free-form key-value labels.\n\tLabels map[string]string `json:\"labels,omitempty\"`\n\t// The run mode.\n\t// KCL default: \"auto\"\n\tMode any `json:\"mode\"`\n\t// How many times a failed request is retried.\n\t// KCL default: 3\n\tRetries int64 `json:\"retries\"`\n\t// Free-form tags.\n\tTags []string `json:\"tags,omitempty\"`\n}\nfunc (s *Settings) Validate() []string {\n\terrors := []string{}\n\treturn errors\n}\n\n"
}
},
{
"name": "generate_java",
"rpc": "KclService.GenerateJava",
"new_core": true,
"args": {
"parse_args": {
"paths": [
"tests/consistency/testdata/dto/main.k"
]
},
"package": "com.example.dto"
},
"expect": {
"java_source": "package com.example.dto;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Objects;\n\n// A user of the platform.\nclass User {\n // Whether the account is active.\n // KCL default: True\n public Boolean active;\n // The unique identifier.\n public long id;\n // The display name.\n public String name;\n // An optional alias.\n public String nickname;\n // A numeric score.\n // KCL default: 1\n public Double score;\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (!(o instanceof User)) return false;\n User other = (User) o;\n return Objects.equals(this.active, other.active)\n && Objects.equals(this.id, other.id)\n && Objects.equals(this.name, other.name)\n && Objects.equals(this.nickname, other.nickname)\n && Objects.equals(this.score, other.score);\n }\n\n @Override\n public int hashCode() {\n return Objects.hash(active, id, name, nickname, score);\n }\n\n public List<String> validate() {\n List<String> errors = new ArrayList<>();\n return errors;\n }\n}\n\n// Runtime settings of the platform.\nclass Settings {\n // Free-form key-value labels.\n public Map<String, String> labels;\n // The run mode.\n // KCL default: \"auto\"\n public Object mode;\n // How many times a failed request is retried.\n // KCL default: 3\n public long retries;\n // Free-form tags.\n public List<String> tags;\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (!(o instanceof Settings)) return false;\n Settings other = (Settings) o;\n return Objects.equals(this.labels, other.labels)\n && Objects.equals(this.mode, other.mode)\n && Objects.equals(this.retries, other.retries)\n && Objects.equals(this.tags, other.tags);\n }\n\n @Override\n public int hashCode() {\n return Objects.hash(labels, mode, retries, tags);\n }\n\n public List<String> validate() {\n List<String> errors = new ArrayList<>();\n return errors;\n }\n}\n\n"
}
},
{
"name": "generate_typescript",
"rpc": "KclService.GenerateTypeScript",
"new_core": true,
"args": {
"parse_args": {
"paths": [
"tests/consistency/testdata/dto/main.k"
]
}
},
"expect": {
"typescript_source": "// A user of the platform.\nexport class User {\n // Whether the account is active.\n // KCL default: True\n active?: boolean;\n // The unique identifier.\n id!: number;\n // The display name.\n name!: string;\n // An optional alias.\n nickname?: string;\n // A numeric score.\n // KCL default: 1\n score?: number;\n\n validate(): string[] {\n const errors: string[] = [];\n return errors;\n }\n}\n\n// Runtime settings of the platform.\nexport class Settings {\n // Free-form key-value labels.\n labels?: Record<string, string>;\n // The run mode.\n // KCL default: \"auto\"\n mode!: any;\n // How many times a failed request is retried.\n // KCL default: 3\n retries!: number;\n // Free-form tags.\n tags?: string[];\n\n validate(): string[] {\n const errors: string[] = [];\n return errors;\n }\n}\n\n"
}
}
]
}