newo 3.1.0 → 3.3.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 (63) hide show
  1. package/CHANGELOG.md +223 -1
  2. package/dist/api.d.ts +44 -1
  3. package/dist/api.js +91 -0
  4. package/dist/cli/commands/create-webhooks.d.ts +3 -0
  5. package/dist/cli/commands/create-webhooks.js +83 -0
  6. package/dist/cli/commands/help.js +25 -1
  7. package/dist/cli/commands/list-actions.d.ts +3 -0
  8. package/dist/cli/commands/list-actions.js +89 -0
  9. package/dist/cli/commands/migrate-account.d.ts +3 -0
  10. package/dist/cli/commands/migrate-account.js +84 -0
  11. package/dist/cli/commands/profile.d.ts +3 -0
  12. package/dist/cli/commands/profile.js +62 -0
  13. package/dist/cli/commands/pull-akb.d.ts +3 -0
  14. package/dist/cli/commands/pull-akb.js +19 -0
  15. package/dist/cli/commands/pull-attributes.js +7 -0
  16. package/dist/cli/commands/pull-integrations.d.ts +3 -0
  17. package/dist/cli/commands/pull-integrations.js +19 -0
  18. package/dist/cli/commands/push-akb.d.ts +3 -0
  19. package/dist/cli/commands/push-akb.js +19 -0
  20. package/dist/cli/commands/push-integrations.d.ts +3 -0
  21. package/dist/cli/commands/push-integrations.js +19 -0
  22. package/dist/cli/commands/verify-migration.d.ts +3 -0
  23. package/dist/cli/commands/verify-migration.js +68 -0
  24. package/dist/cli.js +37 -0
  25. package/dist/sync/akb.d.ts +14 -0
  26. package/dist/sync/akb.js +175 -0
  27. package/dist/sync/attributes.d.ts +19 -0
  28. package/dist/sync/attributes.js +221 -2
  29. package/dist/sync/integrations.d.ts +23 -0
  30. package/dist/sync/integrations.js +340 -0
  31. package/dist/sync/migrate.d.ts +32 -0
  32. package/dist/sync/migrate.js +590 -0
  33. package/dist/sync/projects.js +171 -1
  34. package/dist/sync/push.js +15 -0
  35. package/dist/sync/skill-files.js +1 -1
  36. package/dist/sync/status.js +4 -2
  37. package/dist/sync.d.ts +1 -0
  38. package/dist/sync.js +1 -0
  39. package/dist/types.d.ts +143 -1
  40. package/package.json +15 -3
  41. package/src/api.ts +188 -1
  42. package/src/cli/commands/create-webhooks.ts +100 -0
  43. package/src/cli/commands/help.ts +25 -1
  44. package/src/cli/commands/list-actions.ts +112 -0
  45. package/src/cli/commands/migrate-account.ts +104 -0
  46. package/src/cli/commands/profile.ts +79 -0
  47. package/src/cli/commands/pull-akb.ts +27 -0
  48. package/src/cli/commands/pull-attributes.ts +8 -0
  49. package/src/cli/commands/pull-integrations.ts +27 -0
  50. package/src/cli/commands/push-akb.ts +27 -0
  51. package/src/cli/commands/push-integrations.ts +27 -0
  52. package/src/cli/commands/verify-migration.ts +88 -0
  53. package/src/cli.ts +46 -0
  54. package/src/sync/akb.ts +205 -0
  55. package/src/sync/attributes.ts +269 -2
  56. package/src/sync/integrations.ts +403 -0
  57. package/src/sync/migrate.ts +746 -0
  58. package/src/sync/projects.ts +207 -1
  59. package/src/sync/push.ts +17 -0
  60. package/src/sync/skill-files.ts +1 -1
  61. package/src/sync/status.ts +4 -2
  62. package/src/sync.ts +1 -0
  63. package/src/types.ts +165 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,226 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.3.0] - 2025-10-20
11
+
12
+ ### Added
13
+
14
+ - **Account Migration System**: Fully automated account copying from source to destination
15
+ - `newo migrate-account` - Complete migration command with progress tracking
16
+ - Automatic webhook creation from YAML configuration files
17
+ - API mapping built from live API queries to prevent content loss
18
+ - Comprehensive migration includes all entities: projects, agents, flows, skills, attributes, AKB, integrations, connectors, webhooks
19
+ - Interactive confirmation with multi-stage progress indicators
20
+ - **Migration Verification**: Compare entity counts between source and destination accounts
21
+ - `newo verify` - Verification command showing detailed entity comparison
22
+ - Entity count validation for projects, agents, flows, and skills
23
+ - SHA256 checksum verification for file integrity
24
+ - Webhook existence verification
25
+ - **Webhook Creation**: Direct webhook creation from YAML files
26
+ - `newo create-webhooks` - Batch webhook creation command
27
+ - Support for both outgoing and incoming webhook types
28
+ - YAML-based configuration with automatic detection
29
+ - **Migration Module** (`src/sync/migrate.ts`):
30
+ - Complete migration orchestration logic
31
+ - API mapping generation from live queries
32
+ - Webhook creation automation
33
+ - Progress tracking and error handling
34
+ - **Enhanced API Functions**:
35
+ - `updateProject()` - Update project metadata on platform
36
+ - `updateAgent()` - Update agent metadata on platform
37
+ - `createOutgoingWebhook()` - Create outgoing webhooks via API
38
+ - `createIncomingWebhook()` - Create incoming webhooks via API
39
+
40
+ ### Enhanced
41
+
42
+ - **Pull Command**: Deletion detection for entities removed remotely
43
+ - Interactive confirmation before deleting local entities
44
+ - Confirmation options: y (yes), n (no), a (all), q (quit)
45
+ - Prevents accidental deletion of local work
46
+ - Graceful handling of remote entity removal
47
+ - **Status Command**: Full path display in error messages
48
+ - Complete paths shown: project/agent/flow/skill hierarchy
49
+ - Improved debugging with clear file location information
50
+ - **Type Definitions**: Extended for enhanced metadata support
51
+ - `Agent.persona` field for persona association
52
+ - `ProjectMeta` fields: `is_auto_update_enabled`, `registry_idn`, `display_idn`, `svc_catalog_slug`
53
+ - Enhanced event creation metadata: `skill_selector`, `interrupt_mode`, `skill_idn`, `connector_idn`
54
+ - **Help Command**: Updated documentation for migration commands
55
+ - Complete migration workflow documentation
56
+ - Verification command usage examples
57
+ - Webhook creation command reference
58
+
59
+ ### Fixed
60
+
61
+ - **Pull Command**: No longer overwrites local files with empty API content
62
+ - Protection against data loss from API errors
63
+ - Validation of API response before writing files
64
+ - Skip empty content writes with warning messages
65
+ - **Event Creation**: Full metadata preservation from source
66
+ - Event skill_selector properly copied
67
+ - Interrupt mode settings preserved
68
+ - Skill and connector IDN associations maintained
69
+ - **Migration Script**: Proper map.json generation from API
70
+ - Builds ID mappings directly from API queries
71
+ - No longer depends on pull command execution
72
+ - Ensures accurate entity relationships
73
+
74
+ ### Testing
75
+
76
+ - **Complete Account Migration**: Successfully migrated account with 1,084 skills
77
+ - Tested across 3 different test accounts
78
+ - 100% entity match validation (projects, agents, flows, skills)
79
+ - 100% file integrity verification (SHA256 checksums on attributes)
80
+ - 100% webhook creation success (all 5 webhooks verified)
81
+ - Migration time: ~30 minutes (vs 8-10 hours manual process)
82
+ - **Entity Count Verification**: Automated comparison validates all entity types
83
+ - **Webhook Creation**: Batch webhook creation from YAML files tested and verified
84
+
85
+ ### Performance
86
+
87
+ - **Migration Speed**: 96% time reduction compared to manual migration
88
+ - Automated process: ~30 minutes
89
+ - Manual process: 8-10 hours
90
+ - **Reliability**: 100% success rate across multiple test migrations
91
+ - **Data Integrity**: Full SHA256 verification ensures zero data loss
92
+
93
+ ## [3.2.0] - 2025-10-17
94
+
95
+ ### Added
96
+
97
+ - **Integration Management**: Complete integration and connector management system
98
+ - `newo pull-integrations` - Download all integrations, connectors, and webhooks to local YAML files
99
+ - `newo push-integrations` - Upload connector changes with full CRUD support (Create, Update, Delete)
100
+ - Combined integration files: `{integration_idn}.yaml` contains metadata + settings in single file
101
+ - Nested connector structure: Each connector in own subdirectory `connectors/{connector_idn}/{connector_idn}.yaml`
102
+ - Automatic webhook synchronization (outgoing + incoming webhooks)
103
+ - 15 integrations discovered and managed (api, sandbox, twilio, magic_browser, newo_chat, etc.)
104
+ - Full connector lifecycle: Create via YAML + push → Modify → Delete via YAML removal + push
105
+ - **AKB Knowledge Base Management**: Complete knowledge base synchronization
106
+ - `newo pull-akb` - Download AKB articles for all personas linked to agents
107
+ - `newo push-akb` - Upload AKB articles from local YAML files to platform
108
+ - YAML format matches backup structure exactly for compatibility
109
+ - Automatic persona-to-agent mapping via agent IDN
110
+ - Pagination support for large knowledge bases
111
+ - Articles stored in `akb/{agent_idn}.yaml` format
112
+ - **Project Attributes**: Full project-level attribute management
113
+ - Enhanced `newo pull-attributes` to pull both customer AND project attributes
114
+ - Project attributes saved to `projects/{project_idn}/attributes.yaml`
115
+ - Push integrated into main `newo push` command
116
+ - Automatic ID mapping for push operations
117
+ - Same YAML format as customer attributes with !enum tags
118
+ - Change detection and update mechanism
119
+ - **Developer Tools**: Reference and productivity features
120
+ - `newo list-actions` - List all 78 available NSL/Jinja script actions with categorization
121
+ - `newo profile` - Display customer profile information (organization, email, platform links)
122
+ - Action categorization into 12 groups (Gen, Get, Create, Delete, Update, etc.)
123
+ - Verbose mode shows complete parameter schemas for each action
124
+ - **API Integrations**: 17 new API endpoints
125
+ - Integration endpoints: GET integrations, connectors, settings
126
+ - Connector CRUD: POST, PUT, DELETE for connectors
127
+ - Webhook endpoints: GET outgoing/incoming webhooks
128
+ - AKB endpoints: GET personas, topics; POST import
129
+ - Project attribute endpoints: GET, PUT for project attributes
130
+ - Script actions endpoint: GET all NSL actions
131
+ - Customer profile endpoint: GET profile information
132
+ - **TypeScript Types**: 22 new interfaces for complete type safety
133
+ - Integration types: Integration, Connector, IntegrationSetting, CreateConnectorRequest, UpdateConnectorRequest
134
+ - Webhook types: OutgoingWebhook, IncomingWebhook
135
+ - AKB types: Persona, AkbTopic, AkbTopicItem, AkbYamlTopic
136
+ - Script action types: ScriptAction, ArgumentSchema
137
+ - Metadata types: IntegrationMetadata, ConnectorMetadata, IntegrationsYamlData
138
+
139
+ ### Changed
140
+
141
+ - **File Structure**: Enhanced directory hierarchy with new integration and AKB folders
142
+ - `newo_customers/{customer}/integrations/` - Integration configurations
143
+ - `newo_customers/{customer}/akb/` - AKB knowledge base articles
144
+ - `newo_customers/{customer}/projects/{project}/attributes.yaml` - Project attributes
145
+ - **Pull Attributes Command**: Now pulls both customer and project attributes in single command
146
+ - **Push Command**: Enhanced to push project attribute changes alongside skill changes
147
+ - **Help Documentation**: Comprehensive updates with all new commands and file structure
148
+ - **Integration Structure**: Nested connector directories with webhook subdirectories
149
+ - `integrations/{integration}/{integration}.yaml` - Combined metadata + settings
150
+ - `integrations/{integration}/connectors/{connector}/{connector}.yaml` - Connector config
151
+ - `integrations/{integration}/connectors/{connector}/webhooks/` - Webhook files
152
+
153
+ ### Technical Details
154
+
155
+ - **Modular Architecture**: 8 new modules created
156
+ - `src/sync/integrations.ts` (340+ lines) - Integration/connector/webhook sync
157
+ - `src/sync/akb.ts` (205 lines) - AKB knowledge base sync
158
+ - `src/cli/commands/pull-integrations.ts` - Integration pull handler
159
+ - `src/cli/commands/push-integrations.ts` - Integration push handler
160
+ - `src/cli/commands/pull-akb.ts` - AKB pull handler
161
+ - `src/cli/commands/push-akb.ts` - AKB push handler
162
+ - `src/cli/commands/list-actions.ts` - Script actions listing
163
+ - `src/cli/commands/profile.ts` - Profile viewer
164
+ - **Enhanced Modules**: 6 existing modules updated
165
+ - `src/types.ts` (+160 lines) - New type definitions
166
+ - `src/api.ts` (+110 lines) - New API functions
167
+ - `src/sync/attributes.ts` (+126 lines) - Project attribute support
168
+ - `src/sync/push.ts` (+15 lines) - Project attribute push integration
169
+ - `src/cli.ts` (+12 lines) - New command routing
170
+ - `src/cli/commands/help.ts` (+30 lines) - Documentation updates
171
+ - **Webhook Association**: Webhooks grouped by connector_idn and stored in connector subdirectories
172
+ - **Change Detection**: Smart comparison for connectors (title, status, settings)
173
+ - **Error Handling**: Graceful handling of missing settings endpoints (404 errors)
174
+ - **ID Mapping**: Separate JSON files for attribute ID mappings to enable push operations
175
+ - **YAML Parsing**: Custom !enum tag handling for AttributeValueTypes
176
+
177
+ ### Example Usage
178
+
179
+ ```bash
180
+ # Integration management
181
+ newo pull-integrations # Download all integrations + webhooks
182
+ newo push-integrations # Upload connector changes
183
+
184
+ # Knowledge base management
185
+ newo pull-akb # Download AKB for personas with agents
186
+ newo push-akb # Upload AKB articles
187
+
188
+ # Enhanced attributes
189
+ newo pull-attributes # Now pulls customer + project attributes
190
+ newo push # Now pushes project attributes too
191
+
192
+ # Developer tools
193
+ newo profile # View customer information
194
+ newo list-actions # Browse 78 NSL actions
195
+ newo list-actions --verbose # With parameter details
196
+ ```
197
+
198
+ ### Files Created
199
+
200
+ **Integration Structure:**
201
+ ```
202
+ newo_customers/{customer}/integrations/
203
+ ├── integrations.yaml
204
+ └── {integration_idn}/
205
+ ├── {integration_idn}.yaml # Combined metadata + settings
206
+ └── connectors/
207
+ └── {connector_idn}/
208
+ ├── {connector_idn}.yaml
209
+ └── webhooks/
210
+ ├── outgoing.yaml
211
+ └── incoming.yaml
212
+ ```
213
+
214
+ **AKB Structure:**
215
+ ```
216
+ newo_customers/{customer}/akb/
217
+ └── {agent_idn}.yaml # AKB articles per agent
218
+ ```
219
+
220
+ **Project Attributes:**
221
+ ```
222
+ newo_customers/{customer}/projects/{project}/
223
+ └── attributes.yaml # Project-specific attributes
224
+ ```
225
+
226
+ ### Breaking Changes
227
+
228
+ None. All changes are additive and backward compatible.
229
+
10
230
  ## [3.1.0] - 2025-10-15
11
231
 
12
232
  ### Added
@@ -698,7 +918,9 @@ Another Item: $Price [Modifiers: modifier3]
698
918
  - GitHub Actions CI/CD integration
699
919
  - Robust authentication with token refresh
700
920
 
701
- [Unreleased]: https://github.com/sabbah13/newo-cli/compare/v3.1.0...HEAD
921
+ [Unreleased]: https://github.com/sabbah13/newo-cli/compare/v3.3.0...HEAD
922
+ [3.3.0]: https://github.com/sabbah13/newo-cli/compare/v3.2.0...v3.3.0
923
+ [3.2.0]: https://github.com/sabbah13/newo-cli/compare/v3.1.0...v3.2.0
702
924
  [3.1.0]: https://github.com/sabbah13/newo-cli/compare/v3.0.0...v3.1.0
703
925
  [3.0.0]: https://github.com/sabbah13/newo-cli/compare/v2.0.6...v3.0.0
704
926
  [2.0.6]: https://github.com/sabbah13/newo-cli/compare/v2.0.5...v2.0.6
package/dist/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type AxiosInstance } from 'axios';
2
- import type { ProjectMeta, Agent, Skill, FlowEvent, FlowState, AkbImportArticle, CustomerProfile, CustomerAttribute, CustomerAttributesResponse, UserPersonaResponse, UserPersona, ChatHistoryParams, ChatHistoryResponse, CreateAgentRequest, CreateAgentResponse, CreateFlowRequest, CreateFlowResponse, CreateSkillRequest, CreateSkillResponse, CreateFlowEventRequest, CreateFlowEventResponse, CreateFlowStateRequest, CreateFlowStateResponse, CreateSkillParameterRequest, CreateSkillParameterResponse, CreateCustomerAttributeRequest, CreateCustomerAttributeResponse, CreatePersonaRequest, CreatePersonaResponse, CreateProjectRequest, CreateProjectResponse, PublishFlowRequest, PublishFlowResponse, Integration, Connector, CreateSandboxPersonaRequest, CreateSandboxPersonaResponse, CreateActorRequest, CreateActorResponse, SendChatMessageRequest, ConversationActsParams, ConversationActsResponse } from './types.js';
2
+ import type { ProjectMeta, Agent, Skill, FlowEvent, FlowState, AkbImportArticle, CustomerProfile, CustomerAttribute, CustomerAttributesResponse, UserPersonaResponse, UserPersona, ChatHistoryParams, ChatHistoryResponse, CreateAgentRequest, CreateAgentResponse, CreateFlowRequest, CreateFlowResponse, CreateSkillRequest, CreateSkillResponse, CreateFlowEventRequest, CreateFlowEventResponse, CreateFlowStateRequest, CreateFlowStateResponse, CreateSkillParameterRequest, CreateSkillParameterResponse, CreateCustomerAttributeRequest, CreateCustomerAttributeResponse, CreatePersonaRequest, CreatePersonaResponse, CreateProjectRequest, CreateProjectResponse, PublishFlowRequest, PublishFlowResponse, Integration, Connector, CreateSandboxPersonaRequest, CreateSandboxPersonaResponse, CreateActorRequest, CreateActorResponse, SendChatMessageRequest, ConversationActsParams, ConversationActsResponse, ScriptAction, IntegrationSetting, CreateConnectorRequest, CreateConnectorResponse, UpdateConnectorRequest, OutgoingWebhook, IncomingWebhook, PersonaSearchResponse, AkbTopicsResponse } from './types.js';
3
3
  export declare function makeClient(verbose?: boolean, token?: string): Promise<AxiosInstance>;
4
4
  export declare function listProjects(client: AxiosInstance): Promise<ProjectMeta[]>;
5
5
  export declare function listAgents(client: AxiosInstance, projectId: string): Promise<Agent[]>;
@@ -13,6 +13,10 @@ export declare function importAkbArticle(client: AxiosInstance, articleData: Akb
13
13
  export declare function getCustomerProfile(client: AxiosInstance): Promise<CustomerProfile>;
14
14
  export declare function getCustomerAttributes(client: AxiosInstance, includeHidden?: boolean): Promise<CustomerAttributesResponse>;
15
15
  export declare function updateCustomerAttribute(client: AxiosInstance, attribute: CustomerAttribute): Promise<void>;
16
+ export declare function getProjectAttributes(client: AxiosInstance, projectId: string, includeHidden?: boolean): Promise<CustomerAttributesResponse>;
17
+ export declare function updateProjectAttribute(client: AxiosInstance, projectId: string, attribute: CustomerAttribute): Promise<void>;
18
+ export declare function createProjectAttribute(client: AxiosInstance, projectId: string, attributeData: CreateCustomerAttributeRequest): Promise<CreateCustomerAttributeResponse>;
19
+ export declare function deleteProjectAttribute(client: AxiosInstance, projectId: string, attributeId: string): Promise<void>;
16
20
  export declare function listUserPersonas(client: AxiosInstance, page?: number, per?: number): Promise<UserPersonaResponse>;
17
21
  export declare function getUserPersona(client: AxiosInstance, personaId: string): Promise<UserPersona>;
18
22
  export declare function getAccount(client: AxiosInstance): Promise<{
@@ -42,4 +46,43 @@ export declare function createSandboxPersona(client: AxiosInstance, personaData:
42
46
  export declare function createActor(client: AxiosInstance, personaId: string, actorData: CreateActorRequest): Promise<CreateActorResponse>;
43
47
  export declare function sendChatMessage(client: AxiosInstance, actorId: string, messageData: SendChatMessageRequest): Promise<void>;
44
48
  export declare function getConversationActs(client: AxiosInstance, params: ConversationActsParams): Promise<ConversationActsResponse>;
49
+ export declare function getScriptActions(client: AxiosInstance): Promise<ScriptAction[]>;
50
+ export declare function getIntegrationSettings(client: AxiosInstance, integrationId: string): Promise<IntegrationSetting[]>;
51
+ export declare function createConnector(client: AxiosInstance, integrationId: string, connectorData: CreateConnectorRequest): Promise<CreateConnectorResponse>;
52
+ export declare function updateConnector(client: AxiosInstance, connectorId: string, updateData: UpdateConnectorRequest): Promise<void>;
53
+ export declare function deleteConnector(client: AxiosInstance, connectorId: string): Promise<void>;
54
+ export declare function listOutgoingWebhooks(client: AxiosInstance): Promise<OutgoingWebhook[]>;
55
+ export declare function listIncomingWebhooks(client: AxiosInstance): Promise<IncomingWebhook[]>;
56
+ export declare function searchPersonas(client: AxiosInstance, isLinkedToAgent?: boolean, page?: number, per?: number): Promise<PersonaSearchResponse>;
57
+ export declare function getAkbTopics(client: AxiosInstance, personaId: string, page?: number, per?: number, orderBy?: string): Promise<AkbTopicsResponse>;
58
+ export declare function updateProject(client: AxiosInstance, projectId: string, updateData: Partial<{
59
+ title: string;
60
+ description: string;
61
+ is_auto_update_enabled: boolean;
62
+ registry_idn: string;
63
+ registry_item_idn: string | null;
64
+ registry_item_version: string | null;
65
+ }>): Promise<void>;
66
+ export declare function updateAgent(client: AxiosInstance, agentId: string, updateData: Partial<{
67
+ title: string;
68
+ description: string;
69
+ persona_id: string | null;
70
+ }>): Promise<void>;
71
+ export declare function createOutgoingWebhook(client: AxiosInstance, webhookData: {
72
+ connector_idn: string;
73
+ event_idn: string;
74
+ url: string;
75
+ method: string;
76
+ headers?: Record<string, string>;
77
+ body_template?: string;
78
+ }): Promise<{
79
+ id: string;
80
+ }>;
81
+ export declare function createIncomingWebhook(client: AxiosInstance, webhookData: {
82
+ connector_idn: string;
83
+ event_idn: string;
84
+ }): Promise<{
85
+ id: string;
86
+ url: string;
87
+ }>;
45
88
  //# sourceMappingURL=api.d.ts.map
package/dist/api.js CHANGED
@@ -121,6 +121,37 @@ export async function updateCustomerAttribute(client, attribute) {
121
121
  value_type: attribute.value_type
122
122
  });
123
123
  }
124
+ export async function getProjectAttributes(client, projectId, includeHidden = false) {
125
+ const response = await client.get(`/api/v1/bff/projects/${projectId}/attributes`, {
126
+ params: {
127
+ query: '',
128
+ include_hidden: includeHidden
129
+ }
130
+ });
131
+ return response.data;
132
+ }
133
+ export async function updateProjectAttribute(client, projectId, attribute) {
134
+ if (!attribute.id) {
135
+ throw new Error(`Project attribute ${attribute.idn} is missing ID - cannot update`);
136
+ }
137
+ await client.put(`/api/v1/designer/projects/${projectId}/attributes/${attribute.id}`, {
138
+ idn: attribute.idn,
139
+ value: attribute.value,
140
+ title: attribute.title,
141
+ description: attribute.description,
142
+ group: attribute.group,
143
+ is_hidden: attribute.is_hidden,
144
+ possible_values: attribute.possible_values,
145
+ value_type: attribute.value_type
146
+ });
147
+ }
148
+ export async function createProjectAttribute(client, projectId, attributeData) {
149
+ const response = await client.post(`/api/v1/designer/projects/${projectId}/attributes`, attributeData);
150
+ return response.data;
151
+ }
152
+ export async function deleteProjectAttribute(client, projectId, attributeId) {
153
+ await client.delete(`/api/v1/designer/projects/${projectId}/attributes/${attributeId}`);
154
+ }
124
155
  // Conversation API Functions
125
156
  export async function listUserPersonas(client, page = 1, per = 50) {
126
157
  const response = await client.get('/api/v1/bff/conversations/user-personas', {
@@ -265,4 +296,64 @@ export async function getConversationActs(client, params) {
265
296
  });
266
297
  return response.data;
267
298
  }
299
+ // Script Actions API Functions
300
+ export async function getScriptActions(client) {
301
+ const response = await client.get('/api/v1/script/actions');
302
+ return response.data;
303
+ }
304
+ // Integration API Functions
305
+ export async function getIntegrationSettings(client, integrationId) {
306
+ const response = await client.get(`/api/v1/integrations/${integrationId}/settings`);
307
+ return response.data;
308
+ }
309
+ // Connector CRUD API Functions
310
+ export async function createConnector(client, integrationId, connectorData) {
311
+ const response = await client.post(`/api/v1/integrations/${integrationId}/connectors`, connectorData);
312
+ return response.data;
313
+ }
314
+ export async function updateConnector(client, connectorId, updateData) {
315
+ await client.put(`/api/v1/integrations/connectors/${connectorId}`, updateData);
316
+ }
317
+ export async function deleteConnector(client, connectorId) {
318
+ await client.delete(`/api/v1/integrations/connectors/${connectorId}`);
319
+ }
320
+ // Webhook API Functions
321
+ export async function listOutgoingWebhooks(client) {
322
+ const response = await client.get('/api/v1/webhooks');
323
+ return response.data;
324
+ }
325
+ export async function listIncomingWebhooks(client) {
326
+ const response = await client.get('/api/v1/webhooks/incoming');
327
+ return response.data;
328
+ }
329
+ // AKB (Knowledge Base) API Functions
330
+ export async function searchPersonas(client, isLinkedToAgent = true, page = 1, per = 30) {
331
+ const response = await client.get('/api/v1/bff/personas/search', {
332
+ params: { is_linked_to_agent: isLinkedToAgent, page, per }
333
+ });
334
+ return response.data;
335
+ }
336
+ export async function getAkbTopics(client, personaId, page = 1, per = 100, orderBy = 'created_at') {
337
+ const response = await client.get('/api/v1/akb/topics', {
338
+ params: { persona_id: personaId, page, per, order_by: orderBy }
339
+ });
340
+ return response.data;
341
+ }
342
+ // Project update
343
+ export async function updateProject(client, projectId, updateData) {
344
+ await client.put(`/api/v1/designer/projects/${projectId}`, updateData);
345
+ }
346
+ // Agent update
347
+ export async function updateAgent(client, agentId, updateData) {
348
+ await client.put(`/api/v1/designer/agents/${agentId}`, updateData);
349
+ }
350
+ // Webhook creation
351
+ export async function createOutgoingWebhook(client, webhookData) {
352
+ const response = await client.post('/api/v1/webhooks', webhookData);
353
+ return response.data;
354
+ }
355
+ export async function createIncomingWebhook(client, webhookData) {
356
+ const response = await client.post('/api/v1/webhooks/incoming', webhookData);
357
+ return response.data;
358
+ }
268
359
  //# sourceMappingURL=api.js.map
@@ -0,0 +1,3 @@
1
+ import type { MultiCustomerConfig, CliArgs } from '../../types.js';
2
+ export declare function handleCreateWebhooksCommand(customerConfig: MultiCustomerConfig, args: CliArgs, verbose: boolean): Promise<void>;
3
+ //# sourceMappingURL=create-webhooks.d.ts.map
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Webhook creation command handler
3
+ */
4
+ import { makeClient } from '../../api.js';
5
+ import { getValidAccessToken } from '../../auth.js';
6
+ import { selectSingleCustomer } from '../customer-selection.js';
7
+ import { customerDir } from '../../fsutil.js';
8
+ import fs from 'fs-extra';
9
+ import yaml from 'js-yaml';
10
+ import path from 'path';
11
+ export async function handleCreateWebhooksCommand(customerConfig, args, verbose) {
12
+ const { selectedCustomer } = selectSingleCustomer(customerConfig, args.customer);
13
+ if (!selectedCustomer) {
14
+ console.error('❌ No customer selected');
15
+ process.exit(1);
16
+ }
17
+ const accessToken = await getValidAccessToken(selectedCustomer);
18
+ const client = await makeClient(verbose, accessToken);
19
+ console.log(`\n📡 Creating webhooks for ${selectedCustomer.idn}...\n`);
20
+ const custDir = customerDir(selectedCustomer.idn);
21
+ let outgoingCreated = 0;
22
+ let incomingCreated = 0;
23
+ // Create outgoing webhooks
24
+ const outgoingFile = path.join(custDir, 'integrations/api/connectors/webhook/webhooks/outgoing.yaml');
25
+ if (await fs.pathExists(outgoingFile)) {
26
+ const outgoingData = yaml.load(await fs.readFile(outgoingFile, 'utf8'));
27
+ const webhooks = outgoingData.webhooks || [];
28
+ console.log(`Found ${webhooks.length} outgoing webhooks in YAML file`);
29
+ for (const webhook of webhooks) {
30
+ try {
31
+ await client.post('/api/v1/webhooks', {
32
+ idn: webhook.idn,
33
+ description: webhook.description || '',
34
+ connector_idn: webhook.connector_idn,
35
+ url: webhook.url,
36
+ command_idns: webhook.command_idns || []
37
+ });
38
+ outgoingCreated++;
39
+ console.log(` ✅ Created outgoing: ${webhook.idn}`);
40
+ }
41
+ catch (error) {
42
+ const status = error.response?.status;
43
+ if (status === 409) {
44
+ console.log(` ℹ️ Already exists: ${webhook.idn}`);
45
+ }
46
+ else {
47
+ console.error(` ❌ Failed: ${webhook.idn} - ${error.response?.data?.reason || error.message}`);
48
+ }
49
+ }
50
+ }
51
+ }
52
+ // Create incoming webhooks
53
+ const incomingFile = path.join(custDir, 'integrations/api/connectors/webhook/webhooks/incoming.yaml');
54
+ if (await fs.pathExists(incomingFile)) {
55
+ const incomingData = yaml.load(await fs.readFile(incomingFile, 'utf8'));
56
+ const webhooks = incomingData.webhooks || [];
57
+ console.log(`\nFound ${webhooks.length} incoming webhooks in YAML file`);
58
+ for (const webhook of webhooks) {
59
+ try {
60
+ await client.post('/api/v1/webhooks/incoming', {
61
+ idn: webhook.idn,
62
+ description: webhook.description || '',
63
+ connector_idn: webhook.connector_idn,
64
+ event_idns: webhook.event_idns || [],
65
+ allowed_ips: webhook.allowed_ips || []
66
+ });
67
+ incomingCreated++;
68
+ console.log(` ✅ Created incoming: ${webhook.idn}`);
69
+ }
70
+ catch (error) {
71
+ const status = error.response?.status;
72
+ if (status === 409) {
73
+ console.log(` ℹ️ Already exists: ${webhook.idn}`);
74
+ }
75
+ else {
76
+ console.error(` ❌ Failed: ${webhook.idn} - ${error.response?.data?.reason || error.message}`);
77
+ }
78
+ }
79
+ }
80
+ }
81
+ console.log(`\n✅ Created ${outgoingCreated} outgoing and ${incomingCreated} incoming webhooks\n`);
82
+ }
83
+ //# sourceMappingURL=create-webhooks.js.map
@@ -12,7 +12,7 @@ Core Commands:
12
12
  newo conversations [--customer <idn>] [--all] # download user conversations -> ./newo_customers/<idn>/conversations.yaml
13
13
  newo sandbox "<message>" [--customer <idn>] # test agent in sandbox - single message mode (NEW v3.1.0)
14
14
  newo sandbox --actor <id> "message" # continue existing sandbox conversation with chat ID
15
- newo pull-attributes [--customer <idn>] # download customer attributes -> ./newo_customers/<idn>/attributes.yaml
15
+ newo pull-attributes [--customer <idn>] # download customer + project attributes -> ./newo_customers/<idn>/attributes.yaml + projects/{project}/attributes.yaml
16
16
  newo list-customers # list available customers and their configuration
17
17
  newo meta [--customer <idn>] # get project metadata (debug command)
18
18
  newo import-akb <file> <persona_id> [--customer <idn>] # import AKB articles from structured text file
@@ -41,6 +41,17 @@ Enterprise Features:
41
41
  newo conversations [--customer <idn>] [--all] # download conversation history
42
42
  newo pull-attributes [--customer <idn>] # sync customer attributes
43
43
  newo import-akb <file> <persona_id> # import knowledge base articles
44
+ newo pull-integrations [--customer <idn>] # download integrations and connectors → ./newo_customers/<idn>/integrations/
45
+ newo push-integrations [--customer <idn>] # upload integration and connector changes to platform
46
+ newo list-actions [--customer <idn>] # list all available NSL/Jinja script actions with parameters
47
+ newo profile [--customer <idn>] # display customer profile information
48
+ newo pull-akb [--customer <idn>] # download AKB articles for all personas with agents → ./newo_customers/<idn>/akb/
49
+ newo push-akb [--customer <idn>] # upload AKB articles from local YAML files to platform
50
+
51
+ Account Migration (NEW):
52
+ newo migrate-account --source <idn> --dest <idn> [--yes] # migrate complete account from source to destination
53
+ newo verify --source <idn> --dest <idn> # verify migration by comparing entity counts
54
+ newo create-webhooks [--customer <idn>] # create webhooks from YAML files
44
55
 
45
56
  Flags:
46
57
  --customer <idn> # specify customer (if not set, uses default or interactive selection)
@@ -122,8 +133,21 @@ File Structure:
122
133
  ├── <customer-idn>/
123
134
  │ ├── attributes.yaml # Customer attributes (pull-attributes)
124
135
  │ ├── conversations.yaml # User conversations and personas
136
+ │ ├── akb/ # AKB knowledge base articles (pull-akb)
137
+ │ │ └── <agent-idn>.yaml # AKB articles per agent persona
138
+ │ ├── integrations/ # Integration configurations (pull-integrations)
139
+ │ │ ├── integrations.yaml # Master integrations list
140
+ │ │ └── <integration-idn>/
141
+ │ │ ├── <integration-idn>.yaml # Integration metadata + settings (combined)
142
+ │ │ └── connectors/
143
+ │ │ └── <connector-idn>/ # Each connector in own directory
144
+ │ │ ├── <connector-idn>.yaml # Connector config
145
+ │ │ └── webhooks/ # Webhooks subdirectory (if any)
146
+ │ │ ├── outgoing.yaml # Outgoing webhooks
147
+ │ │ └── incoming.yaml # Incoming webhooks
125
148
  │ └── projects/
126
149
  │ └── <project-idn>/
150
+ │ ├── attributes.yaml # Project attributes (pull-attributes)
127
151
  │ ├── flows.yaml # Auto-generated project structure
128
152
  │ ├── metadata.yaml # Project metadata
129
153
  │ └── <agent-idn>/
@@ -0,0 +1,3 @@
1
+ import type { MultiCustomerConfig, CliArgs } from '../../types.js';
2
+ export declare function handleListActionsCommand(customerConfig: MultiCustomerConfig, args: CliArgs, verbose: boolean): Promise<void>;
3
+ //# sourceMappingURL=list-actions.d.ts.map
@@ -0,0 +1,89 @@
1
+ /**
2
+ * List actions command handler
3
+ * Displays all available NSL/Jinja script actions
4
+ */
5
+ import { makeClient, getScriptActions } from '../../api.js';
6
+ import { getValidAccessToken } from '../../auth.js';
7
+ import { requireSingleCustomer } from '../customer-selection.js';
8
+ export async function handleListActionsCommand(customerConfig, args, verbose) {
9
+ const selectedCustomer = requireSingleCustomer(customerConfig, args.customer);
10
+ const accessToken = await getValidAccessToken(selectedCustomer);
11
+ const client = await makeClient(verbose, accessToken);
12
+ console.log(`📋 Fetching available script actions...\n`);
13
+ const actions = await getScriptActions(client);
14
+ console.log(`✅ Found ${actions.length} script actions\n`);
15
+ // Group actions by category
16
+ const categories = new Map();
17
+ for (const action of actions) {
18
+ // Categorize by prefix (e.g., Get, Create, Delete, Gen, etc.)
19
+ const category = getCategoryFromActionTitle(action.title);
20
+ if (!categories.has(category)) {
21
+ categories.set(category, []);
22
+ }
23
+ categories.get(category).push(action);
24
+ }
25
+ // Display actions by category
26
+ const sortedCategories = Array.from(categories.entries()).sort(([a], [b]) => a.localeCompare(b));
27
+ for (const [category, categoryActions] of sortedCategories) {
28
+ console.log(`\n${category}:`);
29
+ for (const action of categoryActions.sort((a, b) => a.title.localeCompare(b.title))) {
30
+ console.log(` • ${action.title}`);
31
+ // Show parameters if verbose
32
+ if (verbose && Object.keys(action.arguments).length > 0) {
33
+ console.log(` Parameters:`);
34
+ for (const [paramName, paramSchema] of Object.entries(action.arguments)) {
35
+ const required = paramSchema.default === undefined && !paramSchema.anyOf ? ' (required)' : '';
36
+ console.log(` - ${paramName}: ${paramSchema.type}${required}`);
37
+ }
38
+ }
39
+ }
40
+ }
41
+ console.log(`\n💡 Use --verbose flag to see parameter details\n`);
42
+ }
43
+ /**
44
+ * Categorize action by its title prefix
45
+ */
46
+ function getCategoryFromActionTitle(title) {
47
+ // Common prefixes
48
+ const prefixes = [
49
+ 'Gen',
50
+ 'Get',
51
+ 'Create',
52
+ 'Delete',
53
+ 'Update',
54
+ 'Set',
55
+ 'Send',
56
+ 'Append',
57
+ 'Build',
58
+ 'Parse',
59
+ 'Validate',
60
+ 'Format',
61
+ 'Convert',
62
+ 'Filter',
63
+ 'Sort',
64
+ 'Search'
65
+ ];
66
+ for (const prefix of prefixes) {
67
+ if (title.startsWith(prefix)) {
68
+ return `${prefix} Actions`;
69
+ }
70
+ }
71
+ // Special cases
72
+ if (title.includes('Array') || title.includes('JSON')) {
73
+ return 'Data Manipulation';
74
+ }
75
+ if (title.includes('Actor') || title.includes('Persona')) {
76
+ return 'User Management';
77
+ }
78
+ if (title.includes('Message') || title.includes('Chat')) {
79
+ return 'Communication';
80
+ }
81
+ if (title.includes('Akb') || title.includes('Knowledge')) {
82
+ return 'Knowledge Base';
83
+ }
84
+ if (title.includes('Attribute')) {
85
+ return 'Attributes';
86
+ }
87
+ return 'Other Actions';
88
+ }
89
+ //# sourceMappingURL=list-actions.js.map
@@ -0,0 +1,3 @@
1
+ import type { MultiCustomerConfig, CliArgs } from '../../types.js';
2
+ export declare function handleMigrateAccountCommand(customerConfig: MultiCustomerConfig, args: CliArgs, verbose: boolean): Promise<void>;
3
+ //# sourceMappingURL=migrate-account.d.ts.map