checkly 7.4.0 → 7.5.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/dist/ai-context/checkly.rules.md +55 -17
- package/dist/ai-context/context.d.ts +76 -24
- package/dist/ai-context/context.js +48 -25
- package/dist/ai-context/context.js.map +1 -1
- package/dist/ai-context/public-skills/checkly/README.md +39 -0
- package/dist/ai-context/public-skills/checkly/SKILL.md +65 -0
- package/dist/ai-context/{skills/monitoring/references/api-checks.md → skills-command/references/configure-api-checks.md} +1 -1
- package/dist/ai-context/skills-command/references/configure-dns-monitors.md +38 -0
- package/dist/ai-context/skills-command/references/configure-heartbeat-monitors.md +33 -0
- package/dist/ai-context/skills-command/references/configure-icmp-monitors.md +41 -0
- package/dist/ai-context/skills-command/references/configure-tcp-monitors.md +45 -0
- package/dist/ai-context/skills-command/references/configure-url-monitors.md +43 -0
- package/dist/ai-context/{skills/monitoring/SKILL.md → skills-command/references/configure.md} +40 -17
- package/dist/ai-context/skills-command/references/initialize.md +116 -0
- package/dist/commands/baseCommand.d.ts +3 -0
- package/dist/commands/baseCommand.js +3 -0
- package/dist/commands/baseCommand.js.map +1 -1
- package/dist/commands/incidents/create.d.ts +15 -0
- package/dist/commands/incidents/create.js +107 -0
- package/dist/commands/incidents/create.js.map +1 -0
- package/dist/commands/incidents/list.d.ts +12 -0
- package/dist/commands/incidents/list.js +107 -0
- package/dist/commands/incidents/list.js.map +1 -0
- package/dist/commands/incidents/resolve.d.ts +14 -0
- package/dist/commands/incidents/resolve.js +87 -0
- package/dist/commands/incidents/resolve.js.map +1 -0
- package/dist/commands/incidents/update.d.ts +16 -0
- package/dist/commands/incidents/update.js +111 -0
- package/dist/commands/incidents/update.js.map +1 -0
- package/dist/commands/skills.d.ts +12 -0
- package/dist/commands/skills.js +104 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/formatters/incidents.d.ts +7 -0
- package/dist/formatters/incidents.js +186 -0
- package/dist/formatters/incidents.js.map +1 -0
- package/dist/help/help-extension.js +17 -6
- package/dist/help/help-extension.js.map +1 -1
- package/dist/helpers/cli-mode.d.ts +3 -0
- package/dist/helpers/cli-mode.js +46 -0
- package/dist/helpers/cli-mode.js.map +1 -0
- package/dist/helpers/command-preview.d.ts +24 -0
- package/dist/helpers/command-preview.js +51 -0
- package/dist/helpers/command-preview.js.map +1 -0
- package/dist/helpers/flags.d.ts +2 -0
- package/dist/helpers/flags.js +16 -1
- package/dist/helpers/flags.js.map +1 -1
- package/dist/helpers/incidents.d.ts +15 -0
- package/dist/helpers/incidents.js +58 -0
- package/dist/helpers/incidents.js.map +1 -0
- package/dist/rest/api.d.ts +2 -1
- package/dist/rest/api.js +5 -24
- package/dist/rest/api.js.map +1 -1
- package/dist/rest/incidents.d.ts +60 -0
- package/dist/rest/incidents.js +30 -0
- package/dist/rest/incidents.js.map +1 -0
- package/dist/rest/status-pages.d.ts +3 -0
- package/dist/rest/status-pages.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/oclif.manifest.json +541 -110
- package/package.json +7 -1
- package/dist/ai-context/skills/monitoring/README.md +0 -55
- package/dist/ai-context/skills/monitoring/references/uptime-monitors.md +0 -206
- /package/dist/ai-context/{skills/monitoring/references/alert-channels.md → skills-command/references/configure-alert-channels.md} +0 -0
- /package/dist/ai-context/{skills/monitoring/references/browser-checks.md → skills-command/references/configure-browser-checks.md} +0 -0
- /package/dist/ai-context/{skills/monitoring/references/check-groups.md → skills-command/references/configure-check-groups.md} +0 -0
- /package/dist/ai-context/{skills/monitoring/references/multistep-checks.md → skills-command/references/configure-multistep-checks.md} +0 -0
- /package/dist/ai-context/{skills/monitoring/references/playwright-checks.md → skills-command/references/configure-playwright-checks.md} +0 -0
- /package/dist/ai-context/{skills/monitoring/references/supporting-constructs.md → skills-command/references/configure-supporting-constructs.md} +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AuthCommand } from '../authCommand';
|
|
2
|
+
export default class IncidentsUpdate extends AuthCommand {
|
|
3
|
+
static hidden: boolean;
|
|
4
|
+
static description: string;
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
message: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
status: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
severity: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'notify-subscribers': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const core_1 = require("@oclif/core");
|
|
30
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
31
|
+
const authCommand_1 = require("../authCommand");
|
|
32
|
+
const flags_1 = require("../../helpers/flags");
|
|
33
|
+
const api = __importStar(require("../../rest/api"));
|
|
34
|
+
const incidents_1 = require("../../formatters/incidents");
|
|
35
|
+
const incidents_2 = require("../../helpers/incidents");
|
|
36
|
+
class IncidentsUpdate extends authCommand_1.AuthCommand {
|
|
37
|
+
static hidden = false;
|
|
38
|
+
static description = 'Post a progress update to an incident.';
|
|
39
|
+
static args = {
|
|
40
|
+
id: core_1.Args.string({
|
|
41
|
+
description: 'The incident ID.',
|
|
42
|
+
required: true,
|
|
43
|
+
}),
|
|
44
|
+
};
|
|
45
|
+
static flags = {
|
|
46
|
+
'message': core_1.Flags.string({
|
|
47
|
+
description: 'Update message.',
|
|
48
|
+
required: true,
|
|
49
|
+
}),
|
|
50
|
+
'status': core_1.Flags.string({
|
|
51
|
+
description: 'Incident progress status.',
|
|
52
|
+
options: incidents_2.incidentProgressStatusOptions,
|
|
53
|
+
default: 'investigating',
|
|
54
|
+
}),
|
|
55
|
+
'severity': core_1.Flags.string({
|
|
56
|
+
description: 'Update the overall incident severity.',
|
|
57
|
+
options: incidents_2.incidentSeverityOptions,
|
|
58
|
+
}),
|
|
59
|
+
'notify-subscribers': core_1.Flags.boolean({
|
|
60
|
+
description: 'Notify status page subscribers about this incident update.',
|
|
61
|
+
default: true,
|
|
62
|
+
allowNo: true,
|
|
63
|
+
}),
|
|
64
|
+
'output': (0, flags_1.outputFlag)({ default: 'table' }),
|
|
65
|
+
};
|
|
66
|
+
async run() {
|
|
67
|
+
const { args, flags } = await this.parse(IncidentsUpdate);
|
|
68
|
+
this.style.outputFormat = flags.output;
|
|
69
|
+
try {
|
|
70
|
+
if (flags.severity) {
|
|
71
|
+
await api.incidents.update(args.id, {
|
|
72
|
+
severity: (0, incidents_2.toIncidentSeverity)(flags.severity),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const update = await api.incidents.createUpdate(args.id, {
|
|
76
|
+
description: flags.message,
|
|
77
|
+
status: (0, incidents_2.toIncidentProgressStatus)(flags.status),
|
|
78
|
+
notifySubscribers: flags['notify-subscribers'],
|
|
79
|
+
});
|
|
80
|
+
if (flags.output === 'json') {
|
|
81
|
+
this.log(JSON.stringify(update, null, 2));
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const fmt = flags.output === 'md' ? 'md' : 'terminal';
|
|
85
|
+
if (fmt === 'md') {
|
|
86
|
+
const lines = [];
|
|
87
|
+
lines.push((0, incidents_1.formatIncidentUpdateDetail)(args.id, update, fmt, 'Incident Update Posted'));
|
|
88
|
+
if (flags.severity) {
|
|
89
|
+
lines.push('');
|
|
90
|
+
lines.push(`Severity updated to **${(0, incidents_1.formatIncidentSeverity)((0, incidents_2.toIncidentSeverity)(flags.severity), fmt)}**.`);
|
|
91
|
+
}
|
|
92
|
+
this.log(lines.join('\n'));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const output = [];
|
|
96
|
+
output.push((0, incidents_1.formatIncidentUpdateDetail)(args.id, update, fmt, 'Incident Update Posted'));
|
|
97
|
+
if (flags.severity) {
|
|
98
|
+
output.push(` ${chalk_1.default.dim('Severity:')} ${(0, incidents_1.formatIncidentSeverity)((0, incidents_2.toIncidentSeverity)(flags.severity), fmt)}`);
|
|
99
|
+
}
|
|
100
|
+
output.push('');
|
|
101
|
+
output.push(` ${chalk_1.default.dim('Resolve:')} checkly incidents resolve ${args.id}`);
|
|
102
|
+
this.log(output.join('\n'));
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
this.style.longError('Failed to post incident update.', err);
|
|
106
|
+
process.exitCode = 1;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.default = IncidentsUpdate;
|
|
111
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/incidents/update.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAyC;AACzC,kDAAyB;AACzB,gDAA4C;AAC5C,+CAAgD;AAChD,oDAAqC;AAErC,0DAA+F;AAC/F,uDAOgC;AAEhC,MAAqB,eAAgB,SAAQ,yBAAW;IACtD,MAAM,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,MAAM,CAAC,WAAW,GAAG,wCAAwC,CAAA;IAE7D,MAAM,CAAC,IAAI,GAAG;QACZ,EAAE,EAAE,WAAI,CAAC,MAAM,CAAC;YACd,WAAW,EAAE,kBAAkB;YAC/B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAA;IAED,MAAM,CAAC,KAAK,GAAG;QACb,SAAS,EAAE,YAAK,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,iBAAiB;YAC9B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,YAAK,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,2BAA2B;YACxC,OAAO,EAAE,yCAA6B;YACtC,OAAO,EAAE,eAAe;SACzB,CAAC;QACF,UAAU,EAAE,YAAK,CAAC,MAAM,CAAC;YACvB,WAAW,EAAE,uCAAuC;YACpD,OAAO,EAAE,mCAAuB;SACjC,CAAC;QACF,oBAAoB,EAAE,YAAK,CAAC,OAAO,CAAC;YAClC,WAAW,EAAE,4DA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AG,CAAC,CAAA;QACtB,CAAC;IACH,CAAC;;AA/EH,kCAgFC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from './baseCommand';
|
|
2
|
+
export default class Skills extends BaseCommand {
|
|
3
|
+
static hidden: boolean;
|
|
4
|
+
static description: string;
|
|
5
|
+
static args: {
|
|
6
|
+
action: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
reference: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
private printOverview;
|
|
11
|
+
private listAvailableReferences;
|
|
12
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const promises_1 = require("fs/promises");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const context_1 = require("../ai-context/context");
|
|
7
|
+
const baseCommand_1 = require("./baseCommand");
|
|
8
|
+
const REFERENCES_DIR = (0, path_1.join)(__dirname, '../ai-context/skills-command/references');
|
|
9
|
+
class Skills extends baseCommand_1.BaseCommand {
|
|
10
|
+
static hidden = false;
|
|
11
|
+
static description = 'Show Checkly AI skills, actions and their references.';
|
|
12
|
+
static args = {
|
|
13
|
+
action: core_1.Args.string({
|
|
14
|
+
required: false,
|
|
15
|
+
description: 'The action name (e.g. "configure", "initialize").',
|
|
16
|
+
}),
|
|
17
|
+
reference: core_1.Args.string({
|
|
18
|
+
required: false,
|
|
19
|
+
description: 'A specific reference within the action (e.g. "api-checks").',
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
async run() {
|
|
23
|
+
const { args } = await this.parse(Skills);
|
|
24
|
+
if (!args.action) {
|
|
25
|
+
this.printOverview();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const actionIds = context_1.ACTIONS.map(a => a.id);
|
|
29
|
+
if (!actionIds.includes(args.action)) {
|
|
30
|
+
this.error(`Action "${args.action}" not found.`
|
|
31
|
+
+ `\n\nAvailable actions: ${actionIds.join(', ')}`);
|
|
32
|
+
}
|
|
33
|
+
if (args.reference) {
|
|
34
|
+
const filename = `${args.action}-${args.reference}.md`;
|
|
35
|
+
const refPath = (0, path_1.join)(REFERENCES_DIR, filename);
|
|
36
|
+
try {
|
|
37
|
+
const content = await (0, promises_1.readFile)(refPath, 'utf8');
|
|
38
|
+
this.log(content);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
const available = await this.listAvailableReferences(args.action);
|
|
42
|
+
this.error(`Reference "${args.reference}" not found for action "${args.action}".`
|
|
43
|
+
+ (available.length > 0
|
|
44
|
+
? `\n\nAvailable references: ${available.join(', ')}`
|
|
45
|
+
: ''));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const actionPath = (0, path_1.join)(REFERENCES_DIR, `${args.action}.md`);
|
|
50
|
+
try {
|
|
51
|
+
const content = await (0, promises_1.readFile)(actionPath, 'utf8');
|
|
52
|
+
this.log(content);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
this.error(`Could not read action file for "${args.action}".`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
printOverview() {
|
|
60
|
+
this.log(`${context_1.SKILL.description}\n`);
|
|
61
|
+
this.log('Examples:\n');
|
|
62
|
+
this.log(' $ checkly skills initialize');
|
|
63
|
+
this.log(' $ checkly skills configure');
|
|
64
|
+
this.log(' $ checkly skills configure api-checks');
|
|
65
|
+
this.log('');
|
|
66
|
+
this.log('Actions:\n');
|
|
67
|
+
const maxActionLen = Math.max(...context_1.ACTIONS.map(a => a.id.length));
|
|
68
|
+
for (const action of context_1.ACTIONS) {
|
|
69
|
+
const desc = action.description ? `${action.description}` : '';
|
|
70
|
+
this.log(` ${action.id.padEnd(maxActionLen + 2)}${desc}`);
|
|
71
|
+
}
|
|
72
|
+
this.log('');
|
|
73
|
+
for (const action of context_1.ACTIONS) {
|
|
74
|
+
if (!('references' in action))
|
|
75
|
+
continue;
|
|
76
|
+
this.log(`References for "${action.id}":\n`);
|
|
77
|
+
const refs = action.references.map(r => ({
|
|
78
|
+
shortId: r.id.replace(`${action.id}-`, ''),
|
|
79
|
+
description: r.description,
|
|
80
|
+
}));
|
|
81
|
+
const maxRefLen = Math.max(...refs.map(r => r.shortId.length));
|
|
82
|
+
for (const ref of refs) {
|
|
83
|
+
const desc = ref.description ? ref.description : '';
|
|
84
|
+
this.log(` ${ref.shortId.padEnd(maxRefLen + 2)}${desc}`);
|
|
85
|
+
}
|
|
86
|
+
this.log('');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async listAvailableReferences(action) {
|
|
90
|
+
try {
|
|
91
|
+
const files = await (0, promises_1.readdir)(REFERENCES_DIR);
|
|
92
|
+
const prefix = `${action}-`;
|
|
93
|
+
return files
|
|
94
|
+
.filter(f => f.endsWith('.md') && f.startsWith(prefix))
|
|
95
|
+
.map(f => f.replace(/\.md$/, '').slice(prefix.length))
|
|
96
|
+
.sort();
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.default = Skills;
|
|
104
|
+
//# sourceMappingURL=skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/commands/skills.ts"],"names":[],"mappings":";;AAAA,sCAAkC;AAClC,0CAA+C;AAC/C,+BAA2B;AAE3B,mDAAsD;AACtD,+CAA2C;AAE3C,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,yCAAyC,CAAC,CAAA;AAEjF,MAAqB,MAAO,SAAQ,yBAAW;IAC7C,MAAM,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,MAAM,CAAC,WAAW,GAAG,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C,CAAA;YAC3D,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,uBAAuB,CAAE,MAAc;QACnD,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAA,kBAAO,EAAC,cAAc,CAAC,CAAA;YAC3C,MAAM,MAAM,GAAG,GAAG,MAAM,GAAG,CAAA;YAC3B,OAAO,KAAK;iBACT,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;iBACtD,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;iBACrD,IAAI,EAAE,CAAA;QACX,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAA;QACX,CAAC;IACH,CAAC;;AA5GH,yBA6GC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IncidentUpdate, StatusPageIncident } from '../rest/incidents';
|
|
2
|
+
import { type OutputFormat } from './render';
|
|
3
|
+
export declare function formatIncidentSeverity(severity: string, format: OutputFormat): string;
|
|
4
|
+
export declare function formatIncidentStatus(status: string, format: OutputFormat): string;
|
|
5
|
+
export declare function formatIncidentsList(incidents: StatusPageIncident[], format: OutputFormat): string;
|
|
6
|
+
export declare function formatIncidentDetail(incident: StatusPageIncident, format: OutputFormat): string;
|
|
7
|
+
export declare function formatIncidentUpdateDetail(incidentId: string, update: IncidentUpdate, format: OutputFormat, title?: string): string;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.formatIncidentUpdateDetail = exports.formatIncidentDetail = exports.formatIncidentsList = exports.formatIncidentStatus = exports.formatIncidentSeverity = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const render_1 = require("./render");
|
|
9
|
+
function normalizeLabel(value) {
|
|
10
|
+
return value.toLowerCase();
|
|
11
|
+
}
|
|
12
|
+
function safeTimeAgo(dateStr) {
|
|
13
|
+
if (!dateStr)
|
|
14
|
+
return '-';
|
|
15
|
+
try {
|
|
16
|
+
return (0, render_1.timeAgo)(dateStr);
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return '-';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function formatIncidentSeverity(severity, format) {
|
|
23
|
+
const label = normalizeLabel(severity);
|
|
24
|
+
if (format === 'md')
|
|
25
|
+
return label;
|
|
26
|
+
switch (severity) {
|
|
27
|
+
case 'CRITICAL':
|
|
28
|
+
return chalk_1.default.red(label);
|
|
29
|
+
case 'MAJOR':
|
|
30
|
+
return chalk_1.default.yellow(label);
|
|
31
|
+
case 'MEDIUM':
|
|
32
|
+
return chalk_1.default.cyan(label);
|
|
33
|
+
case 'MINOR':
|
|
34
|
+
return chalk_1.default.dim(label);
|
|
35
|
+
default:
|
|
36
|
+
return chalk_1.default.dim(label);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.formatIncidentSeverity = formatIncidentSeverity;
|
|
40
|
+
function formatIncidentStatus(status, format) {
|
|
41
|
+
const label = normalizeLabel(status);
|
|
42
|
+
if (format === 'md')
|
|
43
|
+
return label;
|
|
44
|
+
switch (status) {
|
|
45
|
+
case 'RESOLVED':
|
|
46
|
+
return chalk_1.default.green(label);
|
|
47
|
+
case 'IDENTIFIED':
|
|
48
|
+
return chalk_1.default.yellow(label);
|
|
49
|
+
case 'MONITORING':
|
|
50
|
+
return chalk_1.default.cyan(label);
|
|
51
|
+
case 'INVESTIGATING':
|
|
52
|
+
return chalk_1.default.yellow(label);
|
|
53
|
+
default:
|
|
54
|
+
return chalk_1.default.dim(label);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.formatIncidentStatus = formatIncidentStatus;
|
|
58
|
+
function buildIncidentListColumns(format) {
|
|
59
|
+
if (format === 'md') {
|
|
60
|
+
return [
|
|
61
|
+
{ header: 'Name', value: i => i.name },
|
|
62
|
+
{ header: 'Severity', value: i => formatIncidentSeverity(i.severity, format) },
|
|
63
|
+
{ header: 'Status', value: i => formatIncidentStatus(i.lastUpdateStatus, format) },
|
|
64
|
+
{ header: 'Services', value: i => String(i.services.length) },
|
|
65
|
+
{ header: 'Updated', value: i => (0, render_1.formatDate)(i.updated_at ?? i.created_at, format) },
|
|
66
|
+
{ header: 'ID', value: i => i.id },
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
const termWidth = process.stdout.columns || 120;
|
|
70
|
+
const nameWidth = Math.min(26, Math.floor(termWidth * 0.24));
|
|
71
|
+
return [
|
|
72
|
+
{
|
|
73
|
+
header: 'Name',
|
|
74
|
+
width: nameWidth,
|
|
75
|
+
value: i => (0, render_1.truncateToWidth)(i.name, nameWidth - 2),
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
header: 'Severity',
|
|
79
|
+
width: 11,
|
|
80
|
+
value: i => formatIncidentSeverity(i.severity, format),
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
header: 'Status',
|
|
84
|
+
width: 15,
|
|
85
|
+
value: i => formatIncidentStatus(i.lastUpdateStatus, format),
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
header: 'Services',
|
|
89
|
+
width: 10,
|
|
90
|
+
value: i => String(i.services.length),
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
header: 'Updated',
|
|
94
|
+
width: 12,
|
|
95
|
+
value: i => safeTimeAgo(i.updated_at ?? i.created_at),
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
header: 'ID',
|
|
99
|
+
value: i => chalk_1.default.dim(i.id),
|
|
100
|
+
},
|
|
101
|
+
];
|
|
102
|
+
}
|
|
103
|
+
function formatIncidentsList(incidents, format) {
|
|
104
|
+
return (0, render_1.renderTable)(buildIncidentListColumns(format), incidents, format);
|
|
105
|
+
}
|
|
106
|
+
exports.formatIncidentsList = formatIncidentsList;
|
|
107
|
+
const incidentDetailFields = [
|
|
108
|
+
{ label: 'Severity', value: (i, fmt) => formatIncidentSeverity(i.severity, fmt) },
|
|
109
|
+
{ label: 'Status', value: (i, fmt) => formatIncidentStatus(i.lastUpdateStatus, fmt) },
|
|
110
|
+
{ label: 'Services', value: i => String(i.services.length) },
|
|
111
|
+
{ label: 'Created', value: (i, fmt) => (0, render_1.formatDate)(i.created_at, fmt) },
|
|
112
|
+
{ label: 'Updated', value: (i, fmt) => (0, render_1.formatDate)(i.updated_at, fmt) },
|
|
113
|
+
{ label: 'ID', value: i => i.id },
|
|
114
|
+
];
|
|
115
|
+
function buildIncidentServiceColumns(format) {
|
|
116
|
+
if (format === 'md') {
|
|
117
|
+
return [
|
|
118
|
+
{ header: 'Service', value: s => s.name },
|
|
119
|
+
{ header: 'ID', value: s => s.id },
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
const termWidth = process.stdout.columns || 120;
|
|
123
|
+
const nameWidth = Math.min(28, Math.floor(termWidth * 0.30));
|
|
124
|
+
return [
|
|
125
|
+
{ header: 'Service', width: nameWidth, value: s => (0, render_1.truncateToWidth)(s.name, nameWidth - 2) },
|
|
126
|
+
{ header: 'ID', value: s => chalk_1.default.dim(s.id) },
|
|
127
|
+
];
|
|
128
|
+
}
|
|
129
|
+
function formatIncidentDetail(incident, format) {
|
|
130
|
+
const lines = [];
|
|
131
|
+
lines.push((0, render_1.renderDetailFields)(incident.name, incidentDetailFields, incident, format));
|
|
132
|
+
if (incident.services.length > 0) {
|
|
133
|
+
lines.push('');
|
|
134
|
+
if (format === 'md') {
|
|
135
|
+
lines.push('## Services');
|
|
136
|
+
lines.push('');
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
lines.push(chalk_1.default.bold('SERVICES'));
|
|
140
|
+
}
|
|
141
|
+
lines.push((0, render_1.renderTable)(buildIncidentServiceColumns(format), incident.services, format));
|
|
142
|
+
}
|
|
143
|
+
const latest = incident.incidentUpdates[0];
|
|
144
|
+
if (latest) {
|
|
145
|
+
lines.push('');
|
|
146
|
+
if (format === 'md') {
|
|
147
|
+
lines.push('## Latest Update');
|
|
148
|
+
lines.push('');
|
|
149
|
+
lines.push(`- Status: ${formatIncidentStatus(latest.status, format)}`);
|
|
150
|
+
lines.push(`- Message: ${latest.description}`);
|
|
151
|
+
const published = latest.publicIncidentUpdateDate ?? latest.created_at;
|
|
152
|
+
if (published) {
|
|
153
|
+
lines.push(`- Published: ${(0, render_1.formatDate)(published, format)}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
lines.push(chalk_1.default.bold('LATEST UPDATE'));
|
|
158
|
+
lines.push(`${chalk_1.default.dim('Status:')} ${formatIncidentStatus(latest.status, format)}`);
|
|
159
|
+
lines.push(`${chalk_1.default.dim('Message:')} ${latest.description}`);
|
|
160
|
+
const published = latest.publicIncidentUpdateDate ?? latest.created_at;
|
|
161
|
+
if (published) {
|
|
162
|
+
lines.push(`${chalk_1.default.dim('Published:')} ${(0, render_1.formatDate)(published, format)}`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return lines.join('\n');
|
|
167
|
+
}
|
|
168
|
+
exports.formatIncidentDetail = formatIncidentDetail;
|
|
169
|
+
const incidentUpdateDetailFields = [
|
|
170
|
+
{ label: 'Incident ID', value: v => v.incidentId },
|
|
171
|
+
{
|
|
172
|
+
label: 'Status',
|
|
173
|
+
value: (v, fmt) => formatIncidentStatus(v.update.status, fmt),
|
|
174
|
+
},
|
|
175
|
+
{ label: 'Message', value: v => v.update.description },
|
|
176
|
+
{
|
|
177
|
+
label: 'Published',
|
|
178
|
+
value: (v, fmt) => (0, render_1.formatDate)(v.update.publicIncidentUpdateDate ?? v.update.created_at, fmt),
|
|
179
|
+
},
|
|
180
|
+
{ label: 'Update ID', value: v => v.update.id ?? null },
|
|
181
|
+
];
|
|
182
|
+
function formatIncidentUpdateDetail(incidentId, update, format, title = 'Incident Update') {
|
|
183
|
+
return (0, render_1.renderDetailFields)(title, incidentUpdateDetailFields, { incidentId, update }, format);
|
|
184
|
+
}
|
|
185
|
+
exports.formatIncidentUpdateDetail = formatIncidentUpdateDetail;
|
|
186
|
+
//# sourceMappingURL=incidents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incidents.js","sourceRoot":"","sources":["../../src/formatters/incidents.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAEzB,qCASiB;AAEjB,SAAS,cAAc,CAAE,KAAa;IACpC,OAAO,KAAK,CAAC,WAAW,EAAE,CAAA;AAC5B,CAAC;AAED,SAAS,WAAW,CAAE,OAAkC;IACtD,IAAI,CAAC,OAAO;QAAE,OAAO,GAAG,CAAA;IACxB,IAAI,CAAC;QACH,OAAO,IAAA,gBAAO,EAAC,OAAO,CAAC,CAAA;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAA;IACZ,CAAC;AACH,CAAC;AAED,SAAgB,sBAAsB,CAAE,QAAgB,EAAE,MAAoB;IAC5E,MAAM,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;IACtC,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IACjC,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,UAAU;YACb,OAAO,eAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACzB,KAAK,OAAO;YACV,OAAO,eAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAC5B,KAAK,QAAQ;YACX,OAAO,eAAK,CAAC,IAAI,CAAC,KAAK,C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,CAAC,EAAE,IAAI,IAAI,EAAE;CACxD,CAAA;AAED,SAAgB,0BAA0B,CACxC,UAAkB,EAClB,MAAsB,EACtB,MAAoB,EACpB,KAAK,GAAG,iBAAiB;IAEzB,OAAO,IAAA,2BAAkB,EAAC,KAAK,EAAE,0BAA0B,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,CAAA;AAC9F,CAAC;AAPD,gEAOC"}
|
|
@@ -15,12 +15,23 @@ class ChecklyHelpClass extends core_1.Help {
|
|
|
15
15
|
// discard commands with ':' indicating they are under a topic
|
|
16
16
|
.filter(c => !c.id.includes(':') || c.coreCommand)
|
|
17
17
|
.map(c => [c.id.replace(/:/g, ' '), this.summary(c)]);
|
|
18
|
-
const formatCommandsWithTopics = (commands) =>
|
|
19
|
-
|
|
20
|
-
.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const formatCommandsWithTopics = (commands) => {
|
|
19
|
+
const explicitTopics = new Map(topics.map(t => [t.name, t.description]));
|
|
20
|
+
const topicNames = new Set(topics.map(t => t.name));
|
|
21
|
+
for (const command of commands) {
|
|
22
|
+
const separatorIndex = command.id.indexOf(':');
|
|
23
|
+
if (separatorIndex > 0) {
|
|
24
|
+
topicNames.add(command.id.slice(0, separatorIndex));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const topicRows = [...topicNames].map(name => [name, explicitTopics.get(name)]);
|
|
28
|
+
return commands
|
|
29
|
+
// discard commands with ':' indicating they are under a topic
|
|
30
|
+
.filter(c => !c.id.includes(':'))
|
|
31
|
+
.map(c => [c.id, this.summary(c)])
|
|
32
|
+
.concat(topicRows)
|
|
33
|
+
.sort(([a], [b]) => (a < b) ? -1 : 1);
|
|
34
|
+
};
|
|
24
35
|
const reder = (commands) => this.renderList(commands, {
|
|
25
36
|
spacer: '\n',
|
|
26
37
|
stripAnsi: this.opts.stripAnsi,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-extension.js","sourceRoot":"","sources":["../../src/help/help-extension.ts"],"names":[],"mappings":";;;;;AAAA,sCAA2C;AAC3C,0DAAiC;AAGjC,MAAqB,gBAAiB,SAAQ,WAAI;IACtC,iBAAiB,CAAE,QAAiC,EAC5D,MAAoB;QACpB,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAA;QAEpC,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAA;QACxD,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAA;QAE/D,MAAM,2BAA2B,GAAG,CAAC,QAAiC,EAAE,EAAE,CACxE,QAAQ;YACN,8DAA8D;aAC7D,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;aACjD,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAEzD,MAAM,wBAAwB,GAAG,CAAC,QAAiC,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"help-extension.js","sourceRoot":"","sources":["../../src/help/help-extension.ts"],"names":[],"mappings":";;;;;AAAA,sCAA2C;AAC3C,0DAAiC;AAGjC,MAAqB,gBAAiB,SAAQ,WAAI;IACtC,iBAAiB,CAAE,QAAiC,EAC5D,MAAoB;QACpB,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAA;QAEpC,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAA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,CAAC,GAAG,gBAAgB;gBACpC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,UAAU,KAAK,KAAK,CAC3C,CAAA;QACH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;QAC3B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QAEZ,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAA;YACxE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACd,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,uBAAuB,EAC3C;;;KAGD,CAAC,CAAC,CAAA;QAEH,MAAM,cAAc,GAAG,kBAAQ,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,OAAO,EAAE,EAAE;YAC9D,OAAO,WAAW,GAAG,GAAG,OAAO,CAAC,WAAW,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAA;QAC7F,CAAC,EAAE,EAAE,CAAC,CAAA;QAEN,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAA;QAClD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;CACF;AA9ED,mCA8EC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.detectCliMode = exports.detectOperator = void 0;
|
|
4
|
+
const VALID_CLI_MODES = new Set(['interactive', 'ci', 'agent']);
|
|
5
|
+
const AGENT_OPERATORS = new Set([
|
|
6
|
+
'claude-code', 'cursor', 'windsurf', 'aider', 'github-copilot',
|
|
7
|
+
]);
|
|
8
|
+
const CI_OPERATORS = new Set([
|
|
9
|
+
'github-actions', 'gitlab-ci', 'ci',
|
|
10
|
+
]);
|
|
11
|
+
function detectOperator() {
|
|
12
|
+
if (process.env.CLAUDECODE)
|
|
13
|
+
return 'claude-code';
|
|
14
|
+
if (process.env.CURSOR_TRACE_ID)
|
|
15
|
+
return 'cursor';
|
|
16
|
+
if (process.env.TERM_PROGRAM === 'vscode')
|
|
17
|
+
return 'vscode';
|
|
18
|
+
if (process.env.GITHUB_COPILOT)
|
|
19
|
+
return 'github-copilot';
|
|
20
|
+
if (process.env.AIDER)
|
|
21
|
+
return 'aider';
|
|
22
|
+
if (process.env.WINDSURF || process.env.CODEIUM_ENV)
|
|
23
|
+
return 'windsurf';
|
|
24
|
+
if (process.env.GITHUB_ACTIONS)
|
|
25
|
+
return 'github-actions';
|
|
26
|
+
if (process.env.GITLAB_CI)
|
|
27
|
+
return 'gitlab-ci';
|
|
28
|
+
if (process.env.CI)
|
|
29
|
+
return 'ci';
|
|
30
|
+
return 'manual';
|
|
31
|
+
}
|
|
32
|
+
exports.detectOperator = detectOperator;
|
|
33
|
+
function detectCliMode() {
|
|
34
|
+
const envMode = process.env.CHECKLY_CLI_MODE;
|
|
35
|
+
if (envMode && VALID_CLI_MODES.has(envMode)) {
|
|
36
|
+
return envMode;
|
|
37
|
+
}
|
|
38
|
+
const operator = detectOperator();
|
|
39
|
+
if (AGENT_OPERATORS.has(operator))
|
|
40
|
+
return 'agent';
|
|
41
|
+
if (CI_OPERATORS.has(operator))
|
|
42
|
+
return 'ci';
|
|
43
|
+
return 'interactive';
|
|
44
|
+
}
|
|
45
|
+
exports.detectCliMode = detectCliMode;
|
|
46
|
+
//# sourceMappingURL=cli-mode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-mode.js","sourceRoot":"","sources":["../../src/helpers/cli-mode.ts"],"names":[],"mappings":";;;AAEA,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3B,CAAC;IAED,MAAM,QAAQ,GAAG,cAAc,EAAE,CAAA;IAEjC,IAAI,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC;QAAE,OAAO,OAAO,CAAA;IACjD,IAAI,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAA;IAC3C,OAAO,aAAa,CAAA;AACtB,CAAC;AAXD,sCAWC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type CommandClassification = {
|
|
2
|
+
readOnly: boolean;
|
|
3
|
+
destructive: boolean;
|
|
4
|
+
idempotent: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type CommandPreview = {
|
|
7
|
+
command: string;
|
|
8
|
+
description: string;
|
|
9
|
+
changes: string[];
|
|
10
|
+
flags: Record<string, unknown>;
|
|
11
|
+
args?: Record<string, unknown>;
|
|
12
|
+
classification: CommandClassification;
|
|
13
|
+
};
|
|
14
|
+
export type AgentPreviewResponse = {
|
|
15
|
+
status: 'confirmation_required' | 'dry_run';
|
|
16
|
+
command: string;
|
|
17
|
+
description: string;
|
|
18
|
+
classification: CommandClassification;
|
|
19
|
+
changes: string[];
|
|
20
|
+
confirmCommand: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function buildConfirmCommand(command: string, flags: Record<string, unknown>, args?: Record<string, unknown>): string;
|
|
23
|
+
export declare function formatPreviewForAgent(preview: CommandPreview, status: 'confirmation_required' | 'dry_run'): AgentPreviewResponse;
|
|
24
|
+
export declare function formatPreviewForTerminal(preview: CommandPreview): string;
|