@koan-labs/koan 0.2.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 (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +138 -0
  3. package/dist/cli/main.d.ts +2 -0
  4. package/dist/cli/main.js +399 -0
  5. package/dist/cli/prompt.d.ts +5 -0
  6. package/dist/cli/prompt.js +48 -0
  7. package/dist/core/answers.d.ts +27 -0
  8. package/dist/core/answers.js +86 -0
  9. package/dist/core/commandLog.d.ts +8 -0
  10. package/dist/core/commandLog.js +51 -0
  11. package/dist/core/commands.d.ts +71 -0
  12. package/dist/core/commands.js +252 -0
  13. package/dist/core/constants.d.ts +32 -0
  14. package/dist/core/constants.js +36 -0
  15. package/dist/core/crystallize.d.ts +15 -0
  16. package/dist/core/crystallize.js +124 -0
  17. package/dist/core/documents.d.ts +11 -0
  18. package/dist/core/documents.js +72 -0
  19. package/dist/core/gitPolicy.d.ts +2 -0
  20. package/dist/core/gitPolicy.js +25 -0
  21. package/dist/core/handoff.d.ts +5 -0
  22. package/dist/core/handoff.js +20 -0
  23. package/dist/core/hostAdapter.d.ts +8 -0
  24. package/dist/core/hostAdapter.js +34 -0
  25. package/dist/core/lock.d.ts +5 -0
  26. package/dist/core/lock.js +142 -0
  27. package/dist/core/mcpCache.d.ts +4 -0
  28. package/dist/core/mcpCache.js +37 -0
  29. package/dist/core/prd.d.ts +33 -0
  30. package/dist/core/prd.js +151 -0
  31. package/dist/core/profile.d.ts +8 -0
  32. package/dist/core/profile.js +47 -0
  33. package/dist/core/profileRef.d.ts +3 -0
  34. package/dist/core/profileRef.js +41 -0
  35. package/dist/core/project.d.ts +17 -0
  36. package/dist/core/project.js +126 -0
  37. package/dist/core/qa.d.ts +6 -0
  38. package/dist/core/qa.js +26 -0
  39. package/dist/core/questions.d.ts +10 -0
  40. package/dist/core/questions.js +272 -0
  41. package/dist/core/reconstruct.d.ts +7 -0
  42. package/dist/core/reconstruct.js +62 -0
  43. package/dist/core/schemas.d.ts +331 -0
  44. package/dist/core/schemas.js +132 -0
  45. package/dist/core/scoring.d.ts +9 -0
  46. package/dist/core/scoring.js +72 -0
  47. package/dist/core/session.d.ts +6 -0
  48. package/dist/core/session.js +88 -0
  49. package/dist/index.d.ts +18 -0
  50. package/dist/index.js +18 -0
  51. package/dist/mcp/server.d.ts +5 -0
  52. package/dist/mcp/server.js +539 -0
  53. package/package.json +55 -0
@@ -0,0 +1,272 @@
1
+ import { adapterFor } from "./hostAdapter.js";
2
+ const fallbackLevels = ["beginner", "intermediate", "expert", "non_technical"];
3
+ const bank = {
4
+ purpose: {
5
+ intent: "Clarify why this product deserves to exist.",
6
+ text: {
7
+ ko: {
8
+ non_technical: "이것이 완성되어 잘 작동한다면, 지금은 불가능한 어떤 일이 누군가에게 가능해지나요?",
9
+ beginner: "이 프로젝트가 해결해야 하는 가장 중요한 문제는 무엇이고, 왜 그 문제가 당신에게 중요한가요?",
10
+ intermediate: "이 제품이 존재해야 하는 이유를 한 문장으로 말하면 무엇인가요?",
11
+ expert: "이 제품의 존재 이유와, 다른 것이 만들지 못하는 핵심 outcome을 정의해 주세요."
12
+ },
13
+ en: {
14
+ non_technical: "If this existed and worked beautifully, what would become possible for someone that is not possible today?",
15
+ beginner: "What is the most important problem this should solve, and why does it matter to you?",
16
+ intermediate: "In one sentence, why should this product exist?",
17
+ expert: "Define the product's reason for existence and the core outcome nothing else creates."
18
+ },
19
+ mixed: {
20
+ non_technical: "이것이 완성되면, 지금은 impossible한 어떤 일이 누군가에게 possible해지나요?",
21
+ beginner: "해결해야 할 most important problem은 무엇이고, 왜 당신에게 중요한가요?",
22
+ intermediate: "이 product가 존재해야 하는 이유를 한 문장으로 말하면 무엇인가요?",
23
+ expert: "이 product의 reason for existence와 핵심 outcome을 정의해 주세요."
24
+ }
25
+ }
26
+ },
27
+ target_users: {
28
+ intent: "Identify who changes if the project succeeds.",
29
+ text: {
30
+ ko: {
31
+ non_technical: "이게 완성되면 누가 가장 도움을 받나요?",
32
+ beginner: "주 사용자는 누구이고, 그 사람의 어떤 상황이 달라지나요?",
33
+ intermediate: "이 프로젝트의 target user와 개선될 workflow는 무엇인가요?",
34
+ expert: "Primary user segment와 user outcome을 정의해 주세요."
35
+ },
36
+ en: {
37
+ non_technical: "Who benefits most if this works?",
38
+ beginner: "Who is the main user, and what gets easier for them?",
39
+ intermediate: "What target user and workflow does this improve?",
40
+ expert: "Define the primary user segment and user outcome."
41
+ },
42
+ mixed: {
43
+ non_technical: "이게 완성되면 who benefits most인가요?",
44
+ beginner: "main user는 누구이고 무엇이 easier해지나요?",
45
+ intermediate: "target user와 개선될 workflow는 무엇인가요?",
46
+ expert: "primary user segment와 user outcome을 정의해 주세요."
47
+ }
48
+ }
49
+ },
50
+ current_goal: {
51
+ intent: "Define the active goal for this Koan session.",
52
+ text: {
53
+ ko: {
54
+ non_technical: "이번에 먼저 끝내고 싶은 한 가지는 무엇인가요?",
55
+ beginner: "지금 당장 Koan이 정리해야 할 목표 하나를 고르면 무엇인가요?",
56
+ intermediate: "이번 세션의 active goal은 무엇인가요?",
57
+ expert: "Define the active goal for this planning cycle."
58
+ },
59
+ en: {
60
+ non_technical: "What is the one thing you want to finish first?",
61
+ beginner: "What single goal should Koan clarify right now?",
62
+ intermediate: "What is the active goal for this session?",
63
+ expert: "Define the active goal for this planning cycle."
64
+ },
65
+ mixed: {
66
+ non_technical: "먼저 finish하고 싶은 one thing은 무엇인가요?",
67
+ beginner: "지금 Koan이 clarify할 single goal은 무엇인가요?",
68
+ intermediate: "이번 session의 active goal은 무엇인가요?",
69
+ expert: "이번 planning cycle의 active goal을 정의해 주세요."
70
+ }
71
+ }
72
+ },
73
+ scope: {
74
+ intent: "Clarify what is inside the current goal.",
75
+ text: {
76
+ ko: {
77
+ non_technical: "이번에 꼭 포함되어야 하는 일은 무엇인가요?",
78
+ beginner: "이번 목표 안에 들어가는 기능이나 결과물은 무엇인가요?",
79
+ intermediate: "이번 scope에 포함되는 deliverable은 무엇인가요?",
80
+ expert: "List the in-scope deliverables for this goal."
81
+ },
82
+ en: {
83
+ non_technical: "What must be included this time?",
84
+ beginner: "What features or outputs belong inside this goal?",
85
+ intermediate: "What deliverables are in scope?",
86
+ expert: "List the in-scope deliverables for this goal."
87
+ },
88
+ mixed: {
89
+ non_technical: "이번에 must include 되는 일은 무엇인가요?",
90
+ beginner: "이번 goal 안에 들어가는 features나 outputs는 무엇인가요?",
91
+ intermediate: "이번 scope의 deliverables는 무엇인가요?",
92
+ expert: "in-scope deliverables를 정의해 주세요."
93
+ }
94
+ }
95
+ },
96
+ non_goals: {
97
+ intent: "Clarify what must not be included now.",
98
+ text: {
99
+ ko: {
100
+ non_technical: "이번에는 하지 말아야 할 일은 무엇인가요?",
101
+ beginner: "나중으로 미루거나 제외해야 하는 것은 무엇인가요?",
102
+ intermediate: "이번 목표의 non-goals는 무엇인가요?",
103
+ expert: "Define explicit non-goals and exclusions."
104
+ },
105
+ en: {
106
+ non_technical: "What should not be done this time?",
107
+ beginner: "What should be postponed or excluded?",
108
+ intermediate: "What are the non-goals for this goal?",
109
+ expert: "Define explicit non-goals and exclusions."
110
+ },
111
+ mixed: {
112
+ non_technical: "이번에는 not do 해야 할 일은 무엇인가요?",
113
+ beginner: "postpone하거나 exclude할 것은 무엇인가요?",
114
+ intermediate: "이번 goal의 non-goals는 무엇인가요?",
115
+ expert: "explicit non-goals와 exclusions를 정의해 주세요."
116
+ }
117
+ }
118
+ },
119
+ constraints: {
120
+ intent: "Identify constraints that shape the plan.",
121
+ text: {
122
+ ko: {
123
+ non_technical: "꼭 지켜야 하는 조건이나 제한이 있나요?",
124
+ beginner: "시간, 비용, 도구, 환경 중 반드시 맞춰야 하는 조건은 무엇인가요?",
125
+ intermediate: "이번 구현의 constraints는 무엇인가요?",
126
+ expert: "List technical, operational, and product constraints."
127
+ },
128
+ en: {
129
+ non_technical: "Are there any rules or limits we must respect?",
130
+ beginner: "What time, cost, tool, or environment limits matter?",
131
+ intermediate: "What constraints shape this implementation?",
132
+ expert: "List technical, operational, and product constraints."
133
+ },
134
+ mixed: {
135
+ non_technical: "꼭 respect해야 하는 rules나 limits가 있나요?",
136
+ beginner: "time, cost, tool, environment limits 중 중요한 것은 무엇인가요?",
137
+ intermediate: "이번 implementation constraints는 무엇인가요?",
138
+ expert: "technical, operational, product constraints를 정의해 주세요."
139
+ }
140
+ }
141
+ },
142
+ success_criteria: {
143
+ intent: "Define how completion will be judged.",
144
+ text: {
145
+ ko: {
146
+ non_technical: "무엇을 보면 '이제 됐다'고 말할 수 있나요?",
147
+ beginner: "이 작업이 finished 되었다고 판단할 결과는 무엇인가요?",
148
+ intermediate: "완료 판단 기준과 검증 방법은 무엇인가요?",
149
+ expert: "Define acceptance criteria and verification signals."
150
+ },
151
+ en: {
152
+ non_technical: "What will make you say, 'this is done'?",
153
+ beginner: "What result proves this is finished?",
154
+ intermediate: "What completion criteria and verification steps matter?",
155
+ expert: "Define acceptance criteria and verification signals."
156
+ },
157
+ mixed: {
158
+ non_technical: "무엇을 보면 'this is done'이라고 말할 수 있나요?",
159
+ beginner: "이 작업이 finished 됐다는 result는 무엇인가요?",
160
+ intermediate: "completion criteria와 verification steps는 무엇인가요?",
161
+ expert: "acceptance criteria와 verification signals를 정의해 주세요."
162
+ }
163
+ }
164
+ },
165
+ philosophical_intent: {
166
+ intent: "Surface the deeper need behind the surface solution and the principle the product must never betray.",
167
+ text: {
168
+ ko: {
169
+ non_technical: "기능 말고, 왜 이것이 세상에 있어야 한다고 느끼나요?",
170
+ beginner: "처음 떠올린 기능 뒤에 있는 진짜 필요나 답답함은 무엇인가요?",
171
+ intermediate: "이 제품이 표면 문제를 완벽히 해결하더라도, 그 과정에서 절대 훼손하면 안 되는 가치는 무엇인가요?",
172
+ expert: "모든 tradeoff에서 거부권을 갖는 product philosophy — 타협 불가능한 가치 — 를 정의해 주세요."
173
+ },
174
+ en: {
175
+ non_technical: "Beyond features, why does this deserve to exist in the world?",
176
+ beginner: "What real need or frustration sits behind the feature you first imagined?",
177
+ intermediate: "If this solved the surface problem perfectly, what value must it never damage along the way?",
178
+ expert: "Define the product philosophy: the non-negotiable value that can veto features and guide tradeoffs."
179
+ },
180
+ mixed: {
181
+ non_technical: "features 말고, 왜 이것이 세상에 exist해야 한다고 느끼나요?",
182
+ beginner: "처음 떠올린 feature 뒤에 있는 real need나 답답함은 무엇인가요?",
183
+ intermediate: "surface problem을 완벽히 해결하더라도 절대 damage하면 안 되는 value는 무엇인가요?",
184
+ expert: "모든 tradeoff에 거부권을 갖는 product philosophy를 정의해 주세요."
185
+ }
186
+ }
187
+ },
188
+ implementation_plan: {
189
+ intent: "Clarify enough structure for implementation planning.",
190
+ text: {
191
+ ko: {
192
+ non_technical: "어떤 순서로 만들면 가장 자연스러울까요?",
193
+ beginner: "처음 만들 부분, 그 다음 만들 부분을 나누면 어떻게 되나요?",
194
+ intermediate: "구현을 어떤 단계로 나누면 좋을까요?",
195
+ expert: "What implementation phases and module boundaries should the plan use?"
196
+ },
197
+ en: {
198
+ non_technical: "What order would feel natural to build this in?",
199
+ beginner: "What should be built first, second, and after that?",
200
+ intermediate: "How should implementation be split into phases?",
201
+ expert: "What implementation phases and module boundaries should the plan use?"
202
+ },
203
+ mixed: {
204
+ non_technical: "어떤 order로 build하면 자연스러울까요?",
205
+ beginner: "first, second, after that으로 나누면 어떻게 되나요?",
206
+ intermediate: "implementation phases를 어떻게 나누면 좋을까요?",
207
+ expert: "implementation phases와 module boundaries를 정의해 주세요."
208
+ }
209
+ }
210
+ },
211
+ qa_criteria: {
212
+ intent: "Define how review should judge the work.",
213
+ text: {
214
+ ko: {
215
+ non_technical: "검토할 때 꼭 확인해야 하는 것은 무엇인가요?",
216
+ beginner: "잘 만들었는지 확인할 체크리스트는 무엇인가요?",
217
+ intermediate: "QA 기준과 테스트 기대치는 무엇인가요?",
218
+ expert: "Define spec-compliance and general quality review criteria."
219
+ },
220
+ en: {
221
+ non_technical: "What must be checked during review?",
222
+ beginner: "What checklist proves this was built well?",
223
+ intermediate: "What QA criteria and test expectations matter?",
224
+ expert: "Define spec-compliance and general quality review criteria."
225
+ },
226
+ mixed: {
227
+ non_technical: "review 때 꼭 check해야 하는 것은 무엇인가요?",
228
+ beginner: "잘 만들었는지 확인할 checklist는 무엇인가요?",
229
+ intermediate: "QA criteria와 test expectations는 무엇인가요?",
230
+ expert: "spec-compliance와 general quality criteria를 정의해 주세요."
231
+ }
232
+ }
233
+ },
234
+ handoff_readiness: {
235
+ intent: "Clarify what another agent needs to continue.",
236
+ text: {
237
+ ko: {
238
+ non_technical: "다른 사람이 이어받으려면 꼭 알아야 할 것은 무엇인가요?",
239
+ beginner: "Codex나 Claude가 다음에 바로 이어가려면 어떤 설명이 필요할까요?",
240
+ intermediate: "handoff에 반드시 포함할 맥락과 다음 행동은 무엇인가요?",
241
+ expert: "What context, state, and next action are required for handoff?"
242
+ },
243
+ en: {
244
+ non_technical: "What must another person know to continue?",
245
+ beginner: "What should Codex or Claude know to pick this up next?",
246
+ intermediate: "What context and next action must handoff include?",
247
+ expert: "What context, state, and next action are required for handoff?"
248
+ },
249
+ mixed: {
250
+ non_technical: "다른 사람이 continue하려면 꼭 알아야 할 것은 무엇인가요?",
251
+ beginner: "Codex나 Claude가 pick up하려면 어떤 설명이 필요할까요?",
252
+ intermediate: "handoff에 포함할 context와 next action은 무엇인가요?",
253
+ expert: "handoff에 required context, state, next action을 정의해 주세요."
254
+ }
255
+ }
256
+ }
257
+ };
258
+ export function getQuestion(axis, profile, host = "generic") {
259
+ const template = bank[axis];
260
+ const language = profile.language;
261
+ const byLevel = template.text[language] ?? template.text.ko;
262
+ const question = byLevel[profile.developmentUnderstanding] ??
263
+ fallbackLevels.map((level) => byLevel[level]).find(Boolean) ??
264
+ template.intent;
265
+ return {
266
+ axis,
267
+ intent: template.intent,
268
+ userFacingQuestion: question,
269
+ answerSchema: "free_text",
270
+ hostAgentInstruction: adapterFor(host).questionInstruction
271
+ };
272
+ }
@@ -0,0 +1,7 @@
1
+ import type { AmbiguityLedger, SessionState } from "./schemas.js";
2
+ export interface ReconstructionResult {
3
+ state: SessionState;
4
+ ledger: AmbiguityLedger;
5
+ sources: string[];
6
+ }
7
+ export declare function reconstructFromDocuments(projectRoot: string, isoDate?: string): Promise<ReconstructionResult | null>;
@@ -0,0 +1,62 @@
1
+ import { access, readFile } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { CORE_DOCUMENTS, LAZY_DOCUMENTS } from "./constants.js";
4
+ import { readManagedSection } from "./documents.js";
5
+ import { DEFAULT_ACTIVE_GOAL_PLACEHOLDER, DEFAULT_PLAN_PLACEHOLDER, DEFAULT_STATUS_PLACEHOLDER } from "./project.js";
6
+ import { createInitialLedger, updateAxisScore } from "./scoring.js";
7
+ import { createSessionState, goalIdFromDate } from "./session.js";
8
+ const RECONSTRUCTED_CLARITY = 0.5;
9
+ async function exists(path) {
10
+ try {
11
+ await access(path);
12
+ return true;
13
+ }
14
+ catch {
15
+ return false;
16
+ }
17
+ }
18
+ function sectionHasContent(section, placeholder) {
19
+ return section !== null && section.length > 0 && !section.startsWith(placeholder);
20
+ }
21
+ // Best-effort recovery per spec §9.5: when session state is missing but koan/*.md
22
+ // exists, rebuild a conservative in-memory session and ledger. Never writes to disk.
23
+ export async function reconstructFromDocuments(projectRoot, isoDate = new Date().toISOString()) {
24
+ const goalPath = join(projectRoot, CORE_DOCUMENTS.goal);
25
+ if (!(await exists(goalPath)))
26
+ return null;
27
+ const goalId = goalIdFromDate(isoDate);
28
+ const state = createSessionState(goalId, isoDate);
29
+ let ledger = createInitialLedger(goalId, isoDate);
30
+ const sources = [];
31
+ const grant = (axis, relativePath) => {
32
+ ledger = updateAxisScore(ledger, axis, RECONSTRUCTED_CLARITY, `reconstructed from ${relativePath}`, isoDate);
33
+ if (!sources.includes(relativePath))
34
+ sources.push(relativePath);
35
+ };
36
+ const goalText = await readFile(goalPath, "utf8");
37
+ if (sectionHasContent(readManagedSection(goalText, "active-goal"), DEFAULT_ACTIVE_GOAL_PLACEHOLDER)) {
38
+ grant("purpose", CORE_DOCUMENTS.goal);
39
+ grant("current_goal", CORE_DOCUMENTS.goal);
40
+ }
41
+ const planPath = join(projectRoot, CORE_DOCUMENTS.plan);
42
+ if (await exists(planPath)) {
43
+ const planText = await readFile(planPath, "utf8");
44
+ if (sectionHasContent(readManagedSection(planText, "implementation-plan"), DEFAULT_PLAN_PLACEHOLDER)) {
45
+ grant("implementation_plan", CORE_DOCUMENTS.plan);
46
+ }
47
+ }
48
+ const statusPath = join(projectRoot, CORE_DOCUMENTS.status);
49
+ if (await exists(statusPath)) {
50
+ const statusText = await readFile(statusPath, "utf8");
51
+ if (sectionHasContent(readManagedSection(statusText, "current-status"), DEFAULT_STATUS_PLACEHOLDER)) {
52
+ grant("handoff_readiness", CORE_DOCUMENTS.status);
53
+ }
54
+ }
55
+ if (await exists(join(projectRoot, LAZY_DOCUMENTS.qa))) {
56
+ grant("qa_criteria", LAZY_DOCUMENTS.qa);
57
+ }
58
+ if (await exists(join(projectRoot, LAZY_DOCUMENTS.philosophy))) {
59
+ grant("philosophical_intent", LAZY_DOCUMENTS.philosophy);
60
+ }
61
+ return { state, ledger, sources };
62
+ }
@@ -0,0 +1,331 @@
1
+ import { z } from "zod";
2
+ export declare const StrictnessSchema: z.ZodEnum<{
3
+ advisory: "advisory";
4
+ strict: "strict";
5
+ }>;
6
+ export type Strictness = z.infer<typeof StrictnessSchema>;
7
+ export declare const LanguageSchema: z.ZodEnum<{
8
+ ko: "ko";
9
+ en: "en";
10
+ mixed: "mixed";
11
+ }>;
12
+ export type Language = z.infer<typeof LanguageSchema>;
13
+ export declare const DevelopmentUnderstandingSchema: z.ZodEnum<{
14
+ non_technical: "non_technical";
15
+ beginner: "beginner";
16
+ intermediate: "intermediate";
17
+ expert: "expert";
18
+ }>;
19
+ export type DevelopmentUnderstanding = z.infer<typeof DevelopmentUnderstandingSchema>;
20
+ export declare const ExplanationStyleSchema: z.ZodEnum<{
21
+ short: "short";
22
+ example_first: "example_first";
23
+ step_by_step: "step_by_step";
24
+ technical_ok: "technical_ok";
25
+ }>;
26
+ export type ExplanationStyle = z.infer<typeof ExplanationStyleSchema>;
27
+ export declare const OutputUseSchema: z.ZodEnum<{
28
+ self_implementation: "self_implementation";
29
+ agent_execution: "agent_execution";
30
+ team_sharing: "team_sharing";
31
+ learning: "learning";
32
+ }>;
33
+ export type OutputUse = z.infer<typeof OutputUseSchema>;
34
+ export declare const LearningModeSchema: z.ZodEnum<{
35
+ approval_required: "approval_required";
36
+ auto_with_review: "auto_with_review";
37
+ }>;
38
+ export type LearningMode = z.infer<typeof LearningModeSchema>;
39
+ export declare const UserProfileSchema: z.ZodObject<{
40
+ developmentUnderstanding: z.ZodEnum<{
41
+ non_technical: "non_technical";
42
+ beginner: "beginner";
43
+ intermediate: "intermediate";
44
+ expert: "expert";
45
+ }>;
46
+ explanationStyle: z.ZodEnum<{
47
+ short: "short";
48
+ example_first: "example_first";
49
+ step_by_step: "step_by_step";
50
+ technical_ok: "technical_ok";
51
+ }>;
52
+ language: z.ZodEnum<{
53
+ ko: "ko";
54
+ en: "en";
55
+ mixed: "mixed";
56
+ }>;
57
+ outputUse: z.ZodEnum<{
58
+ self_implementation: "self_implementation";
59
+ agent_execution: "agent_execution";
60
+ team_sharing: "team_sharing";
61
+ learning: "learning";
62
+ }>;
63
+ domainBackground: z.ZodString;
64
+ learningMode: z.ZodEnum<{
65
+ approval_required: "approval_required";
66
+ auto_with_review: "auto_with_review";
67
+ }>;
68
+ }, z.core.$strip>;
69
+ export type UserProfile = z.infer<typeof UserProfileSchema>;
70
+ export declare const DEFAULT_CONVERGENCE_THRESHOLD = 0.7;
71
+ export declare const ProjectSettingsSchema: z.ZodDefault<z.ZodObject<{
72
+ convergenceThreshold: z.ZodNumber;
73
+ }, z.core.$strip>>;
74
+ export type ProjectSettings = z.infer<typeof ProjectSettingsSchema>;
75
+ export declare const ProjectConfigSchema: z.ZodObject<{
76
+ version: z.ZodLiteral<1>;
77
+ koanVersion: z.ZodString;
78
+ projectRoot: z.ZodString;
79
+ strictness: z.ZodEnum<{
80
+ advisory: "advisory";
81
+ strict: "strict";
82
+ }>;
83
+ experimentalHandoff: z.ZodBoolean;
84
+ documents: z.ZodObject<{
85
+ readme: z.ZodString;
86
+ goal: z.ZodString;
87
+ status: z.ZodString;
88
+ plan: z.ZodString;
89
+ }, z.core.$strip>;
90
+ settings: z.ZodDefault<z.ZodObject<{
91
+ convergenceThreshold: z.ZodNumber;
92
+ }, z.core.$strip>>;
93
+ }, z.core.$strip>;
94
+ export type ProjectConfig = z.infer<typeof ProjectConfigSchema>;
95
+ export declare const AmbiguityAxisSchema: z.ZodEnum<{
96
+ purpose: "purpose";
97
+ target_users: "target_users";
98
+ current_goal: "current_goal";
99
+ scope: "scope";
100
+ non_goals: "non_goals";
101
+ constraints: "constraints";
102
+ success_criteria: "success_criteria";
103
+ philosophical_intent: "philosophical_intent";
104
+ implementation_plan: "implementation_plan";
105
+ qa_criteria: "qa_criteria";
106
+ handoff_readiness: "handoff_readiness";
107
+ }>;
108
+ export type AmbiguityAxis = z.infer<typeof AmbiguityAxisSchema>;
109
+ export declare const AxisScoreSchema: z.ZodObject<{
110
+ axis: z.ZodEnum<{
111
+ purpose: "purpose";
112
+ target_users: "target_users";
113
+ current_goal: "current_goal";
114
+ scope: "scope";
115
+ non_goals: "non_goals";
116
+ constraints: "constraints";
117
+ success_criteria: "success_criteria";
118
+ philosophical_intent: "philosophical_intent";
119
+ implementation_plan: "implementation_plan";
120
+ qa_criteria: "qa_criteria";
121
+ handoff_readiness: "handoff_readiness";
122
+ }>;
123
+ clarity: z.ZodNumber;
124
+ evidence: z.ZodArray<z.ZodString>;
125
+ updatedAt: z.ZodString;
126
+ }, z.core.$strip>;
127
+ export type AxisScore = z.infer<typeof AxisScoreSchema>;
128
+ export declare const AmbiguityLedgerSchema: z.ZodObject<{
129
+ version: z.ZodLiteral<1>;
130
+ goalId: z.ZodString;
131
+ axes: z.ZodArray<z.ZodObject<{
132
+ axis: z.ZodEnum<{
133
+ purpose: "purpose";
134
+ target_users: "target_users";
135
+ current_goal: "current_goal";
136
+ scope: "scope";
137
+ non_goals: "non_goals";
138
+ constraints: "constraints";
139
+ success_criteria: "success_criteria";
140
+ philosophical_intent: "philosophical_intent";
141
+ implementation_plan: "implementation_plan";
142
+ qa_criteria: "qa_criteria";
143
+ handoff_readiness: "handoff_readiness";
144
+ }>;
145
+ clarity: z.ZodNumber;
146
+ evidence: z.ZodArray<z.ZodString>;
147
+ updatedAt: z.ZodString;
148
+ }, z.core.$strip>>;
149
+ }, z.core.$strip>;
150
+ export type AmbiguityLedger = z.infer<typeof AmbiguityLedgerSchema>;
151
+ export declare const AnswerRecordSchema: z.ZodObject<{
152
+ questionId: z.ZodString;
153
+ axis: z.ZodEnum<{
154
+ purpose: "purpose";
155
+ target_users: "target_users";
156
+ current_goal: "current_goal";
157
+ scope: "scope";
158
+ non_goals: "non_goals";
159
+ constraints: "constraints";
160
+ success_criteria: "success_criteria";
161
+ philosophical_intent: "philosophical_intent";
162
+ implementation_plan: "implementation_plan";
163
+ qa_criteria: "qa_criteria";
164
+ handoff_readiness: "handoff_readiness";
165
+ }>;
166
+ question: z.ZodString;
167
+ answer: z.ZodString;
168
+ recordedAt: z.ZodString;
169
+ }, z.core.$strip>;
170
+ export type AnswerRecord = z.infer<typeof AnswerRecordSchema>;
171
+ export declare const SessionStateSchema: z.ZodObject<{
172
+ version: z.ZodLiteral<1>;
173
+ sessionId: z.ZodString;
174
+ activeGoalId: z.ZodNullable<z.ZodString>;
175
+ phase: z.ZodEnum<{
176
+ setup: "setup";
177
+ questioning: "questioning";
178
+ crystallizing: "crystallizing";
179
+ ready: "ready";
180
+ archived: "archived";
181
+ }>;
182
+ lastQuestionId: z.ZodNullable<z.ZodString>;
183
+ answers: z.ZodDefault<z.ZodArray<z.ZodObject<{
184
+ questionId: z.ZodString;
185
+ axis: z.ZodEnum<{
186
+ purpose: "purpose";
187
+ target_users: "target_users";
188
+ current_goal: "current_goal";
189
+ scope: "scope";
190
+ non_goals: "non_goals";
191
+ constraints: "constraints";
192
+ success_criteria: "success_criteria";
193
+ philosophical_intent: "philosophical_intent";
194
+ implementation_plan: "implementation_plan";
195
+ qa_criteria: "qa_criteria";
196
+ handoff_readiness: "handoff_readiness";
197
+ }>;
198
+ question: z.ZodString;
199
+ answer: z.ZodString;
200
+ recordedAt: z.ZodString;
201
+ }, z.core.$strip>>>;
202
+ updatedAt: z.ZodString;
203
+ }, z.core.$strip>;
204
+ export type SessionState = z.infer<typeof SessionStateSchema>;
205
+ export declare const WritePlanOperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
206
+ type: z.ZodLiteral<"write">;
207
+ path: z.ZodString;
208
+ content: z.ZodString;
209
+ }, z.core.$strip>, z.ZodObject<{
210
+ type: z.ZodLiteral<"append">;
211
+ path: z.ZodString;
212
+ content: z.ZodString;
213
+ headerIfMissing: z.ZodOptional<z.ZodString>;
214
+ }, z.core.$strip>, z.ZodObject<{
215
+ type: z.ZodLiteral<"managed-region">;
216
+ path: z.ZodString;
217
+ name: z.ZodString;
218
+ content: z.ZodString;
219
+ }, z.core.$strip>], "type">;
220
+ export type WritePlanOperation = z.infer<typeof WritePlanOperationSchema>;
221
+ export declare const WritePlanSchema: z.ZodObject<{
222
+ description: z.ZodString;
223
+ operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
224
+ type: z.ZodLiteral<"write">;
225
+ path: z.ZodString;
226
+ content: z.ZodString;
227
+ }, z.core.$strip>, z.ZodObject<{
228
+ type: z.ZodLiteral<"append">;
229
+ path: z.ZodString;
230
+ content: z.ZodString;
231
+ headerIfMissing: z.ZodOptional<z.ZodString>;
232
+ }, z.core.$strip>, z.ZodObject<{
233
+ type: z.ZodLiteral<"managed-region">;
234
+ path: z.ZodString;
235
+ name: z.ZodString;
236
+ content: z.ZodString;
237
+ }, z.core.$strip>], "type">>;
238
+ }, z.core.$strip>;
239
+ export type WritePlan = z.infer<typeof WritePlanSchema>;
240
+ export declare const CommandLogEntrySchema: z.ZodObject<{
241
+ at: z.ZodString;
242
+ command: z.ZodString;
243
+ summary: z.ZodString;
244
+ }, z.core.$strip>;
245
+ export type CommandLogEntry = z.infer<typeof CommandLogEntrySchema>;
246
+ export declare const CommandLogSchema: z.ZodObject<{
247
+ version: z.ZodLiteral<1>;
248
+ entries: z.ZodArray<z.ZodObject<{
249
+ at: z.ZodString;
250
+ command: z.ZodString;
251
+ summary: z.ZodString;
252
+ }, z.core.$strip>>;
253
+ }, z.core.$strip>;
254
+ export type CommandLog = z.infer<typeof CommandLogSchema>;
255
+ export declare const UserProfileRefSchema: z.ZodObject<{
256
+ version: z.ZodLiteral<1>;
257
+ profilePath: z.ZodString;
258
+ overrides: z.ZodObject<{
259
+ developmentUnderstanding: z.ZodOptional<z.ZodEnum<{
260
+ non_technical: "non_technical";
261
+ beginner: "beginner";
262
+ intermediate: "intermediate";
263
+ expert: "expert";
264
+ }>>;
265
+ explanationStyle: z.ZodOptional<z.ZodEnum<{
266
+ short: "short";
267
+ example_first: "example_first";
268
+ step_by_step: "step_by_step";
269
+ technical_ok: "technical_ok";
270
+ }>>;
271
+ language: z.ZodOptional<z.ZodEnum<{
272
+ ko: "ko";
273
+ en: "en";
274
+ mixed: "mixed";
275
+ }>>;
276
+ outputUse: z.ZodOptional<z.ZodEnum<{
277
+ self_implementation: "self_implementation";
278
+ agent_execution: "agent_execution";
279
+ team_sharing: "team_sharing";
280
+ learning: "learning";
281
+ }>>;
282
+ domainBackground: z.ZodOptional<z.ZodString>;
283
+ learningMode: z.ZodOptional<z.ZodEnum<{
284
+ approval_required: "approval_required";
285
+ auto_with_review: "auto_with_review";
286
+ }>>;
287
+ }, z.core.$strip>;
288
+ }, z.core.$strip>;
289
+ export type UserProfileRef = z.infer<typeof UserProfileRefSchema>;
290
+ export declare const QuestionContextSchema: z.ZodObject<{
291
+ sessionId: z.ZodString;
292
+ axis: z.ZodEnum<{
293
+ purpose: "purpose";
294
+ target_users: "target_users";
295
+ current_goal: "current_goal";
296
+ scope: "scope";
297
+ non_goals: "non_goals";
298
+ constraints: "constraints";
299
+ success_criteria: "success_criteria";
300
+ philosophical_intent: "philosophical_intent";
301
+ implementation_plan: "implementation_plan";
302
+ qa_criteria: "qa_criteria";
303
+ handoff_readiness: "handoff_readiness";
304
+ }>;
305
+ questionId: z.ZodString;
306
+ askedAt: z.ZodString;
307
+ }, z.core.$strip>;
308
+ export type QuestionContext = z.infer<typeof QuestionContextSchema>;
309
+ export declare const McpCacheSchema: z.ZodObject<{
310
+ version: z.ZodLiteral<1>;
311
+ lastQuestion: z.ZodNullable<z.ZodObject<{
312
+ sessionId: z.ZodString;
313
+ axis: z.ZodEnum<{
314
+ purpose: "purpose";
315
+ target_users: "target_users";
316
+ current_goal: "current_goal";
317
+ scope: "scope";
318
+ non_goals: "non_goals";
319
+ constraints: "constraints";
320
+ success_criteria: "success_criteria";
321
+ philosophical_intent: "philosophical_intent";
322
+ implementation_plan: "implementation_plan";
323
+ qa_criteria: "qa_criteria";
324
+ handoff_readiness: "handoff_readiness";
325
+ }>;
326
+ questionId: z.ZodString;
327
+ askedAt: z.ZodString;
328
+ }, z.core.$strip>>;
329
+ rawIntent: z.ZodDefault<z.ZodNullable<z.ZodString>>;
330
+ }, z.core.$strip>;
331
+ export type McpCache = z.infer<typeof McpCacheSchema>;