@synergenius/flow-weaver 0.17.7 → 0.17.9
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/api/parse.d.ts +5 -0
- package/dist/api/parse.js +4 -0
- package/dist/ast/types.d.ts +2 -0
- package/dist/cli/commands/compile.js +2 -1
- package/dist/cli/commands/init.js +15 -9
- package/dist/cli/commands/validate.js +1 -1
- package/dist/cli/exports.d.ts +17 -0
- package/dist/cli/exports.js +23 -0
- package/dist/cli/flow-weaver.mjs +59021 -62127
- package/dist/cli/templates/index.js +8 -1
- package/dist/extensions/index.d.ts +10 -6
- package/dist/extensions/index.js +11 -6
- package/dist/generated-version.d.ts +1 -1
- package/dist/generated-version.js +1 -1
- package/dist/generator/index.d.ts +11 -0
- package/dist/generator/index.js +11 -0
- package/dist/parser.d.ts +7 -0
- package/dist/parser.js +29 -0
- package/package.json +11 -7
- package/dist/extensions/cicd/base-target.d.ts +0 -110
- package/dist/extensions/cicd/base-target.js +0 -397
- package/dist/extensions/cicd/detection.d.ts +0 -33
- package/dist/extensions/cicd/detection.js +0 -88
- package/dist/extensions/cicd/docs/cicd.md +0 -395
- package/dist/extensions/cicd/index.d.ts +0 -15
- package/dist/extensions/cicd/index.js +0 -15
- package/dist/extensions/cicd/register.d.ts +0 -11
- package/dist/extensions/cicd/register.js +0 -62
- package/dist/extensions/cicd/rules.d.ts +0 -30
- package/dist/extensions/cicd/rules.js +0 -288
- package/dist/extensions/cicd/tag-handler.d.ts +0 -14
- package/dist/extensions/cicd/tag-handler.js +0 -504
- package/dist/extensions/cicd/templates/cicd-docker.d.ts +0 -9
- package/dist/extensions/cicd/templates/cicd-docker.js +0 -110
- package/dist/extensions/cicd/templates/cicd-matrix.d.ts +0 -9
- package/dist/extensions/cicd/templates/cicd-matrix.js +0 -112
- package/dist/extensions/cicd/templates/cicd-multi-env.d.ts +0 -9
- package/dist/extensions/cicd/templates/cicd-multi-env.js +0 -126
- package/dist/extensions/cicd/templates/cicd-test-deploy.d.ts +0 -11
- package/dist/extensions/cicd/templates/cicd-test-deploy.js +0 -156
- package/dist/extensions/inngest/dev-mode.d.ts +0 -9
- package/dist/extensions/inngest/dev-mode.js +0 -213
- package/dist/extensions/inngest/generator.d.ts +0 -53
- package/dist/extensions/inngest/generator.js +0 -1176
- package/dist/extensions/inngest/index.d.ts +0 -2
- package/dist/extensions/inngest/index.js +0 -2
- package/dist/extensions/inngest/register.d.ts +0 -6
- package/dist/extensions/inngest/register.js +0 -23
- package/dist/extensions/inngest/templates/ai-agent-durable.d.ts +0 -8
- package/dist/extensions/inngest/templates/ai-agent-durable.js +0 -334
- package/dist/extensions/inngest/templates/ai-pipeline-durable.d.ts +0 -8
- package/dist/extensions/inngest/templates/ai-pipeline-durable.js +0 -326
package/dist/api/parse.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ export interface ParseOptions extends Partial<ASTParseOptions> {
|
|
|
10
10
|
* Useful for files that only contain node type definitions.
|
|
11
11
|
*/
|
|
12
12
|
nodeTypesOnly?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Project root directory. When set, tag handlers from installed
|
|
15
|
+
* marketplace packs are discovered and registered before parsing.
|
|
16
|
+
*/
|
|
17
|
+
projectDir?: string;
|
|
13
18
|
}
|
|
14
19
|
export interface ParseResult {
|
|
15
20
|
ast: TWorkflowAST;
|
package/dist/api/parse.js
CHANGED
|
@@ -25,6 +25,10 @@ export async function parseWorkflow(filePath, options) {
|
|
|
25
25
|
const warnings = [];
|
|
26
26
|
let availableWorkflows = [];
|
|
27
27
|
try {
|
|
28
|
+
// Load marketplace pack tag handlers before parsing
|
|
29
|
+
if (options?.projectDir) {
|
|
30
|
+
await parser.loadPackHandlers(options.projectDir);
|
|
31
|
+
}
|
|
28
32
|
// Parse the file to extract nodes and workflows
|
|
29
33
|
const parsed = parser.parse(filePath);
|
|
30
34
|
warnings.push(...parsed.warnings);
|
package/dist/ast/types.d.ts
CHANGED
|
@@ -869,6 +869,8 @@ export type TParseOptions = {
|
|
|
869
869
|
includeLocations?: boolean;
|
|
870
870
|
validate?: boolean;
|
|
871
871
|
validationRules?: TValidationRule[];
|
|
872
|
+
/** Project root directory. When set, pack tag handlers are discovered from node_modules/. */
|
|
873
|
+
projectDir?: string;
|
|
872
874
|
};
|
|
873
875
|
export type TValidationRule = {
|
|
874
876
|
name: string;
|
|
@@ -94,7 +94,7 @@ export async function compileCommand(input, options = {}) {
|
|
|
94
94
|
continue;
|
|
95
95
|
}
|
|
96
96
|
// Parse the workflow
|
|
97
|
-
const parseResult = await parseWorkflow(file, { workflowName });
|
|
97
|
+
const parseResult = await parseWorkflow(file, { workflowName, projectDir: cwd });
|
|
98
98
|
if (parseResult.warnings.length > 0 && verbose) {
|
|
99
99
|
logger.warn(`Parse warnings in ${fileName}:`);
|
|
100
100
|
parseResult.warnings.forEach((w) => logger.warn(` ${w}`));
|
|
@@ -242,6 +242,7 @@ export async function compileCustomTarget(target, input, options) {
|
|
|
242
242
|
logger.info(`Target: ${target}`);
|
|
243
243
|
logger.newline();
|
|
244
244
|
const annotationParser = new AnnotationParser();
|
|
245
|
+
await annotationParser.loadPackHandlers(process.cwd());
|
|
245
246
|
const parseResult = annotationParser.parse(filePath);
|
|
246
247
|
if (parseResult.errors.length > 0) {
|
|
247
248
|
const msgs = parseResult.errors.map((e) => ` ${e}`).join('\n');
|
|
@@ -10,7 +10,7 @@ import input from '@inquirer/input';
|
|
|
10
10
|
import select, { Separator } from '@inquirer/select';
|
|
11
11
|
import confirm from '@inquirer/confirm';
|
|
12
12
|
import { ExitPromptError } from '@inquirer/core';
|
|
13
|
-
import { getWorkflowTemplate, getAllWorkflowTemplates } from '../templates/index.js';
|
|
13
|
+
import { getWorkflowTemplate, getAllWorkflowTemplates, loadPackTemplates } from '../templates/index.js';
|
|
14
14
|
import { logger } from '../utils/logger.js';
|
|
15
15
|
import { compileCommand } from './compile.js';
|
|
16
16
|
import { runMcpSetupFromInit, CLI_TOOL_BINARY, detectCliTools } from './mcp-setup.js';
|
|
@@ -37,11 +37,15 @@ export function toWorkflowName(projectName) {
|
|
|
37
37
|
export function isNonInteractive() {
|
|
38
38
|
return !process.stdin.isTTY;
|
|
39
39
|
}
|
|
40
|
-
// Dynamic: includes core templates plus any registered by extensions
|
|
41
|
-
|
|
40
|
+
// Dynamic: includes core templates plus any registered by extensions/packs
|
|
41
|
+
function getValidTemplates() {
|
|
42
|
+
return getAllWorkflowTemplates().map((t) => t.id);
|
|
43
|
+
}
|
|
42
44
|
const VALID_PERSONAS = ['nocode', 'vibecoder', 'lowcode', 'expert'];
|
|
43
|
-
// Dynamic: includes core use cases plus any registered by extensions
|
|
44
|
-
|
|
45
|
+
// Dynamic: includes core use cases plus any registered by extensions/packs
|
|
46
|
+
function getValidUseCases() {
|
|
47
|
+
return USE_CASE_CHOICES.map((c) => c.value);
|
|
48
|
+
}
|
|
45
49
|
// ── Config resolution (prompts) ──────────────────────────────────────────────
|
|
46
50
|
export async function resolveInitConfig(dirArg, options) {
|
|
47
51
|
const skipPrompts = options.yes || isNonInteractive();
|
|
@@ -102,8 +106,8 @@ export async function resolveInitConfig(dirArg, options) {
|
|
|
102
106
|
if (hasExplicitTemplate) {
|
|
103
107
|
// Direct --template flag bypasses everything
|
|
104
108
|
template = options.template;
|
|
105
|
-
if (!
|
|
106
|
-
throw new Error(`Unknown template "${template}". Available: ${
|
|
109
|
+
if (!getValidTemplates().includes(template)) {
|
|
110
|
+
throw new Error(`Unknown template "${template}". Available: ${getValidTemplates().join(', ')}`);
|
|
107
111
|
}
|
|
108
112
|
}
|
|
109
113
|
else if (persona === 'expert') {
|
|
@@ -138,8 +142,8 @@ export async function resolveInitConfig(dirArg, options) {
|
|
|
138
142
|
else {
|
|
139
143
|
// Non-expert: use-case categories
|
|
140
144
|
if (options.useCase) {
|
|
141
|
-
if (!
|
|
142
|
-
throw new Error(`Unknown use case "${options.useCase}". Available: ${
|
|
145
|
+
if (!getValidUseCases().includes(options.useCase)) {
|
|
146
|
+
throw new Error(`Unknown use case "${options.useCase}". Available: ${getValidUseCases().join(', ')}`);
|
|
143
147
|
}
|
|
144
148
|
useCase = options.useCase;
|
|
145
149
|
}
|
|
@@ -488,6 +492,8 @@ export async function handleAgentHandoff(opts) {
|
|
|
488
492
|
// ── CLI entrypoint ───────────────────────────────────────────────────────────
|
|
489
493
|
export async function initCommand(dirArg, options) {
|
|
490
494
|
try {
|
|
495
|
+
// Load templates contributed by installed marketplace packs
|
|
496
|
+
await loadPackTemplates(process.cwd());
|
|
491
497
|
const config = await resolveInitConfig(dirArg, options);
|
|
492
498
|
// Validate target directory
|
|
493
499
|
const pkgPath = path.join(config.targetDir, 'package.json');
|
|
@@ -62,7 +62,7 @@ export async function validateCommand(input, options = {}) {
|
|
|
62
62
|
}
|
|
63
63
|
try {
|
|
64
64
|
// Parse the workflow
|
|
65
|
-
const parseResult = await parseWorkflow(file, { workflowName });
|
|
65
|
+
const parseResult = await parseWorkflow(file, { workflowName, projectDir: process.cwd() });
|
|
66
66
|
if (parseResult.warnings.length > 0) {
|
|
67
67
|
if (!json && !quiet) {
|
|
68
68
|
logger.warn(`Parse warnings in ${fileName}:`);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI utilities — public barrel for export target packs.
|
|
3
|
+
*
|
|
4
|
+
* Exposes CLI internals that marketplace packs need: template types,
|
|
5
|
+
* provider code generators, LLM type snippets, compileCustomTarget,
|
|
6
|
+
* and the logger.
|
|
7
|
+
*/
|
|
8
|
+
export type { WorkflowTemplate, WorkflowTemplateOptions, NodeTemplate, ConfigSchema, ConfigField, ConfigFieldType, } from './templates/index.js';
|
|
9
|
+
export { registerWorkflowTemplates, getAllWorkflowTemplates, getWorkflowTemplate, } from './templates/index.js';
|
|
10
|
+
export { getProviderCode, generateOpenAIProvider, generateAnthropicProvider, generateOllamaProvider, generateMockProvider, type ProviderCodeOptions, } from './templates/providers/index.js';
|
|
11
|
+
export { LLM_CORE_TYPES, LLM_SIMPLE_TYPES, LLM_MOCK_PROVIDER, LLM_MOCK_PROVIDER_WITH_TOOLS, } from './templates/shared/llm-types.js';
|
|
12
|
+
export { aiConfigSchema } from './templates/workflows/ai-agent.js';
|
|
13
|
+
export { registerPackUseCase } from './commands/init-personas.js';
|
|
14
|
+
export { compileCustomTarget } from './commands/compile.js';
|
|
15
|
+
export { logger } from './utils/logger.js';
|
|
16
|
+
export { getErrorMessage, wrapError } from '../utils/error-utils.js';
|
|
17
|
+
//# sourceMappingURL=exports.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI utilities — public barrel for export target packs.
|
|
3
|
+
*
|
|
4
|
+
* Exposes CLI internals that marketplace packs need: template types,
|
|
5
|
+
* provider code generators, LLM type snippets, compileCustomTarget,
|
|
6
|
+
* and the logger.
|
|
7
|
+
*/
|
|
8
|
+
export { registerWorkflowTemplates, getAllWorkflowTemplates, getWorkflowTemplate, } from './templates/index.js';
|
|
9
|
+
// Template providers
|
|
10
|
+
export { getProviderCode, generateOpenAIProvider, generateAnthropicProvider, generateOllamaProvider, generateMockProvider, } from './templates/providers/index.js';
|
|
11
|
+
// Template shared types (LLM stubs)
|
|
12
|
+
export { LLM_CORE_TYPES, LLM_SIMPLE_TYPES, LLM_MOCK_PROVIDER, LLM_MOCK_PROVIDER_WITH_TOOLS, } from './templates/shared/llm-types.js';
|
|
13
|
+
// AI agent config schema (reused by durable variants)
|
|
14
|
+
export { aiConfigSchema } from './templates/workflows/ai-agent.js';
|
|
15
|
+
// Init persona registration
|
|
16
|
+
export { registerPackUseCase } from './commands/init-personas.js';
|
|
17
|
+
// Compile target execution
|
|
18
|
+
export { compileCustomTarget } from './commands/compile.js';
|
|
19
|
+
// Logger
|
|
20
|
+
export { logger } from './utils/logger.js';
|
|
21
|
+
// Error utilities
|
|
22
|
+
export { getErrorMessage, wrapError } from '../utils/error-utils.js';
|
|
23
|
+
//# sourceMappingURL=exports.js.map
|