newo 2.0.6 → 3.0.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/README.md +146 -0
  3. package/dist/api.d.ts +17 -1
  4. package/dist/api.js +78 -0
  5. package/dist/cli/commands/create-agent.d.ts +3 -0
  6. package/dist/cli/commands/create-agent.js +75 -0
  7. package/dist/cli/commands/create-attribute.d.ts +3 -0
  8. package/dist/cli/commands/create-attribute.js +63 -0
  9. package/dist/cli/commands/create-event.d.ts +3 -0
  10. package/dist/cli/commands/create-event.js +66 -0
  11. package/dist/cli/commands/create-flow.d.ts +3 -0
  12. package/dist/cli/commands/create-flow.js +100 -0
  13. package/dist/cli/commands/create-parameter.d.ts +3 -0
  14. package/dist/cli/commands/create-parameter.js +47 -0
  15. package/dist/cli/commands/create-persona.d.ts +3 -0
  16. package/dist/cli/commands/create-persona.js +43 -0
  17. package/dist/cli/commands/create-project.d.ts +3 -0
  18. package/dist/cli/commands/create-project.js +55 -0
  19. package/dist/cli/commands/create-skill.d.ts +3 -0
  20. package/dist/cli/commands/create-skill.js +115 -0
  21. package/dist/cli/commands/create-state.d.ts +3 -0
  22. package/dist/cli/commands/create-state.js +58 -0
  23. package/dist/cli/commands/delete-agent.d.ts +3 -0
  24. package/dist/cli/commands/delete-agent.js +70 -0
  25. package/dist/cli/commands/delete-flow.d.ts +3 -0
  26. package/dist/cli/commands/delete-flow.js +83 -0
  27. package/dist/cli/commands/delete-skill.d.ts +3 -0
  28. package/dist/cli/commands/delete-skill.js +87 -0
  29. package/dist/cli/commands/help.js +104 -22
  30. package/dist/cli/commands/push.js +4 -3
  31. package/dist/cli.js +48 -0
  32. package/dist/sync/push.d.ts +1 -1
  33. package/dist/sync/push.js +372 -4
  34. package/dist/sync/status.js +178 -1
  35. package/dist/types.d.ts +100 -1
  36. package/package.json +1 -1
  37. package/src/api.ts +118 -1
  38. package/src/cli/commands/create-agent.ts +96 -0
  39. package/src/cli/commands/create-attribute.ts +75 -0
  40. package/src/cli/commands/create-event.ts +79 -0
  41. package/src/cli/commands/create-flow.ts +124 -0
  42. package/src/cli/commands/create-parameter.ts +59 -0
  43. package/src/cli/commands/create-persona.ts +54 -0
  44. package/src/cli/commands/create-project.ts +66 -0
  45. package/src/cli/commands/create-skill.ts +144 -0
  46. package/src/cli/commands/create-state.ts +71 -0
  47. package/src/cli/commands/delete-agent.ts +90 -0
  48. package/src/cli/commands/delete-flow.ts +105 -0
  49. package/src/cli/commands/delete-skill.ts +110 -0
  50. package/src/cli/commands/help.ts +104 -22
  51. package/src/cli/commands/push.ts +5 -3
  52. package/src/cli.ts +60 -0
  53. package/src/sync/push.ts +413 -5
  54. package/src/sync/status.ts +183 -1
  55. package/src/types.ts +122 -2
@@ -4,47 +4,129 @@
4
4
 
5
5
  export function handleHelpCommand(): void {
6
6
  console.log(`NEWO CLI - Multi-Customer Support
7
- Usage:
8
- newo pull [--customer <idn>] # download projects -> ./newo_customers/<idn>/projects/
9
- newo push [--customer <idn>] # upload modified *.guidance/*.jinja back to NEWO
10
- newo status [--customer <idn>] # show modified files
7
+ A professional command-line tool for NEWO AI Agent development with modular architecture and comprehensive multi-customer support.
8
+
9
+ Core Commands:
10
+ newo pull [--customer <idn>] # download projects + attributes -> ./newo_customers/<idn>/
11
+ newo push [--customer <idn>] [--no-publish] # upload modified *.guidance/*.jinja + attributes back to NEWO, publish flows by default
12
+ newo status [--customer <idn>] # show modified files that would be pushed
11
13
  newo conversations [--customer <idn>] [--all] # download user conversations -> ./newo_customers/<idn>/conversations.yaml
12
- newo list-customers # list available customers
13
- newo meta [--customer <idn>] # get project metadata (debug)
14
- newo import-akb <file> <persona_id> [--customer <idn>] # import AKB articles from file
14
+ newo pull-attributes [--customer <idn>] # download customer attributes -> ./newo_customers/<idn>/attributes.yaml
15
+ newo list-customers # list available customers and their configuration
16
+ newo meta [--customer <idn>] # get project metadata (debug command)
17
+ newo import-akb <file> <persona_id> [--customer <idn>] # import AKB articles from structured text file
18
+
19
+ Project Management:
20
+ newo create-project <idn> [--title <title>] [--description <desc>] [--version <version>] [--auto-update] # create project on platform ✅
21
+
22
+ Entity Management (Full Lifecycle Support):
23
+ newo create-agent <idn> --project <project-idn> [--title <title>] [--description <desc>] # create agent → push to platform ✅
24
+ newo delete-agent <agent-idn> --project <project-idn> [--confirm] # delete agent locally (requires --confirm)
25
+ newo create-flow <idn> --agent <agent-idn> --project <project-idn> [--title <title>] [--description <desc>] [--runner <guidance|nsl>] # create flow → push to platform ✅
26
+ newo delete-flow <flow-idn> --agent <agent-idn> --project <project-idn> [--confirm] # delete flow locally (requires --confirm)
27
+ newo create-skill <idn> --flow <flow-idn> --agent <agent-idn> --project <project-idn> [--title <title>] [--script <content>] [--runner <guidance|nsl>] # create skill → push to platform ✅
28
+ newo delete-skill <skill-idn> --flow <flow-idn> --agent <agent-idn> --project <project-idn> [--confirm] # delete skill locally (requires --confirm)
29
+
30
+ Identity & Configuration:
31
+ newo create-persona <name> [--title <title>] [--description <desc>] # create agent persona ✅
32
+ newo create-attribute <idn> --value <value> [--title <title>] [--group <group>] [--value-type <string>] # create customer attribute ✅
33
+
34
+ Advanced Components (NSL Focus):
35
+ newo create-event <idn> --flow <flow-id> --skill <skill-idn> [--description <desc>] [--integration <api|system>] [--connector <webhook|system>] # create flow event ✅
36
+ newo create-state <idn> --flow <flow-id> [--title <title>] [--default-value <value>] [--scope <user|flow|global>] # create flow state ✅
37
+ newo create-parameter <name> --skill <skill-id> [--default-value <value>] # create skill parameter (API limitations)
38
+
39
+ Enterprise Features:
40
+ newo conversations [--customer <idn>] [--all] # download conversation history
41
+ newo pull-attributes [--customer <idn>] # sync customer attributes
42
+ newo import-akb <file> <persona_id> # import knowledge base articles
15
43
 
16
44
  Flags:
17
45
  --customer <idn> # specify customer (if not set, uses default or interactive selection)
18
46
  --all # include all available data (for conversations: all personas and acts)
19
47
  --force, -f # force overwrite without prompting (for pull command)
20
- --verbose, -v # enable detailed logging
48
+ --verbose, -v # enable detailed logging and progress information
49
+ --confirm # confirm destructive operations without prompting
50
+ --no-publish # skip automatic flow publishing during push operations
21
51
 
22
52
  Environment Variables:
23
53
  NEWO_BASE_URL # NEWO API base URL (default: https://app.newo.ai)
24
- NEWO_CUSTOMER_<IDN>_API_KEY # API key for customer <IDN>
54
+
55
+ Single Customer:
56
+ NEWO_API_KEY # API key for single customer setup
57
+ NEWO_PROJECT_ID # Optional: specific project ID
58
+
59
+ Multi-Customer:
60
+ NEWO_API_KEYS # JSON array of API keys or key+project objects
61
+ NEWO_CUSTOMER_<IDN>_API_KEY # API key for specific customer <IDN>
25
62
  NEWO_CUSTOMER_<IDN>_PROJECT_ID # Optional: specific project ID for customer
26
63
  NEWO_DEFAULT_CUSTOMER # Optional: default customer to use
27
64
 
28
- Multi-Customer Examples:
29
- # Configure customers in .env:
30
- NEWO_CUSTOMER_acme_API_KEY=your_acme_api_key
31
- NEWO_CUSTOMER_globex_API_KEY=your_globex_api_key
65
+ Configuration Examples:
66
+ # Single customer setup:
67
+ NEWO_API_KEY=your_api_key_here
68
+
69
+ # Multi-customer JSON array:
70
+ NEWO_API_KEYS=["key1", "key2", "key3"]
71
+
72
+ # Multi-customer with project IDs:
73
+ NEWO_API_KEYS=[{"key":"key1","project_id":"uuid1"}, {"key":"key2"}]
74
+
75
+ # Multi-customer individual variables:
76
+ NEWO_CUSTOMER_acme_API_KEY=acme_api_key_here
77
+ NEWO_CUSTOMER_globex_API_KEY=globex_api_key_here
32
78
  NEWO_DEFAULT_CUSTOMER=acme
33
79
 
34
- # Commands:
35
- newo pull # Pull from all customers (if no default set)
80
+ Usage Examples:
81
+ # Basic workflow:
82
+ newo pull # Download all projects and attributes
83
+ newo status # Check for local modifications
84
+ newo push # Upload changes back to NEWO
85
+
86
+ # Multi-customer operations:
36
87
  newo pull --customer acme # Pull projects for Acme only
37
- newo status # Status for all customers (if no default set)
38
- newo push # Interactive selection for multiple customers
39
88
  newo push --customer globex # Push changes for Globex only
89
+ newo conversations --all # Download all conversations with full history
90
+
91
+ # Complete weather system workflow (FULLY WORKING - NSL Focus):
92
+ newo create-project weather_system --title "Weather System" --description "Comprehensive weather service"
93
+ newo create-persona weather_persona --title "Weather Persona" --description "Professional weather assistant"
94
+ newo create-attribute weather_api_key --value "your_api_key" --group "Weather Config"
95
+ newo pull # Sync new project locally
96
+
97
+ newo create-agent WeatherBot --project weather_system --title "Weather Bot" --persona-id <persona-id>
98
+ newo create-flow MainFlow --agent WeatherBot --project weather_system --title "Main Flow" --runner nsl
99
+ newo push && newo pull # Creates agent + flow, syncs IDs
100
+
101
+ newo create-skill WeatherSkill --flow MainFlow --agent WeatherBot --project weather_system --title "Weather NSL Skill" --runner nsl
102
+ newo create-event user_message --flow <flow-id> --skill WeatherSkill --integration api --connector webhook
103
+ newo create-state user_location --flow <flow-id> --title "User Location" --scope user
104
+ newo create-state request_count --flow <flow-id> --title "Request Count" --scope flow
105
+ newo push # Creates complete system
106
+ newo status # Should show: Clean
107
+
108
+ # Import AKB articles:
109
+ newo import-akb articles.txt da4550db-2b95-4500-91ff-fb4b60fe7be9
40
110
 
41
111
  File Structure:
42
112
  newo_customers/
43
- ├── acme/
113
+ ├── <customer-idn>/
114
+ │ ├── attributes.yaml # Customer attributes (pull-attributes)
115
+ │ ├── conversations.yaml # User conversations and personas
44
116
  │ └── projects/
45
- │ └── project1/
46
- └── globex/
47
- └── projects/
48
- └── project2/
117
+ │ └── <project-idn>/
118
+ │ ├── flows.yaml # Auto-generated project structure
119
+ │ ├── metadata.yaml # Project metadata
120
+ └── <agent-idn>/
121
+ │ ├── metadata.yaml # Agent metadata
122
+ │ └── <flow-idn>/
123
+ │ ├── metadata.yaml # Flow metadata
124
+ │ └── <skill-idn>/
125
+ │ ├── skill.guidance # AI guidance scripts
126
+ │ ├── skill.jinja # NSL/Jinja template scripts
127
+ │ └── metadata.yaml # Skill metadata
128
+ └── .newo/ # CLI state and mappings (auto-generated)
129
+
130
+ For more information, visit: https://github.com/sabbah13/newo-cli
49
131
  `);
50
132
  }
@@ -17,11 +17,13 @@ export async function handlePushCommand(
17
17
  args.customer as string | undefined
18
18
  );
19
19
 
20
+ const shouldPublish = !args['no-publish'];
21
+
20
22
  if (selectedCustomer) {
21
23
  // Single customer push
22
24
  const accessToken = await getValidAccessToken(selectedCustomer);
23
25
  const client = await makeClient(verbose, accessToken);
24
- await pushChanged(client, selectedCustomer, verbose);
26
+ await pushChanged(client, selectedCustomer, verbose, shouldPublish);
25
27
  } else if (isMultiCustomer) {
26
28
  // Multiple customers exist with no default, ask user
27
29
  const customersToProcess = await interactiveCustomerSelection(allCustomers);
@@ -31,7 +33,7 @@ export async function handlePushCommand(
31
33
  const customer = customersToProcess[0]!;
32
34
  const accessToken = await getValidAccessToken(customer);
33
35
  const client = await makeClient(verbose, accessToken);
34
- await pushChanged(client, customer, verbose);
36
+ await pushChanged(client, customer, verbose, shouldPublish);
35
37
  } else {
36
38
  // Multi-customer push (user selected "All customers")
37
39
  console.log(`🔄 Pushing to ${customersToProcess.length} customers...`);
@@ -39,7 +41,7 @@ export async function handlePushCommand(
39
41
  console.log(`\n📤 Pushing for customer: ${customer.idn}`);
40
42
  const accessToken = await getValidAccessToken(customer);
41
43
  const client = await makeClient(verbose, accessToken);
42
- await pushChanged(client, customer, verbose);
44
+ await pushChanged(client, customer, verbose, shouldPublish);
43
45
  }
44
46
  console.log(`\n✅ Push completed for all ${customersToProcess.length} customers`);
45
47
  }
package/src/cli.ts CHANGED
@@ -16,6 +16,18 @@ import { handlePullAttributesCommand } from './cli/commands/pull-attributes.js';
16
16
  import { handleImportAkbCommand } from './cli/commands/import-akb.js';
17
17
  import { handleHelpCommand } from './cli/commands/help.js';
18
18
  import { handleListCustomersCommand } from './cli/commands/list-customers.js';
19
+ import { handleCreateAgentCommand } from './cli/commands/create-agent.js';
20
+ import { handleDeleteAgentCommand } from './cli/commands/delete-agent.js';
21
+ import { handleCreateFlowCommand } from './cli/commands/create-flow.js';
22
+ import { handleDeleteFlowCommand } from './cli/commands/delete-flow.js';
23
+ import { handleCreateSkillCommand } from './cli/commands/create-skill.js';
24
+ import { handleDeleteSkillCommand } from './cli/commands/delete-skill.js';
25
+ import { handleCreateProjectCommand } from './cli/commands/create-project.js';
26
+ import { handleCreateEventCommand } from './cli/commands/create-event.js';
27
+ import { handleCreateStateCommand } from './cli/commands/create-state.js';
28
+ import { handleCreateParameterCommand } from './cli/commands/create-parameter.js';
29
+ import { handleCreatePersonaCommand } from './cli/commands/create-persona.js';
30
+ import { handleCreateAttributeCommand } from './cli/commands/create-attribute.js';
19
31
  import type { CliArgs, NewoApiError } from './types.js';
20
32
 
21
33
  dotenv.config();
@@ -87,6 +99,54 @@ async function main(): Promise<void> {
87
99
  await handleImportAkbCommand(customerConfig, args, verbose);
88
100
  break;
89
101
 
102
+ case 'create-agent':
103
+ await handleCreateAgentCommand(customerConfig, args, verbose);
104
+ break;
105
+
106
+ case 'delete-agent':
107
+ await handleDeleteAgentCommand(customerConfig, args, verbose);
108
+ break;
109
+
110
+ case 'create-flow':
111
+ await handleCreateFlowCommand(customerConfig, args, verbose);
112
+ break;
113
+
114
+ case 'delete-flow':
115
+ await handleDeleteFlowCommand(customerConfig, args, verbose);
116
+ break;
117
+
118
+ case 'create-skill':
119
+ await handleCreateSkillCommand(customerConfig, args, verbose);
120
+ break;
121
+
122
+ case 'delete-skill':
123
+ await handleDeleteSkillCommand(customerConfig, args, verbose);
124
+ break;
125
+
126
+ case 'create-project':
127
+ await handleCreateProjectCommand(customerConfig, args, verbose);
128
+ break;
129
+
130
+ case 'create-event':
131
+ await handleCreateEventCommand(customerConfig, args, verbose);
132
+ break;
133
+
134
+ case 'create-state':
135
+ await handleCreateStateCommand(customerConfig, args, verbose);
136
+ break;
137
+
138
+ case 'create-parameter':
139
+ await handleCreateParameterCommand(customerConfig, args, verbose);
140
+ break;
141
+
142
+ case 'create-persona':
143
+ await handleCreatePersonaCommand(customerConfig, args, verbose);
144
+ break;
145
+
146
+ case 'create-attribute':
147
+ await handleCreateAttributeCommand(customerConfig, args, verbose);
148
+ break;
149
+
90
150
  default:
91
151
  console.error('Unknown command:', cmd);
92
152
  console.error('Run "newo --help" for usage information');