@owlmeans/viable-common 0.0.33 → 0.0.35

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 (97) 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 +93 -62
  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/consts.d.ts +38 -0
  10. package/build/blueprint/consts.d.ts.map +1 -1
  11. package/build/blueprint/consts.js +40 -0
  12. package/build/blueprint/consts.js.map +1 -1
  13. package/build/blueprint/index.d.ts +0 -3
  14. package/build/blueprint/index.d.ts.map +1 -1
  15. package/build/blueprint/index.js +0 -3
  16. package/build/blueprint/index.js.map +1 -1
  17. package/build/blueprint/types.d.ts +5 -5
  18. package/build/intent/consts.d.ts +57 -0
  19. package/build/intent/consts.d.ts.map +1 -0
  20. package/build/intent/consts.js +58 -0
  21. package/build/intent/consts.js.map +1 -0
  22. package/build/intent/entrypoints.d.ts +27 -0
  23. package/build/intent/entrypoints.d.ts.map +1 -0
  24. package/build/intent/entrypoints.js +28 -0
  25. package/build/intent/entrypoints.js.map +1 -0
  26. package/build/intent/errors.d.ts +20 -0
  27. package/build/intent/errors.d.ts.map +1 -0
  28. package/build/intent/errors.js +28 -0
  29. package/build/intent/errors.js.map +1 -0
  30. package/build/intent/flow.d.ts +17 -0
  31. package/build/intent/flow.d.ts.map +1 -0
  32. package/build/intent/flow.js +65 -0
  33. package/build/intent/flow.js.map +1 -0
  34. package/build/intent/index.d.ts +7 -0
  35. package/build/intent/index.d.ts.map +1 -0
  36. package/build/intent/index.js +6 -0
  37. package/build/intent/index.js.map +1 -0
  38. package/build/intent/schemas.d.ts +10 -0
  39. package/build/intent/schemas.d.ts.map +1 -0
  40. package/build/intent/schemas.js +24 -0
  41. package/build/intent/schemas.js.map +1 -0
  42. package/build/intent/types.d.ts +40 -0
  43. package/build/intent/types.d.ts.map +1 -0
  44. package/build/intent/types.js +2 -0
  45. package/build/intent/types.js.map +1 -0
  46. package/build/scaffold/consts.d.ts +14 -1
  47. package/build/scaffold/consts.d.ts.map +1 -1
  48. package/build/scaffold/consts.js +10 -0
  49. package/build/scaffold/consts.js.map +1 -1
  50. package/build/scaffold/schemas.d.ts +7 -0
  51. package/build/scaffold/schemas.d.ts.map +1 -1
  52. package/build/scaffold/schemas.js +119 -68
  53. package/build/scaffold/schemas.js.map +1 -1
  54. package/build/scaffold/types.d.ts +62 -24
  55. package/build/scaffold/types.d.ts.map +1 -1
  56. package/build/skills/consts.d.ts +0 -34
  57. package/build/skills/consts.d.ts.map +1 -1
  58. package/build/skills/consts.js +0 -106
  59. package/build/skills/consts.js.map +1 -1
  60. package/build/skills/index.d.ts +0 -1
  61. package/build/skills/index.d.ts.map +1 -1
  62. package/build/skills/index.js +0 -1
  63. package/build/skills/index.js.map +1 -1
  64. package/build/skills/roles.d.ts +0 -9
  65. package/build/skills/roles.d.ts.map +1 -1
  66. package/build/skills/roles.js +0 -226
  67. package/build/skills/roles.js.map +1 -1
  68. package/build/ux/schemas.js +2 -2
  69. package/build/ux/schemas.js.map +1 -1
  70. package/package.json +17 -7
  71. package/src/ba/index.ts +0 -1
  72. package/src/blueprint/consts.ts +40 -0
  73. package/src/blueprint/index.ts +0 -3
  74. package/src/blueprint/types.ts +5 -5
  75. package/src/intent/consts.ts +66 -0
  76. package/src/intent/entrypoints.ts +43 -0
  77. package/src/intent/errors.ts +33 -0
  78. package/src/intent/flow.ts +67 -0
  79. package/src/intent/index.ts +6 -0
  80. package/src/intent/schemas.ts +27 -0
  81. package/src/intent/types.ts +45 -0
  82. package/src/scaffold/consts.ts +14 -1
  83. package/src/scaffold/schemas.ts +125 -69
  84. package/src/scaffold/types.ts +64 -23
  85. package/src/skills/consts.ts +0 -112
  86. package/src/skills/index.ts +0 -1
  87. package/src/skills/roles.ts +0 -267
  88. package/src/ux/schemas.ts +2 -2
  89. package/tests/blueprint.spec.ts +2 -66
  90. package/tests/intent.spec.ts +121 -0
  91. package/tests/scaffold.spec.ts +73 -13
  92. package/src/ba/schemas.ts +0 -196
  93. package/src/blueprint/case.ts +0 -320
  94. package/src/blueprint/resolve.ts +0 -136
  95. package/src/blueprint/schemas.ts +0 -44
  96. package/src/skills/catalogue.ts +0 -1864
  97. package/tests/skills.spec.ts +0 -125
@@ -1,125 +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('OwlMeansServer types a handler with the shared type its protocol declares, never an invented payload type', () => {
44
- const body = viableSkill(ViableSkill.OwlMeansServer).body
45
-
46
- expect(body).not.toContain('TaskCreatePayload')
47
- expect(body).toContain('payload: Task, ctx: Context')
48
- expect(body).toContain('The PROTOCOL decides the handler\'s types')
49
- })
50
-
51
- it('FixerHeuristics repairs a handler/protocol mismatch in the HANDLER, never in the declaration', () => {
52
- const body = viableSkill(ViableSkill.FixerHeuristics).body
53
-
54
- expect(body).toContain('HANDLER disagreeing with its protocol')
55
- expect(body).toContain('Never edit the declaration toward the handler')
56
- })
57
-
58
- it('OwlmeansContext and OwlmeansState show no project-common/project-backend deep import with an extension', () => {
59
- for (const alias of [ViableSkill.OwlmeansContext, ViableSkill.OwlmeansState]) {
60
- expect(viableSkill(alias).body).not.toMatch(/project-(?:common|backend)\/[^\s'"`]*\.(?:js|type)\b/)
61
- }
62
- })
63
- })
64
-
65
- /**
66
- * The prompt service SKIPS an alias it cannot resolve, so a skill in the enum with no body is a
67
- * rule no model ever receives — nothing fails, the prompt simply lacks it.
68
- */
69
- describe('viable-common catalogue — completeness', () => {
70
- it('declares one body and one sort weight for every skill in the enum', () => {
71
- const declared = VIABLE_SKILLS.map(entry => entry.alias)
72
-
73
- expect(Object.values(ViableSkill).filter(alias => !declared.includes(alias))).toEqual([])
74
- expect(new Set(declared).size).toBe(declared.length)
75
- for (const alias of Object.values(ViableSkill)) {
76
- expect(typeof SKILL_ORDER[alias], alias).toBe('number')
77
- }
78
- })
79
- })
80
-
81
- /**
82
- * The house style is taught in two places a designer and a coder read — the visual designer's
83
- * persona and the shadcn skill — and a template ships the same values. Neither may drift back
84
- * to teaching the decoration the template now paints flat.
85
- */
86
- describe('viable-common catalogue — the house style', () => {
87
- it('ShadcnUi teaches the white ground, one accent and flat depth, and repaints the old classes', () => {
88
- const body = viableSkill(ViableSkill.ShadcnUi).body
89
-
90
- expect(body).toContain('bg-background')
91
- expect(body).toContain('ONE product accent')
92
- expect(body).toContain('shadow-floating')
93
- expect(body).toContain('REPAINTED flat')
94
- expect(body).toContain('explicitly asks')
95
- expect(body).not.toContain('DECORATION VOCABULARY')
96
- expect(body).not.toMatch(/\/\/ right[^\n]*gradient/)
97
- expect(body).toContain('SelectItem')
98
- })
99
-
100
- it('the visual designer defaults to the house style and changes it only on an explicit ask', () => {
101
- const role = VIABLE_PERSONAS[ViablePersona.VisualDesigner].role
102
-
103
- expect(role).toContain('white ground')
104
- expect(role).toContain('ONE')
105
- expect(role).toContain('explicitly asks')
106
- expect(role).not.toContain('expressive and bright')
107
- expect(role).not.toMatch(/default to .*gradients/)
108
- })
109
-
110
- it('LandingGate teaches the gate card, the synchronous handoff and the screen that reads it', () => {
111
- const body = viableSkill(ViableSkill.LandingGate).body
112
-
113
- expect(body).toContain('data-home-gate')
114
- expect(body).toContain('aria-pressed')
115
- expect(body).toContain('useLandingStart(target)')
116
- expect(body).toContain('useLandingContinuation')
117
- expect(body).toContain('readLandingHandoff')
118
- expect(body).toContain('clearLandingHandoff()')
119
- // Named only as the thing NOT to do: its continuation lands on the guarded screen.
120
- expect(body).toContain('NEVER `useLogin(target)`')
121
- expect(body).toContain('SYNCHRONOUS')
122
- expect(body).toContain('WRONG')
123
- expect(body).not.toContain('${')
124
- })
125
- })