traits 0.5.1 → 0.5.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/Source.ts +1 -1
- package/Trait.ts +109 -4
- package/TraitConflict.ts +43 -4
- package/TraitDerivation.ts +104 -32
- package/TraitEvaluation.ts +104 -49
- package/TraitStore.ts +128 -44
- package/TraitsConfig.ts +16 -9
- package/TraitsContext.ts +3 -1
- package/_util/Frontmatter.ts +78 -0
- package/_util/Git.ts +6 -5
- package/bin.ts +3 -1
- package/dist/Source.js +1 -1
- package/dist/Source.js.map +1 -1
- package/dist/Trait.d.ts +39 -5
- package/dist/Trait.d.ts.map +1 -1
- package/dist/Trait.js +66 -3
- package/dist/Trait.js.map +1 -1
- package/dist/TraitConflict.d.ts +47 -15
- package/dist/TraitConflict.d.ts.map +1 -1
- package/dist/TraitConflict.js +38 -4
- package/dist/TraitConflict.js.map +1 -1
- package/dist/TraitDerivation.d.ts +85 -28
- package/dist/TraitDerivation.d.ts.map +1 -1
- package/dist/TraitDerivation.js +85 -23
- package/dist/TraitDerivation.js.map +1 -1
- package/dist/TraitEvaluation.d.ts +38 -8
- package/dist/TraitEvaluation.d.ts.map +1 -1
- package/dist/TraitEvaluation.js +84 -47
- package/dist/TraitEvaluation.js.map +1 -1
- package/dist/TraitStore.d.ts +60 -10
- package/dist/TraitStore.d.ts.map +1 -1
- package/dist/TraitStore.js +57 -37
- package/dist/TraitStore.js.map +1 -1
- package/dist/TraitsConfig.d.ts +4 -3
- package/dist/TraitsConfig.d.ts.map +1 -1
- package/dist/TraitsConfig.js +12 -5
- package/dist/TraitsConfig.js.map +1 -1
- package/dist/TraitsContext.d.ts +2 -1
- package/dist/TraitsContext.d.ts.map +1 -1
- package/dist/TraitsContext.js.map +1 -1
- package/dist/_util/Frontmatter.d.ts +37 -0
- package/dist/_util/Frontmatter.d.ts.map +1 -0
- package/dist/_util/Frontmatter.js +52 -0
- package/dist/_util/Frontmatter.js.map +1 -0
- package/dist/_util/Git.d.ts +2 -3
- package/dist/_util/Git.d.ts.map +1 -1
- package/dist/_util/Git.js +4 -1
- package/dist/_util/Git.js.map +1 -1
- package/dist/bin.js +3 -1
- package/dist/bin.js.map +1 -1
- package/dist/getIncludedFiles.d.ts +13 -0
- package/dist/getIncludedFiles.d.ts.map +1 -0
- package/dist/getIncludedFiles.js +26 -0
- package/dist/getIncludedFiles.js.map +1 -0
- package/dist/main.js +14 -11
- package/dist/main.js.map +1 -1
- package/dist/package.json +7 -2
- package/dist/test/Frontmatter.test.d.ts +2 -0
- package/dist/test/Frontmatter.test.d.ts.map +1 -0
- package/dist/test/Frontmatter.test.js +29 -0
- package/dist/test/Frontmatter.test.js.map +1 -0
- package/dist/test/Trait.test.d.ts +2 -0
- package/dist/test/Trait.test.d.ts.map +1 -0
- package/dist/test/Trait.test.js +144 -0
- package/dist/test/Trait.test.js.map +1 -0
- package/dist/test/TraitDerivation.test.d.ts +2 -0
- package/dist/test/TraitDerivation.test.d.ts.map +1 -0
- package/dist/test/TraitDerivation.test.js +173 -0
- package/dist/test/TraitDerivation.test.js.map +1 -0
- package/dist/test/TraitEvaluation.test.d.ts +2 -0
- package/dist/test/TraitEvaluation.test.d.ts.map +1 -0
- package/dist/test/TraitEvaluation.test.js +116 -0
- package/dist/test/TraitEvaluation.test.js.map +1 -0
- package/dist/test/TraitIgnores.test.js +29 -5
- package/dist/test/TraitIgnores.test.js.map +1 -1
- package/dist/test/TraitStore.test.d.ts +2 -0
- package/dist/test/TraitStore.test.d.ts.map +1 -0
- package/dist/test/TraitStore.test.js +94 -0
- package/dist/test/TraitStore.test.js.map +1 -0
- package/dist/toolkit/CheckTraits.d.ts +121 -13
- package/dist/toolkit/CheckTraits.d.ts.map +1 -1
- package/dist/toolkit/CheckTraits.js +28 -40
- package/dist/toolkit/CheckTraits.js.map +1 -1
- package/dist/toolkit/DeriveTrait.d.ts +161 -45
- package/dist/toolkit/DeriveTrait.d.ts.map +1 -1
- package/dist/toolkit/DeriveTrait.js +26 -14
- package/dist/toolkit/DeriveTrait.js.map +1 -1
- package/dist/traitIgnores.d.ts +18 -0
- package/dist/traitIgnores.d.ts.map +1 -1
- package/dist/traitIgnores.js +10 -7
- package/dist/traitIgnores.js.map +1 -1
- package/getIncludedFiles.ts +42 -0
- package/main.ts +14 -11
- package/package.json +7 -2
- package/skills/traits/SKILL.md +92 -46
- package/toolkit/CheckTraits.ts +34 -55
- package/toolkit/DeriveTrait.ts +27 -14
- package/traitIgnores.ts +14 -6
- package/_util/words.ts +0 -555
- package/dist/_util/words.d.ts +0 -2
- package/dist/_util/words.d.ts.map +0 -1
- package/dist/_util/words.js +0 -556
- package/dist/_util/words.js.map +0 -1
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { FileSystem, Path, Schema as S } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import { DecisionModel, Tool, Toolkit } from "effect/ai";
|
|
3
3
|
import { ChildProcessSpawner } from "effect/process";
|
|
4
4
|
import { TraitsContext } from "../TraitsContext.ts";
|
|
5
5
|
import { TraitStore } from "../TraitStore.ts";
|
|
6
6
|
export declare const CheckTraits: Tool.Tool<"check_traits", {
|
|
7
7
|
readonly parameters: S.Struct<{
|
|
8
8
|
readonly include: S.$Array<S.String>;
|
|
9
|
-
readonly
|
|
9
|
+
readonly traitNames: S.optional<S.$Array<S.brand<S.String, "traits/TraitName">>>;
|
|
10
10
|
}>;
|
|
11
11
|
readonly success: S.$Array<S.Struct<{
|
|
12
|
-
readonly trait: S.Struct<{
|
|
13
|
-
readonly id: S.brand<S.String, "traits/Trait">;
|
|
12
|
+
readonly trait: S.StructWithRest<S.Struct<{
|
|
14
13
|
readonly body: S.String;
|
|
15
|
-
|
|
14
|
+
readonly diff: S.optional<S.String>;
|
|
15
|
+
readonly mime: S.optional<S.Union<readonly [S.String, S.$Array<S.String>]>>;
|
|
16
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
17
|
+
readonly skip: S.optional<S.String>;
|
|
18
|
+
readonly when: S.optional<S.String>;
|
|
19
|
+
}>, readonly [S.$Record<S.String, S.Codec<S.Json, S.Json, never, never>>]>;
|
|
16
20
|
readonly source: S.Struct<{
|
|
17
21
|
readonly text: S.String;
|
|
18
22
|
readonly location: S.optional<S.TaggedUnion<{
|
|
@@ -33,22 +37,76 @@ export declare const CheckTraits: Tool.Tool<"check_traits", {
|
|
|
33
37
|
}>;
|
|
34
38
|
}>;
|
|
35
39
|
}>>;
|
|
36
|
-
readonly failure: S.Union<readonly [
|
|
40
|
+
readonly failure: S.Union<readonly [S.TaggedStruct<"AiError", {
|
|
41
|
+
readonly message: S.String;
|
|
42
|
+
}>, S.Union<readonly [S.Struct<{
|
|
43
|
+
readonly _tag: S.tag<"TraitNotFoundError">;
|
|
44
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
45
|
+
readonly message: S.String;
|
|
46
|
+
}>, S.Struct<{
|
|
47
|
+
readonly _tag: S.tag<"TraitAlreadyExistsError">;
|
|
48
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
49
|
+
readonly message: S.String;
|
|
50
|
+
}>, S.Struct<{
|
|
51
|
+
readonly _tag: S.tag<"TraitFilenameMismatchError">;
|
|
52
|
+
readonly path: S.String;
|
|
53
|
+
readonly expectedFilename: S.String;
|
|
54
|
+
readonly message: S.String;
|
|
55
|
+
}>, S.Struct<{
|
|
56
|
+
readonly _tag: S.tag<"MissingFrontmatterError">;
|
|
57
|
+
readonly path: S.String;
|
|
58
|
+
readonly message: S.String;
|
|
59
|
+
}>, S.Struct<{
|
|
60
|
+
readonly _tag: S.tag<"UnterminatedFrontmatterError">;
|
|
61
|
+
readonly path: S.String;
|
|
62
|
+
readonly message: S.String;
|
|
63
|
+
}>, S.Struct<{
|
|
64
|
+
readonly _tag: S.tag<"InvalidYamlError">;
|
|
65
|
+
readonly path: S.String;
|
|
66
|
+
readonly line: S.optional<S.Int>;
|
|
67
|
+
readonly column: S.optional<S.Int>;
|
|
68
|
+
readonly cause: S.Defect;
|
|
69
|
+
readonly message: S.String;
|
|
70
|
+
}>, S.TaggedStruct<"PlatformError", {
|
|
71
|
+
readonly message: S.String;
|
|
72
|
+
}>, S.TaggedStruct<"SchemaError", {
|
|
73
|
+
readonly message: S.String;
|
|
74
|
+
}>]>, S.Struct<{
|
|
75
|
+
readonly _tag: S.tag<"TraitAssessmentTooLargeError">;
|
|
76
|
+
readonly traitName: S.brand<S.String, "traits/TraitName">;
|
|
77
|
+
readonly bytes: S.Int;
|
|
78
|
+
readonly maxBytes: S.Int;
|
|
79
|
+
readonly location: S.optional<S.TaggedUnion<{
|
|
80
|
+
readonly File: S.TaggedStruct<"File", {
|
|
81
|
+
readonly path: S.String;
|
|
82
|
+
readonly startLine: S.Int;
|
|
83
|
+
}>;
|
|
84
|
+
readonly Generated: S.TaggedStruct<"Generated", {}>;
|
|
85
|
+
}>>;
|
|
86
|
+
readonly message: S.String;
|
|
87
|
+
}>, S.Struct<{
|
|
88
|
+
readonly _tag: S.tag<"GitFileListingError">;
|
|
89
|
+
readonly directory: S.String;
|
|
90
|
+
readonly exitCode: S.Int;
|
|
37
91
|
readonly message: S.String;
|
|
38
92
|
}>]>;
|
|
39
|
-
readonly failureMode: "
|
|
93
|
+
readonly failureMode: "return";
|
|
40
94
|
}, ChildProcessSpawner.ChildProcessSpawner | DecisionModel.DecisionModel | FileSystem.FileSystem | Path.Path | TraitStore | TraitsContext>;
|
|
41
95
|
export declare const toolkit: Toolkit.Toolkit<{
|
|
42
96
|
readonly check_traits: Tool.Tool<"check_traits", {
|
|
43
97
|
readonly parameters: S.Struct<{
|
|
44
98
|
readonly include: S.$Array<S.String>;
|
|
45
|
-
readonly
|
|
99
|
+
readonly traitNames: S.optional<S.$Array<S.brand<S.String, "traits/TraitName">>>;
|
|
46
100
|
}>;
|
|
47
101
|
readonly success: S.$Array<S.Struct<{
|
|
48
|
-
readonly trait: S.Struct<{
|
|
49
|
-
readonly id: S.brand<S.String, "traits/Trait">;
|
|
102
|
+
readonly trait: S.StructWithRest<S.Struct<{
|
|
50
103
|
readonly body: S.String;
|
|
51
|
-
|
|
104
|
+
readonly diff: S.optional<S.String>;
|
|
105
|
+
readonly mime: S.optional<S.Union<readonly [S.String, S.$Array<S.String>]>>;
|
|
106
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
107
|
+
readonly skip: S.optional<S.String>;
|
|
108
|
+
readonly when: S.optional<S.String>;
|
|
109
|
+
}>, readonly [S.$Record<S.String, S.Codec<S.Json, S.Json, never, never>>]>;
|
|
52
110
|
readonly source: S.Struct<{
|
|
53
111
|
readonly text: S.String;
|
|
54
112
|
readonly location: S.optional<S.TaggedUnion<{
|
|
@@ -69,10 +127,60 @@ export declare const toolkit: Toolkit.Toolkit<{
|
|
|
69
127
|
}>;
|
|
70
128
|
}>;
|
|
71
129
|
}>>;
|
|
72
|
-
readonly failure: S.Union<readonly [
|
|
130
|
+
readonly failure: S.Union<readonly [S.TaggedStruct<"AiError", {
|
|
131
|
+
readonly message: S.String;
|
|
132
|
+
}>, S.Union<readonly [S.Struct<{
|
|
133
|
+
readonly _tag: S.tag<"TraitNotFoundError">;
|
|
134
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
135
|
+
readonly message: S.String;
|
|
136
|
+
}>, S.Struct<{
|
|
137
|
+
readonly _tag: S.tag<"TraitAlreadyExistsError">;
|
|
138
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
139
|
+
readonly message: S.String;
|
|
140
|
+
}>, S.Struct<{
|
|
141
|
+
readonly _tag: S.tag<"TraitFilenameMismatchError">;
|
|
142
|
+
readonly path: S.String;
|
|
143
|
+
readonly expectedFilename: S.String;
|
|
144
|
+
readonly message: S.String;
|
|
145
|
+
}>, S.Struct<{
|
|
146
|
+
readonly _tag: S.tag<"MissingFrontmatterError">;
|
|
147
|
+
readonly path: S.String;
|
|
148
|
+
readonly message: S.String;
|
|
149
|
+
}>, S.Struct<{
|
|
150
|
+
readonly _tag: S.tag<"UnterminatedFrontmatterError">;
|
|
151
|
+
readonly path: S.String;
|
|
152
|
+
readonly message: S.String;
|
|
153
|
+
}>, S.Struct<{
|
|
154
|
+
readonly _tag: S.tag<"InvalidYamlError">;
|
|
155
|
+
readonly path: S.String;
|
|
156
|
+
readonly line: S.optional<S.Int>;
|
|
157
|
+
readonly column: S.optional<S.Int>;
|
|
158
|
+
readonly cause: S.Defect;
|
|
159
|
+
readonly message: S.String;
|
|
160
|
+
}>, S.TaggedStruct<"PlatformError", {
|
|
161
|
+
readonly message: S.String;
|
|
162
|
+
}>, S.TaggedStruct<"SchemaError", {
|
|
163
|
+
readonly message: S.String;
|
|
164
|
+
}>]>, S.Struct<{
|
|
165
|
+
readonly _tag: S.tag<"TraitAssessmentTooLargeError">;
|
|
166
|
+
readonly traitName: S.brand<S.String, "traits/TraitName">;
|
|
167
|
+
readonly bytes: S.Int;
|
|
168
|
+
readonly maxBytes: S.Int;
|
|
169
|
+
readonly location: S.optional<S.TaggedUnion<{
|
|
170
|
+
readonly File: S.TaggedStruct<"File", {
|
|
171
|
+
readonly path: S.String;
|
|
172
|
+
readonly startLine: S.Int;
|
|
173
|
+
}>;
|
|
174
|
+
readonly Generated: S.TaggedStruct<"Generated", {}>;
|
|
175
|
+
}>>;
|
|
176
|
+
readonly message: S.String;
|
|
177
|
+
}>, S.Struct<{
|
|
178
|
+
readonly _tag: S.tag<"GitFileListingError">;
|
|
179
|
+
readonly directory: S.String;
|
|
180
|
+
readonly exitCode: S.Int;
|
|
73
181
|
readonly message: S.String;
|
|
74
182
|
}>]>;
|
|
75
|
-
readonly failureMode: "
|
|
183
|
+
readonly failureMode: "return";
|
|
76
184
|
}, ChildProcessSpawner.ChildProcessSpawner | DecisionModel.DecisionModel | FileSystem.FileSystem | Path.Path | TraitStore | TraitsContext>;
|
|
77
185
|
}>;
|
|
78
186
|
export declare const layer: import("effect/Layer").Layer<Tool.Handler<"check_traits">, never, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckTraits.d.ts","sourceRoot":"","sources":["../../toolkit/CheckTraits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,UAAU,
|
|
1
|
+
{"version":3,"file":"CheckTraits.d.ts","sourceRoot":"","sources":["../../toolkit/CheckTraits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,UAAU,EAAQ,IAAI,EAAQ,MAAM,IAAI,CAAC,EAAU,MAAM,QAAQ,CAAA;AACzF,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAOpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAmB,MAAM,kBAAkB,CAAA;AAE9D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0IA2DY,CAAA;AAEpC,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA4B,CAAA;AAEhD,eAAO,MAAM,KAAK,0EAyDhB,CAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Array, Effect, FileSystem, Path, pipe,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Array, Effect, FileSystem, flow, Path, pipe, Schema as S, String } from "effect";
|
|
2
|
+
import { DecisionModel, Tool, Toolkit } from "effect/ai";
|
|
3
|
+
import { ChildProcessSpawner } from "effect/process";
|
|
4
|
+
import { getIncludedFiles, GitFileListingError } from "../getIncludedFiles.js";
|
|
4
5
|
import { Source, SourceLocation } from "../Source.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
6
|
+
import * as Trait from "../Trait.js";
|
|
7
|
+
import * as Evaluation from "../TraitEvaluation.js";
|
|
8
|
+
import { excludeIgnored } from "../traitIgnores.js";
|
|
8
9
|
import { TraitsContext } from "../TraitsContext.js";
|
|
9
10
|
import { TraitStore, TraitStoreError } from "../TraitStore.js";
|
|
10
11
|
export const CheckTraits = Tool.make("check_traits", {
|
|
@@ -20,8 +21,8 @@ export const CheckTraits = Tool.make("check_traits", {
|
|
|
20
21
|
| Git-ignored files are excluded by default, with ignore rules refreshed on every call. Untracked files do not need to be added to Git to be evaluated. Tracked files remain eligible even if ignore rules match them. Set excludeGitignored: false in traits.ts to disable this filter; explicit excludes still apply. Git failures fail the check.
|
|
21
22
|
| All entries follow native glob syntax, including escaping filenames with glob characters. No custom directory expansion or literal-path classification is applied.
|
|
22
23
|
| Reads current full file contents, including unstaged edits, and checks each 200-line chunk against the selected traits in parallel.
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
| Omit traitNames to check all stored traits; supply unique trait names for a focused check. Unknown names fail the call.
|
|
25
|
+
| A leading // traits-ignore-file <trait-name>: <reason> comment skips that trait for the entire file, including focused checks. Names are case-sensitive and must be updated after renaming. Directives require a reason and must precede code.
|
|
25
26
|
| Returns findings with the trait, source text, absolute path, 1-based chunk startLine, and assessment classification and probabilities.
|
|
26
27
|
| Classification distinguishes violation from inconclusive; probabilities are not calibrated guarantees. No exact offending lines are provided.
|
|
27
28
|
| Diagnose uncertainty using the full distribution, not the selected label alone; inspect source and trait before changing code.
|
|
@@ -35,18 +36,24 @@ export const CheckTraits = Tool.make("check_traits", {
|
|
|
35
36
|
| Ask for clarification when a fix changes behavior or exceeds authorized scope.
|
|
36
37
|
| The tool diagnoses only; the calling agent is responsible for edits, verification, and reporting unresolved blockers.
|
|
37
38
|
| Unmatched patterns select no files. An empty result means no failures for this selection, not a repository-wide guarantee.
|
|
38
|
-
| Empty include/
|
|
39
|
+
| Empty include/traitNames lists, no matched files, or an empty store check no pairs.
|
|
39
40
|
`),
|
|
40
41
|
parameters: S.Struct({
|
|
41
42
|
include: S.Array(S.String).annotate({
|
|
42
43
|
description: "Project-owned source, configuration, or documentation paths/globs, absolute or relative to the MCP working directory. Exclude third-party/generated files, secrets, and binaries. Overlapping matches are deduplicated; unmatched patterns select no files."
|
|
43
44
|
}),
|
|
44
|
-
|
|
45
|
-
description: "Optional trait
|
|
45
|
+
traitNames: S.Array(Trait.TraitName).pipe(S.optional).annotate({
|
|
46
|
+
description: "Optional unique trait names for a focused review. Omit for all stored traits; an empty array selects none."
|
|
46
47
|
})
|
|
47
48
|
}),
|
|
48
|
-
success: S.Array(TraitEvaluation),
|
|
49
|
-
failure: S.Union([
|
|
49
|
+
success: S.Array(Evaluation.TraitEvaluation),
|
|
50
|
+
failure: S.Union([
|
|
51
|
+
S.TaggedStruct("AiError", { message: S.String }),
|
|
52
|
+
TraitStoreError,
|
|
53
|
+
S.Struct({ ...Evaluation.TraitAssessmentTooLargeError.fields, message: S.String }),
|
|
54
|
+
S.Struct({ ...GitFileListingError.fields, message: S.String })
|
|
55
|
+
]),
|
|
56
|
+
failureMode: "return",
|
|
50
57
|
dependencies: [
|
|
51
58
|
DecisionModel.DecisionModel,
|
|
52
59
|
TraitStore,
|
|
@@ -67,26 +74,10 @@ export const layer = toolkit.toLayer({
|
|
|
67
74
|
const fs = yield* FileSystem.FileSystem;
|
|
68
75
|
const path = yield* Path.Path;
|
|
69
76
|
const cwd = path.resolve();
|
|
70
|
-
const includedFiles =
|
|
71
|
-
|
|
72
|
-
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
73
|
-
const process = yield* spawner.spawn(ChildProcess.make `git ls-files --cached --others --exclude-standard --full-name -z`.pipe(ChildProcess.setCwd(context.configRoot)));
|
|
74
|
-
const output = yield* process.stdout.pipe(Stream.decodeText(), Stream.mkString);
|
|
75
|
-
const exitCode = yield* process.exitCode;
|
|
76
|
-
if (exitCode !== 0) {
|
|
77
|
-
return yield* PlatformError.systemError({
|
|
78
|
-
_tag: "Unknown",
|
|
79
|
-
module: "ChildProcess",
|
|
80
|
-
method: "git ls-files",
|
|
81
|
-
description: `Process exited with code ${exitCode}`
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
return new Set(pipe(output, String.split("\0"), Array.filter(String.isNonEmpty), Array.map((file) => path.resolve(context.configRoot, file))));
|
|
85
|
-
}))
|
|
86
|
-
: undefined;
|
|
87
|
-
const traits = yield* params.traitIds === undefined
|
|
77
|
+
const includedFiles = yield* getIncludedFiles;
|
|
78
|
+
const traits = yield* params.traitNames === undefined
|
|
88
79
|
? store.ls
|
|
89
|
-
: Effect.forEach(Array.dedupe(params.
|
|
80
|
+
: Effect.forEach(Array.dedupe(params.traitNames), store.get, { concurrency: "unbounded" });
|
|
90
81
|
const matches = yield* Effect.forEach(params.include, (pattern) => {
|
|
91
82
|
const absolute = path.isAbsolute(pattern) ? pattern : `${cwd}${path.sep}${pattern}`;
|
|
92
83
|
return fs.glob(absolute, {
|
|
@@ -95,20 +86,17 @@ export const layer = toolkit.toLayer({
|
|
|
95
86
|
});
|
|
96
87
|
}, { concurrency: "unbounded" });
|
|
97
88
|
const resolved = pipe(matches, Array.flatten, Array.map((file) => path.resolve(context.configRoot, file)), Array.dedupe);
|
|
98
|
-
const paths = yield* Effect.filter(includedFiles === undefined ? resolved : Array.filter(resolved, (file) => includedFiles.has(file)), (
|
|
99
|
-
|
|
89
|
+
const paths = yield* Effect.filter(includedFiles === undefined ? resolved : Array.filter(resolved, (file) => includedFiles.has(file)), flow(fs.stat, Effect.map((info) => info.type === "File")), { concurrency: "unbounded" });
|
|
90
|
+
return yield* Effect.forEach(paths, Effect.fn("CheckTraits.file")(function* (file) {
|
|
100
91
|
const text = yield* fs.readFileString(file);
|
|
101
|
-
const
|
|
102
|
-
const activeTraits = Array.filter(traits, (trait) => !ignored.has(trait.id));
|
|
92
|
+
const activeTraits = pipe(traits, excludeIgnored(text));
|
|
103
93
|
const chunks = Array.chunksOf(String.split(text, "\n"), 200);
|
|
104
94
|
const sources = Array.map(chunks, (lines, index) => Source.make({
|
|
105
95
|
text: Array.join(lines, "\n"),
|
|
106
96
|
location: SourceLocation.cases.File.make({ path: file, startLine: index * 200 + 1 })
|
|
107
97
|
}));
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}), { concurrency: "unbounded" });
|
|
111
|
-
return Array.flatten(results);
|
|
98
|
+
return yield* pipe(sources, Effect.forEach((source) => Evaluation.evaluateAll(activeTraits, source), { concurrency: "unbounded" }), Effect.map(flow(Array.flatten, Array.filter(Evaluation.requiresReview))));
|
|
99
|
+
}), { concurrency: "unbounded" }).pipe(Effect.map(Array.flatten));
|
|
112
100
|
})
|
|
113
101
|
});
|
|
114
102
|
//# sourceMappingURL=CheckTraits.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckTraits.js","sourceRoot":"","sources":["../../toolkit/CheckTraits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"CheckTraits.js","sourceRoot":"","sources":["../../toolkit/CheckTraits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACzF,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEpD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC9E,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,KAAK,MAAM,aAAa,CAAA;AACpC,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAA;AACnD,OAAO,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IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAA;YACvD,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAA;YAC5D,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CACjD,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC;gBAC7B,QAAQ,EAAE,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC;aACrF,CAAC,CACH,CAAA;YACD,OAAO,KAAK,CAAC,CAAC,IAAI,CAChB,OAAO,EACP,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,EACtG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,CACzE,CAAA;QACH,CAAC,CAAC,EACF,EAAE,WAAW,EAAE,WAAW,EAAE,CAC7B,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAA;IACnC,CAAC,CAAC;CACH,CAAC,CAAA"}
|
|
@@ -1,107 +1,223 @@
|
|
|
1
1
|
import { Schema as S } from "effect";
|
|
2
|
-
import {
|
|
2
|
+
import { DecisionModel, LanguageModel, McpSchema, Tool, Toolkit } from "effect/ai";
|
|
3
3
|
import { TraitsContext } from "../TraitsContext.ts";
|
|
4
4
|
import { TraitStore } from "../TraitStore.ts";
|
|
5
5
|
export declare const DeriveTrait: Tool.Tool<"derive_trait", {
|
|
6
6
|
readonly parameters: S.Struct<{
|
|
7
|
+
readonly diff: S.optional<S.String>;
|
|
8
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
7
9
|
readonly proposedTrait: S.String;
|
|
8
10
|
readonly approved: S.optional<S.Boolean>;
|
|
9
11
|
}>;
|
|
10
12
|
readonly success: S.toTaggedUnion<"_tag", readonly [S.TaggedStruct<"Created", {
|
|
11
|
-
readonly trait: S.Struct<{
|
|
12
|
-
readonly id: S.brand<S.String, "traits/Trait">;
|
|
13
|
+
readonly trait: S.StructWithRest<S.Struct<{
|
|
13
14
|
readonly body: S.String;
|
|
14
|
-
|
|
15
|
+
readonly diff: S.optional<S.String>;
|
|
16
|
+
readonly mime: S.optional<S.Union<readonly [S.String, S.$Array<S.String>]>>;
|
|
17
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
18
|
+
readonly skip: S.optional<S.String>;
|
|
19
|
+
readonly when: S.optional<S.String>;
|
|
20
|
+
}>, readonly [S.$Record<S.String, S.Codec<S.Json, S.Json, never, never>>]>;
|
|
15
21
|
}>, S.TaggedStruct<"Covered", {
|
|
16
|
-
readonly traits: S.$Array<S.Struct<{
|
|
17
|
-
readonly id: S.brand<S.String, "traits/Trait">;
|
|
22
|
+
readonly traits: S.$Array<S.StructWithRest<S.Struct<{
|
|
18
23
|
readonly body: S.String;
|
|
19
|
-
|
|
24
|
+
readonly diff: S.optional<S.String>;
|
|
25
|
+
readonly mime: S.optional<S.Union<readonly [S.String, S.$Array<S.String>]>>;
|
|
26
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
27
|
+
readonly skip: S.optional<S.String>;
|
|
28
|
+
readonly when: S.optional<S.String>;
|
|
29
|
+
}>, readonly [S.$Record<S.String, S.Codec<S.Json, S.Json, never, never>>]>>;
|
|
20
30
|
}>, S.TaggedStruct<"Clarification", {
|
|
21
|
-
readonly traits: S.$Array<S.Struct<{
|
|
22
|
-
readonly id: S.brand<S.String, "traits/Trait">;
|
|
31
|
+
readonly traits: S.$Array<S.StructWithRest<S.Struct<{
|
|
23
32
|
readonly body: S.String;
|
|
24
|
-
|
|
33
|
+
readonly diff: S.optional<S.String>;
|
|
34
|
+
readonly mime: S.optional<S.Union<readonly [S.String, S.$Array<S.String>]>>;
|
|
35
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
36
|
+
readonly skip: S.optional<S.String>;
|
|
37
|
+
readonly when: S.optional<S.String>;
|
|
38
|
+
}>, readonly [S.$Record<S.String, S.Codec<S.Json, S.Json, never, never>>]>>;
|
|
25
39
|
readonly proposedTrait: S.String;
|
|
26
40
|
}>, S.TaggedStruct<"Inconclusive", {
|
|
27
41
|
readonly findings: S.$Array<S.TaggedStruct<"Fail", {
|
|
28
|
-
readonly existing: S.Struct<{
|
|
29
|
-
readonly id: S.brand<S.String, "traits/Trait">;
|
|
42
|
+
readonly existing: S.StructWithRest<S.Struct<{
|
|
30
43
|
readonly body: S.String;
|
|
31
|
-
|
|
44
|
+
readonly diff: S.optional<S.String>;
|
|
45
|
+
readonly mime: S.optional<S.Union<readonly [S.String, S.$Array<S.String>]>>;
|
|
46
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
47
|
+
readonly skip: S.optional<S.String>;
|
|
48
|
+
readonly when: S.optional<S.String>;
|
|
49
|
+
}>, readonly [S.$Record<S.String, S.Codec<S.Json, S.Json, never, never>>]>;
|
|
32
50
|
readonly proposed: S.String;
|
|
33
|
-
readonly reason: S.Literals<readonly ["conflict", "inconclusive"]>;
|
|
51
|
+
readonly reason: S.Literals<readonly ["conflict", "coverage_gap", "inconclusive"]>;
|
|
34
52
|
}>>;
|
|
35
53
|
}>, S.TaggedStruct<"Updated", {
|
|
36
|
-
readonly trait: S.Struct<{
|
|
37
|
-
readonly id: S.brand<S.String, "traits/Trait">;
|
|
54
|
+
readonly trait: S.StructWithRest<S.Struct<{
|
|
38
55
|
readonly body: S.String;
|
|
39
|
-
|
|
56
|
+
readonly diff: S.optional<S.String>;
|
|
57
|
+
readonly mime: S.optional<S.Union<readonly [S.String, S.$Array<S.String>]>>;
|
|
58
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
59
|
+
readonly skip: S.optional<S.String>;
|
|
60
|
+
readonly when: S.optional<S.String>;
|
|
61
|
+
}>, readonly [S.$Record<S.String, S.Codec<S.Json, S.Json, never, never>>]>;
|
|
40
62
|
}>, S.TaggedStruct<"Resolved", {
|
|
41
|
-
readonly traits: S.$Array<S.Struct<{
|
|
42
|
-
readonly id: S.brand<S.String, "traits/Trait">;
|
|
63
|
+
readonly traits: S.$Array<S.StructWithRest<S.Struct<{
|
|
43
64
|
readonly body: S.String;
|
|
44
|
-
|
|
65
|
+
readonly diff: S.optional<S.String>;
|
|
66
|
+
readonly mime: S.optional<S.Union<readonly [S.String, S.$Array<S.String>]>>;
|
|
67
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
68
|
+
readonly skip: S.optional<S.String>;
|
|
69
|
+
readonly when: S.optional<S.String>;
|
|
70
|
+
}>, readonly [S.$Record<S.String, S.Codec<S.Json, S.Json, never, never>>]>>;
|
|
45
71
|
}>, S.TaggedStruct<"ApprovalRequired", {
|
|
46
72
|
readonly message: S.String;
|
|
47
73
|
}>, S.TaggedStruct<"RevisionRequired", {
|
|
48
74
|
readonly feedback: S.String;
|
|
49
75
|
}>, S.TaggedStruct<"Declined", {}>]>;
|
|
50
|
-
readonly failure: S.Union<readonly [
|
|
76
|
+
readonly failure: S.Union<readonly [S.TaggedStruct<"AiError", {
|
|
77
|
+
readonly message: S.String;
|
|
78
|
+
}>, S.Union<readonly [S.Struct<{
|
|
79
|
+
readonly _tag: S.tag<"TraitNotFoundError">;
|
|
80
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
81
|
+
readonly message: S.String;
|
|
82
|
+
}>, S.Struct<{
|
|
83
|
+
readonly _tag: S.tag<"TraitAlreadyExistsError">;
|
|
84
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
85
|
+
readonly message: S.String;
|
|
86
|
+
}>, S.Struct<{
|
|
87
|
+
readonly _tag: S.tag<"TraitFilenameMismatchError">;
|
|
88
|
+
readonly path: S.String;
|
|
89
|
+
readonly expectedFilename: S.String;
|
|
90
|
+
readonly message: S.String;
|
|
91
|
+
}>, S.Struct<{
|
|
92
|
+
readonly _tag: S.tag<"MissingFrontmatterError">;
|
|
93
|
+
readonly path: S.String;
|
|
94
|
+
readonly message: S.String;
|
|
95
|
+
}>, S.Struct<{
|
|
96
|
+
readonly _tag: S.tag<"UnterminatedFrontmatterError">;
|
|
97
|
+
readonly path: S.String;
|
|
98
|
+
readonly message: S.String;
|
|
99
|
+
}>, S.Struct<{
|
|
100
|
+
readonly _tag: S.tag<"InvalidYamlError">;
|
|
101
|
+
readonly path: S.String;
|
|
102
|
+
readonly line: S.optional<S.Int>;
|
|
103
|
+
readonly column: S.optional<S.Int>;
|
|
104
|
+
readonly cause: S.Defect;
|
|
105
|
+
readonly message: S.String;
|
|
106
|
+
}>, S.TaggedStruct<"PlatformError", {
|
|
51
107
|
readonly message: S.String;
|
|
52
|
-
}>,
|
|
53
|
-
|
|
108
|
+
}>, S.TaggedStruct<"SchemaError", {
|
|
109
|
+
readonly message: S.String;
|
|
110
|
+
}>]>, typeof McpSchema.ElicitationDeclined]>;
|
|
111
|
+
readonly failureMode: "return";
|
|
54
112
|
}, DecisionModel.DecisionModel | LanguageModel.LanguageModel | TraitStore | TraitsContext>;
|
|
55
113
|
export declare const toolkit: Toolkit.Toolkit<{
|
|
56
114
|
readonly derive_trait: Tool.Tool<"derive_trait", {
|
|
57
115
|
readonly parameters: S.Struct<{
|
|
116
|
+
readonly diff: S.optional<S.String>;
|
|
117
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
58
118
|
readonly proposedTrait: S.String;
|
|
59
119
|
readonly approved: S.optional<S.Boolean>;
|
|
60
120
|
}>;
|
|
61
121
|
readonly success: S.toTaggedUnion<"_tag", readonly [S.TaggedStruct<"Created", {
|
|
62
|
-
readonly trait: S.Struct<{
|
|
63
|
-
readonly id: S.brand<S.String, "traits/Trait">;
|
|
122
|
+
readonly trait: S.StructWithRest<S.Struct<{
|
|
64
123
|
readonly body: S.String;
|
|
65
|
-
|
|
124
|
+
readonly diff: S.optional<S.String>;
|
|
125
|
+
readonly mime: S.optional<S.Union<readonly [S.String, S.$Array<S.String>]>>;
|
|
126
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
127
|
+
readonly skip: S.optional<S.String>;
|
|
128
|
+
readonly when: S.optional<S.String>;
|
|
129
|
+
}>, readonly [S.$Record<S.String, S.Codec<S.Json, S.Json, never, never>>]>;
|
|
66
130
|
}>, S.TaggedStruct<"Covered", {
|
|
67
|
-
readonly traits: S.$Array<S.Struct<{
|
|
68
|
-
readonly id: S.brand<S.String, "traits/Trait">;
|
|
131
|
+
readonly traits: S.$Array<S.StructWithRest<S.Struct<{
|
|
69
132
|
readonly body: S.String;
|
|
70
|
-
|
|
133
|
+
readonly diff: S.optional<S.String>;
|
|
134
|
+
readonly mime: S.optional<S.Union<readonly [S.String, S.$Array<S.String>]>>;
|
|
135
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
136
|
+
readonly skip: S.optional<S.String>;
|
|
137
|
+
readonly when: S.optional<S.String>;
|
|
138
|
+
}>, readonly [S.$Record<S.String, S.Codec<S.Json, S.Json, never, never>>]>>;
|
|
71
139
|
}>, S.TaggedStruct<"Clarification", {
|
|
72
|
-
readonly traits: S.$Array<S.Struct<{
|
|
73
|
-
readonly id: S.brand<S.String, "traits/Trait">;
|
|
140
|
+
readonly traits: S.$Array<S.StructWithRest<S.Struct<{
|
|
74
141
|
readonly body: S.String;
|
|
75
|
-
|
|
142
|
+
readonly diff: S.optional<S.String>;
|
|
143
|
+
readonly mime: S.optional<S.Union<readonly [S.String, S.$Array<S.String>]>>;
|
|
144
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
145
|
+
readonly skip: S.optional<S.String>;
|
|
146
|
+
readonly when: S.optional<S.String>;
|
|
147
|
+
}>, readonly [S.$Record<S.String, S.Codec<S.Json, S.Json, never, never>>]>>;
|
|
76
148
|
readonly proposedTrait: S.String;
|
|
77
149
|
}>, S.TaggedStruct<"Inconclusive", {
|
|
78
150
|
readonly findings: S.$Array<S.TaggedStruct<"Fail", {
|
|
79
|
-
readonly existing: S.Struct<{
|
|
80
|
-
readonly id: S.brand<S.String, "traits/Trait">;
|
|
151
|
+
readonly existing: S.StructWithRest<S.Struct<{
|
|
81
152
|
readonly body: S.String;
|
|
82
|
-
|
|
153
|
+
readonly diff: S.optional<S.String>;
|
|
154
|
+
readonly mime: S.optional<S.Union<readonly [S.String, S.$Array<S.String>]>>;
|
|
155
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
156
|
+
readonly skip: S.optional<S.String>;
|
|
157
|
+
readonly when: S.optional<S.String>;
|
|
158
|
+
}>, readonly [S.$Record<S.String, S.Codec<S.Json, S.Json, never, never>>]>;
|
|
83
159
|
readonly proposed: S.String;
|
|
84
|
-
readonly reason: S.Literals<readonly ["conflict", "inconclusive"]>;
|
|
160
|
+
readonly reason: S.Literals<readonly ["conflict", "coverage_gap", "inconclusive"]>;
|
|
85
161
|
}>>;
|
|
86
162
|
}>, S.TaggedStruct<"Updated", {
|
|
87
|
-
readonly trait: S.Struct<{
|
|
88
|
-
readonly id: S.brand<S.String, "traits/Trait">;
|
|
163
|
+
readonly trait: S.StructWithRest<S.Struct<{
|
|
89
164
|
readonly body: S.String;
|
|
90
|
-
|
|
165
|
+
readonly diff: S.optional<S.String>;
|
|
166
|
+
readonly mime: S.optional<S.Union<readonly [S.String, S.$Array<S.String>]>>;
|
|
167
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
168
|
+
readonly skip: S.optional<S.String>;
|
|
169
|
+
readonly when: S.optional<S.String>;
|
|
170
|
+
}>, readonly [S.$Record<S.String, S.Codec<S.Json, S.Json, never, never>>]>;
|
|
91
171
|
}>, S.TaggedStruct<"Resolved", {
|
|
92
|
-
readonly traits: S.$Array<S.Struct<{
|
|
93
|
-
readonly id: S.brand<S.String, "traits/Trait">;
|
|
172
|
+
readonly traits: S.$Array<S.StructWithRest<S.Struct<{
|
|
94
173
|
readonly body: S.String;
|
|
95
|
-
|
|
174
|
+
readonly diff: S.optional<S.String>;
|
|
175
|
+
readonly mime: S.optional<S.Union<readonly [S.String, S.$Array<S.String>]>>;
|
|
176
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
177
|
+
readonly skip: S.optional<S.String>;
|
|
178
|
+
readonly when: S.optional<S.String>;
|
|
179
|
+
}>, readonly [S.$Record<S.String, S.Codec<S.Json, S.Json, never, never>>]>>;
|
|
96
180
|
}>, S.TaggedStruct<"ApprovalRequired", {
|
|
97
181
|
readonly message: S.String;
|
|
98
182
|
}>, S.TaggedStruct<"RevisionRequired", {
|
|
99
183
|
readonly feedback: S.String;
|
|
100
184
|
}>, S.TaggedStruct<"Declined", {}>]>;
|
|
101
|
-
readonly failure: S.Union<readonly [
|
|
185
|
+
readonly failure: S.Union<readonly [S.TaggedStruct<"AiError", {
|
|
186
|
+
readonly message: S.String;
|
|
187
|
+
}>, S.Union<readonly [S.Struct<{
|
|
188
|
+
readonly _tag: S.tag<"TraitNotFoundError">;
|
|
189
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
190
|
+
readonly message: S.String;
|
|
191
|
+
}>, S.Struct<{
|
|
192
|
+
readonly _tag: S.tag<"TraitAlreadyExistsError">;
|
|
193
|
+
readonly name: S.brand<S.String, "traits/TraitName">;
|
|
194
|
+
readonly message: S.String;
|
|
195
|
+
}>, S.Struct<{
|
|
196
|
+
readonly _tag: S.tag<"TraitFilenameMismatchError">;
|
|
197
|
+
readonly path: S.String;
|
|
198
|
+
readonly expectedFilename: S.String;
|
|
199
|
+
readonly message: S.String;
|
|
200
|
+
}>, S.Struct<{
|
|
201
|
+
readonly _tag: S.tag<"MissingFrontmatterError">;
|
|
202
|
+
readonly path: S.String;
|
|
203
|
+
readonly message: S.String;
|
|
204
|
+
}>, S.Struct<{
|
|
205
|
+
readonly _tag: S.tag<"UnterminatedFrontmatterError">;
|
|
206
|
+
readonly path: S.String;
|
|
207
|
+
readonly message: S.String;
|
|
208
|
+
}>, S.Struct<{
|
|
209
|
+
readonly _tag: S.tag<"InvalidYamlError">;
|
|
210
|
+
readonly path: S.String;
|
|
211
|
+
readonly line: S.optional<S.Int>;
|
|
212
|
+
readonly column: S.optional<S.Int>;
|
|
213
|
+
readonly cause: S.Defect;
|
|
214
|
+
readonly message: S.String;
|
|
215
|
+
}>, S.TaggedStruct<"PlatformError", {
|
|
216
|
+
readonly message: S.String;
|
|
217
|
+
}>, S.TaggedStruct<"SchemaError", {
|
|
102
218
|
readonly message: S.String;
|
|
103
|
-
}>, typeof McpSchema.ElicitationDeclined]>;
|
|
104
|
-
readonly failureMode: "
|
|
219
|
+
}>]>, typeof McpSchema.ElicitationDeclined]>;
|
|
220
|
+
readonly failureMode: "return";
|
|
105
221
|
}, DecisionModel.DecisionModel | LanguageModel.LanguageModel | TraitStore | TraitsContext>;
|
|
106
222
|
}>;
|
|
107
223
|
export declare const layer: import("effect/Layer").Layer<Tool.Handler<"derive_trait">, never, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeriveTrait.d.ts","sourceRoot":"","sources":["../../toolkit/DeriveTrait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAU,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"DeriveTrait.d.ts","sourceRoot":"","sources":["../../toolkit/DeriveTrait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAU,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAIlF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAmB,MAAM,kBAAkB,CAAA;AAE9D,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0FAyDW,CAAA;AAEnC,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA4B,CAAA;AAEhD,eAAO,MAAM,KAAK,0EAEhB,CAAA"}
|