@chibitek/chibi 0.1.179 → 0.1.180

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 (100) hide show
  1. package/dist/assets/{abnfDiagram-O67JEVCF-BFpvXOmW.js → abnfDiagram-O67JEVCF-C91sfqR5.js} +1 -1
  2. package/dist/assets/{arc-0cz8QAA9.js → arc-ywHVvcgD.js} +1 -1
  3. package/dist/assets/{architectureDiagram-NJMV4G6O-DxG1U8Tf.js → architectureDiagram-NJMV4G6O-BgUERWVi.js} +1 -1
  4. package/dist/assets/{blockDiagram-BEXU5L5S-DdpIUUid.js → blockDiagram-BEXU5L5S-CpeTJJap.js} +1 -1
  5. package/dist/assets/{c4Diagram-YGBWAQC7-CNB5U3O1.js → c4Diagram-YGBWAQC7-BgdM3M47.js} +1 -1
  6. package/dist/assets/channel-Ck_atLKb.js +1 -0
  7. package/dist/assets/{chunk-2Q5K7J3B-DixTESOo.js → chunk-2Q5K7J3B-BcMR6SsJ.js} +1 -1
  8. package/dist/assets/{chunk-3FUC2YCW-9KbkQg_1.js → chunk-3FUC2YCW-DNzXM7Mm.js} +2 -2
  9. package/dist/assets/{chunk-5VM5RSS4-DMNRleww.js → chunk-5VM5RSS4-kVNi7GcP.js} +1 -1
  10. package/dist/assets/{chunk-GTNCS2PH-kxGMXg9R.js → chunk-GTNCS2PH-B5bYzLKn.js} +1 -1
  11. package/dist/assets/{chunk-GWA4HPMP-B7sa9Us9.js → chunk-GWA4HPMP-DiMuTVC6.js} +1 -1
  12. package/dist/assets/{chunk-JWPE2WC7-BF65Wqy-.js → chunk-JWPE2WC7-Bl2yeh-K.js} +1 -1
  13. package/dist/assets/{chunk-NETBCI7D-Du36YO_k.js → chunk-NETBCI7D-Klel5WGa.js} +1 -1
  14. package/dist/assets/{chunk-WEXAMYUT-BMTNPIkJ.js → chunk-WEXAMYUT-CPIykbsI.js} +1 -1
  15. package/dist/assets/{chunk-XXDRQBXY-BqdQPY5v.js → chunk-XXDRQBXY-8cVOBFNO.js} +1 -1
  16. package/dist/assets/{classDiagram-v2-NBCMYWYE-DYSOprmY.js → classDiagram-v2-NBCMYWYE-DxDpAPju.js} +1 -1
  17. package/dist/assets/{cose-bilkent-JH36ORCC-DXKY6FnT.js → cose-bilkent-JH36ORCC-Bb935SMz.js} +1 -1
  18. package/dist/assets/{cynefin-OW5HDTMX-DamnOWMn.js → cynefin-OW5HDTMX-CxYWe3QR.js} +1 -1
  19. package/dist/assets/{cynefinDiagram-VND7K2PF-Bb-wuGye.js → cynefinDiagram-VND7K2PF-CYhyAhYv.js} +1 -1
  20. package/dist/assets/{dagre-6A5THRUB-DVMvGhu7.js → dagre-6A5THRUB-Bb41Vmni.js} +1 -1
  21. package/dist/assets/{diagram-22UHCM2B-BX4_NJ2M.js → diagram-22UHCM2B-BNvUBpgi.js} +1 -1
  22. package/dist/assets/{diagram-3UASUU5V-4J3gjVZn.js → diagram-3UASUU5V-D9x2CdxS.js} +1 -1
  23. package/dist/assets/{diagram-ATOU4E4O-Bbune_ll.js → diagram-ATOU4E4O-BXIrC_GF.js} +1 -1
  24. package/dist/assets/{diagram-CDSNMT55-EEDiwifm.js → diagram-CDSNMT55-OI4ao0qQ.js} +1 -1
  25. package/dist/assets/{diagram-MLGK6HIB-D5lseSZO.js → diagram-MLGK6HIB-_zZZdxaC.js} +1 -1
  26. package/dist/assets/{diagram-MPIPVDR6-isxlwvOO.js → diagram-MPIPVDR6-9k65oUfK.js} +1 -1
  27. package/dist/assets/{ebnfDiagram-ZINNZB2B-DXhf0QK8.js → ebnfDiagram-ZINNZB2B-Chvztd4J.js} +1 -1
  28. package/dist/assets/{elk-276RUBZZ-rR6aJBHM.js → elk-276RUBZZ-CMWtKZmi.js} +1 -1
  29. package/dist/assets/{erDiagram-OPXOYQCR-DRIV4t6Y.js → erDiagram-OPXOYQCR-2vqBM9HW.js} +1 -1
  30. package/dist/assets/{flowDiagram-KWPJA3E3-BT3z2JmZ.js → flowDiagram-KWPJA3E3-C6y9L478.js} +1 -1
  31. package/dist/assets/{ganttDiagram-FUAMR5RP-CR0drs2s.js → ganttDiagram-FUAMR5RP-uWHpQwJY.js} +1 -1
  32. package/dist/assets/{gitGraphDiagram-X574FWY7-BrjfMmlB.js → gitGraphDiagram-X574FWY7-BLM0_X6z.js} +1 -1
  33. package/dist/assets/{index-DAGHO7rw.js → index-CPnrJ6T1.js} +131 -131
  34. package/dist/assets/{index-BISPpSBx.js → index-YJUVFbCT.js} +1 -1
  35. package/dist/assets/{infoDiagram-VRGFBTTK-fIajbwUK.js → infoDiagram-VRGFBTTK-DWeJ1wdL.js} +1 -1
  36. package/dist/assets/{ishikawaDiagram-OU5B5YK6-DlOC_sEC.js → ishikawaDiagram-OU5B5YK6-R28kPwvB.js} +1 -1
  37. package/dist/assets/{journeyDiagram-ZHPQQLJL-BY4NF3Iq.js → journeyDiagram-ZHPQQLJL-BHWE5-BX.js} +1 -1
  38. package/dist/assets/{kanban-definition-PNTS6WVX-CjcD7Qp-.js → kanban-definition-PNTS6WVX-M-Er9io8.js} +1 -1
  39. package/dist/assets/{linear-D2XvBjOb.js → linear-UI6pE8Wd.js} +1 -1
  40. package/dist/assets/{mermaid.core-DbXyvZNy.js → mermaid.core-B_hsjjFv.js} +5 -5
  41. package/dist/assets/{mindmap-definition-NLK3R4M7-rjla1J-s.js → mindmap-definition-NLK3R4M7-C6u7tH0B.js} +1 -1
  42. package/dist/assets/{pegDiagram-GJSIUBJH-hvEPNypQ.js → pegDiagram-GJSIUBJH-HdJHW3kd.js} +1 -1
  43. package/dist/assets/{pieDiagram-5QR66LMP-D-jjzmff.js → pieDiagram-5QR66LMP-DYm0T2vD.js} +1 -1
  44. package/dist/assets/{quadrantDiagram-O4NWA36T-DJsTKR54.js → quadrantDiagram-O4NWA36T-CEqOPSKh.js} +1 -1
  45. package/dist/assets/{railroadDiagram-XR7U4H2S-CgA8NcMY.js → railroadDiagram-XR7U4H2S-I8gLnKDm.js} +1 -1
  46. package/dist/assets/{requirementDiagram-PLB6GJNP-D5BkeVLA.js → requirementDiagram-PLB6GJNP-0AbgBQwX.js} +1 -1
  47. package/dist/assets/{sankeyDiagram-IPEJSGJF-lEfgZleC.js → sankeyDiagram-IPEJSGJF-CELks0t3.js} +1 -1
  48. package/dist/assets/{sequenceDiagram-PO4LG4MO-iDpAQv2z.js → sequenceDiagram-PO4LG4MO-Lv5pg-Nj.js} +1 -1
  49. package/dist/assets/{sizeCapture-INFHLROL-hEJsAOhI.js → sizeCapture-INFHLROL-D13uYR-m.js} +1 -1
  50. package/dist/assets/{stateDiagram-v2-GCMORJYK-CKDZvZXj.js → stateDiagram-v2-GCMORJYK-C6ntlRJp.js} +1 -1
  51. package/dist/assets/{swimlanes-2SLR337P-_dOmzve2.js → swimlanes-2SLR337P-BBMTJMbP.js} +1 -1
  52. package/dist/assets/swimlanesDiagram-TC7HE7FX-CN2rFhol.js +8 -0
  53. package/dist/assets/{timeline-definition-EJHVYXUP-9GwS2a9Y.js → timeline-definition-EJHVYXUP-CQqiq_9n.js} +1 -1
  54. package/dist/assets/{usecaseDiagram-POWQR4AR-CqJl0zf1.js → usecaseDiagram-POWQR4AR-CMdMUvua.js} +1 -1
  55. package/dist/assets/{vennDiagram-UO4OBE2U-CGQiSSZm.js → vennDiagram-UO4OBE2U-DwNRIC20.js} +1 -1
  56. package/dist/assets/{wardleyDiagram-VNRHLVJA-D4KBo3Q_.js → wardleyDiagram-VNRHLVJA-BDP4uswI.js} +1 -1
  57. package/dist/assets/{xychartDiagram-PMCCYNJV-BgvRJLNL.js → xychartDiagram-PMCCYNJV-B9qFFRsi.js} +1 -1
  58. package/dist/index.html +1 -1
  59. package/dist-server/companion/src/routes.js +1 -0
  60. package/dist-server/index.js +1661 -965
  61. package/dist-server/server/connection-cap-failover.js +243 -0
  62. package/dist-server/server/engine-tiers-view.js +2 -0
  63. package/dist-server/server/index.js +54 -54
  64. package/dist-server/server/model-levels/chibitek-rankings.js +15 -5
  65. package/dist-server/server/paw/fill.js +342 -0
  66. package/dist-server/server/paw/http.js +66 -0
  67. package/dist-server/server/paw/loader.js +19 -2
  68. package/dist-server/server/paw/service.js +61 -4
  69. package/dist-server/server/paw/templates.js +15 -2
  70. package/dist-server/server/routes/engine-tiers.js +12 -1
  71. package/dist-server/server/skill-library.js +8 -0
  72. package/dist-server/shared/engine-tiers.js +9 -0
  73. package/dist-server/shared/paw.js +2 -2
  74. package/package.json +1 -1
  75. package/skills/build-paw/SKILL.md +212 -0
  76. package/skills/build-paw/VENDORED.md +5 -0
  77. package/skills/build-paw/manifest.json +19 -0
  78. package/skills/build-paw/paw-skeleton/AGENTS.md +9 -0
  79. package/skills/build-paw/paw-skeleton/CLAUDE.md +9 -0
  80. package/skills/build-paw/paw-skeleton/CONTEXT.md +10 -0
  81. package/skills/build-paw/paw-skeleton/README.md +5 -0
  82. package/skills/build-paw/paw-skeleton/departments/example-team/CONTEXT.md +5 -0
  83. package/skills/build-paw/paw-skeleton/departments/example-team/skills/README.md +1 -0
  84. package/skills/build-paw/paw-skeleton/departments/example-team/templates/README.md +1 -0
  85. package/skills/build-paw/paw-skeleton/departments/example-team/voice.md +3 -0
  86. package/skills/build-paw/paw-skeleton/me/CHANGELOG.md +7 -0
  87. package/skills/build-paw/paw-skeleton/me/about-me.md +7 -0
  88. package/skills/build-paw/paw-skeleton/me/personal/README.md +1 -0
  89. package/skills/build-paw/paw-skeleton/me/projects/.gitkeep +1 -0
  90. package/skills/build-paw/paw-skeleton/org/brand/voice.md +5 -0
  91. package/skills/build-paw/paw-skeleton/org/company.md +6 -0
  92. package/skills/build-paw/paw-skeleton/org/glossary.md +6 -0
  93. package/skills/build-paw/paw-skeleton/org/marketing/positioning.md +3 -0
  94. package/skills/build-paw/paw-skeleton/org/policies/ai-use.md +5 -0
  95. package/skills/build-paw/paw-skeleton/org/policies/engineering.md +5 -0
  96. package/skills/build-paw/paw-skeleton/org/policies/secrets.md +5 -0
  97. package/skills/build-paw/paw-skeleton/org/tools.md +3 -0
  98. package/skills/build-paw/paw-skeleton/paw.yaml +45 -0
  99. package/dist/assets/channel-DktfdxuU.js +0 -1
  100. package/dist/assets/swimlanesDiagram-TC7HE7FX-BROCOsEt.js +0 -8
@@ -0,0 +1,342 @@
1
+ // Build-paw fill helpers: detect missing / empty / sparse PAW, plan writes from
2
+ // interview answers, and commit only after a clear yes — with an extra yes for
3
+ // each org/policies file. Also appends me/CHANGELOG.md and refreshes reviewed
4
+ // dates. me/personal stays private unless the person asks to put something there.
5
+ import { isPolicyPath } from "./loader.js";
6
+ import { PAW_MANIFEST_FILE, serializeManifest, STALE_AFTER_DAYS } from "./manifest.js";
7
+ import { applyLocks, listFiles, pawExists, readManifest, readText, writeText, } from "./workspace.js";
8
+ /** Files that make a first PAW useful (skill acceptance checklist). */
9
+ export const COVERAGE_FILES = [
10
+ "me/about-me.md",
11
+ "org/company.md",
12
+ "org/tools.md",
13
+ "org/policies/ai-use.md",
14
+ "org/policies/secrets.md",
15
+ ];
16
+ const PLACEHOLDER_MARKERS = [
17
+ "(fill in)",
18
+ "Your Organization",
19
+ "An Administrator fills this in",
20
+ "## (no updates yet)",
21
+ "Only your Private Bot reads this folder",
22
+ ];
23
+ const clean = (value, max) => (value ?? "").replace(/\r\n?/g, "\n").replace(/\u2014/g, ", ").trim().slice(0, max);
24
+ /** Looks like a secret the interview must refuse to store. */
25
+ export function looksLikeSecret(text) {
26
+ return /(?:api[_-]?key|password|secret|token)\s*[:=]\s*\S+/i.test(text)
27
+ || /\bBearer\s+[A-Za-z0-9._\-+/=]{12,}/i.test(text)
28
+ || /\bsk-[A-Za-z0-9]{10,}/.test(text)
29
+ || /-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/.test(text);
30
+ }
31
+ export function isPlaceholderText(text) {
32
+ if (text == null)
33
+ return true;
34
+ const trimmed = text.trim();
35
+ if (!trimmed)
36
+ return true;
37
+ return PLACEHOLDER_MARKERS.some((marker) => trimmed.includes(marker));
38
+ }
39
+ function filled(root, path) {
40
+ return !isPlaceholderText(readText(root, path));
41
+ }
42
+ /** missing = no paw.yaml; empty = tree with nothing useful filled; sparse =
43
+ * some coverage but not enough for a useful first PAW; ready = covered. */
44
+ export function assessPawFill(root) {
45
+ if (!pawExists(root))
46
+ return "missing";
47
+ const aboutFilled = filled(root, "me/about-me.md");
48
+ const companyFilled = filled(root, "org/company.md");
49
+ const covered = COVERAGE_FILES.filter((path) => filled(root, path));
50
+ // A fresh empty template still has policy stubs; without about-me or company
51
+ // it is empty. Some coverage but not a full useful first PAW is sparse.
52
+ if (!aboutFilled && !companyFilled)
53
+ return "empty";
54
+ if (covered.length < COVERAGE_FILES.length || !aboutFilled)
55
+ return "sparse";
56
+ return "ready";
57
+ }
58
+ export function needsBuildPawInterview(root) {
59
+ const state = assessPawFill(root);
60
+ return state === "missing" || state === "empty" || state === "sparse";
61
+ }
62
+ /** Policy or important files whose reviewed date is missing or older than
63
+ * STALE_AFTER_DAYS (90). Used for Phase 3 follow-up questions. */
64
+ export function staleOrPlaceholderFiles(root, now = Date.now()) {
65
+ if (!pawExists(root))
66
+ return [...COVERAGE_FILES];
67
+ const manifest = readManifest(root);
68
+ const out = new Set();
69
+ for (const path of COVERAGE_FILES) {
70
+ if (!filled(root, path))
71
+ out.add(path);
72
+ }
73
+ for (const path of listFiles(root)) {
74
+ if (!(path.startsWith("org/") || path.startsWith("departments/")) || !path.endsWith(".md"))
75
+ continue;
76
+ if (/(^|\/)README\.md$/i.test(path))
77
+ continue;
78
+ const reviewed = manifest.files[path]?.reviewed;
79
+ if (!reviewed) {
80
+ out.add(path);
81
+ continue;
82
+ }
83
+ const age = Math.floor((now - Date.parse(`${reviewed}T00:00:00Z`)) / 86_400_000);
84
+ if (Number.isFinite(age) && age >= STALE_AFTER_DAYS)
85
+ out.add(path);
86
+ }
87
+ return [...out].sort();
88
+ }
89
+ function departmentId(name) {
90
+ return name.trim().toLowerCase().replace(/&/g, " and ").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60);
91
+ }
92
+ function line(label, value) {
93
+ return value ? `- **${label}:** ${value}\n` : "";
94
+ }
95
+ function bulletList(text) {
96
+ return text
97
+ .split(/\n|;|\u2022/)
98
+ .map((part) => part.replace(/^[-*]\s*/, "").trim())
99
+ .filter(Boolean)
100
+ .map((part) => `- ${part}`)
101
+ .join("\n");
102
+ }
103
+ /** Build the draft file set from interview answers. Does not write. */
104
+ export function planBuildPawWrites(root, answers, options = {}) {
105
+ const now = options.now ?? new Date();
106
+ const date = now.toISOString().slice(0, 10);
107
+ const entries = [];
108
+ const push = (path, summary, body, policy = false) => {
109
+ entries.push({ path, summary, policy, body: body.endsWith("\n") ? body : `${body}\n` });
110
+ };
111
+ const name = clean(answers.name, 80);
112
+ const role = clean(answers.role, 120);
113
+ const goals = clean(answers.goals, 2_000);
114
+ const style = clean(answers.workingStyle, 2_000);
115
+ const neverDo = clean(answers.neverDo, 2_000);
116
+ const company = clean(answers.company, 120);
117
+ const offer = clean(answers.offer, 2_000);
118
+ const market = clean(answers.market, 2_000);
119
+ const mission = clean(answers.mission, 2_000);
120
+ const hardRules = clean(answers.hardRules, 2_000);
121
+ const department = clean(answers.department, 80);
122
+ const teamOwns = clean(answers.teamOwns, 2_000);
123
+ const teamVoice = clean(answers.teamVoice, 2_000);
124
+ const tools = clean(answers.tools, 2_000);
125
+ const toolsApproved = clean(answers.toolsApproved, 2_000);
126
+ const toolsForbidden = clean(answers.toolsForbidden, 2_000);
127
+ const voice = clean(answers.voice, 2_000);
128
+ const preferWords = clean(answers.preferWords, 1_000);
129
+ const avoidWords = clean(answers.avoidWords, 1_000);
130
+ const positioning = clean(answers.positioning, 2_000);
131
+ const aiUse = clean(answers.aiUse, 2_000);
132
+ const engineeringRules = clean(answers.engineeringRules, 2_000);
133
+ const projects = clean(answers.projects, 2_000);
134
+ const privateProjects = clean(answers.privateProjects, 2_000);
135
+ if (name || role || goals || style || neverDo || company || department) {
136
+ push("me/about-me.md", "role, goals and how you like to work", [
137
+ `# About me\n\n`,
138
+ line("Name", name),
139
+ line("Role", role),
140
+ line("Department", department),
141
+ line("Company", company),
142
+ goals ? `\n## Goals\n\n${goals}\n` : "",
143
+ style ? `\n## How I like to work\n\n${style}\n` : "",
144
+ neverDo ? `\n## Never do\n\n${bulletList(neverDo)}\n` : "",
145
+ `\n_From the Atomic PAW interview, ${date}. Edit it any time in Settings > General > PAW._\n`,
146
+ ].join(""));
147
+ }
148
+ if (company || offer || market || mission || hardRules) {
149
+ push("org/company.md", "company name, what you sell, mission and hard rules", [
150
+ `# ${company || "Company"}\n\n`,
151
+ line("Name", company),
152
+ line("What we do", offer),
153
+ line("Who we serve", market),
154
+ line("Mission", mission),
155
+ hardRules ? `\n## Hard rules\n\n${bulletList(hardRules)}\n` : "",
156
+ ].join(""));
157
+ }
158
+ if (department) {
159
+ const id = departmentId(department) || "team";
160
+ push(`departments/${id}/CONTEXT.md`, `team pack for ${department}`, [
161
+ `# ${department}\n\n`,
162
+ teamOwns ? `## What we own\n\n${teamOwns}\n` : "How this team works day to day.\n",
163
+ ].join(""));
164
+ if (teamVoice) {
165
+ push(`departments/${id}/voice.md`, `writing voice for ${department}`, `# ${department} voice\n\n${teamVoice}\n`);
166
+ }
167
+ }
168
+ if (tools || toolsApproved || toolsForbidden) {
169
+ push("org/tools.md", "tools and systems (names only)", [
170
+ `# Tools\n\n`,
171
+ tools ? `## In daily use\n\n${bulletList(tools)}\n\n` : "",
172
+ toolsApproved ? `## Approved for assistants\n\n${bulletList(toolsApproved)}\n\n` : "",
173
+ toolsForbidden ? `## Do not touch\n\n${bulletList(toolsForbidden)}\n` : "",
174
+ ].join(""));
175
+ }
176
+ if (voice || preferWords || avoidWords) {
177
+ push("org/brand/voice.md", "writing voice and brand words", [
178
+ `# Voice\n\n`,
179
+ voice ? `${voice}\n\n` : "",
180
+ preferWords ? `## Prefer\n\n${bulletList(preferWords)}\n\n` : "",
181
+ avoidWords ? `## Avoid\n\n${bulletList(avoidWords)}\n` : "",
182
+ ].join(""));
183
+ }
184
+ if (preferWords || avoidWords) {
185
+ const terms = [
186
+ ...(preferWords ? preferWords.split(/\n|;/).map((w) => w.trim()).filter(Boolean).map((w) => `- Prefer: ${w}`) : []),
187
+ ...(avoidWords ? avoidWords.split(/\n|;/).map((w) => w.trim()).filter(Boolean).map((w) => `- Avoid: ${w}`) : []),
188
+ ].join("\n");
189
+ if (terms)
190
+ push("org/glossary.md", "glossary terms from brand words", `# Glossary\n\n${terms}\n`);
191
+ }
192
+ if (positioning || market) {
193
+ push("org/marketing/positioning.md", "who you serve and why you are different", [
194
+ `# Positioning\n\n`,
195
+ positioning || market,
196
+ "\n",
197
+ ].join(""));
198
+ }
199
+ if (aiUse || neverDo) {
200
+ push("org/policies/ai-use.md", "what assistants may do alone vs with your OK", [
201
+ `# AI use policy\n\n`,
202
+ aiUse ? `${bulletList(aiUse)}\n` : "- Humans own decisions that affect customers or money.\n- Agents propose; owners approve irreversible actions.\n",
203
+ neverDo ? `\n## Never do\n\n${bulletList(neverDo)}\n` : "",
204
+ "\n- No pasting secrets into prompts or PAW files.\n",
205
+ ].join(""), true);
206
+ }
207
+ if (engineeringRules) {
208
+ push("org/policies/engineering.md", "engineering and code rules", [
209
+ `# Engineering policy\n\n`,
210
+ bulletList(engineeringRules),
211
+ "\n",
212
+ ].join(""), true);
213
+ }
214
+ if (answers.secretsOk || hardRules.toLowerCase().includes("password") || hardRules.toLowerCase().includes("secret")) {
215
+ push("org/policies/secrets.md", "secrets stay in a password manager", `# Secrets policy
216
+
217
+ - Passwords and API keys live in a password manager, never in PAW, git, or chat.
218
+ - If an agent finds a secret in a file, it stops, redacts, and alerts the owner.
219
+ - Rotate anything that may have leaked.
220
+ `, true);
221
+ }
222
+ if (projects) {
223
+ push("me/projects/active.md", "active projects", `# Active projects\n\n${bulletList(projects)}\n`);
224
+ }
225
+ if (privateProjects) {
226
+ push("me/personal/projects.md", "private projects (me/personal only)", `# Private projects\n\n${bulletList(privateProjects)}\n`);
227
+ }
228
+ // paw.yaml org name / departments / owners when the empty template has no owner yet
229
+ if (pawExists(root) && (company || department || answers.ownerEmail)) {
230
+ const manifest = readManifest(root);
231
+ if (!manifest.owners.org) {
232
+ const next = {
233
+ ...manifest,
234
+ organization: {
235
+ ...manifest.organization,
236
+ name: company || manifest.organization.name,
237
+ },
238
+ owners: {
239
+ ...manifest.owners,
240
+ org: clean(answers.ownerEmail, 120) || manifest.owners.org,
241
+ },
242
+ };
243
+ if (department) {
244
+ const id = departmentId(department) || "team";
245
+ if (!next.departments.some((entry) => entry.id === id)) {
246
+ next.departments = [...next.departments, { id, name: department }];
247
+ }
248
+ if (answers.ownerEmail) {
249
+ next.owners.departments = { ...next.owners.departments, [id]: clean(answers.ownerEmail, 120) };
250
+ }
251
+ }
252
+ push(PAW_MANIFEST_FILE, "organization name and departments in paw.yaml", serializeManifest(next));
253
+ }
254
+ }
255
+ const topics = entries.map((entry) => entry.path.split("/").pop()?.replace(/\.md$/, "") || entry.path).slice(0, 8);
256
+ const changelogLine = topics.length
257
+ ? `Initial PAW filled from interview: ${topics.join(", ")}.`
258
+ : "PAW interview recorded with no file changes.";
259
+ return { entries, changelogLine };
260
+ }
261
+ /** Append a dated entry at the top of me/CHANGELOG.md (newest first). */
262
+ export function appendChangelog(root, line, options = {}) {
263
+ const now = options.now ?? new Date();
264
+ const date = now.toISOString().slice(0, 10);
265
+ const heading = options.zoneLabel ? `## ${date} (${options.zoneLabel})` : `## ${date}`;
266
+ const existing = readText(root, "me/CHANGELOG.md");
267
+ const header = "# PAW changelog\n\nDated notes of what changed in this workspace. Newest first.\n\n";
268
+ const body = existing && existing.includes("# PAW changelog")
269
+ ? existing.replace(/^# PAW changelog\n\n(?:Dated notes[^\n]*\n\n)?(?:## \(no updates yet\)\n\n[^\n]*\n\n)?/m, "")
270
+ : existing
271
+ ? `${existing.trim()}\n\n`
272
+ : "";
273
+ writeText(root, "me/CHANGELOG.md", `${header}${heading}\n- ${line.trim()}\n\n${body}`);
274
+ }
275
+ /** Refresh files.<path>.reviewed in paw.yaml for each written path. */
276
+ export function markReviewed(root, paths, options = {}) {
277
+ if (!pawExists(root) || !paths.length)
278
+ return;
279
+ const manifest = readManifest(root);
280
+ const reviewed = (options.now ?? new Date()).toISOString().slice(0, 10);
281
+ const owner = options.owner?.trim() || manifest.owners.org;
282
+ const files = { ...manifest.files };
283
+ for (const path of paths) {
284
+ if (path === PAW_MANIFEST_FILE)
285
+ continue;
286
+ files[path] = { ...files[path], ...(owner ? { owner } : {}), reviewed };
287
+ }
288
+ writeText(root, PAW_MANIFEST_FILE, serializeManifest({ ...manifest, files }));
289
+ }
290
+ /**
291
+ * Commit a write plan. Requires confirm: true. Every policy entry must also
292
+ * appear in confirmPolicies. me/personal paths need allowPersonal. Secrets in
293
+ * any body are refused.
294
+ */
295
+ export function commitBuildPawWrites(root, plan, options) {
296
+ const rejected = [];
297
+ const written = [];
298
+ if (!options.confirm) {
299
+ return {
300
+ written: [],
301
+ rejected: plan.entries.map((entry) => ({ path: entry.path, reason: "Waiting for a clear yes before saving." })),
302
+ changelog: false,
303
+ };
304
+ }
305
+ const confirmedPolicies = new Set((options.confirmPolicies ?? []).map((path) => path.trim()).filter(Boolean));
306
+ const manifest = pawExists(root) ? readManifest(root) : null;
307
+ for (const entry of plan.entries) {
308
+ if (looksLikeSecret(entry.body)) {
309
+ rejected.push({ path: entry.path, reason: "Refused: looks like a secret. Keep it in a password manager." });
310
+ continue;
311
+ }
312
+ if (entry.path.startsWith("me/personal/") && !options.allowPersonal) {
313
+ rejected.push({ path: entry.path, reason: "me/personal stays private unless you ask to put something there." });
314
+ continue;
315
+ }
316
+ const policy = entry.policy || (manifest ? isPolicyPath(manifest, entry.path) : entry.path.startsWith("org/policies/"));
317
+ if (policy && !confirmedPolicies.has(entry.path)) {
318
+ rejected.push({ path: entry.path, reason: `Policy file needs an explicit yes for ${entry.path}.` });
319
+ continue;
320
+ }
321
+ writeText(root, entry.path, entry.body);
322
+ written.push(entry.path);
323
+ }
324
+ let changelog = false;
325
+ if (written.length) {
326
+ appendChangelog(root, plan.changelogLine, { now: options.now, zoneLabel: options.zoneLabel });
327
+ changelog = true;
328
+ markReviewed(root, written.filter((path) => path !== PAW_MANIFEST_FILE && path !== "me/CHANGELOG.md"), {
329
+ owner: options.personEmail,
330
+ now: options.now,
331
+ });
332
+ if (manifest || pawExists(root))
333
+ applyLocks(root, readManifest(root), options.personEmail ?? "");
334
+ }
335
+ return { written, rejected, changelog };
336
+ }
337
+ /** One-shot: plan then commit. Used by the service and tests. */
338
+ export function applyBuildPawInterview(root, answers, options = { confirm: false }) {
339
+ const plan = planBuildPawWrites(root, answers, { now: options.now });
340
+ const result = commitBuildPawWrites(root, plan, options);
341
+ return { plan, result };
342
+ }
@@ -0,0 +1,66 @@
1
+ const field = (body, key, max) => (typeof body?.[key] === "string" ? body[key].slice(0, max) : undefined);
2
+ export function shortInterviewAnswers(body) {
3
+ return {
4
+ name: field(body, "name", 80),
5
+ role: field(body, "role", 120),
6
+ department: field(body, "department", 80),
7
+ company: field(body, "company", 120),
8
+ goals: field(body, "goals", 2_000),
9
+ workingStyle: field(body, "workingStyle", 2_000),
10
+ };
11
+ }
12
+ export function buildPawAnswersFromBody(body) {
13
+ return {
14
+ ...shortInterviewAnswers(body),
15
+ neverDo: field(body, "neverDo", 2_000),
16
+ offer: field(body, "offer", 2_000),
17
+ market: field(body, "market", 2_000),
18
+ mission: field(body, "mission", 2_000),
19
+ hardRules: field(body, "hardRules", 2_000),
20
+ teamOwns: field(body, "teamOwns", 2_000),
21
+ teamVoice: field(body, "teamVoice", 2_000),
22
+ tools: field(body, "tools", 2_000),
23
+ toolsApproved: field(body, "toolsApproved", 2_000),
24
+ toolsForbidden: field(body, "toolsForbidden", 2_000),
25
+ voice: field(body, "voice", 2_000),
26
+ preferWords: field(body, "preferWords", 1_000),
27
+ avoidWords: field(body, "avoidWords", 1_000),
28
+ positioning: field(body, "positioning", 2_000),
29
+ aiUse: field(body, "aiUse", 2_000),
30
+ engineeringRules: field(body, "engineeringRules", 2_000),
31
+ secretsOk: body?.secretsOk === true,
32
+ projects: field(body, "projects", 2_000),
33
+ privateProjects: field(body, "privateProjects", 2_000),
34
+ ownerEmail: field(body, "ownerEmail", 120),
35
+ };
36
+ }
37
+ export function interviewPlanResponse(paw, body) {
38
+ const plan = paw.planInterview(buildPawAnswersFromBody(body));
39
+ return {
40
+ fillState: paw.fillState(),
41
+ entries: plan.entries.map(({ path, summary, policy }) => ({ path, summary, policy })),
42
+ changelogLine: plan.changelogLine,
43
+ };
44
+ }
45
+ export async function interviewCommitResponse(paw, body) {
46
+ const confirmPolicies = Array.isArray(body?.confirmPolicies)
47
+ ? body.confirmPolicies.filter((item) => typeof item === "string").map((item) => item.slice(0, 200))
48
+ : [];
49
+ const { plan, result, status } = await paw.commitInterview(buildPawAnswersFromBody(body), {
50
+ confirm: body?.confirm === true,
51
+ confirmPolicies,
52
+ allowPersonal: body?.allowPersonal === true,
53
+ chibitek: body?.chibitek === true,
54
+ });
55
+ return {
56
+ status,
57
+ written: result.written,
58
+ rejected: result.rejected,
59
+ changelog: result.changelog,
60
+ plan: plan.entries.map(({ path, summary, policy }) => ({ path, summary, policy })),
61
+ };
62
+ }
63
+ /** Whether this turn should mount the build-paw skill. */
64
+ export function shouldMountBuildPaw(input) {
65
+ return input.runOn !== "cloud" && !input.personalBot && !input.freeBilling && input.needsInterview;
66
+ }
@@ -129,7 +129,7 @@ export function planLoad(view, manifest, options) {
129
129
  const LAYER_LABEL = { org: "organization", department: "department", me: "you", personal: "personal" };
130
130
  /** The system prompt section. "" when nothing loads. */
131
131
  export function pawPromptText(root, plan, options) {
132
- if (!plan.included.length && !plan.deferred.length)
132
+ if (!plan.included.length && !plan.deferred.length && options.fillState !== "missing" && options.fillState !== "empty" && options.fillState !== "sparse")
133
133
  return "";
134
134
  const lines = [];
135
135
  lines.push(`\n\nShared context (PAW): the person's Personal AI Workspace is the folder ${JSON.stringify(root)}.`);
@@ -140,6 +140,15 @@ export function pawPromptText(root, plan, options) {
140
140
  else {
141
141
  lines.push(`Layers load in order: organization${options.organization ? ` (${options.organization})` : ""}, then department, then the person. Where they disagree the later layer wins, except organization policies, which always win.`);
142
142
  lines.push(`Never open, list or read ${JSON.stringify(join(root, "me", "personal"))}: it is private to the person's Private Bot.`);
143
+ if (options.fillState === "missing" || options.fillState === "empty" || options.fillState === "sparse") {
144
+ lines.push("PAW is not filled in yet (missing, empty or sparse). Run the build-paw interview yourself: ask 3 to 5 skippable plain-language questions at a time across groups A–G, never ask for secrets or customer PII, show what you will write and where, save only after a clear yes, and require an explicit yes naming each file under org/policies/. Append every accepted update to me/CHANGELOG.md.");
145
+ }
146
+ else {
147
+ lines.push("When the person shares a new lasting fact (preference, hard rule, tool, team, project, brand word, never-do), propose the exact PAW file and section to update, save after a yes, require an explicit yes for org/policies/**, never write me/personal/ unless they ask, and append a dated line to me/CHANGELOG.md.");
148
+ }
149
+ if (options.followUps?.length) {
150
+ lines.push(`These PAW files are still placeholders or were not reviewed in over 90 days — ask a few skippable follow-up questions to refresh them: ${options.followUps.map((path) => JSON.stringify(path)).join(", ")}.`);
151
+ }
143
152
  }
144
153
  for (const file of plan.included) {
145
154
  lines.push(`\n--- ${file.path} (${LAYER_LABEL[file.layer]}) ---\n${file.text.trim()}`);
@@ -159,5 +168,13 @@ export function pawPromptText(root, plan, options) {
159
168
  export function pawSystemPrompt(root, manifest, options) {
160
169
  const view = mergeView(listFiles(root), manifest, options);
161
170
  const plan = planLoad(view, manifest, { ...options, read: (path) => readText(root, path) });
162
- return { text: pawPromptText(root, plan, { personalBot: options.personalBot, organization: manifest.organization.name }), plan };
171
+ return {
172
+ text: pawPromptText(root, plan, {
173
+ personalBot: options.personalBot,
174
+ organization: manifest.organization.name,
175
+ fillState: options.fillState,
176
+ followUps: options.followUps,
177
+ }),
178
+ plan,
179
+ };
163
180
  }
@@ -11,6 +11,7 @@ import { mergeView, pawSystemPrompt } from "./loader.js";
11
11
  import { PAW_MANIFEST_FILE, isLockedPath, safeRelative, serializeManifest, staleFiles } from "./manifest.js";
12
12
  import { chooseSource, pullLayers } from "./sync.js";
13
13
  import { builtinTemplate, chooseTemplateName, emptyTemplate, parseTemplateJson } from "./templates.js";
14
+ import { applyBuildPawInterview, assessPawFill, isPlaceholderText, needsBuildPawInterview, planBuildPawWrites, staleOrPlaceholderFiles, } from "./fill.js";
14
15
  import { applyInterview, applyLocks, defaultPawRoot, ensureWorkspace, listFiles, pawExists, readManifest, readText, writeAboutMe, writeText, } from "./workspace.js";
15
16
  import { CLI_TOOLS, renderPointer, writeCliPointer } from "./wiring.js";
16
17
  export class PawService {
@@ -90,7 +91,7 @@ export class PawService {
90
91
  this.state = { ...this.state, template: "chibitek" };
91
92
  }
92
93
  // an About me already there (written by hand, or filled from Nexus) is kept
93
- const result = applyInterview(this.root, { ...answers, name: answers.name || this.options.person().name }, { personEmail: this.options.person().email, keepAboutMe: Boolean(this.aboutMe().trim()) });
94
+ const result = applyInterview(this.root, { ...answers, name: answers.name || this.options.person().name }, { personEmail: this.options.person().email, keepAboutMe: Boolean(this.aboutMe().trim()) && !isPlaceholderText(this.aboutMe()) });
94
95
  this.saveState({ ...this.state, departments: result.departments, interviewedAt: Date.now() });
95
96
  return this.status();
96
97
  }
@@ -118,11 +119,66 @@ export class PawService {
118
119
  const known = new Set(this.manifest().departments.map((department) => department.id));
119
120
  this.saveState({ ...this.state, departments: [...new Set(ids)].filter((id) => known.has(id)) });
120
121
  }
121
- /** This turn's PAW section. "" when PAW is off or not on this computer. */
122
+ /** missing / empty / sparse / ready for the build-paw interview. */
123
+ fillState() {
124
+ if (!this.enabled())
125
+ return "missing";
126
+ return assessPawFill(this.root);
127
+ }
128
+ /** True when the build-paw skill should mount for a company bot turn. */
129
+ needsInterview() {
130
+ return this.enabled() && needsBuildPawInterview(this.root);
131
+ }
132
+ /** This turn's PAW section. "" when PAW is off or not on this computer.
133
+ * Still returns interview guidance when the folder is missing or empty. */
122
134
  systemPrompt(input) {
123
- if (!this.enabled() || !this.exists())
135
+ if (!this.enabled())
124
136
  return "";
125
- return pawSystemPrompt(this.root, this.manifest(), { departments: this.state.departments, personalBot: input.personalBot, request: input.request }).text;
137
+ if (!this.exists()) {
138
+ // nudge even before ensure(): the skill creates the tree
139
+ return pawSystemPrompt(this.root, this.manifest(), {
140
+ departments: this.state.departments,
141
+ personalBot: input.personalBot,
142
+ request: input.request,
143
+ fillState: "missing",
144
+ }).text;
145
+ }
146
+ const fillState = this.fillState();
147
+ const followUps = input.personalBot ? [] : staleOrPlaceholderFiles(this.root);
148
+ return pawSystemPrompt(this.root, this.manifest(), {
149
+ departments: this.state.departments,
150
+ personalBot: input.personalBot,
151
+ request: input.request,
152
+ fillState,
153
+ followUps: fillState === "ready" ? followUps : followUps.slice(0, 12),
154
+ }).text;
155
+ }
156
+ /** Draft the files a build-paw interview would write (no disk changes). */
157
+ planInterview(answers) {
158
+ return planBuildPawWrites(this.root, answers);
159
+ }
160
+ /** Save interview files after confirm / confirmPolicies. */
161
+ async commitInterview(answers, options) {
162
+ if (!this.exists())
163
+ await this.ensure({ chibitek: options.chibitek });
164
+ const { plan, result } = applyBuildPawInterview(this.root, {
165
+ ...answers,
166
+ name: answers.name || this.options.person().name,
167
+ }, {
168
+ ...options,
169
+ personEmail: options.personEmail ?? this.options.person().email,
170
+ zoneLabel: options.zoneLabel ?? "America/New_York",
171
+ });
172
+ if (result.written.length) {
173
+ const departments = [...this.state.departments];
174
+ for (const path of result.written) {
175
+ const match = /^departments\/([^/]+)\//.exec(path);
176
+ if (match && !departments.includes(match[1]))
177
+ departments.push(match[1]);
178
+ }
179
+ this.saveState({ ...this.state, departments, interviewedAt: Date.now() });
180
+ }
181
+ return { plan, result, status: this.status() };
126
182
  }
127
183
  async sync() {
128
184
  const manifest = this.manifest();
@@ -181,6 +237,7 @@ export class PawService {
181
237
  organization: manifest.organization.name,
182
238
  template: this.state.template ?? manifest.organization.template,
183
239
  interviewed: Boolean(this.state.interviewedAt),
240
+ fillState: this.exists() ? assessPawFill(this.root) : "missing",
184
241
  departments: manifest.departments.map((department) => ({ ...department, joined: joined.has(department.id) })),
185
242
  layers: exists
186
243
  ? { org: listFiles(this.root, "org").length, departments: listFiles(this.root, "departments").length, me: listFiles(this.root, "me").filter((path) => !path.startsWith("me/personal/")).length }
@@ -36,12 +36,25 @@ department or person can override them.
36
36
  `;
37
37
  const README = (title, body) => `# ${title}\n\n${body}\n`;
38
38
  function emptyFiles() {
39
+ // Shape matches skills/build-paw/paw-skeleton so the interview has a place
40
+ // for every answer. Placeholders stay until the person fills them.
39
41
  return {
40
- "org/company.md": README("Company", "Who we are, what we do and the rules that always apply. An Administrator fills this in. Never put passwords or keys here, only where to find them (for example \"in 1Password\")."),
41
- "org/policies/README.md": README("Policies", "Company policies (security, AI use, approvals). Nothing in a department or personal folder can override a file here."),
42
+ "org/company.md": "# Company\n\n- Name: Your Organization\n- What we do: (fill in)\n- Mission: (fill in)\n- Hard rules agents must follow: (fill in; no secrets)\n",
43
+ "org/glossary.md": README("Glossary", "Company and product terms. (fill in)"),
44
+ "org/tools.md": README("Tools", "Approved apps, engines and connectors assistants may talk about. (fill in)"),
45
+ "org/policies/ai-use.md": "# AI use policy\n\n- Humans own decisions that affect customers or money.\n- Agents propose; owners approve irreversible actions.\n- No pasting secrets into prompts or PAW files.\n",
46
+ "org/policies/engineering.md": "# Engineering policy\n\n- Tests before merge for behavior changes.\n- No force-push to shared main without explicit owner OK.\n- Dependencies stay pinned; review new ones before adding.\n",
47
+ "org/policies/secrets.md": "# Secrets policy\n\n- Passwords and API keys live in a password manager, never in PAW, git, or chat.\n- If an agent finds a secret in a file, it stops, redacts, and alerts the owner.\n- Rotate anything that may have leaked.\n",
48
+ "org/brand/voice.md": README("Voice", "How writing should sound. (fill in)"),
42
49
  "org/brand/README.md": README("Brand", "Logos, colors, fonts, voice and tone."),
50
+ "org/marketing/positioning.md": README("Positioning", "Who you serve and why you are different. (fill in)"),
43
51
  "org/marketing/README.md": README("Marketing", "Positioning, approved claims, campaigns."),
44
52
  "org/clients/README.md": README("Clients", "Client profiles, scoped by role. Never patient data."),
53
+ "me/about-me.md": "# About me\n\n- **Name:** (fill in)\n- **Role:** (fill in)\n\n## Goals\n\n(fill in)\n\n## How I like to work\n\n(fill in)\n",
54
+ "me/CHANGELOG.md": "# PAW changelog\n\nDated notes of what changed in this workspace. Newest first.\n\n## (no updates yet)\n\nFilled by the build-paw interview and later lasting-fact saves.\n",
55
+ "CLAUDE.md": "# Claude rules for this PAW\n\n- If PAW is unfilled, run the build-paw interview first. When I share new lasting facts, offer to save them to the right PAW file.\n- Read `paw.yaml` first. Load only the files the matching job lists.\n- Policies under `org/policies/` always win. Never override them without an explicit yes for that file.\n- Never read or write secrets. Point to a password manager instead.\n- Prefer editing `me/` for personal notes. Propose changes to `org/` and `departments/` and save after a quick yes.\n- Keep `me/personal/` private. Append accepted updates to `me/CHANGELOG.md`.\n- Keep answers short. Cite the PAW file you used.\n",
56
+ "AGENTS.md": "# Agent rules for this PAW\n\n- If PAW is unfilled, run the build-paw interview first. When I share new lasting facts, offer to save them to the right PAW file.\n- Layer order: organization, then department, then person.\n- Closer layers win only where `paw.yaml` lists them under `overridable`.\n- `me/personal/` is private. Company-scoped agents must not open it.\n- Stop loading files when the token budget is spent. List remaining paths instead.\n- No credentials, tokens, or customer PII in any PAW file.\n- Log accepted updates in `me/CHANGELOG.md` with the date.\n",
57
+ "CONTEXT.md": README("Context", "Signpost for which PAW files to load for a job. Prefer paw.yaml load rules."),
45
58
  };
46
59
  }
47
60
  export function emptyTemplate(organization = "") {
@@ -1,4 +1,4 @@
1
- import { isBotTier, isModelClass, MODEL_CLASSES } from "../../shared/engine-tiers.js";
1
+ import { DEFAULT_CONNECTION_RUN_OUT, isBotTier, isConnectionRunOutPolicy, isModelClass, MODEL_CLASSES } from "../../shared/engine-tiers.js";
2
2
  import { checkedLadder, rebalanceRow, withLadder, withTierClass } from "../engine-tiers.js";
3
3
  import { engineTiersView } from "../engine-tiers-view.js";
4
4
  import { PASS } from "./table.js";
@@ -100,6 +100,17 @@ export function createEngineTierRoutes(deps) {
100
100
  deps.saveEngineTiers(value ? { ...rest, includeFree: true } : rest);
101
101
  return json(res, 200, await view());
102
102
  }
103
+ if (path === "/api/engine-tiers/connection-run-out" && method === "PUT") {
104
+ if (deps.disabled())
105
+ return disabled();
106
+ const body = await readBody(req);
107
+ const value = body && typeof body === "object" && !Array.isArray(body) && Object.keys(body).length === 1 ? body.connectionRunOut : undefined;
108
+ if (!isConnectionRunOutPolicy(value))
109
+ return json(res, 400, { error: 'send { connectionRunOut: "ask" | "ask-before-paid" | "keep-going" }' });
110
+ const { connectionRunOut: _was, ...rest } = deps.engineTiers() ?? { ladders: {} };
111
+ deps.saveEngineTiers(value === DEFAULT_CONNECTION_RUN_OUT ? rest : { ...rest, connectionRunOut: value });
112
+ return json(res, 200, await view());
113
+ }
103
114
  if (path === "/api/engine-tiers/rebalance" && method === "GET") {
104
115
  if (deps.disabled())
105
116
  return disabled();
@@ -126,3 +126,11 @@ export function renderSkillInstructions(selected, { includeRoot = false } = {})
126
126
  return "";
127
127
  return selected.map(({ manifest, instructions, directory }) => `\n\n<openmaus-skill id=${JSON.stringify(manifest.id)} version=${JSON.stringify(manifest.version)}${includeRoot ? ` root=${JSON.stringify(directory)}` : ""}>\n${instructions}\n</openmaus-skill>`).join("");
128
128
  }
129
+ /** Mount build-paw when PAW still needs the interview. Callers skip free-tier
130
+ * turns and the Private Bot before calling this. */
131
+ export function withBuildPawSkill(selected, skills, needsInterview) {
132
+ if (!needsInterview)
133
+ return [...selected];
134
+ const skill = skills.find((entry) => entry.manifest.id === "build-paw");
135
+ return skill ? mergeSkills(selected, [skill]) : [...selected];
136
+ }
@@ -14,6 +14,15 @@ export const MODEL_CLASSES = ["Mezcal", "Plata", "Reposado", "Añejo"];
14
14
  export function isModelClass(value) {
15
15
  return typeof value === "string" && MODEL_CLASSES.includes(value);
16
16
  }
17
+ /** What happens when a connection hits its plan limit (Capy run-out setting).
18
+ * ask: stop before any next connection. ask-before-paid (default): move to
19
+ * another subscription, and stop before a pay-per-use key.
20
+ * keep-going: move on, including onto pay-per-use keys. */
21
+ export const CONNECTION_RUN_OUT_POLICIES = ["ask", "ask-before-paid", "keep-going"];
22
+ export const DEFAULT_CONNECTION_RUN_OUT = "ask-before-paid";
23
+ export function isConnectionRunOutPolicy(value) {
24
+ return typeof value === "string" && CONNECTION_RUN_OUT_POLICIES.includes(value);
25
+ }
17
26
  /** The levels step 3 graded before classes, as older config and override
18
27
  * files still hold them: L1 Mezcal, L2 Plata, L3 Reposado, L4 Añejo. */
19
28
  export const LEGACY_LEVEL_CLASSES = {
@@ -8,7 +8,7 @@ export const CHIBITEK_DEPARTMENTS = [
8
8
  { id: "creative", name: "Creative" },
9
9
  { id: "sales-and-marketing", name: "Sales and Marketing" },
10
10
  ];
11
- /** The interview can be sent once at least one answer is filled in. */
11
+ /** The short wizard interview can be sent once at least one answer is filled in. */
12
12
  export function interviewHasAnswers(answers) {
13
- return ["role", "department", "company", "goals", "workingStyle"].some((key) => Boolean(answers[key]?.trim()));
13
+ return ["role", "department", "company", "goals", "workingStyle"].some((key) => Boolean(answers[key]?.toString().trim()));
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chibitek/chibi",
3
- "version": "0.1.179",
3
+ "version": "0.1.180",
4
4
  "description": "Atomic by Chibitek: run your AI team's server anywhere and pair your devices to it",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",