@synergenius/flow-weaver 0.8.1 → 0.8.2

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/cli/index.js CHANGED
@@ -29,6 +29,7 @@ import { openapiCommand } from './commands/openapi.js';
29
29
  import { pluginInitCommand } from './commands/plugin.js';
30
30
  import { migrateCommand } from './commands/migrate.js';
31
31
  import { changelogCommand } from './commands/changelog.js';
32
+ import { stripCommand } from './commands/strip.js';
32
33
  import { docsListCommand, docsReadCommand, docsSearchCommand } from './commands/docs.js';
33
34
  import { marketInitCommand, marketPackCommand, marketPublishCommand, marketInstallCommand, marketSearchCommand, marketListCommand, } from './commands/market.js';
34
35
  import { logger } from './utils/logger.js';
@@ -79,6 +80,22 @@ program
79
80
  process.exit(1);
80
81
  }
81
82
  });
83
+ // Strip command
84
+ program
85
+ .command('strip <input>')
86
+ .description('Remove generated code from compiled workflow files')
87
+ .option('-o, --output <path>', 'Output directory (default: in-place)')
88
+ .option('--dry-run', 'Preview without writing', false)
89
+ .option('--verbose', 'Verbose output', false)
90
+ .action(async (input, options) => {
91
+ try {
92
+ await stripCommand(input, options);
93
+ }
94
+ catch (error) {
95
+ logger.error(`Command failed: ${getErrorMessage(error)}`);
96
+ process.exit(1);
97
+ }
98
+ });
82
99
  // Describe command
83
100
  program
84
101
  .command('describe <input>')
package/dist/parser.js CHANGED
@@ -2033,7 +2033,7 @@ export class AnnotationParser {
2033
2033
  if (missingLines.length === 0)
2034
2034
  return null;
2035
2035
  // Find the insertion point: just before the closing */
2036
- const lines = content.split('\n');
2036
+ const lines = content.split(/\r?\n/);
2037
2037
  let jsDocEndLine = -1;
2038
2038
  for (let i = fnStartLine - 1; i >= 0; i--) {
2039
2039
  if (lines[i].includes('*/')) {
@@ -2051,7 +2051,7 @@ export class AnnotationParser {
2051
2051
  };
2052
2052
  }
2053
2053
  // No @flowWeaver JSDoc — check if user just typed "/**" on the cursor line
2054
- const lines = content.split('\n');
2054
+ const lines = content.split(/\r?\n/);
2055
2055
  const cursorLineText = lines[cursorLine] || '';
2056
2056
  if (/^\s*\/\*\*\s*$/.test(cursorLineText)) {
2057
2057
  // User typed "/**" — generate only the continuation lines after it
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: CLI Reference
3
3
  description: Complete reference for all Flow Weaver CLI commands, flags, and options
4
- keywords: [cli, commands, compile, validate, run, watch, dev, serve, export, diagram, diff, doctor, init, migrate, marketplace, plugin, grammar, changelog, openapi, pattern, create, templates]
4
+ keywords: [cli, commands, compile, validate, strip, run, watch, dev, serve, export, diagram, diff, doctor, init, migrate, marketplace, plugin, grammar, changelog, openapi, pattern, create, templates]
5
5
  ---
6
6
 
7
7
  # CLI Reference
@@ -14,6 +14,7 @@ Complete reference for all `flow-weaver` CLI commands.
14
14
  |---------|-------------|
15
15
  | `compile` | Compile workflow files to TypeScript |
16
16
  | `validate` | Validate without compiling |
17
+ | `strip` | Remove generated code from compiled files |
17
18
  | `describe` | Output workflow structure (JSON/text/mermaid) |
18
19
  | `run` | Execute a workflow directly |
19
20
  | `watch` | Recompile on file changes |
@@ -108,6 +109,29 @@ flow-weaver validate workflow.ts --json --strict
108
109
 
109
110
  ---
110
111
 
112
+ ### strip
113
+
114
+ Remove generated code from compiled workflow files. Deletes the runtime section and replaces each workflow body with a `throw new Error('Not implemented')` placeholder. Useful for committing clean source files to version control.
115
+
116
+ ```bash
117
+ flow-weaver strip <input> [options]
118
+ ```
119
+
120
+ | Flag | Description | Default |
121
+ |------|-------------|---------|
122
+ | `-o, --output <path>` | Output directory | in-place |
123
+ | `--dry-run` | Preview without writing | `false` |
124
+ | `--verbose` | Verbose output | `false` |
125
+
126
+ **Examples:**
127
+ ```bash
128
+ flow-weaver strip my-workflow.ts
129
+ flow-weaver strip '**/*.ts' --dry-run
130
+ flow-weaver strip my-workflow.ts -o cleaned/
131
+ ```
132
+
133
+ ---
134
+
111
135
  ### describe
112
136
 
113
137
  Output workflow structure in LLM-friendly formats.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synergenius/flow-weaver",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "Deterministic workflow compiler for AI agents. Compiles to standalone TypeScript, no runtime dependencies.",
5
5
  "private": false,
6
6
  "type": "module",