keating 0.3.6
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/README.md +334 -0
- package/SYSTEM.md +33 -0
- package/bin/keating.js +31 -0
- package/dist/src/cli/main.js +357 -0
- package/dist/src/cli/setup.js +197 -0
- package/dist/src/cli/web.js +84 -0
- package/dist/src/core/animation.js +304 -0
- package/dist/src/core/ax-optimizer.js +81 -0
- package/dist/src/core/ax-prompt-learner.js +59 -0
- package/dist/src/core/ax-trial.js +181 -0
- package/dist/src/core/benchmark.js +253 -0
- package/dist/src/core/commands.js +57 -0
- package/dist/src/core/config.js +120 -0
- package/dist/src/core/engagement.js +235 -0
- package/dist/src/core/env.js +9 -0
- package/dist/src/core/evolution.js +242 -0
- package/dist/src/core/flashcards.js +133 -0
- package/dist/src/core/learner-state.js +108 -0
- package/dist/src/core/lesson-plan.js +155 -0
- package/dist/src/core/map-elites.js +228 -0
- package/dist/src/core/map.js +89 -0
- package/dist/src/core/mastery.js +207 -0
- package/dist/src/core/paths.js +100 -0
- package/dist/src/core/pi-agent.js +82 -0
- package/dist/src/core/policy.js +79 -0
- package/dist/src/core/project.js +337 -0
- package/dist/src/core/projects.js +281 -0
- package/dist/src/core/prompt-evolution.js +344 -0
- package/dist/src/core/quiz.js +194 -0
- package/dist/src/core/random.js +19 -0
- package/dist/src/core/self-improve.js +425 -0
- package/dist/src/core/speech.js +54 -0
- package/dist/src/core/terminal.js +117 -0
- package/dist/src/core/theme.js +101 -0
- package/dist/src/core/topics.js +620 -0
- package/dist/src/core/types.js +1 -0
- package/dist/src/core/util.js +30 -0
- package/dist/src/core/verification.js +162 -0
- package/dist/src/pi/hyperteacher-extension.js +573 -0
- package/dist/src/runtime/pi.js +343 -0
- package/package.json +78 -0
- package/pi/prompts/bridge.md +14 -0
- package/pi/prompts/diagnose.md +15 -0
- package/pi/prompts/improve.md +39 -0
- package/pi/prompts/learn.md +21 -0
- package/pi/prompts/quiz.md +14 -0
- package/pi/skills/adaptive-teaching/SKILL.md +33 -0
- package/scripts/install/install.sh +308 -0
- package/web/dist/.well-known/llms.txt +44 -0
- package/web/dist/apple-touch-icon.svg +10 -0
- package/web/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/web/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/web/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/web/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/web/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/web/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/web/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/web/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/web/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/web/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/web/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/web/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/web/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/web/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/web/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/web/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/web/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/web/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/web/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/web/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/web/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/web/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/web/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/web/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/web/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/web/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/web/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/web/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/web/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/web/dist/assets/_baseFor-B_cjfMB6.js +1 -0
- package/web/dist/assets/anthropic-BT6Vfzb1.js +36 -0
- package/web/dist/assets/arc-x2nTilpc.js +1 -0
- package/web/dist/assets/architecture-YZFGNWBL-B1hlUWjX.js +1 -0
- package/web/dist/assets/architectureDiagram-Q4EWVU46-CMApWFyw.js +36 -0
- package/web/dist/assets/array-B9UHiPd-.js +1 -0
- package/web/dist/assets/azure-openai-responses-CommX3YJ.js +1 -0
- package/web/dist/assets/blockDiagram-DXYQGD6D-DOQbsNRY.js +132 -0
- package/web/dist/assets/c4Diagram-AHTNJAMY-VFfRZWWA.js +10 -0
- package/web/dist/assets/channel-KY2Tg8Ba.js +1 -0
- package/web/dist/assets/chunk-2KRD3SAO-B-AqvS0u.js +1 -0
- package/web/dist/assets/chunk-336JU56O-DlYgPyl6.js +2 -0
- package/web/dist/assets/chunk-426QAEUC-CsVoBkfR.js +1 -0
- package/web/dist/assets/chunk-4BX2VUAB-0Z13aFAn.js +1 -0
- package/web/dist/assets/chunk-4TB4RGXK-DqC0Zwm7.js +206 -0
- package/web/dist/assets/chunk-55IACEB6-CWE_u-IY.js +1 -0
- package/web/dist/assets/chunk-5FUZZQ4R-CApli0xX.js +62 -0
- package/web/dist/assets/chunk-5PVQY5BW-Cbzhfhln.js +2 -0
- package/web/dist/assets/chunk-67CJDMHE-Cx7uJS4d.js +1 -0
- package/web/dist/assets/chunk-7N4EOEYR-CYPNsFus.js +1 -0
- package/web/dist/assets/chunk-AA7GKIK3-rU0uhR_u.js +1 -0
- package/web/dist/assets/chunk-BSJP7CBP-5VmcfR4-.js +1 -0
- package/web/dist/assets/chunk-Bj-mKKzh.js +1 -0
- package/web/dist/assets/chunk-CIAEETIT-CHJ-L8H1.js +1 -0
- package/web/dist/assets/chunk-EDXVE4YY-DZHAJjMI.js +1 -0
- package/web/dist/assets/chunk-ENJZ2VHE-DbUDFa7w.js +10 -0
- package/web/dist/assets/chunk-FMBD7UC4-BsYE5e_h.js +15 -0
- package/web/dist/assets/chunk-FOC6F5B3-Cm6aoTv7.js +1 -0
- package/web/dist/assets/chunk-ICPOFSXX-C5eNZ4L6.js +123 -0
- package/web/dist/assets/chunk-K5T4RW27-R7dAJ4rq.js +94 -0
- package/web/dist/assets/chunk-KGLVRYIC-MO99YZXL.js +1 -0
- package/web/dist/assets/chunk-LIHQZDEY-DUJ656sT.js +1 -0
- package/web/dist/assets/chunk-ORNJ4GCN-DXuuEC1n.js +1 -0
- package/web/dist/assets/chunk-OYMX7WX6-pJlEprWq.js +231 -0
- package/web/dist/assets/chunk-QZHKN3VN-_pQxbbiW.js +1 -0
- package/web/dist/assets/chunk-U2HBQHQK-Mh_l9PLe.js +70 -0
- package/web/dist/assets/chunk-X2U36JSP-BOeiJW0w.js +1 -0
- package/web/dist/assets/chunk-XPW4576I-fQ9SDvr_.js +32 -0
- package/web/dist/assets/chunk-YZCP3GAM-eboO4P5S.js +1 -0
- package/web/dist/assets/chunk-ZZ45TVLE-Cky0eqlr.js +1 -0
- package/web/dist/assets/classDiagram-6PBFFD2Q-DEPsZSU3.js +1 -0
- package/web/dist/assets/classDiagram-v2-HSJHXN6E-DhmIOEpX.js +1 -0
- package/web/dist/assets/clone-DeTzYqo8.js +1 -0
- package/web/dist/assets/cose-bilkent-S5V4N54A-N4zWUJ7C.js +1 -0
- package/web/dist/assets/cytoscape.esm-BBMd0vGm.js +321 -0
- package/web/dist/assets/dagre-IpK1aoMm.js +1 -0
- package/web/dist/assets/dagre-KV5264BT-DCytJuju.js +4 -0
- package/web/dist/assets/defaultLocale-5eAKkKJC.js +1 -0
- package/web/dist/assets/diagram-5BDNPKRD-Cv4miBae.js +10 -0
- package/web/dist/assets/diagram-G4DWMVQ6-CtICKUFi.js +24 -0
- package/web/dist/assets/diagram-MMDJMWI5-Cn7aGorh.js +43 -0
- package/web/dist/assets/diagram-TYMM5635-CCUWDPsC.js +24 -0
- package/web/dist/assets/dist-Dm98VvTW.js +1 -0
- package/web/dist/assets/env-api-keys-BNlMKqxw.js +1 -0
- package/web/dist/assets/erDiagram-SMLLAGMA-uT88sBlT.js +85 -0
- package/web/dist/assets/event-stream-D33K9rpL.js +1 -0
- package/web/dist/assets/flatten-C-u5nd5-.js +1 -0
- package/web/dist/assets/flowDiagram-DWJPFMVM-Bl3O7S1m.js +162 -0
- package/web/dist/assets/ganttDiagram-T4ZO3ILL-B1FhwV45.js +292 -0
- package/web/dist/assets/gitGraph-7Q5UKJZL-Bc_7vzer.js +1 -0
- package/web/dist/assets/gitGraphDiagram-UUTBAWPF-DfW6svMS.js +106 -0
- package/web/dist/assets/github-copilot-headers-L39QqneT.js +1 -0
- package/web/dist/assets/google-BdYNeCP_.js +1 -0
- package/web/dist/assets/google-gemini-cli-DpxAL3K4.js +2 -0
- package/web/dist/assets/google-shared-DyQdgtsI.js +2 -0
- package/web/dist/assets/google-vertex-CKRybaXj.js +1 -0
- package/web/dist/assets/graphlib-CMTVFyOZ.js +1 -0
- package/web/dist/assets/hash-kZ2KD_no.js +1 -0
- package/web/dist/assets/index-Bdb7P7gx.css +2 -0
- package/web/dist/assets/index-DNxepp8B.js +2891 -0
- package/web/dist/assets/info-OMHHGYJF-BGcxeaZt.js +1 -0
- package/web/dist/assets/infoDiagram-42DDH7IO-BbES7X_c.js +2 -0
- package/web/dist/assets/init-DlZdxViB.js +1 -0
- package/web/dist/assets/isEmpty-DssUW35f.js +1 -0
- package/web/dist/assets/ishikawaDiagram-UXIWVN3A-DxQ28rho.js +70 -0
- package/web/dist/assets/journeyDiagram-VCZTEJTY-D0X8qQ0P.js +139 -0
- package/web/dist/assets/json-parse-C6tSeIxX.js +2 -0
- package/web/dist/assets/kanban-definition-6JOO6SKY-DWYfSlpl.js +89 -0
- package/web/dist/assets/katex-CyM-5LlM.js +265 -0
- package/web/dist/assets/line-CuHce5JG.js +1 -0
- package/web/dist/assets/linear-Ca0Vkwuj.js +1 -0
- package/web/dist/assets/mermaid-parser.core-Cy4iY_Dy.js +4 -0
- package/web/dist/assets/mermaid.core-6PGkQdYc.js +11 -0
- package/web/dist/assets/mindmap-definition-QFDTVHPH-BBnKdtQh.js +96 -0
- package/web/dist/assets/mistral-BWaUMIgd.js +7 -0
- package/web/dist/assets/openai-D4NSaQIs.js +16 -0
- package/web/dist/assets/openai-codex-responses-CHBgKhmb.js +7 -0
- package/web/dist/assets/openai-completions-kcXmmaHI.js +5 -0
- package/web/dist/assets/openai-responses-Cqq3H3p3.js +1 -0
- package/web/dist/assets/openai-responses-shared-CTNuo9ci.js +10 -0
- package/web/dist/assets/ordinal-_K3x1fkz.js +1 -0
- package/web/dist/assets/ort-wasm-simd-threaded.jsep-B0T3yYHD.wasm +0 -0
- package/web/dist/assets/packet-4T2RLAQJ-D35ZLSBH.js +1 -0
- package/web/dist/assets/path-6uRLdFF7.js +1 -0
- package/web/dist/assets/pdf.worker.min-Cpi8b8z3.mjs +28 -0
- package/web/dist/assets/pie-ZZUOXDRM-DRoETpJX.js +1 -0
- package/web/dist/assets/pieDiagram-DEJITSTG-DfMjfTQz.js +30 -0
- package/web/dist/assets/preload-helper-DSXbuxSR.js +1 -0
- package/web/dist/assets/quadrantDiagram-34T5L4WZ-DfBSEept.js +7 -0
- package/web/dist/assets/radar-PYXPWWZC-DLKxRJ0V.js +1 -0
- package/web/dist/assets/reduce-836A2NiQ.js +1 -0
- package/web/dist/assets/requirementDiagram-MS252O5E-BPkxJQkz.js +84 -0
- package/web/dist/assets/rough.esm-Djo4Abte.js +1 -0
- package/web/dist/assets/sankeyDiagram-XADWPNL6-He3x9tNT.js +10 -0
- package/web/dist/assets/sequenceDiagram-FGHM5R23-DfCDpvrT.js +157 -0
- package/web/dist/assets/src-DdOdIreR.js +1 -0
- package/web/dist/assets/stateDiagram-FHFEXIEX-fuww6347.js +1 -0
- package/web/dist/assets/stateDiagram-v2-QKLJ7IA2-U6voafO3.js +1 -0
- package/web/dist/assets/timeline-definition-GMOUNBTQ-BWunHgBC.js +120 -0
- package/web/dist/assets/transform-messages-CqKEdRVp.js +1 -0
- package/web/dist/assets/transformers.web-DKUtmSAi.js +2818 -0
- package/web/dist/assets/treeView-SZITEDCU-BCx0xSAm.js +1 -0
- package/web/dist/assets/treemap-W4RFUUIX-2CvghWJK.js +1 -0
- package/web/dist/assets/vennDiagram-DHZGUBPP-CBXRutSP.js +34 -0
- package/web/dist/assets/wardley-RL74JXVD-BkPL_mhd.js +1 -0
- package/web/dist/assets/wardleyDiagram-NUSXRM2D-DTcVscPH.js +20 -0
- package/web/dist/assets/web-CMKYLKbT.js +10 -0
- package/web/dist/assets/xychartDiagram-5P7HB3ND-CZLgX9Fe.js +7 -0
- package/web/dist/favicon.svg +10 -0
- package/web/dist/index.html +104 -0
- package/web/dist/keating-metaharness.pdf +10557 -3
- package/web/dist/llms.txt +44 -0
- package/web/dist/logo.png +0 -0
- package/web/dist/manifest.webmanifest +1 -0
- package/web/dist/og-image.png +0 -0
- package/web/dist/pwa-192x192.svg +10 -0
- package/web/dist/pwa-512x512.svg +10 -0
- package/web/dist/registerSW.js +1 -0
- package/web/dist/robots.txt +8 -0
- package/web/dist/sitemap.xml +39 -0
- package/web/dist/sw.js +1 -0
- package/web/dist/tapes/doctor.mp4 +0 -0
- package/web/dist/tapes/feedback-flow.mp4 +0 -0
- package/web/dist/tapes/improve-flow.mp4 +0 -0
- package/web/dist/tapes/intro.mp4 +0 -0
- package/web/dist/tapes/learning-flow.mp4 +0 -0
- package/web/dist/tapes/session-flow.mp4 +0 -0
- package/web/dist/tapes/teacher-flow.mp4 +0 -0
- package/web/dist/tapes/tests.mp4 +0 -0
- package/web/dist/workbox-66610c77.js +1 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export const KEATING_VOICE_TOOL_NAME = "keating_voice";
|
|
2
|
+
export const VOICE_TAGS = [
|
|
3
|
+
"explain",
|
|
4
|
+
"question",
|
|
5
|
+
"verify",
|
|
6
|
+
"redirect",
|
|
7
|
+
"encourage",
|
|
8
|
+
"pause",
|
|
9
|
+
"recap"
|
|
10
|
+
];
|
|
11
|
+
const DEFAULT_TAGS = ["explain"];
|
|
12
|
+
const DEFAULT_PACE = "normal";
|
|
13
|
+
const DEFAULT_AFFECT = "warm";
|
|
14
|
+
function isVoiceTag(value) {
|
|
15
|
+
return VOICE_TAGS.includes(value);
|
|
16
|
+
}
|
|
17
|
+
function cleanText(value) {
|
|
18
|
+
return String(value ?? "").replace(/\s+/g, " ").trim();
|
|
19
|
+
}
|
|
20
|
+
export function normalizeVoiceUtterance(input, speech) {
|
|
21
|
+
const text = cleanText(input.text);
|
|
22
|
+
if (!text) {
|
|
23
|
+
throw new Error("keating_voice requires non-empty text.");
|
|
24
|
+
}
|
|
25
|
+
const tags = (input.tags ?? [])
|
|
26
|
+
.map(tag => cleanText(tag).toLowerCase())
|
|
27
|
+
.filter(isVoiceTag);
|
|
28
|
+
return {
|
|
29
|
+
text,
|
|
30
|
+
voice: cleanText(input.voice) || speech.defaultVoice,
|
|
31
|
+
tags: tags.length > 0 ? tags : DEFAULT_TAGS,
|
|
32
|
+
pace: input.pace ?? DEFAULT_PACE,
|
|
33
|
+
affect: input.affect ?? DEFAULT_AFFECT,
|
|
34
|
+
listenFor: input.listenFor ? cleanText(input.listenFor) : undefined
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function voiceTagLine(utterance) {
|
|
38
|
+
const attrs = [
|
|
39
|
+
`voice=${utterance.voice}`,
|
|
40
|
+
`tags=${utterance.tags.join(",")}`,
|
|
41
|
+
`pace=${utterance.pace}`,
|
|
42
|
+
`affect=${utterance.affect}`,
|
|
43
|
+
utterance.listenFor ? `listen_for=${utterance.listenFor}` : undefined
|
|
44
|
+
].filter(Boolean);
|
|
45
|
+
return `[voice ${attrs.join(" ")}] ${utterance.text}`;
|
|
46
|
+
}
|
|
47
|
+
export function speechStrategySummary(speech) {
|
|
48
|
+
return [
|
|
49
|
+
`speech=${speech.enabled ? "enabled" : "disabled"}`,
|
|
50
|
+
`voice=${speech.defaultVoice}`,
|
|
51
|
+
`fast_model=${speech.fastModel ?? "unset"}`,
|
|
52
|
+
`steering_model=${speech.steeringModel ?? "default"}`
|
|
53
|
+
].join("\n");
|
|
54
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { shellCommandSections } from "./commands.js";
|
|
2
|
+
export const RESET = "\x1b[0m";
|
|
3
|
+
const BOLD = "\x1b[1m";
|
|
4
|
+
const DIM = "\x1b[2m";
|
|
5
|
+
function rgb(red, green, blue) {
|
|
6
|
+
return `\x1b[38;2;${red};${green};${blue}m`;
|
|
7
|
+
}
|
|
8
|
+
function bgRgb(red, green, blue) {
|
|
9
|
+
return `\x1b[48;2;${red};${green};${blue}m`;
|
|
10
|
+
}
|
|
11
|
+
// ─── Retro palette (true-color, matches web 1:1) ───────────────────────
|
|
12
|
+
const PRIMARY = rgb(16, 185, 129); // #10b981 — web primary green
|
|
13
|
+
const PRIMARY_BG = bgRgb(16, 185, 129) + rgb(244, 241, 234);
|
|
14
|
+
const GREEN_LIGHT = rgb(52, 211, 153); // #34d399 — logo top
|
|
15
|
+
const GREEN_DARK = rgb(5, 150, 105); // #059669 — logo bottom
|
|
16
|
+
const TERRACOTTA = rgb(212, 74, 61); // #d44a3d — Nav version tag
|
|
17
|
+
const PAPER = rgb(244, 241, 234); // #f4f1ea — background
|
|
18
|
+
const PARCHMENT = rgb(216, 210, 196); // border-muted
|
|
19
|
+
const SEPIA = rgb(160, 150, 136); // muted text
|
|
20
|
+
const COAL = rgb(50, 50, 50); // dark borders
|
|
21
|
+
const NEON = rgb(0, 255, 0); // #00ff00 — terminal glow
|
|
22
|
+
const INK = rgb(26, 26, 26); // #1a1a1a — foreground
|
|
23
|
+
function paint(text, ...codes) {
|
|
24
|
+
return `${codes.join("")}${text}${RESET}`;
|
|
25
|
+
}
|
|
26
|
+
export const keatingColor = {
|
|
27
|
+
primary: PRIMARY,
|
|
28
|
+
terracotta: TERRACOTTA,
|
|
29
|
+
paper: PAPER,
|
|
30
|
+
parchment: PARCHMENT,
|
|
31
|
+
sepia: SEPIA,
|
|
32
|
+
coal: COAL,
|
|
33
|
+
neon: NEON,
|
|
34
|
+
ink: INK,
|
|
35
|
+
};
|
|
36
|
+
export function printInfo(text) {
|
|
37
|
+
console.log(paint(` ${text}`, SEPIA));
|
|
38
|
+
}
|
|
39
|
+
export function printSuccess(text) {
|
|
40
|
+
console.log(paint(` ✓ ${text}`, PRIMARY, BOLD));
|
|
41
|
+
}
|
|
42
|
+
export function printWarning(text) {
|
|
43
|
+
console.log(paint(` ⚠ ${text}`, rgb(255, 193, 7), BOLD));
|
|
44
|
+
}
|
|
45
|
+
export function printError(text) {
|
|
46
|
+
console.log(paint(` ✗ ${text}`, rgb(220, 38, 38), BOLD));
|
|
47
|
+
}
|
|
48
|
+
export function printSection(title) {
|
|
49
|
+
console.log("");
|
|
50
|
+
console.log(paint(`◆ ${title}`, PRIMARY, BOLD));
|
|
51
|
+
}
|
|
52
|
+
export const KEATING_ASCII_LOGO = [
|
|
53
|
+
"██╗ ██╗███████╗ █████╗ ████████╗██╗███╗ ██╗ ██████╗ ",
|
|
54
|
+
"██║ ██╔╝██╔════╝██╔══██╗╚══██╔══╝██║████╗ ██║██╔════╝ ",
|
|
55
|
+
"█████╔╝ █████╗ ███████║ ██║ ██║██╔██╗ ██║██║ ███╗",
|
|
56
|
+
"██╔═██╗ ██╔══╝ ██╔══██║ ██║ ██║██║╚██╗██║██║ ██║",
|
|
57
|
+
"██║ ██╗███████╗██║ ██║ ██║ ██║██║ ╚████║╚██████╔╝",
|
|
58
|
+
"╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ",
|
|
59
|
+
];
|
|
60
|
+
export const KEATING_SUBTITLE_LINES = [
|
|
61
|
+
"THE HYPERTEACHER — Cognitive Empowerment",
|
|
62
|
+
'"That the powerful play goes on, and you may contribute a verse."',
|
|
63
|
+
" — Whitman",
|
|
64
|
+
];
|
|
65
|
+
export function printAsciiHeader(subtitleLines = []) {
|
|
66
|
+
console.log("");
|
|
67
|
+
// Render logo with progressive green gradient (top-center-heavy)
|
|
68
|
+
const logoColors = [GREEN_LIGHT, GREEN_LIGHT, PRIMARY, PRIMARY, GREEN_DARK, GREEN_DARK];
|
|
69
|
+
for (let index = 0; index < KEATING_ASCII_LOGO.length; index += 1) {
|
|
70
|
+
console.log(paint(` ${KEATING_ASCII_LOGO[index]}`, logoColors[index], BOLD));
|
|
71
|
+
}
|
|
72
|
+
for (const line of subtitleLines) {
|
|
73
|
+
console.log(paint(` ${line}`, SEPIA));
|
|
74
|
+
}
|
|
75
|
+
console.log("");
|
|
76
|
+
}
|
|
77
|
+
export function printPanel(title, subtitleLines = []) {
|
|
78
|
+
const inner = 53;
|
|
79
|
+
const border = "─".repeat(inner + 2);
|
|
80
|
+
const renderLine = (text, color, bolded = false) => {
|
|
81
|
+
const content = text.length > inner ? `${text.slice(0, inner - 3)}...` : text;
|
|
82
|
+
const codes = bolded ? `${color}${BOLD}` : color;
|
|
83
|
+
return `${COAL}${BOLD}│${RESET} ${codes}${content.padEnd(inner)}${RESET} ${COAL}${BOLD}│${RESET}`;
|
|
84
|
+
};
|
|
85
|
+
console.log("");
|
|
86
|
+
console.log(paint(`┌${border}┐`, COAL, BOLD));
|
|
87
|
+
console.log(renderLine(title, PRIMARY, true));
|
|
88
|
+
if (subtitleLines.length > 0) {
|
|
89
|
+
console.log(paint(`├${border}┤`, COAL, BOLD));
|
|
90
|
+
for (const line of subtitleLines) {
|
|
91
|
+
console.log(renderLine(line, PAPER));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
console.log(paint(`└${border}┘`, COAL, BOLD));
|
|
95
|
+
console.log("");
|
|
96
|
+
}
|
|
97
|
+
export function printCommandSections(sections) {
|
|
98
|
+
for (const section of sections) {
|
|
99
|
+
printSection(section.title);
|
|
100
|
+
const maxUsage = Math.max(...section.commands.map(c => c.usage.length));
|
|
101
|
+
for (const cmd of section.commands) {
|
|
102
|
+
const padded = cmd.usage.padEnd(maxUsage + 2);
|
|
103
|
+
console.log(paint(` ${padded}`, PRIMARY, BOLD) + paint(cmd.description, SEPIA));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
export function printShellGreeting() {
|
|
108
|
+
printAsciiHeader([
|
|
109
|
+
paint("THE HYPERTEACHER — Cognitive Empowerment!", PARCHMENT, BOLD),
|
|
110
|
+
paint('"That the powerful play goes on, and you may contribute a verse."', SEPIA, DIM),
|
|
111
|
+
paint(" — Whitman", SEPIA, DIM),
|
|
112
|
+
]);
|
|
113
|
+
const sections = shellCommandSections();
|
|
114
|
+
printCommandSections(sections);
|
|
115
|
+
console.log(paint('\n Type "/help" any time for usage hints.', SEPIA, DIM));
|
|
116
|
+
console.log("");
|
|
117
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keating CLI Theme — ANSI color constants that mirror the retro web palette.
|
|
3
|
+
*
|
|
4
|
+
* Uses 24-bit true-color (38;2;R;G;B) so the CLI matches the web hex values
|
|
5
|
+
* exactly on modern terminals. Falls back gracefully on 256-color terminals.
|
|
6
|
+
*/
|
|
7
|
+
import { extensionCommandSpecs, cliCommandSpecs } from "./commands.js";
|
|
8
|
+
import { KEATING_ASCII_LOGO, KEATING_SUBTITLE_LINES } from "./terminal.js";
|
|
9
|
+
// ─── True-color helpers ─────────────────────────────────────────────
|
|
10
|
+
function fg(r, g, b) {
|
|
11
|
+
return `\x1b[38;2;${r};${g};${b}m`;
|
|
12
|
+
}
|
|
13
|
+
function bg(r, g, b) {
|
|
14
|
+
return `\x1b[48;2;${r};${g};${b}m`;
|
|
15
|
+
}
|
|
16
|
+
// ─── Retro palette (matches web/src/app.css & web/src/styles/retro.css) ─
|
|
17
|
+
export const color = {
|
|
18
|
+
reset: "\x1b[0m",
|
|
19
|
+
bold: "\x1b[1m",
|
|
20
|
+
dim: "\x1b[2m",
|
|
21
|
+
italic: "\x1b[3m",
|
|
22
|
+
// Primary green — matches web --primary #10b981
|
|
23
|
+
primary: fg(16, 185, 129),
|
|
24
|
+
primaryBg: bg(16, 185, 129) + fg(244, 241, 234),
|
|
25
|
+
// Logo gradient (mirrors web ChatIntro gradient)
|
|
26
|
+
greenLight: fg(52, 211, 153), // #34d399
|
|
27
|
+
greenMid: fg(16, 185, 129), // #10b981
|
|
28
|
+
greenDark: fg(5, 150, 105), // #059669
|
|
29
|
+
// Retro terracotta — matches web Nav version tag #d44a3d
|
|
30
|
+
terracotta: fg(212, 74, 61),
|
|
31
|
+
terracottaBg: bg(212, 74, 61) + fg(244, 241, 234),
|
|
32
|
+
// Neon glow — terminal green for dark-mode feel
|
|
33
|
+
neon: fg(0, 255, 0), // #00ff00
|
|
34
|
+
// Warm paper neutrals (mirrors web --background #f4f1ea)
|
|
35
|
+
cream: fg(244, 241, 234),
|
|
36
|
+
parchment: fg(216, 210, 196), // softer than web muted, terminal-friendly
|
|
37
|
+
sepia: fg(160, 150, 136), // warm dim text
|
|
38
|
+
// Compatibility aliases (old 256-color names → new true-color)
|
|
39
|
+
sage: fg(16, 185, 129), // same as primary, kept for compat
|
|
40
|
+
gold: fg(16, 185, 129), // was 220 yellow, now primary green
|
|
41
|
+
// Deep darks
|
|
42
|
+
ink: fg(26, 26, 26),
|
|
43
|
+
coal: fg(50, 50, 50), // border/dark neutral
|
|
44
|
+
coalBg: bg(50, 50, 50),
|
|
45
|
+
// Semantic helpers (mirrors web intent)
|
|
46
|
+
ok: fg(16, 185, 129), // success → primary green
|
|
47
|
+
warn: fg(255, 193, 7), // amber warning
|
|
48
|
+
err: fg(220, 38, 38), // true red error
|
|
49
|
+
info: fg(100, 180, 255), // soft blue info
|
|
50
|
+
};
|
|
51
|
+
// Convenience helpers
|
|
52
|
+
export function c(tag, text) {
|
|
53
|
+
return `${color[tag]}${text}${color.reset}`;
|
|
54
|
+
}
|
|
55
|
+
export function bold(tag, text) {
|
|
56
|
+
return `${color.bold}${color[tag]}${text}${color.reset}`;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The Keating shell ASCII greeting — shown once per session.
|
|
60
|
+
*
|
|
61
|
+
* Logo renders with a progressive green gradient (top-to-bottom) that mirrors
|
|
62
|
+
* the web ChatIntro CSS: #34d399 → #10b981 → #059669.
|
|
63
|
+
*/
|
|
64
|
+
export const KEATING_GREETING = (() => {
|
|
65
|
+
const logoColors = [
|
|
66
|
+
color.greenLight,
|
|
67
|
+
color.greenLight,
|
|
68
|
+
color.greenMid,
|
|
69
|
+
color.greenMid,
|
|
70
|
+
color.greenDark,
|
|
71
|
+
color.greenDark,
|
|
72
|
+
];
|
|
73
|
+
const logo = KEATING_ASCII_LOGO.map((line, i) => `${logoColors[i] ?? color.greenMid} ${line}${color.reset}`).join("\n");
|
|
74
|
+
const [title, ...quoteLines] = KEATING_SUBTITLE_LINES;
|
|
75
|
+
const subtitle = [
|
|
76
|
+
`${color.bold}${color.parchment} ${title}${color.reset}`,
|
|
77
|
+
...quoteLines.map(line => `${color.dim}${color.sepia} ${line}${color.reset}`),
|
|
78
|
+
].join("\n");
|
|
79
|
+
return `\n${logo}\n\n${subtitle}\n`;
|
|
80
|
+
})();
|
|
81
|
+
/**
|
|
82
|
+
* Command list formatted for the shell greeting (slash-prefixed).
|
|
83
|
+
*/
|
|
84
|
+
export function shellCommands() {
|
|
85
|
+
const cmds = extensionCommandSpecs
|
|
86
|
+
.filter(s => !s.cliOnly)
|
|
87
|
+
.map(s => [`/${s.name}${s.args ? ` ${s.args}` : ""}`, s.description]);
|
|
88
|
+
return formatCommandList(cmds);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Command list formatted for the CLI help output (no slash prefix).
|
|
92
|
+
*/
|
|
93
|
+
export function cliCommands() {
|
|
94
|
+
const cmds = cliCommandSpecs
|
|
95
|
+
.map(s => [`${s.name}${s.args ? ` ${s.args}` : ""}`, s.description]);
|
|
96
|
+
return formatCommandList(cmds);
|
|
97
|
+
}
|
|
98
|
+
function formatCommandList(cmds) {
|
|
99
|
+
const lines = cmds.map(([cmd, desc]) => ` ${color.bold}${color.primary}${cmd.padEnd(22)}${color.reset} ${color.dim}${color.sepia}${desc}${color.reset}`);
|
|
100
|
+
return lines.join("\n");
|
|
101
|
+
}
|