empirical-sdd 0.20.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.
package/dist/core.d.ts ADDED
@@ -0,0 +1,54 @@
1
+ import { ProjectStore } from "./storage.js";
2
+ import { type ActionPacket, type AdoptionOptions, type ArchiveResult, type CapabilitySummary, type CompletionInput, type Criterion, type ExplainReport, type ExplorationPacket, type FeatureStartResult, type FeatureStartOptions, type InitOptions, type IntegrationReport, type ProjectConfig, type ProjectPolicy, type ProjectConfigurationInput, type StartOptions, type ValidationReport, type Workflow, type WorkflowState, type WorktreeCreateInput, type WorktreeHandoff, type WorktreeProposal } from "./types.js";
3
+ export declare class EmpiricalProject {
4
+ store: ProjectStore;
5
+ private readonly readOnly;
6
+ private constructor();
7
+ static open(start?: string, options?: {
8
+ migrate?: boolean;
9
+ }): Promise<EmpiricalProject>;
10
+ static openReadOnly(start?: string): Promise<EmpiricalProject>;
11
+ static initialize(root?: string, options?: InitOptions): Promise<{
12
+ project: EmpiricalProject;
13
+ state: WorkflowState;
14
+ integrations: IntegrationReport;
15
+ }>;
16
+ static adopt(root?: string, options?: AdoptionOptions): Promise<{
17
+ project: EmpiricalProject;
18
+ state: WorkflowState;
19
+ integrations: IntegrationReport;
20
+ }>;
21
+ status(): Promise<WorkflowState>;
22
+ config(): Promise<ProjectConfig>;
23
+ configure(input: ProjectConfigurationInput): Promise<ProjectConfig>;
24
+ policy(): Promise<ProjectPolicy>;
25
+ explore(problem: string): Promise<ExplorationPacket>;
26
+ capabilities(): Promise<CapabilitySummary[]>;
27
+ capability(name: string): Promise<string | null>;
28
+ start(request: string, options?: StartOptions): Promise<FeatureStartResult>;
29
+ fast(request: string, options?: FeatureStartOptions): Promise<FeatureStartResult>;
30
+ complex(request: string, options?: FeatureStartOptions): Promise<FeatureStartResult>;
31
+ loop(): Promise<ActionPacket>;
32
+ private begin;
33
+ proposeWorktree(request: string, workflow: Workflow, overrides?: {
34
+ changeType?: "feature" | "fix" | "chore";
35
+ feature?: string;
36
+ branch?: string;
37
+ path?: string;
38
+ base?: string;
39
+ }): Promise<WorktreeProposal>;
40
+ createWorktree(input: WorktreeCreateInput): Promise<WorktreeHandoff>;
41
+ explain(): Promise<ExplainReport>;
42
+ next(): Promise<ActionPacket>;
43
+ complete(input: CompletionInput): Promise<ActionPacket>;
44
+ archive(expectedRevision: number, actor?: string): Promise<ArchiveResult>;
45
+ retry(expectedRevision: number, actor?: string): Promise<ActionPacket>;
46
+ verify(): Promise<ValidationReport>;
47
+ integrations(): Promise<IntegrationReport>;
48
+ migrate(): Promise<Record<string, unknown>>;
49
+ doctor(): Promise<Record<string, unknown>>;
50
+ private validatePhasePass;
51
+ private assertCapabilityDeltasUnchanged;
52
+ private packet;
53
+ }
54
+ export declare function parseCriteria(markdown: string): Criterion[];
@@ -0,0 +1,7 @@
1
+ import { type ProjectStore } from "./storage.js";
2
+ import type { DecisionSummary, DecisionValidationReport } from "./types.js";
3
+ export declare function decisionPath(store: ProjectStore, feature: string): string;
4
+ export declare function createDecisionTemplate(store: ProjectStore, feature: string): Promise<void>;
5
+ export declare function validateDecisions(store: ProjectStore, feature: string, requireAccepted?: boolean): Promise<DecisionValidationReport>;
6
+ export declare function parseDecisions(markdown: string, requireAccepted?: boolean): DecisionValidationReport;
7
+ export declare function requireValidDecisions(store: ProjectStore, feature: string): Promise<DecisionSummary[]>;
@@ -0,0 +1,47 @@
1
+ export declare const DISCOVERY_SCHEMA_VERSION: 1;
2
+ export type DiscoveryPassId = "problem" | "outcome" | "boundaries" | "risks" | "verification";
3
+ export type DiscoveryStatus = "draft" | "approved" | "started";
4
+ export type DiscoveryWorkflow = "fast" | "complex";
5
+ export interface SocraticQuestion {
6
+ pass: DiscoveryPassId;
7
+ title: string;
8
+ question: string;
9
+ }
10
+ export interface SocraticAnswer {
11
+ pass: DiscoveryPassId;
12
+ title: string;
13
+ question: string;
14
+ answer: string;
15
+ followUp: {
16
+ question: string;
17
+ answer: string;
18
+ } | null;
19
+ }
20
+ export interface DiscoveryRecord {
21
+ schemaVersion: typeof DISCOVERY_SCHEMA_VERSION;
22
+ id: string;
23
+ problem: string;
24
+ status: DiscoveryStatus;
25
+ answers: SocraticAnswer[];
26
+ refinedRequest: string | null;
27
+ approvedAt: string | null;
28
+ workflow: DiscoveryWorkflow | null;
29
+ handoff: {
30
+ feature: string;
31
+ revision: number;
32
+ } | null;
33
+ createdAt: string;
34
+ updatedAt: string;
35
+ }
36
+ export interface DiscoveryPaths {
37
+ directory: string;
38
+ json: string;
39
+ markdown: string;
40
+ }
41
+ export declare function createDiscoveryRecord(problem: string, now?: Date): DiscoveryRecord;
42
+ export declare function socraticQuestions(problem: string, priorContext?: string): SocraticQuestion[];
43
+ export declare function materialFollowUp(problem: string, question: SocraticQuestion, answer: string): string | null;
44
+ export declare function buildRefinedRequest(problem: string, answers: SocraticAnswer[]): string;
45
+ export declare function recommendWorkflow(problem: string, answers: SocraticAnswer[]): DiscoveryWorkflow;
46
+ export declare function saveDiscovery(root: string, record: DiscoveryRecord): Promise<DiscoveryPaths>;
47
+ export declare function renderDiscoveryMarkdown(record: DiscoveryRecord): string;
@@ -0,0 +1,6 @@
1
+ export declare class EmpiricalError extends Error {
2
+ readonly code: string;
3
+ readonly details?: unknown;
4
+ constructor(code: string, message: string, details?: unknown);
5
+ }
6
+ export declare function asErrorMessage(error: unknown): string;
@@ -0,0 +1,6 @@
1
+ export { EmpiricalProject, parseCriteria } from "./core.js";
2
+ export { EmpiricalError } from "./errors.js";
3
+ export { installGlobalAgentSkills, installProjectIntegrations } from "./integrations.js";
4
+ export { ProjectStore, discoverProject } from "./storage.js";
5
+ export { capabilityDeltaDigest, listCapabilities, loadCapabilityDeltas, parseCapabilityDelta, planCapabilityArchive, validateFeatureDeltas, } from "./specifications.js";
6
+ export * from "./types.js";