@walkeros/cli 3.0.2 → 4.0.0-next-1773967844643

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/dev.d.ts CHANGED
@@ -205,7 +205,6 @@ declare const SimulateInputShape: {
205
205
  web: "web";
206
206
  server: "server";
207
207
  }>>;
208
- example: z.ZodOptional<z.ZodString>;
209
208
  step: z.ZodOptional<z.ZodString>;
210
209
  };
211
210
  /**
@@ -222,7 +221,6 @@ declare const SimulateInputSchema: z.ZodObject<{
222
221
  web: "web";
223
222
  server: "server";
224
223
  }>>;
225
- example: z.ZodOptional<z.ZodString>;
226
224
  step: z.ZodOptional<z.ZodString>;
227
225
  }, z.core.$strip>;
228
226
  type SimulateInput = z.infer<typeof SimulateInputSchema>;
package/dist/dev.js CHANGED
@@ -69,7 +69,7 @@ var BundleOptionsSchema = z4.object({
69
69
  });
70
70
  var BundleInputShape = {
71
71
  configPath: FilePathSchema.describe(
72
- "Path to flow configuration file (JSON or JavaScript)"
72
+ "Path to flow configuration file (JSON or JavaScript), URL, or inline JSON string"
73
73
  ),
74
74
  flow: z4.string().optional().describe("Flow name for multi-flow configs"),
75
75
  stats: z4.boolean().optional().default(true).describe("Return bundle statistics"),
@@ -86,17 +86,16 @@ var SimulateOptionsSchema = z5.object({
86
86
  json: z5.boolean().optional().describe("Format output as JSON")
87
87
  });
88
88
  var SimulateInputShape = {
89
- configPath: FilePathSchema.describe("Path to flow configuration file"),
89
+ configPath: FilePathSchema.describe(
90
+ "Path to flow configuration file, URL, or inline JSON string"
91
+ ),
90
92
  event: z5.string().min(1).optional().describe(
91
- "Event as JSON string, file path, or URL. Optional when example is provided."
93
+ "Event as JSON string, file path, or URL. For sources: { content, trigger?, env? }."
92
94
  ),
93
95
  flow: z5.string().optional().describe("Flow name for multi-flow configs"),
94
96
  platform: PlatformSchema.optional().describe("Override platform detection"),
95
- example: z5.string().optional().describe(
96
- 'Name of a step example to use as event input (uses its "in" value)'
97
- ),
98
97
  step: z5.string().optional().describe(
99
- 'Step target in type.name format (e.g. "destination.gtag") to narrow example lookup'
98
+ 'Step target in type.name format (e.g. "source.browser", "destination.gtag")'
100
99
  )
101
100
  };
102
101
  var SimulateInputSchema = z5.object(SimulateInputShape);
package/dist/dev.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/schemas/index.ts","../src/schemas/primitives.ts","../src/schemas/run.ts","../src/schemas/validate.ts","../src/schemas/bundle.ts","../src/schemas/simulate.ts","../src/schemas/push.ts"],"sourcesContent":["/**\n * CLI Schemas\n *\n * Zod schemas for CLI parameter validation.\n * Follows walkerOS patterns from @walkeros/core.\n */\n\nexport { PortSchema, FilePathSchema } from './primitives';\n\nexport { RunOptionsSchema, type RunOptions } from './run';\n\nexport {\n ValidationTypeSchema,\n ValidateOptionsSchema,\n ValidateInputShape,\n ValidateInputSchema,\n type ValidationType,\n type ValidateOptions,\n type ValidateInput,\n} from './validate';\n\nexport {\n BundleOptionsSchema,\n BundleInputShape,\n BundleInputSchema,\n type BundleOptions,\n type BundleInput,\n} from './bundle';\n\nexport {\n PlatformSchema,\n SimulateOptionsSchema,\n SimulateInputShape,\n SimulateInputSchema,\n type Platform,\n type SimulateOptions,\n type SimulateInput,\n} from './simulate';\n\nexport {\n PushOptionsSchema,\n PushInputShape,\n PushInputSchema,\n type PushOptions,\n type PushInput,\n} from './push';\n","/**\n * CLI Primitive Schemas\n *\n * Basic Zod schemas for CLI parameter validation.\n * Follows walkerOS patterns from @walkeros/core.\n */\n\nimport { z } from '@walkeros/core/dev';\n\n/**\n * Port number schema.\n *\n * @remarks\n * Validates HTTP server port number.\n * Must be integer between 1-65535.\n */\nexport const PortSchema = z\n .number()\n .int('Port must be an integer')\n .min(1, 'Port must be at least 1')\n .max(65535, 'Port must be at most 65535')\n .describe('HTTP server port number');\n\n/**\n * File path schema.\n *\n * @remarks\n * Basic string validation for file paths.\n * File existence is checked separately (Zod can't check filesystem).\n */\nexport const FilePathSchema = z\n .string()\n .min(1, 'File path cannot be empty')\n .describe('Path to configuration file');\n","/**\n * Run Command Schemas\n *\n * Zod schemas for run command options validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { PortSchema, FilePathSchema } from './primitives';\n\n/**\n * Run command options schema.\n *\n * @remarks\n * Validates all options for the `walkeros run` command.\n */\nexport const RunOptionsSchema = z.object({\n flow: FilePathSchema,\n port: PortSchema.default(8080),\n flowName: z.string().optional().describe('Specific flow name to run'),\n});\n\nexport type RunOptions = z.infer<typeof RunOptionsSchema>;\n","/**\n * Validate Command Schemas\n *\n * Zod schemas for validate command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\n\n/**\n * Validation type schema.\n *\n * @remarks\n * Validates the type of validation to perform.\n * - `contract`: Validate a data contract\n * - `event`: Validate a walkerOS event object\n * - `flow`: Validate a flow configuration file\n * - `mapping`: Validate mapping rules\n */\nexport const ValidationTypeSchema = z\n .enum(['contract', 'event', 'flow', 'mapping'])\n .describe('Validation type: \"event\", \"flow\", \"mapping\", or \"contract\"');\n\nexport type ValidationType = z.infer<typeof ValidationTypeSchema>;\n\n/**\n * Validate options schema.\n *\n * @remarks\n * Options for the programmatic validate() API.\n */\nexport const ValidateOptionsSchema = z.object({\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n path: z\n .string()\n .optional()\n .describe(\n 'Entry path for package schema validation (e.g., \"destinations.snowplow\", \"sources.browser\")',\n ),\n});\n\nexport type ValidateOptions = z.infer<typeof ValidateOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const ValidateInputShape = {\n type: ValidationTypeSchema,\n input: z\n .string()\n .min(1)\n .describe('JSON string, file path, or URL to validate'),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n path: z\n .string()\n .optional()\n .describe(\n 'Entry path for package schema validation (e.g., \"destinations.snowplow\"). When provided, validates the entry against its package JSON Schema instead of using --type.',\n ),\n};\n\n/**\n * Validate input schema for MCP tools.\n *\n * @remarks\n * Full input schema including type and input source.\n */\nexport const ValidateInputSchema = z.object(ValidateInputShape);\n\nexport type ValidateInput = z.infer<typeof ValidateInputSchema>;\n","/**\n * Bundle Command Schemas\n *\n * Zod schemas for bundle command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { FilePathSchema } from './primitives';\n\n/**\n * Bundle options schema.\n *\n * @remarks\n * Options for the programmatic bundle() API.\n */\nexport const BundleOptionsSchema = z.object({\n silent: z.boolean().optional().describe('Suppress all output'),\n verbose: z.boolean().optional().describe('Enable verbose logging'),\n stats: z\n .boolean()\n .optional()\n .default(true)\n .describe('Return bundle statistics'),\n cache: z\n .boolean()\n .optional()\n .default(true)\n .describe('Enable package caching'),\n flowName: z.string().optional().describe('Flow name for multi-flow configs'),\n});\n\nexport type BundleOptions = z.infer<typeof BundleOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const BundleInputShape = {\n configPath: FilePathSchema.describe(\n 'Path to flow configuration file (JSON or JavaScript)',\n ),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n stats: z\n .boolean()\n .optional()\n .default(true)\n .describe('Return bundle statistics'),\n output: z\n .string()\n .optional()\n .describe('Output file path (defaults to config-defined)'),\n};\n\n/**\n * Bundle input schema for MCP tools.\n *\n * @remarks\n * Full input schema including config path and options.\n */\nexport const BundleInputSchema = z.object(BundleInputShape);\n\nexport type BundleInput = z.infer<typeof BundleInputSchema>;\n","/**\n * Simulate Command Schemas\n *\n * Zod schemas for simulate command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { FilePathSchema } from './primitives';\n\n/**\n * Platform schema.\n *\n * @remarks\n * Validates platform type for event simulation.\n */\nexport const PlatformSchema = z\n .enum(['web', 'server'])\n .describe('Platform type for event processing');\n\nexport type Platform = z.infer<typeof PlatformSchema>;\n\n/**\n * Simulate options schema.\n *\n * @remarks\n * Options for the programmatic simulate() API.\n */\nexport const SimulateOptionsSchema = z.object({\n silent: z.boolean().optional().describe('Suppress all output'),\n verbose: z.boolean().optional().describe('Enable verbose logging'),\n json: z.boolean().optional().describe('Format output as JSON'),\n});\n\nexport type SimulateOptions = z.infer<typeof SimulateOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const SimulateInputShape = {\n configPath: FilePathSchema.describe('Path to flow configuration file'),\n event: z\n .string()\n .min(1)\n .optional()\n .describe(\n 'Event as JSON string, file path, or URL. Optional when example is provided.',\n ),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n platform: PlatformSchema.optional().describe('Override platform detection'),\n example: z\n .string()\n .optional()\n .describe(\n 'Name of a step example to use as event input (uses its \"in\" value)',\n ),\n step: z\n .string()\n .optional()\n .describe(\n 'Step target in type.name format (e.g. \"destination.gtag\") to narrow example lookup',\n ),\n};\n\n/**\n * Simulate input schema for MCP tools.\n *\n * @remarks\n * Full input schema including config path, event, and options.\n */\nexport const SimulateInputSchema = z.object(SimulateInputShape);\n\nexport type SimulateInput = z.infer<typeof SimulateInputSchema>;\n","/**\n * Push Command Schemas\n *\n * Zod schemas for push command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { FilePathSchema } from './primitives';\nimport { PlatformSchema } from './simulate';\n\n/**\n * Push options schema.\n *\n * @remarks\n * Options for the programmatic push() API.\n */\nexport const PushOptionsSchema = z.object({\n silent: z.boolean().optional().describe('Suppress all output'),\n verbose: z.boolean().optional().describe('Enable verbose logging'),\n json: z.boolean().optional().describe('Format output as JSON'),\n});\n\nexport type PushOptions = z.infer<typeof PushOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const PushInputShape = {\n configPath: FilePathSchema.describe('Path to flow configuration file'),\n event: z.string().min(1).describe('Event as JSON string, file path, or URL'),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n platform: PlatformSchema.optional().describe('Override platform detection'),\n};\n\n/**\n * Push input schema for MCP tools.\n *\n * @remarks\n * Full input schema including config path, event, and options.\n */\nexport const PushInputSchema = z.object(PushInputShape);\n\nexport type PushInput = z.infer<typeof PushInputSchema>;\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOA,SAAS,SAAS;AASX,IAAM,aAAa,EACvB,OAAO,EACP,IAAI,yBAAyB,EAC7B,IAAI,GAAG,yBAAyB,EAChC,IAAI,OAAO,4BAA4B,EACvC,SAAS,yBAAyB;AAS9B,IAAM,iBAAiB,EAC3B,OAAO,EACP,IAAI,GAAG,2BAA2B,EAClC,SAAS,4BAA4B;;;AC3BxC,SAAS,KAAAA,UAAS;AASX,IAAM,mBAAmBC,GAAE,OAAO;AAAA,EACvC,MAAM;AAAA,EACN,MAAM,WAAW,QAAQ,IAAI;AAAA,EAC7B,UAAUA,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS,2BAA2B;AACtE,CAAC;;;ACbD,SAAS,KAAAC,UAAS;AAYX,IAAM,uBAAuBA,GACjC,KAAK,CAAC,YAAY,SAAS,QAAQ,SAAS,CAAC,EAC7C,SAAS,4DAA4D;AAUjE,IAAM,wBAAwBA,GAAE,OAAO;AAAA,EAC5C,MAAMA,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS,kCAAkC;AAAA,EACvE,MAAMA,GACH,OAAO,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","z","z","z"]}
1
+ {"version":3,"sources":["../src/schemas/index.ts","../src/schemas/primitives.ts","../src/schemas/run.ts","../src/schemas/validate.ts","../src/schemas/bundle.ts","../src/schemas/simulate.ts","../src/schemas/push.ts"],"sourcesContent":["/**\n * CLI Schemas\n *\n * Zod schemas for CLI parameter validation.\n * Follows walkerOS patterns from @walkeros/core.\n */\n\nexport { PortSchema, FilePathSchema } from './primitives';\n\nexport { RunOptionsSchema, type RunOptions } from './run';\n\nexport {\n ValidationTypeSchema,\n ValidateOptionsSchema,\n ValidateInputShape,\n ValidateInputSchema,\n type ValidationType,\n type ValidateOptions,\n type ValidateInput,\n} from './validate';\n\nexport {\n BundleOptionsSchema,\n BundleInputShape,\n BundleInputSchema,\n type BundleOptions,\n type BundleInput,\n} from './bundle';\n\nexport {\n PlatformSchema,\n SimulateOptionsSchema,\n SimulateInputShape,\n SimulateInputSchema,\n type Platform,\n type SimulateOptions,\n type SimulateInput,\n} from './simulate';\n\nexport {\n PushOptionsSchema,\n PushInputShape,\n PushInputSchema,\n type PushOptions,\n type PushInput,\n} from './push';\n","/**\n * CLI Primitive Schemas\n *\n * Basic Zod schemas for CLI parameter validation.\n * Follows walkerOS patterns from @walkeros/core.\n */\n\nimport { z } from '@walkeros/core/dev';\n\n/**\n * Port number schema.\n *\n * @remarks\n * Validates HTTP server port number.\n * Must be integer between 1-65535.\n */\nexport const PortSchema = z\n .number()\n .int('Port must be an integer')\n .min(1, 'Port must be at least 1')\n .max(65535, 'Port must be at most 65535')\n .describe('HTTP server port number');\n\n/**\n * File path schema.\n *\n * @remarks\n * Basic string validation for file paths.\n * File existence is checked separately (Zod can't check filesystem).\n */\nexport const FilePathSchema = z\n .string()\n .min(1, 'File path cannot be empty')\n .describe('Path to configuration file');\n","/**\n * Run Command Schemas\n *\n * Zod schemas for run command options validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { PortSchema, FilePathSchema } from './primitives';\n\n/**\n * Run command options schema.\n *\n * @remarks\n * Validates all options for the `walkeros run` command.\n */\nexport const RunOptionsSchema = z.object({\n flow: FilePathSchema,\n port: PortSchema.default(8080),\n flowName: z.string().optional().describe('Specific flow name to run'),\n});\n\nexport type RunOptions = z.infer<typeof RunOptionsSchema>;\n","/**\n * Validate Command Schemas\n *\n * Zod schemas for validate command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\n\n/**\n * Validation type schema.\n *\n * @remarks\n * Validates the type of validation to perform.\n * - `contract`: Validate a data contract\n * - `event`: Validate a walkerOS event object\n * - `flow`: Validate a flow configuration file\n * - `mapping`: Validate mapping rules\n */\nexport const ValidationTypeSchema = z\n .enum(['contract', 'event', 'flow', 'mapping'])\n .describe('Validation type: \"event\", \"flow\", \"mapping\", or \"contract\"');\n\nexport type ValidationType = z.infer<typeof ValidationTypeSchema>;\n\n/**\n * Validate options schema.\n *\n * @remarks\n * Options for the programmatic validate() API.\n */\nexport const ValidateOptionsSchema = z.object({\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n path: z\n .string()\n .optional()\n .describe(\n 'Entry path for package schema validation (e.g., \"destinations.snowplow\", \"sources.browser\")',\n ),\n});\n\nexport type ValidateOptions = z.infer<typeof ValidateOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const ValidateInputShape = {\n type: ValidationTypeSchema,\n input: z\n .string()\n .min(1)\n .describe('JSON string, file path, or URL to validate'),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n path: z\n .string()\n .optional()\n .describe(\n 'Entry path for package schema validation (e.g., \"destinations.snowplow\"). When provided, validates the entry against its package JSON Schema instead of using --type.',\n ),\n};\n\n/**\n * Validate input schema for MCP tools.\n *\n * @remarks\n * Full input schema including type and input source.\n */\nexport const ValidateInputSchema = z.object(ValidateInputShape);\n\nexport type ValidateInput = z.infer<typeof ValidateInputSchema>;\n","/**\n * Bundle Command Schemas\n *\n * Zod schemas for bundle command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { FilePathSchema } from './primitives';\n\n/**\n * Bundle options schema.\n *\n * @remarks\n * Options for the programmatic bundle() API.\n */\nexport const BundleOptionsSchema = z.object({\n silent: z.boolean().optional().describe('Suppress all output'),\n verbose: z.boolean().optional().describe('Enable verbose logging'),\n stats: z\n .boolean()\n .optional()\n .default(true)\n .describe('Return bundle statistics'),\n cache: z\n .boolean()\n .optional()\n .default(true)\n .describe('Enable package caching'),\n flowName: z.string().optional().describe('Flow name for multi-flow configs'),\n});\n\nexport type BundleOptions = z.infer<typeof BundleOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const BundleInputShape = {\n configPath: FilePathSchema.describe(\n 'Path to flow configuration file (JSON or JavaScript), URL, or inline JSON string',\n ),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n stats: z\n .boolean()\n .optional()\n .default(true)\n .describe('Return bundle statistics'),\n output: z\n .string()\n .optional()\n .describe('Output file path (defaults to config-defined)'),\n};\n\n/**\n * Bundle input schema for MCP tools.\n *\n * @remarks\n * Full input schema including config path and options.\n */\nexport const BundleInputSchema = z.object(BundleInputShape);\n\nexport type BundleInput = z.infer<typeof BundleInputSchema>;\n","/**\n * Simulate Command Schemas\n *\n * Zod schemas for simulate command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { FilePathSchema } from './primitives';\n\n/**\n * Platform schema.\n *\n * @remarks\n * Validates platform type for event simulation.\n */\nexport const PlatformSchema = z\n .enum(['web', 'server'])\n .describe('Platform type for event processing');\n\nexport type Platform = z.infer<typeof PlatformSchema>;\n\n/**\n * Simulate options schema.\n *\n * @remarks\n * Options for the programmatic simulate() API.\n */\nexport const SimulateOptionsSchema = z.object({\n silent: z.boolean().optional().describe('Suppress all output'),\n verbose: z.boolean().optional().describe('Enable verbose logging'),\n json: z.boolean().optional().describe('Format output as JSON'),\n});\n\nexport type SimulateOptions = z.infer<typeof SimulateOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const SimulateInputShape = {\n configPath: FilePathSchema.describe(\n 'Path to flow configuration file, URL, or inline JSON string',\n ),\n event: z\n .string()\n .min(1)\n .optional()\n .describe(\n 'Event as JSON string, file path, or URL. For sources: { content, trigger?, env? }.',\n ),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n platform: PlatformSchema.optional().describe('Override platform detection'),\n step: z\n .string()\n .optional()\n .describe(\n 'Step target in type.name format (e.g. \"source.browser\", \"destination.gtag\")',\n ),\n};\n\n/**\n * Simulate input schema for MCP tools.\n *\n * @remarks\n * Full input schema including config path, event, and options.\n */\nexport const SimulateInputSchema = z.object(SimulateInputShape);\n\nexport type SimulateInput = z.infer<typeof SimulateInputSchema>;\n","/**\n * Push Command Schemas\n *\n * Zod schemas for push command parameter validation.\n */\n\nimport { z } from '@walkeros/core/dev';\nimport { FilePathSchema } from './primitives';\nimport { PlatformSchema } from './simulate';\n\n/**\n * Push options schema.\n *\n * @remarks\n * Options for the programmatic push() API.\n */\nexport const PushOptionsSchema = z.object({\n silent: z.boolean().optional().describe('Suppress all output'),\n verbose: z.boolean().optional().describe('Enable verbose logging'),\n json: z.boolean().optional().describe('Format output as JSON'),\n});\n\nexport type PushOptions = z.infer<typeof PushOptionsSchema>;\n\n/**\n * Raw shape for MCP SDK compatibility (ZodRawShapeCompat).\n *\n * @remarks\n * MCP SDK's registerTool expects raw shapes (Record<string, ZodType>)\n * rather than ZodObject instances. Define shape first, then wrap.\n */\nexport const PushInputShape = {\n configPath: FilePathSchema.describe('Path to flow configuration file'),\n event: z.string().min(1).describe('Event as JSON string, file path, or URL'),\n flow: z.string().optional().describe('Flow name for multi-flow configs'),\n platform: PlatformSchema.optional().describe('Override platform detection'),\n};\n\n/**\n * Push input schema for MCP tools.\n *\n * @remarks\n * Full input schema including config path, event, and options.\n */\nexport const PushInputSchema = z.object(PushInputShape);\n\nexport type PushInput = z.infer<typeof PushInputSchema>;\n"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOA,SAAS,SAAS;AASX,IAAM,aAAa,EACvB,OAAO,EACP,IAAI,yBAAyB,EAC7B,IAAI,GAAG,yBAAyB,EAChC,IAAI,OAAO,4BAA4B,EACvC,SAAS,yBAAyB;AAS9B,IAAM,iBAAiB,EAC3B,OAAO,EACP,IAAI,GAAG,2BAA2B,EAClC,SAAS,4BAA4B;;;AC3BxC,SAAS,KAAAA,UAAS;AASX,IAAM,mBAAmBC,GAAE,OAAO;AAAA,EACvC,MAAM;AAAA,EACN,MAAM,WAAW,QAAQ,IAAI;AAAA,EAC7B,UAAUA,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS,2BAA2B;AACtE,CAAC;;;ACbD,SAAS,KAAAC,UAAS;AAYX,IAAM,uBAAuBA,GACjC,KAAK,CAAC,YAAY,SAAS,QAAQ,SAAS,CAAC,EAC7C,SAAS,4DAA4D;AAUjE,IAAM,wBAAwBA,GAAE,OAAO;AAAA,EAC5C,MAAMA,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS,kCAAkC;AAAA,EACvE,MAAMA,GACH,OAAO,EACP,SAAS,EACT;AAAA,IACC;AAAA,EACF;AACJ,CAAC;AAWM,IAAM,qBAAqB;AAAA,EAChC,MAAM;AAAA,EACN,OAAOA,GACJ,OAAO,EACP,IAAI,CAAC,EACL,SAAS,4CAA4C;AAAA,EACxD,MAAMA,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS,kCA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WM,IAAM,qBAAqB;AAAA,EAChC,YAAY,eAAe;AAAA,IACzB;AAAA,EACF;AAAA,EACA,OAAOA,GACJ,OAAO,EACP,IAAI,CAAC,EACL,SAAS,EACT;AAAA,IACC;AAAA,EACF;AAAA,EACF,MAAMA,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS,kCAAkC;AAAA,EACvE,UAAU,eAAe,SAAS,EAAE,SAAS,6BAA6B;AAAA,EAC1E,MAAMA,GACH,OAAO,EACP,SAAS,EACT;AAAA,IACC;AAAA,EACF;AACJ;AAQO,IAAM,sBAAsBA,GAAE,OAAO,kBAAkB;;;AC/D9D,SAAS,KAAAC,UAAS;AAUX,IAAM,oBAAoBC,GAAE,OAAO;AAAA,EACxC,QAAQA,GAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,qBAAqB;AAAA,EAC7D,SAASA,GAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,wBAAwB;AAAA,EACjE,MAAMA,GAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,uBAAuB;AAC/D,CAAC;AAWM,IAAM,iBAAiB;AAAA,EAC5B,YAAY,eAAe,SAAS,iCAAiC;AAAA,EACrE,OAAOA,GAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,yCAAyC;AAAA,EAC3E,MAAMA,GAAE,OAAO,EAAE,SAAS,EAAE,SAAS,kCAAkC;AAAA,EACvE,UAAU,eAAe,SAAS,EAAE,SAAS,6BAA6B;AAC5E;AAQO,IAAM,kBAAkBA,GAAE,OAAO,cAAc;","names":["z","z","z","z","z","z","z","z","z"]}
package/dist/index.d.ts CHANGED
@@ -234,17 +234,8 @@ interface SimulateCommandOptions {
234
234
  verbose?: boolean;
235
235
  silent?: boolean;
236
236
  platform?: 'web' | 'server';
237
- example?: string;
238
237
  step?: string;
239
238
  }
240
- interface ExampleMatch {
241
- name: string;
242
- step: string;
243
- expected: unknown;
244
- actual: unknown;
245
- match: boolean;
246
- diff?: string;
247
- }
248
239
  interface SimulationResult {
249
240
  success: boolean;
250
241
  error?: string;
@@ -253,7 +244,6 @@ interface SimulationResult {
253
244
  logs?: unknown[];
254
245
  usage?: Record<string, ApiCall[]>;
255
246
  duration?: number;
256
- exampleMatch?: ExampleMatch;
257
247
  /** Events captured by source simulation */
258
248
  capturedEvents?: WalkerOS.DeepPartialEvent[];
259
249
  }
@@ -298,13 +288,28 @@ type Platform = 'web' | 'server';
298
288
 
299
289
  declare function getToken(): string | undefined;
300
290
  declare function getAuthHeaders(): Record<string, string>;
291
+ declare function requireProjectId(): string;
292
+
301
293
  /**
302
- * Fetch with deploy token priority for heartbeat calls.
303
- * Priority: WALKEROS_DEPLOY_TOKEN > WALKEROS_TOKEN > config file
294
+ * Merge a bearer token into a headers object.
295
+ * Shared by apiFetch, deployFetch, and runtime callers that manage their own tokens.
304
296
  */
305
- declare function deployAuthenticatedFetch(url: string, init?: RequestInit): Promise<Response>;
306
- declare function resolveBaseUrl(): string;
307
- declare function requireProjectId(): string;
297
+ declare function mergeAuthHeaders(token: string | null | undefined, headers?: HeadersInit): Record<string, string>;
298
+ /**
299
+ * Authenticated fetch — resolves base URL + adds auth token.
300
+ * Use for all API calls that require WALKEROS_TOKEN.
301
+ */
302
+ declare function apiFetch(path: string, init?: RequestInit): Promise<Response>;
303
+ /**
304
+ * Unauthenticated fetch — resolves base URL, no auth.
305
+ * Use for public endpoints (login device flow, feedback).
306
+ */
307
+ declare function publicFetch(path: string, init?: RequestInit): Promise<Response>;
308
+ /**
309
+ * Deploy-authenticated fetch — uses deploy token with fallback to user token.
310
+ * Use for runtime operations (heartbeat, config polling, secrets).
311
+ */
312
+ declare function deployFetch(path: string, init?: RequestInit): Promise<Response>;
308
313
 
309
314
  interface SSEEvent {
310
315
  type: string;
@@ -358,41 +363,12 @@ declare function simulateCommand(options: SimulateCommandOptions): Promise<void>
358
363
  /**
359
364
  * High-level simulate function for programmatic usage.
360
365
  *
361
- * Handles configuration loading internally and returns structured results.
362
- *
363
- * @param configOrPath - Bundle configuration object or path to config file
364
- * @param event - Event object to simulate
365
- * @param options - Simulation options
366
- * @param options.silent - Suppress all output (default: false)
367
- * @param options.verbose - Enable verbose logging (default: false)
368
- * @param options.json - Format output as JSON (default: false)
369
- * @returns Simulation result with success status, elb result, and usage data
370
- *
371
- * @example
372
- * ```typescript
373
- * // With config file
374
- * const result = await simulate('./walker.config.json', {
375
- * name: 'page view',
376
- * data: { title: 'Home Page', path: '/', url: 'https://example.com' }
377
- * });
378
- *
379
- * // With config object
380
- * const result = await simulate(
381
- * {
382
- * platform: 'web',
383
- * packages: { '@walkeros/collector': { imports: ['startFlow'] } },
384
- * code: '...',
385
- * output: './bundle.js'
386
- * },
387
- * { name: 'page view' },
388
- * { silent: true }
389
- * );
390
- * ```
366
+ * For destinations/transformers: event is a walkerOS event { name, data }.
367
+ * For sources (--step source.*): event is a SourceInput { content, trigger?, env? }.
391
368
  */
392
369
  declare function simulate(configOrPath: string | unknown, event: unknown, options?: SimulateOptions & {
393
370
  flow?: string;
394
371
  platform?: Platform$1;
395
- example?: string;
396
372
  step?: string;
397
373
  }): Promise<SimulationResult>;
398
374
 
@@ -486,6 +462,8 @@ interface RunCommandOptions {
486
462
  flow?: string;
487
463
  /** API flow ID (enables heartbeat, polling, secrets) */
488
464
  flowId?: string;
465
+ /** Deployment ID (for heartbeat tracking) */
466
+ deploymentId?: string;
489
467
  /** Project ID */
490
468
  project?: string;
491
469
  /** Enable JSON output */
@@ -951,6 +929,7 @@ declare function createDeployCommand(config: string | undefined, options: Deploy
951
929
 
952
930
  interface FeedbackOptions {
953
931
  anonymous?: boolean;
932
+ version?: string;
954
933
  }
955
934
  declare function feedback(text: string, options?: FeedbackOptions): Promise<void>;
956
935
  declare function feedbackCommand(text: string): Promise<void>;
@@ -5097,6 +5076,24 @@ interface components {
5097
5076
 
5098
5077
  declare function createApiClient(): openapi_fetch.Client<paths, `${string}/${string}`>;
5099
5078
 
5079
+ interface ApiErrorDetail {
5080
+ path: string;
5081
+ message: string;
5082
+ }
5083
+ declare class ApiError extends Error {
5084
+ code?: string;
5085
+ details?: ApiErrorDetail[];
5086
+ constructor(message: string, options?: {
5087
+ code?: string;
5088
+ details?: ApiErrorDetail[];
5089
+ });
5090
+ }
5091
+ /**
5092
+ * Extract structured error from an openapi-fetch error response and throw.
5093
+ * The error shape is: { error: { code, message, details: { errors: [] } } }
5094
+ */
5095
+ declare function throwApiError(error: unknown, fallbackMessage: string): never;
5096
+
5100
5097
  interface WalkerOSConfig {
5101
5098
  token: string;
5102
5099
  email: string;
@@ -5113,10 +5110,15 @@ declare function readConfig(): WalkerOSConfig | null;
5113
5110
  declare function writeConfig(config: WalkerOSConfig): void;
5114
5111
 
5115
5112
  /**
5116
- * Load and parse JSON configuration file from local path or URL.
5113
+ * Load and parse JSON configuration from a file path, URL, or inline JSON string.
5117
5114
  *
5118
- * @param configPath - Path to JSON file or HTTP/HTTPS URL
5119
- * @returns Parsed configuration object and cleanup function
5115
+ * Detection priority:
5116
+ * 1. URL (http://, https://) — download and parse
5117
+ * 2. Existing file path — read and parse
5118
+ * 3. Inline JSON string (starting with { or [) — parse directly
5119
+ *
5120
+ * @param configPath - Path to JSON file, HTTP/HTTPS URL, or inline JSON string
5121
+ * @returns Parsed configuration object
5120
5122
  * @throws Error if file not found, download fails, or invalid JSON
5121
5123
  *
5122
5124
  * @example
@@ -5126,8 +5128,11 @@ declare function writeConfig(config: WalkerOSConfig): void;
5126
5128
  *
5127
5129
  * // Remote URL
5128
5130
  * const config = await loadJsonConfig('https://example.com/config.json')
5131
+ *
5132
+ * // Inline JSON
5133
+ * const config = await loadJsonConfig('{"version":3,"flows":{}}')
5129
5134
  * ```
5130
5135
  */
5131
5136
  declare function loadJsonConfig<T>(configPath: string): Promise<T>;
5132
5137
 
5133
- export { type BuildOptions, type BundleStats, type CLIBuildOptions, type DeployOptions, type ExampleLookupResult, type ExampleMatch, type FeedbackOptions, type GlobalOptions, type ListDeploymentsOptions, type ListFlowsOptions, type MinifyOptions, type PushResult, type RunCommandOptions, type RunOptions, type RunResult, type SSEEvent, type SSEParseResult, type SimulationResult, type ValidateResult, type ValidationError, type ValidationType, type ValidationWarning, type WalkerOSConfig, bundle, bundleCommand, bundleRemote, compareOutput, createApiClient, createDeployCommand, createDeployment, createDeploymentCommand, createFlow, createFlowCommand, createProject, createProjectCommand, deleteDeployment, deleteDeploymentCommand, deleteFlow, deleteFlowCommand, deleteProject, deleteProjectCommand, deploy, deployAuthenticatedFetch, deployCommand, duplicateFlow, duplicateFlowCommand, feedback, feedbackCommand, findExample, getAuthHeaders, getDeployment, getDeploymentBySlug, getDeploymentBySlugCommand, getDeploymentCommand, getFlow, getFlowCommand, getProject, getProjectCommand, getToken, listDeployments, listDeploymentsCommand, listFlows, listFlowsCommand, listProjects, listProjectsCommand, loadJsonConfig, loginCommand, logoutCommand, parseSSEEvents, push, pushCommand, readConfig, requireProjectId, resolveBaseUrl, run, runCommand, simulate, simulateCommand, updateFlow, updateFlowCommand, updateProject, updateProjectCommand, validate, validateCommand, whoami, whoamiCommand, writeConfig };
5138
+ export { ApiError, type ApiErrorDetail, type BuildOptions, type BundleStats, type CLIBuildOptions, type DeployOptions, type ExampleLookupResult, type FeedbackOptions, type GlobalOptions, type ListDeploymentsOptions, type ListFlowsOptions, type MinifyOptions, type PushResult, type RunCommandOptions, type RunOptions, type RunResult, type SSEEvent, type SSEParseResult, type SimulationResult, type ValidateResult, type ValidationError, type ValidationType, type ValidationWarning, type WalkerOSConfig, apiFetch, bundle, bundleCommand, bundleRemote, compareOutput, createApiClient, createDeployCommand, createDeployment, createDeploymentCommand, createFlow, createFlowCommand, createProject, createProjectCommand, deleteDeployment, deleteDeploymentCommand, deleteFlow, deleteFlowCommand, deleteProject, deleteProjectCommand, deploy, deployCommand, deployFetch, duplicateFlow, duplicateFlowCommand, feedback, feedbackCommand, findExample, getAuthHeaders, getDeployment, getDeploymentBySlug, getDeploymentBySlugCommand, getDeploymentCommand, getFlow, getFlowCommand, getProject, getProjectCommand, getToken, listDeployments, listDeploymentsCommand, listFlows, listFlowsCommand, listProjects, listProjectsCommand, loadJsonConfig, loginCommand, logoutCommand, mergeAuthHeaders, parseSSEEvents, publicFetch, push, pushCommand, readConfig, requireProjectId, run, runCommand, simulate, simulateCommand, throwApiError, updateFlow, updateFlowCommand, updateProject, updateProjectCommand, validate, validateCommand, whoami, whoamiCommand, writeConfig };