@hham21/circe 0.4.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 (83) hide show
  1. package/README.md +185 -0
  2. package/dist/agent.d.ts +73 -0
  3. package/dist/agent.js +334 -0
  4. package/dist/agent.js.map +1 -0
  5. package/dist/cli/agents-cmd.d.ts +2 -0
  6. package/dist/cli/agents-cmd.js +77 -0
  7. package/dist/cli/agents-cmd.js.map +1 -0
  8. package/dist/cli/index.d.ts +4 -0
  9. package/dist/cli/index.js +29 -0
  10. package/dist/cli/index.js.map +1 -0
  11. package/dist/cli/output.d.ts +20 -0
  12. package/dist/cli/output.js +136 -0
  13. package/dist/cli/output.js.map +1 -0
  14. package/dist/cli/run.d.ts +10 -0
  15. package/dist/cli/run.js +90 -0
  16. package/dist/cli/run.js.map +1 -0
  17. package/dist/cli/skills-cmd.d.ts +2 -0
  18. package/dist/cli/skills-cmd.js +95 -0
  19. package/dist/cli/skills-cmd.js.map +1 -0
  20. package/dist/cli/workflows-cmd.d.ts +2 -0
  21. package/dist/cli/workflows-cmd.js +61 -0
  22. package/dist/cli/workflows-cmd.js.map +1 -0
  23. package/dist/context.d.ts +8 -0
  24. package/dist/context.js +23 -0
  25. package/dist/context.js.map +1 -0
  26. package/dist/events.d.ts +134 -0
  27. package/dist/events.js +127 -0
  28. package/dist/events.js.map +1 -0
  29. package/dist/handoff.d.ts +153 -0
  30. package/dist/handoff.js +42 -0
  31. package/dist/handoff.js.map +1 -0
  32. package/dist/index.d.ts +9 -0
  33. package/dist/index.js +10 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/orchestration/contract.d.ts +27 -0
  36. package/dist/orchestration/contract.js +104 -0
  37. package/dist/orchestration/contract.js.map +1 -0
  38. package/dist/orchestration/index.d.ts +10 -0
  39. package/dist/orchestration/index.js +6 -0
  40. package/dist/orchestration/index.js.map +1 -0
  41. package/dist/orchestration/loop.d.ts +25 -0
  42. package/dist/orchestration/loop.js +81 -0
  43. package/dist/orchestration/loop.js.map +1 -0
  44. package/dist/orchestration/parallel.d.ts +27 -0
  45. package/dist/orchestration/parallel.js +78 -0
  46. package/dist/orchestration/parallel.js.map +1 -0
  47. package/dist/orchestration/pipeline.d.ts +23 -0
  48. package/dist/orchestration/pipeline.js +100 -0
  49. package/dist/orchestration/pipeline.js.map +1 -0
  50. package/dist/orchestration/sprint.d.ts +21 -0
  51. package/dist/orchestration/sprint.js +56 -0
  52. package/dist/orchestration/sprint.js.map +1 -0
  53. package/dist/presets/frontend.d.ts +8 -0
  54. package/dist/presets/frontend.js +113 -0
  55. package/dist/presets/frontend.js.map +1 -0
  56. package/dist/presets/fullstack.d.ts +9 -0
  57. package/dist/presets/fullstack.js +118 -0
  58. package/dist/presets/fullstack.js.map +1 -0
  59. package/dist/presets/index.d.ts +2 -0
  60. package/dist/presets/index.js +3 -0
  61. package/dist/presets/index.js.map +1 -0
  62. package/dist/session/index.d.ts +1 -0
  63. package/dist/session/index.js +2 -0
  64. package/dist/session/index.js.map +1 -0
  65. package/dist/session/manager.d.ts +17 -0
  66. package/dist/session/manager.js +50 -0
  67. package/dist/session/manager.js.map +1 -0
  68. package/dist/tools/custom.d.ts +5 -0
  69. package/dist/tools/custom.js +7 -0
  70. package/dist/tools/custom.js.map +1 -0
  71. package/dist/tools/index.d.ts +1 -0
  72. package/dist/tools/index.js +2 -0
  73. package/dist/tools/index.js.map +1 -0
  74. package/dist/tools/skills.d.ts +18 -0
  75. package/dist/tools/skills.js +99 -0
  76. package/dist/tools/skills.js.map +1 -0
  77. package/dist/types.d.ts +36 -0
  78. package/dist/types.js +12 -0
  79. package/dist/types.js.map +1 -0
  80. package/dist/utils.d.ts +24 -0
  81. package/dist/utils.js +85 -0
  82. package/dist/utils.js.map +1 -0
  83. package/package.json +49 -0
@@ -0,0 +1,134 @@
1
+ export type OrchestratorEvent = {
2
+ type: "agent:start";
3
+ agent: string;
4
+ timestamp: number;
5
+ } | {
6
+ type: "agent:done";
7
+ agent: string;
8
+ result: unknown;
9
+ /** USD */ cost: number;
10
+ tokens: [number, number];
11
+ timestamp: number;
12
+ } | {
13
+ type: "agent:error";
14
+ agent: string;
15
+ error: string;
16
+ attempt: number;
17
+ /** USD */ cost?: number;
18
+ tokens?: [number, number];
19
+ timestamp: number;
20
+ } | {
21
+ type: "step:start";
22
+ step: number;
23
+ agent: string;
24
+ timestamp: number;
25
+ } | {
26
+ type: "step:done";
27
+ step: number;
28
+ agent: string;
29
+ output: unknown;
30
+ /** USD */ cost?: number;
31
+ tokens?: [number, number];
32
+ timestamp: number;
33
+ } | {
34
+ type: "step:error";
35
+ step: number;
36
+ agent: string;
37
+ error: string;
38
+ timestamp: number;
39
+ } | {
40
+ type: "round:start";
41
+ round: number;
42
+ timestamp: number;
43
+ } | {
44
+ type: "round:done";
45
+ round: number;
46
+ result: unknown; /** USD */
47
+ cost?: number;
48
+ timestamp: number;
49
+ } | {
50
+ type: "round:error";
51
+ round: number;
52
+ error: string;
53
+ timestamp: number;
54
+ } | {
55
+ type: "branch:start";
56
+ branch: string;
57
+ timestamp: number;
58
+ } | {
59
+ type: "branch:done";
60
+ branch: string;
61
+ result: unknown; /** USD */
62
+ cost?: number;
63
+ timestamp: number;
64
+ } | {
65
+ type: "branch:error";
66
+ branch: string;
67
+ error: string;
68
+ timestamp: number;
69
+ } | {
70
+ type: "retry";
71
+ agent: string;
72
+ attempt: number;
73
+ maxAttempts: number;
74
+ timestamp: number;
75
+ } | {
76
+ type: "pipeline:done"; /** USD */
77
+ totalCost: number;
78
+ timestamp: number;
79
+ } | {
80
+ type: "sprint:start";
81
+ index: number;
82
+ definition: unknown;
83
+ timestamp: number;
84
+ } | {
85
+ type: "sprint:done";
86
+ index: number;
87
+ result: unknown; /** USD */
88
+ cost?: number;
89
+ timestamp: number;
90
+ } | {
91
+ type: "sprint:error";
92
+ index: number;
93
+ error: string;
94
+ timestamp: number;
95
+ };
96
+ type EventHandler<T extends OrchestratorEvent["type"]> = (event: Extract<OrchestratorEvent, {
97
+ type: T;
98
+ }>) => void;
99
+ export interface EventBusOptions {
100
+ maxCost?: number;
101
+ }
102
+ export declare class EventBus {
103
+ history: OrchestratorEvent[];
104
+ private handlerMap;
105
+ private maxCost;
106
+ private runningCost;
107
+ private perAgentCost;
108
+ constructor(options?: EventBusOptions);
109
+ on<T extends OrchestratorEvent["type"]>(type: T, handler: EventHandler<T>): void;
110
+ emit(event: OrchestratorEvent): void;
111
+ getCostSummary(): {
112
+ total: number;
113
+ perAgent: Record<string, number>;
114
+ };
115
+ }
116
+ export interface RetryPolicy {
117
+ maxRetries: number;
118
+ backoff?: (attempt: number) => number;
119
+ shouldRetry?: (error: Error) => boolean;
120
+ }
121
+ export declare function defaultShouldRetry(error: Error): boolean;
122
+ export declare function defaultBackoff(attempt: number): number;
123
+ export declare function toError(err: unknown): Error;
124
+ export declare function errorMessage(err: unknown): string;
125
+ /**
126
+ * Run a Runnable with optional retry + EventBus retry event emission.
127
+ * Shared by all orchestrators to eliminate duplicated retry wrappers.
128
+ */
129
+ export declare function runWithOptionalRetry<TIn, TOut>(agent: {
130
+ name?: string;
131
+ run(input: TIn): Promise<TOut>;
132
+ }, input: TIn, retryPolicy: RetryPolicy | null, eventBus: EventBus | null): Promise<TOut>;
133
+ export declare function executeWithRetry<T>(fn: () => Promise<T>, policy: RetryPolicy, onRetry?: (attempt: number, error: Error) => void): Promise<T>;
134
+ export {};
package/dist/events.js ADDED
@@ -0,0 +1,127 @@
1
+ function extractCostEntry(event) {
2
+ if (event.type === "agent:done") {
3
+ return { cost: event.cost, agent: event.agent };
4
+ }
5
+ if (event.type === "agent:error" && event.cost != null) {
6
+ return { cost: event.cost, agent: event.agent };
7
+ }
8
+ if (event.type === "step:done" && event.cost != null) {
9
+ return { cost: event.cost, agent: event.agent };
10
+ }
11
+ if (event.type === "round:done" && event.cost != null) {
12
+ return { cost: event.cost, agent: `round-${event.round}` };
13
+ }
14
+ if (event.type === "sprint:done" && event.cost != null) {
15
+ return { cost: event.cost, agent: `sprint-${event.index}` };
16
+ }
17
+ if (event.type === "branch:done" && event.cost != null) {
18
+ return { cost: event.cost, agent: event.branch };
19
+ }
20
+ return null;
21
+ }
22
+ export class EventBus {
23
+ history = [];
24
+ handlerMap = new Map();
25
+ maxCost;
26
+ runningCost = 0;
27
+ perAgentCost = {};
28
+ constructor(options) {
29
+ this.maxCost = options?.maxCost ?? null;
30
+ }
31
+ on(type, handler) {
32
+ const list = this.handlerMap.get(type) ?? [];
33
+ list.push(handler);
34
+ this.handlerMap.set(type, list);
35
+ }
36
+ emit(event) {
37
+ this.history.push(event);
38
+ const costEntry = extractCostEntry(event);
39
+ if (costEntry) {
40
+ this.runningCost += costEntry.cost;
41
+ this.perAgentCost[costEntry.agent] = (this.perAgentCost[costEntry.agent] ?? 0) + costEntry.cost;
42
+ }
43
+ if (this.maxCost != null && this.runningCost > this.maxCost) {
44
+ throw new Error(`Cost limit exceeded: $${this.runningCost.toFixed(2)} spent, limit is $${this.maxCost.toFixed(2)}`);
45
+ }
46
+ const handlers = this.handlerMap.get(event.type);
47
+ if (handlers) {
48
+ for (const handler of handlers) {
49
+ try {
50
+ handler(event);
51
+ }
52
+ catch (err) {
53
+ console.error(`[EventBus] handler error for ${event.type}:`, err);
54
+ }
55
+ }
56
+ }
57
+ }
58
+ getCostSummary() {
59
+ return { total: this.runningCost, perAgent: { ...this.perAgentCost } };
60
+ }
61
+ }
62
+ const NON_RETRYABLE_PATTERNS = [
63
+ /\b400\b/,
64
+ /\b401\b/,
65
+ /\b403\b/,
66
+ /bad request/i,
67
+ /unauthorized/i,
68
+ /forbidden/i,
69
+ /invalid.*model/i,
70
+ /invalid.*api.?key/i,
71
+ ];
72
+ export function defaultShouldRetry(error) {
73
+ const msg = error.message;
74
+ return !NON_RETRYABLE_PATTERNS.some((p) => p.test(msg));
75
+ }
76
+ const BASE_BACKOFF_MS = 1_000;
77
+ const MAX_BACKOFF_MS = 60_000;
78
+ export function defaultBackoff(attempt) {
79
+ return Math.min(BASE_BACKOFF_MS * 2 ** attempt, MAX_BACKOFF_MS);
80
+ }
81
+ export function toError(err) {
82
+ return err instanceof Error ? err : new Error(String(err));
83
+ }
84
+ export function errorMessage(err) {
85
+ return toError(err).message;
86
+ }
87
+ /**
88
+ * Run a Runnable with optional retry + EventBus retry event emission.
89
+ * Shared by all orchestrators to eliminate duplicated retry wrappers.
90
+ */
91
+ export async function runWithOptionalRetry(agent, input, retryPolicy, eventBus) {
92
+ if (!retryPolicy) {
93
+ return agent.run(input);
94
+ }
95
+ return executeWithRetry(() => agent.run(input), retryPolicy, (attempt) => {
96
+ eventBus?.emit({
97
+ type: "retry",
98
+ agent: agent.name ?? "unknown",
99
+ attempt,
100
+ maxAttempts: retryPolicy.maxRetries,
101
+ timestamp: Date.now(),
102
+ });
103
+ });
104
+ }
105
+ export async function executeWithRetry(fn, policy, onRetry) {
106
+ const shouldRetry = policy.shouldRetry ?? defaultShouldRetry;
107
+ const backoff = policy.backoff ?? defaultBackoff;
108
+ let lastError = null;
109
+ for (let attempt = 0; attempt <= policy.maxRetries; attempt++) {
110
+ try {
111
+ return await fn();
112
+ }
113
+ catch (err) {
114
+ lastError = toError(err);
115
+ if (attempt >= policy.maxRetries || !shouldRetry(lastError)) {
116
+ throw lastError;
117
+ }
118
+ onRetry?.(attempt + 1, lastError);
119
+ const delay = backoff(attempt);
120
+ if (delay > 0) {
121
+ await new Promise((r) => setTimeout(r, delay));
122
+ }
123
+ }
124
+ }
125
+ throw lastError;
126
+ }
127
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAmDA,SAAS,gBAAgB,CAAC,KAAwB;IAChD,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QAChC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;IAClD,CAAC;IAC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OAAO,CAAC,OAAO,CAAC,CAAC;YAC/B,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;gBACd,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;YACjD,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,SAAU,CAAC;AACnB,CAAC"}
@@ -0,0 +1,153 @@
1
+ import { z } from "zod";
2
+ export declare const FeatureSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ description: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ name: string;
7
+ description: string;
8
+ }, {
9
+ name: string;
10
+ description: string;
11
+ }>;
12
+ export declare const TechStackSchema: z.ZodObject<{
13
+ frontend: z.ZodString;
14
+ backend: z.ZodString;
15
+ database: z.ZodString;
16
+ }, "strip", z.ZodTypeAny, {
17
+ frontend: string;
18
+ backend: string;
19
+ database: string;
20
+ }, {
21
+ frontend: string;
22
+ backend: string;
23
+ database: string;
24
+ }>;
25
+ export declare const ProductSpecSchema: z.ZodObject<{
26
+ appName: z.ZodString;
27
+ features: z.ZodArray<z.ZodObject<{
28
+ name: z.ZodString;
29
+ description: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ name: string;
32
+ description: string;
33
+ }, {
34
+ name: string;
35
+ description: string;
36
+ }>, "many">;
37
+ techStack: z.ZodObject<{
38
+ frontend: z.ZodString;
39
+ backend: z.ZodString;
40
+ database: z.ZodString;
41
+ }, "strip", z.ZodTypeAny, {
42
+ frontend: string;
43
+ backend: string;
44
+ database: string;
45
+ }, {
46
+ frontend: string;
47
+ backend: string;
48
+ database: string;
49
+ }>;
50
+ designDirection: z.ZodString;
51
+ }, "strip", z.ZodTypeAny, {
52
+ appName: string;
53
+ features: {
54
+ name: string;
55
+ description: string;
56
+ }[];
57
+ techStack: {
58
+ frontend: string;
59
+ backend: string;
60
+ database: string;
61
+ };
62
+ designDirection: string;
63
+ }, {
64
+ appName: string;
65
+ features: {
66
+ name: string;
67
+ description: string;
68
+ }[];
69
+ techStack: {
70
+ frontend: string;
71
+ backend: string;
72
+ database: string;
73
+ };
74
+ designDirection: string;
75
+ }>;
76
+ export declare const BuildResultSchema: z.ZodObject<{
77
+ appDir: z.ZodString;
78
+ runCommand: z.ZodString;
79
+ port: z.ZodNumber;
80
+ selfAssessment: z.ZodString;
81
+ }, "strip", z.ZodTypeAny, {
82
+ appDir: string;
83
+ runCommand: string;
84
+ port: number;
85
+ selfAssessment: string;
86
+ }, {
87
+ appDir: string;
88
+ runCommand: string;
89
+ port: number;
90
+ selfAssessment: string;
91
+ }>;
92
+ export declare const QAReportSchema: z.ZodObject<{
93
+ passed: z.ZodBoolean;
94
+ scores: z.ZodRecord<z.ZodString, z.ZodNumber>;
95
+ feedback: z.ZodArray<z.ZodString, "many">;
96
+ }, "strip", z.ZodTypeAny, {
97
+ passed: boolean;
98
+ scores: Record<string, number>;
99
+ feedback: string[];
100
+ }, {
101
+ passed: boolean;
102
+ scores: Record<string, number>;
103
+ feedback: string[];
104
+ }>;
105
+ export type Feature = z.infer<typeof FeatureSchema>;
106
+ export type TechStack = z.infer<typeof TechStackSchema>;
107
+ export type ProductSpec = z.infer<typeof ProductSpecSchema>;
108
+ export type BuildResult = z.infer<typeof BuildResultSchema>;
109
+ export type QAReport = z.infer<typeof QAReportSchema>;
110
+ export declare function hasQAPassed(result: unknown): boolean;
111
+ export declare const Feature: {
112
+ parse: (d: unknown) => {
113
+ name: string;
114
+ description: string;
115
+ };
116
+ };
117
+ export declare const TechStack: {
118
+ parse: (d: unknown) => {
119
+ frontend: string;
120
+ backend: string;
121
+ database: string;
122
+ };
123
+ };
124
+ export declare const ProductSpec: {
125
+ parse: (d: unknown) => {
126
+ appName: string;
127
+ features: {
128
+ name: string;
129
+ description: string;
130
+ }[];
131
+ techStack: {
132
+ frontend: string;
133
+ backend: string;
134
+ database: string;
135
+ };
136
+ designDirection: string;
137
+ };
138
+ };
139
+ export declare const BuildResult: {
140
+ parse: (d: unknown) => {
141
+ appDir: string;
142
+ runCommand: string;
143
+ port: number;
144
+ selfAssessment: string;
145
+ };
146
+ };
147
+ export declare const QAReport: {
148
+ parse: (d: unknown) => {
149
+ passed: boolean;
150
+ scores: Record<string, number>;
151
+ feedback: string[];
152
+ };
153
+ };
@@ -0,0 +1,42 @@
1
+ import { z } from "zod";
2
+ export const FeatureSchema = z.object({
3
+ name: z.string(),
4
+ description: z.string(),
5
+ });
6
+ export const TechStackSchema = z.object({
7
+ frontend: z.string(),
8
+ backend: z.string(),
9
+ database: z.string(),
10
+ });
11
+ export const ProductSpecSchema = z.object({
12
+ appName: z.string(),
13
+ features: z.array(FeatureSchema),
14
+ techStack: TechStackSchema,
15
+ designDirection: z.string(),
16
+ });
17
+ export const BuildResultSchema = z.object({
18
+ appDir: z.string(),
19
+ runCommand: z.string(),
20
+ port: z.number(),
21
+ selfAssessment: z.string(),
22
+ });
23
+ export const QAReportSchema = z.object({
24
+ passed: z.boolean(),
25
+ scores: z.record(z.string(), z.number()),
26
+ feedback: z.array(z.string()),
27
+ });
28
+ export function hasQAPassed(result) {
29
+ if (result != null && typeof result === "object" && "passed" in result) {
30
+ return result.passed === true;
31
+ }
32
+ return false;
33
+ }
34
+ function makeParser(schema) {
35
+ return { parse: (d) => schema.parse(d) };
36
+ }
37
+ export const Feature = makeParser(FeatureSchema);
38
+ export const TechStack = makeParser(TechStackSchema);
39
+ export const ProductSpec = makeParser(ProductSpecSchema);
40
+ export const BuildResult = makeParser(BuildResultSchema);
41
+ export const QAReport = makeParser(QAReportSchema);
42
+ //# sourceMappingURL=handoff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handoff.js","sourceRoot":"","sources":["../src/handoff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,CAA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A8B,CAAC,MAAM,KAAK,IAAI,CAAC;IACzD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,UAAU,CAAI,MAAoC;IACzD,OAAO,EAAE,KAAK,EAAE,CAAC,CAAU,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACpD,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACzD,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { Agent, Agent as BaseAgent, agent, loadAgent, type ResultMetrics } from "./agent.js";
2
+ export { EventBus, executeWithRetry, defaultShouldRetry, defaultBackoff, type OrchestratorEvent, type RetryPolicy, } from "./events.js";
3
+ export { findJsonString, parseTrailingOptions, createMetrics, accumulateMetrics, type MetricsAccumulator } from "./utils.js";
4
+ export { FeatureSchema, TechStackSchema, ProductSpecSchema, BuildResultSchema, QAReportSchema, type Feature, type TechStack, type ProductSpec, type BuildResult, type QAReport, hasQAPassed, } from "./handoff.js";
5
+ export { Pipeline, pipe, Loop, Parallel, Contract, Sprint, type PipelineOptions, type LoopOptions, type ParallelOptions, type ParallelResult, type ContractOptions, type SprintOptions, } from "./orchestration/index.js";
6
+ export { OutputFormatter } from "./cli/output.js";
7
+ export { SkillRegistry, type SkillInfo } from "./tools/skills.js";
8
+ export { setFormatter, setSkillRegistry, getSkillRegistry } from "./context.js";
9
+ export { RunContextSchema, type RunContext, type Runnable, type MetricsSnapshot } from "./types.js";
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ export { Agent, Agent as BaseAgent, agent, loadAgent } from "./agent.js";
2
+ export { EventBus, executeWithRetry, defaultShouldRetry, defaultBackoff, } from "./events.js";
3
+ export { findJsonString, parseTrailingOptions, createMetrics, accumulateMetrics } from "./utils.js";
4
+ export { FeatureSchema, TechStackSchema, ProductSpecSchema, BuildResultSchema, QAReportSchema, hasQAPassed, } from "./handoff.js";
5
+ export { Pipeline, pipe, Loop, Parallel, Contract, Sprint, } from "./orchestration/index.js";
6
+ export { OutputFormatter } from "./cli/output.js";
7
+ export { SkillRegistry } from "./tools/skills.js";
8
+ export { setFormatter, setSkillRegistry, getSkillRegistry } from "./context.js";
9
+ export { RunContextSchema } from "./types.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,KAAK,EAAE,SAAS,EAAsB,MAAM,YAAY,CAAC;AAC7F,OAAO,EACL,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GAGf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,aAAa,EAAE,iBAAiB,EAA2B,MAAM,YAAY,CAAC;AAC7H,OAAO,EACL,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EAMd,WAAW,GACZ,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,MAAM,GAOP,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAkB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAwD,MAAM,YAAY,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { Runnable } from "../types.js";
2
+ import type { EventBus, RetryPolicy } from "../events.js";
3
+ export interface ContractOptions<TReview = unknown> {
4
+ maxRounds?: number;
5
+ isAccepted?: (review: TReview) => boolean;
6
+ retryPolicy?: RetryPolicy;
7
+ eventBus?: EventBus;
8
+ }
9
+ export declare class Contract<TIn = unknown, TProposal = unknown, TReview = unknown> implements Runnable<TIn, TProposal> {
10
+ name?: string;
11
+ private proposer;
12
+ private reviewer;
13
+ private maxRounds;
14
+ private retryPolicy;
15
+ private eventBus;
16
+ private customIsAccepted;
17
+ private _lastMetrics;
18
+ private _lastProposal;
19
+ private _lastEvaluatorResult;
20
+ constructor(proposer: Runnable<TIn | TReview, TProposal>, reviewer: Runnable<TProposal, TReview>, options?: ContractOptions<TReview>);
21
+ get lastMetrics(): import("../types.js").MetricsSnapshot | null;
22
+ get lastEvaluatorResult(): TReview | null;
23
+ run(input: TIn): Promise<TProposal>;
24
+ private executeRound;
25
+ private parseReview;
26
+ private isAccepted;
27
+ }
@@ -0,0 +1,104 @@
1
+ import { findJsonString } from "../utils.js";
2
+ import { runWithOptionalRetry, errorMessage } from "../events.js";
3
+ import { createMetrics, accumulateMetrics } from "../utils.js";
4
+ const DEFAULT_MAX_ROUNDS = 3;
5
+ export class Contract {
6
+ name;
7
+ proposer;
8
+ reviewer;
9
+ maxRounds;
10
+ retryPolicy;
11
+ eventBus;
12
+ customIsAccepted = null;
13
+ _lastMetrics = null;
14
+ _lastProposal = null;
15
+ _lastEvaluatorResult = null;
16
+ constructor(proposer, reviewer, options) {
17
+ this.proposer = proposer;
18
+ this.reviewer = reviewer;
19
+ this.maxRounds = options?.maxRounds ?? DEFAULT_MAX_ROUNDS;
20
+ this.customIsAccepted = options?.isAccepted ?? null;
21
+ this.retryPolicy = options?.retryPolicy ?? null;
22
+ this.eventBus = options?.eventBus ?? null;
23
+ }
24
+ get lastMetrics() { return this._lastMetrics; }
25
+ get lastEvaluatorResult() { return this._lastEvaluatorResult; }
26
+ async run(input) {
27
+ this._lastMetrics = null;
28
+ this._lastProposal = null;
29
+ this._lastEvaluatorResult = null;
30
+ const accumulated = createMetrics();
31
+ let proposalInput = input;
32
+ let review;
33
+ try {
34
+ for (let round = 0; round < this.maxRounds; round++) {
35
+ this.eventBus?.emit({ type: "round:start", round, timestamp: Date.now() });
36
+ try {
37
+ review = await this.executeRound(round, proposalInput, accumulated);
38
+ }
39
+ catch (err) {
40
+ this.eventBus?.emit({
41
+ type: "round:error",
42
+ round,
43
+ error: errorMessage(err),
44
+ timestamp: Date.now(),
45
+ });
46
+ throw new Error(`[Contract:round-${round + 1}] ${errorMessage(err)}`);
47
+ }
48
+ if (this.isAccepted(review)) {
49
+ this._lastMetrics = { ...accumulated };
50
+ return this._lastProposal;
51
+ }
52
+ proposalInput = review;
53
+ }
54
+ this._lastMetrics = { ...accumulated };
55
+ return review;
56
+ }
57
+ finally {
58
+ if (!this._lastMetrics) {
59
+ this._lastMetrics = { ...accumulated };
60
+ }
61
+ }
62
+ }
63
+ async executeRound(round, proposalInput, accumulated) {
64
+ const proposal = await runWithOptionalRetry(this.proposer, proposalInput, this.retryPolicy, this.eventBus);
65
+ this._lastProposal = proposal;
66
+ const pm = this.proposer.lastMetrics;
67
+ accumulateMetrics(accumulated, pm);
68
+ const review = this.parseReview(await runWithOptionalRetry(this.reviewer, proposal, this.retryPolicy, this.eventBus));
69
+ this._lastEvaluatorResult = review;
70
+ const rm = this.reviewer.lastMetrics;
71
+ accumulateMetrics(accumulated, rm);
72
+ const roundCost = (pm?.cost ?? 0) + (rm?.cost ?? 0);
73
+ this.eventBus?.emit({
74
+ type: "round:done",
75
+ round,
76
+ result: review,
77
+ cost: roundCost || undefined,
78
+ timestamp: Date.now(),
79
+ });
80
+ return review;
81
+ }
82
+ parseReview(review) {
83
+ if (typeof review !== "string")
84
+ return review;
85
+ const jsonStr = findJsonString(review);
86
+ if (!jsonStr)
87
+ return review;
88
+ try {
89
+ return JSON.parse(jsonStr);
90
+ }
91
+ catch {
92
+ return review;
93
+ }
94
+ }
95
+ isAccepted(review) {
96
+ if (this.customIsAccepted)
97
+ return this.customIsAccepted(review);
98
+ if (review == null || typeof review !== "object")
99
+ return false;
100
+ const accepted = review.accepted;
101
+ return typeof accepted === "boolean" && accepted;
102
+ }
103
+ }
104
+ //# sourceMappingURL=contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/orchestration/contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAG/D,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAS7B,MAAM,OAAO,QAAQ;IACnB,IAAI,CAAU;IACN,QAAQ,CAAqC;IAC7C,QAAQ,CAA+B;IACvC,SAAS,CAAS;IAClB,WAAW,CAAqB;IAChC,QAAQ,CAAkB;IAC1B,gBAAgB,GAA0C,IAAI,CAAC;IAC/D,YAAY,GAA8B,IAAI,CAAC;IAC/C,aAAa,GAAqB,IAAI,CAAC;IACvC,oBAAoB,GAAmB,IAAI,CAAC;IAEpD,YAAY,QAA4C,EAAE,QAAsC,EAAE,OAAkC;QAClI,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,kBAAkB,CAAC;QAC1D,IAAI,CAAC,gBAAgB,GAAG,OAAO,EAAE,UAAU,IAAI,IAAI,CAAC;QACpD,IAAI,CAAC,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,IAAI,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,OAAO,EAAE,QAAQ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AAQ,EAAE,IAAI,CAAC;YAClB,IAAI,EAAE,YAAY;YAClB,KAAK;YACL,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,SAAS,IAAI,SAAS;YAC5B,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,WAAW,CAAC,MAAe;QACjC,IAAI,OAAO,MAAM,KAAK,QAAQ;YAAE,OAAO,MAAiB,CAAC;QACzD,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QACvC,IAAI,CAAC,OAAO;YAAE,OAAO,MAAiB,CAAC;QACvC,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAY,CAAC;QACxC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,MAAiB,CAAC;QAC3B,CAAC;IACH,CAAC;IAEO,UAAU,CAAC,MAAe;QAChC,IAAI,IAAI,CAAC,gBAAgB;YAAE,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAChE,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC/D,MAAM,QAAQ,GAAI,MAAkC,CAAC,QAAQ,CAAC;QAC9D,OAAO,OAAO,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC;IACnD,CAAC;CACF"}
@@ -0,0 +1,10 @@
1
+ export { Pipeline, pipe } from "./pipeline.js";
2
+ export type { PipelineOptions } from "./pipeline.js";
3
+ export { Loop } from "./loop.js";
4
+ export type { LoopOptions } from "./loop.js";
5
+ export { Parallel } from "./parallel.js";
6
+ export type { ParallelOptions, ParallelResult } from "./parallel.js";
7
+ export { Contract } from "./contract.js";
8
+ export type { ContractOptions } from "./contract.js";
9
+ export { Sprint } from "./sprint.js";
10
+ export type { SprintOptions } from "./sprint.js";
@@ -0,0 +1,6 @@
1
+ export { Pipeline, pipe } from "./pipeline.js";
2
+ export { Loop } from "./loop.js";
3
+ export { Parallel } from "./parallel.js";
4
+ export { Contract } from "./contract.js";
5
+ export { Sprint } from "./sprint.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/orchestration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}