@llm-dev-ops/agentics-cli 2.1.4 → 2.3.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/pipeline/auto-chain.d.ts +73 -0
- package/dist/pipeline/auto-chain.d.ts.map +1 -1
- package/dist/pipeline/auto-chain.js +525 -38
- package/dist/pipeline/auto-chain.js.map +1 -1
- package/dist/pipeline/phase2/phases/prompt-generator.d.ts.map +1 -1
- package/dist/pipeline/phase2/phases/prompt-generator.js +53 -6
- package/dist/pipeline/phase2/phases/prompt-generator.js.map +1 -1
- package/dist/pipeline/phase2/schemas.d.ts +10 -10
- package/dist/pipeline/phase4/phases/http-server-generator.d.ts +12 -0
- package/dist/pipeline/phase4/phases/http-server-generator.d.ts.map +1 -1
- package/dist/pipeline/phase4/phases/http-server-generator.js +92 -25
- package/dist/pipeline/phase4/phases/http-server-generator.js.map +1 -1
- package/dist/pipeline/phase5-build/phase5-build-coordinator.d.ts.map +1 -1
- package/dist/pipeline/phase5-build/phase5-build-coordinator.js +44 -0
- package/dist/pipeline/phase5-build/phase5-build-coordinator.js.map +1 -1
- package/dist/pipeline/phase5-build/phases/post-generation-validator.d.ts +75 -0
- package/dist/pipeline/phase5-build/phases/post-generation-validator.d.ts.map +1 -0
- package/dist/pipeline/phase5-build/phases/post-generation-validator.js +728 -0
- package/dist/pipeline/phase5-build/phases/post-generation-validator.js.map +1 -0
- package/dist/pipeline/phase5-build/types.d.ts +1 -1
- package/dist/pipeline/phase5-build/types.d.ts.map +1 -1
- package/dist/pipeline/types.d.ts +84 -0
- package/dist/pipeline/types.d.ts.map +1 -1
- package/dist/pipeline/types.js +43 -1
- package/dist/pipeline/types.js.map +1 -1
- package/dist/synthesis/consensus-svg.d.ts +19 -0
- package/dist/synthesis/consensus-svg.d.ts.map +1 -0
- package/dist/synthesis/consensus-svg.js +95 -0
- package/dist/synthesis/consensus-svg.js.map +1 -0
- package/dist/synthesis/consensus-tiers.d.ts +99 -0
- package/dist/synthesis/consensus-tiers.d.ts.map +1 -0
- package/dist/synthesis/consensus-tiers.js +285 -0
- package/dist/synthesis/consensus-tiers.js.map +1 -0
- package/dist/synthesis/domain-labor-classifier.d.ts +101 -0
- package/dist/synthesis/domain-labor-classifier.d.ts.map +1 -0
- package/dist/synthesis/domain-labor-classifier.js +312 -0
- package/dist/synthesis/domain-labor-classifier.js.map +1 -0
- package/dist/synthesis/domain-unit-registry.d.ts +59 -0
- package/dist/synthesis/domain-unit-registry.d.ts.map +1 -0
- package/dist/synthesis/domain-unit-registry.js +294 -0
- package/dist/synthesis/domain-unit-registry.js.map +1 -0
- package/dist/synthesis/financial-claim-extractor.d.ts +52 -0
- package/dist/synthesis/financial-claim-extractor.d.ts.map +1 -0
- package/dist/synthesis/financial-claim-extractor.js +351 -0
- package/dist/synthesis/financial-claim-extractor.js.map +1 -0
- package/dist/synthesis/financial-consistency-rules.d.ts +66 -0
- package/dist/synthesis/financial-consistency-rules.d.ts.map +1 -0
- package/dist/synthesis/financial-consistency-rules.js +432 -0
- package/dist/synthesis/financial-consistency-rules.js.map +1 -0
- package/dist/synthesis/financial-consistency-runner.d.ts +73 -0
- package/dist/synthesis/financial-consistency-runner.d.ts.map +1 -0
- package/dist/synthesis/financial-consistency-runner.js +131 -0
- package/dist/synthesis/financial-consistency-runner.js.map +1 -0
- package/dist/synthesis/forbidden-spin-phrases.d.ts +32 -0
- package/dist/synthesis/forbidden-spin-phrases.d.ts.map +1 -0
- package/dist/synthesis/forbidden-spin-phrases.js +84 -0
- package/dist/synthesis/forbidden-spin-phrases.js.map +1 -0
- package/dist/synthesis/phase-gate-thresholds.d.ts +30 -0
- package/dist/synthesis/phase-gate-thresholds.d.ts.map +1 -0
- package/dist/synthesis/phase-gate-thresholds.js +34 -0
- package/dist/synthesis/phase-gate-thresholds.js.map +1 -0
- package/dist/synthesis/prompts/index.d.ts.map +1 -1
- package/dist/synthesis/prompts/index.js +22 -0
- package/dist/synthesis/prompts/index.js.map +1 -1
- package/dist/synthesis/simulation-artifact-generator.d.ts.map +1 -1
- package/dist/synthesis/simulation-artifact-generator.js +89 -1
- package/dist/synthesis/simulation-artifact-generator.js.map +1 -1
- package/dist/synthesis/simulation-renderers.d.ts +105 -2
- package/dist/synthesis/simulation-renderers.d.ts.map +1 -1
- package/dist/synthesis/simulation-renderers.js +1056 -92
- package/dist/synthesis/simulation-renderers.js.map +1 -1
- package/dist/synthesis/unit-economics-loader.d.ts +71 -0
- package/dist/synthesis/unit-economics-loader.d.ts.map +1 -0
- package/dist/synthesis/unit-economics-loader.js +200 -0
- package/dist/synthesis/unit-economics-loader.js.map +1 -0
- package/package.json +1 -1
|
@@ -44,6 +44,79 @@ export interface AutoChainResult {
|
|
|
44
44
|
commitHash?: string;
|
|
45
45
|
githubUrl?: string;
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Copy whatever planning artifacts exist from ~/.agentics/runs/<traceId>/
|
|
49
|
+
* to .agentics/plans/ in the current working directory. Uses .agentics/plans/
|
|
50
|
+
* instead of plans/ to avoid colliding with any existing plans/ folder in the
|
|
51
|
+
* project (e.g., SPARC artifacts checked into the repo). Skips files that
|
|
52
|
+
* already exist with identical content to avoid unnecessary duplication.
|
|
53
|
+
*
|
|
54
|
+
* Called after every phase so even if later phases fail, earlier artifacts
|
|
55
|
+
* are still available.
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* ADR-PIPELINE-068: scaffold body for `src/simulation-lineage.ts`.
|
|
59
|
+
*
|
|
60
|
+
* Exported so unit tests can write the file to a temp directory and
|
|
61
|
+
* exercise the runtime behavior (env override, manifest walk, fallback)
|
|
62
|
+
* without having to spin up the full pipeline.
|
|
63
|
+
*
|
|
64
|
+
* Invariants enforced by tests:
|
|
65
|
+
* - Uses `readFileSync` + `fileURLToPath` (NEVER `require(`)
|
|
66
|
+
* - Exports `loadSimulationLineage`, `requireSimulationLineage`,
|
|
67
|
+
* `formatLineageBanner`, and the legacy `loadSimulationId` alias
|
|
68
|
+
* - Walks up at most 6 directories from the module location and from cwd
|
|
69
|
+
*/
|
|
70
|
+
export declare const SIMULATION_LINEAGE_SCAFFOLD = "// Auto-generated by Agentics pipeline (ADR-PIPELINE-068)\n// ESM-safe simulation lineage loader. Reads .agentics/plans/manifest.json\n// (or .agentics/runs/latest/manifest.json) using readFileSync \u2014 never\n// CommonJS require(). Do NOT reimplement this helper; import from it.\nimport { readFileSync, existsSync } from 'node:fs';\nimport { resolve, dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport type SimulationLineageSource = 'env' | 'manifest' | 'fallback';\n\nexport interface SimulationLineage {\n readonly simulationId: string;\n readonly traceId: string;\n readonly runId: string;\n readonly source: SimulationLineageSource;\n readonly manifestPath?: string;\n}\n\nconst MANIFEST_CANDIDATES: readonly string[] = [\n '.agentics/plans/manifest.json',\n '.agentics/runs/latest/manifest.json',\n];\n\nconst WALK_DEPTH = 6;\n\n/** Walk up from startDir looking for any manifest candidate path. */\nfunction findManifest(startDir: string): string | null {\n let dir = startDir;\n for (let i = 0; i < WALK_DEPTH; i++) {\n for (const rel of MANIFEST_CANDIDATES) {\n const candidate = resolve(dir, rel);\n if (existsSync(candidate)) return candidate;\n }\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return null;\n}\n\nfunction moduleDir(): string {\n try {\n return dirname(fileURLToPath(import.meta.url));\n } catch {\n return process.cwd();\n }\n}\n\n/**\n * Load the simulation lineage. Permissive \u2014 returns a fallback record when\n * nothing is available. Callers who need strict behavior should use\n * requireSimulationLineage() instead.\n *\n * Resolution order:\n * 1. AGENTICS_SIMULATION_ID / AGENTICS_TRACE_ID environment variables\n * 2. First manifest.json found walking up from this module (then cwd)\n * 3. Fallback record with source='fallback'\n */\nexport function loadSimulationLineage(): SimulationLineage {\n const envSim = process.env['AGENTICS_SIMULATION_ID'];\n const envTrace = process.env['AGENTICS_TRACE_ID'];\n if (envSim) {\n return {\n simulationId: envSim,\n traceId: envTrace ?? envSim,\n runId: envSim,\n source: 'env',\n };\n }\n\n const startDirs = [moduleDir(), process.cwd()];\n for (const start of startDirs) {\n try {\n const manifestPath = findManifest(start);\n if (!manifestPath) continue;\n const raw = JSON.parse(readFileSync(manifestPath, 'utf-8')) as Record<string, unknown>;\n const runId = String(raw['run_id'] ?? raw['runId'] ?? '');\n const simulationId = String(\n raw['simulation_id'] ?? raw['simulationId'] ?? raw['execution_id'] ?? runId,\n );\n const traceId = String(raw['trace_id'] ?? raw['traceId'] ?? simulationId);\n if (simulationId) {\n return { simulationId, traceId, runId: runId || simulationId, source: 'manifest', manifestPath };\n }\n } catch {\n // Try the next start dir. Never throw from the permissive loader.\n }\n }\n\n return {\n simulationId: 'sim-unknown',\n traceId: 'trace-unknown',\n runId: 'run-unknown',\n source: 'fallback',\n };\n}\n\n/**\n * Strict variant \u2014 throws ECLI-LIN-068 when no simulation lineage is\n * available. Use this at startup when the service MUST carry a real\n * simulation id (audit logs, ERP posts, etc.).\n */\nexport function requireSimulationLineage(): SimulationLineage {\n const lineage = loadSimulationLineage();\n if (lineage.source === 'fallback') {\n throw new Error(\n 'ECLI-LIN-068: simulation lineage unavailable \u2014 set AGENTICS_SIMULATION_ID or place .agentics/plans/manifest.json in the project tree',\n );\n }\n return lineage;\n}\n\n/**\n * Human-readable banner printed by the demo script when the loader falls\n * back. Makes the break visible instead of letting sim-unknown leak into\n * downstream audit logs and ERP posts.\n */\nexport function formatLineageBanner(lineage: SimulationLineage): string {\n if (lineage.source !== 'fallback') {\n return `simulation lineage: ${lineage.simulationId} (source: ${lineage.source})`;\n }\n return [\n '',\n '\u26A0\uFE0F Simulation lineage unavailable (source: fallback)',\n ' All audit entries and ERP posts will carry sim-unknown.',\n ' Fix: place .agentics/plans/manifest.json in the project tree,',\n ' or set AGENTICS_SIMULATION_ID=<run-id> before running the demo.',\n '',\n ].join('\\n');\n}\n\n/** Also exported under the legacy alias some older prompts referenced. */\nexport const loadSimulationId = (): string => loadSimulationLineage().simulationId;\n";
|
|
71
|
+
/**
|
|
72
|
+
* ADR-PIPELINE-069: scaffold body for `src/circuit-breaker.ts`.
|
|
73
|
+
*
|
|
74
|
+
* Extracted from the legacy middleware.ts scaffold so generators can
|
|
75
|
+
* `import { CircuitBreaker } from './circuit-breaker.js'` without pulling
|
|
76
|
+
* the entire middleware module. middleware.ts now re-exports this symbol
|
|
77
|
+
* so existing imports keep working.
|
|
78
|
+
*/
|
|
79
|
+
export declare const CIRCUIT_BREAKER_SCAFFOLD = "// Auto-generated by Agentics pipeline (ADR-PIPELINE-069)\n// Owned by the scaffold \u2014 do NOT redeclare CircuitBreaker in generated code.\nimport { createLogger } from './logger.js';\n\n/** Simple circuit breaker for external service calls. */\nexport class CircuitBreaker {\n private failures = 0;\n private state: 'closed' | 'open' | 'half-open' = 'closed';\n private nextAttempt = 0;\n\n constructor(\n private readonly name: string,\n private readonly threshold = 5,\n private readonly cooldownMs = 30000,\n private readonly logger = createLogger('circuit-breaker'),\n ) {}\n\n async call<T>(fn: () => Promise<T>): Promise<T> {\n if (this.state === 'open') {\n if (Date.now() < this.nextAttempt) {\n throw new Error(`Circuit breaker '${this.name}' is OPEN \u2014 retry after ${new Date(this.nextAttempt).toISOString()}`);\n }\n this.state = 'half-open';\n this.logger.info('circuit.half-open', { name: this.name });\n }\n try {\n const result = await fn();\n if (this.state === 'half-open') {\n this.state = 'closed';\n this.failures = 0;\n this.logger.info('circuit.closed', { name: this.name });\n }\n return result;\n } catch (err) {\n this.failures++;\n if (this.failures >= this.threshold) {\n this.state = 'open';\n this.nextAttempt = Date.now() + this.cooldownMs;\n this.logger.warn('circuit.open', { name: this.name, failures: this.failures, retryAt: new Date(this.nextAttempt).toISOString() });\n }\n throw err;\n }\n }\n\n getState(): string { return this.state; }\n}\n";
|
|
80
|
+
/**
|
|
81
|
+
* ADR-PIPELINE-069: Single source of truth for scaffold-owned modules.
|
|
82
|
+
*
|
|
83
|
+
* Every module the pipeline emits into `.agentics/plans/scaffold/src/` is
|
|
84
|
+
* listed here with its public exports. The list is consumed by:
|
|
85
|
+
* - `copyPlanningArtifacts()` — writes OWNED_MODULES.json sidecar
|
|
86
|
+
* - `prompt-generator.ts` — injects "do not reimplement" block
|
|
87
|
+
* - `post-generation-validator.ts` PGV-012 — bans duplicate declarations
|
|
88
|
+
*
|
|
89
|
+
* When you add a new scaffold file, add it here in the same change.
|
|
90
|
+
*/
|
|
91
|
+
export interface OwnedScaffoldModule {
|
|
92
|
+
readonly path: string;
|
|
93
|
+
readonly exports: readonly string[];
|
|
94
|
+
}
|
|
95
|
+
export declare const OWNED_SCAFFOLD_MODULES: readonly OwnedScaffoldModule[];
|
|
96
|
+
export interface OwnedModulesManifest {
|
|
97
|
+
readonly version: '1.0';
|
|
98
|
+
readonly generated_at: string;
|
|
99
|
+
readonly owned: readonly OwnedScaffoldModule[];
|
|
100
|
+
}
|
|
101
|
+
export declare function buildOwnedModulesManifest(now?: Date): OwnedModulesManifest;
|
|
102
|
+
export interface ScaffoldDuplicateFinding {
|
|
103
|
+
/** Absolute path of the file that redeclares an owned export. */
|
|
104
|
+
readonly path: string;
|
|
105
|
+
/** The export name that collides. */
|
|
106
|
+
readonly exportName: string;
|
|
107
|
+
/** Scaffold path that owns the export. */
|
|
108
|
+
readonly ownedPath: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* ADR-PIPELINE-069: Walk a project tree looking for generator-emitted files
|
|
112
|
+
* that redeclare an export listed in OWNED_SCAFFOLD_MODULES. Skips:
|
|
113
|
+
* - the scaffold-owned files themselves (matched by basename)
|
|
114
|
+
* - test files
|
|
115
|
+
* - node_modules / dist / .agentics
|
|
116
|
+
*
|
|
117
|
+
* Returns one finding per (file, export) pair.
|
|
118
|
+
*/
|
|
119
|
+
export declare function detectScaffoldDuplicates(projectRoot: string, owned?: readonly OwnedScaffoldModule[]): ScaffoldDuplicateFinding[];
|
|
47
120
|
export declare function executeAutoChain(traceId: string, options?: AutoChainOptions): Promise<AutoChainResult>;
|
|
48
121
|
/**
|
|
49
122
|
* Format the auto-chain result for stdout display.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto-chain.d.ts","sourceRoot":"","sources":["../../src/pipeline/auto-chain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,wBAAwB,CAAC;AA+BhC,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,CAAC;CACxC;AAED,UAAU,WAAW;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC1E;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"auto-chain.d.ts","sourceRoot":"","sources":["../../src/pipeline/auto-chain.ts"],"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