newo 3.1.0 → 3.2.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.
- package/CHANGELOG.md +139 -1
- package/dist/api.d.ts +14 -1
- package/dist/api.js +74 -0
- package/dist/cli/commands/help.js +20 -1
- package/dist/cli/commands/list-actions.d.ts +3 -0
- package/dist/cli/commands/list-actions.js +89 -0
- package/dist/cli/commands/profile.d.ts +3 -0
- package/dist/cli/commands/profile.js +62 -0
- package/dist/cli/commands/pull-akb.d.ts +3 -0
- package/dist/cli/commands/pull-akb.js +19 -0
- package/dist/cli/commands/pull-attributes.js +7 -0
- package/dist/cli/commands/pull-integrations.d.ts +3 -0
- package/dist/cli/commands/pull-integrations.js +19 -0
- package/dist/cli/commands/push-akb.d.ts +3 -0
- package/dist/cli/commands/push-akb.js +19 -0
- package/dist/cli/commands/push-integrations.d.ts +3 -0
- package/dist/cli/commands/push-integrations.js +19 -0
- package/dist/cli.js +24 -0
- package/dist/sync/akb.d.ts +14 -0
- package/dist/sync/akb.js +175 -0
- package/dist/sync/attributes.d.ts +19 -0
- package/dist/sync/attributes.js +221 -2
- package/dist/sync/integrations.d.ts +23 -0
- package/dist/sync/integrations.js +340 -0
- package/dist/sync/projects.js +171 -1
- package/dist/sync/push.js +15 -0
- package/dist/sync/skill-files.js +1 -1
- package/dist/sync/status.js +4 -2
- package/dist/types.d.ts +128 -0
- package/package.json +11 -3
- package/src/api.ts +132 -1
- package/src/cli/commands/help.ts +20 -1
- package/src/cli/commands/list-actions.ts +112 -0
- package/src/cli/commands/profile.ts +79 -0
- package/src/cli/commands/pull-akb.ts +27 -0
- package/src/cli/commands/pull-attributes.ts +8 -0
- package/src/cli/commands/pull-integrations.ts +27 -0
- package/src/cli/commands/push-akb.ts +27 -0
- package/src/cli/commands/push-integrations.ts +27 -0
- package/src/cli.ts +30 -0
- package/src/sync/akb.ts +205 -0
- package/src/sync/attributes.ts +269 -2
- package/src/sync/integrations.ts +403 -0
- package/src/sync/projects.ts +207 -1
- package/src/sync/push.ts +17 -0
- package/src/sync/skill-files.ts +1 -1
- package/src/sync/status.ts +4 -2
- package/src/types.ts +150 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,143 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [3.2.0] - 2025-10-17
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Integration Management**: Complete integration and connector management system
|
|
15
|
+
- `newo pull-integrations` - Download all integrations, connectors, and webhooks to local YAML files
|
|
16
|
+
- `newo push-integrations` - Upload connector changes with full CRUD support (Create, Update, Delete)
|
|
17
|
+
- Combined integration files: `{integration_idn}.yaml` contains metadata + settings in single file
|
|
18
|
+
- Nested connector structure: Each connector in own subdirectory `connectors/{connector_idn}/{connector_idn}.yaml`
|
|
19
|
+
- Automatic webhook synchronization (outgoing + incoming webhooks)
|
|
20
|
+
- 15 integrations discovered and managed (api, sandbox, twilio, magic_browser, newo_chat, etc.)
|
|
21
|
+
- Full connector lifecycle: Create via YAML + push → Modify → Delete via YAML removal + push
|
|
22
|
+
- **AKB Knowledge Base Management**: Complete knowledge base synchronization
|
|
23
|
+
- `newo pull-akb` - Download AKB articles for all personas linked to agents
|
|
24
|
+
- `newo push-akb` - Upload AKB articles from local YAML files to platform
|
|
25
|
+
- YAML format matches backup structure exactly for compatibility
|
|
26
|
+
- Automatic persona-to-agent mapping via agent IDN
|
|
27
|
+
- Pagination support for large knowledge bases
|
|
28
|
+
- Articles stored in `akb/{agent_idn}.yaml` format
|
|
29
|
+
- **Project Attributes**: Full project-level attribute management
|
|
30
|
+
- Enhanced `newo pull-attributes` to pull both customer AND project attributes
|
|
31
|
+
- Project attributes saved to `projects/{project_idn}/attributes.yaml`
|
|
32
|
+
- Push integrated into main `newo push` command
|
|
33
|
+
- Automatic ID mapping for push operations
|
|
34
|
+
- Same YAML format as customer attributes with !enum tags
|
|
35
|
+
- Change detection and update mechanism
|
|
36
|
+
- **Developer Tools**: Reference and productivity features
|
|
37
|
+
- `newo list-actions` - List all 78 available NSL/Jinja script actions with categorization
|
|
38
|
+
- `newo profile` - Display customer profile information (organization, email, platform links)
|
|
39
|
+
- Action categorization into 12 groups (Gen, Get, Create, Delete, Update, etc.)
|
|
40
|
+
- Verbose mode shows complete parameter schemas for each action
|
|
41
|
+
- **API Integrations**: 17 new API endpoints
|
|
42
|
+
- Integration endpoints: GET integrations, connectors, settings
|
|
43
|
+
- Connector CRUD: POST, PUT, DELETE for connectors
|
|
44
|
+
- Webhook endpoints: GET outgoing/incoming webhooks
|
|
45
|
+
- AKB endpoints: GET personas, topics; POST import
|
|
46
|
+
- Project attribute endpoints: GET, PUT for project attributes
|
|
47
|
+
- Script actions endpoint: GET all NSL actions
|
|
48
|
+
- Customer profile endpoint: GET profile information
|
|
49
|
+
- **TypeScript Types**: 22 new interfaces for complete type safety
|
|
50
|
+
- Integration types: Integration, Connector, IntegrationSetting, CreateConnectorRequest, UpdateConnectorRequest
|
|
51
|
+
- Webhook types: OutgoingWebhook, IncomingWebhook
|
|
52
|
+
- AKB types: Persona, AkbTopic, AkbTopicItem, AkbYamlTopic
|
|
53
|
+
- Script action types: ScriptAction, ArgumentSchema
|
|
54
|
+
- Metadata types: IntegrationMetadata, ConnectorMetadata, IntegrationsYamlData
|
|
55
|
+
|
|
56
|
+
### Changed
|
|
57
|
+
|
|
58
|
+
- **File Structure**: Enhanced directory hierarchy with new integration and AKB folders
|
|
59
|
+
- `newo_customers/{customer}/integrations/` - Integration configurations
|
|
60
|
+
- `newo_customers/{customer}/akb/` - AKB knowledge base articles
|
|
61
|
+
- `newo_customers/{customer}/projects/{project}/attributes.yaml` - Project attributes
|
|
62
|
+
- **Pull Attributes Command**: Now pulls both customer and project attributes in single command
|
|
63
|
+
- **Push Command**: Enhanced to push project attribute changes alongside skill changes
|
|
64
|
+
- **Help Documentation**: Comprehensive updates with all new commands and file structure
|
|
65
|
+
- **Integration Structure**: Nested connector directories with webhook subdirectories
|
|
66
|
+
- `integrations/{integration}/{integration}.yaml` - Combined metadata + settings
|
|
67
|
+
- `integrations/{integration}/connectors/{connector}/{connector}.yaml` - Connector config
|
|
68
|
+
- `integrations/{integration}/connectors/{connector}/webhooks/` - Webhook files
|
|
69
|
+
|
|
70
|
+
### Technical Details
|
|
71
|
+
|
|
72
|
+
- **Modular Architecture**: 8 new modules created
|
|
73
|
+
- `src/sync/integrations.ts` (340+ lines) - Integration/connector/webhook sync
|
|
74
|
+
- `src/sync/akb.ts` (205 lines) - AKB knowledge base sync
|
|
75
|
+
- `src/cli/commands/pull-integrations.ts` - Integration pull handler
|
|
76
|
+
- `src/cli/commands/push-integrations.ts` - Integration push handler
|
|
77
|
+
- `src/cli/commands/pull-akb.ts` - AKB pull handler
|
|
78
|
+
- `src/cli/commands/push-akb.ts` - AKB push handler
|
|
79
|
+
- `src/cli/commands/list-actions.ts` - Script actions listing
|
|
80
|
+
- `src/cli/commands/profile.ts` - Profile viewer
|
|
81
|
+
- **Enhanced Modules**: 6 existing modules updated
|
|
82
|
+
- `src/types.ts` (+160 lines) - New type definitions
|
|
83
|
+
- `src/api.ts` (+110 lines) - New API functions
|
|
84
|
+
- `src/sync/attributes.ts` (+126 lines) - Project attribute support
|
|
85
|
+
- `src/sync/push.ts` (+15 lines) - Project attribute push integration
|
|
86
|
+
- `src/cli.ts` (+12 lines) - New command routing
|
|
87
|
+
- `src/cli/commands/help.ts` (+30 lines) - Documentation updates
|
|
88
|
+
- **Webhook Association**: Webhooks grouped by connector_idn and stored in connector subdirectories
|
|
89
|
+
- **Change Detection**: Smart comparison for connectors (title, status, settings)
|
|
90
|
+
- **Error Handling**: Graceful handling of missing settings endpoints (404 errors)
|
|
91
|
+
- **ID Mapping**: Separate JSON files for attribute ID mappings to enable push operations
|
|
92
|
+
- **YAML Parsing**: Custom !enum tag handling for AttributeValueTypes
|
|
93
|
+
|
|
94
|
+
### Example Usage
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Integration management
|
|
98
|
+
newo pull-integrations # Download all integrations + webhooks
|
|
99
|
+
newo push-integrations # Upload connector changes
|
|
100
|
+
|
|
101
|
+
# Knowledge base management
|
|
102
|
+
newo pull-akb # Download AKB for personas with agents
|
|
103
|
+
newo push-akb # Upload AKB articles
|
|
104
|
+
|
|
105
|
+
# Enhanced attributes
|
|
106
|
+
newo pull-attributes # Now pulls customer + project attributes
|
|
107
|
+
newo push # Now pushes project attributes too
|
|
108
|
+
|
|
109
|
+
# Developer tools
|
|
110
|
+
newo profile # View customer information
|
|
111
|
+
newo list-actions # Browse 78 NSL actions
|
|
112
|
+
newo list-actions --verbose # With parameter details
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Files Created
|
|
116
|
+
|
|
117
|
+
**Integration Structure:**
|
|
118
|
+
```
|
|
119
|
+
newo_customers/{customer}/integrations/
|
|
120
|
+
├── integrations.yaml
|
|
121
|
+
└── {integration_idn}/
|
|
122
|
+
├── {integration_idn}.yaml # Combined metadata + settings
|
|
123
|
+
└── connectors/
|
|
124
|
+
└── {connector_idn}/
|
|
125
|
+
├── {connector_idn}.yaml
|
|
126
|
+
└── webhooks/
|
|
127
|
+
├── outgoing.yaml
|
|
128
|
+
└── incoming.yaml
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**AKB Structure:**
|
|
132
|
+
```
|
|
133
|
+
newo_customers/{customer}/akb/
|
|
134
|
+
└── {agent_idn}.yaml # AKB articles per agent
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
**Project Attributes:**
|
|
138
|
+
```
|
|
139
|
+
newo_customers/{customer}/projects/{project}/
|
|
140
|
+
└── attributes.yaml # Project-specific attributes
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Breaking Changes
|
|
144
|
+
|
|
145
|
+
None. All changes are additive and backward compatible.
|
|
146
|
+
|
|
10
147
|
## [3.1.0] - 2025-10-15
|
|
11
148
|
|
|
12
149
|
### Added
|
|
@@ -698,7 +835,8 @@ Another Item: $Price [Modifiers: modifier3]
|
|
|
698
835
|
- GitHub Actions CI/CD integration
|
|
699
836
|
- Robust authentication with token refresh
|
|
700
837
|
|
|
701
|
-
[Unreleased]: https://github.com/sabbah13/newo-cli/compare/v3.
|
|
838
|
+
[Unreleased]: https://github.com/sabbah13/newo-cli/compare/v3.2.0...HEAD
|
|
839
|
+
[3.2.0]: https://github.com/sabbah13/newo-cli/compare/v3.1.0...v3.2.0
|
|
702
840
|
[3.1.0]: https://github.com/sabbah13/newo-cli/compare/v3.0.0...v3.1.0
|
|
703
841
|
[3.0.0]: https://github.com/sabbah13/newo-cli/compare/v2.0.6...v3.0.0
|
|
704
842
|
[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,13 @@ 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>;
|
|
45
58
|
//# 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,47 @@ 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
|
+
}
|
|
268
342
|
//# sourceMappingURL=api.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,12 @@ 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
|
|
44
50
|
|
|
45
51
|
Flags:
|
|
46
52
|
--customer <idn> # specify customer (if not set, uses default or interactive selection)
|
|
@@ -122,8 +128,21 @@ File Structure:
|
|
|
122
128
|
├── <customer-idn>/
|
|
123
129
|
│ ├── attributes.yaml # Customer attributes (pull-attributes)
|
|
124
130
|
│ ├── conversations.yaml # User conversations and personas
|
|
131
|
+
│ ├── akb/ # AKB knowledge base articles (pull-akb)
|
|
132
|
+
│ │ └── <agent-idn>.yaml # AKB articles per agent persona
|
|
133
|
+
│ ├── integrations/ # Integration configurations (pull-integrations)
|
|
134
|
+
│ │ ├── integrations.yaml # Master integrations list
|
|
135
|
+
│ │ └── <integration-idn>/
|
|
136
|
+
│ │ ├── <integration-idn>.yaml # Integration metadata + settings (combined)
|
|
137
|
+
│ │ └── connectors/
|
|
138
|
+
│ │ └── <connector-idn>/ # Each connector in own directory
|
|
139
|
+
│ │ ├── <connector-idn>.yaml # Connector config
|
|
140
|
+
│ │ └── webhooks/ # Webhooks subdirectory (if any)
|
|
141
|
+
│ │ ├── outgoing.yaml # Outgoing webhooks
|
|
142
|
+
│ │ └── incoming.yaml # Incoming webhooks
|
|
125
143
|
│ └── projects/
|
|
126
144
|
│ └── <project-idn>/
|
|
145
|
+
│ ├── attributes.yaml # Project attributes (pull-attributes)
|
|
127
146
|
│ ├── flows.yaml # Auto-generated project structure
|
|
128
147
|
│ ├── metadata.yaml # Project metadata
|
|
129
148
|
│ └── <agent-idn>/
|
|
@@ -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,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile command handler
|
|
3
|
+
* Displays customer profile information
|
|
4
|
+
*/
|
|
5
|
+
import { makeClient, getCustomerProfile } from '../../api.js';
|
|
6
|
+
import { getValidAccessToken } from '../../auth.js';
|
|
7
|
+
import { requireSingleCustomer } from '../customer-selection.js';
|
|
8
|
+
export async function handleProfileCommand(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 customer profile for ${selectedCustomer.idn}...\n`);
|
|
13
|
+
const profile = await getCustomerProfile(client);
|
|
14
|
+
// Display formatted profile information
|
|
15
|
+
console.log(`Organization: ${profile.organization_name || 'N/A'}`);
|
|
16
|
+
console.log(`Customer IDN: ${profile.idn}`);
|
|
17
|
+
console.log(`Email: ${profile.email || 'N/A'}`);
|
|
18
|
+
console.log(`Status: ${profile.status || 'N/A'} ${profile.is_active ? '(active)' : '(inactive)'}`);
|
|
19
|
+
if (profile.phone_number) {
|
|
20
|
+
console.log(`Phone: ${profile.phone_number}`);
|
|
21
|
+
}
|
|
22
|
+
if (profile.website) {
|
|
23
|
+
console.log(`Website: ${profile.website}`);
|
|
24
|
+
}
|
|
25
|
+
if (profile.referral_code) {
|
|
26
|
+
console.log(`Referral Code: ${profile.referral_code}`);
|
|
27
|
+
}
|
|
28
|
+
// Platform links
|
|
29
|
+
if (profile.platform_links) {
|
|
30
|
+
console.log(`\nPlatform Links:`);
|
|
31
|
+
if (profile.platform_links.portal) {
|
|
32
|
+
console.log(` Portal: ${profile.platform_links.portal}`);
|
|
33
|
+
}
|
|
34
|
+
if (profile.platform_links.builder) {
|
|
35
|
+
console.log(` Builder: ${profile.platform_links.builder}`);
|
|
36
|
+
}
|
|
37
|
+
if (profile.platform_links.creator) {
|
|
38
|
+
console.log(` Creator: ${profile.platform_links.creator}`);
|
|
39
|
+
}
|
|
40
|
+
if (profile.platform_links.chat_widget) {
|
|
41
|
+
console.log(` Chat Widget: ${profile.platform_links.chat_widget}`);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// Show additional fields if verbose
|
|
45
|
+
if (verbose) {
|
|
46
|
+
console.log(`\nAdditional Information:`);
|
|
47
|
+
console.log(` Customer ID: ${profile.id}`);
|
|
48
|
+
console.log(` Tenant: ${profile.tenant || 'N/A'}`);
|
|
49
|
+
console.log(` Organization Type: ${profile.organization_type || 'N/A'}`);
|
|
50
|
+
console.log(` External Customer ID: ${profile.external_customer_id || 'N/A'}`);
|
|
51
|
+
if (profile.industry && profile.industry.length > 0) {
|
|
52
|
+
console.log(` Industry: ${profile.industry.join(', ')}`);
|
|
53
|
+
}
|
|
54
|
+
if (profile.billing_email) {
|
|
55
|
+
console.log(` Billing Email: ${profile.billing_email}`);
|
|
56
|
+
}
|
|
57
|
+
console.log(` BAA Signed: ${profile.is_baa_signed ? 'Yes' : 'No'}`);
|
|
58
|
+
console.log(` Marked for Deletion: ${profile.is_marked_for_deletion ? 'Yes' : 'No'}`);
|
|
59
|
+
}
|
|
60
|
+
console.log();
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=profile.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pull AKB command handler
|
|
3
|
+
* Downloads AKB (knowledge base) articles for all personas linked to agents
|
|
4
|
+
*/
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { makeClient } from '../../api.js';
|
|
7
|
+
import { pullAkb } from '../../sync/akb.js';
|
|
8
|
+
import { getValidAccessToken } from '../../auth.js';
|
|
9
|
+
import { requireSingleCustomer } from '../customer-selection.js';
|
|
10
|
+
export async function handlePullAkbCommand(customerConfig, args, verbose) {
|
|
11
|
+
const selectedCustomer = requireSingleCustomer(customerConfig, args.customer);
|
|
12
|
+
const accessToken = await getValidAccessToken(selectedCustomer);
|
|
13
|
+
const client = await makeClient(verbose, accessToken);
|
|
14
|
+
const customerDir = path.join(process.cwd(), 'newo_customers', selectedCustomer.idn);
|
|
15
|
+
console.log(`📚 Fetching AKB articles for ${selectedCustomer.idn}...`);
|
|
16
|
+
await pullAkb(client, customerDir, verbose);
|
|
17
|
+
console.log(`✅ AKB articles saved to newo_customers/${selectedCustomer.idn}/akb/`);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=pull-akb.js.map
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Pull attributes command handler
|
|
3
|
+
* Pulls both customer and project attributes
|
|
3
4
|
*/
|
|
4
5
|
import { makeClient } from '../../api.js';
|
|
5
6
|
import { saveCustomerAttributes } from '../../sync.js';
|
|
7
|
+
import { pullAllProjectAttributes } from '../../sync/attributes.js';
|
|
6
8
|
import { getValidAccessToken } from '../../auth.js';
|
|
7
9
|
import { requireSingleCustomer } from '../customer-selection.js';
|
|
8
10
|
export async function handlePullAttributesCommand(customerConfig, args, verbose) {
|
|
9
11
|
const selectedCustomer = requireSingleCustomer(customerConfig, args.customer);
|
|
10
12
|
const accessToken = await getValidAccessToken(selectedCustomer);
|
|
11
13
|
const client = await makeClient(verbose, accessToken);
|
|
14
|
+
// Pull customer attributes
|
|
12
15
|
console.log(`🔍 Fetching customer attributes for ${selectedCustomer.idn}...`);
|
|
13
16
|
await saveCustomerAttributes(client, selectedCustomer, verbose);
|
|
14
17
|
console.log(`✅ Customer attributes saved to newo_customers/${selectedCustomer.idn}/attributes.yaml`);
|
|
18
|
+
// Pull project attributes
|
|
19
|
+
console.log(`\n📋 Fetching project attributes for ${selectedCustomer.idn}...`);
|
|
20
|
+
await pullAllProjectAttributes(client, selectedCustomer, verbose);
|
|
21
|
+
console.log(`✅ Project attributes saved to newo_customers/${selectedCustomer.idn}/projects/{project_idn}/attributes.yaml`);
|
|
15
22
|
}
|
|
16
23
|
//# sourceMappingURL=pull-attributes.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pull integrations command handler
|
|
3
|
+
* Downloads all integrations and connectors from NEWO platform
|
|
4
|
+
*/
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { makeClient } from '../../api.js';
|
|
7
|
+
import { pullIntegrations } from '../../sync/integrations.js';
|
|
8
|
+
import { getValidAccessToken } from '../../auth.js';
|
|
9
|
+
import { requireSingleCustomer } from '../customer-selection.js';
|
|
10
|
+
export async function handlePullIntegrationsCommand(customerConfig, args, verbose) {
|
|
11
|
+
const selectedCustomer = requireSingleCustomer(customerConfig, args.customer);
|
|
12
|
+
const accessToken = await getValidAccessToken(selectedCustomer);
|
|
13
|
+
const client = await makeClient(verbose, accessToken);
|
|
14
|
+
const customerDir = path.join(process.cwd(), 'newo_customers', selectedCustomer.idn);
|
|
15
|
+
console.log(`📦 Fetching integrations for ${selectedCustomer.idn}...`);
|
|
16
|
+
await pullIntegrations(client, customerDir, verbose);
|
|
17
|
+
console.log(`✅ Integrations saved to newo_customers/${selectedCustomer.idn}/integrations/`);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=pull-integrations.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Push AKB command handler
|
|
3
|
+
* Uploads AKB (knowledge base) articles to NEWO platform
|
|
4
|
+
*/
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { makeClient } from '../../api.js';
|
|
7
|
+
import { pushAkb } from '../../sync/akb.js';
|
|
8
|
+
import { getValidAccessToken } from '../../auth.js';
|
|
9
|
+
import { requireSingleCustomer } from '../customer-selection.js';
|
|
10
|
+
export async function handlePushAkbCommand(customerConfig, args, verbose) {
|
|
11
|
+
const selectedCustomer = requireSingleCustomer(customerConfig, args.customer);
|
|
12
|
+
const accessToken = await getValidAccessToken(selectedCustomer);
|
|
13
|
+
const client = await makeClient(verbose, accessToken);
|
|
14
|
+
const customerDir = path.join(process.cwd(), 'newo_customers', selectedCustomer.idn);
|
|
15
|
+
console.log(`📤 Pushing AKB articles for ${selectedCustomer.idn}...`);
|
|
16
|
+
await pushAkb(client, customerDir, verbose);
|
|
17
|
+
console.log(`✅ AKB articles pushed successfully`);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=push-akb.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Push integrations command handler
|
|
3
|
+
* Uploads integration and connector changes to NEWO platform
|
|
4
|
+
*/
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { makeClient } from '../../api.js';
|
|
7
|
+
import { pushIntegrations } from '../../sync/integrations.js';
|
|
8
|
+
import { getValidAccessToken } from '../../auth.js';
|
|
9
|
+
import { requireSingleCustomer } from '../customer-selection.js';
|
|
10
|
+
export async function handlePushIntegrationsCommand(customerConfig, args, verbose) {
|
|
11
|
+
const selectedCustomer = requireSingleCustomer(customerConfig, args.customer);
|
|
12
|
+
const accessToken = await getValidAccessToken(selectedCustomer);
|
|
13
|
+
const client = await makeClient(verbose, accessToken);
|
|
14
|
+
const customerDir = path.join(process.cwd(), 'newo_customers', selectedCustomer.idn);
|
|
15
|
+
console.log(`📤 Pushing integration changes for ${selectedCustomer.idn}...`);
|
|
16
|
+
await pushIntegrations(client, customerDir, verbose);
|
|
17
|
+
console.log(`✅ Integration changes pushed successfully`);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=push-integrations.js.map
|
package/dist/cli.js
CHANGED
|
@@ -29,6 +29,12 @@ import { handleCreateParameterCommand } from './cli/commands/create-parameter.js
|
|
|
29
29
|
import { handleCreatePersonaCommand } from './cli/commands/create-persona.js';
|
|
30
30
|
import { handleCreateAttributeCommand } from './cli/commands/create-attribute.js';
|
|
31
31
|
import { handleSandboxCommand } from './cli/commands/sandbox.js';
|
|
32
|
+
import { handlePullIntegrationsCommand } from './cli/commands/pull-integrations.js';
|
|
33
|
+
import { handlePushIntegrationsCommand } from './cli/commands/push-integrations.js';
|
|
34
|
+
import { handleListActionsCommand } from './cli/commands/list-actions.js';
|
|
35
|
+
import { handleProfileCommand } from './cli/commands/profile.js';
|
|
36
|
+
import { handlePullAkbCommand } from './cli/commands/pull-akb.js';
|
|
37
|
+
import { handlePushAkbCommand } from './cli/commands/push-akb.js';
|
|
32
38
|
dotenv.config();
|
|
33
39
|
async function main() {
|
|
34
40
|
try {
|
|
@@ -131,6 +137,24 @@ async function main() {
|
|
|
131
137
|
case 'create-attribute':
|
|
132
138
|
await handleCreateAttributeCommand(customerConfig, args, verbose);
|
|
133
139
|
break;
|
|
140
|
+
case 'pull-integrations':
|
|
141
|
+
await handlePullIntegrationsCommand(customerConfig, args, verbose);
|
|
142
|
+
break;
|
|
143
|
+
case 'push-integrations':
|
|
144
|
+
await handlePushIntegrationsCommand(customerConfig, args, verbose);
|
|
145
|
+
break;
|
|
146
|
+
case 'list-actions':
|
|
147
|
+
await handleListActionsCommand(customerConfig, args, verbose);
|
|
148
|
+
break;
|
|
149
|
+
case 'profile':
|
|
150
|
+
await handleProfileCommand(customerConfig, args, verbose);
|
|
151
|
+
break;
|
|
152
|
+
case 'pull-akb':
|
|
153
|
+
await handlePullAkbCommand(customerConfig, args, verbose);
|
|
154
|
+
break;
|
|
155
|
+
case 'push-akb':
|
|
156
|
+
await handlePushAkbCommand(customerConfig, args, verbose);
|
|
157
|
+
break;
|
|
134
158
|
default:
|
|
135
159
|
console.error('Unknown command:', cmd);
|
|
136
160
|
console.error('Run "newo --help" for usage information');
|