newo 1.5.0 → 1.5.2
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/.env.example +17 -6
- package/CHANGELOG.md +91 -0
- package/README.md +502 -105
- package/dist/akb.d.ts +1 -1
- package/dist/akb.js +21 -17
- package/dist/api.d.ts +3 -2
- package/dist/api.js +24 -21
- package/dist/auth.d.ts +5 -5
- package/dist/auth.js +332 -75
- package/dist/cli.js +225 -29
- package/dist/customer.d.ts +23 -0
- package/dist/customer.js +87 -0
- package/dist/customerAsync.d.ts +22 -0
- package/dist/customerAsync.js +67 -0
- package/dist/customerInit.d.ts +10 -0
- package/dist/customerInit.js +78 -0
- package/dist/env.d.ts +33 -0
- package/dist/env.js +82 -0
- package/dist/fsutil.d.ts +14 -6
- package/dist/fsutil.js +35 -12
- package/dist/hash.d.ts +2 -2
- package/dist/hash.js +31 -8
- package/dist/sync.d.ts +5 -5
- package/dist/sync.js +91 -52
- package/dist/types.d.ts +76 -53
- package/package.json +16 -9
- package/src/akb.ts +23 -18
- package/src/api.ts +27 -24
- package/src/auth.ts +367 -94
- package/src/cli.ts +234 -33
- package/src/customer.ts +102 -0
- package/src/customerAsync.ts +78 -0
- package/src/customerInit.ts +97 -0
- package/src/env.ts +118 -0
- package/src/fsutil.ts +43 -11
- package/src/hash.ts +29 -8
- package/src/sync.ts +105 -54
- package/src/types.ts +82 -54
package/src/types.ts
CHANGED
|
@@ -6,9 +6,37 @@ export interface NewoEnvironment {
|
|
|
6
6
|
NEWO_BASE_URL?: string;
|
|
7
7
|
NEWO_PROJECT_ID?: string;
|
|
8
8
|
NEWO_API_KEY?: string;
|
|
9
|
+
NEWO_API_KEYS?: string; // JSON string containing array of keys or key objects
|
|
9
10
|
NEWO_ACCESS_TOKEN?: string;
|
|
10
11
|
NEWO_REFRESH_TOKEN?: string;
|
|
11
12
|
NEWO_REFRESH_URL?: string;
|
|
13
|
+
NEWO_DEFAULT_CUSTOMER?: string;
|
|
14
|
+
// Dynamic customer entries will be detected at runtime
|
|
15
|
+
[key: string]: string | undefined;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ApiKeyConfig {
|
|
19
|
+
key: string;
|
|
20
|
+
project_id?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface CustomerConfig {
|
|
24
|
+
idn: string;
|
|
25
|
+
apiKey: string;
|
|
26
|
+
projectId?: string | undefined;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface CustomerProfile {
|
|
30
|
+
id: string;
|
|
31
|
+
idn: string;
|
|
32
|
+
organization_name: string;
|
|
33
|
+
email: string;
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface MultiCustomerConfig {
|
|
38
|
+
customers: Record<string, CustomerConfig>;
|
|
39
|
+
defaultCustomer?: string | undefined;
|
|
12
40
|
}
|
|
13
41
|
|
|
14
42
|
// Authentication Types
|
|
@@ -30,70 +58,70 @@ export interface StoredTokens {
|
|
|
30
58
|
|
|
31
59
|
// API Response Types
|
|
32
60
|
export interface ProjectMeta {
|
|
33
|
-
id: string;
|
|
34
|
-
idn: string;
|
|
35
|
-
title: string;
|
|
36
|
-
description?: string;
|
|
37
|
-
created_at?: string;
|
|
38
|
-
updated_at?: string;
|
|
61
|
+
readonly id: string;
|
|
62
|
+
readonly idn: string;
|
|
63
|
+
readonly title: string;
|
|
64
|
+
readonly description?: string;
|
|
65
|
+
readonly created_at?: string;
|
|
66
|
+
readonly updated_at?: string;
|
|
39
67
|
}
|
|
40
68
|
|
|
41
69
|
export interface Agent {
|
|
42
|
-
id: string;
|
|
43
|
-
idn: string;
|
|
44
|
-
title?: string;
|
|
45
|
-
description?: string;
|
|
46
|
-
flows?: Flow[];
|
|
70
|
+
readonly id: string;
|
|
71
|
+
readonly idn: string;
|
|
72
|
+
readonly title?: string;
|
|
73
|
+
readonly description?: string;
|
|
74
|
+
readonly flows?: readonly Flow[];
|
|
47
75
|
}
|
|
48
76
|
|
|
49
77
|
export interface Flow {
|
|
50
|
-
id: string;
|
|
51
|
-
idn: string;
|
|
52
|
-
title: string;
|
|
53
|
-
description?: string;
|
|
54
|
-
default_runner_type: RunnerType;
|
|
55
|
-
default_model: ModelConfig;
|
|
78
|
+
readonly id: string;
|
|
79
|
+
readonly idn: string;
|
|
80
|
+
readonly title: string;
|
|
81
|
+
readonly description?: string;
|
|
82
|
+
readonly default_runner_type: RunnerType;
|
|
83
|
+
readonly default_model: ModelConfig;
|
|
56
84
|
}
|
|
57
85
|
|
|
58
86
|
export interface ModelConfig {
|
|
59
|
-
model_idn: string;
|
|
60
|
-
provider_idn: string;
|
|
87
|
+
readonly model_idn: string;
|
|
88
|
+
readonly provider_idn: string;
|
|
61
89
|
}
|
|
62
90
|
|
|
63
91
|
export interface SkillParameter {
|
|
64
|
-
name: string;
|
|
65
|
-
default_value?: string;
|
|
92
|
+
readonly name: string;
|
|
93
|
+
readonly default_value?: string;
|
|
66
94
|
}
|
|
67
95
|
|
|
68
96
|
export interface Skill {
|
|
69
|
-
id: string;
|
|
70
|
-
idn: string;
|
|
71
|
-
title: string;
|
|
72
|
-
prompt_script?: string;
|
|
73
|
-
runner_type: RunnerType;
|
|
74
|
-
model: ModelConfig;
|
|
75
|
-
parameters: SkillParameter[];
|
|
76
|
-
path?: string | undefined;
|
|
97
|
+
readonly id: string;
|
|
98
|
+
readonly idn: string;
|
|
99
|
+
readonly title: string;
|
|
100
|
+
prompt_script?: string; // Mutable for updates
|
|
101
|
+
readonly runner_type: RunnerType;
|
|
102
|
+
readonly model: ModelConfig;
|
|
103
|
+
readonly parameters: readonly SkillParameter[];
|
|
104
|
+
readonly path?: string | undefined;
|
|
77
105
|
}
|
|
78
106
|
|
|
79
107
|
export interface FlowEvent {
|
|
80
|
-
id: string;
|
|
81
|
-
idn: string;
|
|
82
|
-
description: string;
|
|
83
|
-
skill_selector: SkillSelector;
|
|
84
|
-
skill_idn?: string;
|
|
85
|
-
state_idn?: string;
|
|
86
|
-
integration_idn?: string;
|
|
87
|
-
connector_idn?: string;
|
|
88
|
-
interrupt_mode: InterruptMode;
|
|
108
|
+
readonly id: string;
|
|
109
|
+
readonly idn: string;
|
|
110
|
+
readonly description: string;
|
|
111
|
+
readonly skill_selector: SkillSelector;
|
|
112
|
+
readonly skill_idn?: string;
|
|
113
|
+
readonly state_idn?: string;
|
|
114
|
+
readonly integration_idn?: string;
|
|
115
|
+
readonly connector_idn?: string;
|
|
116
|
+
readonly interrupt_mode: InterruptMode;
|
|
89
117
|
}
|
|
90
118
|
|
|
91
119
|
export interface FlowState {
|
|
92
|
-
id: string;
|
|
93
|
-
idn: string;
|
|
94
|
-
title: string;
|
|
95
|
-
default_value?: string;
|
|
96
|
-
scope: StateFieldScope;
|
|
120
|
+
readonly id: string;
|
|
121
|
+
readonly idn: string;
|
|
122
|
+
readonly title: string;
|
|
123
|
+
readonly default_value?: string;
|
|
124
|
+
readonly scope: StateFieldScope;
|
|
97
125
|
}
|
|
98
126
|
|
|
99
127
|
// Enum Types
|
|
@@ -144,13 +172,13 @@ export interface HashStore {
|
|
|
144
172
|
|
|
145
173
|
// AKB Types
|
|
146
174
|
export interface ParsedArticle {
|
|
147
|
-
topic_name: string;
|
|
148
|
-
persona_id: string | null;
|
|
149
|
-
topic_summary: string;
|
|
150
|
-
topic_facts: string[];
|
|
151
|
-
confidence: number;
|
|
152
|
-
source: string;
|
|
153
|
-
labels: string[];
|
|
175
|
+
readonly topic_name: string;
|
|
176
|
+
readonly persona_id: string | null;
|
|
177
|
+
readonly topic_summary: string;
|
|
178
|
+
readonly topic_facts: readonly string[];
|
|
179
|
+
readonly confidence: number;
|
|
180
|
+
readonly source: string;
|
|
181
|
+
readonly labels: readonly string[];
|
|
154
182
|
}
|
|
155
183
|
|
|
156
184
|
export interface AkbImportArticle extends Omit<ParsedArticle, 'persona_id'> {
|
|
@@ -159,10 +187,10 @@ export interface AkbImportArticle extends Omit<ParsedArticle, 'persona_id'> {
|
|
|
159
187
|
|
|
160
188
|
// CLI Types
|
|
161
189
|
export interface CliArgs {
|
|
162
|
-
_: string[];
|
|
163
|
-
verbose?: boolean;
|
|
164
|
-
v?: boolean;
|
|
165
|
-
[key: string]: unknown;
|
|
190
|
+
readonly _: readonly string[];
|
|
191
|
+
readonly verbose?: boolean;
|
|
192
|
+
readonly v?: boolean;
|
|
193
|
+
readonly [key: string]: unknown;
|
|
166
194
|
}
|
|
167
195
|
|
|
168
196
|
// flows.yaml Generation Types
|