traits 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/Assessment.ts +14 -0
  2. package/LICENSE +203 -0
  3. package/Source.ts +13 -0
  4. package/Trait.ts +51 -0
  5. package/TraitConflict.ts +52 -0
  6. package/TraitDerivation.ts +137 -0
  7. package/TraitEvaluation.ts +69 -0
  8. package/TraitStore.ts +88 -0
  9. package/TraitsConfig.ts +57 -0
  10. package/TraitsContext.ts +11 -0
  11. package/_util/Approval.ts +59 -0
  12. package/_util/Git.ts +25 -0
  13. package/_util/TraitsConfigProvider.ts +22 -0
  14. package/_util/TraitsTelemetry.ts +20 -0
  15. package/_util/words.ts +555 -0
  16. package/bin.ts +65 -0
  17. package/dist/Assessment.d.ts +12 -0
  18. package/dist/Assessment.d.ts.map +1 -0
  19. package/dist/Assessment.js +12 -0
  20. package/dist/Assessment.js.map +1 -0
  21. package/dist/Source.d.ts +21 -0
  22. package/dist/Source.d.ts.map +1 -0
  23. package/dist/Source.js +10 -0
  24. package/dist/Source.js.map +1 -0
  25. package/dist/Trait.d.ts +12 -0
  26. package/dist/Trait.d.ts.map +1 -0
  27. package/dist/Trait.js +44 -0
  28. package/dist/Trait.js.map +1 -0
  29. package/dist/TraitConflict.d.ts +56 -0
  30. package/dist/TraitConflict.d.ts.map +1 -0
  31. package/dist/TraitConflict.js +47 -0
  32. package/dist/TraitConflict.js.map +1 -0
  33. package/dist/TraitDerivation.d.ts +99 -0
  34. package/dist/TraitDerivation.d.ts.map +1 -0
  35. package/dist/TraitDerivation.js +109 -0
  36. package/dist/TraitDerivation.js.map +1 -0
  37. package/dist/TraitEvaluation.d.ts +68 -0
  38. package/dist/TraitEvaluation.d.ts.map +1 -0
  39. package/dist/TraitEvaluation.js +61 -0
  40. package/dist/TraitEvaluation.js.map +1 -0
  41. package/dist/TraitStore.d.ts +17 -0
  42. package/dist/TraitStore.d.ts.map +1 -0
  43. package/dist/TraitStore.js +57 -0
  44. package/dist/TraitStore.js.map +1 -0
  45. package/dist/TraitsConfig.d.ts +14 -0
  46. package/dist/TraitsConfig.d.ts.map +1 -0
  47. package/dist/TraitsConfig.js +40 -0
  48. package/dist/TraitsConfig.js.map +1 -0
  49. package/dist/TraitsContext.d.ts +11 -0
  50. package/dist/TraitsContext.d.ts.map +1 -0
  51. package/dist/TraitsContext.js +4 -0
  52. package/dist/TraitsContext.js.map +1 -0
  53. package/dist/_util/Approval.d.ts +28 -0
  54. package/dist/_util/Approval.d.ts.map +1 -0
  55. package/dist/_util/Approval.js +48 -0
  56. package/dist/_util/Approval.js.map +1 -0
  57. package/dist/_util/Git.d.ts +15 -0
  58. package/dist/_util/Git.d.ts.map +1 -0
  59. package/dist/_util/Git.js +17 -0
  60. package/dist/_util/Git.js.map +1 -0
  61. package/dist/_util/TraitsConfigProvider.d.ts +3 -0
  62. package/dist/_util/TraitsConfigProvider.d.ts.map +1 -0
  63. package/dist/_util/TraitsConfigProvider.js +17 -0
  64. package/dist/_util/TraitsConfigProvider.js.map +1 -0
  65. package/dist/_util/TraitsTelemetry.d.ts +3 -0
  66. package/dist/_util/TraitsTelemetry.d.ts.map +1 -0
  67. package/dist/_util/TraitsTelemetry.js +12 -0
  68. package/dist/_util/TraitsTelemetry.js.map +1 -0
  69. package/dist/_util/words.d.ts +2 -0
  70. package/dist/_util/words.d.ts.map +1 -0
  71. package/dist/_util/words.js +556 -0
  72. package/dist/_util/words.js.map +1 -0
  73. package/dist/bin.d.ts +3 -0
  74. package/dist/bin.d.ts.map +1 -0
  75. package/dist/bin.js +60 -0
  76. package/dist/bin.js.map +1 -0
  77. package/dist/index.d.ts +10 -0
  78. package/dist/index.d.ts.map +1 -0
  79. package/dist/index.js +10 -0
  80. package/dist/index.js.map +1 -0
  81. package/dist/main.d.ts +3 -0
  82. package/dist/main.d.ts.map +1 -0
  83. package/dist/main.js +72 -0
  84. package/dist/main.js.map +1 -0
  85. package/dist/package.json +52 -0
  86. package/dist/test/TraitIgnores.test.d.ts +2 -0
  87. package/dist/test/TraitIgnores.test.d.ts.map +1 -0
  88. package/dist/test/TraitIgnores.test.js +20 -0
  89. package/dist/test/TraitIgnores.test.js.map +1 -0
  90. package/dist/toolkit/CheckTraits.d.ts +79 -0
  91. package/dist/toolkit/CheckTraits.d.ts.map +1 -0
  92. package/dist/toolkit/CheckTraits.js +114 -0
  93. package/dist/toolkit/CheckTraits.js.map +1 -0
  94. package/dist/toolkit/DeriveTrait.d.ts +108 -0
  95. package/dist/toolkit/DeriveTrait.d.ts.map +1 -0
  96. package/dist/toolkit/DeriveTrait.js +54 -0
  97. package/dist/toolkit/DeriveTrait.js.map +1 -0
  98. package/dist/toolkit/toolkit.d.ts +3 -0
  99. package/dist/toolkit/toolkit.d.ts.map +1 -0
  100. package/dist/toolkit/toolkit.js +6 -0
  101. package/dist/toolkit/toolkit.js.map +1 -0
  102. package/dist/traitIgnores.d.ts +3 -0
  103. package/dist/traitIgnores.d.ts.map +1 -0
  104. package/dist/traitIgnores.js +17 -0
  105. package/dist/traitIgnores.js.map +1 -0
  106. package/index.ts +9 -0
  107. package/main.ts +111 -0
  108. package/package.json +45 -0
  109. package/skills/traits/SKILL.md +339 -0
  110. package/toolkit/CheckTraits.ts +154 -0
  111. package/toolkit/DeriveTrait.ts +59 -0
  112. package/toolkit/toolkit.ts +9 -0
  113. package/traitIgnores.ts +14 -0
  114. 1289345811335-0.8567837113514543/lib/traits.js +0 -662
  115. 1289345811335-0.8567837113514543/package.json +0 -7
package/_util/words.ts ADDED
@@ -0,0 +1,555 @@
1
+ export const words = [
2
+ "acacia",
3
+ "adventure",
4
+ "agate",
5
+ "alabaster",
6
+ "albatross",
7
+ "alchemy",
8
+ "alder",
9
+ "allure",
10
+ "alpine",
11
+ "amaranth",
12
+ "amber",
13
+ "ambrosia",
14
+ "amethyst",
15
+ "amulet",
16
+ "anemone",
17
+ "angel",
18
+ "anthem",
19
+ "antler",
20
+ "apricot",
21
+ "aquamarine",
22
+ "aquarium",
23
+ "arbor",
24
+ "arcadia",
25
+ "archway",
26
+ "aria",
27
+ "arpeggio",
28
+ "arrowroot",
29
+ "aspen",
30
+ "aster",
31
+ "astral",
32
+ "atlas",
33
+ "aurora",
34
+ "autumn",
35
+ "avalon",
36
+ "aviary",
37
+ "azalea",
38
+ "azure",
39
+ "badger",
40
+ "ballad",
41
+ "ballet",
42
+ "bamboo",
43
+ "banyan",
44
+ "basil",
45
+ "bayberry",
46
+ "beacon",
47
+ "bead",
48
+ "beech",
49
+ "bell",
50
+ "bellflower",
51
+ "berry",
52
+ "birch",
53
+ "birdsong",
54
+ "bliss",
55
+ "bloom",
56
+ "blossom",
57
+ "bluebell",
58
+ "bluebird",
59
+ "blueberry",
60
+ "boreal",
61
+ "bower",
62
+ "bramble",
63
+ "brass",
64
+ "breeze",
65
+ "brook",
66
+ "bubble",
67
+ "buttercup",
68
+ "butterfly",
69
+ "cabin",
70
+ "cadence",
71
+ "cairn",
72
+ "calico",
73
+ "camellia",
74
+ "canary",
75
+ "candle",
76
+ "canopy",
77
+ "canvas",
78
+ "canyon",
79
+ "caravan",
80
+ "cardinal",
81
+ "carnation",
82
+ "carousel",
83
+ "cascade",
84
+ "castle",
85
+ "cedar",
86
+ "celadon",
87
+ "celestial",
88
+ "cello",
89
+ "chalet",
90
+ "chalice",
91
+ "chamomile",
92
+ "charm",
93
+ "cherry",
94
+ "chickadee",
95
+ "chime",
96
+ "chinchilla",
97
+ "cinnamon",
98
+ "citadel",
99
+ "citrine",
100
+ "citrus",
101
+ "clarinet",
102
+ "clematis",
103
+ "cloud",
104
+ "clover",
105
+ "cobalt",
106
+ "cocoa",
107
+ "comet",
108
+ "compass",
109
+ "concerto",
110
+ "constellation",
111
+ "copper",
112
+ "coral",
113
+ "cosmic",
114
+ "cosmos",
115
+ "cottage",
116
+ "cove",
117
+ "crane",
118
+ "crescent",
119
+ "cricket",
120
+ "crocus",
121
+ "crown",
122
+ "crystal",
123
+ "cupcake",
124
+ "cypress",
125
+ "daffodil",
126
+ "dahlia",
127
+ "daisy",
128
+ "dandelion",
129
+ "dapple",
130
+ "dawn",
131
+ "daybreak",
132
+ "daydream",
133
+ "deer",
134
+ "delight",
135
+ "dew",
136
+ "dewdrop",
137
+ "diamond",
138
+ "dolphin",
139
+ "dove",
140
+ "dragon",
141
+ "dragonfly",
142
+ "dream",
143
+ "dreamer",
144
+ "dreamscape",
145
+ "drift",
146
+ "driftwood",
147
+ "droplet",
148
+ "dune",
149
+ "dusk",
150
+ "eagle",
151
+ "echo",
152
+ "edelweiss",
153
+ "elderberry",
154
+ "elm",
155
+ "elysian",
156
+ "ember",
157
+ "emerald",
158
+ "enchantment",
159
+ "enclave",
160
+ "enigma",
161
+ "epiphany",
162
+ "equinox",
163
+ "ethereal",
164
+ "evergreen",
165
+ "fable",
166
+ "fairy",
167
+ "falcon",
168
+ "fantasia",
169
+ "faraway",
170
+ "fawn",
171
+ "feather",
172
+ "fern",
173
+ "festival",
174
+ "fig",
175
+ "filigree",
176
+ "finch",
177
+ "firefly",
178
+ "fir",
179
+ "fjord",
180
+ "flamingo",
181
+ "fleur",
182
+ "flora",
183
+ "flourish",
184
+ "flower",
185
+ "flute",
186
+ "foal",
187
+ "forest",
188
+ "fountain",
189
+ "fox",
190
+ "freesia",
191
+ "frog",
192
+ "frost",
193
+ "galaxy",
194
+ "garden",
195
+ "gardenia",
196
+ "garland",
197
+ "garnet",
198
+ "gazebo",
199
+ "gazelle",
200
+ "gem",
201
+ "ginger",
202
+ "ginkgo",
203
+ "glacier",
204
+ "glade",
205
+ "gleam",
206
+ "glimmer",
207
+ "glitter",
208
+ "glow",
209
+ "gold",
210
+ "golden",
211
+ "goldfinch",
212
+ "gossamer",
213
+ "grace",
214
+ "granite",
215
+ "grape",
216
+ "greenhouse",
217
+ "griffin",
218
+ "grotto",
219
+ "grove",
220
+ "halo",
221
+ "harbor",
222
+ "hare",
223
+ "harmony",
224
+ "harp",
225
+ "harvest",
226
+ "haven",
227
+ "hawthorn",
228
+ "heather",
229
+ "hedgehog",
230
+ "heliotrope",
231
+ "heron",
232
+ "hibiscus",
233
+ "hickory",
234
+ "highland",
235
+ "hilltop",
236
+ "holly",
237
+ "honey",
238
+ "honeybee",
239
+ "honeysuckle",
240
+ "hope",
241
+ "horizon",
242
+ "hummingbird",
243
+ "hyacinth",
244
+ "hydrangea",
245
+ "ibis",
246
+ "icicle",
247
+ "idyll",
248
+ "illumine",
249
+ "imagine",
250
+ "indigo",
251
+ "iris",
252
+ "island",
253
+ "ivory",
254
+ "ivy",
255
+ "jade",
256
+ "jasmine",
257
+ "jazz",
258
+ "jewel",
259
+ "journey",
260
+ "joy",
261
+ "jubilee",
262
+ "juniper",
263
+ "kaleidoscope",
264
+ "karate",
265
+ "kestrel",
266
+ "kingfisher",
267
+ "kite",
268
+ "kiwi",
269
+ "koala",
270
+ "koi",
271
+ "lagoon",
272
+ "lake",
273
+ "lantern",
274
+ "lapis",
275
+ "larch",
276
+ "lark",
277
+ "laurel",
278
+ "lavender",
279
+ "leaf",
280
+ "legend",
281
+ "lemon",
282
+ "lemur",
283
+ "lighthouse",
284
+ "lilac",
285
+ "lily",
286
+ "linden",
287
+ "lotus",
288
+ "lullaby",
289
+ "lumen",
290
+ "luminous",
291
+ "lunar",
292
+ "lupine",
293
+ "lyra",
294
+ "lyric",
295
+ "macaw",
296
+ "magic",
297
+ "magnolia",
298
+ "mandarin",
299
+ "mandolin",
300
+ "mango",
301
+ "maple",
302
+ "marble",
303
+ "marigold",
304
+ "marimba",
305
+ "mariposa",
306
+ "marvel",
307
+ "meadow",
308
+ "melody",
309
+ "meridian",
310
+ "mermaid",
311
+ "meteor",
312
+ "midnight",
313
+ "milkweed",
314
+ "mimosa",
315
+ "mint",
316
+ "mirage",
317
+ "mist",
318
+ "moon",
319
+ "moonbeam",
320
+ "moonflower",
321
+ "moonlight",
322
+ "moonrise",
323
+ "moonstone",
324
+ "morning",
325
+ "mosaic",
326
+ "moss",
327
+ "mountain",
328
+ "mulberry",
329
+ "muse",
330
+ "music",
331
+ "myriad",
332
+ "myrtle",
333
+ "mystic",
334
+ "myth",
335
+ "narwhal",
336
+ "nebula",
337
+ "nectar",
338
+ "nightingale",
339
+ "nimbus",
340
+ "nocturne",
341
+ "nova",
342
+ "oak",
343
+ "oasis",
344
+ "ocean",
345
+ "octave",
346
+ "odyssey",
347
+ "olive",
348
+ "opal",
349
+ "opera",
350
+ "orchard",
351
+ "orchestra",
352
+ "orchid",
353
+ "origami",
354
+ "oriole",
355
+ "otter",
356
+ "owl",
357
+ "pagoda",
358
+ "palace",
359
+ "palm",
360
+ "panda",
361
+ "papaya",
362
+ "papyrus",
363
+ "paradise",
364
+ "parakeet",
365
+ "parchment",
366
+ "pastel",
367
+ "pathway",
368
+ "pavilion",
369
+ "peach",
370
+ "peacock",
371
+ "pear",
372
+ "pearl",
373
+ "pebble",
374
+ "pegasus",
375
+ "pelican",
376
+ "penguin",
377
+ "peony",
378
+ "peridot",
379
+ "periwinkle",
380
+ "petal",
381
+ "phoenix",
382
+ "piano",
383
+ "piccolo",
384
+ "pilgrim",
385
+ "pine",
386
+ "pinnacle",
387
+ "pixie",
388
+ "planet",
389
+ "plum",
390
+ "plume",
391
+ "poem",
392
+ "poetry",
393
+ "polaris",
394
+ "pomegranate",
395
+ "pond",
396
+ "poplar",
397
+ "poppy",
398
+ "porcelain",
399
+ "portal",
400
+ "prairie",
401
+ "primrose",
402
+ "prism",
403
+ "promise",
404
+ "puffin",
405
+ "quail",
406
+ "quartz",
407
+ "quest",
408
+ "quill",
409
+ "quince",
410
+ "rabbit",
411
+ "radiance",
412
+ "rainbow",
413
+ "raindrop",
414
+ "rainfall",
415
+ "raven",
416
+ "realm",
417
+ "redwood",
418
+ "reed",
419
+ "reef",
420
+ "reflection",
421
+ "reverie",
422
+ "rhapsody",
423
+ "ribbon",
424
+ "ripple",
425
+ "river",
426
+ "robin",
427
+ "rose",
428
+ "rosemary",
429
+ "rosewood",
430
+ "rowan",
431
+ "ruby",
432
+ "rune",
433
+ "saffron",
434
+ "sage",
435
+ "sail",
436
+ "sandalwood",
437
+ "sapphire",
438
+ "satin",
439
+ "savanna",
440
+ "seabird",
441
+ "seaglass",
442
+ "seahorse",
443
+ "seal",
444
+ "seashell",
445
+ "sequoia",
446
+ "serenade",
447
+ "serendipity",
448
+ "serenity",
449
+ "shamrock",
450
+ "shell",
451
+ "shimmer",
452
+ "silhouette",
453
+ "silk",
454
+ "silver",
455
+ "skylark",
456
+ "snow",
457
+ "snowdrop",
458
+ "snowfall",
459
+ "snowflake",
460
+ "solace",
461
+ "solar",
462
+ "solstice",
463
+ "sonata",
464
+ "songbird",
465
+ "sorrel",
466
+ "spark",
467
+ "sparkle",
468
+ "sparrow",
469
+ "spell",
470
+ "spire",
471
+ "spring",
472
+ "sprite",
473
+ "spruce",
474
+ "star",
475
+ "stardust",
476
+ "starfish",
477
+ "starlight",
478
+ "starling",
479
+ "stone",
480
+ "storybook",
481
+ "strawberry",
482
+ "stream",
483
+ "summer",
484
+ "sun",
485
+ "sunbeam",
486
+ "sunflower",
487
+ "sunlight",
488
+ "sunrise",
489
+ "sunset",
490
+ "swallow",
491
+ "swan",
492
+ "sweetpea",
493
+ "sycamore",
494
+ "symphony",
495
+ "talisman",
496
+ "tamarind",
497
+ "tangerine",
498
+ "tapestry",
499
+ "teal",
500
+ "telescope",
501
+ "terrace",
502
+ "thistle",
503
+ "thrush",
504
+ "thyme",
505
+ "tide",
506
+ "tiger",
507
+ "topaz",
508
+ "toucan",
509
+ "tower",
510
+ "treasure",
511
+ "treetop",
512
+ "trill",
513
+ "tulip",
514
+ "turquoise",
515
+ "turtle",
516
+ "twilight",
517
+ "twinkle",
518
+ "unicorn",
519
+ "valley",
520
+ "vanilla",
521
+ "velvet",
522
+ "verbena",
523
+ "verdant",
524
+ "vesper",
525
+ "violet",
526
+ "violin",
527
+ "vista",
528
+ "voyage",
529
+ "waltz",
530
+ "wand",
531
+ "wander",
532
+ "waterfall",
533
+ "wave",
534
+ "whale",
535
+ "whimsy",
536
+ "whisper",
537
+ "wildflower",
538
+ "willow",
539
+ "windchime",
540
+ "windmill",
541
+ "wing",
542
+ "winter",
543
+ "wish",
544
+ "wisteria",
545
+ "wizard",
546
+ "wolf",
547
+ "wonder",
548
+ "woodland",
549
+ "wren",
550
+ "yarrow",
551
+ "yonder",
552
+ "zenith",
553
+ "zephyr",
554
+ "zinnia"
555
+ ] as const
package/bin.ts ADDED
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+ // traits-ignore-file dawn_sparrow_wolf-37a52965-6425-476e-bc3a-d20ce70bc1a6: Effect utilities are unavailable until this launcher installs dependencies.
3
+ import { spawn } from "node:child_process"
4
+ import { once } from "node:events"
5
+ import { existsSync, readFileSync } from "node:fs"
6
+ import { join } from "node:path"
7
+
8
+ const candidates = [
9
+ ["pnpm", ["pnpm-lock.yaml"]],
10
+ ["npm", ["package-lock.json", "npm-shrinkwrap.json"]],
11
+ ["yarn", ["yarn.lock"]],
12
+ ["bun", ["bun.lock", "bun.lockb"]]
13
+ ] as const
14
+
15
+ const [command, args] = installCommand(process.cwd())
16
+ process.stderr.write(`[traits] Installing dependencies in ${process.cwd()} using ${command}\n`)
17
+ await install(command, args)
18
+ await import("./main.ts")
19
+
20
+ function installCommand(root: string): [string, string[]] {
21
+ const manifest = JSON.parse(readFileSync(join(root, "package.json"), "utf8"))
22
+ const declared =
23
+ typeof manifest === "object" && manifest !== null && "packageManager" in manifest
24
+ ? manifest.packageManager
25
+ : undefined
26
+ const matches = candidates.filter((candidate) => candidate[1].some((file) => existsSync(join(root, file))))
27
+ const manager =
28
+ typeof declared === "string" ? declared.split("@")[0] : matches.length === 1 ? matches[0]?.[0] : undefined
29
+ if (manager === undefined || !candidates.some((candidate) => candidate[0] === manager)) {
30
+ throw new Error("Set package.json#packageManager to pnpm, npm, yarn, or bun to select the installer")
31
+ }
32
+ const locked =
33
+ candidates.find((candidate) => candidate[0] === manager)?.[1].some((file) => existsSync(join(root, file))) ?? false
34
+ if (manager === "npm") return [manager, [locked ? "ci" : "install"]]
35
+ if (manager === "yarn") {
36
+ const modern =
37
+ typeof declared === "string"
38
+ ? !declared.startsWith("yarn@1.")
39
+ : /^__metadata:/m.test(readFileSync(join(root, "yarn.lock"), "utf8"))
40
+ return [manager, ["install", ...(locked ? [modern ? "--immutable" : "--frozen-lockfile"] : [])]]
41
+ }
42
+ return [manager, ["install", ...(locked ? ["--frozen-lockfile"] : [])]]
43
+ }
44
+
45
+ function install(command: string, args: string[]) {
46
+ const child = spawn(command, args, {
47
+ stdio: ["ignore", process.stderr, process.stderr]
48
+ })
49
+ const interrupt = () => {
50
+ child.kill("SIGINT")
51
+ }
52
+ const terminate = () => {
53
+ child.kill("SIGTERM")
54
+ }
55
+ process.on("SIGINT", interrupt)
56
+ process.on("SIGTERM", terminate)
57
+ return once(child, "close")
58
+ .then((result) => {
59
+ if (result[0] !== 0) throw new Error(`${command} exited with ${result[1] ?? result[0]}`)
60
+ })
61
+ .finally(() => {
62
+ process.off("SIGINT", interrupt)
63
+ process.off("SIGTERM", terminate)
64
+ })
65
+ }
@@ -0,0 +1,12 @@
1
+ import { Schema as S } from "effect";
2
+ export type Assessment = typeof Assessment.Type;
3
+ export declare const Assessment: S.Struct<{
4
+ readonly classification: S.Literals<readonly ["compliant", "violation", "not-applicable", "inconclusive"]>;
5
+ readonly probabilities: S.Struct<{
6
+ readonly compliant: S.Finite;
7
+ readonly violation: S.Finite;
8
+ readonly "not-applicable": S.Finite;
9
+ readonly inconclusive: S.Finite;
10
+ }>;
11
+ }>;
12
+ //# sourceMappingURL=Assessment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Assessment.d.ts","sourceRoot":"","sources":["../Assessment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAIpC,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,IAAI,CAAA;AAC/C,eAAO,MAAM,UAAU;;;;;;;;EAQrB,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { Schema as S } from "effect";
2
+ const Probability = S.Finite.check(S.isBetween({ minimum: 0, maximum: 1 }));
3
+ export const Assessment = S.Struct({
4
+ classification: S.Literals(["compliant", "violation", "not-applicable", "inconclusive"]),
5
+ probabilities: S.Struct({
6
+ compliant: Probability,
7
+ violation: Probability,
8
+ "not-applicable": Probability,
9
+ inconclusive: Probability
10
+ })
11
+ });
12
+ //# sourceMappingURL=Assessment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Assessment.js","sourceRoot":"","sources":["../Assessment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEpC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;AAG3E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;IACxF,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC;QACtB,SAAS,EAAE,WAAW;QACtB,SAAS,EAAE,WAAW;QACtB,gBAAgB,EAAE,WAAW;QAC7B,YAAY,EAAE,WAAW;KAC1B,CAAC;CACH,CAAC,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { Schema as S } from "effect";
2
+ export type SourceLocation = typeof SourceLocation.Type;
3
+ export declare const SourceLocation: S.TaggedUnion<{
4
+ readonly File: S.TaggedStruct<"File", {
5
+ readonly path: S.String;
6
+ readonly startLine: S.Int;
7
+ }>;
8
+ readonly Generated: S.TaggedStruct<"Generated", {}>;
9
+ }>;
10
+ export type Source = typeof Source.Type;
11
+ export declare const Source: S.Struct<{
12
+ readonly text: S.String;
13
+ readonly location: S.optional<S.TaggedUnion<{
14
+ readonly File: S.TaggedStruct<"File", {
15
+ readonly path: S.String;
16
+ readonly startLine: S.Int;
17
+ }>;
18
+ readonly Generated: S.TaggedStruct<"Generated", {}>;
19
+ }>>;
20
+ }>;
21
+ //# sourceMappingURL=Source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Source.d.ts","sourceRoot":"","sources":["../Source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEpC,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAA;AACvD,eAAO,MAAM,cAAc;;;;;;EAGzB,CAAA;AAEF,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,IAAI,CAAA;AACvC,eAAO,MAAM,MAAM;;;;;;;;;EAGjB,CAAA"}
package/dist/Source.js ADDED
@@ -0,0 +1,10 @@
1
+ import { Schema as S } from "effect";
2
+ export const SourceLocation = S.TaggedUnion({
3
+ File: { path: S.String, startLine: S.Int },
4
+ Generated: {}
5
+ });
6
+ export const Source = S.Struct({
7
+ text: S.String,
8
+ location: SourceLocation.pipe(S.optional)
9
+ });
10
+ //# sourceMappingURL=Source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Source.js","sourceRoot":"","sources":["../Source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAGpC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC;IAC1C,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,EAAE;IAC1C,SAAS,EAAE,EAAE;CACd,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,IAAI,EAAE,CAAC,CAAC,MAAM;IACd,QAAQ,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;CAC1C,CAAC,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { Effect, Schema as S } from "effect";
2
+ import { DecisionModel, LanguageModel } from "effect/ai";
3
+ import { TraitsContext } from "./TraitsContext.ts";
4
+ export type TraitId = typeof TraitId.Type;
5
+ export declare const TraitId: S.brand<S.String, "traits/Trait">;
6
+ export type Trait = typeof Trait.Type;
7
+ export declare const Trait: S.Struct<{
8
+ readonly id: S.brand<S.String, "traits/Trait">;
9
+ readonly body: S.String;
10
+ }>;
11
+ export declare const checkDecomposability: (proposedTrait: string) => Effect.Effect<readonly string[], import("effect/ai/AiError").AiError, DecisionModel.DecisionModel | LanguageModel.LanguageModel | TraitsContext>;
12
+ //# sourceMappingURL=Trait.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Trait.d.ts","sourceRoot":"","sources":["../Trait.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,EAAU,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAY,aAAa,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AACzC,eAAO,MAAM,OAAO,mCAAyC,CAAA;AAE7D,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC,IAAI,CAAA;AACrC,eAAO,MAAM,KAAK;;;EAA4C,CAAA;AAE9D,eAAO,MAAM,oBAAoB,6KAuC/B,CAAA"}