snow-flow 4.2.3 ā 4.2.4
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/dist/cli.js +1 -91
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1590,97 +1590,7 @@ program
|
|
|
1590
1590
|
cliLogger.error('ā Invalid memory operation');
|
|
1591
1591
|
}
|
|
1592
1592
|
});
|
|
1593
|
-
// Auth
|
|
1594
|
-
program
|
|
1595
|
-
.command('auth <action>')
|
|
1596
|
-
.description('Authentication management (login, logout, status)')
|
|
1597
|
-
.option('--instance <instance>', 'ServiceNow instance (e.g., dev12345.service-now.com)')
|
|
1598
|
-
.option('--client-id <clientId>', 'OAuth Client ID')
|
|
1599
|
-
.option('--client-secret <clientSecret>', 'OAuth Client Secret')
|
|
1600
|
-
.action(async (action, options) => {
|
|
1601
|
-
const oauth = new snow_oauth_js_1.ServiceNowOAuth();
|
|
1602
|
-
if (action === 'login') {
|
|
1603
|
-
cliLogger.info('š Starting ServiceNow OAuth authentication...');
|
|
1604
|
-
// Get credentials from options or environment
|
|
1605
|
-
const instance = options.instance || process.env.SNOW_INSTANCE;
|
|
1606
|
-
const clientId = options.clientId || process.env.SNOW_CLIENT_ID;
|
|
1607
|
-
const clientSecret = options.clientSecret || process.env.SNOW_CLIENT_SECRET;
|
|
1608
|
-
if (!instance || !clientId || !clientSecret) {
|
|
1609
|
-
console.error('ā Missing required OAuth credentials');
|
|
1610
|
-
cliLogger.info('\nš Please provide:');
|
|
1611
|
-
cliLogger.info(' --instance: ServiceNow instance (e.g., dev12345.service-now.com)');
|
|
1612
|
-
cliLogger.info(' --client-id: OAuth Client ID');
|
|
1613
|
-
cliLogger.info(' --client-secret: OAuth Client Secret');
|
|
1614
|
-
cliLogger.info('\nš” Or set environment variables:');
|
|
1615
|
-
cliLogger.info(' export SNOW_INSTANCE=your-instance.service-now.com');
|
|
1616
|
-
cliLogger.info(' export SNOW_CLIENT_ID=your-client-id');
|
|
1617
|
-
cliLogger.info(' export SNOW_CLIENT_SECRET=your-client-secret');
|
|
1618
|
-
return;
|
|
1619
|
-
}
|
|
1620
|
-
// Start OAuth flow
|
|
1621
|
-
const result = await oauth.authenticate(instance, clientId, clientSecret);
|
|
1622
|
-
if (result.success) {
|
|
1623
|
-
cliLogger.info('\nā
Authentication successful!');
|
|
1624
|
-
cliLogger.info('š Snow-Flow is now connected to ServiceNow!');
|
|
1625
|
-
cliLogger.info('\nš Next steps:');
|
|
1626
|
-
cliLogger.info(' 1. Test connection: snow-flow auth status');
|
|
1627
|
-
cliLogger.info(' 2. Start development: snow-flow swarm "create a widget for incident management"');
|
|
1628
|
-
// Test connection
|
|
1629
|
-
const client = new servicenow_client_js_1.ServiceNowClient();
|
|
1630
|
-
const testResult = await client.testConnection();
|
|
1631
|
-
if (testResult.success) {
|
|
1632
|
-
cliLogger.info(`\nš Connection test successful!`);
|
|
1633
|
-
cliLogger.info(`š¤ Logged in as: ${testResult.data.name} (${testResult.data.user_name})`);
|
|
1634
|
-
}
|
|
1635
|
-
}
|
|
1636
|
-
else {
|
|
1637
|
-
console.error(`\nā Authentication failed: ${result.error}`);
|
|
1638
|
-
process.exit(1);
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1641
|
-
else if (action === 'logout') {
|
|
1642
|
-
cliLogger.info('š Logging out...');
|
|
1643
|
-
await oauth.logout();
|
|
1644
|
-
}
|
|
1645
|
-
else if (action === 'status') {
|
|
1646
|
-
cliLogger.info('š Authentication Status:');
|
|
1647
|
-
const isAuthenticated = await oauth.isAuthenticated();
|
|
1648
|
-
const credentials = await oauth.loadCredentials();
|
|
1649
|
-
if (isAuthenticated && credentials) {
|
|
1650
|
-
console.log(' āāā Status: ā
Authenticated');
|
|
1651
|
-
console.log(` āāā Instance: ${credentials.instance}`);
|
|
1652
|
-
console.log(' āāā Method: OAuth 2.0');
|
|
1653
|
-
console.log(` āāā Client ID: ${credentials.clientId}`);
|
|
1654
|
-
if (credentials.expiresAt) {
|
|
1655
|
-
const expiresAt = new Date(credentials.expiresAt);
|
|
1656
|
-
console.log(` āāā Token expires: ${expiresAt.toLocaleString()}`);
|
|
1657
|
-
}
|
|
1658
|
-
// Test connection
|
|
1659
|
-
const client = new servicenow_client_js_1.ServiceNowClient();
|
|
1660
|
-
const testResult = await client.testConnection();
|
|
1661
|
-
if (testResult.success) {
|
|
1662
|
-
console.log(`\nš Connection test: ā
Success`);
|
|
1663
|
-
if (testResult.data.message) {
|
|
1664
|
-
console.log(` ${testResult.data.message}`);
|
|
1665
|
-
}
|
|
1666
|
-
console.log(`š Instance: ${testResult.data.email || credentials.instance}`);
|
|
1667
|
-
}
|
|
1668
|
-
else {
|
|
1669
|
-
console.log(`\nš Connection test: ā Failed`);
|
|
1670
|
-
console.log(` Error: ${testResult.error}`);
|
|
1671
|
-
}
|
|
1672
|
-
}
|
|
1673
|
-
else {
|
|
1674
|
-
console.log(' āāā Status: ā Not authenticated');
|
|
1675
|
-
console.log(' āāā Instance: Not configured');
|
|
1676
|
-
console.log(' āāā Method: Not set');
|
|
1677
|
-
console.log('\nš” Run "snow-flow auth login" to authenticate');
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
else {
|
|
1681
|
-
console.log('ā Invalid action. Use: login, logout, or status');
|
|
1682
|
-
}
|
|
1683
|
-
});
|
|
1593
|
+
// Auth commands are now handled by registerAuthCommands() at the top of this file
|
|
1684
1594
|
// Initialize Snow-Flow project
|
|
1685
1595
|
program
|
|
1686
1596
|
.command('init')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snow-flow",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.4",
|
|
4
4
|
"description": "Conversational ServiceNow development platform using Claude Code. Multi-agent orchestration with 20+ MCP servers providing 200+ ServiceNow tools for comprehensive platform development.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "commonjs",
|