intentdna 1.7.5 → 1.8.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/LICENSE +201 -0
- package/README.md +143 -194
- package/dist/assets/candidates.d.ts +124 -0
- package/dist/assets/candidates.js +1249 -0
- package/dist/assets/catalog.d.ts +101 -0
- package/dist/assets/catalog.js +311 -0
- package/dist/assets/evidence.d.ts +93 -0
- package/dist/assets/evidence.js +391 -0
- package/dist/assets/index.d.ts +4 -0
- package/dist/assets/index.js +4 -0
- package/dist/assets/metadata.d.ts +19 -0
- package/dist/assets/metadata.js +227 -0
- package/dist/cli/commands/assets.d.ts +65 -0
- package/dist/cli/commands/assets.js +2871 -0
- package/dist/cli/commands/auth.d.ts +322 -0
- package/dist/cli/commands/auth.js +1592 -0
- package/dist/cli/commands/cloud-auth-guidance.d.ts +2 -0
- package/dist/cli/commands/cloud-auth-guidance.js +4 -0
- package/dist/cli/commands/cloud.d.ts +1359 -0
- package/dist/cli/commands/cloud.js +8364 -0
- package/dist/cli/commands/evolve.js +18 -2
- package/dist/cli/commands/generate.js +25 -2
- package/dist/cli/commands/guard.d.ts +1 -1
- package/dist/cli/commands/guard.js +1 -1
- package/dist/cli/commands/guide.d.ts +15 -0
- package/dist/cli/commands/guide.js +1747 -0
- package/dist/cli/commands/init.d.ts +12 -0
- package/dist/cli/commands/init.js +95 -60
- package/dist/cli/commands/org.d.ts +16 -0
- package/dist/cli/commands/org.js +2393 -0
- package/dist/cli/commands/release.d.ts +59 -0
- package/dist/cli/commands/release.js +716 -0
- package/dist/cli/commands/report.d.ts +82 -0
- package/dist/cli/commands/report.js +1516 -0
- package/dist/cli/commands/run.d.ts +6 -1
- package/dist/cli/commands/run.js +95 -26
- package/dist/cli/commands/sync.d.ts +8 -1
- package/dist/cli/commands/sync.js +436 -141
- package/dist/cli/commands/templates.d.ts +64 -0
- package/dist/cli/commands/templates.js +2151 -1
- package/dist/cli/commands/workflow.d.ts +26 -0
- package/dist/cli/commands/workflow.js +3053 -0
- package/dist/cli/index.js +703 -36
- package/dist/compiler/cascade.js +4 -9
- package/dist/compiler/compile.js +1 -0
- package/dist/governance/evidence-capture-attribution.d.ts +12 -0
- package/dist/governance/evidence-capture-attribution.js +46 -0
- package/dist/governance/index.d.ts +2 -0
- package/dist/governance/index.js +1 -0
- package/dist/hooks/cli.d.ts +5 -0
- package/dist/hooks/cli.js +149 -5
- package/dist/hooks/enforce.d.ts +1 -0
- package/dist/hooks/protocol.d.ts +1 -1
- package/dist/hooks/protocol.js +1 -1
- package/dist/hooks/state.d.ts +41 -0
- package/dist/hooks/state.js +126 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/mcp/tools-state.js +2 -0
- package/dist/organization/index.d.ts +121 -0
- package/dist/organization/index.js +413 -0
- package/dist/runtime/claude-sync-target.d.ts +49 -0
- package/dist/runtime/claude-sync-target.js +280 -0
- package/dist/runtime/codex-adapter.d.ts +254 -0
- package/dist/runtime/codex-adapter.js +1204 -0
- package/dist/runtime/codex-sync-target.d.ts +33 -0
- package/dist/runtime/codex-sync-target.js +241 -0
- package/dist/runtime/index.d.ts +8 -0
- package/dist/runtime/index.js +4 -0
- package/dist/runtime/output-artifact-registry.d.ts +1 -1
- package/dist/runtime/output-artifact-registry.js +2 -0
- package/dist/runtime/settings-adapter.d.ts +1 -1
- package/dist/runtime/settings-adapter.js +1 -1
- package/dist/runtime/skill-adapter.d.ts +5 -1
- package/dist/runtime/skill-adapter.js +120 -34
- package/dist/runtime/sync-artifact-registry.d.ts +99 -0
- package/dist/runtime/sync-artifact-registry.js +194 -0
- package/dist/runtime/sync-target-plan.d.ts +45 -0
- package/dist/runtime/sync-target-plan.js +19 -0
- package/dist/schema/controller-registry.d.ts +8 -1
- package/dist/schema/controller-registry.js +8 -0
- package/dist/schema/types.d.ts +35 -23
- package/dist/schema/types.js +10 -1
- package/dist/schema/validate.js +22 -22
- package/dist/schema/validators/controllers.js +38 -20
- package/dist/schema/workflow-authoring-contract.d.ts +29 -0
- package/dist/schema/workflow-authoring-contract.js +109 -0
- package/dist/schema/yaml-parser.js +18 -0
- package/dist/templates/api-backend.dna.yaml +19 -0
- package/dist/templates/brainstorming-first.dna.yaml +19 -0
- package/dist/templates/code-cleanup.dna.yaml +19 -0
- package/dist/templates/code-review-pipeline.dna.yaml +18 -0
- package/dist/templates/documentation-writer.dna.yaml +19 -0
- package/dist/templates/flutter-behavior-lock.dna.yaml +19 -0
- package/dist/templates/flutter-refactoring-rescue.dna.yaml +19 -0
- package/dist/templates/flutter-rewrite-diagnosis-review.dna.yaml +210 -0
- package/dist/templates/flutter-rewrite-fix-review-loop.dna.yaml +260 -0
- package/dist/templates/flutter-rewrite-new.dna.yaml +506 -0
- package/dist/templates/flutter-rewrite.dna.yaml +20 -0
- package/dist/templates/frontend-quality.dna.yaml +19 -0
- package/dist/templates/full-pipeline.dna.yaml +20 -0
- package/dist/templates/marketplace.d.ts +92 -0
- package/dist/templates/marketplace.js +502 -0
- package/dist/templates/metadata.d.ts +25 -0
- package/dist/templates/metadata.js +136 -3
- package/dist/templates/mobile-dev.dna.yaml +19 -0
- package/dist/templates/multi-agent-handoff-coordination.dna.yaml +156 -0
- package/dist/templates/multi-perspective-review.dna.yaml +19 -0
- package/dist/templates/persistent-executor.dna.yaml +19 -0
- package/dist/templates/qa-loop.dna.yaml +18 -0
- package/dist/templates/release-evidence-gate.dna.yaml +131 -0
- package/dist/templates/requirements-gate.dna.yaml +19 -0
- package/dist/templates/research-orchestration.dna.yaml +19 -0
- package/dist/templates/root-cause-analysis.dna.yaml +19 -0
- package/dist/templates/safe-refactoring.dna.yaml +321 -0
- package/dist/templates/secure-dev.dna.yaml +19 -0
- package/dist/templates/subagent-parallel.dna.yaml +19 -0
- package/dist/templates/systematic-debugging.dna.yaml +19 -0
- package/dist/templates/tdd-strict.dna.yaml +19 -0
- package/dist/templates/ui-visual-regression-qa.dna.yaml +133 -0
- package/dist/templates/workflow-author.dna.yaml +302 -0
- package/dist/templates/workflow-blocked-scope-triage.dna.yaml +242 -0
- package/dist/templates/workflow-completion-audit.dna.yaml +254 -0
- package/dist/templates/workflow-cross-boundary-resource-approval.dna.yaml +249 -0
- package/dist/templates/workflow-evidence-review.dna.yaml +198 -0
- package/dist/templates/workflow-module-inventory.dna.yaml +257 -0
- package/dist/templates/workflow-runtime-smoke-review.dna.yaml +252 -0
- package/dist/templates/workflow-verification-command-routing.dna.yaml +278 -0
- package/dist/workflow/authoring-packet.d.ts +67 -0
- package/dist/workflow/authoring-packet.js +218 -0
- package/dist/workflow/draft.d.ts +159 -0
- package/dist/workflow/draft.js +800 -0
- package/dist/workflow/index.d.ts +3 -0
- package/dist/workflow/index.js +3 -0
- package/dist/workflow/suggestion-review.d.ts +65 -0
- package/dist/workflow/suggestion-review.js +245 -0
- package/package.json +1 -1
- package/spec/README.md +15 -48
- package/spec/codex-adapter-contract.md +176 -0
- package/spec/sync-target-plan.md +158 -0
- package/spec/workflow-capability-ir.md +153 -0
- package/spec/agent-dispatch-fix.md +0 -116
- package/spec/control-plane-convergence-handoff-2026-04-24.md +0 -432
- package/spec/flutter-rewrite-template-optimization.md +0 -301
- package/spec/foundation-hardening.md +0 -178
- package/spec/hooks-infra-harness-hardening.md +0 -741
- package/spec/multi-config.md +0 -172
- package/spec/parallel-isolation.md +0 -268
- package/spec/template-version-namespace-fix.md +0 -653
- package/spec/workflow-pipeline.md +0 -101
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
|
+
import { WORKFLOW_AUTHORING_SCHEMA } from "../schema/workflow-authoring-contract.js";
|
|
4
|
+
import { parseYAML } from "../schema/yaml-parser.js";
|
|
5
|
+
import { calculateTemplateContentHash, findTemplateCatalogEntry } from "../templates/catalog.js";
|
|
6
|
+
export const AUTHORING_PACKET_SCHEMA_VERSION = "intentdna.authoring_packet.v1";
|
|
7
|
+
const DEFAULT_EXAMPLES = [
|
|
8
|
+
{
|
|
9
|
+
name: "code-review-pipeline",
|
|
10
|
+
annotation: "Shows a multi-role review pipeline with scoped permissions, dependency ordering, checkpoints, and review handoffs.",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: "qa-loop",
|
|
14
|
+
annotation: "Shows a bounded generate-run-analyze-fix QA loop with explicit retry behavior and verification evidence.",
|
|
15
|
+
},
|
|
16
|
+
];
|
|
17
|
+
function isRecord(value) {
|
|
18
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19
|
+
}
|
|
20
|
+
function stringArray(value) {
|
|
21
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
|
|
22
|
+
}
|
|
23
|
+
function objectKeys(value) {
|
|
24
|
+
return isRecord(value) ? Object.keys(value) : [];
|
|
25
|
+
}
|
|
26
|
+
function c1Metadata(parsed) {
|
|
27
|
+
return {
|
|
28
|
+
id: parsed.id,
|
|
29
|
+
name: parsed.name,
|
|
30
|
+
version: parsed.version,
|
|
31
|
+
purpose: parsed.purpose,
|
|
32
|
+
maturity: parsed.maturity,
|
|
33
|
+
fit: stringArray(parsed.fit),
|
|
34
|
+
not_for: stringArray(parsed.not_for),
|
|
35
|
+
inputs: stringArray(parsed.inputs),
|
|
36
|
+
outputs: stringArray(parsed.outputs),
|
|
37
|
+
lineage: isRecord(parsed.lineage) ? parsed.lineage : undefined,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function workflowKeys(parsed) {
|
|
41
|
+
if (isRecord(parsed.workflows))
|
|
42
|
+
return Object.keys(parsed.workflows);
|
|
43
|
+
return isRecord(parsed.workflow) ? ["workflow"] : [];
|
|
44
|
+
}
|
|
45
|
+
function exampleAnnotation(name) {
|
|
46
|
+
return DEFAULT_EXAMPLES.find((example) => example.name === name)?.annotation
|
|
47
|
+
?? "Complete C1 workflow asset loaded from the real template catalog at packet generation time.";
|
|
48
|
+
}
|
|
49
|
+
async function loadExampleTemplate(name, projectDir) {
|
|
50
|
+
const entry = await findTemplateCatalogEntry(name, { projectDir });
|
|
51
|
+
if (!entry)
|
|
52
|
+
throw new Error(`Authoring packet example template not found: ${name}`);
|
|
53
|
+
const yaml = await readFile(entry.path, "utf-8");
|
|
54
|
+
const parsed = parseYAML(yaml);
|
|
55
|
+
const record = isRecord(parsed) ? parsed : {};
|
|
56
|
+
return {
|
|
57
|
+
name: entry.name,
|
|
58
|
+
display_name: entry.displayName,
|
|
59
|
+
source_path: entry.path,
|
|
60
|
+
content_hash: calculateTemplateContentHash(yaml),
|
|
61
|
+
annotation: exampleAnnotation(name),
|
|
62
|
+
c1_metadata: c1Metadata(record),
|
|
63
|
+
workflow_keys: workflowKeys(record),
|
|
64
|
+
role_keys: objectKeys(record.roles),
|
|
65
|
+
yaml,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function shellQuote(value) {
|
|
69
|
+
return `'${value.replace(/'/g, `'"'"'`)}'`;
|
|
70
|
+
}
|
|
71
|
+
export async function buildAuthoringPacket(options = {}) {
|
|
72
|
+
const generatedAt = options.generatedAt ?? new Date().toISOString();
|
|
73
|
+
const projectDir = resolve(options.projectDir ?? process.cwd());
|
|
74
|
+
const exampleNames = options.exampleTemplates ?? DEFAULT_EXAMPLES.map((example) => example.name);
|
|
75
|
+
const examples = await Promise.all(exampleNames.map((name) => loadExampleTemplate(name, projectDir)));
|
|
76
|
+
const projectFlag = `--project-dir ${shellQuote(projectDir)}`;
|
|
77
|
+
const authoringCommand = options.goal !== undefined
|
|
78
|
+
? `dna workflow authoring-packet ${shellQuote(options.goal)} --json ${projectFlag}`
|
|
79
|
+
: `dna workflow authoring-packet --json ${projectFlag}`;
|
|
80
|
+
const candidatePath = join(projectDir, ".dna", "authoring", "<asset>.candidate.dna.yaml");
|
|
81
|
+
const savedPath = join(projectDir, ".dna", "templates", "<asset>.dna.yaml");
|
|
82
|
+
return {
|
|
83
|
+
schema_version: AUTHORING_PACKET_SCHEMA_VERSION,
|
|
84
|
+
generated_at: generatedAt,
|
|
85
|
+
network_performed: false,
|
|
86
|
+
mutation_performed: false,
|
|
87
|
+
runtime_authority: false,
|
|
88
|
+
project_context: {
|
|
89
|
+
root: projectDir,
|
|
90
|
+
handling: "local_path_only",
|
|
91
|
+
explicitly_requested: options.projectDir !== undefined,
|
|
92
|
+
},
|
|
93
|
+
...(options.goal !== undefined ? {
|
|
94
|
+
goal_context: {
|
|
95
|
+
raw: options.goal,
|
|
96
|
+
handling: "opaque_context_only",
|
|
97
|
+
goal_modeling_performed: false,
|
|
98
|
+
},
|
|
99
|
+
} : {}),
|
|
100
|
+
asset_contract: {
|
|
101
|
+
source: "docs/architecture/c1-asset-format.md",
|
|
102
|
+
required_fields: ["id", "name", "version", "purpose", "maturity"],
|
|
103
|
+
recommended_fields: ["fit", "not_for", "inputs", "outputs", "roles", "workflow|workflows", "boundaries", "evidence", "lineage"],
|
|
104
|
+
validation_required_fields: ["version", "id", "name", "type", "cascade"],
|
|
105
|
+
validation_notes: [
|
|
106
|
+
"Use type project for a project-local authored workflow unless a different cascade layer is explicitly intended.",
|
|
107
|
+
"Include genes: {} and contexts: {} when the workflow adds no policy genes or context modifiers.",
|
|
108
|
+
"Use exactly one of workflow or workflows, never both.",
|
|
109
|
+
"Start authored assets at maturity: draft until a human reviews or adopts them.",
|
|
110
|
+
],
|
|
111
|
+
directory_protocol: {
|
|
112
|
+
builtin_templates: "src/templates/*.dna.yaml",
|
|
113
|
+
project_templates: ".dna/templates/*.dna.yaml",
|
|
114
|
+
candidate_staging: ".dna/authoring/*.candidate.dna.yaml",
|
|
115
|
+
},
|
|
116
|
+
compatibility: [
|
|
117
|
+
"Built-in and project-local workflow assets use the same C1 shape.",
|
|
118
|
+
"Existing x_intentdna fields remain compatibility metadata and should not be deleted just to adopt C1.",
|
|
119
|
+
"Do not delete existing JSON or YAML fields when revising an older asset; deprecate or mirror them when needed.",
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
schema_constraints: WORKFLOW_AUTHORING_SCHEMA,
|
|
123
|
+
red_lines: [
|
|
124
|
+
"Do not loosen Species or Enterprise thresholds; lower layers may only tighten inherited red lines.",
|
|
125
|
+
"Declare boundaries for runtime authority, write scope, evidence authority, and adoption whenever they apply.",
|
|
126
|
+
"Do not claim Online, marketplace, Supabase, or MCP executes the workflow or makes allow/warn/block/validate decisions.",
|
|
127
|
+
"Do not store service-role keys, token peppers, user JWTs, raw API tokens, or secrets in browser-facing or committed YAML.",
|
|
128
|
+
"Do not bypass dna validate, asset inspection, human review, or explicit sync/adoption commands.",
|
|
129
|
+
"Do not derive policy from evidence automatically; evidence can produce suggestions only after human review.",
|
|
130
|
+
"Do not call an LLM, model user intent, rank workflow shapes, or generate YAML inside dna; creation belongs to the external agent.",
|
|
131
|
+
],
|
|
132
|
+
examples,
|
|
133
|
+
interview_protocol: [
|
|
134
|
+
{
|
|
135
|
+
id: "goal",
|
|
136
|
+
question: "What repeated work method should this asset make easier or safer?",
|
|
137
|
+
required_output: "One concrete workflow purpose and a short success definition.",
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
id: "steps",
|
|
141
|
+
question: "What are the real steps, in order or DAG form, from intake to verified handoff?",
|
|
142
|
+
required_output: "Step ids, owners/roles, dependencies, prompts, and produced/consumed artifacts.",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: "roles",
|
|
146
|
+
question: "Who or which agent role is allowed to read, write, run commands, and review?",
|
|
147
|
+
required_output: "Role definitions with minimal tool permissions and read/write scopes.",
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: "verification",
|
|
151
|
+
question: "What evidence proves the workflow did the right thing?",
|
|
152
|
+
required_output: "Checkpoints, completion checks, command evidence, handoff artifacts, and reviewer criteria.",
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: "boundaries",
|
|
156
|
+
question: "What must this workflow never do, mutate, expose, or claim?",
|
|
157
|
+
required_output: "not_for plus runtime-authority, write-scope, evidence-authority, adoption, secret, and escalation boundaries.",
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: "failure",
|
|
161
|
+
question: "How should failure, retry, blocked scope, or human escalation work?",
|
|
162
|
+
required_output: "retry_policy, transitions, blocked item recording, and human review gates.",
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
validate_loop: [
|
|
166
|
+
{
|
|
167
|
+
step: `Generate one C1 YAML candidate at ${candidatePath} from the interview answers and packet examples.`,
|
|
168
|
+
owner: "external_agent",
|
|
169
|
+
writes: true,
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
step: "Validate the candidate YAML with dna; do not treat prose review as validation.",
|
|
173
|
+
command: `dna validate ${shellQuote(candidatePath)}`,
|
|
174
|
+
owner: "dna",
|
|
175
|
+
writes: false,
|
|
176
|
+
repeat_until: "exit code 0 and no error diagnostics",
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
step: "Revise only the candidate YAML needed to satisfy diagnostics and the stated human intent, then run validation again.",
|
|
180
|
+
owner: "external_agent",
|
|
181
|
+
writes: true,
|
|
182
|
+
repeat_until: "dna validate passes",
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
step: `After explicit human confirmation, save the exact validated YAML at ${savedPath}; packet generation itself does not perform this write.`,
|
|
186
|
+
owner: "human",
|
|
187
|
+
writes: true,
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
step: "Confirm catalog visibility before any init, adoption, binding, or sync.",
|
|
191
|
+
command: `dna assets show <asset> ${projectFlag} && dna assets inspect <asset> ${projectFlag}`,
|
|
192
|
+
owner: "dna",
|
|
193
|
+
writes: false,
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
step: "Preview both supported harness sync surfaces after the saved asset validates.",
|
|
197
|
+
command: `dna sync ${projectFlag} --dry-run && dna sync ${projectFlag} --codex --dry-run`,
|
|
198
|
+
owner: "dna",
|
|
199
|
+
writes: false,
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
handoff_boundary: [
|
|
203
|
+
"The external agent authors YAML only; it does not adopt, bind, sync, upload, deploy, or make runtime decisions.",
|
|
204
|
+
"Human save/adoption decisions are explicit and separate from packet generation.",
|
|
205
|
+
"The packet contains no instruction to auto-execute a mutation command; it names the reviewed save destination only.",
|
|
206
|
+
"dna validates, catalogs, compiles, syncs, and records local runtime evidence deterministically after explicit commands.",
|
|
207
|
+
"Online may later present this packet, but Online still does not execute workflows or own runtime authority.",
|
|
208
|
+
],
|
|
209
|
+
next_commands: [
|
|
210
|
+
authoringCommand,
|
|
211
|
+
`dna validate ${shellQuote(savedPath)}`,
|
|
212
|
+
`dna assets show <asset> ${projectFlag}`,
|
|
213
|
+
`dna assets inspect <asset> ${projectFlag}`,
|
|
214
|
+
`dna sync ${projectFlag} --dry-run`,
|
|
215
|
+
`dna sync ${projectFlag} --codex --dry-run`,
|
|
216
|
+
],
|
|
217
|
+
};
|
|
218
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
export type WorkflowDraftExampleId = "dev_pipeline" | "evidence_review" | "rewrite_governance";
|
|
2
|
+
export type HandoffType = "file" | "directory" | "test_result" | "git_commit" | "summary" | "state";
|
|
3
|
+
export interface HandoffArtifact {
|
|
4
|
+
type: HandoffType;
|
|
5
|
+
path?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
from?: string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
description: string;
|
|
10
|
+
}
|
|
11
|
+
export interface WorkflowStepDef {
|
|
12
|
+
id: string;
|
|
13
|
+
role: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
depends_on?: string[];
|
|
16
|
+
prompt?: string;
|
|
17
|
+
checkpoints?: Array<{
|
|
18
|
+
assert: string;
|
|
19
|
+
message: string;
|
|
20
|
+
action?: "block" | "warn";
|
|
21
|
+
}>;
|
|
22
|
+
handoff?: {
|
|
23
|
+
consumes?: HandoffArtifact[];
|
|
24
|
+
produces?: HandoffArtifact[];
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface WorkflowDraftDef {
|
|
28
|
+
name: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
steps: WorkflowStepDef[];
|
|
31
|
+
retry_policy?: {
|
|
32
|
+
max_retries: number;
|
|
33
|
+
retry_from?: string;
|
|
34
|
+
backoff?: "none" | "linear" | "exponential";
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface WorkflowDraftInput {
|
|
38
|
+
exampleId: WorkflowDraftExampleId;
|
|
39
|
+
goal: string;
|
|
40
|
+
strictness: "standard" | "high";
|
|
41
|
+
}
|
|
42
|
+
export interface WorkflowDraftValidation {
|
|
43
|
+
ok: boolean;
|
|
44
|
+
messages: Array<{
|
|
45
|
+
severity: "error" | "warning" | "info";
|
|
46
|
+
path: string;
|
|
47
|
+
message: string;
|
|
48
|
+
}>;
|
|
49
|
+
preview: {
|
|
50
|
+
step_count: number;
|
|
51
|
+
parallel_groups: string[][];
|
|
52
|
+
retry_max: number;
|
|
53
|
+
write_path: "draft_only";
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface WorkflowDraft {
|
|
57
|
+
mode: "draft_only";
|
|
58
|
+
generated_at: string;
|
|
59
|
+
input: WorkflowDraftInput;
|
|
60
|
+
scaffold?: {
|
|
61
|
+
kind: "example_clone_scaffold";
|
|
62
|
+
source_example: WorkflowDraftExampleId;
|
|
63
|
+
positioning: string;
|
|
64
|
+
deprecated_primary_creation_path: "dna workflow authoring-packet";
|
|
65
|
+
};
|
|
66
|
+
workflow: WorkflowDraftDef;
|
|
67
|
+
design_packet: WorkflowDesignPacket;
|
|
68
|
+
yaml: string;
|
|
69
|
+
validation: WorkflowDraftValidation;
|
|
70
|
+
safe_flow: string[];
|
|
71
|
+
forbidden: string[];
|
|
72
|
+
}
|
|
73
|
+
export type WorkflowEditOperation = "insert_step" | "add_verifier" | "tighten_boundary" | "split_step" | "replace_role";
|
|
74
|
+
export interface WorkflowEditPlanInput extends WorkflowDraftInput {
|
|
75
|
+
operation: WorkflowEditOperation;
|
|
76
|
+
instruction: string;
|
|
77
|
+
targetStep?: string;
|
|
78
|
+
role?: string;
|
|
79
|
+
source?: string;
|
|
80
|
+
inference?: {
|
|
81
|
+
operation?: "explicit" | "inferred";
|
|
82
|
+
targetStep?: "explicit" | "inferred" | "default";
|
|
83
|
+
role?: "explicit" | "inferred" | "default";
|
|
84
|
+
confidence: "low" | "medium" | "high";
|
|
85
|
+
reasons: string[];
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export interface WorkflowEditPlan {
|
|
89
|
+
mode: "edit_plan_only";
|
|
90
|
+
generated_at: string;
|
|
91
|
+
input: WorkflowEditPlanInput;
|
|
92
|
+
base_workflow: WorkflowDraftDef;
|
|
93
|
+
proposed_workflow: WorkflowDraftDef;
|
|
94
|
+
design_packet: WorkflowDesignPacket;
|
|
95
|
+
operations: Array<{
|
|
96
|
+
operation: WorkflowEditOperation;
|
|
97
|
+
target: string;
|
|
98
|
+
summary: string;
|
|
99
|
+
human_review_required: true;
|
|
100
|
+
}>;
|
|
101
|
+
yaml: string;
|
|
102
|
+
validation: WorkflowDraftValidation;
|
|
103
|
+
safe_flow: string[];
|
|
104
|
+
forbidden: string[];
|
|
105
|
+
}
|
|
106
|
+
export interface WorkflowDesignPacket {
|
|
107
|
+
workflow: string;
|
|
108
|
+
goal: string;
|
|
109
|
+
stepCount: number;
|
|
110
|
+
editableOperations: WorkflowEditOperation[];
|
|
111
|
+
reviewCommands: string[];
|
|
112
|
+
adoptionCommands: string[];
|
|
113
|
+
mutationBoundary: string;
|
|
114
|
+
userPrompt: string;
|
|
115
|
+
}
|
|
116
|
+
export interface WorkflowTemplateEvidenceLink {
|
|
117
|
+
label: string;
|
|
118
|
+
path: string;
|
|
119
|
+
kind: "doc" | "dogfood" | "reference";
|
|
120
|
+
description?: string;
|
|
121
|
+
}
|
|
122
|
+
export interface WorkflowTemplateLineage {
|
|
123
|
+
generatedFrom?: string;
|
|
124
|
+
sourceAsset?: string;
|
|
125
|
+
sourceCandidate?: string;
|
|
126
|
+
sourceSuggestion?: string;
|
|
127
|
+
sourceEvidence?: string;
|
|
128
|
+
}
|
|
129
|
+
export interface WorkflowTemplateContext {
|
|
130
|
+
workflowId?: string;
|
|
131
|
+
workflows?: Record<string, WorkflowDraftDef>;
|
|
132
|
+
roles?: Record<string, unknown>;
|
|
133
|
+
controllers?: Record<string, unknown>;
|
|
134
|
+
extraSections?: Record<string, unknown>;
|
|
135
|
+
}
|
|
136
|
+
export interface WorkflowDraftExample {
|
|
137
|
+
id: WorkflowDraftExampleId;
|
|
138
|
+
label: string;
|
|
139
|
+
summary: string;
|
|
140
|
+
workflow: WorkflowDraftDef;
|
|
141
|
+
}
|
|
142
|
+
export declare function workflowDraftToYaml(workflow: WorkflowDraftDef): string;
|
|
143
|
+
export declare function workflowDraftToTemplateYaml(params: {
|
|
144
|
+
templateName: string;
|
|
145
|
+
workflow: WorkflowDraftDef;
|
|
146
|
+
generatedAt?: string;
|
|
147
|
+
lineage?: WorkflowTemplateLineage;
|
|
148
|
+
evidence?: readonly WorkflowTemplateEvidenceLink[];
|
|
149
|
+
templateContext?: WorkflowTemplateContext;
|
|
150
|
+
}): string;
|
|
151
|
+
export declare function workflowDraftExamples(): WorkflowDraftExample[];
|
|
152
|
+
export declare function buildWorkflowDesignPacket(params: {
|
|
153
|
+
workflow: WorkflowDraftDef;
|
|
154
|
+
goal: string;
|
|
155
|
+
templateName?: string;
|
|
156
|
+
}): WorkflowDesignPacket;
|
|
157
|
+
export declare function createWorkflowDraft(input: WorkflowDraftInput, generatedAt?: string): WorkflowDraft;
|
|
158
|
+
export declare function createWorkflowEditPlanFromWorkflow(baseWorkflow: WorkflowDraftDef, input: WorkflowEditPlanInput, generatedAt?: string): WorkflowEditPlan;
|
|
159
|
+
export declare function createWorkflowEditPlan(input: WorkflowEditPlanInput, generatedAt?: string): WorkflowEditPlan;
|