rhachet-roles-bhrain 0.2.0 → 0.3.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.
Files changed (130) hide show
  1. package/dist/.test/getContextOpenAI.js +1 -1
  2. package/dist/.test/getContextOpenAI.js.map +1 -1
  3. package/dist/domain.operations/review/compileReviewPrompt.d.ts +22 -0
  4. package/dist/domain.operations/review/compileReviewPrompt.js +95 -0
  5. package/dist/domain.operations/review/compileReviewPrompt.js.map +1 -0
  6. package/dist/domain.operations/review/enumFilesFromDiffs.d.ts +8 -0
  7. package/dist/domain.operations/review/enumFilesFromDiffs.js +74 -0
  8. package/dist/domain.operations/review/enumFilesFromDiffs.js.map +1 -0
  9. package/dist/domain.operations/review/enumFilesFromGlob.d.ts +8 -0
  10. package/dist/domain.operations/review/enumFilesFromGlob.js +31 -0
  11. package/dist/domain.operations/review/enumFilesFromGlob.js.map +1 -0
  12. package/dist/domain.operations/review/estimateTokenCount.d.ts +9 -0
  13. package/dist/domain.operations/review/estimateTokenCount.js +20 -0
  14. package/dist/domain.operations/review/estimateTokenCount.js.map +1 -0
  15. package/dist/domain.operations/review/formatReviewOutput.d.ts +14 -0
  16. package/dist/domain.operations/review/formatReviewOutput.js +42 -0
  17. package/dist/domain.operations/review/formatReviewOutput.js.map +1 -0
  18. package/dist/domain.operations/review/genTokenBreakdownMarkdown.d.ts +19 -0
  19. package/dist/domain.operations/review/genTokenBreakdownMarkdown.js +110 -0
  20. package/dist/domain.operations/review/genTokenBreakdownMarkdown.js.map +1 -0
  21. package/dist/domain.operations/review/genTokenBreakdownReport.d.ts +24 -0
  22. package/dist/domain.operations/review/genTokenBreakdownReport.js +64 -0
  23. package/dist/domain.operations/review/genTokenBreakdownReport.js.map +1 -0
  24. package/dist/domain.operations/review/invokeClaudeCode.d.ts +22 -0
  25. package/dist/domain.operations/review/invokeClaudeCode.js +92 -0
  26. package/dist/domain.operations/review/invokeClaudeCode.js.map +1 -0
  27. package/dist/domain.operations/review/writeInputArtifacts.d.ts +27 -0
  28. package/dist/domain.operations/review/writeInputArtifacts.js +50 -0
  29. package/dist/domain.operations/review/writeInputArtifacts.js.map +1 -0
  30. package/dist/domain.operations/review/writeOutputArtifacts.d.ts +12 -0
  31. package/dist/domain.operations/review/writeOutputArtifacts.js +46 -0
  32. package/dist/domain.operations/review/writeOutputArtifacts.js.map +1 -0
  33. package/dist/roles/getRoleRegistry.js +2 -1
  34. package/dist/roles/getRoleRegistry.js.map +1 -1
  35. package/dist/roles/getRoleRegistry.readme.js +6 -0
  36. package/dist/roles/getRoleRegistry.readme.js.map +1 -1
  37. package/dist/roles/reviewer/briefs/review.tactics.md +60 -0
  38. package/dist/roles/reviewer/getReviewerRole.d.ts +6 -0
  39. package/dist/roles/reviewer/getReviewerRole.js +80 -0
  40. package/dist/roles/reviewer/getReviewerRole.js.map +1 -0
  41. package/dist/roles/reviewer/skills/review/review.d.ts +57 -0
  42. package/dist/roles/reviewer/skills/review/review.js +445 -0
  43. package/dist/roles/reviewer/skills/review/review.js.map +1 -0
  44. package/dist/roles/reviewer/skills/review/review.sh +21 -0
  45. package/dist/roles/reviewer/skills/review/review.ts +575 -0
  46. package/dist/roles/thinker/getThinkerRole.js +1 -1
  47. package/dist/roles/thinker/getThinkerRole.js.map +1 -1
  48. package/dist/roles/thinker/skills/brief.articulate/.demo/article.vision.v2025_08_19..i1.via_chatgpt.md +47 -0
  49. package/dist/roles/thinker/skills/brief.articulate/.demo/article.vision.v2025_08_19.i2.via_rhachet.md +60 -0
  50. package/dist/roles/thinker/skills/brief.articulate/.demo/diverge.v2025_08_17.i1.md +62 -0
  51. package/dist/roles/thinker/skills/brief.articulate/.demo/diverge.v2025_08_17.i1.with_feedback.md +89 -0
  52. package/dist/roles/thinker/skills/brief.articulate/.demo/diverge.v2025_08_17.i2.md +47 -0
  53. package/dist/roles/thinker/skills/brief.articulate/.demo/joke.v2025_08_15.i1.md +44 -0
  54. package/dist/roles/thinker/skills/brief.articulate/.demo/joke.v2025_08_15.i2.md +63 -0
  55. package/dist/roles/thinker/skills/brief.articulate/.demo/joke.v2025_08_15.i3.md +51 -0
  56. package/dist/roles/thinker/skills/brief.articulate/.demo/user-journey.v2025_08_17.i1.md +62 -0
  57. package/dist/roles/thinker/skills/brief.articulate/.demo/user-journey.v2025_08_17.i2.md +49 -0
  58. package/dist/roles/thinker/skills/brief.articulate/.readme.md +0 -0
  59. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.skill.js +1 -1
  60. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.skill.js.map +1 -1
  61. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.skill.ts +168 -0
  62. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.ts +157 -0
  63. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_08_28.i1.md +93 -0
  64. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_08_28.i2.md +84 -0
  65. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_09_28.i1.no_focus_context.md +8 -0
  66. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_09_28.i2.md +54 -0
  67. package/dist/roles/thinker/skills/brief.catalogize/.demo/persona.usecases.v2025_08_28.i1.md +62 -0
  68. package/dist/roles/thinker/skills/brief.catalogize/.demo/persona.usecases.v2025_08_28.i2.md +64 -0
  69. package/dist/roles/thinker/skills/brief.catalogize/.readme.md +5 -0
  70. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.skill.js +1 -1
  71. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.skill.js.map +1 -1
  72. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.skill.ts +173 -0
  73. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.ts +132 -0
  74. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.i4.md +3 -0
  75. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.i5.md +3 -0
  76. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.i6.md +3 -0
  77. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.md +3 -0
  78. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i1.md +52 -0
  79. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i2.md +51 -0
  80. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i3.md +47 -0
  81. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i4.md +62 -0
  82. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i5.md +47 -0
  83. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i6.md +53 -0
  84. package/dist/roles/thinker/skills/brief.demonstrate/.readme +3 -0
  85. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.skill.js +1 -1
  86. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.skill.js.map +1 -1
  87. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.skill.ts +190 -0
  88. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.ts +164 -0
  89. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i1.md +72 -0
  90. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i2.md +53 -0
  91. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i3.which_objectives.md +58 -0
  92. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i5.which_personas.md +64 -0
  93. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input2.cluster.v2025_08_17.i1.md +67 -0
  94. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input2.cluster.v2025_08_17.i2.md +49 -0
  95. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input2.cluster.v2025_08_17.i3.md +59 -0
  96. package/dist/roles/thinker/skills/khue.cluster/.readme.md +0 -0
  97. package/dist/roles/thinker/skills/khue.cluster/stepCluster.skill.js +1 -1
  98. package/dist/roles/thinker/skills/khue.cluster/stepCluster.skill.js.map +1 -1
  99. package/dist/roles/thinker/skills/khue.cluster/stepCluster.skill.ts +174 -0
  100. package/dist/roles/thinker/skills/khue.cluster/stepCluster.ts +150 -0
  101. package/dist/roles/thinker/skills/khue.decompose/.readme.md +9 -0
  102. package/dist/roles/thinker/skills/khue.diverge/.demo/joke.examples.v2025_08_17.i2.md +23 -0
  103. package/dist/roles/thinker/skills/khue.diverge/.demo/joke.examples.v2025_08_17.i3.md +23 -0
  104. package/dist/roles/thinker/skills/khue.diverge/.demo/joke.varieties.v2025_08_17.i1.md +23 -0
  105. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i1.md +9 -0
  106. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i2.md +9 -0
  107. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i3.md +23 -0
  108. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i4.folksy.md +9 -0
  109. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i5.folksy.md +23 -0
  110. package/dist/roles/thinker/skills/khue.diverge/.readme.md +0 -0
  111. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.skill.js +1 -1
  112. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.skill.js.map +1 -1
  113. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.skill.ts +149 -0
  114. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.ts +151 -0
  115. package/dist/roles/thinker/skills/khue.encompose/.readme.md +7 -0
  116. package/dist/roles/thinker/skills/khue.instantiate/.readme.md +14 -0
  117. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.skill.js +1 -1
  118. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.skill.js.map +1 -1
  119. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.skill.ts +190 -0
  120. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.ts +132 -0
  121. package/dist/roles/thinker/skills/khue.triage/.demo/laughs.v2025_08_18.i1.md +29 -0
  122. package/dist/roles/thinker/skills/khue.triage/.demo/user.journeys.v2025_08_17.i1.md +86 -0
  123. package/dist/roles/thinker/skills/khue.triage/.demo/user.journeys.v2025_08_17.i2.md +68 -0
  124. package/dist/roles/thinker/skills/khue.triage/.readme.md +0 -0
  125. package/dist/roles/thinker/skills/khue.triage/stepTriage.skill.js +1 -1
  126. package/dist/roles/thinker/skills/khue.triage/stepTriage.skill.js.map +1 -1
  127. package/dist/roles/thinker/skills/khue.triage/stepTriage.skill.ts +174 -0
  128. package/dist/roles/thinker/skills/khue.triage/stepTriage.ts +153 -0
  129. package/package.json +7 -6
  130. package/readme.md +55 -0
@@ -0,0 +1,67 @@
1
+ [
2
+ {
3
+ "label": "Digital Education and Learning",
4
+ "members": [
5
+ "A student using an online learning platform to complete daily algebra exercises.",
6
+ "A yoga practitioner following an online video series for daily sessions.",
7
+ "A traveler using a language app daily to build vocabulary before a trip.",
8
+ "A high school student organizing study schedules and assignment deadlines in a planner app."
9
+ ],
10
+ "rationale": "These concepts involve individuals using digital platforms to enhance or facilitate their learning and education processes."
11
+ },
12
+ {
13
+ "label": "Health and Fitness Tracking",
14
+ "members": [
15
+ "A customer's morning routine as they use their smartwatch to track steps.",
16
+ "A fitness enthusiast booking classes and tracking goals in a workout app."
17
+ ],
18
+ "rationale": "These scenarios involve the use of technology to monitor and improve personal health and fitness activities."
19
+ },
20
+ {
21
+ "label": "Digital Organization and Productivity",
22
+ "members": [
23
+ "An influencer planning photo shoots and posting schedules with a content calendar app.",
24
+ "An event organizer sending out e-invites and tracking RSVPs through an event app.",
25
+ "A babysitter logging hours and generating invoices via a babysitting service app.",
26
+ "A small business owner managing orders and inventory via an online platform.",
27
+ "A high school student organizing study schedules and assignment deadlines in a planner app."
28
+ ],
29
+ "rationale": "These entries involve using technology to organize tasks, schedules, and manage productivity across different contexts."
30
+ },
31
+ {
32
+ "label": "Home and Lifestyle Apps",
33
+ "members": [
34
+ "A parent navigating a grocery store app to build their weekly shopping list.",
35
+ "A new pet owner researching breed-specific care tips on a vet's website.",
36
+ "A gardener logging plant growth in a digital garden journal app.",
37
+ "A home cook using a meal kit service website to pick new recipes.",
38
+ "A cafe regular pre-ordering their daily coffee through a mobile app."
39
+ ],
40
+ "rationale": "These situations revolve around individuals using apps to manage and enhance their home, lifestyle, or everyday activities."
41
+ },
42
+ {
43
+ "label": "Travel and Exploration",
44
+ "members": [
45
+ "A road tripper planning a route with a digital map for scenic stops.",
46
+ "A traveler using a language app daily to build vocabulary before a trip.",
47
+ "An environmentalist tracking local wildlife sightings with a citizen science app."
48
+ ],
49
+ "rationale": "These concepts focus on individuals using technology to assist in travel planning, exploration, and discovery of new experiences."
50
+ },
51
+ {
52
+ "label": "Entertainment and Media",
53
+ "members": [
54
+ "A commuter reading news headlines on their phone while on the train.",
55
+ "A music lover exploring new playlists and artists on a streaming service."
56
+ ],
57
+ "rationale": "These entries involve consuming digital media and entertainment using mobile or online services."
58
+ },
59
+ {
60
+ "label": "DIY and Practical Skills",
61
+ "members": [
62
+ "A DIY enthusiast following step-by-step guides on a home improvement site.",
63
+ "A gardener logging plant growth in a digital garden journal app."
64
+ ],
65
+ "rationale": "These scenarios involve individuals using technology to assist in learning and applying practical skills related to DIY activities."
66
+ }
67
+ ]
@@ -0,0 +1,49 @@
1
+ [
2
+ {
3
+ "label": "Personal Organization",
4
+ "members": [
5
+ "A high school student organizing study schedules and assignment deadlines in a planner app.",
6
+ "An influencer planning photo shoots and posting schedules with a content calendar app.",
7
+ "A babysitter logging hours and generating invoices via a babysitting service app.",
8
+ "A small business owner managing orders and inventory via an online platform.",
9
+ "An event organizer sending out e-invites and tracking RSVPs through an event app."
10
+ ],
11
+ "rationale": "These concepts revolve around managing personal tasks and schedules using digital tools, highlighting organizational needs in various contexts."
12
+ },
13
+ {
14
+ "label": "Health and Fitness",
15
+ "members": [
16
+ "A customer's morning routine as they use their smartwatch to track steps.",
17
+ "A fitness enthusiast booking classes and tracking goals in a workout app.",
18
+ "A yoga practitioner following an online video series for daily sessions."
19
+ ],
20
+ "rationale": "These concepts focus on personal health and fitness routines supported by technology, indicating a trend of integrating digital tools to enhance physical well-being."
21
+ },
22
+ {
23
+ "label": "Educational and Learning Platforms",
24
+ "members": [
25
+ "A student using an online learning platform to complete daily algebra exercises.",
26
+ "A traveler using a language app daily to build vocabulary before a trip.",
27
+ "A book lover cataloging and reviewing recent reads in a book community app."
28
+ ],
29
+ "rationale": "These concepts explore the use of digital platforms for learning and education, emphasizing continuous self-improvement and skill development."
30
+ },
31
+ {
32
+ "label": "Shopping and Consumption",
33
+ "members": [
34
+ "A parent navigating a grocery store app to build their weekly shopping list.",
35
+ "A home cook using a meal kit service website to pick new recipes.",
36
+ "A cafe regular pre-ordering their daily coffee through a mobile app."
37
+ ],
38
+ "rationale": "These concepts highlight consumer habits and routines facilitated by digital applications, focusing on convenience and efficiency in shopping and meal preparation."
39
+ },
40
+ {
41
+ "label": "Exploration and Travel",
42
+ "members": [
43
+ "A road tripper planning a route with a digital map for scenic stops.",
44
+ "A traveler using a language app daily to build vocabulary before a trip.",
45
+ "An environmentalist tracking local wildlife sightings with a citizen science app."
46
+ ],
47
+ "rationale": "These concepts involve exploration and travel, either through planning journeys or understanding the environment, supported by digital tools to enhance the experience."
48
+ }
49
+ ]
@@ -0,0 +1,59 @@
1
+ [
2
+ {
3
+ "label": "Daily Planning and Organization",
4
+ "members": [
5
+ "A parent navigating a grocery store app to build their weekly shopping list.",
6
+ "A home cook using a meal kit service website to pick new recipes.",
7
+ "An influencer planning photo shoots and posting schedules with a content calendar app.",
8
+ "An event organizer sending out e-invites and tracking RSVPs through an event app.",
9
+ "A babysitter logging hours and generating invoices via a babysitting service app.",
10
+ "A high school student organizing study schedules and assignment deadlines in a planner app."
11
+ ],
12
+ "rationale": "These concepts revolve around the use of digital tools for planning, scheduling, and organizing daily tasks, showcasing the integration of technology in routine management."
13
+ },
14
+ {
15
+ "label": "Health and Fitness Tracking",
16
+ "members": [
17
+ "A customer's morning routine as they use their smartwatch to track steps.",
18
+ "A fitness enthusiast booking classes and tracking goals in a workout app.",
19
+ "A yoga practitioner following an online video series for daily sessions."
20
+ ],
21
+ "rationale": "These scenarios involve individuals utilizing digital platforms and devices to monitor and enhance their physical wellness, highlighting the intersection of technology and personal health management."
22
+ },
23
+ {
24
+ "label": "Learning and Skill Development",
25
+ "members": [
26
+ "A student using an online learning platform to complete daily algebra exercises.",
27
+ "A traveler using a language app daily to build vocabulary before a trip.",
28
+ "A DIY enthusiast following step-by-step guides on a home improvement site.",
29
+ "A book lover cataloging and reviewing recent reads in a book community app."
30
+ ],
31
+ "rationale": "These activities focus on using digital resources to acquire new knowledge and skills, reflecting the educational potential of digital applications across various interests and needs."
32
+ },
33
+ {
34
+ "label": "Exploration and Tracking",
35
+ "members": [
36
+ "A road tripper planning a route with a digital map for scenic stops.",
37
+ "An environmentalist tracking local wildlife sightings with a citizen science app.",
38
+ "A gardener logging plant growth in a digital garden journal app."
39
+ ],
40
+ "rationale": "These examples depict the use of digital tools to explore, document, and track outdoor activities and observations, which emphasizes technology's role in enhancing exploration and environmental awareness."
41
+ },
42
+ {
43
+ "label": "Lifestyle and Entertainment",
44
+ "members": [
45
+ "A cafe regular pre-ordering their daily coffee through a mobile app.",
46
+ "A music lover exploring new playlists and artists on a streaming service.",
47
+ "A commuter reading news headlines on their phone while on the train."
48
+ ],
49
+ "rationale": "These scenarios illustrate the integration of technology into everyday lifestyle and leisure activities, demonstrating how digital solutions facilitate convenience and access to entertainment and information on-the-go."
50
+ },
51
+ {
52
+ "label": "Business and Commerce Management",
53
+ "members": [
54
+ "A new pet owner researching breed-specific care tips on a vet's website.",
55
+ "A small business owner managing orders and inventory via an online platform."
56
+ ],
57
+ "rationale": "Both cases involve the use of digital platforms for managing business-related and commerce activities, reflecting technology's role in supporting small businesses and niche markets."
58
+ }
59
+ ]
@@ -108,7 +108,7 @@ exports.SKILL_CLUSTER = (0, rhachet_1.genRoleSkill)({
108
108
  lookup: {
109
109
  apiKeyOpenai: {
110
110
  source: 'process.env',
111
- envar: 'PREP_OPENAI_KEY',
111
+ envar: 'OPENAI_API_KEY',
112
112
  desc: 'the openai key to use',
113
113
  type: 'string',
114
114
  },
@@ -1 +1 @@
1
- {"version":3,"file":"stepCluster.skill.js","sourceRoot":"","sources":["../../../../../src/roles/thinker/skills/khue.cluster/stepCluster.skill.ts"],"names":[],"mappings":";;;AAAA,qCAAqD;AACrD,+DAA6E;AAE7E,sEAAmE;AACnE,4EAAyE;AACzE,kEAA+D;AAE/D,+CAAgE;AAEnD,QAAA,aAAa,GAAG,IAAA,sBAAY,EAAC;IACxC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,yBAAW;IAClB,OAAO,EAAE;QACP,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,MAAM,EAAE,cAAc;gBACtB,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,kCAAkC;gBACxC,IAAI,EAAE,QAAQ;aACf;YACD,KAAK,EAAE;gBACL,MAAM,EAAE,cAAc;gBACtB,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,6BAA6B;gBACnC,IAAI,EAAE,QAAQ;aACf;YACD,IAAI,EAAE;gBACJ,MAAM,EAAE,cAAc;gBACtB,IAAI,EAAE,GAAG;gBACT,IAAI,EAAE,yBAAyB;gBAC/B,IAAI,EAAE,SAAS;aAChB;YACD,UAAU,EAAE;gBACV,MAAM,EAAE,cAAc;gBACtB,IAAI,EAAE,GAAG;gBACT,IAAI,EA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EAAE,EAAE;wBACP,GAAG,EAAE;4BACH,mBAAmB,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO;4BAC3C,mBAAmB,EAAE,SAAS,CAAC,IAAI,CAAC,OAAO;4BAC3C,oBAAoB,EAAE,SAAS,CAAC,KAAK;4BACrC,QAAQ,EAAE,SAAS,CAAC,QAAQ;yBAC7B;wBACD,IAAI,EAAE,SAAS,CAAC,UAAU;qBAC3B;iBACF,CAAC;gBACF,OAAO,EAAE,MAAM,IAAA,sBAAY,EAAC;oBAC1B,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE;wBACL,GAAG,EAAE;4BACH,eAAe,EAAE,SAAS,CAAC,eAAe,CAAC;4BAC3C,eAAe,EAAE,SAAS,CAAC,eAAe,CAAC;yBAC5C;wBACD,MAAM,EAAE;4BACN,GAAG,SAAS,CAAC,MAAM;4BACnB,GAAG,gCAAkB,EAAE,oJAAoJ;yBAC5K;qBACF;iBACF,CAAC;aACH,CAAC;QACJ,CAAC;KACF;IACD,OAAO,EAAE;QACP,MAAM,EAAE;YACN,YAAY,EAAE;gBACZ,MAAM,EAAE,aAAa;gBACrB,KAAK,EAAE,iBAAiB;gBACxB,IAAI,EAAE,uBAAuB;gBAC7B,IAAI,EAAE,QAAQ;aACf;SACF;QACD,MAAM,EAAE,CAAC,KAAK,EAAqC,EAAE,CACnD,OAAO,KAAK,CAAC,YAAY,KAAK,QAAQ;QACxC,WAAW,EAAE,GAAG,EAAE;YAChB,OAAO;gBACL,GAAG,IAAA,mCAAgB,GAAE;gBACrB,GAAG,IAAA,uCAAkB,GAAE;gBACvB,GAAG,IAAA,6CAAqB,GAAE;aAC3B,CAAC;QACJ,CAAC;KACF;IACD,MAAM,EAAE,EAAE;CACX,CAAC,CAAC"}
1
+ {"version":3,"file":"stepCluster.skill.js","sourceRoot":"","sources":["../../../../../src/roles/thinker/skills/khue.cluster/stepCluster.skill.ts"],"names":[],"mappings":";;;AAAA,qCAAqD;AACrD,+DAA6E;AAE7E,sE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AC;QACJ,CAAC;KACF;IACD,OAAO,EAAE;QACP,MAAM,EAAE;YACN,YAAY,EAAE;gBACZ,MAAM,EAAE,aAAa;gBACrB,KAAK,EAAE,gBAAgB;gBACvB,IAAI,EAAE,uBAAuB;gBAC7B,IAAI,EAAE,QAAQ;aACf;SACF;QACD,MAAM,EAAE,CAAC,KAAK,EAAqC,EAAE,CACnD,OAAO,KAAK,CAAC,YAAY,KAAK,QAAQ;QACxC,WAAW,EAAE,GAAG,EAAE;YAChB,OAAO;gBACL,GAAG,IAAA,mCAAgB,GAAE;gBACrB,GAAG,IAAA,uCAAkB,GAAE;gBACvB,GAAG,IAAA,6CAAqB,GAAE;aAC3B,CAAC;QACJ,CAAC;KACF;IACD,MAAM,EAAE,EAAE;CACX,CAAC,CAAC"}
@@ -0,0 +1,174 @@
1
+ import { enrollThread, genRoleSkill } from 'rhachet';
2
+ import { genArtifactGitFile, getArtifactObsDir } from 'rhachet-artifact-git';
3
+
4
+ import { genContextLogTrail } from '@src/.test/genContextLogTrail';
5
+ import { genContextStitchTrail } from '@src/.test/genContextStitchTrail';
6
+ import { getContextOpenAI } from '@src/.test/getContextOpenAI';
7
+
8
+ import { BRIEFS_FOR_CLUSTER, loopCluster } from './stepCluster';
9
+
10
+ export const SKILL_CLUSTER = genRoleSkill({
11
+ slug: 'cluster',
12
+ route: loopCluster,
13
+ threads: {
14
+ lookup: {
15
+ output: {
16
+ source: 'process.argv',
17
+ char: 'o',
18
+ desc: 'the output file to write against',
19
+ type: 'string',
20
+ },
21
+ input: {
22
+ source: 'process.argv',
23
+ char: 'i',
24
+ desc: 'the input file to seed from',
25
+ type: 'string',
26
+ },
27
+ goal: {
28
+ source: 'process.argv',
29
+ char: 'g',
30
+ desc: 'the goal of the request',
31
+ type: '?string',
32
+ },
33
+ references: {
34
+ source: 'process.argv',
35
+ char: 'f',
36
+ desc: 'reference files to to use, if any; delimit with commas',
37
+ type: '?string',
38
+ },
39
+ briefs: {
40
+ source: 'process.argv',
41
+ char: 'b',
42
+ desc: 'brief files to to use, if any; delimit with commas',
43
+ type: '?string',
44
+ },
45
+ },
46
+ assess: (
47
+ input,
48
+ ): input is {
49
+ output: string;
50
+ input: string;
51
+ goal: string;
52
+ references: string;
53
+ briefs: string;
54
+ ask: string;
55
+ } => typeof input.output === 'string',
56
+ instantiate: async (input: {
57
+ output: string;
58
+ input: string;
59
+ goal: string;
60
+ references: string;
61
+ briefs: string;
62
+ ask: string;
63
+ }) => {
64
+ // declare where all the artifacts will be found
65
+ const obsDir = getArtifactObsDir({ uri: input.output });
66
+ const artifacts = {
67
+ goal: {
68
+ concept: genArtifactGitFile(
69
+ { uri: obsDir + '.goal.concept.md' },
70
+ { versions: true },
71
+ ),
72
+ context: genArtifactGitFile(
73
+ { uri: obsDir + '.goal.context.md' },
74
+ { versions: true },
75
+ ),
76
+ },
77
+ feedback: genArtifactGitFile(
78
+ { uri: obsDir + '.feedback.md' },
79
+ { versions: true },
80
+ ),
81
+ 'focus.context': genArtifactGitFile(
82
+ { uri: obsDir + '.focus.context.md' },
83
+ { versions: true },
84
+ ),
85
+ 'focus.concept': genArtifactGitFile(
86
+ { uri: input.output },
87
+ { versions: true },
88
+ ),
89
+ input: genArtifactGitFile({ uri: input.input }, { versions: true }),
90
+ references:
91
+ input.references
92
+ ?.split(',')
93
+ .filter((uri) => !!uri)
94
+ .map((reference) =>
95
+ genArtifactGitFile({ uri: reference }, { access: 'readonly' }),
96
+ ) ?? [],
97
+ briefs:
98
+ input.briefs
99
+ ?.split(',')
100
+ .filter((uri) => !!uri)
101
+ .map((brief) =>
102
+ genArtifactGitFile({ uri: brief }, { access: 'readonly' }),
103
+ ) ?? [],
104
+ };
105
+
106
+ // detect the goal of the caller
107
+ const goalConcept: string = await (async () => {
108
+ // if goal explicitly defined, use it
109
+ if (input.goal)
110
+ return (
111
+ (
112
+ await genArtifactGitFile(
113
+ { uri: input.goal },
114
+ { access: 'readonly' },
115
+ ).get()
116
+ )?.content ?? input.ask
117
+ );
118
+
119
+ // otherwise, assume its the ask
120
+ return input.ask;
121
+ })();
122
+ await artifacts.goal.concept.set({ content: goalConcept });
123
+
124
+ return {
125
+ caller: await enrollThread({
126
+ role: 'caller',
127
+ stash: {
128
+ ask: '',
129
+ art: {
130
+ 'foci.goal.concept': artifacts.goal.concept,
131
+ 'foci.goal.context': artifacts.goal.context,
132
+ 'foci.input.concept': artifacts.input,
133
+ feedback: artifacts.feedback,
134
+ },
135
+ refs: artifacts.references,
136
+ },
137
+ }),
138
+ thinker: await enrollThread({
139
+ role: 'thinker',
140
+ stash: {
141
+ art: {
142
+ 'focus.context': artifacts['focus.context'],
143
+ 'focus.concept': artifacts['focus.concept'],
144
+ },
145
+ briefs: [
146
+ ...artifacts.briefs,
147
+ ...BRIEFS_FOR_CLUSTER, // flow the cluster briefs down so that <ponder> has them in context too; this approach does cause duplicate briefs for cluster, but thats no biggie
148
+ ],
149
+ },
150
+ }),
151
+ };
152
+ },
153
+ },
154
+ context: {
155
+ lookup: {
156
+ apiKeyOpenai: {
157
+ source: 'process.env',
158
+ envar: 'OPENAI_API_KEY',
159
+ desc: 'the openai key to use',
160
+ type: 'string',
161
+ },
162
+ },
163
+ assess: (input): input is { apiKeyOpenai: string } =>
164
+ typeof input.apiKeyOpenai === 'string',
165
+ instantiate: () => {
166
+ return {
167
+ ...getContextOpenAI(),
168
+ ...genContextLogTrail(),
169
+ ...genContextStitchTrail(),
170
+ };
171
+ },
172
+ },
173
+ readme: '',
174
+ });
@@ -0,0 +1,150 @@
1
+ import { UnexpectedCodePathError } from 'helpful-errors';
2
+ import {
3
+ asStitcherFlat,
4
+ type GStitcher,
5
+ genStepImagineViaTemplate,
6
+ genStitchRoute,
7
+ genTemplate,
8
+ getTemplateValFromArtifacts,
9
+ getTemplateVarsFromRoleInherit,
10
+ type RoleContext,
11
+ type Threads,
12
+ } from 'rhachet';
13
+ import type { Artifact } from 'rhachet-artifact';
14
+ import type { GitFile } from 'rhachet-artifact-git';
15
+ import { withRetry, withTimeout } from 'wrapper-fns';
16
+
17
+ import type { Focus } from '@src/_topublish/rhachet-roles-bhrain/src/domain/objects/Focus';
18
+ import { type ContextOpenAI, sdkOpenAi } from '@src/access/sdk/sdkOpenAi';
19
+ import { genLoopFeedback } from '@src/domain.operations/artifact/genLoopFeedback';
20
+ import { genStepArtSet } from '@src/domain.operations/artifact/genStepArtSet';
21
+ import { getThinkerBriefs } from '@src/roles/thinker/getThinkerBrief';
22
+
23
+ // exported so that we can pass them through to <ponder> too
24
+ export const BRIEFS_FOR_CLUSTER = getThinkerBriefs([
25
+ 'trait.ocd.md',
26
+ 'cognition/cog401.questions.._.md',
27
+ 'cognition/cog000.overview.and.premise.md',
28
+ 'cognition/cog101.concept.treestruct._.md',
29
+ 'cognition/cog201.cortal.focus.p1.definition.md',
30
+ 'cognition/cog301.traversal.1.motion.primitives._.md',
31
+ 'cognition/cog401.questions.._.md',
32
+ 'cognition/cog401.questions.2.1.primitives.rough._.md',
33
+ 'librarian.tactics/<articulate>._.[article].frame.cognitive.md', // todo: keep or remove
34
+ 'librarian.tactics/<articulate>._.[article].frame.tactical.md',
35
+ 'cognition/cog201.cortal.focus.p2.breadth.md',
36
+ 'cognition/cog301.traversal.1.motion.primitives.breadth.md',
37
+ 'cognition/cog301.traversal.1.motion.primitives.breadth.vary.md',
38
+ 'thinker.tactics/<cluster>._.[article].frame.tactical._.md',
39
+ 'librarian.tactics/[brief].verbiage.outline.over.narrative.md',
40
+ ]);
41
+
42
+ type StitcherDesired = GStitcher<
43
+ Threads<{
44
+ caller: RoleContext<
45
+ 'caller',
46
+ {
47
+ art: {
48
+ feedback: Artifact<typeof GitFile>;
49
+ 'foci.goal.concept': Focus['concept'];
50
+ 'foci.goal.context': Focus['context'];
51
+ 'foci.input.concept': Focus['concept'];
52
+ };
53
+ refs: Artifact<typeof GitFile>[];
54
+ }
55
+ >;
56
+ thinker: RoleContext<
57
+ 'thinker',
58
+ {
59
+ art: {
60
+ 'focus.concept': Focus['concept'];
61
+ 'focus.context': Focus['context'];
62
+ };
63
+ briefs: Artifact<typeof GitFile>[];
64
+ }
65
+ >;
66
+ }>,
67
+ ContextOpenAI & GStitcher['context'],
68
+ { content: string }
69
+ >;
70
+
71
+ const template = genTemplate<StitcherDesired['threads']>({
72
+ ref: { uri: __filename.replace('.ts', '.template.md') },
73
+ getVariables: async ({ threads }) => ({
74
+ ...(await getTemplateVarsFromRoleInherit({ thread: threads.thinker })),
75
+
76
+ guide: {
77
+ goal:
78
+ (await threads.caller.context.stash.art['foci.goal.concept'].get())
79
+ ?.content ||
80
+ UnexpectedCodePathError.throw('goal not declared', {
81
+ art: threads.caller.context.stash.art['foci.goal.concept'],
82
+ }),
83
+ feedback:
84
+ (await threads.caller.context.stash.art.feedback.get())?.content || '',
85
+ },
86
+
87
+ focus: {
88
+ context:
89
+ (await threads.thinker.context.stash.art['focus.context'].get())
90
+ ?.content ||
91
+ (await threads.caller.context.stash.art['foci.goal.context'].get()) // fallback to @[caller].focus[goal].context
92
+ ?.content ||
93
+ '',
94
+ concept:
95
+ (await threads.thinker.context.stash.art['focus.concept'].get())
96
+ ?.content || '',
97
+ },
98
+
99
+ seed: {
100
+ concepts:
101
+ (await threads.caller.context.stash.art['foci.input.concept'].get())
102
+ ?.content ||
103
+ UnexpectedCodePathError.throw('input not declared', {
104
+ art: threads.caller.context.stash.art['foci.input.concept'],
105
+ }),
106
+ },
107
+
108
+ skill: {
109
+ briefs: await getTemplateValFromArtifacts({
110
+ artifacts: [
111
+ ...BRIEFS_FOR_CLUSTER,
112
+ ...threads.thinker.context.stash.briefs,
113
+ ],
114
+ }),
115
+ },
116
+
117
+ references: await getTemplateValFromArtifacts({
118
+ artifacts: threads.caller.context.stash.refs,
119
+ }),
120
+ }),
121
+ });
122
+
123
+ const stepImagine = genStepImagineViaTemplate<StitcherDesired>({
124
+ slug: '@[thinker]<cluster>',
125
+ stitchee: 'thinker',
126
+ readme: '',
127
+ template,
128
+ imagine: withRetry(
129
+ withTimeout(sdkOpenAi.imagine, { threshold: { seconds: 60 } }), // allow up to 60 sec, for longer files
130
+ ),
131
+ });
132
+
133
+ const stepPersist = genStepArtSet({
134
+ stitchee: 'thinker',
135
+ artee: 'focus.concept',
136
+ });
137
+
138
+ export const stepCluster = asStitcherFlat<StitcherDesired>(
139
+ genStitchRoute({
140
+ slug: '@[thinker]<cluster>',
141
+ readme: '@[thinker]<cluster> -> [article]',
142
+ sequence: [stepImagine, stepPersist],
143
+ }),
144
+ );
145
+
146
+ export const loopCluster = genLoopFeedback({
147
+ stitchee: 'thinker',
148
+ artee: 'focus.concept',
149
+ repeatee: stepCluster,
150
+ });
@@ -0,0 +1,9 @@
1
+ decompose = acuity++ via subcomponents
2
+
3
+ purpose =
4
+ - identify the core components
5
+
6
+
7
+ e.g.,
8
+ - <decompose>[goal] -> [[goal]]
9
+ - <decompose>[concept] -> [[components]]
@@ -0,0 +1,23 @@
1
+ [
2
+ "A man walked into a bar... ouch!",
3
+ "Why don't scientists trust atoms? Because they make up everything!",
4
+ "Why did the scarecrow win an award? Because he was outstanding in his field!",
5
+ "Why don't skeletons fight each other? They don't have the guts.",
6
+ "Why did the bicycle fall over? Because it was two-tired!",
7
+ "What do you call fake spaghetti? An impasta!",
8
+ "Why was the math book sad? It had too many problems.",
9
+ "What's orange and sounds like a parrot? A carrot.",
10
+ "Why do cows have hooves instead of feet? Because they lactose.",
11
+ "What did one ocean say to the other ocean? Nothing, they just waved.",
12
+ "Why was the broom late? It swept in.",
13
+ "Why did the golfer bring two pairs of pants? In case he got a hole in one.",
14
+ "What do you call cheese that isn't yours? Nacho cheese.",
15
+ "Why can't you give Elsa a balloon? Because she will let it go.",
16
+ "Why don't programmers like nature? It has too many bugs.",
17
+ "How do you organize an outer space party? You planet.",
18
+ "Why did the chicken join a band? Because it had the drumsticks.",
19
+ "What do you call a bear with no teeth? A gummy bear.",
20
+ "Why don't you play poker in the jungle? Too many cheetahs.",
21
+ "How do you make a tissue dance? Put a little boogie in it.",
22
+ "What did the zero say to the eight? Nice belt!"
23
+ ]
@@ -0,0 +1,23 @@
1
+ [
2
+ "Why did the chicken cross the road? To get to the other side!",
3
+ "Why don't scientists trust atoms? Because they make up everything!",
4
+ "What do you call fake spaghetti? An impasta!",
5
+ "Why was the math book sad? Because it had too many problems.",
6
+ "How do you organize a space party? You planet!",
7
+ "What did one wall say to the other wall? I'll meet you at the corner!",
8
+ "Why can’t your nose be 12 inches long? Because then it would be a foot!",
9
+ "What do you call cheese that isn't yours? Nacho cheese!",
10
+ "What did the janitor say when he jumped out of the closet? Supplies!",
11
+ "Why did the scarecrow win an award? Because he was outstanding in his field!",
12
+ "Why couldn’t the bicycle stand up by itself? It was two tired.",
13
+ "What do you get when you cross a snowman with a vampire? Frostbite.",
14
+ "How does a penguin build its house? Igloos it together!",
15
+ "Why did the golfer bring two pairs of pants? In case he got a hole in one!",
16
+ "What do you call a bear with no teeth? A gummy bear!",
17
+ "What do you call a fish with no eye? Fsh!",
18
+ "Why did the tomato turn red? Because it saw the salad dressing!",
19
+ "What do you get if you put a radio in the fridge? Cool music.",
20
+ "Why did the picture go to jail? Because it was framed!",
21
+ "Why don't skeletons fight each other? They don't have the guts.",
22
+ "What do you call a boomerang that won’t come back? A stick."
23
+ ]
@@ -0,0 +1,23 @@
1
+ [
2
+ "A pun that plays on the double meanings of words.",
3
+ "A knock-knock joke that's a play on words.",
4
+ "A light bulb joke that uses a formulaic setup and punchline.",
5
+ "A dad joke that's intentionally corny.",
6
+ "A joke that relies on a clever twist or surprise ending.",
7
+ "A riddle joke where the answer is both unexpected and funny.",
8
+ "An observational joke highlighting everyday absurdities.",
9
+ "A one-liner that delivers humor succinctly.",
10
+ "A parody joke that imitates a well-known style or genre.",
11
+ "A situational joke that relies on context for humor.",
12
+ "An anti-joke where the punchline is a literal answer.",
13
+ "A slapstick joke involving physical humor.",
14
+ "A dark humor joke with a morbid twist.",
15
+ "A story-based joke with a humorous anecdote.",
16
+ "A meme-style joke using visual elements for comedy.",
17
+ "A classic setup and punchline joke.",
18
+ "A stereotype joke that exaggerates a common trait.",
19
+ "A self-deprecating joke making fun of oneself.",
20
+ "A topical joke referring to current events.",
21
+ "An absurdist joke that defies logic for humor.",
22
+ "An irony-based joke highlighting contradictions."
23
+ ]
@@ -0,0 +1,9 @@
1
+ [
2
+ "a new customer discovering and purchasing a product on an e-commerce site",
3
+ "a returning user reordering a favorite meal through a food delivery app",
4
+ "a visitor signing up for a newsletter after reading multiple blog posts",
5
+ "a potential client engaging with a series of online demos before purchasing software",
6
+ "a student researching, selecting, and enrolling in an online course",
7
+ "a traveler booking flights, accommodations, and activities through a travel service",
8
+ "an employee completing a training module and passing an assessment on a company portal"
9
+ ]
@@ -0,0 +1,9 @@
1
+ [
2
+ "a first-time visitor exploring different products on an online marketplace before making a purchase decision",
3
+ "an existing customer using a loyalty program to earn points and redeem rewards while shopping",
4
+ "a user downloading and testing a free trial of a software application before committing to a subscription",
5
+ "an attendee navigating through a series of virtual conference sessions and networking events",
6
+ "a reader subscribing to a podcast after listening to multiple episodes",
7
+ "a client requesting and receiving a custom quote through a service provider's website",
8
+ "a participant completing a multi-step registration process for a community event or workshop"
9
+ ]