@fenixforce/edition-pro 0.1.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 (173) hide show
  1. package/dist/api/approval-routes.d.ts +15 -0
  2. package/dist/api/fleet-routes.d.ts +23 -0
  3. package/dist/api/integration-routes.d.ts +17 -0
  4. package/dist/api/middleware.d.ts +37 -0
  5. package/dist/boot.d.ts +37 -0
  6. package/dist/business/approval-queue.d.ts +94 -0
  7. package/dist/business/arena.d.ts +71 -0
  8. package/dist/business/best-of-n.d.ts +68 -0
  9. package/dist/business/brainstorm.d.ts +42 -0
  10. package/dist/business/compile-checker.d.ts +50 -0
  11. package/dist/business/debate.d.ts +38 -0
  12. package/dist/business/fleet-budget.d.ts +69 -0
  13. package/dist/business/fleet-config.d.ts +125 -0
  14. package/dist/business/fleet.d.ts +85 -0
  15. package/dist/business/handoff.d.ts +56 -0
  16. package/dist/business/hat-system.d.ts +57 -0
  17. package/dist/business/index.d.ts +44 -0
  18. package/dist/business/integration-registry.d.ts +66 -0
  19. package/dist/business/node-pipeline.d.ts +62 -0
  20. package/dist/business/oracle.d.ts +64 -0
  21. package/dist/business/roles/index.d.ts +7 -0
  22. package/dist/business/roles/judge.d.ts +24 -0
  23. package/dist/business/roles/planner.d.ts +30 -0
  24. package/dist/business/roles/types.d.ts +37 -0
  25. package/dist/business/roles/worker.d.ts +25 -0
  26. package/dist/business/router.d.ts +75 -0
  27. package/dist/business/shared-memory.d.ts +85 -0
  28. package/dist/business/status-detector.d.ts +52 -0
  29. package/dist/business/swarm-registry.d.ts +63 -0
  30. package/dist/business/templates.d.ts +55 -0
  31. package/dist/business/workspace-manager.d.ts +105 -0
  32. package/dist/index.d.ts +21 -0
  33. package/dist/index.js +638 -0
  34. package/dist/infrastructure/pty-agent.d.ts +74 -0
  35. package/dist/migrations/migrate.d.ts +7 -0
  36. package/dist/migrations/runner.d.ts +49 -0
  37. package/dist/workspace/worktree.d.ts +69 -0
  38. package/package.json +37 -0
  39. package/skills/builtin/academic-researcher/SKILL.md +51 -0
  40. package/skills/builtin/advanced-recon/SKILL.md +75 -0
  41. package/skills/builtin/agent-governance/SKILL.md +122 -0
  42. package/skills/builtin/algorithmic-art/SKILL.md +55 -0
  43. package/skills/builtin/api-attack-surface-mapper/SKILL.md +88 -0
  44. package/skills/builtin/api-development/SKILL.md +147 -0
  45. package/skills/builtin/api-exploit-prover/SKILL.md +74 -0
  46. package/skills/builtin/api-integration/SKILL.md +73 -0
  47. package/skills/builtin/api-security-tester/SKILL.md +82 -0
  48. package/skills/builtin/api-test-executor/SKILL.md +62 -0
  49. package/skills/builtin/app-store-optimization/SKILL.md +46 -0
  50. package/skills/builtin/audio-tour-guide/SKILL.md +18 -0
  51. package/skills/builtin/auth-flow-operator/SKILL.md +70 -0
  52. package/skills/builtin/autonomous-rag/SKILL.md +21 -0
  53. package/skills/builtin/backend-development/SKILL.md +265 -0
  54. package/skills/builtin/binary-analysis-analyst/SKILL.md +61 -0
  55. package/skills/builtin/binary-analysis-core/SKILL.md +65 -0
  56. package/skills/builtin/binary-recon/SKILL.md +64 -0
  57. package/skills/builtin/blackboard-coordination/SKILL.md +56 -0
  58. package/skills/builtin/blog-to-podcast/SKILL.md +18 -0
  59. package/skills/builtin/blog-writing/SKILL.md +36 -0
  60. package/skills/builtin/brainstorming/SKILL.md +69 -0
  61. package/skills/builtin/brand-design/SKILL.md +42 -0
  62. package/skills/builtin/ci-cd-pipelines/SKILL.md +210 -0
  63. package/skills/builtin/cloud-infrastructure/SKILL.md +140 -0
  64. package/skills/builtin/code-review/SKILL.md +88 -0
  65. package/skills/builtin/code-review-analyst/SKILL.md +96 -0
  66. package/skills/builtin/code-review-recon/SKILL.md +64 -0
  67. package/skills/builtin/code-review-verifier/SKILL.md +55 -0
  68. package/skills/builtin/coding-agent-team/SKILL.md +13 -0
  69. package/skills/builtin/competitor-intelligence/SKILL.md +39 -0
  70. package/skills/builtin/content-engine/SKILL.md +82 -0
  71. package/skills/builtin/context7-docs/SKILL.md +145 -0
  72. package/skills/builtin/copywriting/SKILL.md +38 -0
  73. package/skills/builtin/corrective-rag/SKILL.md +19 -0
  74. package/skills/builtin/cost-optimization/SKILL.md +131 -0
  75. package/skills/builtin/crypto-vulnerability-analyst/SKILL.md +64 -0
  76. package/skills/builtin/customer-support/SKILL.md +48 -0
  77. package/skills/builtin/customer-voice-support/SKILL.md +43 -0
  78. package/skills/builtin/data-analysis/SKILL.md +57 -0
  79. package/skills/builtin/data-visualization/SKILL.md +33 -0
  80. package/skills/builtin/database-design/SKILL.md +119 -0
  81. package/skills/builtin/decision-helper/SKILL.md +84 -0
  82. package/skills/builtin/deep-research/SKILL.md +68 -0
  83. package/skills/builtin/deepwiki-research/SKILL.md +115 -0
  84. package/skills/builtin/dependency-audit/SKILL.md +46 -0
  85. package/skills/builtin/doc-coauthoring/SKILL.md +48 -0
  86. package/skills/builtin/docker-deployment/SKILL.md +243 -0
  87. package/skills/builtin/docx-generation/SKILL.md +135 -0
  88. package/skills/builtin/dry-run-harness/SKILL.md +61 -0
  89. package/skills/builtin/editor/SKILL.md +44 -0
  90. package/skills/builtin/email-drafter/SKILL.md +42 -0
  91. package/skills/builtin/error-handling/SKILL.md +82 -0
  92. package/skills/builtin/eval-harness/SKILL.md +197 -0
  93. package/skills/builtin/evaluation-framework/SKILL.md +51 -0
  94. package/skills/builtin/exploit-writer/SKILL.md +63 -0
  95. package/skills/builtin/fact-checker/SKILL.md +51 -0
  96. package/skills/builtin/filesystem-context/SKILL.md +47 -0
  97. package/skills/builtin/financial-coach/SKILL.md +18 -0
  98. package/skills/builtin/finding-chain-correlator/SKILL.md +70 -0
  99. package/skills/builtin/finding-verifier/SKILL.md +65 -0
  100. package/skills/builtin/frontend-design/SKILL.md +104 -0
  101. package/skills/builtin/frontend-development/SKILL.md +227 -0
  102. package/skills/builtin/frontend-slides/SKILL.md +155 -0
  103. package/skills/builtin/fullstack-project/SKILL.md +286 -0
  104. package/skills/builtin/game-development/SKILL.md +60 -0
  105. package/skills/builtin/git-workflow/SKILL.md +44 -0
  106. package/skills/builtin/i18n-localization/SKILL.md +38 -0
  107. package/skills/builtin/image-prompt-engineering/SKILL.md +37 -0
  108. package/skills/builtin/investment-research/SKILL.md +33 -0
  109. package/skills/builtin/investor-materials/SKILL.md +90 -0
  110. package/skills/builtin/javascript-surface-analyzer/SKILL.md +66 -0
  111. package/skills/builtin/markdown-reports/SKILL.md +68 -0
  112. package/skills/builtin/market-research/SKILL.md +69 -0
  113. package/skills/builtin/mcp-builder/SKILL.md +86 -0
  114. package/skills/builtin/meeting-notes/SKILL.md +47 -0
  115. package/skills/builtin/memory-safety-analyst/SKILL.md +61 -0
  116. package/skills/builtin/meta-controller/SKILL.md +44 -0
  117. package/skills/builtin/mixture-of-agents/SKILL.md +53 -0
  118. package/skills/builtin/monitoring-observability/SKILL.md +169 -0
  119. package/skills/builtin/negotiation-simulator/SKILL.md +24 -0
  120. package/skills/builtin/nestjs-development/SKILL.md +56 -0
  121. package/skills/builtin/nextjs-development/SKILL.md +55 -0
  122. package/skills/builtin/parallel-dispatch/SKILL.md +83 -0
  123. package/skills/builtin/pdf-generation/SKILL.md +169 -0
  124. package/skills/builtin/personal-finance/SKILL.md +17 -0
  125. package/skills/builtin/pev-workflow/SKILL.md +62 -0
  126. package/skills/builtin/planning-with-files/SKILL.md +59 -0
  127. package/skills/builtin/pptx-generation/SKILL.md +117 -0
  128. package/skills/builtin/prisma-orm/SKILL.md +48 -0
  129. package/skills/builtin/rag-database-routing/SKILL.md +38 -0
  130. package/skills/builtin/rapid-prototyping/SKILL.md +152 -0
  131. package/skills/builtin/react-development/SKILL.md +244 -0
  132. package/skills/builtin/react-native-mobile/SKILL.md +113 -0
  133. package/skills/builtin/refactoring/SKILL.md +39 -0
  134. package/skills/builtin/reflexive-metacognition/SKILL.md +29 -0
  135. package/skills/builtin/riper-workflow/SKILL.md +214 -0
  136. package/skills/builtin/security-audit/SKILL.md +113 -0
  137. package/skills/builtin/security-self-audit/SKILL.md +311 -0
  138. package/skills/builtin/self-evolving-agent/SKILL.md +28 -0
  139. package/skills/builtin/self-improvement-loop/SKILL.md +58 -0
  140. package/skills/builtin/semantic-search/SKILL.md +93 -0
  141. package/skills/builtin/seo-audit-team/SKILL.md +27 -0
  142. package/skills/builtin/seo-optimization/SKILL.md +49 -0
  143. package/skills/builtin/server-management/SKILL.md +190 -0
  144. package/skills/builtin/social-media-content/SKILL.md +50 -0
  145. package/skills/builtin/sprint-planner/SKILL.md +49 -0
  146. package/skills/builtin/strategic-compact/SKILL.md +61 -0
  147. package/skills/builtin/strategy-advisor/SKILL.md +51 -0
  148. package/skills/builtin/structured-thinking/SKILL.md +70 -0
  149. package/skills/builtin/subagent-development/SKILL.md +105 -0
  150. package/skills/builtin/system-design/SKILL.md +66 -0
  151. package/skills/builtin/systematic-debugging/SKILL.md +87 -0
  152. package/skills/builtin/tailwind-css/SKILL.md +55 -0
  153. package/skills/builtin/taint-flow-tracer/SKILL.md +89 -0
  154. package/skills/builtin/teaching-agent-team/SKILL.md +32 -0
  155. package/skills/builtin/tech-debt-manager/SKILL.md +67 -0
  156. package/skills/builtin/technical-documentation/SKILL.md +47 -0
  157. package/skills/builtin/test-driven-development/SKILL.md +70 -0
  158. package/skills/builtin/theme-factory/SKILL.md +244 -0
  159. package/skills/builtin/threat-model-generator/SKILL.md +105 -0
  160. package/skills/builtin/trust-layer/SKILL.md +43 -0
  161. package/skills/builtin/typescript-patterns/SKILL.md +61 -0
  162. package/skills/builtin/ui-ux-design/SKILL.md +75 -0
  163. package/skills/builtin/verification-before-completion/SKILL.md +41 -0
  164. package/skills/builtin/verification-loop/SKILL.md +120 -0
  165. package/skills/builtin/waf-bypass-agent/SKILL.md +97 -0
  166. package/skills/builtin/web-artifacts-builder/SKILL.md +117 -0
  167. package/skills/builtin/web-assessment-executor/SKILL.md +66 -0
  168. package/skills/builtin/web-exploit-prover/SKILL.md +58 -0
  169. package/skills/builtin/web-scraping/SKILL.md +63 -0
  170. package/skills/builtin/webapp-testing/SKILL.md +86 -0
  171. package/skills/builtin/webhook-development/SKILL.md +62 -0
  172. package/skills/builtin/writing-skills/SKILL.md +67 -0
  173. package/skills/builtin/xlsx-generation/SKILL.md +116 -0
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Fleet Configuration Schema — Task B0.1
3
+ *
4
+ * TypeScript interfaces and Zod schemas for fleet (multi-workspace)
5
+ * configuration. Includes routing rules, budget limits, channel bindings,
6
+ * workspace configs, approval settings, and a loader that reads fleet.json,
7
+ * validates with Zod, and merges sensible defaults.
8
+ */
9
+ import { z } from "zod";
10
+ export declare function resolveEnvVar(value: string): string;
11
+ export declare const ApprovalConfigSchema: z.ZodObject<{
12
+ requireApproval: z.ZodDefault<z.ZodArray<z.ZodString>>;
13
+ autoApprove: z.ZodDefault<z.ZodArray<z.ZodString>>;
14
+ expirationDays: z.ZodDefault<z.ZodNumber>;
15
+ notifyOn: z.ZodDefault<z.ZodArray<z.ZodString>>;
16
+ notifyChannel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
17
+ }, z.core.$strip>;
18
+ export type ApprovalConfig = z.infer<typeof ApprovalConfigSchema>;
19
+ export declare const BudgetConfigSchema: z.ZodObject<{
20
+ dailyLimit: z.ZodDefault<z.ZodNumber>;
21
+ monthlyLimit: z.ZodDefault<z.ZodNumber>;
22
+ perWorkspaceDailyLimit: z.ZodDefault<z.ZodNumber>;
23
+ }, z.core.$strip>;
24
+ export type BudgetConfig = z.infer<typeof BudgetConfigSchema>;
25
+ export declare const FleetRouterConfigSchema: z.ZodObject<{
26
+ mentionPrefix: z.ZodDefault<z.ZodString>;
27
+ fallbackWorkspace: z.ZodDefault<z.ZodString>;
28
+ classificationModel: z.ZodDefault<z.ZodString>;
29
+ confidenceThreshold: z.ZodDefault<z.ZodNumber>;
30
+ }, z.core.$strip>;
31
+ export type FleetRouterConfig = z.infer<typeof FleetRouterConfigSchema>;
32
+ export declare const WorkspaceConfigSchema: z.ZodObject<{
33
+ id: z.ZodString;
34
+ name: z.ZodString;
35
+ identityDir: z.ZodDefault<z.ZodString>;
36
+ channels: z.ZodDefault<z.ZodArray<z.ZodString>>;
37
+ tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
38
+ layers: z.ZodDefault<z.ZodArray<z.ZodString>>;
39
+ approval: z.ZodOptional<z.ZodObject<{
40
+ requireApproval: z.ZodDefault<z.ZodArray<z.ZodString>>;
41
+ autoApprove: z.ZodDefault<z.ZodArray<z.ZodString>>;
42
+ expirationDays: z.ZodDefault<z.ZodNumber>;
43
+ notifyOn: z.ZodDefault<z.ZodArray<z.ZodString>>;
44
+ notifyChannel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
45
+ }, z.core.$strip>>;
46
+ budget: z.ZodOptional<z.ZodObject<{
47
+ dailyLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
48
+ monthlyLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
49
+ perWorkspaceDailyLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
50
+ }, z.core.$strip>>;
51
+ integrationGrants: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
52
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
53
+ }, z.core.$strip>;
54
+ export type WorkspaceConfig = z.infer<typeof WorkspaceConfigSchema>;
55
+ export declare const ChannelBindingSchema: z.ZodObject<{
56
+ channel: z.ZodString;
57
+ workspaceId: z.ZodString;
58
+ config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
59
+ }, z.core.$strip>;
60
+ export type ChannelBinding = z.infer<typeof ChannelBindingSchema>;
61
+ export declare const FleetConfigSchema: z.ZodObject<{
62
+ id: z.ZodDefault<z.ZodString>;
63
+ name: z.ZodDefault<z.ZodString>;
64
+ version: z.ZodDefault<z.ZodLiteral<1>>;
65
+ routing: z.ZodDefault<z.ZodObject<{
66
+ mentionPrefix: z.ZodDefault<z.ZodString>;
67
+ fallbackWorkspace: z.ZodDefault<z.ZodString>;
68
+ classificationModel: z.ZodDefault<z.ZodString>;
69
+ confidenceThreshold: z.ZodDefault<z.ZodNumber>;
70
+ }, z.core.$strip>>;
71
+ budget: z.ZodDefault<z.ZodObject<{
72
+ dailyLimit: z.ZodDefault<z.ZodNumber>;
73
+ monthlyLimit: z.ZodDefault<z.ZodNumber>;
74
+ perWorkspaceDailyLimit: z.ZodDefault<z.ZodNumber>;
75
+ }, z.core.$strip>>;
76
+ channelBindings: z.ZodDefault<z.ZodArray<z.ZodObject<{
77
+ channel: z.ZodString;
78
+ workspaceId: z.ZodString;
79
+ config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
80
+ }, z.core.$strip>>>;
81
+ workspaces: z.ZodDefault<z.ZodArray<z.ZodObject<{
82
+ id: z.ZodString;
83
+ name: z.ZodString;
84
+ identityDir: z.ZodDefault<z.ZodString>;
85
+ channels: z.ZodDefault<z.ZodArray<z.ZodString>>;
86
+ tools: z.ZodDefault<z.ZodArray<z.ZodString>>;
87
+ layers: z.ZodDefault<z.ZodArray<z.ZodString>>;
88
+ approval: z.ZodOptional<z.ZodObject<{
89
+ requireApproval: z.ZodDefault<z.ZodArray<z.ZodString>>;
90
+ autoApprove: z.ZodDefault<z.ZodArray<z.ZodString>>;
91
+ expirationDays: z.ZodDefault<z.ZodNumber>;
92
+ notifyOn: z.ZodDefault<z.ZodArray<z.ZodString>>;
93
+ notifyChannel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
94
+ }, z.core.$strip>>;
95
+ budget: z.ZodOptional<z.ZodObject<{
96
+ dailyLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
97
+ monthlyLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
98
+ perWorkspaceDailyLimit: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
99
+ }, z.core.$strip>>;
100
+ integrationGrants: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
101
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
102
+ }, z.core.$strip>>>;
103
+ approval: z.ZodDefault<z.ZodObject<{
104
+ requireApproval: z.ZodDefault<z.ZodArray<z.ZodString>>;
105
+ autoApprove: z.ZodDefault<z.ZodArray<z.ZodString>>;
106
+ expirationDays: z.ZodDefault<z.ZodNumber>;
107
+ notifyOn: z.ZodDefault<z.ZodArray<z.ZodString>>;
108
+ notifyChannel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
109
+ }, z.core.$strip>>;
110
+ }, z.core.$strip>;
111
+ export type FleetConfig = z.infer<typeof FleetConfigSchema>;
112
+ export declare const DEFAULT_FLEET_CONFIG: FleetConfig;
113
+ export interface LoadFleetConfigOptions {
114
+ /** If true, resolve ${ENV_VAR} placeholders in string values. */
115
+ resolveEnv?: boolean;
116
+ }
117
+ /**
118
+ * Parse and validate a fleet configuration object.
119
+ * Merges with sensible defaults, optionally resolves env vars.
120
+ */
121
+ export declare function loadFleetConfig(raw: unknown, options?: LoadFleetConfigOptions): FleetConfig;
122
+ /**
123
+ * Parse fleet config from a JSON string (e.g. read from fleet.json).
124
+ */
125
+ export declare function loadFleetConfigFromJSON(json: string, options?: LoadFleetConfigOptions): FleetConfig;
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Fleet Coordinator — Task B1.1
3
+ *
4
+ * Top-level orchestrator that composes the workspace manager, shared memory
5
+ * bridge, fleet router, and budget tracking into a single lifecycle manager.
6
+ */
7
+ import type { FleetConfig, WorkspaceConfig, BudgetConfig } from "./fleet-config.js";
8
+ import { type WorkspaceManager, type WorkspaceInstance, type IdentityAssemblerLike, type WorkspaceStorageLike } from "./workspace-manager.js";
9
+ import { type SharedMemoryBridge, type MemoryEngineLike, type EmbedFn } from "./shared-memory.js";
10
+ import { type RouteEnvelope, type RouteResult, type ClassificationProviderLike } from "./router.js";
11
+ export type FleetStatus = "created" | "starting" | "running" | "stopping" | "stopped";
12
+ export interface FleetStatusReport {
13
+ fleetId: string;
14
+ customerId: string;
15
+ status: FleetStatus;
16
+ workspaces: Array<{
17
+ id: string;
18
+ name: string;
19
+ status: WorkspaceInstance["status"];
20
+ }>;
21
+ budget: {
22
+ dailySpent: number;
23
+ monthlySpent: number;
24
+ dailyLimit: number;
25
+ monthlyLimit: number;
26
+ };
27
+ messageCount: number;
28
+ startedAt: Date | null;
29
+ }
30
+ export type FleetEventType = "fleet:started" | "fleet:stopped" | "workspace:started" | "workspace:stopped" | "workspace:error" | "message:routed";
31
+ export interface FleetEvent {
32
+ type: FleetEventType;
33
+ fleetId: string;
34
+ timestamp: number;
35
+ workspaceId?: string;
36
+ error?: string;
37
+ routeResult?: RouteResult;
38
+ }
39
+ export type FleetEventHandler = (event: FleetEvent) => void;
40
+ export interface FleetCoordinatorDeps {
41
+ /** Identity assembler (from kernel). */
42
+ identityAssembler?: IdentityAssemblerLike;
43
+ /** Storage adapter for workspace persistence. */
44
+ storage?: WorkspaceStorageLike;
45
+ /** Memory engine for shared memory bridge. */
46
+ memoryEngine?: MemoryEngineLike;
47
+ /** Embedding function for semantic memory search. */
48
+ embed?: EmbedFn;
49
+ /** LLM provider for intent classification routing. */
50
+ classificationProvider?: ClassificationProviderLike;
51
+ }
52
+ export interface FleetBudgetTracker {
53
+ recordCost(amount: number, workspaceId?: string): void;
54
+ getDailySpent(): number;
55
+ getMonthlySpent(): number;
56
+ getWorkspaceDailySpent(workspaceId: string): number;
57
+ isOverBudget(config: BudgetConfig): boolean;
58
+ reset(): void;
59
+ }
60
+ export declare function createFleetBudgetTracker(): FleetBudgetTracker;
61
+ export interface FleetCoordinator {
62
+ /** Start the fleet — create and start all configured workspaces. */
63
+ start(): Promise<void>;
64
+ /** Stop the fleet — drain and stop all running workspaces. */
65
+ stop(): Promise<void>;
66
+ /** Route an inbound message envelope to the appropriate workspace. */
67
+ route(envelope: RouteEnvelope): Promise<RouteResult>;
68
+ /** Get fleet status report with aggregated workspace statuses and costs. */
69
+ status(): FleetStatusReport;
70
+ /** Add and start a new workspace at runtime. */
71
+ addWorkspace(config: WorkspaceConfig): Promise<WorkspaceInstance>;
72
+ /** Stop and remove a workspace at runtime. */
73
+ removeWorkspace(workspaceId: string): Promise<void>;
74
+ /** Subscribe to fleet events. Returns unsubscribe function. */
75
+ on(handler: FleetEventHandler): () => void;
76
+ /** Access the underlying workspace manager. */
77
+ readonly workspaceManager: WorkspaceManager;
78
+ /** Access the shared memory bridge. */
79
+ readonly sharedMemory: SharedMemoryBridge | null;
80
+ /** Access the budget tracker. */
81
+ readonly budget: FleetBudgetTracker;
82
+ /** Current fleet status. */
83
+ readonly fleetStatus: FleetStatus;
84
+ }
85
+ export declare function createFleetCoordinator(customerId: string, config: FleetConfig, deps?: FleetCoordinatorDeps): FleetCoordinator;
@@ -0,0 +1,56 @@
1
+ export interface HandoffSummary {
2
+ taskId: string;
3
+ /** Bulleted actions taken */
4
+ completedSteps: string[];
5
+ /** What the agent was doing when handed off */
6
+ currentState: string;
7
+ /** What it couldn't resolve */
8
+ openQuestions: string[];
9
+ /** File paths, git branch, PR URL */
10
+ artifacts: string[];
11
+ /** What a human should do next */
12
+ suggestedNextActions: string[];
13
+ /** 10:1 compressed working context */
14
+ compressedContext: string;
15
+ }
16
+ export interface HandoffRequest {
17
+ taskId: string;
18
+ workspaceId: string;
19
+ /** Trigger source */
20
+ trigger: "api" | "agent" | "approval-queue";
21
+ /** Last N tool calls to summarize */
22
+ recentToolCalls?: ToolCallEntry[];
23
+ /** Modified files from the background task */
24
+ modifiedFiles?: string[];
25
+ /** Git branch the background task was working on */
26
+ gitBranch?: string;
27
+ }
28
+ export interface ToolCallEntry {
29
+ tool: string;
30
+ input: string;
31
+ output: string;
32
+ timestamp: number;
33
+ }
34
+ export interface HandoffTarget {
35
+ /** New foreground session ID */
36
+ sessionId: string;
37
+ /** Workspace ID for the foreground session */
38
+ workspaceId: string;
39
+ }
40
+ export type CompressionLLMFn = (prompt: string) => Promise<string>;
41
+ export type ArtifactStoreFn = (key: string, content: string) => Promise<void>;
42
+ export type HandoffEventEmitter = (event: string, payload: Record<string, unknown>) => void;
43
+ /**
44
+ * Generate a handoff summary from a background task's tool call history.
45
+ * Compresses the last 50 tool calls into a 10:1 summary.
46
+ */
47
+ export declare function generateHandoffSummary(request: HandoffRequest, compress: CompressionLLMFn, emit?: HandoffEventEmitter): Promise<HandoffSummary>;
48
+ /**
49
+ * Format the handoff summary for injection as the first message
50
+ * in a new interactive foreground session.
51
+ */
52
+ export declare function formatHandoffMessage(summary: HandoffSummary): string;
53
+ /**
54
+ * Store handoff summary as a brain artifact for later retrieval.
55
+ */
56
+ export declare function persistHandoff(summary: HandoffSummary, storeArtifact: ArtifactStoreFn): Promise<void>;
@@ -0,0 +1,57 @@
1
+ export interface Hat {
2
+ id: string;
3
+ name: string;
4
+ description: string;
5
+ triggers: string[];
6
+ identityOverride: Partial<IdentityOverride>;
7
+ toolRestrictions: string[];
8
+ systemPromptAddendum: string;
9
+ preferredProviderSlot: string;
10
+ }
11
+ export interface IdentityOverride {
12
+ name: string;
13
+ tone: string;
14
+ role: string;
15
+ traits: string[];
16
+ }
17
+ export interface HatSelectionResult {
18
+ hat: Hat;
19
+ score: number;
20
+ matchedTriggers: string[];
21
+ }
22
+ export interface HatCollectionConfig {
23
+ customHatsDir?: string;
24
+ defaultHatId?: string;
25
+ selectionThreshold?: number;
26
+ }
27
+ export interface QueryClassification {
28
+ intent: string;
29
+ confidence: number;
30
+ entities?: string[];
31
+ }
32
+ export type HatEventEmitter = (event: string, payload: Record<string, unknown>) => void;
33
+ export type YamlLoader = (path: string) => Promise<Hat | null>;
34
+ export declare const BUILTIN_HATS: Hat[];
35
+ export declare class HatSystem {
36
+ private hats;
37
+ private config;
38
+ private emit;
39
+ constructor(config?: HatCollectionConfig, opts?: {
40
+ emit?: HatEventEmitter;
41
+ });
42
+ /**
43
+ * Load custom hats from workspace directory and merge with built-ins.
44
+ */
45
+ loadCustomHats(loader: YamlLoader): Promise<number>;
46
+ /**
47
+ * Select the best hat for a given task based on classification.
48
+ */
49
+ select(taskText: string, classification?: QueryClassification): HatSelectionResult;
50
+ /** Get a specific hat by ID. */
51
+ getHat(id: string): Hat | undefined;
52
+ /** Register a hat at runtime. */
53
+ registerHat(hat: Hat): void;
54
+ /** List all available hats. */
55
+ listHats(): Hat[];
56
+ private scoreHat;
57
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Business module — Fleet orchestration for Fenix Pro edition.
3
+ * Re-exports all public types and functions from the business package.
4
+ */
5
+ export { resolveEnvVar, loadFleetConfig, loadFleetConfigFromJSON, FleetConfigSchema, FleetRouterConfigSchema, BudgetConfigSchema, ApprovalConfigSchema, WorkspaceConfigSchema, ChannelBindingSchema, DEFAULT_FLEET_CONFIG, } from "./fleet-config.js";
6
+ export type { FleetConfig, FleetRouterConfig, BudgetConfig, ApprovalConfig, WorkspaceConfig, ChannelBinding, LoadFleetConfigOptions, } from "./fleet-config.js";
7
+ export { createWorkspaceManager, createInMemorySTM, } from "./workspace-manager.js";
8
+ export type { WorkspaceStatus, WorkspaceInstance, WorkspaceManager, WorkspaceManagerConfig, WorkspaceManagerEvents, IdentityAssemblerLike, STMLike, WorkspaceStorageLike, } from "./workspace-manager.js";
9
+ export { createSharedMemoryBridge, } from "./shared-memory.js";
10
+ export type { SharedMemoryFact, SharedMemorySearchResult, SharedMemoryBridge, SharedMemoryBridgeConfig, MemoryEngineLike, EmbedFn, } from "./shared-memory.js";
11
+ export { createFleetRouter, extractMention, matchChannelBinding, } from "./router.js";
12
+ export type { FleetRouter, RouteEnvelope, RouteResult, ClassificationProviderLike, WorkspaceSummary, MentionResult, } from "./router.js";
13
+ export { createFleetCoordinator, createFleetBudgetTracker, } from "./fleet.js";
14
+ export type { FleetCoordinator, FleetCoordinatorDeps, FleetStatus, FleetStatusReport, FleetEvent, FleetEventType, FleetEventHandler, FleetBudgetTracker, } from "./fleet.js";
15
+ export { BUILTIN_TEMPLATES, listTemplates, getTemplate, applyTemplate, } from "./templates.js";
16
+ export type { WorkspaceTemplate, TemplateCustomizations, } from "./templates.js";
17
+ export { ApprovalQueue, checkAutoApproval, } from "./approval-queue.js";
18
+ export type { ApprovalItem, ApprovalStatus, ApprovalListFilters, StorageAdapter, ToolExecutor, NotificationDispatcher, ApprovalQueueConfig, } from "./approval-queue.js";
19
+ export { IntegrationRegistry, KNOWN_INTEGRATIONS, createInMemoryIntegrationStorage, } from "./integration-registry.js";
20
+ export type { IntegrationProtocol, AuthMethod, IntegrationDefinition, IntegrationConnectionStatus, IntegrationConnection, WorkspaceIntegrationGrant, IntegrationStorageLike, SecretStoreLike, } from "./integration-registry.js";
21
+ export { FleetBudget, } from "./fleet-budget.js";
22
+ export type { FleetBudgetConfig, CostEntry, CostTrackerLike, BudgetExceededType, BudgetExceededInfo, BudgetExceededHandler, WorkspaceCostBreakdown, } from "./fleet-budget.js";
23
+ export { runPlannerCycle, assignTaskToWorker, executeWorkerTask, claimNextTask, createEscalation, evaluateCycle, shouldContinue, DEFAULT_JUDGE_CONFIG, } from "./roles/index.js";
24
+ export type { AgentRole, RoleConfig, RoleTask, EscalationRequest, CycleEvaluation, RoleEventEmitter, PlannerContext, PlannerDecision, LLMPlanFn, WorkerContext, TaskExecutorFn, WorkerResult, JudgeContext, JudgeConfig, LLMJudgeFn, } from "./roles/index.js";
25
+ export { OracleHandler, OracleBudgetExceededError, DEFAULT_ORACLE_CONFIG } from "./oracle.js";
26
+ export type { OracleConfig, OracleConsultation, OracleResponse, OracleLLMCallFn, CostRecorderFn, OracleEventEmitter, } from "./oracle.js";
27
+ export { BestOfNEngine, BudgetExceededError as BestOfNBudgetError, DEFAULT_BEST_OF_N } from "./best-of-n.js";
28
+ export type { BestOfNConfig, CandidateResult, JudgeScore, BestOfNResult, SubTask, CandidateExecutorFn, JudgeFn as BestOfNJudgeFn, InvestigatorFn, BudgetCheckFn, BestOfNEventEmitter, } from "./best-of-n.js";
29
+ export { runDebate, DEFAULT_DEBATE_CONFIG } from "./debate.js";
30
+ export type { DebateConfig, DebateRound, DebateResult, DebateLLMCallFn, DebateEventEmitter, } from "./debate.js";
31
+ export { runBrainstorm, DEFAULT_BRAINSTORM_CONFIG } from "./brainstorm.js";
32
+ export type { BrainstormConfig, BrainstormIdea, ThemeCluster, BrainstormResult, ScoredIdea, BrainstormLLMCallFn, BrainstormEventEmitter, } from "./brainstorm.js";
33
+ export { runCompileCheck, formatErrorSummary, parseCompileErrors, DEFAULT_COMPILE_TIMEOUT, } from "./compile-checker.js";
34
+ export type { CompileCheckJob, CompileError, CompileCheckResult, PackageCompileResult, CompileEventEmitter, ArtifactStoreFn as CompileArtifactStoreFn, } from "./compile-checker.js";
35
+ export { generateHandoffSummary, formatHandoffMessage, persistHandoff, } from "./handoff.js";
36
+ export type { HandoffSummary, HandoffRequest, ToolCallEntry, HandoffTarget, CompressionLLMFn, HandoffEventEmitter, } from "./handoff.js";
37
+ export { ArenaEngine, formatArenaForApproval, DEFAULT_ARENA_CONFIG } from "./arena.js";
38
+ export type { ArenaConfig, ArenaContestant, ArenaScore, ArenaDiff, ArenaResult, ContestantExecutorFn, ArenaJudgeFn, DiffGeneratorFn, ArenaEventEmitter, } from "./arena.js";
39
+ export { executePipeline, validateDAG, getExecutionOrder, } from "./node-pipeline.js";
40
+ export type { PipelineNode, NodeInput, NodeResult, Transformer, NodeStatus, PipelineConfig, NodeExecutor, PipelineExecution, PipelineEventType, PipelineEvent, PipelineEventHandler, } from "./node-pipeline.js";
41
+ export { SwarmRegistry, CircularSwarmDependencyError, } from "./swarm-registry.js";
42
+ export type { SwarmRegistration, SwarmRegistryEntry, SwarmFileConfig, SwarmRegistryEventType, SwarmRegistryEvent, SwarmRegistryEventHandler, } from "./swarm-registry.js";
43
+ export { StatusDetector } from "./status-detector.js";
44
+ export type { AgentExecutionStatus, StatusSignal, AgentStatusRecord, StatusEventType, StatusChangeEvent, StatusChangeHandler, StatusDetectorConfig, } from "./status-detector.js";
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Integration Registry — Task B2.3
3
+ *
4
+ * Manages external service integrations (MCP servers, APIs) for fleets.
5
+ * Stores credentials via the kernel's SecretStore and tracks which
6
+ * workspaces have access to which integrations.
7
+ */
8
+ export type IntegrationProtocol = "MCP" | "builtin";
9
+ export type AuthMethod = "oauth2" | "api_key";
10
+ export interface IntegrationDefinition {
11
+ id: string;
12
+ name: string;
13
+ protocol: IntegrationProtocol;
14
+ authMethod: AuthMethod;
15
+ capabilities: string[];
16
+ }
17
+ export type IntegrationConnectionStatus = "connected" | "disconnected" | "error";
18
+ export interface IntegrationConnection {
19
+ fleetId: string;
20
+ integrationId: string;
21
+ status: IntegrationConnectionStatus;
22
+ connectedAt: Date | null;
23
+ error?: string;
24
+ }
25
+ export interface WorkspaceIntegrationGrant {
26
+ workspaceId: string;
27
+ integrationId: string;
28
+ grantedAt: Date;
29
+ }
30
+ export interface IntegrationStorageLike {
31
+ getConnection(fleetId: string, integrationId: string): IntegrationConnection | undefined;
32
+ saveConnection(connection: IntegrationConnection): void;
33
+ deleteConnection(fleetId: string, integrationId: string): boolean;
34
+ listConnections(fleetId: string): IntegrationConnection[];
35
+ getWorkspaceGrant(workspaceId: string, integrationId: string): WorkspaceIntegrationGrant | undefined;
36
+ saveWorkspaceGrant(grant: WorkspaceIntegrationGrant): void;
37
+ deleteWorkspaceGrant(workspaceId: string, integrationId: string): boolean;
38
+ listWorkspaceGrants(workspaceId: string): WorkspaceIntegrationGrant[];
39
+ }
40
+ export interface SecretStoreLike {
41
+ store(userId: string, provider: string, key: string): Promise<void>;
42
+ retrieve(userId: string, provider: string): Promise<string | null>;
43
+ delete(userId: string, provider: string): boolean;
44
+ has(userId: string, provider: string): boolean;
45
+ }
46
+ export declare const KNOWN_INTEGRATIONS: readonly IntegrationDefinition[];
47
+ export declare function createInMemoryIntegrationStorage(): IntegrationStorageLike;
48
+ export declare class IntegrationRegistry {
49
+ private readonly storage;
50
+ private readonly secretStore;
51
+ constructor(storage: IntegrationStorageLike, secretStore: SecretStoreLike);
52
+ /** Returns all known/supported integrations. */
53
+ listAvailable(): readonly IntegrationDefinition[];
54
+ /** Connect a fleet to an integration, storing credentials securely. */
55
+ connect(fleetId: string, integrationId: string, credentials: string): Promise<IntegrationConnection>;
56
+ /** Disconnect a fleet from an integration, removing stored credentials. */
57
+ disconnect(fleetId: string, integrationId: string): void;
58
+ /** Get the current connection status for a fleet + integration pair. */
59
+ getStatus(fleetId: string, integrationId: string): IntegrationConnection;
60
+ /** Grant a workspace access to an integration. */
61
+ grantAccess(workspaceId: string, integrationId: string): void;
62
+ /** Revoke a workspace's access to an integration. */
63
+ revokeAccess(workspaceId: string, integrationId: string): void;
64
+ /** Get all integrations accessible to a workspace. */
65
+ getWorkspaceIntegrations(workspaceId: string): WorkspaceIntegrationGrant[];
66
+ }
@@ -0,0 +1,62 @@
1
+ import type { FinishReason } from "@fenixforce/kernel";
2
+ export interface NodeInput {
3
+ prompt: string;
4
+ context?: Record<string, unknown>;
5
+ previous: Record<string, NodeResult>;
6
+ }
7
+ export interface NodeResult {
8
+ nodeId: string;
9
+ output: string;
10
+ metadata: Record<string, unknown>;
11
+ finishReason: FinishReason;
12
+ durationMs: number;
13
+ }
14
+ export type Transformer = (input: NodeInput) => NodeInput | Promise<NodeInput>;
15
+ export interface PipelineNode {
16
+ id: string;
17
+ /** Which agent (or worker hat) handles this stage. */
18
+ agent?: string;
19
+ /** Upstream node IDs (DAG edges). */
20
+ dependsOn: string[];
21
+ /** Reshape upstream output before injection. */
22
+ inputTransformer?: Transformer;
23
+ /** Reshape this node's output before passing downstream. */
24
+ outputTransformer?: Transformer;
25
+ /** Skip node if condition met. */
26
+ skipCondition?: (input: NodeInput) => boolean;
27
+ }
28
+ export type NodeStatus = "pending" | "running" | "completed" | "skipped" | "failed";
29
+ export interface PipelineConfig {
30
+ id: string;
31
+ nodes: PipelineNode[];
32
+ /** Max concurrent nodes. Default 3. */
33
+ concurrentNodes?: number;
34
+ }
35
+ export type NodeExecutor = (nodeId: string, agent: string | undefined, input: NodeInput) => Promise<{
36
+ output: string;
37
+ metadata?: Record<string, unknown>;
38
+ finishReason?: FinishReason;
39
+ }>;
40
+ export interface PipelineExecution {
41
+ pipelineId: string;
42
+ status: "running" | "completed" | "failed";
43
+ results: Record<string, NodeResult>;
44
+ nodeStatuses: Record<string, NodeStatus>;
45
+ startedAt: number;
46
+ completedAt?: number;
47
+ error?: string;
48
+ }
49
+ export type PipelineEventType = "pipeline:start" | "pipeline:complete" | "pipeline:error" | "node:start" | "node:complete" | "node:skip" | "node:error";
50
+ export interface PipelineEvent {
51
+ type: PipelineEventType;
52
+ pipelineId: string;
53
+ nodeId?: string;
54
+ timestamp: number;
55
+ detail?: string;
56
+ }
57
+ export type PipelineEventHandler = (event: PipelineEvent) => void;
58
+ export declare function executePipeline(config: PipelineConfig, executor: NodeExecutor, eventHandler?: PipelineEventHandler): Promise<PipelineExecution>;
59
+ /** Validate DAG has no cycles (throws if cycle found). */
60
+ export declare function validateDAG(nodes: PipelineNode[]): void;
61
+ /** Get execution order as flat array of node IDs. */
62
+ export declare function getExecutionOrder(nodes: PipelineNode[]): string[];
@@ -0,0 +1,64 @@
1
+ export interface OracleConfig {
2
+ /** Named slot in provider config — maps to high-capability model */
3
+ slot: "oracle";
4
+ /** Cap on context tokens sent to oracle */
5
+ maxTokensIn: number;
6
+ /** Cap on oracle response tokens */
7
+ maxTokensOut: number;
8
+ /** Max oracle calls per session */
9
+ invocationBudget: number;
10
+ }
11
+ export declare const DEFAULT_ORACLE_CONFIG: OracleConfig;
12
+ export interface OracleConsultation {
13
+ /** Text description of the stuck problem */
14
+ problem: string;
15
+ /** Relevant context excerpt (capped at maxTokensIn) */
16
+ contextExcerpt: string;
17
+ /** Specific question for the oracle */
18
+ question: string;
19
+ /** Worker workspace ID */
20
+ workerId: string;
21
+ /** Session ID for budget tracking */
22
+ sessionId: string;
23
+ }
24
+ export interface OracleResponse {
25
+ guidance: string;
26
+ tokensCost: number;
27
+ consultationId: string;
28
+ }
29
+ export type OracleLLMCallFn = (prompt: string, maxTokens: number) => Promise<{
30
+ text: string;
31
+ tokensUsed: number;
32
+ }>;
33
+ export type CostRecorderFn = (amount: number, category: string, sessionId: string) => void;
34
+ export type OracleEventEmitter = (event: string, payload: Record<string, unknown>) => void;
35
+ export declare class OracleHandler {
36
+ private config;
37
+ private llmCall;
38
+ private recordCost;
39
+ private emit;
40
+ private sessionInvocations;
41
+ constructor(config: Partial<OracleConfig> | undefined, llmCall: OracleLLMCallFn, opts?: {
42
+ recordCost?: CostRecorderFn;
43
+ emit?: OracleEventEmitter;
44
+ });
45
+ /**
46
+ * Consult the oracle with a focused problem excerpt.
47
+ * Returns strategic guidance injected as "## Oracle Guidance".
48
+ */
49
+ consult(req: OracleConsultation): Promise<OracleResponse>;
50
+ /**
51
+ * Format oracle response for injection into worker's next turn.
52
+ */
53
+ formatGuidanceBlock(response: OracleResponse): string;
54
+ /** Get remaining oracle budget for a session. */
55
+ getRemainingBudget(sessionId: string): number;
56
+ /** Reset session invocation counter. */
57
+ resetSession(sessionId: string): void;
58
+ }
59
+ export declare class OracleBudgetExceededError extends Error {
60
+ sessionId: string;
61
+ used: number;
62
+ budget: number;
63
+ constructor(sessionId: string, used: number, budget: number);
64
+ }
@@ -0,0 +1,7 @@
1
+ export type { AgentRole, RoleConfig, RoleTask, EscalationRequest, CycleEvaluation, RoleEventEmitter, } from "./types.js";
2
+ export { runPlannerCycle, assignTaskToWorker } from "./planner.js";
3
+ export type { PlannerContext, PlannerDecision, LLMPlanFn } from "./planner.js";
4
+ export { executeWorkerTask, claimNextTask, createEscalation } from "./worker.js";
5
+ export type { WorkerContext, TaskExecutorFn, WorkerResult } from "./worker.js";
6
+ export { evaluateCycle, shouldContinue, DEFAULT_JUDGE_CONFIG } from "./judge.js";
7
+ export type { JudgeContext, JudgeConfig, LLMJudgeFn } from "./judge.js";
@@ -0,0 +1,24 @@
1
+ import type { RoleConfig, RoleTask, CycleEvaluation, RoleEventEmitter } from "./types.js";
2
+ export interface JudgeContext {
3
+ workspaceId: string;
4
+ roleConfig: RoleConfig;
5
+ tasks: RoleTask[];
6
+ }
7
+ export interface JudgeConfig {
8
+ /** Minimum goal achievement rate to consider cycle complete (0-1) */
9
+ completionThreshold: number;
10
+ /** Maximum acceptable worker error rate (0-1) */
11
+ maxErrorRate: number;
12
+ /** Whether to route cycle:escalate through approval queue */
13
+ requireHumanApproval: boolean;
14
+ }
15
+ export declare const DEFAULT_JUDGE_CONFIG: JudgeConfig;
16
+ export type LLMJudgeFn = (prompt: string) => Promise<string>;
17
+ /**
18
+ * Evaluate a planning cycle and return a verdict.
19
+ */
20
+ export declare function evaluateCycle(ctx: JudgeContext, config?: JudgeConfig, llmJudge?: LLMJudgeFn, emit?: RoleEventEmitter): Promise<CycleEvaluation>;
21
+ /**
22
+ * Quick check: should the cycle continue based on task states?
23
+ */
24
+ export declare function shouldContinue(tasks: RoleTask[]): boolean;
@@ -0,0 +1,30 @@
1
+ import type { RoleConfig, RoleTask, RoleEventEmitter } from "./types.js";
2
+ export interface PlannerContext {
3
+ workspaceId: string;
4
+ roleConfig: RoleConfig;
5
+ /** Available worker workspace IDs */
6
+ workerIds: string[];
7
+ /** Current task backlog */
8
+ taskQueue: RoleTask[];
9
+ }
10
+ export interface PlannerDecision {
11
+ newTasks: Array<{
12
+ title: string;
13
+ description: string;
14
+ scope: string;
15
+ assignToWorkerId?: string;
16
+ }>;
17
+ spawnSubPlanner?: {
18
+ domain: string;
19
+ scope: string;
20
+ };
21
+ }
22
+ export type LLMPlanFn = (prompt: string) => Promise<string>;
23
+ /**
24
+ * Run a single planner cycle: analyze workspace context and produce tasks.
25
+ */
26
+ export declare function runPlannerCycle(ctx: PlannerContext, llmPlan: LLMPlanFn, emit?: RoleEventEmitter): Promise<RoleTask[]>;
27
+ /**
28
+ * Assign a pending task to a specific worker.
29
+ */
30
+ export declare function assignTaskToWorker(task: RoleTask, workerId: string, emit?: RoleEventEmitter): RoleTask;
@@ -0,0 +1,37 @@
1
+ export type AgentRole = "planner" | "worker" | "judge";
2
+ export interface RoleConfig {
3
+ role: AgentRole;
4
+ /** For sub-planners — parent planner's workspace ID */
5
+ parentPlannerWorkspaceId?: string;
6
+ /** For workers — restricts to a single task focus */
7
+ taskScope?: string;
8
+ /** For judges — evaluation criteria strings */
9
+ evaluationCriteria?: string[];
10
+ }
11
+ export interface RoleTask {
12
+ id: string;
13
+ workspaceId: string;
14
+ title: string;
15
+ description: string;
16
+ scope: string;
17
+ status: "pending" | "assigned" | "running" | "completed" | "failed" | "escalated";
18
+ assignedWorkerIds: string[];
19
+ result?: unknown;
20
+ error?: string;
21
+ createdAt: Date;
22
+ completedAt?: Date;
23
+ }
24
+ export interface EscalationRequest {
25
+ taskId: string;
26
+ workerId: string;
27
+ reason: string;
28
+ context: string;
29
+ }
30
+ export interface CycleEvaluation {
31
+ verdict: "cycle:continue" | "cycle:complete" | "cycle:escalate";
32
+ goalAchievementRate: number;
33
+ openTaskCount: number;
34
+ workerErrorRate: number;
35
+ notes: string;
36
+ }
37
+ export type RoleEventEmitter = (event: string, payload: Record<string, unknown>) => void;