@snutils/snu 0.1.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/README.md +156 -0
- package/bin/snu.js +8 -0
- package/dist/cli/format.d.ts +14 -0
- package/dist/cli/format.d.ts.map +1 -0
- package/dist/cli/format.js +231 -0
- package/dist/cli/format.js.map +1 -0
- package/dist/cli/index.d.ts +4 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +296 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/stdin.d.ts +14 -0
- package/dist/cli/stdin.d.ts.map +1 -0
- package/dist/cli/stdin.js +75 -0
- package/dist/cli/stdin.js.map +1 -0
- package/dist/client.d.ts +43 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +350 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +185 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/registry.d.ts +5 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +527 -0
- package/dist/registry.js.map +1 -0
- package/dist/server/canonical.d.ts +10 -0
- package/dist/server/canonical.d.ts.map +1 -0
- package/dist/server/canonical.js +72 -0
- package/dist/server/canonical.js.map +1 -0
- package/dist/server/config.d.ts +9 -0
- package/dist/server/config.d.ts.map +1 -0
- package/dist/server/config.js +117 -0
- package/dist/server/config.js.map +1 -0
- package/dist/server/dispatcher.d.ts +32 -0
- package/dist/server/dispatcher.d.ts.map +1 -0
- package/dist/server/dispatcher.js +631 -0
- package/dist/server/dispatcher.js.map +1 -0
- package/dist/server/httpBridge.d.ts +20 -0
- package/dist/server/httpBridge.d.ts.map +1 -0
- package/dist/server/httpBridge.js +219 -0
- package/dist/server/httpBridge.js.map +1 -0
- package/dist/server/pendingRegistry.d.ts +26 -0
- package/dist/server/pendingRegistry.d.ts.map +1 -0
- package/dist/server/pendingRegistry.js +76 -0
- package/dist/server/pendingRegistry.js.map +1 -0
- package/dist/server/policy.d.ts +18 -0
- package/dist/server/policy.d.ts.map +1 -0
- package/dist/server/policy.js +53 -0
- package/dist/server/policy.js.map +1 -0
- package/dist/server/standalone.d.ts +24 -0
- package/dist/server/standalone.d.ts.map +1 -0
- package/dist/server/standalone.js +152 -0
- package/dist/server/standalone.js.map +1 -0
- package/dist/server/wsBridge.d.ts +45 -0
- package/dist/server/wsBridge.d.ts.map +1 -0
- package/dist/server/wsBridge.js +321 -0
- package/dist/server/wsBridge.js.map +1 -0
- package/dist/types.d.ts +123 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/package.json +51 -0
package/README.md
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# SN Utils Bridge (`@snutils/snu`)
|
|
2
|
+
|
|
3
|
+
Unified CLI and Model Context Protocol (MCP) server for ServiceNow development, powered by **SN Utils** and **ScriptSync**.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Zero Manual Credentials:** Connects to your live browser session via SN Utils, automatically inheriting authenticated SSO/MFA sessions, cookies, update set, and application scope.
|
|
10
|
+
- **Dual Mode (CLI + MCP):** Use it as a terminal command tool (`snu query`, `snu search`, `snu schema`) or as an MCP server (`snu --mcp`) in Cursor, Windsurf, Claude Desktop, and Antigravity.
|
|
11
|
+
- **Works Attached & Standalone:** Operates seamlessly when VS Code is open (Attached Mode), or completely standalone without VS Code (Standalone Mode with in-process bridge and auto-handover).
|
|
12
|
+
- **14 Strictly-Typed Tools:** Fast GraphQL code search, schema dictionary inspection, record queries, CRUD operations, background script execution, and live form automation.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 1. Installation & Quickstart
|
|
17
|
+
|
|
18
|
+
### Using `npx` (No Installation Needed)
|
|
19
|
+
```bash
|
|
20
|
+
# Run a quick query
|
|
21
|
+
npx @snutils/snu query incident "active=true" --limit 5
|
|
22
|
+
|
|
23
|
+
# Inspect table schema
|
|
24
|
+
npx @snutils/snu schema sys_user
|
|
25
|
+
|
|
26
|
+
# Fast code search across script includes
|
|
27
|
+
npx @snutils/snu search "GlideRecord"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Global Install
|
|
31
|
+
```bash
|
|
32
|
+
npm install -g @snutils/snu
|
|
33
|
+
|
|
34
|
+
# Now run 'snu' anywhere
|
|
35
|
+
snu context
|
|
36
|
+
snu query sys_script_include "active=true"
|
|
37
|
+
snu run "gs.print('Hello from ' + gs.getUserName());"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 2. MCP Configuration (Cursor / Claude Desktop / Windsurf)
|
|
43
|
+
|
|
44
|
+
Add the following block to your editor's MCP configuration (`mcp.json` or `claude_desktop_config.json`):
|
|
45
|
+
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"mcpServers": {
|
|
49
|
+
"sn-utils": {
|
|
50
|
+
"command": "npx",
|
|
51
|
+
"args": ["-y", "@snutils/snu", "--mcp"]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Or if installed globally:
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"mcpServers": {
|
|
61
|
+
"sn-utils": {
|
|
62
|
+
"command": "snu",
|
|
63
|
+
"args": ["--mcp"]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
> **Standalone MCP:** When you launch `snu --mcp`, it automatically detects if VS Code is running. If not, it spins up an in-process standalone bridge so your AI editor connects directly to your browser's SN Utils helper tab with zero extra steps.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 3. CLI Command Reference
|
|
74
|
+
|
|
75
|
+
### Context, Standalone Daemon & Code Search
|
|
76
|
+
```bash
|
|
77
|
+
# Show active connection, helper tab, and instance roster
|
|
78
|
+
snu context
|
|
79
|
+
|
|
80
|
+
# Start a persistent standalone bridge daemon
|
|
81
|
+
snu serve
|
|
82
|
+
|
|
83
|
+
# GraphQL field-index code search across script tables (Pro)
|
|
84
|
+
snu search "OAuthUtil" --tables sys_script_include,sys_ui_action --limit 20
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Query & Schema
|
|
88
|
+
```bash
|
|
89
|
+
# Inspect table dictionary columns, types, references, choices
|
|
90
|
+
snu schema incident
|
|
91
|
+
|
|
92
|
+
# Query records with encoded queries and field projections
|
|
93
|
+
snu query incident "priority=1^active=true" --fields number,short_description,sys_created_on --limit 10
|
|
94
|
+
|
|
95
|
+
# Output strict JSON for terminal scripting or piping into jq
|
|
96
|
+
snu query incident --json | jq '.records[].number'
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Record Operations
|
|
100
|
+
```bash
|
|
101
|
+
# Fetch record by sys_id
|
|
102
|
+
snu record get incident <sys_id>
|
|
103
|
+
|
|
104
|
+
# Update record field (direct value, from file, or piped via stdin)
|
|
105
|
+
snu record update incident <sys_id> short_description --value "Database latency resolved"
|
|
106
|
+
snu record update sys_script_include <sys_id> script --file ./my_script.js
|
|
107
|
+
cat ./script.js | snu record update sys_script_include <sys_id> script
|
|
108
|
+
|
|
109
|
+
# Create a scriptable artifact (Script Include, Business Rule, etc.)
|
|
110
|
+
snu artifact create sys_script_include MyNewHelper --fields '{"script":"var MyNewHelper = Class.create();"}'
|
|
111
|
+
|
|
112
|
+
# Delete record (--confirm required for safety, or --dry-run to inspect)
|
|
113
|
+
snu record delete incident <sys_id> --dry-run
|
|
114
|
+
snu record delete incident <sys_id> --confirm
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Background Scripts
|
|
118
|
+
```bash
|
|
119
|
+
# Run server-side JavaScript on the instance
|
|
120
|
+
snu run "gs.print('User: ' + gs.getUserName());"
|
|
121
|
+
snu run --file ./fix_script.js
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Browser & Live Form Automation
|
|
125
|
+
```bash
|
|
126
|
+
# Read live form fields from active ServiceNow browser tab
|
|
127
|
+
snu browser form
|
|
128
|
+
|
|
129
|
+
# Set form field via g_form (triggers client scripts / policies)
|
|
130
|
+
snu browser set short_description "Network disruption"
|
|
131
|
+
|
|
132
|
+
# Trigger a UI action on the active form
|
|
133
|
+
snu browser action sysverb_update
|
|
134
|
+
|
|
135
|
+
# Navigate active browser tab to a URL
|
|
136
|
+
snu browser nav "https://myinstance.service-now.com/incident.do?sys_id=-1"
|
|
137
|
+
|
|
138
|
+
# Capture viewport screenshot of ServiceNow tab (saved to screenshots/)
|
|
139
|
+
snu screenshot
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 4. How It Works & Handover Protocol
|
|
145
|
+
|
|
146
|
+
- **Attached Mode (VS Code Open):** `snu` connects to the local **ScriptSync Agent HTTP API** on `127.0.0.1:1977` (with token discovery via `.vscode/sn-agent-port.json` or `~/.sn-scriptsync/agent-port.json`), which relays commands over a local WebSocket to the **SN Utils browser extension**.
|
|
147
|
+
- **Standalone Mode (VS Code Closed):** `snu serve` (or `snu --mcp`) hosts the WebSocket server on `127.0.0.1:1978` and HTTP API on `127.0.0.1:1977`.
|
|
148
|
+
- **Safe Handover:** When VS Code launches while a standalone bridge is active, VS Code sends an automated `yield` signal to acquire the WebSocket and HTTP ports cleanly without port collisions.
|
|
149
|
+
|
|
150
|
+
All credentials stay in your browser—zero tokens or passwords are ever stored or sent over the internet.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## License
|
|
155
|
+
|
|
156
|
+
MIT © [SN Utils B.V. / Arnoud Kooi](https://snutils.com)
|
package/bin/snu.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal formatters and JSON output renderer for @snutils/snu CLI
|
|
3
|
+
*/
|
|
4
|
+
export declare function formatTable(headers: string[], rows: string[][]): string;
|
|
5
|
+
export declare function formatHumanOutput(command: string, result: any): string;
|
|
6
|
+
/**
|
|
7
|
+
* Output strict JSON on stdout on success.
|
|
8
|
+
*/
|
|
9
|
+
export declare function outputJson(data: any): void;
|
|
10
|
+
/**
|
|
11
|
+
* Output structured error on stderr.
|
|
12
|
+
*/
|
|
13
|
+
export declare function outputError(err: any, isJsonMode?: boolean): void;
|
|
14
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/cli/format.ts"],"names":[],"mappings":"AAAA;;GAEG;AAqBH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,CAkCvE;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,MAAM,CAmKtE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,CAE1C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,UAAU,UAAQ,GAAG,IAAI,CAwB9D"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Terminal formatters and JSON output renderer for @snutils/snu CLI
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.formatTable = formatTable;
|
|
7
|
+
exports.formatHumanOutput = formatHumanOutput;
|
|
8
|
+
exports.outputJson = outputJson;
|
|
9
|
+
exports.outputError = outputError;
|
|
10
|
+
const ANSI = {
|
|
11
|
+
reset: '\x1b[0m',
|
|
12
|
+
bold: '\x1b[1m',
|
|
13
|
+
dim: '\x1b[2m',
|
|
14
|
+
italic: '\x1b[3m',
|
|
15
|
+
underline: '\x1b[4m',
|
|
16
|
+
green: '\x1b[32m',
|
|
17
|
+
yellow: '\x1b[33m',
|
|
18
|
+
blue: '\x1b[34m',
|
|
19
|
+
magenta: '\x1b[35m',
|
|
20
|
+
cyan: '\x1b[36m',
|
|
21
|
+
red: '\x1b[31m',
|
|
22
|
+
gray: '\x1b[90m',
|
|
23
|
+
};
|
|
24
|
+
function stripAnsi(str) {
|
|
25
|
+
return str.replace(/\x1b\[[0-9;]*m/g, '');
|
|
26
|
+
}
|
|
27
|
+
function formatTable(headers, rows) {
|
|
28
|
+
if (rows.length === 0)
|
|
29
|
+
return `${ANSI.gray}(no records)${ANSI.reset}`;
|
|
30
|
+
const colWidths = headers.map((h, i) => {
|
|
31
|
+
let max = stripAnsi(h).length;
|
|
32
|
+
for (const row of rows) {
|
|
33
|
+
const cell = row[i] ? stripAnsi(row[i]) : '';
|
|
34
|
+
if (cell.length > max)
|
|
35
|
+
max = cell.length;
|
|
36
|
+
}
|
|
37
|
+
return Math.min(max, 60); // Cap column width at 60 chars
|
|
38
|
+
});
|
|
39
|
+
const headerLine = headers
|
|
40
|
+
.map((h, i) => `${ANSI.bold}${h.padEnd(colWidths[i])}${ANSI.reset}`)
|
|
41
|
+
.join(' ');
|
|
42
|
+
const dividerLine = colWidths
|
|
43
|
+
.map((w) => `${ANSI.gray}${'-'.repeat(w)}${ANSI.reset}`)
|
|
44
|
+
.join(' ');
|
|
45
|
+
const formattedRows = rows.map((row) => row
|
|
46
|
+
.map((cell, i) => {
|
|
47
|
+
const raw = cell || '';
|
|
48
|
+
const plain = stripAnsi(raw);
|
|
49
|
+
const w = colWidths[i];
|
|
50
|
+
if (plain.length > w) {
|
|
51
|
+
return raw.slice(0, w - 1) + '…';
|
|
52
|
+
}
|
|
53
|
+
return raw + ' '.repeat(Math.max(0, w - plain.length));
|
|
54
|
+
})
|
|
55
|
+
.join(' '));
|
|
56
|
+
return [headerLine, dividerLine, ...formattedRows].join('\n');
|
|
57
|
+
}
|
|
58
|
+
function formatHumanOutput(command, result) {
|
|
59
|
+
if (!result)
|
|
60
|
+
return `${ANSI.gray}(empty result)${ANSI.reset}`;
|
|
61
|
+
// Staged Write Response
|
|
62
|
+
if (result.staged === true) {
|
|
63
|
+
return (`\n${ANSI.yellow}${ANSI.bold}[Staged]${ANSI.reset} ` +
|
|
64
|
+
`${result.message || 'Write staged for review in VS Code.'}\n` +
|
|
65
|
+
`${ANSI.gray}Review ID: ${result.reviewId || 'n/a'} · Approve in Pending Saves queue or via Sync Now in VS Code.${ANSI.reset}\n`);
|
|
66
|
+
}
|
|
67
|
+
// 1. Context
|
|
68
|
+
if (command === 'get_context') {
|
|
69
|
+
const lines = [''];
|
|
70
|
+
const bridgeBadge = result.bridgeReady
|
|
71
|
+
? `${ANSI.green}● Active${ANSI.reset}`
|
|
72
|
+
: `${ANSI.red}● Inactive${ANSI.reset}`;
|
|
73
|
+
const snBadge = result.serviceNowReady
|
|
74
|
+
? `${ANSI.green}● Connected${ANSI.reset}`
|
|
75
|
+
: result.browserConnected
|
|
76
|
+
? `${ANSI.yellow}● Browser Connected (No License / Session)${ANSI.reset}`
|
|
77
|
+
: `${ANSI.yellow}○ Disconnected${ANSI.reset}`;
|
|
78
|
+
lines.push(`${ANSI.bold}ScriptSync Bridge Status:${ANSI.reset}`);
|
|
79
|
+
lines.push(` Bridge Daemon: ${bridgeBadge}`);
|
|
80
|
+
lines.push(` ServiceNow Tab: ${snBadge}`);
|
|
81
|
+
if (result.helper) {
|
|
82
|
+
lines.push(` Helper Tier: ${ANSI.cyan}${result.helper.tier || 'Free'}${ANSI.reset}${result.helper.proFeatures ? ` (${ANSI.green}Pro Active${ANSI.reset})` : ''}`);
|
|
83
|
+
}
|
|
84
|
+
if (result.gates) {
|
|
85
|
+
lines.push(`\n${ANSI.bold}Capabilities & Effective Permission Gates:${ANSI.reset}`);
|
|
86
|
+
const formatGate = (label, enabled) => {
|
|
87
|
+
const badge = enabled ? `${ANSI.green}● Enabled${ANSI.reset}` : `${ANSI.gray}○ Disabled${ANSI.reset}`;
|
|
88
|
+
return ` • ${label.padEnd(22)} ${badge}`;
|
|
89
|
+
};
|
|
90
|
+
lines.push(formatGate('Background Scripts', result.gates.backgroundScripts));
|
|
91
|
+
lines.push(formatGate('Delete Records', result.gates.deleteRecords));
|
|
92
|
+
lines.push(formatGate('Create Artifacts', result.gates.createArtifacts));
|
|
93
|
+
lines.push(formatGate('Browser Debugger', result.gates.browserDebugger));
|
|
94
|
+
lines.push(formatGate('REST Request API', result.gates.restRequest));
|
|
95
|
+
}
|
|
96
|
+
if (result.instances && result.instances.length > 0) {
|
|
97
|
+
lines.push(`\n${ANSI.bold}Workspace Instances (${result.instances.length}):${ANSI.reset}`);
|
|
98
|
+
for (const inst of result.instances) {
|
|
99
|
+
const isDefault = inst.name === result.defaultInstance ? ` ${ANSI.cyan}(default)${ANSI.reset}` : '';
|
|
100
|
+
const activeAge = inst.lastActiveAgeMs !== null ? `${ANSI.gray}${Math.round(inst.lastActiveAgeMs / 60000)}m ago${ANSI.reset}` : `${ANSI.gray}never active${ANSI.reset}`;
|
|
101
|
+
lines.push(` • ${ANSI.bold}${inst.name}${ANSI.reset}${isDefault} → ${inst.url || '(no URL)'} [${activeAge}]`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (result.message && !result.serviceNowReady) {
|
|
105
|
+
lines.push(`\n${ANSI.yellow}Note: ${result.message}${ANSI.reset}`);
|
|
106
|
+
}
|
|
107
|
+
return lines.join('\n');
|
|
108
|
+
}
|
|
109
|
+
// 2. Code Search
|
|
110
|
+
if (command === 'code_search') {
|
|
111
|
+
const lines = [];
|
|
112
|
+
const stats = result.stats || {};
|
|
113
|
+
lines.push(`\n${ANSI.bold}Search Results for "${result.term}":${ANSI.reset} ` +
|
|
114
|
+
`${ANSI.gray}(${stats.matches || 0} matches across ${stats.records || 0} records in ${stats.tables || 0} tables)${ANSI.reset}\n`);
|
|
115
|
+
const tables = result.results || [];
|
|
116
|
+
if (tables.length === 0) {
|
|
117
|
+
lines.push(`${ANSI.gray}No matches found.${ANSI.reset}`);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
for (const t of tables) {
|
|
121
|
+
lines.push(`${ANSI.bold}${ANSI.cyan}${t.label} (${t.table})${ANSI.reset} — ${t.hits?.length || 0} match(es)`);
|
|
122
|
+
for (const hit of t.hits || []) {
|
|
123
|
+
const matchField = hit.field ? ` (${hit.field})` : '';
|
|
124
|
+
lines.push(` • ${hit.name || hit.sys_id}${matchField} [${hit.sys_id}]`);
|
|
125
|
+
if (hit.matches && hit.matches.length > 0) {
|
|
126
|
+
for (const m of hit.matches.slice(0, 3)) {
|
|
127
|
+
lines.push(` ${ANSI.gray}Line ${m.line}:${ANSI.reset} ${m.preview?.trim()}`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
lines.push('');
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return lines.join('\n');
|
|
135
|
+
}
|
|
136
|
+
// 3. Schema
|
|
137
|
+
if (command === 'get_table_metadata') {
|
|
138
|
+
const fields = Array.isArray(result) ? result : result.fields || result.columns || [];
|
|
139
|
+
if (!Array.isArray(fields) || fields.length === 0) {
|
|
140
|
+
return '\n' + JSON.stringify(result, null, 2) + '\n';
|
|
141
|
+
}
|
|
142
|
+
const headers = ['Element', 'Label', 'Type', 'Max Len', 'Mandatory', 'Reference'];
|
|
143
|
+
const rows = fields.map((f) => [
|
|
144
|
+
f.name || f.element || '',
|
|
145
|
+
f.label || '',
|
|
146
|
+
f.type || '',
|
|
147
|
+
String(f.max_length || f.length || ''),
|
|
148
|
+
f.mandatory === true || f.mandatory === 'true' ? 'Yes' : 'No',
|
|
149
|
+
f.reference || '',
|
|
150
|
+
]);
|
|
151
|
+
return `\n${ANSI.bold}Schema Dictionary (${fields.length} columns):${ANSI.reset}\n\n` + formatTable(headers, rows) + '\n';
|
|
152
|
+
}
|
|
153
|
+
// 4. Query Records
|
|
154
|
+
if (command === 'query_records') {
|
|
155
|
+
const records = result.records || (Array.isArray(result) ? result : []);
|
|
156
|
+
if (!Array.isArray(records) || records.length === 0) {
|
|
157
|
+
return `\n${ANSI.gray}No records returned.${ANSI.reset}\n`;
|
|
158
|
+
}
|
|
159
|
+
// Extract columns from first record
|
|
160
|
+
const first = records[0];
|
|
161
|
+
const candidateKeys = Object.keys(first).filter((k) => !k.startsWith('@') && typeof first[k] !== 'object');
|
|
162
|
+
const priority = ['sys_id', 'number', 'name', 'short_description', 'sys_updated_on', 'sys_created_on'];
|
|
163
|
+
const selectedHeaders = [
|
|
164
|
+
...priority.filter((k) => candidateKeys.includes(k)),
|
|
165
|
+
...candidateKeys.filter((k) => !priority.includes(k)),
|
|
166
|
+
].slice(0, 5);
|
|
167
|
+
const rows = records.map((r) => selectedHeaders.map((h) => {
|
|
168
|
+
const val = r[h];
|
|
169
|
+
if (val === null || val === undefined)
|
|
170
|
+
return '';
|
|
171
|
+
if (typeof val === 'object' && val.display_value !== undefined)
|
|
172
|
+
return String(val.display_value);
|
|
173
|
+
return String(val);
|
|
174
|
+
}));
|
|
175
|
+
return `\n` + formatTable(selectedHeaders, rows) + `\n\n${ANSI.gray}Showing ${records.length} record(s) on ${result.table || 'table'}.${ANSI.reset}\n`;
|
|
176
|
+
}
|
|
177
|
+
// 5. Run Background Script Output
|
|
178
|
+
if (command === 'run_background_script') {
|
|
179
|
+
const out = result.output || result.data || '';
|
|
180
|
+
return `\n${ANSI.bold}Script Output:${ANSI.reset}\n----------------------------------------\n${out}\n----------------------------------------\n`;
|
|
181
|
+
}
|
|
182
|
+
// 6. Generic Object/Status Responses
|
|
183
|
+
if (result.created) {
|
|
184
|
+
return `\n${ANSI.green}✓ Created ${result.table || 'artifact'}:${ANSI.reset} ${result.name || result.sys_id} (${result.sys_id})\n`;
|
|
185
|
+
}
|
|
186
|
+
if (result.updated) {
|
|
187
|
+
return `\n${ANSI.green}✓ Updated record:${ANSI.reset} ${result.sys_id} (${result.field || 'field'})\n`;
|
|
188
|
+
}
|
|
189
|
+
if (result.deleted) {
|
|
190
|
+
return `\n${ANSI.green}✓ Deleted record:${ANSI.reset} ${result.sys_id || result.name || ''}\n`;
|
|
191
|
+
}
|
|
192
|
+
if (result.dryRun) {
|
|
193
|
+
return `\n${ANSI.yellow}[Dry Run] Target record that would be deleted:${ANSI.reset}\n${JSON.stringify(result.record, null, 2)}\n`;
|
|
194
|
+
}
|
|
195
|
+
if (result.saved && result.filePath) {
|
|
196
|
+
return `\n${ANSI.green}✓ Screenshot saved to:${ANSI.reset} ${result.filePath}\n`;
|
|
197
|
+
}
|
|
198
|
+
return '\n' + JSON.stringify(result, null, 2) + '\n';
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Output strict JSON on stdout on success.
|
|
202
|
+
*/
|
|
203
|
+
function outputJson(data) {
|
|
204
|
+
process.stdout.write(JSON.stringify(data, null, 2) + '\n');
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Output structured error on stderr.
|
|
208
|
+
*/
|
|
209
|
+
function outputError(err, isJsonMode = false) {
|
|
210
|
+
const errorObj = {
|
|
211
|
+
status: 'error',
|
|
212
|
+
error: err?.message || String(err),
|
|
213
|
+
code: err?.code || 'E_COMMAND_FAILED',
|
|
214
|
+
status_code: err?.status || null,
|
|
215
|
+
details: err?.details || null,
|
|
216
|
+
};
|
|
217
|
+
if (isJsonMode) {
|
|
218
|
+
process.stderr.write(JSON.stringify(errorObj, null, 2) + '\n');
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
if (err?.code === 'E_USER_REJECTED') {
|
|
222
|
+
const feedback = err.details?.userFeedback || err.message;
|
|
223
|
+
process.stderr.write(`\n${ANSI.red}${ANSI.bold}✕ Execution rejected by developer:${ANSI.reset} "${feedback}" ${ANSI.gray}(E_USER_REJECTED)${ANSI.reset}\n`);
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
process.stderr.write(`\n${ANSI.red}${ANSI.bold}Error:${ANSI.reset} ${err?.message || err}\n` +
|
|
227
|
+
(err?.code ? `${ANSI.gray}Code: ${err.code}${ANSI.reset}\n` : ''));
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/cli/format.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAqBH,kCAkCC;AAED,8CAmKC;AAKD,gCAEC;AAKD,kCAwBC;AA9PD,MAAM,IAAI,GAAG;IACX,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,SAAS;IACd,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,SAAS;IACpB,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,UAAU;IACnB,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,UAAU;IACf,IAAI,EAAE,UAAU;CACjB,CAAC;AAEF,SAAS,SAAS,CAAC,GAAW;IAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,SAAgB,WAAW,CAAC,OAAiB,EAAE,IAAgB;IAC7D,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,IAAI,CAAC,IAAI,eAAe,IAAI,CAAC,KAAK,EAAE,CAAC;IAEtE,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACrC,IAAI,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC9B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;Y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