snow-flow 8.31.40 → 8.31.41

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snow-flow",
3
- "version": "8.31.40",
3
+ "version": "8.31.41",
4
4
  "description": "ServiceNow development with SnowCode - 75+ LLM providers (Claude, GPT, Gemini, Llama, Mistral, DeepSeek, Groq, Ollama) • 393 Optimized Tools • 2 MCP Servers • Multi-agent orchestration • Use ANY AI coding assistant (ML tools moved to Enterprise)",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",
@@ -498,7 +498,7 @@
498
498
  "@anthropic-ai/claude-agent-sdk": "0.1.1",
499
499
  "@anthropic-ai/sdk": "0.67.0",
500
500
  "@clack/prompts": "^0.11.0",
501
- "@groeimetai/snow-code": "^0.18.48",
501
+ "@groeimetai/snow-code": "^0.18.49",
502
502
  "@modelcontextprotocol/sdk": "1.20.1",
503
503
  "@tensorflow/tfjs": "^4.22.0",
504
504
  "@types/node-fetch": "^2.6.13",
@@ -1,286 +0,0 @@
1
- diff --git a/node_modules/@groeimetai/snow-code/src/cli/cmd/auth.ts b/node_modules/@groeimetai/snow-code/src/cli/cmd/auth.ts
2
- index ce6bfbd..1133af8 100644
3
- --- a/node_modules/@groeimetai/snow-code/src/cli/cmd/auth.ts
4
- +++ b/node_modules/@groeimetai/snow-code/src/cli/cmd/auth.ts
5
- @@ -711,6 +711,63 @@ export const AuthLoginCommand = cmd({
6
- if (prompts.isCancel(roleChoice)) throw new UI.CancelledError()
7
- role = roleChoice as "developer" | "stakeholder" | "admin"
8
-
9
- + // Check seat availability for selected role
10
- + if (role === "developer" || role === "stakeholder") {
11
- + const seatCheckSpinner = prompts.spinner()
12
- + seatCheckSpinner.start(`Checking ${role} seat availability...`)
13
- +
14
- + try {
15
- + const seatCheckResponse = await fetch(
16
- + `${enterpriseUrl}/api/user-auth/check-seat-availability?licenseKey=${encodeURIComponent(
17
- + licenseKey,
18
- + )}&role=${role}`,
19
- + )
20
- + const seatCheckData = await seatCheckResponse.json()
21
- +
22
- + if (!seatCheckResponse.ok) {
23
- + seatCheckSpinner.stop("Seat check failed", 1)
24
- + prompts.log.error(seatCheckData.error || "Failed to check seat availability")
25
- + throw new Error("Seat availability check failed")
26
- + }
27
- +
28
- + seatCheckSpinner.stop("Seat availability checked")
29
- +
30
- + if (!seatCheckData.available) {
31
- + prompts.log.error(`\n${seatCheckData.message}`)
32
- + prompts.log.message("")
33
- + prompts.log.message(`No ${role} seats are available for this license key.`)
34
- +
35
- + if (seatCheckData.allocatedSeats !== "unlimited") {
36
- + prompts.log.message(
37
- + `Allocated: ${seatCheckData.allocatedSeats}, Registered: ${seatCheckData.registeredUsers}`,
38
- + )
39
- + }
40
- +
41
- + prompts.log.message("")
42
- + prompts.log.message("Please contact your administrator to:")
43
- + prompts.log.message(" • Increase seat allocation for your organization")
44
- + prompts.log.message(` • Free up ${role} seats by removing inactive users`)
45
- + prompts.log.message("")
46
- +
47
- + throw new Error(`No ${role} seats available`)
48
- + }
49
- +
50
- + // Show available seats info
51
- + if (!seatCheckData.unlimited) {
52
- + prompts.log.success(
53
- + `${seatCheckData.availableSeats} ${role} seat(s) available (${seatCheckData.registeredUsers}/${seatCheckData.allocatedSeats} registered)`,
54
- + )
55
- + } else {
56
- + prompts.log.success(`${role} seats: unlimited`)
57
- + }
58
- + } catch (error: any) {
59
- + if (error.message === `No ${role} seats available`) {
60
- + throw error
61
- + }
62
- + prompts.log.warn("Could not verify seat availability - proceeding with registration")
63
- + }
64
- + }
65
- +
66
- prompts.log.info(`Machine ID: ${machineId.substring(0, 16)}...`)
67
-
68
- // Register with enterprise backend
69
- @@ -1074,6 +1131,39 @@ export const AuthLoginCommand = cmd({
70
- // Silently skip enterprise MCP configuration errors
71
- }
72
-
73
- + // 🔐 SYNC CREDENTIALS TO PORTAL (if provided)
74
- + if (authData && authData.token && jiraBaseUrl && jiraEmail && jiraApiToken) {
75
- + try {
76
- + prompts.log.message("")
77
- + prompts.log.step("Syncing credentials to portal...")
78
- +
79
- + const syncResponse = await fetch(`${enterpriseUrl}/api/credentials/store`, {
80
- + method: "POST",
81
- + headers: {
82
- + "Content-Type": "application/json",
83
- + "Authorization": `Bearer ${authData.token}`
84
- + },
85
- + body: JSON.stringify({
86
- + service: "jira",
87
- + email: jiraEmail,
88
- + apiToken: jiraApiToken,
89
- + instanceUrl: jiraBaseUrl
90
- + })
91
- + })
92
- +
93
- + const syncResult = await syncResponse.json()
94
- +
95
- + if (syncResponse.ok && syncResult.success) {
96
- + prompts.log.success("✓ Jira credentials synced to portal")
97
- + } else {
98
- + prompts.log.warn("⚠ Credentials saved locally but sync to portal failed")
99
- + }
100
- + } catch (syncError: any) {
101
- + // Silently continue - credentials are still saved locally
102
- + prompts.log.warn("⚠ Credentials saved locally (portal sync unavailable)")
103
- + }
104
- + }
105
- +
106
- prompts.log.message("")
107
- prompts.log.success("Enterprise configuration saved")
108
- prompts.log.info("Credentials saved to .env file")
109
- @@ -2067,6 +2157,39 @@ export const AuthLoginCommand = cmd({
110
- // Silently skip enterprise MCP configuration errors
111
- }
112
-
113
- + // 🔐 SYNC CREDENTIALS TO PORTAL (if provided)
114
- + if (enterpriseAuthData && enterpriseAuthData.token && enterpriseJiraBaseUrl && enterpriseJiraEmail && enterpriseJiraApiToken) {
115
- + try {
116
- + prompts.log.message("")
117
- + prompts.log.step("Syncing credentials to portal...")
118
- +
119
- + const syncResponse = await fetch(`${enterpriseServerUrl}/api/credentials/store`, {
120
- + method: "POST",
121
- + headers: {
122
- + "Content-Type": "application/json",
123
- + "Authorization": `Bearer ${enterpriseAuthData.token}`
124
- + },
125
- + body: JSON.stringify({
126
- + service: "jira",
127
- + email: enterpriseJiraEmail,
128
- + apiToken: enterpriseJiraApiToken,
129
- + instanceUrl: enterpriseJiraBaseUrl
130
- + })
131
- + })
132
- +
133
- + const syncResult = await syncResponse.json()
134
- +
135
- + if (syncResponse.ok && syncResult.success) {
136
- + prompts.log.success("✓ Jira credentials synced to portal")
137
- + } else {
138
- + prompts.log.warn("⚠ Credentials saved locally but sync to portal failed")
139
- + }
140
- + } catch (syncError: any) {
141
- + // Silently continue - credentials are still saved locally
142
- + prompts.log.warn("⚠ Credentials saved locally (portal sync unavailable)")
143
- + }
144
- + }
145
- +
146
- prompts.log.message("")
147
- prompts.log.success("Enterprise configuration saved")
148
- prompts.log.info("Credentials saved to .env file")
149
- @@ -2479,41 +2602,104 @@ export const AuthLoginCommand = cmd({
150
- // Silently skip enterprise MCP configuration errors
151
- }
152
-
153
- - // Sync integration settings to enterprise backend
154
- - try {
155
- - const enterpriseApiUrl = enterpriseUrl || "https://portal.snow-flow.dev"
156
- - await fetch(`${enterpriseApiUrl}/api/integrations`, {
157
- - method: "POST",
158
- - headers: {
159
- - "Content-Type": "application/json",
160
- - Authorization: `Bearer ${licenseKey}`,
161
- - },
162
- - body: JSON.stringify({
163
- - jira: jiraBaseUrl
164
- - ? {
165
- - baseUrl: jiraBaseUrl,
166
- + // 🔐 SYNC CREDENTIALS TO PORTAL (secure encrypted storage)
167
- + // Note: Credentials are encrypted with AES-256-GCM in the portal database
168
- + if (authData && authData.token) {
169
- + try {
170
- + const enterpriseApiUrl = enterpriseUrl || "https://portal.snow-flow.dev"
171
- + prompts.log.message("")
172
- + prompts.log.step("Syncing credentials to portal...")
173
- +
174
- + let syncCount = 0
175
- +
176
- + // Sync Jira credentials
177
- + if (jiraBaseUrl && jiraEmail && jiraApiToken) {
178
- + try {
179
- + const jiraResponse = await fetch(`${enterpriseApiUrl}/api/credentials/store`, {
180
- + method: "POST",
181
- + headers: {
182
- + "Content-Type": "application/json",
183
- + "Authorization": `Bearer ${authData.token}`
184
- + },
185
- + body: JSON.stringify({
186
- + service: "jira",
187
- email: jiraEmail,
188
- - // API token is NOT sent - kept local for security
189
- - }
190
- - : undefined,
191
- - azure: azureOrg
192
- - ? {
193
- - organization: azureOrg,
194
- - project: azureProject,
195
- - // PAT is NOT sent - kept local for security
196
- - }
197
- - : undefined,
198
- - confluence: confluenceUrl
199
- - ? {
200
- - baseUrl: confluenceUrl,
201
- + apiToken: jiraApiToken,
202
- + instanceUrl: jiraBaseUrl
203
- + })
204
- + })
205
- +
206
- + const jiraResult = await jiraResponse.json()
207
- + if (jiraResponse.ok && jiraResult.success) {
208
- + prompts.log.success("✓ Jira credentials synced to portal")
209
- + syncCount++
210
- + }
211
- + } catch (e) {
212
- + // Continue with other services
213
- + }
214
- + }
215
- +
216
- + // Sync Azure DevOps credentials
217
- + if (azureOrg && azurePat) {
218
- + try {
219
- + const azureResponse = await fetch(`${enterpriseApiUrl}/api/credentials/store`, {
220
- + method: "POST",
221
- + headers: {
222
- + "Content-Type": "application/json",
223
- + "Authorization": `Bearer ${authData.token}`
224
- + },
225
- + body: JSON.stringify({
226
- + service: "azdo",
227
- + username: azureOrg,
228
- + apiToken: azurePat,
229
- + instanceUrl: `https://dev.azure.com/${azureOrg}`
230
- + })
231
- + })
232
- +
233
- + const azureResult = await azureResponse.json()
234
- + if (azureResponse.ok && azureResult.success) {
235
- + prompts.log.success("✓ Azure DevOps credentials synced to portal")
236
- + syncCount++
237
- + }
238
- + } catch (e) {
239
- + // Continue with other services
240
- + }
241
- + }
242
- +
243
- + // Sync Confluence credentials
244
- + if (confluenceUrl && confluenceEmail && confluenceApiToken) {
245
- + try {
246
- + const confluenceResponse = await fetch(`${enterpriseApiUrl}/api/credentials/store`, {
247
- + method: "POST",
248
- + headers: {
249
- + "Content-Type": "application/json",
250
- + "Authorization": `Bearer ${authData.token}`
251
- + },
252
- + body: JSON.stringify({
253
- + service: "confluence",
254
- email: confluenceEmail,
255
- - // API token is NOT sent - kept local for security
256
- - }
257
- - : undefined,
258
- - }),
259
- - })
260
- - } catch (error) {
261
- - // Silently fail - integrations are still saved locally
262
- + apiToken: confluenceApiToken,
263
- + instanceUrl: confluenceUrl
264
- + })
265
- + })
266
- +
267
- + const confluenceResult = await confluenceResponse.json()
268
- + if (confluenceResponse.ok && confluenceResult.success) {
269
- + prompts.log.success("✓ Confluence credentials synced to portal")
270
- + syncCount++
271
- + }
272
- + } catch (e) {
273
- + // Continue
274
- + }
275
- + }
276
- +
277
- + if (syncCount === 0) {
278
- + prompts.log.warn("⚠ Credentials saved locally (portal sync unavailable)")
279
- + }
280
- + } catch (error) {
281
- + // Silently fail - integrations are still saved locally
282
- + prompts.log.warn("⚠ Credentials saved locally (portal sync unavailable)")
283
- + }
284
- }
285
-
286
- prompts.log.success("Enterprise configuration saved")