feat(codegen): scaffold ai-feature-gated pipeline module

This commit is contained in:
Kayshen-X 2026-06-07 14:55:19 +08:00
parent 82a293e7ab
commit ed7608fc04
9 changed files with 37 additions and 0 deletions

View file

@ -13,3 +13,15 @@ path = "src/lib.rs"
[dependencies]
jian-ops-schema = { path = "../../vendor/jian/crates/jian-ops-schema" }
op-editor-core = { path = "../op-editor-core" }
# AI pipeline deps — optional, pulled in only by the `ai` feature so
# non-AI consumers (and the deterministic generators) stay lean. op-ai
# is dependency-free + wasm-clean; op-codegen does NOT depend on
# op-ai-skills (skill corpus is expanded at the transport edge).
op-ai = { path = "../op-ai", optional = true }
serde = { workspace = true, features = ["derive"], optional = true }
serde_json = { workspace = true, optional = true }
[features]
# Gates the AI code-generation pipeline (src/ai/). Off by default.
ai = ["dep:op-ai", "dep:serde", "dep:serde_json"]

View file

@ -0,0 +1 @@
// Implemented in later tasks of this plan.

View file

@ -0,0 +1 @@
// Implemented in later tasks of this plan.

View file

@ -0,0 +1,13 @@
//! AI-driven code-generation pipeline. A pull-based, transport-agnostic
//! state machine: it emits `PendingRequest`s (skill names + user message
//! + params) and consumes streamed text deltas via `on_delta`/
//! `on_complete`/`on_error`, advancing through planning → chunk →
//! assembly. Hosts supply the streaming transport; the pipeline owns the
//! logic. Ported from the TS `code-generation-pipeline.ts`.
pub mod assets;
pub mod bundle;
pub mod parse;
pub mod pipeline;
pub mod prompts;
pub mod types;

View file

@ -0,0 +1 @@
// Implemented in later tasks of this plan.

View file

@ -0,0 +1 @@
// Implemented in later tasks of this plan.

View file

@ -0,0 +1 @@
// Implemented in later tasks of this plan.

View file

@ -0,0 +1 @@
// Implemented in later tasks of this plan.

View file

@ -12,6 +12,12 @@
//! node-accessor helpers, and the test suite; per-framework markup
//! generators live in the sibling `codegen_targets` module.
/// AI-driven code-generation pipeline (planning → chunk → assembly).
/// Gated behind the `ai` feature so the deterministic generators stay
/// dependency-light.
#[cfg(feature = "ai")]
pub mod ai;
mod codegen_targets;
pub use crate::codegen_targets::{