@owlmeans/viable-common 0.0.32 → 0.0.34

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 (91) hide show
  1. package/README.md +3 -3
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/agent-presentation/SKILL.md +1 -1
  4. package/agent-meta/skills/viable-common/SKILL.md +109 -57
  5. package/build/ba/index.d.ts +0 -1
  6. package/build/ba/index.d.ts.map +1 -1
  7. package/build/ba/index.js +0 -1
  8. package/build/ba/index.js.map +1 -1
  9. package/build/blueprint/case.js +3 -3
  10. package/build/blueprint/consts.d.ts +38 -0
  11. package/build/blueprint/consts.d.ts.map +1 -1
  12. package/build/blueprint/consts.js +40 -0
  13. package/build/blueprint/consts.js.map +1 -1
  14. package/build/blueprint/index.d.ts +0 -3
  15. package/build/blueprint/index.d.ts.map +1 -1
  16. package/build/blueprint/index.js +0 -3
  17. package/build/blueprint/index.js.map +1 -1
  18. package/build/blueprint/types.d.ts +5 -5
  19. package/build/connect/errors.d.ts +23 -0
  20. package/build/connect/errors.d.ts.map +1 -1
  21. package/build/connect/errors.js +50 -0
  22. package/build/connect/errors.js.map +1 -1
  23. package/build/intent/consts.d.ts +57 -0
  24. package/build/intent/consts.d.ts.map +1 -0
  25. package/build/intent/consts.js +58 -0
  26. package/build/intent/consts.js.map +1 -0
  27. package/build/intent/entrypoints.d.ts +27 -0
  28. package/build/intent/entrypoints.d.ts.map +1 -0
  29. package/build/intent/entrypoints.js +28 -0
  30. package/build/intent/entrypoints.js.map +1 -0
  31. package/build/intent/errors.d.ts +20 -0
  32. package/build/intent/errors.d.ts.map +1 -0
  33. package/build/intent/errors.js +28 -0
  34. package/build/intent/errors.js.map +1 -0
  35. package/build/intent/flow.d.ts +17 -0
  36. package/build/intent/flow.d.ts.map +1 -0
  37. package/build/intent/flow.js +65 -0
  38. package/build/intent/flow.js.map +1 -0
  39. package/build/intent/index.d.ts +7 -0
  40. package/build/intent/index.d.ts.map +1 -0
  41. package/build/intent/index.js +6 -0
  42. package/build/intent/index.js.map +1 -0
  43. package/build/intent/schemas.d.ts +10 -0
  44. package/build/intent/schemas.d.ts.map +1 -0
  45. package/build/intent/schemas.js +24 -0
  46. package/build/intent/schemas.js.map +1 -0
  47. package/build/intent/types.d.ts +40 -0
  48. package/build/intent/types.d.ts.map +1 -0
  49. package/build/intent/types.js +2 -0
  50. package/build/intent/types.js.map +1 -0
  51. package/build/skills/catalogue.d.ts.map +1 -1
  52. package/build/skills/catalogue.js +15 -1
  53. package/build/skills/catalogue.js.map +1 -1
  54. package/build/skills/consts.d.ts +0 -34
  55. package/build/skills/consts.d.ts.map +1 -1
  56. package/build/skills/consts.js +0 -106
  57. package/build/skills/consts.js.map +1 -1
  58. package/build/skills/index.d.ts +0 -1
  59. package/build/skills/index.d.ts.map +1 -1
  60. package/build/skills/index.js +0 -1
  61. package/build/skills/index.js.map +1 -1
  62. package/build/skills/roles.d.ts +0 -9
  63. package/build/skills/roles.d.ts.map +1 -1
  64. package/build/skills/roles.js +0 -226
  65. package/build/skills/roles.js.map +1 -1
  66. package/package.json +18 -8
  67. package/src/ba/index.ts +0 -1
  68. package/src/blueprint/consts.ts +40 -0
  69. package/src/blueprint/index.ts +0 -3
  70. package/src/blueprint/types.ts +5 -5
  71. package/src/connect/errors.ts +55 -0
  72. package/src/intent/consts.ts +66 -0
  73. package/src/intent/entrypoints.ts +43 -0
  74. package/src/intent/errors.ts +33 -0
  75. package/src/intent/flow.ts +67 -0
  76. package/src/intent/index.ts +6 -0
  77. package/src/intent/schemas.ts +27 -0
  78. package/src/intent/types.ts +45 -0
  79. package/src/skills/consts.ts +0 -112
  80. package/src/skills/index.ts +0 -1
  81. package/src/skills/roles.ts +0 -267
  82. package/tests/blueprint.spec.ts +2 -66
  83. package/tests/connect-errors.spec.ts +31 -1
  84. package/tests/error-status.spec.ts +6 -1
  85. package/tests/intent.spec.ts +121 -0
  86. package/src/ba/schemas.ts +0 -196
  87. package/src/blueprint/case.ts +0 -320
  88. package/src/blueprint/resolve.ts +0 -136
  89. package/src/blueprint/schemas.ts +0 -44
  90. package/src/skills/catalogue.ts +0 -1850
  91. package/tests/skills.spec.ts +0 -110
@@ -1,110 +0,0 @@
1
- import { describe, expect, it } from 'bun:test'
2
-
3
- import { SKILL_ORDER, ViableSkill } from '../src/skills/consts.js'
4
- import { VIABLE_SKILLS, viableSkill } from '../src/skills/catalogue.js'
5
- import { VIABLE_PERSONAS, ViablePersona } from '../src/skills/roles.js'
6
-
7
- /**
8
- * Pins the catalogue's own "wrap exactly once" teaching — the incident this guards against was
9
- * the catalogue itself showing a handler module that wraps itself (`OwlMeansServer`), while the
10
- * deterministic stampers and every OTHER skill always wrap again at the binding site. Both halves
11
- * have to agree, or a coder reading both produces exactly the double wrap that made every request
12
- * to a "completed" story fail with `TypeError: handler is not a function`.
13
- */
14
- describe('viable-common catalogue — handler wrap-once', () => {
15
- it('OwlMeansServer shows a plain handler module, the single wrap at bind, and the WRONG double wrap', () => {
16
- const body = viableSkill(ViableSkill.OwlMeansServer).body
17
-
18
- expect(body).toContain('handleTaskCreate')
19
- expect(body).toContain('api.body(protocols.api.task.create, handleTaskCreate)')
20
- expect(body).toContain('WRONG')
21
- expect(body).toContain('BoundEntrypointHandler')
22
- expect(body).toContain('handler is not a function')
23
- })
24
-
25
- it('WorkerJobs §3 does not say the processor module itself calls handlers()', () => {
26
- const body = viableSkill(ViableSkill.WorkerJobs).body
27
-
28
- expect(body).not.toContain('created with `handlers<Context>()`')
29
- expect(body).toContain('PLAIN exported async function')
30
- expect(body).toContain('WRONG')
31
- expect(body).toContain('handleReportBuildJob')
32
- })
33
-
34
- it('FixerHeuristics reads a double-wrapped binding and a wrong-extension package specifier', () => {
35
- const body = viableSkill(ViableSkill.FixerHeuristics).body
36
-
37
- expect(body).toContain('BoundEntrypointHandler')
38
- expect(body).toContain('TWICE')
39
- expect(body).toContain("project-common/")
40
- expect(body).toContain("project-backend/")
41
- })
42
-
43
- it('OwlmeansContext and OwlmeansState show no project-common/project-backend deep import with an extension', () => {
44
- for (const alias of [ViableSkill.OwlmeansContext, ViableSkill.OwlmeansState]) {
45
- expect(viableSkill(alias).body).not.toMatch(/project-(?:common|backend)\/[^\s'"`]*\.(?:js|type)\b/)
46
- }
47
- })
48
- })
49
-
50
- /**
51
- * The prompt service SKIPS an alias it cannot resolve, so a skill in the enum with no body is a
52
- * rule no model ever receives — nothing fails, the prompt simply lacks it.
53
- */
54
- describe('viable-common catalogue — completeness', () => {
55
- it('declares one body and one sort weight for every skill in the enum', () => {
56
- const declared = VIABLE_SKILLS.map(entry => entry.alias)
57
-
58
- expect(Object.values(ViableSkill).filter(alias => !declared.includes(alias))).toEqual([])
59
- expect(new Set(declared).size).toBe(declared.length)
60
- for (const alias of Object.values(ViableSkill)) {
61
- expect(typeof SKILL_ORDER[alias], alias).toBe('number')
62
- }
63
- })
64
- })
65
-
66
- /**
67
- * The house style is taught in two places a designer and a coder read — the visual designer's
68
- * persona and the shadcn skill — and a template ships the same values. Neither may drift back
69
- * to teaching the decoration the template now paints flat.
70
- */
71
- describe('viable-common catalogue — the house style', () => {
72
- it('ShadcnUi teaches the white ground, one accent and flat depth, and repaints the old classes', () => {
73
- const body = viableSkill(ViableSkill.ShadcnUi).body
74
-
75
- expect(body).toContain('bg-background')
76
- expect(body).toContain('ONE product accent')
77
- expect(body).toContain('shadow-floating')
78
- expect(body).toContain('REPAINTED flat')
79
- expect(body).toContain('explicitly asks')
80
- expect(body).not.toContain('DECORATION VOCABULARY')
81
- expect(body).not.toMatch(/\/\/ right[^\n]*gradient/)
82
- expect(body).toContain('SelectItem')
83
- })
84
-
85
- it('the visual designer defaults to the house style and changes it only on an explicit ask', () => {
86
- const role = VIABLE_PERSONAS[ViablePersona.VisualDesigner].role
87
-
88
- expect(role).toContain('white ground')
89
- expect(role).toContain('ONE')
90
- expect(role).toContain('explicitly asks')
91
- expect(role).not.toContain('expressive and bright')
92
- expect(role).not.toMatch(/default to .*gradients/)
93
- })
94
-
95
- it('LandingGate teaches the gate card, the synchronous handoff and the screen that reads it', () => {
96
- const body = viableSkill(ViableSkill.LandingGate).body
97
-
98
- expect(body).toContain('data-home-gate')
99
- expect(body).toContain('aria-pressed')
100
- expect(body).toContain('useLandingStart(target)')
101
- expect(body).toContain('useLandingContinuation')
102
- expect(body).toContain('readLandingHandoff')
103
- expect(body).toContain('clearLandingHandoff()')
104
- // Named only as the thing NOT to do: its continuation lands on the guarded screen.
105
- expect(body).toContain('NEVER `useLogin(target)`')
106
- expect(body).toContain('SYNCHRONOUS')
107
- expect(body).toContain('WRONG')
108
- expect(body).not.toContain('${')
109
- })
110
- })