@alex.botez/elaborate 1.0.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 (162) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +114 -0
  3. package/dist/durable/index.d.ts +10 -0
  4. package/dist/durable/index.d.ts.map +1 -0
  5. package/dist/durable/index.js +9 -0
  6. package/dist/durable/index.js.map +1 -0
  7. package/dist/durable/workflow.d.ts +165 -0
  8. package/dist/durable/workflow.d.ts.map +1 -0
  9. package/dist/durable/workflow.js +224 -0
  10. package/dist/durable/workflow.js.map +1 -0
  11. package/dist/interview/classification.d.ts +16 -0
  12. package/dist/interview/classification.d.ts.map +1 -0
  13. package/dist/interview/classification.js +25 -0
  14. package/dist/interview/classification.js.map +1 -0
  15. package/dist/interview/composition.d.ts +12 -0
  16. package/dist/interview/composition.d.ts.map +1 -0
  17. package/dist/interview/composition.js +19 -0
  18. package/dist/interview/composition.js.map +1 -0
  19. package/dist/interview/describe.d.ts +41 -0
  20. package/dist/interview/describe.d.ts.map +1 -0
  21. package/dist/interview/describe.js +80 -0
  22. package/dist/interview/describe.js.map +1 -0
  23. package/dist/interview/deviation.d.ts +91 -0
  24. package/dist/interview/deviation.d.ts.map +1 -0
  25. package/dist/interview/deviation.js +137 -0
  26. package/dist/interview/deviation.js.map +1 -0
  27. package/dist/interview/extraction.d.ts +32 -0
  28. package/dist/interview/extraction.d.ts.map +1 -0
  29. package/dist/interview/extraction.js +102 -0
  30. package/dist/interview/extraction.js.map +1 -0
  31. package/dist/interview/index.d.ts +25 -0
  32. package/dist/interview/index.d.ts.map +1 -0
  33. package/dist/interview/index.js +22 -0
  34. package/dist/interview/index.js.map +1 -0
  35. package/dist/interview/macros.d.ts +91 -0
  36. package/dist/interview/macros.d.ts.map +1 -0
  37. package/dist/interview/macros.js +138 -0
  38. package/dist/interview/macros.js.map +1 -0
  39. package/dist/interview/preambles.d.ts +18 -0
  40. package/dist/interview/preambles.d.ts.map +1 -0
  41. package/dist/interview/preambles.js +93 -0
  42. package/dist/interview/preambles.js.map +1 -0
  43. package/dist/interview/progress.d.ts +31 -0
  44. package/dist/interview/progress.d.ts.map +1 -0
  45. package/dist/interview/progress.js +51 -0
  46. package/dist/interview/progress.js.map +1 -0
  47. package/dist/interview/prompt.d.ts +20 -0
  48. package/dist/interview/prompt.d.ts.map +1 -0
  49. package/dist/interview/prompt.js +58 -0
  50. package/dist/interview/prompt.js.map +1 -0
  51. package/dist/phases/aggregate/assumptions.d.ts +14 -0
  52. package/dist/phases/aggregate/assumptions.d.ts.map +1 -0
  53. package/dist/phases/aggregate/assumptions.js +33 -0
  54. package/dist/phases/aggregate/assumptions.js.map +1 -0
  55. package/dist/phases/aggregate/findings.d.ts +10 -0
  56. package/dist/phases/aggregate/findings.d.ts.map +1 -0
  57. package/dist/phases/aggregate/findings.js +20 -0
  58. package/dist/phases/aggregate/findings.js.map +1 -0
  59. package/dist/phases/aggregate/goals.d.ts +28 -0
  60. package/dist/phases/aggregate/goals.d.ts.map +1 -0
  61. package/dist/phases/aggregate/goals.js +74 -0
  62. package/dist/phases/aggregate/goals.js.map +1 -0
  63. package/dist/phases/aggregate/index.d.ts +128 -0
  64. package/dist/phases/aggregate/index.d.ts.map +1 -0
  65. package/dist/phases/aggregate/index.js +165 -0
  66. package/dist/phases/aggregate/index.js.map +1 -0
  67. package/dist/phases/aggregate/pam.d.ts +19 -0
  68. package/dist/phases/aggregate/pam.d.ts.map +1 -0
  69. package/dist/phases/aggregate/pam.js +37 -0
  70. package/dist/phases/aggregate/pam.js.map +1 -0
  71. package/dist/phases/aggregate/scope.d.ts +24 -0
  72. package/dist/phases/aggregate/scope.d.ts.map +1 -0
  73. package/dist/phases/aggregate/scope.js +67 -0
  74. package/dist/phases/aggregate/scope.js.map +1 -0
  75. package/dist/phases/aggregate/shared.d.ts +16 -0
  76. package/dist/phases/aggregate/shared.d.ts.map +1 -0
  77. package/dist/phases/aggregate/shared.js +26 -0
  78. package/dist/phases/aggregate/shared.js.map +1 -0
  79. package/dist/phases/aggregate/stakeholders.d.ts +27 -0
  80. package/dist/phases/aggregate/stakeholders.d.ts.map +1 -0
  81. package/dist/phases/aggregate/stakeholders.js +90 -0
  82. package/dist/phases/aggregate/stakeholders.js.map +1 -0
  83. package/dist/phases/aggregate/waitingRoom.d.ts +16 -0
  84. package/dist/phases/aggregate/waitingRoom.d.ts.map +1 -0
  85. package/dist/phases/aggregate/waitingRoom.js +32 -0
  86. package/dist/phases/aggregate/waitingRoom.js.map +1 -0
  87. package/dist/phases/assumptions.d.ts +19 -0
  88. package/dist/phases/assumptions.d.ts.map +1 -0
  89. package/dist/phases/assumptions.js +224 -0
  90. package/dist/phases/assumptions.js.map +1 -0
  91. package/dist/phases/configuration.d.ts +8 -0
  92. package/dist/phases/configuration.d.ts.map +1 -0
  93. package/dist/phases/configuration.js +14 -0
  94. package/dist/phases/configuration.js.map +1 -0
  95. package/dist/phases/goals.d.ts +15 -0
  96. package/dist/phases/goals.d.ts.map +1 -0
  97. package/dist/phases/goals.js +297 -0
  98. package/dist/phases/goals.js.map +1 -0
  99. package/dist/phases/index.d.ts +21 -0
  100. package/dist/phases/index.d.ts.map +1 -0
  101. package/dist/phases/index.js +56 -0
  102. package/dist/phases/index.js.map +1 -0
  103. package/dist/phases/opening.d.ts +12 -0
  104. package/dist/phases/opening.d.ts.map +1 -0
  105. package/dist/phases/opening.js +99 -0
  106. package/dist/phases/opening.js.map +1 -0
  107. package/dist/phases/purpose.d.ts +17 -0
  108. package/dist/phases/purpose.d.ts.map +1 -0
  109. package/dist/phases/purpose.js +207 -0
  110. package/dist/phases/purpose.js.map +1 -0
  111. package/dist/phases/schema.d.ts +861 -0
  112. package/dist/phases/schema.d.ts.map +1 -0
  113. package/dist/phases/schema.js +157 -0
  114. package/dist/phases/schema.js.map +1 -0
  115. package/dist/phases/scope.d.ts +18 -0
  116. package/dist/phases/scope.d.ts.map +1 -0
  117. package/dist/phases/scope.js +440 -0
  118. package/dist/phases/scope.js.map +1 -0
  119. package/dist/phases/session/archive.d.ts +19 -0
  120. package/dist/phases/session/archive.d.ts.map +1 -0
  121. package/dist/phases/session/archive.js +49 -0
  122. package/dist/phases/session/archive.js.map +1 -0
  123. package/dist/phases/session/file.d.ts +31 -0
  124. package/dist/phases/session/file.d.ts.map +1 -0
  125. package/dist/phases/session/file.js +113 -0
  126. package/dist/phases/session/file.js.map +1 -0
  127. package/dist/phases/session/index.d.ts +8 -0
  128. package/dist/phases/session/index.d.ts.map +1 -0
  129. package/dist/phases/session/index.js +8 -0
  130. package/dist/phases/session/index.js.map +1 -0
  131. package/dist/phases/session/persistence.d.ts +30 -0
  132. package/dist/phases/session/persistence.d.ts.map +1 -0
  133. package/dist/phases/session/persistence.js +91 -0
  134. package/dist/phases/session/persistence.js.map +1 -0
  135. package/dist/phases/shared.d.ts +64 -0
  136. package/dist/phases/shared.d.ts.map +1 -0
  137. package/dist/phases/shared.js +100 -0
  138. package/dist/phases/shared.js.map +1 -0
  139. package/dist/phases/stakeholders.d.ts +17 -0
  140. package/dist/phases/stakeholders.d.ts.map +1 -0
  141. package/dist/phases/stakeholders.js +370 -0
  142. package/dist/phases/stakeholders.js.map +1 -0
  143. package/dist/phases/validation.d.ts +13 -0
  144. package/dist/phases/validation.d.ts.map +1 -0
  145. package/dist/phases/validation.js +130 -0
  146. package/dist/phases/validation.js.map +1 -0
  147. package/dist/skill/adapter.d.ts +16 -0
  148. package/dist/skill/adapter.d.ts.map +1 -0
  149. package/dist/skill/adapter.js +278 -0
  150. package/dist/skill/adapter.js.map +1 -0
  151. package/dist/skill/index.d.ts +12 -0
  152. package/dist/skill/index.d.ts.map +1 -0
  153. package/dist/skill/index.js +11 -0
  154. package/dist/skill/index.js.map +1 -0
  155. package/dist/skill/log.d.ts +18 -0
  156. package/dist/skill/log.d.ts.map +1 -0
  157. package/dist/skill/log.js +53 -0
  158. package/dist/skill/log.js.map +1 -0
  159. package/package.json +83 -0
  160. package/skills/elaborate/SKILL.md +97 -0
  161. package/skills/elaborate/scripts/elaborate.cjs +589 -0
  162. package/skills/project-brief/SKILL.md +45 -0
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Question composition — LLM call that produces an interview question with
3
+ * optional suggested answers, preceded by the composition quality preamble.
4
+ */
5
+ import { WorkflowContext } from "../durable/index.js";
6
+ import { compositionPreamble } from "./preambles.js";
7
+ /** Compose a question with suggestions; falls back to step.fallback if agent returns empty. */
8
+ WorkflowContext.prototype.compose = async function (step) {
9
+ const compPre = compositionPreamble();
10
+ const enrichedStep = compPre
11
+ ? { ...step, message: compPre + "\n\n" + step.message }
12
+ : step;
13
+ const { question, suggestions } = await this.infer(enrichedStep);
14
+ return question ? { question, suggestions } : { question: step.fallback };
15
+ };
16
+ if (typeof WorkflowContext.prototype.compose !== "function") {
17
+ throw new Error("interview/composition.ts self-check failed: WorkflowContext.prototype.compose is not a function.");
18
+ }
19
+ //# sourceMappingURL=composition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composition.js","sourceRoot":"","sources":["../../src/interview/composition.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AASrD,+FAA+F;AAC/F,eAAe,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,WAAW,IAAmB;IACrE,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IACtC,MAAM,YAAY,GAAG,OAAO;QAC1B,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE;QACvD,CAAC,CAAC,IAAI,CAAC;IACT,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACjE,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;AAC5E,CAAC,CAAC;AAEF,IAAI,OAAQ,eAAe,CAAC,SAAgD,CAAC,OAAO,KAAK,UAAU,EAAE,CAAC;IACpG,MAAM,IAAI,KAAK,CAAC,kGAAkG,CAAC,CAAC;AACtH,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Derives LLM prompt schemas from Zod definitions — single source of truth
3
+ * for both TypeScript types (z.infer) and prompt schema strings.
4
+ *
5
+ * Supported Zod types: string, number, boolean, array, object, optional.
6
+ * Throws on unsupported types to surface gaps early.
7
+ */
8
+ import { ZodString, ZodArray, ZodObject } from "zod";
9
+ import { z } from "zod";
10
+ import type { InferStep } from "../durable/index.js";
11
+ export declare const ComposeSchema: ZodObject<{
12
+ question: ZodString;
13
+ suggestions: ZodArray<ZodString, "many">;
14
+ }, "strip", z.ZodTypeAny, {
15
+ suggestions: string[];
16
+ question: string;
17
+ }, {
18
+ suggestions: string[];
19
+ question: string;
20
+ }>;
21
+ /** InferStep pre-loaded with a fallback question — used by ctx.compose. */
22
+ export interface ComposeParams extends InferStep<{
23
+ question: string;
24
+ suggestions: string[];
25
+ }> {
26
+ readonly fallback: string;
27
+ }
28
+ /** Create an InferStep from a Zod schema — converts schema to prompt format, brands return type. */
29
+ export declare function inferStep<S extends ZodObject<any>>(args: {
30
+ id: string;
31
+ schema: S;
32
+ message: string;
33
+ }): InferStep<S["_output"]>;
34
+ /** Create an inferCompositionStep — inferStep plus a fallback question for when the LLM response is empty. */
35
+ export declare function inferCompositionStep(args: {
36
+ id: string;
37
+ message: string;
38
+ fallback: string;
39
+ }): ComposeParams;
40
+ export declare function zodToPromptSchema(schema: ZodObject<any>): Record<string, string>;
41
+ //# sourceMappingURL=describe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe.d.ts","sourceRoot":"","sources":["../../src/interview/describe.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAEL,SAAS,EAGT,QAAQ,EACR,SAAS,EAIV,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,eAAO,MAAM,aAAa;;;;;;;;;EAGxB,CAAC;AAEH,2EAA2E;AAC3E,MAAM,WAAW,aAAc,SAAQ,SAAS,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;IAC3F,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AA8CD,oGAAoG;AACpG,wBAAgB,SAAS,CAAC,CAAC,SAAS,SAAS,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE;IACxD,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,CAAC,CAAC;IACV,OAAO,EAAE,MAAM,CAAA;CAChB,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAG1B;AAED,8GAA8G;AAC9G,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,aAAa,CAGhB;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAShF"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Derives LLM prompt schemas from Zod definitions — single source of truth
3
+ * for both TypeScript types (z.infer) and prompt schema strings.
4
+ *
5
+ * Supported Zod types: string, number, boolean, array, object, optional.
6
+ * Throws on unsupported types to surface gaps early.
7
+ */
8
+ import { ZodString, ZodNumber, ZodBoolean, ZodArray, ZodObject, ZodOptional, ZodNullable, ZodEnum, } from "zod";
9
+ import { z } from "zod";
10
+ export const ComposeSchema = z.object({
11
+ question: z.string().describe("the question to ask the stakeholder"),
12
+ suggestions: z.array(z.string()).describe("2-3 suggested answers"),
13
+ });
14
+ /** Serialize a Zod type to compact inline notation (e.g. `{ description: string, relatedGoals?: string[] }[]`). */
15
+ function zodTypeToString(schema, path = "") {
16
+ if (schema instanceof ZodOptional) {
17
+ return zodTypeToString(schema._def.innerType, path);
18
+ }
19
+ if (schema instanceof ZodNullable) {
20
+ return `${zodTypeToString(schema._def.innerType, path)} | null`;
21
+ }
22
+ if (schema instanceof ZodString)
23
+ return "string";
24
+ if (schema instanceof ZodNumber)
25
+ return "number";
26
+ if (schema instanceof ZodBoolean)
27
+ return "boolean";
28
+ if (schema instanceof ZodEnum) {
29
+ return schema._def.values.map((v) => `"${v}"`).join(" | ");
30
+ }
31
+ if (schema instanceof ZodArray) {
32
+ return `${zodTypeToString(schema._def.type, `${path}[]`)}[]`;
33
+ }
34
+ if (schema instanceof ZodObject) {
35
+ const shape = schema._def.shape();
36
+ const fields = Object.entries(shape).map(([key, val]) => {
37
+ const opt = val instanceof ZodOptional ? "?" : "";
38
+ const desc = getDescription(val);
39
+ const nested = path ? `${path}.${key}` : key;
40
+ const typeStr = zodTypeToString(val, nested);
41
+ return desc ? `${key}${opt}: ${typeStr} - ${desc}` : `${key}${opt}: ${typeStr}`;
42
+ });
43
+ return `{ ${fields.join(", ")} }`;
44
+ }
45
+ const where = path ? ` at "${path}"` : "";
46
+ throw new Error(`zodTypeToString: unsupported Zod type ${schema._def?.typeName ?? "unknown"}${where}`);
47
+ }
48
+ /** Get .describe() text from either the outer wrapper or the inner type. */
49
+ function getDescription(schema) {
50
+ if (schema.description)
51
+ return schema.description;
52
+ if (schema instanceof ZodOptional && schema._def.innerType.description) {
53
+ return schema._def.innerType.description;
54
+ }
55
+ if (schema instanceof ZodNullable && schema._def.innerType.description) {
56
+ return schema._def.innerType.description;
57
+ }
58
+ return "";
59
+ }
60
+ /** Create an InferStep from a Zod schema — converts schema to prompt format, brands return type. */
61
+ export function inferStep(args) {
62
+ const { id, message, schema } = args;
63
+ return { id, message, schema: zodToPromptSchema(schema) };
64
+ }
65
+ /** Create an inferCompositionStep — inferStep plus a fallback question for when the LLM response is empty. */
66
+ export function inferCompositionStep(args) {
67
+ const { fallback, ...rest } = args;
68
+ return { ...inferStep({ schema: ComposeSchema, ...rest }), fallback };
69
+ }
70
+ export function zodToPromptSchema(schema) {
71
+ const shape = schema._def.shape();
72
+ const result = {};
73
+ for (const [key, field] of Object.entries(shape)) {
74
+ const desc = getDescription(field);
75
+ const typeStr = zodTypeToString(field);
76
+ result[key] = desc ? `${typeStr} - ${desc}` : typeStr;
77
+ }
78
+ return result;
79
+ }
80
+ //# sourceMappingURL=describe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe.js","sourceRoot":"","sources":["../../src/interview/describe.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAEL,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,SAAS,EACT,WAAW,EACX,WAAW,EACX,OAAO,GACR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IACpE,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC;CACnE,CAAC,CAAC;AAOH,mHAAmH;AACnH,SAAS,eAAe,CAAC,MAAe,EAAE,IAAI,GAAG,EAAE;IACjD,IAAI,MAAM,YAAY,WAAW,EAAE,CAAC;QAClC,OAAO,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACtD,CAAC;IACD,IAAI,MAAM,YAAY,WAAW,E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EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IACnC,OAAO,EAAE,GAAG,SAAS,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAmB,CAAC;AACzF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAsB;IACtD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAA6B,CAAC;IAC7D,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QACnC,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QACvC,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IACxD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Deviation resilience — classification errors and retry primitive.
3
+ *
4
+ * When ctx.extract detects that the stakeholder didn't answer the question
5
+ * (clarification request, off-topic, pushback), it throws a typed error.
6
+ * The retry primitive catches these and gives the callback a chance to re-ask.
7
+ *
8
+ * One error class per deviation type:
9
+ * - Confusion → user is confused, rephrase the question
10
+ * - OffTopic → unrelated information or new idea
11
+ * - Pushback → questioned the process or method
12
+ * - TopicChange → tried to steer to a different subject
13
+ * - Frustration → expressed fatigue or impatience
14
+ */
15
+ /** Detailed classification of the stakeholder's response. */
16
+ export type ResponseClass = "answer" | "confusion" | "off_topic" | "pushback" | "topic_change" | "frustration";
17
+ /** Thrown when the stakeholder expresses confusion or asks for clarification. */
18
+ export declare class Confusion extends Error {
19
+ readonly response: string;
20
+ constructor(response: string);
21
+ }
22
+ /** Thrown when the stakeholder provides unrelated information or a new idea. */
23
+ export declare class OffTopic extends Error {
24
+ readonly response: string;
25
+ readonly parkedItems: Array<{
26
+ content: string;
27
+ }>;
28
+ constructor(response: string, parkedItems?: Array<{
29
+ content: string;
30
+ }>);
31
+ }
32
+ /** Thrown when the stakeholder questions the process or method. */
33
+ export declare class Pushback extends Error {
34
+ readonly response: string;
35
+ readonly parkedItems: Array<{
36
+ content: string;
37
+ }>;
38
+ constructor(response: string, parkedItems?: Array<{
39
+ content: string;
40
+ }>);
41
+ }
42
+ /** Thrown when the stakeholder tries to steer to a different subject. */
43
+ export declare class TopicChange extends Error {
44
+ readonly response: string;
45
+ readonly parkedItems: Array<{
46
+ content: string;
47
+ }>;
48
+ constructor(response: string, parkedItems?: Array<{
49
+ content: string;
50
+ }>);
51
+ }
52
+ /** Thrown when the stakeholder expresses fatigue or impatience. */
53
+ export declare class Frustration extends Error {
54
+ readonly response: string;
55
+ readonly parkedItems: Array<{
56
+ content: string;
57
+ }>;
58
+ constructor(response: string, parkedItems?: Array<{
59
+ content: string;
60
+ }>);
61
+ }
62
+ /** Union of all deviation error types. */
63
+ export type DeviationError = Confusion | OffTopic | Pushback | TopicChange | Frustration;
64
+ /** All deviation error constructors. */
65
+ declare const DEVIATION_CLASSES: readonly [typeof Confusion, typeof OffTopic, typeof Pushback, typeof TopicChange, typeof Frustration];
66
+ /** Check if a value is a deviation error. */
67
+ export declare function isDeviationError(e: unknown): e is DeviationError;
68
+ /** Map a ResponseClass to its error, or null for 'answer'. */
69
+ export declare function classifyResponse(responseClass: ResponseClass, response: string, parkedItems?: Array<{
70
+ content: string;
71
+ }>): DeviationError | null;
72
+ /** Human-readable acknowledgment text for the stakeholder after a deviation. */
73
+ export declare function deviationMessage(error: DeviationError): string;
74
+ /** Constructor type for any deviation error class. */
75
+ type DeviationErrorClass = (typeof DEVIATION_CLASSES)[number];
76
+ /** Options for ctx.retryOnDeviation(). */
77
+ export interface RetryOptions<T> {
78
+ /** Maximum number of retries after the initial attempt. Default: 2. */
79
+ maxRetries?: number;
80
+ /** Value returned when all retries are exhausted. If absent, the last error is re-thrown. */
81
+ defaults?: T;
82
+ /** Error types to retry on. Default: all deviation errors. */
83
+ retryOn?: DeviationErrorClass[];
84
+ }
85
+ declare module "../durable/workflow.js" {
86
+ interface WorkflowContext {
87
+ retryOnDeviation<T>(callback: (index: number, error?: DeviationError) => Promise<T>, options?: RetryOptions<T>): Promise<T>;
88
+ }
89
+ }
90
+ export {};
91
+ //# sourceMappingURL=deviation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviation.d.ts","sourceRoot":"","sources":["../../src/interview/deviation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,6DAA6D;AAC7D,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,WAAW,GACX,WAAW,GACX,UAAU,GACV,cAAc,GACd,aAAa,CAAC;AAIlB,iFAAiF;AACjF,qBAAa,SAAU,SAAQ,KAAK;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBACd,QAAQ,EAAE,MAAM;CAK7B;AAED,gFAAgF;AAChF,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;gBACrC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAMvE;AAED,mEAAmE;AACnE,qBAAa,QAAS,SAAQ,KAAK;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;gBACrC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC;QAAE,O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C,CAAC,MAAM,CAAC,CAAC;AAE9D,0CAA0C;AAC1C,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb,8DAA8D;IAC9D,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACjC;AAED,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,eAAe;QACvB,gBAAgB,CAAC,CAAC,EAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,EAC/D,OAAO,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,GACxB,OAAO,CAAC,CAAC,CAAC,CAAC;KACf;CACF"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Deviation resilience — classification errors and retry primitive.
3
+ *
4
+ * When ctx.extract detects that the stakeholder didn't answer the question
5
+ * (clarification request, off-topic, pushback), it throws a typed error.
6
+ * The retry primitive catches these and gives the callback a chance to re-ask.
7
+ *
8
+ * One error class per deviation type:
9
+ * - Confusion → user is confused, rephrase the question
10
+ * - OffTopic → unrelated information or new idea
11
+ * - Pushback → questioned the process or method
12
+ * - TopicChange → tried to steer to a different subject
13
+ * - Frustration → expressed fatigue or impatience
14
+ */
15
+ import { WorkflowContext } from "../durable/index.js";
16
+ // ── Error classes ──
17
+ /** Thrown when the stakeholder expresses confusion or asks for clarification. */
18
+ export class Confusion extends Error {
19
+ response;
20
+ constructor(response) {
21
+ super(response);
22
+ this.name = "Confusion";
23
+ this.response = response;
24
+ }
25
+ }
26
+ /** Thrown when the stakeholder provides unrelated information or a new idea. */
27
+ export class OffTopic extends Error {
28
+ response;
29
+ parkedItems;
30
+ constructor(response, parkedItems) {
31
+ super(response);
32
+ this.name = "OffTopic";
33
+ this.response = response;
34
+ this.parkedItems = parkedItems ?? [];
35
+ }
36
+ }
37
+ /** Thrown when the stakeholder questions the process or method. */
38
+ export class Pushback extends Error {
39
+ response;
40
+ parkedItems;
41
+ constructor(response, parkedItems) {
42
+ super(response);
43
+ this.name = "Pushback";
44
+ this.response = response;
45
+ this.parkedItems = parkedItems ?? [];
46
+ }
47
+ }
48
+ /** Thrown when the stakeholder tries to steer to a different subject. */
49
+ export class TopicChange extends Error {
50
+ response;
51
+ parkedItems;
52
+ constructor(response, parkedItems) {
53
+ super(response);
54
+ this.name = "TopicChange";
55
+ this.response = response;
56
+ this.parkedItems = parkedItems ?? [];
57
+ }
58
+ }
59
+ /** Thrown when the stakeholder expresses fatigue or impatience. */
60
+ export class Frustration extends Error {
61
+ response;
62
+ parkedItems;
63
+ constructor(response, parkedItems) {
64
+ super(response);
65
+ this.name = "Frustration";
66
+ this.response = response;
67
+ this.parkedItems = parkedItems ?? [];
68
+ }
69
+ }
70
+ /** All deviation error constructors. */
71
+ const DEVIATION_CLASSES = [Confusion, OffTopic, Pushback, TopicChange, Frustration];
72
+ /** Check if a value is a deviation error. */
73
+ export function isDeviationError(e) {
74
+ return DEVIATION_CLASSES.some((cls) => e instanceof cls);
75
+ }
76
+ // ── Classification → Error mapping ──
77
+ /** Map a ResponseClass to its error, or null for 'answer'. */
78
+ export function classifyResponse(responseClass, response, parkedItems) {
79
+ switch (responseClass) {
80
+ case "answer": return null;
81
+ case "confusion": return new Confusion(response);
82
+ case "off_topic": return new OffTopic(response, parkedItems);
83
+ case "pushback": return new Pushback(response, parkedItems);
84
+ case "topic_change": return new TopicChange(response, parkedItems);
85
+ case "frustration": return new Frustration(response, parkedItems);
86
+ default: return null;
87
+ }
88
+ }
89
+ // ── Deviation messages ──
90
+ /** Human-readable acknowledgment text for the stakeholder after a deviation. */
91
+ export function deviationMessage(error) {
92
+ if (error instanceof Confusion) {
93
+ return "Let me put that differently.";
94
+ }
95
+ if (error instanceof Frustration) {
96
+ return "I understand — we're almost through this part. Let me keep it focused.";
97
+ }
98
+ if (error instanceof Pushback) {
99
+ return "Fair question. This helps us make sure nothing important is missed. Let me continue.";
100
+ }
101
+ return "Thanks for that — I've noted it. Let me come back to what I was asking.";
102
+ }
103
+ /**
104
+ * Retry on deviation errors.
105
+ *
106
+ * Calls the callback. If it throws a deviation error (filtered by retryOn),
107
+ * retries with (index+1, error). The callback uses the error to adjust
108
+ * its prompt (rephrase for clarification, redirect for divergence).
109
+ *
110
+ * Durable-safe: each callback invocation uses index to derive unique
111
+ * prompt/infer IDs. Memoized values replay correctly on resume.
112
+ */
113
+ WorkflowContext.prototype.retryOnDeviation = async function (callback, options) {
114
+ const maxRetries = options?.maxRetries ?? 2;
115
+ const retryOn = options?.retryOn;
116
+ let lastError;
117
+ for (let index = 0; index <= maxRetries; index++) {
118
+ try {
119
+ return await callback(index, lastError);
120
+ }
121
+ catch (e) {
122
+ if (isDeviationError(e)) {
123
+ if (retryOn && !retryOn.some((cls) => e instanceof cls)) {
124
+ throw e;
125
+ }
126
+ lastError = e;
127
+ continue;
128
+ }
129
+ throw e;
130
+ }
131
+ }
132
+ if (options && "defaults" in options) {
133
+ return options.defaults;
134
+ }
135
+ throw lastError;
136
+ };
137
+ //# sourceMappingURL=deviation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviation.js","sourceRoot":"","sources":["../../src/interview/deviation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAatD,sBAAsB;AAEtB,iFAAiF;AACjF,MAAM,OAAO,SAAU,SAAQ,KAAK;IACzB,QAAQ,CAAS;IAC1B,YAAY,QAAgB;QAC1B,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAED,gFAAgF;AAChF,MAAM,OAAO,QAAS,SAAQ,KAAK;IACxB,QAAQ,CAAS;IACjB,WA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EAAyE,CAAC;AACnF,CAAC;AA0BD;;;;;;;;;GASG;AACH,eAAe,CAAC,SAAS,CAAC,gBAAgB,GAAG,KAAK,WAChD,QAA+D,EAC/D,OAAyB;IAEzB,MAAM,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,CAAC;IACjC,IAAI,SAAqC,CAAC;IAE1C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC;QACjD,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxB,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,YAAY,GAAG,CAAC,EAAE,CAAC;oBACxD,MAAM,CAAC,CAAC;gBACV,CAAC;gBACD,SAAS,GAAG,CAAC,CAAC;gBACd,SAAS;YACX,CAAC;YACD,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC;IAED,IAAI,OAAO,IAAI,UAAU,IAAI,OAAO,EAAE,CAAC;QACrC,OAAO,OAAO,CAAC,QAAa,CAAC;IAC/B,CAAC;IACD,MAAM,SAAU,CAAC;AACnB,CAAC,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Response extraction — LLM calls that parse the respondent's words into
3
+ * structured data via a Zod schema, with extraction-quality preamble and
4
+ * response classification (deviation detection).
5
+ */
6
+ import { z } from "zod";
7
+ import type { QuestionContext } from "./prompt.js";
8
+ /** Parameters for `ctx.extract` — unified response-parsing template. */
9
+ export interface ExtractParams<S extends z.ZodObject<any>> {
10
+ id: string;
11
+ response: string;
12
+ artifactsContext: string;
13
+ schema: S;
14
+ asked?: QuestionContext;
15
+ focus?: string;
16
+ guidance?: string;
17
+ }
18
+ /** Parameters for `ctx.seed` — unified artifact-mining template. */
19
+ export interface SeedParams<S extends z.ZodObject<any>> {
20
+ id: string;
21
+ artifactsContext: string;
22
+ schema: S;
23
+ guidance?: string;
24
+ }
25
+ declare module "../durable/workflow.js" {
26
+ interface WorkflowContext {
27
+ extract<S extends z.ZodObject<any>>(params: ExtractParams<S>): Promise<z.infer<S>>;
28
+ seed<S extends z.ZodObject<any>>(params: SeedParams<S>): Promise<z.infer<S>>;
29
+ reextract<S extends z.ZodObject<any>>(id: string, clarification: string, artifactsContext: string, schema: S): Promise<z.infer<S>>;
30
+ }
31
+ }
32
+ //# sourceMappingURL=extraction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../src/interview/extraction.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGnD,wEAAwE;AACxE,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,CAAC,CAAC;IACV,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,oEAAoE;AACpE,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,CAAC,CAAC;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,eAAe;QACvB,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACnF,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7E,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KACpI;CACF"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Response extraction — LLM calls that parse the respondent's words into
3
+ * structured data via a Zod schema, with extraction-quality preamble and
4
+ * response classification (deviation detection).
5
+ */
6
+ import { z } from "zod";
7
+ import { WorkflowContext } from "../durable/index.js";
8
+ import { inferStep } from "./describe.js";
9
+ import { extractionPreamble } from "./preambles.js";
10
+ import { classifyResponse } from "./deviation.js";
11
+ /** Schema field added to every extraction to classify the stakeholder's response. */
12
+ const ResponseClassField = z.enum([
13
+ "answer", "confusion", "off_topic", "pushback", "topic_change", "frustration",
14
+ ]).describe("Classify the respondent's response: answer (addressed the question, even partially — includes disagreeing with content, pointing out conflicts, suggesting corrections, or challenging captured artifacts), confusion (asked what you mean or expressed confusion), off_topic (unrelated information), pushback (rejected the interview process itself — e.g. 'why are you asking me this' or 'this is pointless'), topic_change (steered to different subject), frustration (expressed fatigue/impatience). If in doubt, classify as answer.");
15
+ /** Common response + artifact context block for extraction prompts */
16
+ function extractionBody(response, artifactsContext, asked) {
17
+ const parts = [];
18
+ if (asked?.question) {
19
+ parts.push(`Question asked: "${asked.question}"`);
20
+ if (asked.suggestions && asked.suggestions.length > 0) {
21
+ const letters = "abcdefghijklmnopqrstuvwxyz";
22
+ const formatted = asked.suggestions.map((s, i) => `${letters[i]}) ${s}`).join(", ");
23
+ parts.push(`Suggestions offered: ${formatted}`);
24
+ }
25
+ }
26
+ parts.push(`Their response: "${response}"`);
27
+ parts.push("");
28
+ parts.push(`Existing artifacts: ${artifactsContext}`);
29
+ return parts;
30
+ }
31
+ /** Extract structured data from a user response. Schema drives what to extract. */
32
+ WorkflowContext.prototype.extract = async function (params) {
33
+ const message = buildExtractionMessage(params);
34
+ const augmented = params.schema.extend({ responseClass: ResponseClassField });
35
+ const result = await this.infer(inferStep({ id: params.id, message, schema: augmented }));
36
+ return extractOrThrowOnDeviation(result, params.response);
37
+ };
38
+ /** Assemble the extraction prompt: preamble + classification block + focus + body + guidance. */
39
+ function buildExtractionMessage(params) {
40
+ const { response, artifactsContext, asked, focus, guidance } = params;
41
+ const parts = [];
42
+ const extPre = extractionPreamble();
43
+ if (extPre)
44
+ parts.push(extPre);
45
+ parts.push(`<response_classification>
46
+ Before extracting, classify the respondent's response:
47
+ - "answer": They addressed the question (even partially or tangentially). This includes disagreeing with captured content, pointing out conflicts between items, suggesting corrections or restructuring, or challenging the substance of what was discussed. Content-level engagement is always an answer.
48
+ - "confusion": They asked what you mean, requested rephrasing, or expressed confusion about the question
49
+ - "off_topic": They provided unrelated information or introduced a new idea
50
+ - "pushback": They rejected the interview process itself — e.g. "why are you asking me this?", "this is pointless", "I don't see the point of this exercise". Challenging content or disagreeing with artifacts is NOT pushback — that is an answer.
51
+ - "topic_change": They tried to steer the conversation to a different subject
52
+ - "frustration": They expressed fatigue, impatience, or annoyance
53
+ Set responseClass accordingly. If in doubt, classify as "answer".
54
+ When responseClass is NOT "answer", deposit the respondent's actual content into waitingRoomItems (if the schema has that field) so it is preserved for later phases.
55
+ </response_classification>`);
56
+ if (focus)
57
+ parts.push(`Focus: ${focus}`);
58
+ parts.push(...extractionBody(response, artifactsContext, asked));
59
+ if (guidance)
60
+ parts.push(guidance);
61
+ return parts.join("\n");
62
+ }
63
+ /** Strip responseClass; if non-answer, throw the matching deviation error. */
64
+ function extractOrThrowOnDeviation(result, response) {
65
+ const { responseClass = "answer", ...extraction } = result;
66
+ const error = classifyResponse(responseClass, response, extraction.waitingRoomItems);
67
+ if (error)
68
+ throw error;
69
+ return extraction;
70
+ }
71
+ /**
72
+ * Mine artifacts for initial items. Schema drives what to extract.
73
+ *
74
+ * Callers opting to include waiting-room items for drain/seeding pass
75
+ * `buildFullContext(artifacts, { includeWaitingRoom: true })` so the items
76
+ * surface under the `waitingRoom` JSON field within `artifactsContext`.
77
+ */
78
+ WorkflowContext.prototype.seed = async function (params) {
79
+ const { id, artifactsContext, schema, guidance } = params;
80
+ const parts = [];
81
+ if (guidance)
82
+ parts.push(guidance);
83
+ parts.push(`\nConversation context:\n${artifactsContext}`);
84
+ return this.infer(inferStep({ id, message: parts.join("\n"), schema }));
85
+ };
86
+ /** Re-extract artifacts after a contradiction clarification, using the same schema as the original extraction. */
87
+ WorkflowContext.prototype.reextract = async function (id, clarification, artifactsContext, schema) {
88
+ return this.extract({
89
+ id,
90
+ response: clarification,
91
+ artifactsContext,
92
+ schema,
93
+ guidance: "The respondent clarified a contradiction. Re-extract incorporating the clarification.",
94
+ });
95
+ };
96
+ const REQUIRED_PROTOTYPE_METHODS = ["extract", "seed", "reextract"];
97
+ for (const method of REQUIRED_PROTOTYPE_METHODS) {
98
+ if (typeof WorkflowContext.prototype[method] !== "function") {
99
+ throw new Error(`interview/extraction.ts self-check failed: WorkflowContext.prototype.${method} is not a function.`);
100
+ }
101
+ }
102
+ //# sourceMappingURL=extraction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extraction.js","sourceRoot":"","sources":["../../src/interview/extraction.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA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IAAI,OAAQ,eAAe,CAAC,SAAgD,CAAC,MAAM,CAAC,KAAK,UAAU,EAAE,CAAC;QACpG,MAAM,IAAI,KAAK,CAAC,wEAAwE,MAAM,qBAAqB,CAAC,CAAC;IACvH,CAAC;AACH,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Interview layer barrel — side-effect imports that register all
3
+ * `WorkflowContext` prototype augmentations, plus public re-exports.
4
+ *
5
+ * Consumers that need a phase to "just work" should import this barrel
6
+ * (e.g., `phases/shared.ts`) so every prototype method is available.
7
+ *
8
+ * The API-structure child will prune this barrel to a deliberate
9
+ * public surface; for now it re-exports what cross-layer callers use today.
10
+ */
11
+ import "./deviation.js";
12
+ import "./progress.js";
13
+ import "./prompt.js";
14
+ import "./composition.js";
15
+ import "./extraction.js";
16
+ import "./classification.js";
17
+ import "./macros.js";
18
+ export { compositionPreamble, classificationPreamble, extractionPreamble, suggestionCloser, confirmationCloser } from "./preambles.js";
19
+ export { formatSublabel, type ProgressState } from "./progress.js";
20
+ export { type QuestionContext } from "./prompt.js";
21
+ export { type ExtractParams, type SeedParams } from "./extraction.js";
22
+ export { type ComposePromptExtractOptions, type PromptExtractOptions, type PromptConfirmOptions } from "./macros.js";
23
+ export { type DeviationError, type ResponseClass, classifyResponse, deviationMessage, isDeviationError, Confusion, OffTopic, Pushback, TopicChange, Frustration } from "./deviation.js";
24
+ export { zodToPromptSchema, inferStep, inferCompositionStep, ComposeSchema, type ComposeParams } from "./describe.js";
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interview/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,gBAAgB,CAAC;AACxB,OAAO,eAAe,CAAC;AACvB,OAAO,aAAa,CAAC;AACrB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AACzB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACvI,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,KAAK,2BAA2B,EAAE,KAAK,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACrH,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxL,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,oBAAoB,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Interview layer barrel — side-effect imports that register all
3
+ * `WorkflowContext` prototype augmentations, plus public re-exports.
4
+ *
5
+ * Consumers that need a phase to "just work" should import this barrel
6
+ * (e.g., `phases/shared.ts`) so every prototype method is available.
7
+ *
8
+ * The API-structure child will prune this barrel to a deliberate
9
+ * public surface; for now it re-exports what cross-layer callers use today.
10
+ */
11
+ import "./deviation.js";
12
+ import "./progress.js";
13
+ import "./prompt.js";
14
+ import "./composition.js";
15
+ import "./extraction.js";
16
+ import "./classification.js";
17
+ import "./macros.js";
18
+ export { compositionPreamble, classificationPreamble, extractionPreamble, suggestionCloser, confirmationCloser } from "./preambles.js";
19
+ export { formatSublabel } from "./progress.js";
20
+ export { classifyResponse, deviationMessage, isDeviationError, Confusion, OffTopic, Pushback, TopicChange, Frustration } from "./deviation.js";
21
+ export { zodToPromptSchema, inferStep, inferCompositionStep, ComposeSchema } from "./describe.js";
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interview/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,gBAAgB,CAAC;AACxB,OAAO,eAAe,CAAC;AACvB,OAAO,aAAa,CAAC;AACrB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AACzB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACvI,OAAO,EAAE,cAAc,EAAsB,MAAM,eAAe,CAAC;AAInE,OAAO,EAA2C,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxL,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,oBAAoB,EAAE,aAAa,EAAsB,MAAM,eAAe,CAAC"}