agent-rulebook 0.1.6 → 0.2.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/README.md +54 -138
- package/dist/commands/index.js +11 -10
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.js +3 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/output.d.ts +0 -5
- package/dist/commands/output.js +0 -47
- package/dist/commands/output.js.map +1 -1
- package/dist/commands/project.d.ts +2 -0
- package/dist/commands/project.js +33 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/commands/resolution.d.ts +2 -0
- package/dist/commands/resolution.js +32 -0
- package/dist/commands/resolution.js.map +1 -0
- package/dist/commands/sync.d.ts +6 -3
- package/dist/commands/sync.js +130 -177
- package/dist/commands/sync.js.map +1 -1
- package/dist/core/attempt-outcome.d.ts +21 -0
- package/dist/core/attempt-outcome.js +61 -0
- package/dist/core/attempt-outcome.js.map +1 -0
- package/dist/core/change-policy.d.ts +7 -0
- package/dist/core/change-policy.js +14 -0
- package/dist/core/change-policy.js.map +1 -0
- package/dist/core/index.d.ts +34 -31
- package/dist/core/index.js +18 -13
- package/dist/core/index.js.map +1 -1
- package/dist/core/outcome-schema.d.ts +55 -0
- package/dist/core/outcome-schema.js +44 -0
- package/dist/core/outcome-schema.js.map +1 -0
- package/dist/core/problem-fingerprint.d.ts +4 -0
- package/dist/core/problem-fingerprint.js +37 -0
- package/dist/core/problem-fingerprint.js.map +1 -0
- package/dist/core/problem-schema.d.ts +34 -0
- package/dist/core/problem-schema.js +37 -0
- package/dist/core/problem-schema.js.map +1 -0
- package/dist/core/project-environment-detector.d.ts +2 -2
- package/dist/core/project-environment-detector.js +8 -52
- package/dist/core/project-environment-detector.js.map +1 -1
- package/dist/core/project-file-scan.d.ts +17 -0
- package/dist/core/project-file-scan.js +73 -0
- package/dist/core/project-file-scan.js.map +1 -0
- package/dist/core/project-registry.d.ts +8 -0
- package/dist/core/project-registry.js +38 -0
- package/dist/core/project-registry.js.map +1 -0
- package/dist/core/repository-identity.d.ts +7 -0
- package/dist/core/repository-identity.js +27 -0
- package/dist/core/repository-identity.js.map +1 -0
- package/dist/core/resolution-applicability.d.ts +20 -0
- package/dist/core/resolution-applicability.js +38 -0
- package/dist/core/resolution-applicability.js.map +1 -0
- package/dist/core/resolution-parser.d.ts +20 -0
- package/dist/core/resolution-parser.js +47 -0
- package/dist/core/resolution-parser.js.map +1 -0
- package/dist/core/resolution-ranker.d.ts +34 -0
- package/dist/core/resolution-ranker.js +40 -0
- package/dist/core/resolution-ranker.js.map +1 -0
- package/dist/core/resolution-relation.d.ts +14 -0
- package/dist/core/resolution-relation.js +29 -0
- package/dist/core/resolution-relation.js.map +1 -0
- package/dist/core/resolution-schema.d.ts +109 -0
- package/dist/core/resolution-schema.js +29 -0
- package/dist/core/resolution-schema.js.map +1 -0
- package/dist/core/resolution-search-types.d.ts +37 -0
- package/dist/core/resolution-search-types.js +2 -0
- package/dist/core/resolution-search-types.js.map +1 -0
- package/dist/core/resolution-semantic-checksum.d.ts +12 -0
- package/dist/core/resolution-semantic-checksum.js +24 -0
- package/dist/core/resolution-semantic-checksum.js.map +1 -0
- package/dist/core/resolution-writer.d.ts +7 -0
- package/dist/core/resolution-writer.js +33 -0
- package/dist/core/resolution-writer.js.map +1 -0
- package/dist/core/solution-schema.d.ts +42 -0
- package/dist/core/solution-schema.js +28 -0
- package/dist/core/solution-schema.js.map +1 -0
- package/dist/core/source-evidence-schema.d.ts +26 -0
- package/dist/core/source-evidence-schema.js +29 -0
- package/dist/core/source-evidence-schema.js.map +1 -0
- package/dist/core/source-evidence.d.ts +14 -0
- package/dist/core/source-evidence.js +69 -0
- package/dist/core/source-evidence.js.map +1 -0
- package/dist/core/stack-detector.d.ts +2 -2
- package/dist/core/stack-detector.js +11 -63
- package/dist/core/stack-detector.js.map +1 -1
- package/dist/index.d.ts +3 -4
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +2 -2
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/resolution-change.d.ts +19 -0
- package/dist/mcp/resolution-change.js +136 -0
- package/dist/mcp/resolution-change.js.map +1 -0
- package/dist/mcp/resolutions-commit-change-tool.d.ts +5 -0
- package/dist/mcp/resolutions-commit-change-tool.js +21 -0
- package/dist/mcp/resolutions-commit-change-tool.js.map +1 -0
- package/dist/mcp/resolutions-find-tool.d.ts +5 -0
- package/dist/mcp/resolutions-find-tool.js +75 -0
- package/dist/mcp/resolutions-find-tool.js.map +1 -0
- package/dist/mcp/resolutions-get-source-tool.d.ts +5 -0
- package/dist/mcp/resolutions-get-source-tool.js +30 -0
- package/dist/mcp/resolutions-get-source-tool.js.map +1 -0
- package/dist/mcp/resolutions-get-tool.d.ts +5 -0
- package/dist/mcp/resolutions-get-tool.js +27 -0
- package/dist/mcp/resolutions-get-tool.js.map +1 -0
- package/dist/mcp/resolutions-list-facets-tool.d.ts +4 -0
- package/dist/mcp/resolutions-list-facets-tool.js +18 -0
- package/dist/mcp/resolutions-list-facets-tool.js.map +1 -0
- package/dist/mcp/resolutions-prepare-change-tool.d.ts +5 -0
- package/dist/mcp/resolutions-prepare-change-tool.js +7 -0
- package/dist/mcp/resolutions-prepare-change-tool.js.map +1 -0
- package/dist/mcp/resolutions-report-attempt-tool.d.ts +5 -0
- package/dist/mcp/resolutions-report-attempt-tool.js +87 -0
- package/dist/mcp/resolutions-report-attempt-tool.js.map +1 -0
- package/dist/mcp/schemas.d.ts +265 -197
- package/dist/mcp/schemas.js +28 -93
- package/dist/mcp/schemas.js.map +1 -1
- package/dist/mcp/tool-output.d.ts +0 -34
- package/dist/mcp/tool-output.js +2 -71
- package/dist/mcp/tool-output.js.map +1 -1
- package/dist/mcp/tools.d.ts +973 -204
- package/dist/mcp/tools.js +47 -101
- package/dist/mcp/tools.js.map +1 -1
- package/dist/program.js +5 -9
- package/dist/program.js.map +1 -1
- package/dist/storage/index.d.ts +10 -15
- package/dist/storage/index.js +8 -8
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/project-code-index-source.d.ts +2 -0
- package/dist/storage/project-code-index-source.js +23 -0
- package/dist/storage/project-code-index-source.js.map +1 -0
- package/dist/storage/resolution-candidate-service.d.ts +6 -0
- package/dist/storage/resolution-candidate-service.js +94 -0
- package/dist/storage/resolution-candidate-service.js.map +1 -0
- package/dist/storage/resolution-change-transaction.d.ts +11 -0
- package/dist/storage/resolution-change-transaction.js +56 -0
- package/dist/storage/resolution-change-transaction.js.map +1 -0
- package/dist/storage/resolution-home.d.ts +20 -0
- package/dist/storage/resolution-home.js +59 -0
- package/dist/storage/resolution-home.js.map +1 -0
- package/dist/storage/resolution-index-check.d.ts +28 -0
- package/dist/storage/resolution-index-check.js +30 -0
- package/dist/storage/resolution-index-check.js.map +1 -0
- package/dist/storage/resolution-indexer.d.ts +19 -0
- package/dist/storage/resolution-indexer.js +158 -0
- package/dist/storage/resolution-indexer.js.map +1 -0
- package/dist/storage/resolution-migrations.d.ts +3 -0
- package/dist/storage/resolution-migrations.js +39 -0
- package/dist/storage/resolution-migrations.js.map +1 -0
- package/package.json +5 -3
- package/dist/commands/add.d.ts +0 -2
- package/dist/commands/add.js +0 -134
- package/dist/commands/add.js.map +0 -1
- package/dist/commands/migrate.d.ts +0 -2
- package/dist/commands/migrate.js +0 -73
- package/dist/commands/migrate.js.map +0 -1
- package/dist/commands/rule.d.ts +0 -23
- package/dist/commands/rule.js +0 -158
- package/dist/commands/rule.js.map +0 -1
- package/dist/commands/search.d.ts +0 -2
- package/dist/commands/search.js +0 -57
- package/dist/commands/search.js.map +0 -1
- package/dist/core/compatibility-matcher.d.ts +0 -17
- package/dist/core/compatibility-matcher.js +0 -146
- package/dist/core/compatibility-matcher.js.map +0 -1
- package/dist/core/dedup.d.ts +0 -22
- package/dist/core/dedup.js +0 -54
- package/dist/core/dedup.js.map +0 -1
- package/dist/core/error-signature.d.ts +0 -15
- package/dist/core/error-signature.js +0 -59
- package/dist/core/error-signature.js.map +0 -1
- package/dist/core/facets.d.ts +0 -9
- package/dist/core/facets.js +0 -46
- package/dist/core/facets.js.map +0 -1
- package/dist/core/lesson-importer.d.ts +0 -22
- package/dist/core/lesson-importer.js +0 -94
- package/dist/core/lesson-importer.js.map +0 -1
- package/dist/core/ranker.d.ts +0 -3
- package/dist/core/ranker.js +0 -83
- package/dist/core/ranker.js.map +0 -1
- package/dist/core/rule-compatibility.d.ts +0 -66
- package/dist/core/rule-compatibility.js +0 -53
- package/dist/core/rule-compatibility.js.map +0 -1
- package/dist/core/rule-parser.d.ts +0 -25
- package/dist/core/rule-parser.js +0 -81
- package/dist/core/rule-parser.js.map +0 -1
- package/dist/core/rule-schema.d.ts +0 -265
- package/dist/core/rule-schema.js +0 -202
- package/dist/core/rule-schema.js.map +0 -1
- package/dist/core/rule-writer.d.ts +0 -35
- package/dist/core/rule-writer.js +0 -63
- package/dist/core/rule-writer.js.map +0 -1
- package/dist/core/search-types.d.ts +0 -57
- package/dist/core/search-types.js +0 -2
- package/dist/core/search-types.js.map +0 -1
- package/dist/core/semantic-checksum.d.ts +0 -6
- package/dist/core/semantic-checksum.js +0 -34
- package/dist/core/semantic-checksum.js.map +0 -1
- package/dist/core/slug.d.ts +0 -13
- package/dist/core/slug.js +0 -42
- package/dist/core/slug.js.map +0 -1
- package/dist/mcp/lesson-capture.d.ts +0 -30
- package/dist/mcp/lesson-capture.js +0 -144
- package/dist/mcp/lesson-capture.js.map +0 -1
- package/dist/mcp/rules-add-lesson-tool.d.ts +0 -4
- package/dist/mcp/rules-add-lesson-tool.js +0 -73
- package/dist/mcp/rules-add-lesson-tool.js.map +0 -1
- package/dist/mcp/rules-dedup-lesson-tool.d.ts +0 -4
- package/dist/mcp/rules-dedup-lesson-tool.js +0 -69
- package/dist/mcp/rules-dedup-lesson-tool.js.map +0 -1
- package/dist/mcp/rules-list-facets-tool.d.ts +0 -3
- package/dist/mcp/rules-list-facets-tool.js +0 -31
- package/dist/mcp/rules-list-facets-tool.js.map +0 -1
- package/dist/mcp/rules-prepare-lesson-tool.d.ts +0 -4
- package/dist/mcp/rules-prepare-lesson-tool.js +0 -7
- package/dist/mcp/rules-prepare-lesson-tool.js.map +0 -1
- package/dist/mcp/rules-search-error-tool.d.ts +0 -4
- package/dist/mcp/rules-search-error-tool.js +0 -103
- package/dist/mcp/rules-search-error-tool.js.map +0 -1
- package/dist/mcp/rules-search-for-project-tool.d.ts +0 -4
- package/dist/mcp/rules-search-for-project-tool.js +0 -105
- package/dist/mcp/rules-search-for-project-tool.js.map +0 -1
- package/dist/mcp/rules-search-tool.d.ts +0 -7
- package/dist/mcp/rules-search-tool.js +0 -65
- package/dist/mcp/rules-search-tool.js.map +0 -1
- package/dist/migration/adapters/fenced-lessons.d.ts +0 -2
- package/dist/migration/adapters/fenced-lessons.js +0 -55
- package/dist/migration/adapters/fenced-lessons.js.map +0 -1
- package/dist/migration/adapters/global-rules.d.ts +0 -2
- package/dist/migration/adapters/global-rules.js +0 -72
- package/dist/migration/adapters/global-rules.js.map +0 -1
- package/dist/migration/adapters/index.d.ts +0 -2
- package/dist/migration/adapters/index.js +0 -13
- package/dist/migration/adapters/index.js.map +0 -1
- package/dist/migration/adapters/markdown-lessons.d.ts +0 -2
- package/dist/migration/adapters/markdown-lessons.js +0 -36
- package/dist/migration/adapters/markdown-lessons.js.map +0 -1
- package/dist/migration/adapters/structured-lessons.d.ts +0 -2
- package/dist/migration/adapters/structured-lessons.js +0 -8
- package/dist/migration/adapters/structured-lessons.js.map +0 -1
- package/dist/migration/adapters/structured-shared.d.ts +0 -3
- package/dist/migration/adapters/structured-shared.js +0 -97
- package/dist/migration/adapters/structured-shared.js.map +0 -1
- package/dist/migration/applier.d.ts +0 -32
- package/dist/migration/applier.js +0 -559
- package/dist/migration/applier.js.map +0 -1
- package/dist/migration/index.d.ts +0 -11
- package/dist/migration/index.js +0 -7
- package/dist/migration/index.js.map +0 -1
- package/dist/migration/manifest.d.ts +0 -263
- package/dist/migration/manifest.js +0 -91
- package/dist/migration/manifest.js.map +0 -1
- package/dist/migration/migration-report.d.ts +0 -151
- package/dist/migration/migration-report.js +0 -85
- package/dist/migration/migration-report.js.map +0 -1
- package/dist/migration/scanner.d.ts +0 -2
- package/dist/migration/scanner.js +0 -312
- package/dist/migration/scanner.js.map +0 -1
- package/dist/migration/source-adapter.d.ts +0 -37
- package/dist/migration/source-adapter.js +0 -2
- package/dist/migration/source-adapter.js.map +0 -1
- package/dist/migration/verifier.d.ts +0 -5
- package/dist/migration/verifier.js +0 -218
- package/dist/migration/verifier.js.map +0 -1
- package/dist/storage/index-check.d.ts +0 -21
- package/dist/storage/index-check.js +0 -136
- package/dist/storage/index-check.js.map +0 -1
- package/dist/storage/indexer.d.ts +0 -19
- package/dist/storage/indexer.js +0 -367
- package/dist/storage/indexer.js.map +0 -1
- package/dist/storage/migrations.d.ts +0 -3
- package/dist/storage/migrations.js +0 -126
- package/dist/storage/migrations.js.map +0 -1
- package/dist/storage/rule-discovery.d.ts +0 -4
- package/dist/storage/rule-discovery.js +0 -34
- package/dist/storage/rule-discovery.js.map +0 -1
- package/dist/storage/rule-store.d.ts +0 -10
- package/dist/storage/rule-store.js +0 -12
- package/dist/storage/rule-store.js.map +0 -1
- package/dist/storage/rulebook-home.d.ts +0 -21
- package/dist/storage/rulebook-home.js +0 -78
- package/dist/storage/rulebook-home.js.map +0 -1
- package/dist/storage/search-service.d.ts +0 -17
- package/dist/storage/search-service.js +0 -275
- package/dist/storage/search-service.js.map +0 -1
package/dist/mcp/schemas.d.ts
CHANGED
|
@@ -1,222 +1,290 @@
|
|
|
1
1
|
import * as z from 'zod/v4';
|
|
2
2
|
export declare const MCP_DEFAULT_SEARCH_LIMIT = 5;
|
|
3
3
|
export declare const MCP_MAX_SEARCH_LIMIT = 10;
|
|
4
|
-
export declare const
|
|
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
|
-
language: z.ZodOptional<z.ZodEnum<{
|
|
31
|
-
typescript: "typescript";
|
|
32
|
-
swift: "swift";
|
|
33
|
-
kotlin: "kotlin";
|
|
34
|
-
javascript: "javascript";
|
|
35
|
-
python: "python";
|
|
36
|
-
mcp: "mcp";
|
|
37
|
-
other: "other";
|
|
38
|
-
}>>;
|
|
39
|
-
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
|
-
categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
41
|
-
platforms: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4
|
+
export declare const McpResolutionsFindInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
|
+
mode: z.ZodLiteral<"troubleshoot">;
|
|
6
|
+
observations: z.ZodObject<{
|
|
7
|
+
symptoms: z.ZodArray<z.ZodString>;
|
|
8
|
+
error_signatures: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
9
|
+
symbols: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
10
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
|
+
expected: z.ZodString;
|
|
12
|
+
observed: z.ZodString;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
hypotheses: z.ZodOptional<z.ZodObject<{
|
|
15
|
+
suspected_causes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16
|
+
components: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
17
|
+
}, z.core.$strict>>;
|
|
18
|
+
environment: z.ZodObject<{
|
|
19
|
+
languages: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
20
|
+
platforms: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
21
|
+
runtimes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
22
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
attempted_solution_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
+
current_evidence: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
context_fingerprint: z.ZodOptional<z.ZodString>;
|
|
27
|
+
project_key: z.ZodOptional<z.ZodString>;
|
|
28
|
+
satisfied_conditions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
+
rejected_conditions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
42
30
|
}, z.core.$strict>>;
|
|
43
31
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
44
|
-
}, z.core.$strict
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
32
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
33
|
+
mode: z.ZodLiteral<"preventive">;
|
|
34
|
+
goal: z.ZodString;
|
|
35
|
+
operations: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
|
+
environment: z.ZodObject<{
|
|
37
|
+
languages: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
38
|
+
platforms: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
39
|
+
runtimes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
40
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
attempted_solution_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
+
current_evidence: z.ZodOptional<z.ZodObject<{
|
|
44
|
+
context_fingerprint: z.ZodOptional<z.ZodString>;
|
|
45
|
+
project_key: z.ZodOptional<z.ZodString>;
|
|
46
|
+
satisfied_conditions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
47
|
+
rejected_conditions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
|
+
}, z.core.$strict>>;
|
|
53
49
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
}, z.core.$strict>], "mode">;
|
|
51
|
+
export declare const McpResolutionsGetInputSchema: z.ZodObject<{
|
|
52
|
+
solution_handle: z.ZodString;
|
|
54
53
|
}, z.core.$strict>;
|
|
55
|
-
export declare const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
language: z.ZodEnum<{
|
|
59
|
-
typescript: "typescript";
|
|
60
|
-
swift: "swift";
|
|
61
|
-
kotlin: "kotlin";
|
|
62
|
-
javascript: "javascript";
|
|
63
|
-
python: "python";
|
|
64
|
-
mcp: "mcp";
|
|
65
|
-
other: "other";
|
|
66
|
-
}>;
|
|
67
|
-
platforms: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
|
-
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
69
|
-
categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
-
mistake: z.ZodString;
|
|
71
|
-
fix: z.ZodString;
|
|
72
|
-
source_project: z.ZodOptional<z.ZodString>;
|
|
54
|
+
export declare const McpResolutionsGetSourceInputSchema: z.ZodObject<{
|
|
55
|
+
solution_handle: z.ZodString;
|
|
56
|
+
source_handle: z.ZodString;
|
|
73
57
|
}, z.core.$strict>;
|
|
74
|
-
export declare const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
mcp: "mcp";
|
|
84
|
-
other: "other";
|
|
85
|
-
}>;
|
|
86
|
-
platforms: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
87
|
-
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
|
-
categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
89
|
-
mistake: z.ZodString;
|
|
90
|
-
fix: z.ZodString;
|
|
91
|
-
source_project: z.ZodOptional<z.ZodString>;
|
|
92
|
-
rule_scope: z.ZodEnum<{
|
|
93
|
-
shared: "shared";
|
|
94
|
-
project: "project";
|
|
58
|
+
export declare const McpResolutionsListFacetsInputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
59
|
+
export declare const McpResolutionsReportAttemptInputSchema: z.ZodObject<{
|
|
60
|
+
solution_handle: z.ZodString;
|
|
61
|
+
result: z.ZodEnum<{
|
|
62
|
+
solved: "solved";
|
|
63
|
+
failed: "failed";
|
|
64
|
+
inapplicable: "inapplicable";
|
|
65
|
+
inconclusive: "inconclusive";
|
|
66
|
+
regressed: "regressed";
|
|
95
67
|
}>;
|
|
68
|
+
problem_fingerprint: z.ZodString;
|
|
96
69
|
project_key: z.ZodOptional<z.ZodString>;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}>;
|
|
103
|
-
constraints: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
104
|
-
kind: z.ZodEnum<{
|
|
105
|
-
language: "language";
|
|
106
|
-
sdk: "sdk";
|
|
107
|
-
toolchain: "toolchain";
|
|
108
|
-
framework: "framework";
|
|
109
|
-
runtime: "runtime";
|
|
110
|
-
build_tool: "build_tool";
|
|
111
|
-
platform: "platform";
|
|
112
|
-
}>;
|
|
113
|
-
component: z.ZodString;
|
|
114
|
-
range: z.ZodString;
|
|
115
|
-
}, z.core.$strict>>>;
|
|
116
|
-
verified_with: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
117
|
-
component: z.ZodString;
|
|
118
|
-
version: z.ZodString;
|
|
119
|
-
}, z.core.$strict>>>;
|
|
70
|
+
environment: z.ZodObject<{
|
|
71
|
+
languages: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
72
|
+
platforms: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
73
|
+
runtimes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
74
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
120
75
|
}, z.core.$strict>;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
low: "low";
|
|
124
|
-
high: "high";
|
|
125
|
-
}>;
|
|
126
|
-
token_cost: z.ZodEnum<{
|
|
127
|
-
low: "low";
|
|
128
|
-
high: "high";
|
|
129
|
-
}>;
|
|
130
|
-
recurrence_risk: z.ZodEnum<{
|
|
131
|
-
low: "low";
|
|
132
|
-
high: "high";
|
|
133
|
-
}>;
|
|
134
|
-
}, z.core.$strict>;
|
|
135
|
-
verification: z.ZodObject<{
|
|
76
|
+
reason_code: z.ZodOptional<z.ZodString>;
|
|
77
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
136
78
|
kind: z.ZodEnum<{
|
|
137
79
|
focused_test: "focused_test";
|
|
138
80
|
integration_test: "integration_test";
|
|
139
81
|
manual_verification: "manual_verification";
|
|
82
|
+
observation: "observation";
|
|
140
83
|
}>;
|
|
141
|
-
|
|
142
|
-
|
|
84
|
+
handle: z.ZodString;
|
|
85
|
+
summary: z.ZodString;
|
|
86
|
+
}, z.core.$strict>>;
|
|
143
87
|
}, z.core.$strict>;
|
|
144
|
-
export declare const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
88
|
+
export declare const McpResolutionsPrepareChangeInputSchema: z.ZodObject<{
|
|
89
|
+
problem: z.ZodObject<{
|
|
90
|
+
schema_version: z.ZodLiteral<3>;
|
|
91
|
+
kind: z.ZodLiteral<"problem">;
|
|
92
|
+
id: z.ZodString;
|
|
93
|
+
title: z.ZodString;
|
|
94
|
+
observations: z.ZodObject<{
|
|
95
|
+
symptoms: z.ZodArray<z.ZodString>;
|
|
96
|
+
error_signatures: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
97
|
+
symbols: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
98
|
+
operations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
99
|
+
expected: z.ZodString;
|
|
100
|
+
observed: z.ZodString;
|
|
101
|
+
}, z.core.$strict>;
|
|
102
|
+
hypotheses: z.ZodObject<{
|
|
103
|
+
suspected_causes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
104
|
+
components: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
105
|
+
}, z.core.$strict>;
|
|
106
|
+
environment: z.ZodObject<{
|
|
107
|
+
languages: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
108
|
+
platforms: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
109
|
+
runtimes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
110
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
111
|
+
}, z.core.$strict>;
|
|
112
|
+
created_at: z.ZodISODateTime;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
solution: z.ZodObject<{
|
|
115
|
+
schema_version: z.ZodLiteral<3>;
|
|
116
|
+
kind: z.ZodLiteral<"solution">;
|
|
117
|
+
id: z.ZodString;
|
|
118
|
+
problem_id: z.ZodString;
|
|
119
|
+
revision: z.ZodNumber;
|
|
120
|
+
title: z.ZodString;
|
|
121
|
+
cause: z.ZodString;
|
|
122
|
+
applicable_if: z.ZodArray<z.ZodString>;
|
|
123
|
+
reject_if: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
124
|
+
inspections: z.ZodArray<z.ZodString>;
|
|
125
|
+
actions: z.ZodArray<z.ZodString>;
|
|
126
|
+
verification: z.ZodArray<z.ZodString>;
|
|
127
|
+
safety: z.ZodArray<z.ZodString>;
|
|
128
|
+
source_evidence: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
129
|
+
id: z.ZodString;
|
|
130
|
+
project_key: z.ZodString;
|
|
131
|
+
repository_fingerprint: z.ZodString;
|
|
132
|
+
revision: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
133
|
+
kind: z.ZodLiteral<"git_commit">;
|
|
134
|
+
value: z.ZodString;
|
|
135
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
136
|
+
kind: z.ZodLiteral<"working_tree_hash">;
|
|
137
|
+
value: z.ZodString;
|
|
138
|
+
}, z.core.$strict>], "kind">;
|
|
139
|
+
relative_path: z.ZodString;
|
|
140
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
141
|
+
content_hash: z.ZodString;
|
|
142
|
+
tests: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
143
|
+
}, z.core.$strict>>>;
|
|
144
|
+
prior_solution: z.ZodOptional<z.ZodObject<{
|
|
145
|
+
id: z.ZodString;
|
|
146
|
+
revision: z.ZodNumber;
|
|
147
|
+
relation: z.ZodEnum<{
|
|
148
|
+
refines: "refines";
|
|
149
|
+
supersedes: "supersedes";
|
|
150
|
+
}>;
|
|
151
|
+
}, z.core.$strict>>;
|
|
152
|
+
created_at: z.ZodISODateTime;
|
|
153
|
+
}, z.core.$strict>;
|
|
154
|
+
problem_fingerprint: z.ZodString;
|
|
166
155
|
project_key: z.ZodOptional<z.ZodString>;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
constraints: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
156
|
+
target_solution_handle: z.ZodOptional<z.ZodString>;
|
|
157
|
+
verification: z.ZodObject<{
|
|
158
|
+
recurrence_risk: z.ZodLiteral<"high">;
|
|
159
|
+
value: z.ZodLiteral<"high">;
|
|
160
|
+
verified_at: z.ZodISODateTime;
|
|
161
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
174
162
|
kind: z.ZodEnum<{
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
runtime: "runtime";
|
|
180
|
-
build_tool: "build_tool";
|
|
181
|
-
platform: "platform";
|
|
163
|
+
focused_test: "focused_test";
|
|
164
|
+
integration_test: "integration_test";
|
|
165
|
+
manual_verification: "manual_verification";
|
|
166
|
+
observation: "observation";
|
|
182
167
|
}>;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}, z.core.$strict
|
|
186
|
-
verified_with: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
187
|
-
component: z.ZodString;
|
|
188
|
-
version: z.ZodString;
|
|
189
|
-
}, z.core.$strict>>>;
|
|
168
|
+
handle: z.ZodString;
|
|
169
|
+
summary: z.ZodString;
|
|
170
|
+
}, z.core.$strict>>;
|
|
190
171
|
}, z.core.$strict>;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
token_cost: z.ZodEnum<{
|
|
197
|
-
low: "low";
|
|
198
|
-
high: "high";
|
|
199
|
-
}>;
|
|
200
|
-
recurrence_risk: z.ZodEnum<{
|
|
201
|
-
low: "low";
|
|
202
|
-
high: "high";
|
|
203
|
-
}>;
|
|
172
|
+
relation_evidence: z.ZodObject<{
|
|
173
|
+
replacement_verified: z.ZodBoolean;
|
|
174
|
+
conflict: z.ZodArray<z.ZodString>;
|
|
175
|
+
analogous: z.ZodArray<z.ZodString>;
|
|
176
|
+
weak_text_overlap: z.ZodOptional<z.ZodBoolean>;
|
|
204
177
|
}, z.core.$strict>;
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
178
|
+
}, z.core.$strict>;
|
|
179
|
+
export declare const McpResolutionsCommitChangeInputSchema: z.ZodObject<{
|
|
180
|
+
payload: z.ZodObject<{
|
|
181
|
+
problem: z.ZodObject<{
|
|
182
|
+
schema_version: z.ZodLiteral<3>;
|
|
183
|
+
kind: z.ZodLiteral<"problem">;
|
|
184
|
+
id: z.ZodString;
|
|
185
|
+
title: z.ZodString;
|
|
186
|
+
observations: z.ZodObject<{
|
|
187
|
+
symptoms: z.ZodArray<z.ZodString>;
|
|
188
|
+
error_signatures: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
189
|
+
symbols: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
190
|
+
operations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
191
|
+
expected: z.ZodString;
|
|
192
|
+
observed: z.ZodString;
|
|
193
|
+
}, z.core.$strict>;
|
|
194
|
+
hypotheses: z.ZodObject<{
|
|
195
|
+
suspected_causes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
196
|
+
components: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
197
|
+
}, z.core.$strict>;
|
|
198
|
+
environment: z.ZodObject<{
|
|
199
|
+
languages: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
200
|
+
platforms: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
201
|
+
runtimes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
202
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
203
|
+
}, z.core.$strict>;
|
|
204
|
+
created_at: z.ZodISODateTime;
|
|
205
|
+
}, z.core.$strict>;
|
|
206
|
+
solution: z.ZodObject<{
|
|
207
|
+
schema_version: z.ZodLiteral<3>;
|
|
208
|
+
kind: z.ZodLiteral<"solution">;
|
|
209
|
+
id: z.ZodString;
|
|
210
|
+
problem_id: z.ZodString;
|
|
211
|
+
revision: z.ZodNumber;
|
|
212
|
+
title: z.ZodString;
|
|
213
|
+
cause: z.ZodString;
|
|
214
|
+
applicable_if: z.ZodArray<z.ZodString>;
|
|
215
|
+
reject_if: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
216
|
+
inspections: z.ZodArray<z.ZodString>;
|
|
217
|
+
actions: z.ZodArray<z.ZodString>;
|
|
218
|
+
verification: z.ZodArray<z.ZodString>;
|
|
219
|
+
safety: z.ZodArray<z.ZodString>;
|
|
220
|
+
source_evidence: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
221
|
+
id: z.ZodString;
|
|
222
|
+
project_key: z.ZodString;
|
|
223
|
+
repository_fingerprint: z.ZodString;
|
|
224
|
+
revision: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
225
|
+
kind: z.ZodLiteral<"git_commit">;
|
|
226
|
+
value: z.ZodString;
|
|
227
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
228
|
+
kind: z.ZodLiteral<"working_tree_hash">;
|
|
229
|
+
value: z.ZodString;
|
|
230
|
+
}, z.core.$strict>], "kind">;
|
|
231
|
+
relative_path: z.ZodString;
|
|
232
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
233
|
+
content_hash: z.ZodString;
|
|
234
|
+
tests: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
235
|
+
}, z.core.$strict>>>;
|
|
236
|
+
prior_solution: z.ZodOptional<z.ZodObject<{
|
|
237
|
+
id: z.ZodString;
|
|
238
|
+
revision: z.ZodNumber;
|
|
239
|
+
relation: z.ZodEnum<{
|
|
240
|
+
refines: "refines";
|
|
241
|
+
supersedes: "supersedes";
|
|
242
|
+
}>;
|
|
243
|
+
}, z.core.$strict>>;
|
|
244
|
+
created_at: z.ZodISODateTime;
|
|
245
|
+
}, z.core.$strict>;
|
|
246
|
+
problem_fingerprint: z.ZodString;
|
|
247
|
+
project_key: z.ZodOptional<z.ZodString>;
|
|
248
|
+
target_solution_handle: z.ZodOptional<z.ZodString>;
|
|
249
|
+
verification: z.ZodObject<{
|
|
250
|
+
recurrence_risk: z.ZodLiteral<"high">;
|
|
251
|
+
value: z.ZodLiteral<"high">;
|
|
252
|
+
verified_at: z.ZodISODateTime;
|
|
253
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
254
|
+
kind: z.ZodEnum<{
|
|
255
|
+
focused_test: "focused_test";
|
|
256
|
+
integration_test: "integration_test";
|
|
257
|
+
manual_verification: "manual_verification";
|
|
258
|
+
observation: "observation";
|
|
259
|
+
}>;
|
|
260
|
+
handle: z.ZodString;
|
|
261
|
+
summary: z.ZodString;
|
|
262
|
+
}, z.core.$strict>>;
|
|
263
|
+
}, z.core.$strict>;
|
|
264
|
+
relation_evidence: z.ZodObject<{
|
|
265
|
+
replacement_verified: z.ZodBoolean;
|
|
266
|
+
conflict: z.ZodArray<z.ZodString>;
|
|
267
|
+
analogous: z.ZodArray<z.ZodString>;
|
|
268
|
+
weak_text_overlap: z.ZodOptional<z.ZodBoolean>;
|
|
269
|
+
}, z.core.$strict>;
|
|
212
270
|
}, z.core.$strict>;
|
|
213
271
|
payload_hash: z.ZodString;
|
|
272
|
+
state_hash: z.ZodString;
|
|
273
|
+
relation: z.ZodEnum<{
|
|
274
|
+
exact_solution: "exact_solution";
|
|
275
|
+
same_problem_alternative: "same_problem_alternative";
|
|
276
|
+
refines_solution: "refines_solution";
|
|
277
|
+
supersedes_solution: "supersedes_solution";
|
|
278
|
+
contradicts_solution: "contradicts_solution";
|
|
279
|
+
analogous_pattern: "analogous_pattern";
|
|
280
|
+
weak_overlap: "weak_overlap";
|
|
281
|
+
new_problem: "new_problem";
|
|
282
|
+
}>;
|
|
214
283
|
}, z.core.$strict>;
|
|
215
|
-
export
|
|
216
|
-
export type
|
|
217
|
-
export type
|
|
218
|
-
export type
|
|
219
|
-
export type
|
|
220
|
-
export type
|
|
221
|
-
export type
|
|
222
|
-
export type McpDedupLessonInput = z.infer<typeof McpDedupLessonInputSchema>;
|
|
284
|
+
export type McpResolutionsFindInput = z.infer<typeof McpResolutionsFindInputSchema>;
|
|
285
|
+
export type McpResolutionsGetInput = z.infer<typeof McpResolutionsGetInputSchema>;
|
|
286
|
+
export type McpResolutionsGetSourceInput = z.infer<typeof McpResolutionsGetSourceInputSchema>;
|
|
287
|
+
export type McpResolutionsListFacetsInput = z.infer<typeof McpResolutionsListFacetsInputSchema>;
|
|
288
|
+
export type McpResolutionsReportAttemptInput = z.infer<typeof McpResolutionsReportAttemptInputSchema>;
|
|
289
|
+
export type McpResolutionsPrepareChangeInput = z.infer<typeof McpResolutionsPrepareChangeInputSchema>;
|
|
290
|
+
export type McpResolutionsCommitChangeInput = z.infer<typeof McpResolutionsCommitChangeInputSchema>;
|
package/dist/mcp/schemas.js
CHANGED
|
@@ -1,99 +1,34 @@
|
|
|
1
1
|
import * as z from 'zod/v4';
|
|
2
|
+
import { ProblemSchema } from '../core/problem-schema.js';
|
|
3
|
+
import { SolutionSchema } from '../core/solution-schema.js';
|
|
2
4
|
export const MCP_DEFAULT_SEARCH_LIMIT = 5;
|
|
3
5
|
export const MCP_MAX_SEARCH_LIMIT = 10;
|
|
4
|
-
export const McpRuleLanguageSchema = z.enum([
|
|
5
|
-
'swift',
|
|
6
|
-
'kotlin',
|
|
7
|
-
'typescript',
|
|
8
|
-
'javascript',
|
|
9
|
-
'python',
|
|
10
|
-
'mcp',
|
|
11
|
-
'other',
|
|
12
|
-
]);
|
|
13
|
-
export const McpSearchFiltersSchema = z
|
|
14
|
-
.object({
|
|
15
|
-
language: McpRuleLanguageSchema.optional(),
|
|
16
|
-
tools: z.array(z.string().min(1)).optional(),
|
|
17
|
-
categories: z.array(z.string().min(1)).optional(),
|
|
18
|
-
platforms: z.array(z.string().min(1)).optional(),
|
|
19
|
-
})
|
|
20
|
-
.strict();
|
|
21
6
|
const McpLimitSchema = z.number().int().min(1).max(MCP_MAX_SEARCH_LIMIT).optional();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
.strict()
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
.
|
|
36
|
-
|
|
37
|
-
.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
})
|
|
42
|
-
.strict();
|
|
43
|
-
const McpLessonBaseInputSchema = z
|
|
44
|
-
.object({
|
|
45
|
-
title: z.string().trim().min(1),
|
|
46
|
-
summary: z.string().trim().min(1).optional(),
|
|
47
|
-
language: McpRuleLanguageSchema,
|
|
48
|
-
platforms: z.array(z.string().min(1)).optional(),
|
|
49
|
-
tools: z.array(z.string().min(1)).optional(),
|
|
50
|
-
categories: z.array(z.string().min(1)).optional(),
|
|
51
|
-
mistake: z.string().trim().min(1),
|
|
52
|
-
fix: z.string().trim().min(1),
|
|
53
|
-
source_project: z.string().trim().min(1).optional(),
|
|
54
|
-
})
|
|
55
|
-
.strict();
|
|
56
|
-
export const McpDedupLessonInputSchema = McpLessonBaseInputSchema;
|
|
57
|
-
const McpCaptureCriteriaSchema = z.object({
|
|
58
|
-
debugging_cost: z.enum(['low', 'high']),
|
|
59
|
-
token_cost: z.enum(['low', 'high']),
|
|
60
|
-
recurrence_risk: z.enum(['low', 'high']),
|
|
61
|
-
}).strict();
|
|
62
|
-
const McpVerificationSchema = z.object({
|
|
63
|
-
kind: z.enum(['focused_test', 'integration_test', 'manual_verification']),
|
|
64
|
-
evidence: z.string().trim().min(1),
|
|
65
|
-
}).strict();
|
|
66
|
-
const McpCompatibilitySchema = z.object({
|
|
67
|
-
scope: z.enum(['version_agnostic', 'constrained', 'unknown']),
|
|
68
|
-
constraints: z.array(z.object({
|
|
69
|
-
kind: z.enum(['language', 'sdk', 'toolchain', 'framework', 'runtime', 'build_tool', 'platform']),
|
|
70
|
-
component: z.string().trim().min(1),
|
|
71
|
-
range: z.string().trim().min(1),
|
|
72
|
-
}).strict()).default([]),
|
|
73
|
-
verified_with: z.array(z.object({
|
|
74
|
-
component: z.string().trim().min(1),
|
|
75
|
-
version: z.string().trim().min(1),
|
|
76
|
-
}).strict()).default([]),
|
|
77
|
-
}).strict();
|
|
78
|
-
export const McpPrepareLessonInputSchema = McpLessonBaseInputSchema.extend({
|
|
79
|
-
rule_scope: z.enum(['shared', 'project']),
|
|
80
|
-
project_key: z.string().trim().regex(/^[a-z0-9][a-z0-9._-]*$/).optional(),
|
|
81
|
-
compatibility: McpCompatibilitySchema,
|
|
82
|
-
criteria: McpCaptureCriteriaSchema,
|
|
83
|
-
verification: McpVerificationSchema,
|
|
84
|
-
}).strict().superRefine((input, context) => {
|
|
85
|
-
if (input.rule_scope === 'project' && input.project_key === undefined) {
|
|
86
|
-
context.addIssue({ code: 'custom', path: ['project_key'], message: 'Project scope requires project_key' });
|
|
87
|
-
}
|
|
88
|
-
if (input.rule_scope === 'shared' && input.project_key !== undefined) {
|
|
89
|
-
context.addIssue({ code: 'custom', path: ['project_key'], message: 'Shared scope cannot include project_key' });
|
|
90
|
-
}
|
|
91
|
-
if (input.compatibility.scope === 'constrained' && input.compatibility.constraints.length === 0) {
|
|
92
|
-
context.addIssue({ code: 'custom', path: ['compatibility', 'constraints'], message: 'Constrained compatibility requires constraints' });
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
export const McpAddLessonInputSchema = McpPrepareLessonInputSchema.safeExtend({
|
|
96
|
-
payload_hash: z.string().regex(/^sha256:[a-f0-9]{64}$/),
|
|
7
|
+
const McpResolutionEnvironmentSchema = z.object({ languages: z.array(z.string().trim().min(1)).default([]), platforms: z.array(z.string().trim().min(1)).default([]), runtimes: z.array(z.string().trim().min(1)).default([]), tools: z.array(z.string().trim().min(1)).default([]) }).strict();
|
|
8
|
+
const McpResolutionObservationsSchema = z.object({ symptoms: z.array(z.string().trim().min(1)).min(1), error_signatures: z.array(z.string().trim().min(1)).optional(), symbols: z.array(z.string().trim().min(1)).optional(), operations: z.array(z.string().trim().min(1)).optional(), expected: z.string().trim().min(1), observed: z.string().trim().min(1) }).strict();
|
|
9
|
+
const McpResolutionHypothesesSchema = z.object({ suspected_causes: z.array(z.string().trim().min(1)).optional(), components: z.array(z.string().trim().min(1)).optional() }).strict();
|
|
10
|
+
const McpCurrentEvidenceSchema = z.object({ context_fingerprint: z.string().regex(/^sha256:[a-f0-9]{64}$/).optional(), project_key: z.string().trim().regex(/^[a-z0-9][a-z0-9._-]*$/).optional(), satisfied_conditions: z.array(z.string().trim().min(1)).optional(), rejected_conditions: z.array(z.string().trim().min(1)).optional() }).strict();
|
|
11
|
+
const McpOutcomeEvidenceSchema = z.object({ kind: z.enum(['focused_test', 'integration_test', 'manual_verification', 'observation']), handle: z.string().trim().min(1), summary: z.string().trim().min(1) }).strict();
|
|
12
|
+
export const McpResolutionsFindInputSchema = z.discriminatedUnion('mode', [
|
|
13
|
+
z.object({ mode: z.literal('troubleshoot'), observations: McpResolutionObservationsSchema, hypotheses: McpResolutionHypothesesSchema.optional(), environment: McpResolutionEnvironmentSchema, attempted_solution_ids: z.array(z.string().trim().min(1)).optional(), current_evidence: McpCurrentEvidenceSchema.optional(), limit: McpLimitSchema }).strict(),
|
|
14
|
+
z.object({ mode: z.literal('preventive'), goal: z.string().trim().min(1), operations: z.array(z.string().trim().min(1)).optional(), environment: McpResolutionEnvironmentSchema, attempted_solution_ids: z.array(z.string().trim().min(1)).optional(), current_evidence: McpCurrentEvidenceSchema.optional(), limit: McpLimitSchema }).strict(),
|
|
15
|
+
]);
|
|
16
|
+
export const McpResolutionsGetInputSchema = z.object({ solution_handle: z.string().regex(/^solution-[a-z0-9][a-z0-9-]*@[1-9][0-9]*$/) }).strict();
|
|
17
|
+
export const McpResolutionsGetSourceInputSchema = z.object({ solution_handle: z.string().regex(/^solution-[a-z0-9][a-z0-9-]*@[1-9][0-9]*$/), source_handle: z.string().regex(/^source-[a-z0-9][a-z0-9-]*$/) }).strict();
|
|
18
|
+
export const McpResolutionsListFacetsInputSchema = z.object({}).strict();
|
|
19
|
+
export const McpResolutionsReportAttemptInputSchema = z.object({ solution_handle: z.string().regex(/^solution-[a-z0-9][a-z0-9-]*@[1-9][0-9]*$/), result: z.enum(['solved', 'failed', 'inapplicable', 'inconclusive', 'regressed']), problem_fingerprint: z.string().regex(/^sha256:[a-f0-9]{64}$/), project_key: z.string().trim().regex(/^[a-z0-9][a-z0-9._-]*$/).optional(), environment: McpResolutionEnvironmentSchema, reason_code: z.string().trim().min(1).optional(), evidence: z.array(McpOutcomeEvidenceSchema) }).strict().superRefine((attempt, context) => {
|
|
20
|
+
if ((attempt.result === 'solved' || attempt.result === 'regressed') && attempt.evidence.length === 0)
|
|
21
|
+
context.addIssue({ code: 'custom', path: ['evidence'], message: `${attempt.result} requires verification evidence` });
|
|
22
|
+
if ((attempt.result === 'failed' || attempt.result === 'inapplicable') && attempt.reason_code === undefined)
|
|
23
|
+
context.addIssue({ code: 'custom', path: ['reason_code'], message: `${attempt.result} requires a reason code` });
|
|
24
|
+
if ((attempt.result === 'failed' || attempt.result === 'inapplicable') && attempt.evidence.length === 0)
|
|
25
|
+
context.addIssue({ code: 'custom', path: ['evidence'], message: `${attempt.result} requires observed evidence` });
|
|
97
26
|
});
|
|
98
|
-
|
|
27
|
+
const McpResolutionChangePayloadSchema = z.object({
|
|
28
|
+
problem: ProblemSchema, solution: SolutionSchema, problem_fingerprint: z.string().regex(/^sha256:[a-f0-9]{64}$/), project_key: z.string().trim().regex(/^[a-z0-9][a-z0-9._-]*$/).optional(), target_solution_handle: z.string().regex(/^solution-[a-z0-9][a-z0-9-]*@[1-9][0-9]*$/).optional(),
|
|
29
|
+
verification: z.object({ recurrence_risk: z.literal('high'), value: z.literal('high'), verified_at: z.iso.datetime(), evidence: z.array(McpOutcomeEvidenceSchema).min(1) }).strict(),
|
|
30
|
+
relation_evidence: z.object({ replacement_verified: z.boolean(), conflict: z.array(z.string().trim().min(1)), analogous: z.array(z.string().trim().min(1)), weak_text_overlap: z.boolean().optional() }).strict(),
|
|
31
|
+
}).strict();
|
|
32
|
+
export const McpResolutionsPrepareChangeInputSchema = McpResolutionChangePayloadSchema;
|
|
33
|
+
export const McpResolutionsCommitChangeInputSchema = z.object({ payload: McpResolutionChangePayloadSchema, payload_hash: z.string().regex(/^sha256:[a-f0-9]{64}$/), state_hash: z.string().regex(/^sha256:[a-f0-9]{64}$/), relation: z.enum(['exact_solution', 'same_problem_alternative', 'refines_solution', 'supersedes_solution', 'contradicts_solution', 'analogous_pattern', 'weak_overlap', 'new_problem']) }).strict();
|
|
99
34
|
//# sourceMappingURL=schemas.js.map
|