motia 0.6.3-beta.128 → 0.6.3-beta.130-601955

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/cjs/cli.js CHANGED
@@ -1,15 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
3
  Object.defineProperty(exports, "__esModule", { value: true });
7
4
  /* eslint-disable @typescript-eslint/no-require-imports */
8
5
  const commander_1 = require("commander");
9
6
  require("./cloud");
10
7
  const version_1 = require("./version");
11
8
  const config_utils_1 = require("./cloud/config-utils");
12
- const inquirer_1 = __importDefault(require("inquirer"));
13
9
  const defaultPort = 3000;
14
10
  const defaultHost = '0.0.0.0';
15
11
  require('dotenv/config');
@@ -28,44 +24,10 @@ commander_1.program
28
24
  .command('create')
29
25
  .description('Create a new motia project')
30
26
  .option('-n, --name <project name>', 'The name for your project, used to create a directory, use ./ or . to create it under the existing directory')
31
- .option('-t, --template <template name>', 'The motia template name to use for your project', 'typescript')
32
- .option('-c, --cursor', 'Copy .cursor folder from template')
33
- .option('-i, --interactive', 'Use interactive prompts to create project')
34
- .option('-y, --skip-confirmation', 'Skip confirmation prompt')
35
- .option('-d, --skip-tutorial [value]', 'Skip the motia tutorial (true/false)')
27
+ .option('-i, --interactive', 'Use interactive prompts to create project') // it's default
36
28
  .action((0, config_utils_1.handler)(async (arg, context) => {
37
- if (arg.name || arg.template || arg.cursor) {
38
- const { create } = require('./create');
39
- // Handle skip-tutorial option: 'true', 'false', or prompt user
40
- const skipTutorialValue = await (async () => {
41
- const skipValue = String(arg.skipTutorial).toLowerCase();
42
- if (skipValue === 'true')
43
- return true;
44
- if (skipValue === 'false')
45
- return false;
46
- // Prompt user when not explicitly set
47
- const { disableTutorial } = await inquirer_1.default.prompt({
48
- type: 'confirm',
49
- name: 'disableTutorial',
50
- message: 'Do you wish to disable the motia tutorial?',
51
- default: false,
52
- });
53
- return disableTutorial;
54
- })();
55
- await create({
56
- projectName: arg.name ?? '.',
57
- template: arg.template,
58
- cursorEnabled: arg.cursor,
59
- context,
60
- skipTutorialTemplates: skipTutorialValue,
61
- });
62
- }
63
- else {
64
- const skipConfirmation = arg.skipConfirmation ?? false;
65
- const { createInteractive } = require('./create/interactive');
66
- await createInteractive({ skipConfirmation }, context);
67
- }
68
- process.exit(0);
29
+ const { createInteractive } = require('./create/interactive');
30
+ await createInteractive({ name: arg.name }, context);
69
31
  }));
70
32
  commander_1.program
71
33
  .command('generate-types')
@@ -75,13 +37,6 @@ commander_1.program
75
37
  await generateTypes(process.cwd());
76
38
  process.exit(0);
77
39
  });
78
- commander_1.program
79
- .command('templates')
80
- .description('Prints the list of available templates')
81
- .action(async () => {
82
- const { templates } = require('./create/templates');
83
- console.log(`šŸ“ Available templates: \n\n ${Object.keys(templates).join('\n')}`);
84
- });
85
40
  commander_1.program
86
41
  .command('install')
87
42
  .description('Sets up Python virtual environment and install dependencies')
@@ -1,6 +1,6 @@
1
1
  import { CliContext } from '../cloud/config-utils';
2
2
  interface CreateInteractiveArgs {
3
- skipConfirmation?: boolean;
3
+ name?: string;
4
4
  }
5
- export declare const createInteractive: (_args: CreateInteractiveArgs, context: CliContext) => Promise<void>;
5
+ export declare const createInteractive: (args: CreateInteractiveArgs, context: CliContext) => Promise<void>;
6
6
  export {};
@@ -11,9 +11,9 @@ const choices = {
11
11
  typescript: 'Base (TypeScript)',
12
12
  python: 'Base (Python)',
13
13
  };
14
- const createInteractive = async (_args, context) => {
14
+ const createInteractive = async (args, context) => {
15
15
  context.log('welcome', (message) => message.append('\nšŸš€ ' + colors_1.default.bold('Welcome to Motia Project Creator!')));
16
- const answers = await inquirer_1.default.prompt([
16
+ const questions = [
17
17
  {
18
18
  type: 'list',
19
19
  name: 'template',
@@ -23,7 +23,9 @@ const createInteractive = async (_args, context) => {
23
23
  value: key,
24
24
  })),
25
25
  },
26
- {
26
+ ];
27
+ if (!args.name) {
28
+ questions.push({
27
29
  type: 'input',
28
30
  name: 'projectName',
29
31
  message: '2. Project name (leave blank to use current folder):',
@@ -36,21 +38,22 @@ const createInteractive = async (_args, context) => {
36
38
  return true;
37
39
  },
38
40
  filter: (input) => input.trim(),
39
- },
40
- {
41
- type: 'confirm',
42
- name: 'proceed',
43
- message: '3. Proceed? [Y/n]:',
44
- default: true,
45
- },
46
- ]);
41
+ });
42
+ }
43
+ questions.push({
44
+ type: 'confirm',
45
+ name: 'proceed',
46
+ message: '3. Proceed? [Y/n]:',
47
+ default: true,
48
+ });
49
+ const answers = await inquirer_1.default.prompt(questions);
47
50
  if (!answers.proceed) {
48
51
  context.log('cancelled', (message) => message.tag('info').append('\nāŒ Project creation cancelled.'));
49
52
  return;
50
53
  }
51
54
  context.log('creating', (message) => message.append('\nšŸ”Ø Creating your Motia project...\n'));
52
55
  await (0, index_1.create)({
53
- projectName: answers.projectName || '.',
56
+ projectName: args.name || answers.projectName || '.',
54
57
  template: answers.template,
55
58
  cursorEnabled: true, // Default to true for cursor rules
56
59
  context,
package/dist/cjs/dev.js CHANGED
@@ -59,7 +59,7 @@ const dev = async (port, hostname, disableVerbose, enableMermaid) => {
59
59
  (0, endpoints_1.deployEndpoints)(motiaServer, lockedData);
60
60
  motiaServer.server.listen(port, hostname);
61
61
  console.log('šŸš€ Server ready and listening on port', port);
62
- console.log(`šŸ”— Open http://${hostname}:${port}/ to open workbench šŸ› ļø`);
62
+ console.log(`šŸ”— Open http://localhost:${port} to open workbench šŸ› ļø`);
63
63
  (0, core_1.trackEvent)('dev_server_ready', {
64
64
  port,
65
65
  flows_count: lockedData.flows?.length || 0,
package/dist/esm/cli.js CHANGED
@@ -4,7 +4,6 @@ import { program } from 'commander';
4
4
  import './cloud';
5
5
  import { version } from './version';
6
6
  import { handler } from './cloud/config-utils';
7
- import inquirer from 'inquirer';
8
7
  const defaultPort = 3000;
9
8
  const defaultHost = '0.0.0.0';
10
9
  require('dotenv/config');
@@ -23,44 +22,10 @@ program
23
22
  .command('create')
24
23
  .description('Create a new motia project')
25
24
  .option('-n, --name <project name>', 'The name for your project, used to create a directory, use ./ or . to create it under the existing directory')
26
- .option('-t, --template <template name>', 'The motia template name to use for your project', 'typescript')
27
- .option('-c, --cursor', 'Copy .cursor folder from template')
28
- .option('-i, --interactive', 'Use interactive prompts to create project')
29
- .option('-y, --skip-confirmation', 'Skip confirmation prompt')
30
- .option('-d, --skip-tutorial [value]', 'Skip the motia tutorial (true/false)')
25
+ .option('-i, --interactive', 'Use interactive prompts to create project') // it's default
31
26
  .action(handler(async (arg, context) => {
32
- if (arg.name || arg.template || arg.cursor) {
33
- const { create } = require('./create');
34
- // Handle skip-tutorial option: 'true', 'false', or prompt user
35
- const skipTutorialValue = await (async () => {
36
- const skipValue = String(arg.skipTutorial).toLowerCase();
37
- if (skipValue === 'true')
38
- return true;
39
- if (skipValue === 'false')
40
- return false;
41
- // Prompt user when not explicitly set
42
- const { disableTutorial } = await inquirer.prompt({
43
- type: 'confirm',
44
- name: 'disableTutorial',
45
- message: 'Do you wish to disable the motia tutorial?',
46
- default: false,
47
- });
48
- return disableTutorial;
49
- })();
50
- await create({
51
- projectName: arg.name ?? '.',
52
- template: arg.template,
53
- cursorEnabled: arg.cursor,
54
- context,
55
- skipTutorialTemplates: skipTutorialValue,
56
- });
57
- }
58
- else {
59
- const skipConfirmation = arg.skipConfirmation ?? false;
60
- const { createInteractive } = require('./create/interactive');
61
- await createInteractive({ skipConfirmation }, context);
62
- }
63
- process.exit(0);
27
+ const { createInteractive } = require('./create/interactive');
28
+ await createInteractive({ name: arg.name }, context);
64
29
  }));
65
30
  program
66
31
  .command('generate-types')
@@ -70,13 +35,6 @@ program
70
35
  await generateTypes(process.cwd());
71
36
  process.exit(0);
72
37
  });
73
- program
74
- .command('templates')
75
- .description('Prints the list of available templates')
76
- .action(async () => {
77
- const { templates } = require('./create/templates');
78
- console.log(`šŸ“ Available templates: \n\n ${Object.keys(templates).join('\n')}`);
79
- });
80
38
  program
81
39
  .command('install')
82
40
  .description('Sets up Python virtual environment and install dependencies')
@@ -1,6 +1,6 @@
1
1
  import { CliContext } from '../cloud/config-utils';
2
2
  interface CreateInteractiveArgs {
3
- skipConfirmation?: boolean;
3
+ name?: string;
4
4
  }
5
- export declare const createInteractive: (_args: CreateInteractiveArgs, context: CliContext) => Promise<void>;
5
+ export declare const createInteractive: (args: CreateInteractiveArgs, context: CliContext) => Promise<void>;
6
6
  export {};
@@ -5,9 +5,9 @@ const choices = {
5
5
  typescript: 'Base (TypeScript)',
6
6
  python: 'Base (Python)',
7
7
  };
8
- export const createInteractive = async (_args, context) => {
8
+ export const createInteractive = async (args, context) => {
9
9
  context.log('welcome', (message) => message.append('\nšŸš€ ' + colors.bold('Welcome to Motia Project Creator!')));
10
- const answers = await inquirer.prompt([
10
+ const questions = [
11
11
  {
12
12
  type: 'list',
13
13
  name: 'template',
@@ -17,7 +17,9 @@ export const createInteractive = async (_args, context) => {
17
17
  value: key,
18
18
  })),
19
19
  },
20
- {
20
+ ];
21
+ if (!args.name) {
22
+ questions.push({
21
23
  type: 'input',
22
24
  name: 'projectName',
23
25
  message: '2. Project name (leave blank to use current folder):',
@@ -30,21 +32,22 @@ export const createInteractive = async (_args, context) => {
30
32
  return true;
31
33
  },
32
34
  filter: (input) => input.trim(),
33
- },
34
- {
35
- type: 'confirm',
36
- name: 'proceed',
37
- message: '3. Proceed? [Y/n]:',
38
- default: true,
39
- },
40
- ]);
35
+ });
36
+ }
37
+ questions.push({
38
+ type: 'confirm',
39
+ name: 'proceed',
40
+ message: '3. Proceed? [Y/n]:',
41
+ default: true,
42
+ });
43
+ const answers = await inquirer.prompt(questions);
41
44
  if (!answers.proceed) {
42
45
  context.log('cancelled', (message) => message.tag('info').append('\nāŒ Project creation cancelled.'));
43
46
  return;
44
47
  }
45
48
  context.log('creating', (message) => message.append('\nšŸ”Ø Creating your Motia project...\n'));
46
49
  await create({
47
- projectName: answers.projectName || '.',
50
+ projectName: args.name || answers.projectName || '.',
48
51
  template: answers.template,
49
52
  cursorEnabled: true, // Default to true for cursor rules
50
53
  context,
package/dist/esm/dev.js CHANGED
@@ -53,7 +53,7 @@ export const dev = async (port, hostname, disableVerbose, enableMermaid) => {
53
53
  deployEndpoints(motiaServer, lockedData);
54
54
  motiaServer.server.listen(port, hostname);
55
55
  console.log('šŸš€ Server ready and listening on port', port);
56
- console.log(`šŸ”— Open http://${hostname}:${port}/ to open workbench šŸ› ļø`);
56
+ console.log(`šŸ”— Open http://localhost:${port} to open workbench šŸ› ļø`);
57
57
  trackEvent('dev_server_ready', {
58
58
  port,
59
59
  flows_count: lockedData.flows?.length || 0,
@@ -1,6 +1,6 @@
1
1
  import { CliContext } from '../cloud/config-utils';
2
2
  interface CreateInteractiveArgs {
3
- skipConfirmation?: boolean;
3
+ name?: string;
4
4
  }
5
- export declare const createInteractive: (_args: CreateInteractiveArgs, context: CliContext) => Promise<void>;
5
+ export declare const createInteractive: (args: CreateInteractiveArgs, context: CliContext) => Promise<void>;
6
6
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "motia",
3
3
  "description": "A Modern Unified Backend Framework for APIs, Events and Agents",
4
- "version": "0.6.3-beta.128",
4
+ "version": "0.6.3-beta.130-601955",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -43,9 +43,9 @@
43
43
  "inquirer": "^8.2.5",
44
44
  "table": "^6.9.0",
45
45
  "ts-node": "^10.9.2",
46
- "@motiadev/stream-client-node": "0.6.3-beta.128",
47
- "@motiadev/core": "0.6.3-beta.128",
48
- "@motiadev/workbench": "0.6.3-beta.128"
46
+ "@motiadev/core": "0.6.3-beta.130-601955",
47
+ "@motiadev/workbench": "0.6.3-beta.130-601955",
48
+ "@motiadev/stream-client-node": "0.6.3-beta.130-601955"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@amplitude/analytics-types": "^2.9.2",