deepline 0.3.294 → 0.3.295
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/bundling-sources/sdk/src/compat.ts +35 -7
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +14 -1
- package/dist/cli/auth-EDTRERZP.mjs +31 -0
- package/dist/cli/auth-TDHKB277.js +31 -0
- package/dist/cli/billing-ELIDPILY.js +1749 -0
- package/dist/cli/billing-EXGXJVAU.mjs +1749 -0
- package/dist/cli/chunk-2S5Y3TZP.js +5688 -0
- package/dist/cli/chunk-3KC45UVF.js +150 -0
- package/dist/cli/chunk-3XX5TEA4.js +15 -0
- package/dist/cli/chunk-4MBOJQPL.mjs +0 -0
- package/dist/cli/chunk-4NEFYBF7.js +2240 -0
- package/dist/cli/chunk-5JLQPVNX.js +3056 -0
- package/dist/cli/chunk-5KDKFHZI.js +1269 -0
- package/dist/cli/chunk-6A3TJUWC.js +76 -0
- package/dist/cli/chunk-6O5YZOVN.mjs +890 -0
- package/dist/cli/chunk-7P5AA3SN.js +344 -0
- package/dist/cli/chunk-AYHLUHE5.js +52 -0
- package/dist/cli/chunk-CBVIJSHF.mjs +560 -0
- package/dist/cli/chunk-CFVVCN4A.js +735 -0
- package/dist/cli/chunk-COGTRVWW.js +30 -0
- package/dist/cli/chunk-D4AZUZO4.js +190 -0
- package/dist/cli/chunk-DLIRSHV6.mjs +28 -0
- package/dist/cli/chunk-EACVZI6N.mjs +1995 -0
- package/dist/cli/chunk-EDWJY6T4.mjs +3056 -0
- package/dist/cli/chunk-EXMLR72R.mjs +0 -0
- package/dist/cli/chunk-F35VOIQL.js +890 -0
- package/dist/cli/chunk-GAMFK2ZP.mjs +148 -0
- package/dist/cli/chunk-GHRQQPW2.mjs +2240 -0
- package/dist/cli/chunk-GONRLVV3.js +3440 -0
- package/dist/cli/chunk-GVUJJJ5G.mjs +76 -0
- package/dist/cli/chunk-H7HIDGZ7.mjs +150 -0
- package/dist/cli/chunk-HUZXWOSK.mjs +503 -0
- package/dist/cli/chunk-I5YZLGMG.js +1 -0
- package/dist/cli/chunk-ITOFSXIU.mjs +15 -0
- package/dist/cli/chunk-J5NA2TTX.js +503 -0
- package/dist/cli/chunk-JCS5TPNY.mjs +3440 -0
- package/dist/cli/chunk-JNNOCMQY.js +47 -0
- package/dist/cli/chunk-KRD6H754.mjs +30 -0
- package/dist/cli/chunk-LA46MMTL.js +560 -0
- package/dist/cli/chunk-LDWT7RJK.mjs +190 -0
- package/dist/cli/chunk-M2V26OR5.js +499 -0
- package/dist/cli/chunk-MIMASXO4.mjs +389 -0
- package/dist/cli/chunk-MROPCKW2.mjs +190 -0
- package/dist/cli/chunk-NXDRDJ4K.js +389 -0
- package/dist/cli/chunk-NXGCO4JB.mjs +344 -0
- package/dist/cli/chunk-OG64RBAC.js +6 -0
- package/dist/cli/chunk-OQYEC4GL.mjs +34 -0
- package/dist/cli/chunk-OWJZUE3Y.mjs +103 -0
- package/dist/cli/chunk-SDK3ZA2C.js +103 -0
- package/dist/cli/chunk-SFLARO4Y.mjs +47 -0
- package/dist/cli/chunk-SVIIIYIQ.js +923 -0
- package/dist/cli/chunk-TAC3JIFE.mjs +354 -0
- package/dist/cli/chunk-U3PI7HBM.js +34 -0
- package/dist/cli/chunk-UFS752TU.mjs +52 -0
- package/dist/cli/chunk-UI37DQE7.mjs +499 -0
- package/dist/cli/chunk-UNEMDKXN.js +1 -0
- package/dist/cli/chunk-WB6Z2Q44.mjs +1622 -0
- package/dist/cli/chunk-WJYPBHTE.js +148 -0
- package/dist/cli/chunk-WOHBA5PV.js +354 -0
- package/dist/cli/chunk-WQICC2B3.js +190 -0
- package/dist/cli/chunk-WZYKRD7T.mjs +6 -0
- package/dist/cli/chunk-XL2FO6CW.mjs +5688 -0
- package/dist/cli/chunk-XNYIZMNQ.js +28 -0
- package/dist/cli/chunk-XRK2TZT5.js +1995 -0
- package/dist/cli/chunk-YJYPL5OK.mjs +1269 -0
- package/dist/cli/chunk-YWNDYCXR.mjs +735 -0
- package/dist/cli/chunk-YWWAF7KZ.mjs +923 -0
- package/dist/cli/chunk-ZDO3TO3M.js +1622 -0
- package/dist/cli/client-4JVOYVC5.js +20 -0
- package/dist/cli/client-EEN2IJN2.mjs +20 -0
- package/dist/cli/csv-BOHBEP2I.mjs +585 -0
- package/dist/cli/csv-S5NYRUEX.js +585 -0
- package/dist/cli/db-CLODWCOB.mjs +486 -0
- package/dist/cli/db-F6PKFOOV.js +486 -0
- package/dist/cli/executions-5TQAKLJU.js +28 -0
- package/dist/cli/executions-MAKW6QOY.mjs +28 -0
- package/dist/cli/feedback-GV4QJFEN.js +107 -0
- package/dist/cli/feedback-XY24TW7H.mjs +107 -0
- package/dist/cli/getting-started.js +18 -76
- package/dist/cli/getting-started.mjs +10 -37
- package/dist/cli/git-6S2C22T5.js +23 -0
- package/dist/cli/git-OZLBD5HH.mjs +23 -0
- package/dist/cli/index.js +291 -54294
- package/dist/cli/index.mjs +209 -54352
- package/dist/cli/legacy-noops-LLCGDPQE.js +157 -0
- package/dist/cli/legacy-noops-TYH3TW2D.mjs +157 -0
- package/dist/cli/monitors-CABMB4DW.js +3251 -0
- package/dist/cli/monitors-TTD55HMK.mjs +3251 -0
- package/dist/cli/org-MSF3RG76.js +849 -0
- package/dist/cli/org-SFJ77MWY.mjs +849 -0
- package/dist/cli/play-NXHJSCKL.mjs +18439 -0
- package/dist/cli/play-OKSFNNO4.js +18439 -0
- package/dist/cli/providers-QC2ERERL.js +95 -0
- package/dist/cli/providers-TIIAZEUA.mjs +95 -0
- package/dist/cli/proxy-env-EBANZHPV.js +161 -0
- package/dist/cli/proxy-env-M4ZHXHRL.mjs +161 -0
- package/dist/cli/quickstart-ICANHLMI.js +69 -0
- package/dist/cli/quickstart-KWUOP3FI.mjs +69 -0
- package/dist/cli/search-U5H2FDOO.mjs +18 -0
- package/dist/cli/search-XQRQOLWS.js +18 -0
- package/dist/cli/secrets-3J6YTWFA.mjs +400 -0
- package/dist/cli/secrets-YNMNZNOM.js +400 -0
- package/dist/cli/sessions-CLEES4L6.mjs +15 -0
- package/dist/cli/sessions-J6VR47FG.js +15 -0
- package/dist/cli/settings-EEKZMTY4.js +846 -0
- package/dist/cli/settings-UVLOQZRH.mjs +846 -0
- package/dist/cli/setup-DLMDXPGJ.mjs +1257 -0
- package/dist/cli/setup-HC4Q7QM4.js +1257 -0
- package/dist/cli/skills-33PHFBSB.mjs +28 -0
- package/dist/cli/skills-LFRY3KPX.js +28 -0
- package/dist/cli/tools-3COEPKML.mjs +2955 -0
- package/dist/cli/tools-QXEVCN45.js +2955 -0
- package/dist/cli/update-LSAC4FF5.mjs +28 -0
- package/dist/cli/update-NXHSPYXA.js +28 -0
- package/dist/cli/workflow-7S44OECF.mjs +1936 -0
- package/dist/cli/workflow-QPZWYSZE.js +1936 -0
- package/dist/helpers.js +6 -32
- package/dist/helpers.mjs +2 -0
- package/dist/index.js +1972 -12825
- package/dist/index.mjs +1910 -12672
- package/dist/install-integrity.json +110 -0
- package/dist/monitor-fleet-contract.js +31 -730
- package/dist/monitor-fleet-contract.mjs +18 -667
- package/dist/monitor-input-contract.js +10 -390
- package/dist/monitor-input-contract.mjs +7 -348
- package/dist/plays/bundle-play-file.mjs +13 -5178
- package/dist/plays/csv-data-input.js +5 -3132
- package/dist/plays/csv-data-input.mjs +5 -3105
- package/dist/plays/run-request.js +56 -664
- package/dist/plays/run-request.mjs +30 -588
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +5 -212
- package/dist/release.mjs +5 -185
- package/package.json +1 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;// src/cli/progress.ts
|
|
2
|
+
var _worker_threads = require('worker_threads');
|
|
3
|
+
var CliProgress = (_class = class {
|
|
4
|
+
constructor(enabled) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);
|
|
5
|
+
this.enabled = enabled;
|
|
6
|
+
}
|
|
7
|
+
__init() {this.lastMessage = null}
|
|
8
|
+
__init2() {this.interactive = Boolean(process.stderr.isTTY)}
|
|
9
|
+
__init3() {this.grey = "\x1B[90m"}
|
|
10
|
+
__init4() {this.cyan = "\x1B[36m"}
|
|
11
|
+
__init5() {this.dim = "\x1B[2m"}
|
|
12
|
+
__init6() {this.reset = "\x1B[0m"}
|
|
13
|
+
__init7() {this.worker = null}
|
|
14
|
+
phase(message) {
|
|
15
|
+
if (!this.enabled || this.lastMessage === message) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (this.interactive && this.lastMessage) {
|
|
19
|
+
this.settle("\u2713");
|
|
20
|
+
}
|
|
21
|
+
this.lastMessage = message;
|
|
22
|
+
if (!this.interactive) {
|
|
23
|
+
process.stderr.write(`${message}
|
|
24
|
+
`);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
this.ensureWorker();
|
|
28
|
+
_optionalChain([this, 'access', _ => _.worker, 'optionalAccess', _2 => _2.postMessage, 'call', _3 => _3({ type: "phase", message })]);
|
|
29
|
+
}
|
|
30
|
+
complete() {
|
|
31
|
+
this.settle("\u2713");
|
|
32
|
+
}
|
|
33
|
+
fail() {
|
|
34
|
+
this.settle("\u2717");
|
|
35
|
+
}
|
|
36
|
+
writeLogLine(line) {
|
|
37
|
+
if (!this.enabled) {
|
|
38
|
+
process.stderr.write(`${line}
|
|
39
|
+
`);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const message = this.interactive ? `${this.cyan}[logs]${this.reset} ${this.dim}${line}${this.reset}` : `[logs] ${line}`;
|
|
43
|
+
if (!this.interactive) {
|
|
44
|
+
process.stderr.write(`${message}
|
|
45
|
+
`);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const activeMessage = this.lastMessage;
|
|
49
|
+
_optionalChain([this, 'access', _4 => _4.worker, 'optionalAccess', _5 => _5.terminate, 'call', _6 => _6(), 'access', _7 => _7.catch, 'call', _8 => _8(() => void 0)]);
|
|
50
|
+
this.worker = null;
|
|
51
|
+
process.stderr.write(`\r\x1B[2K${message}
|
|
52
|
+
`);
|
|
53
|
+
if (activeMessage) {
|
|
54
|
+
this.startWorker().postMessage({ type: "phase", message: activeMessage });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
writeLine(line, stream = process.stderr) {
|
|
58
|
+
if (!this.enabled || !this.interactive) {
|
|
59
|
+
stream.write(`${line}
|
|
60
|
+
`);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const activeMessage = this.lastMessage;
|
|
64
|
+
_optionalChain([this, 'access', _9 => _9.worker, 'optionalAccess', _10 => _10.terminate, 'call', _11 => _11(), 'access', _12 => _12.catch, 'call', _13 => _13(() => void 0)]);
|
|
65
|
+
this.worker = null;
|
|
66
|
+
stream.write(`\r\x1B[2K${line}
|
|
67
|
+
`);
|
|
68
|
+
if (activeMessage) {
|
|
69
|
+
this.startWorker().postMessage({ type: "phase", message: activeMessage });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
settle(mark) {
|
|
73
|
+
if (!this.enabled || !this.lastMessage) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (this.interactive) {
|
|
77
|
+
_optionalChain([this, 'access', _14 => _14.worker, 'optionalAccess', _15 => _15.terminate, 'call', _16 => _16(), 'access', _17 => _17.catch, 'call', _18 => _18(() => void 0)]);
|
|
78
|
+
this.worker = null;
|
|
79
|
+
process.stderr.write(
|
|
80
|
+
`\r\x1B[2K${this.grey}${mark} ${this.lastMessage}${this.reset}
|
|
81
|
+
`
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
this.lastMessage = null;
|
|
85
|
+
}
|
|
86
|
+
ensureWorker() {
|
|
87
|
+
this.startWorker();
|
|
88
|
+
}
|
|
89
|
+
startWorker() {
|
|
90
|
+
if (this.worker) {
|
|
91
|
+
return this.worker;
|
|
92
|
+
}
|
|
93
|
+
this.worker = new (0, _worker_threads.Worker)(
|
|
94
|
+
`
|
|
95
|
+
const { parentPort } = require('node:worker_threads');
|
|
96
|
+
const { writeSync } = require('node:fs');
|
|
97
|
+
const frames = ['\u2014', '\\\\', '|', '/'];
|
|
98
|
+
const grey = '\\x1b[90m';
|
|
99
|
+
const reset = '\\x1b[0m';
|
|
100
|
+
let message = '';
|
|
101
|
+
let frameIndex = 0;
|
|
102
|
+
let timer = null;
|
|
103
|
+
function render() {
|
|
104
|
+
if (!message) return;
|
|
105
|
+
const frame = frames[frameIndex % frames.length] || '\u2014';
|
|
106
|
+
frameIndex += 1;
|
|
107
|
+
writeSync(2, '\\r\\x1b[2K' + grey + frame + ' ' + message + reset);
|
|
108
|
+
}
|
|
109
|
+
parentPort.on('message', (event) => {
|
|
110
|
+
if (event.type === 'phase') {
|
|
111
|
+
message = String(event.message || '');
|
|
112
|
+
frameIndex = 0;
|
|
113
|
+
render();
|
|
114
|
+
if (!timer) {
|
|
115
|
+
timer = setInterval(render, 120);
|
|
116
|
+
timer.unref && timer.unref();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (event.type === 'stop') {
|
|
120
|
+
if (timer) clearInterval(timer);
|
|
121
|
+
timer = null;
|
|
122
|
+
writeSync(2, '\\r\\x1b[2K');
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
`,
|
|
126
|
+
{ eval: true }
|
|
127
|
+
);
|
|
128
|
+
this.worker.unref();
|
|
129
|
+
return this.worker;
|
|
130
|
+
}
|
|
131
|
+
}, _class);
|
|
132
|
+
var activeProgress = null;
|
|
133
|
+
function setActiveCliProgress(progress) {
|
|
134
|
+
activeProgress = progress;
|
|
135
|
+
}
|
|
136
|
+
function getActiveCliProgress() {
|
|
137
|
+
return activeProgress;
|
|
138
|
+
}
|
|
139
|
+
function createCliProgress(enabled) {
|
|
140
|
+
const progress = new CliProgress(enabled);
|
|
141
|
+
setActiveCliProgress(progress);
|
|
142
|
+
return progress;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
exports.getActiveCliProgress = getActiveCliProgress; exports.createCliProgress = createCliProgress;
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// ../integration-contracts/monitor-input-contract.ts
|
|
2
|
+
var _handlebars = require('handlebars'); var _handlebars2 = _interopRequireDefault(_handlebars);
|
|
3
|
+
function authoredMonitorFieldPath(path, field) {
|
|
4
|
+
const batch = /^monitors\.(\d+)$/.exec(path);
|
|
5
|
+
return `${batch ? `monitors[${batch[1]}]` : path}.${field}`;
|
|
6
|
+
}
|
|
7
|
+
function record(value) {
|
|
8
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
9
|
+
}
|
|
10
|
+
function json(value, path, issues) {
|
|
11
|
+
if (value === null || typeof value === "string" || typeof value === "boolean" || typeof value === "number" && Number.isFinite(value)) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (Array.isArray(value)) {
|
|
15
|
+
value.forEach((child, index) => json(child, `${path}.${index}`, issues));
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const object = record(value);
|
|
19
|
+
if (!object) {
|
|
20
|
+
issues.push({
|
|
21
|
+
severity: "error",
|
|
22
|
+
code: "invalid_monitor_json_value",
|
|
23
|
+
path,
|
|
24
|
+
message: "Monitor values must be JSON values."
|
|
25
|
+
});
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
for (const [key, child] of Object.entries(object)) {
|
|
29
|
+
json(child, `${path}.${key}`, issues);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function monitorSpec(value, path, issues) {
|
|
33
|
+
const input = record(value);
|
|
34
|
+
if (!input) {
|
|
35
|
+
issues.push({
|
|
36
|
+
severity: "error",
|
|
37
|
+
code: "invalid_monitor_spec",
|
|
38
|
+
path,
|
|
39
|
+
message: "A monitor must be a JSON object."
|
|
40
|
+
});
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const allowed = /* @__PURE__ */ new Set(["key", "tool", "name", "payload"]);
|
|
44
|
+
for (const key2 of Object.keys(input)) {
|
|
45
|
+
if (!allowed.has(key2)) {
|
|
46
|
+
if (key2 === "controls") {
|
|
47
|
+
issues.push({
|
|
48
|
+
severity: "error",
|
|
49
|
+
code: "CONTROLS_NOT_SUPPORTED",
|
|
50
|
+
path: authoredMonitorFieldPath(path, "controls"),
|
|
51
|
+
message: "Operational controls are managed by Deepline and cannot be authored in Batch or Fleet JSON.",
|
|
52
|
+
suggestion: "Remove controls. Bind downstream automation in a Play with sqlListeners."
|
|
53
|
+
});
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (key2 === "play") {
|
|
57
|
+
issues.push({
|
|
58
|
+
severity: "error",
|
|
59
|
+
code: "PLAY_BINDING_NOT_IN_MONITOR_SPEC",
|
|
60
|
+
path: authoredMonitorFieldPath(path, "play"),
|
|
61
|
+
message: "A monitor does not own Play bindings.",
|
|
62
|
+
suggestion: "Declare sqlListeners in the Play, or run: deepline plays bootstrap monitor-triggered --out on-event.play.ts"
|
|
63
|
+
});
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
issues.push({
|
|
67
|
+
severity: "error",
|
|
68
|
+
code: "unknown_monitor_field",
|
|
69
|
+
path: `${path}.${key2}`,
|
|
70
|
+
message: `Monitor definitions do not accept '${key2}'.`
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const key = typeof input.key === "string" ? input.key.trim() : "";
|
|
75
|
+
const tool = typeof input.tool === "string" ? input.tool.trim() : "";
|
|
76
|
+
const name = input.name === void 0 ? void 0 : typeof input.name === "string" && input.name.trim() ? input.name.trim() : null;
|
|
77
|
+
const payload = record(input.payload);
|
|
78
|
+
if (!key) {
|
|
79
|
+
issues.push({
|
|
80
|
+
severity: "error",
|
|
81
|
+
code: "invalid_monitor_key",
|
|
82
|
+
path: `${path}.key`,
|
|
83
|
+
message: "Monitor key must be a non-empty string."
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (!tool) {
|
|
87
|
+
issues.push({
|
|
88
|
+
severity: "error",
|
|
89
|
+
code: "invalid_monitor_tool",
|
|
90
|
+
path: `${path}.tool`,
|
|
91
|
+
message: "Monitor tool must be a non-empty literal string."
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
if (name === null) {
|
|
95
|
+
issues.push({
|
|
96
|
+
severity: "error",
|
|
97
|
+
code: "invalid_monitor_name",
|
|
98
|
+
path: `${path}.name`,
|
|
99
|
+
message: "Monitor name must be a non-empty string when supplied."
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (!payload) {
|
|
103
|
+
issues.push({
|
|
104
|
+
severity: "error",
|
|
105
|
+
code: "invalid_monitor_payload",
|
|
106
|
+
path: `${path}.payload`,
|
|
107
|
+
message: "Monitor payload must be an object."
|
|
108
|
+
});
|
|
109
|
+
} else {
|
|
110
|
+
json(payload, `${path}.payload`, issues);
|
|
111
|
+
}
|
|
112
|
+
if (!key || !tool || !payload || name === null) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
key,
|
|
117
|
+
tool,
|
|
118
|
+
...name ? { name } : {},
|
|
119
|
+
payload
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function issueOrder(left, right) {
|
|
123
|
+
return left.path.localeCompare(right.path) || left.severity.localeCompare(right.severity) || left.code.localeCompare(right.code);
|
|
124
|
+
}
|
|
125
|
+
function lintMonitorBatchInput(value) {
|
|
126
|
+
const issues = [];
|
|
127
|
+
const versionlessEnvelope = !Array.isArray(value) && (() => {
|
|
128
|
+
const candidate = record(value);
|
|
129
|
+
return candidate !== null && Object.keys(candidate).length === 1 && Object.prototype.hasOwnProperty.call(candidate, "monitors");
|
|
130
|
+
})();
|
|
131
|
+
const legacy = Array.isArray(value) || versionlessEnvelope;
|
|
132
|
+
const input = legacy ? null : record(value);
|
|
133
|
+
let monitors = Array.isArray(value) ? value : versionlessEnvelope ? (() => {
|
|
134
|
+
const candidate = _optionalChain([record, 'call', _ => _(value), 'optionalAccess', _2 => _2.monitors]);
|
|
135
|
+
return Array.isArray(candidate) ? candidate : null;
|
|
136
|
+
})() : null;
|
|
137
|
+
if (Array.isArray(value)) {
|
|
138
|
+
issues.push({
|
|
139
|
+
severity: "warning",
|
|
140
|
+
code: "deprecated_batch_array",
|
|
141
|
+
path: "",
|
|
142
|
+
message: "Bare monitor arrays are supported for compatibility.",
|
|
143
|
+
suggestion: 'Wrap the list in {"version":1,"kind":"batch","monitors":[...]}.'
|
|
144
|
+
});
|
|
145
|
+
} else if (versionlessEnvelope) {
|
|
146
|
+
issues.push({
|
|
147
|
+
severity: "warning",
|
|
148
|
+
code: "deprecated_batch_missing_envelope_fields",
|
|
149
|
+
path: "",
|
|
150
|
+
message: "Versionless monitor envelopes are supported for compatibility.",
|
|
151
|
+
suggestion: 'Add "version": 1 and "kind": "batch".'
|
|
152
|
+
});
|
|
153
|
+
if (!monitors) {
|
|
154
|
+
issues.push({
|
|
155
|
+
severity: "error",
|
|
156
|
+
code: "invalid_batch_monitors",
|
|
157
|
+
path: "monitors",
|
|
158
|
+
message: "Batch monitors must be an array."
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
} else if (!input) {
|
|
162
|
+
issues.push({
|
|
163
|
+
severity: "error",
|
|
164
|
+
code: "invalid_batch",
|
|
165
|
+
path: "",
|
|
166
|
+
message: "Batch input must be an object or a legacy array."
|
|
167
|
+
});
|
|
168
|
+
} else {
|
|
169
|
+
for (const key of Object.keys(input)) {
|
|
170
|
+
if (!["version", "kind", "monitors"].includes(key)) {
|
|
171
|
+
issues.push({
|
|
172
|
+
severity: "error",
|
|
173
|
+
code: key === "source" || key === "monitor" ? "batch_fleet_shape_mixup" : "unknown_batch_field",
|
|
174
|
+
path: key,
|
|
175
|
+
message: `Batch input does not accept '${key}'.`
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (input.version !== 1) {
|
|
180
|
+
issues.push({
|
|
181
|
+
severity: "error",
|
|
182
|
+
code: "unsupported_batch_version",
|
|
183
|
+
path: "version",
|
|
184
|
+
message: "Batch input version must be 1."
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
if (input.kind !== "batch") {
|
|
188
|
+
issues.push({
|
|
189
|
+
severity: "error",
|
|
190
|
+
code: "invalid_batch_kind",
|
|
191
|
+
path: "kind",
|
|
192
|
+
message: 'Batch input kind must be "batch".'
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
monitors = Array.isArray(input.monitors) ? input.monitors : null;
|
|
196
|
+
if (!monitors) {
|
|
197
|
+
issues.push({
|
|
198
|
+
severity: "error",
|
|
199
|
+
code: "invalid_batch_monitors",
|
|
200
|
+
path: "monitors",
|
|
201
|
+
message: "Batch monitors must be an array."
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (!monitors || monitors.length === 0) {
|
|
206
|
+
if (_optionalChain([monitors, 'optionalAccess', _3 => _3.length]) === 0) {
|
|
207
|
+
issues.push({
|
|
208
|
+
severity: "error",
|
|
209
|
+
code: "empty_batch",
|
|
210
|
+
path: "monitors",
|
|
211
|
+
message: "A Batch needs at least one monitor."
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
return { issues: issues.sort(issueOrder) };
|
|
215
|
+
}
|
|
216
|
+
const normalized = monitors.map(
|
|
217
|
+
(item, index) => monitorSpec(item, `monitors.${index}`, issues)
|
|
218
|
+
);
|
|
219
|
+
const seen = /* @__PURE__ */ new Map();
|
|
220
|
+
normalized.forEach((item, index) => {
|
|
221
|
+
if (!item) return;
|
|
222
|
+
const first = seen.get(item.key);
|
|
223
|
+
if (first !== void 0) {
|
|
224
|
+
for (const position of [first, index]) {
|
|
225
|
+
issues.push({
|
|
226
|
+
severity: "error",
|
|
227
|
+
code: "duplicate_monitor_key",
|
|
228
|
+
path: `monitors.${position}.key`,
|
|
229
|
+
message: `Duplicate monitor key '${item.key}'.`
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
} else {
|
|
233
|
+
seen.set(item.key, index);
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
const ordered = issues.sort(issueOrder);
|
|
237
|
+
return ordered.some((issue) => issue.severity === "error") ? { issues: ordered } : {
|
|
238
|
+
normalized: {
|
|
239
|
+
version: 1,
|
|
240
|
+
kind: "batch",
|
|
241
|
+
monitors: normalized
|
|
242
|
+
},
|
|
243
|
+
issues: ordered
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function validateHandlebars(value, path, issues) {
|
|
247
|
+
if (!value.includes("{{")) return;
|
|
248
|
+
try {
|
|
249
|
+
_handlebars2.default.parse(value);
|
|
250
|
+
} catch (error) {
|
|
251
|
+
issues.push({
|
|
252
|
+
severity: "error",
|
|
253
|
+
code: "invalid_handlebars_template",
|
|
254
|
+
path,
|
|
255
|
+
message: error instanceof Error ? error.message : "Invalid Handlebars template."
|
|
256
|
+
});
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
const expressions = _nullishCoalesce(value.match(/{{[\s\S]*?}}/g), () => ( []));
|
|
260
|
+
if (expressions.some(
|
|
261
|
+
(expression) => !/^{{\s*[A-Za-z_][A-Za-z0-9_]*\s*}}$/.test(expression)
|
|
262
|
+
)) {
|
|
263
|
+
issues.push({
|
|
264
|
+
severity: "error",
|
|
265
|
+
code: "unsupported_handlebars_expression",
|
|
266
|
+
path,
|
|
267
|
+
message: "Fleet templates allow only direct source-row fields such as {{domain}}; helpers, blocks, partials, paths, and prototype access are disabled."
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
function walkTemplates(value, path, issues) {
|
|
272
|
+
if (typeof value === "string") return validateHandlebars(value, path, issues);
|
|
273
|
+
if (Array.isArray(value)) {
|
|
274
|
+
value.forEach(
|
|
275
|
+
(item, index) => walkTemplates(item, `${path}.${index}`, issues)
|
|
276
|
+
);
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
const input = record(value);
|
|
280
|
+
if (!input) return;
|
|
281
|
+
for (const [key, child] of Object.entries(input)) {
|
|
282
|
+
walkTemplates(child, `${path}.${key}`, issues);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
function lintMonitorSpecTemplate(value, path = "monitor") {
|
|
286
|
+
const issues = [];
|
|
287
|
+
const normalized = monitorSpec(value, path, issues);
|
|
288
|
+
const input = record(value);
|
|
289
|
+
if (input && typeof input.tool === "string" && input.tool.includes("{{")) {
|
|
290
|
+
issues.push({
|
|
291
|
+
severity: "error",
|
|
292
|
+
code: "templated_monitor_tool",
|
|
293
|
+
path: `${path}.tool`,
|
|
294
|
+
message: "Fleet monitor tool must be literal; only key, name, and payload may be templated."
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
if (input) {
|
|
298
|
+
for (const field of ["key", "name", "payload"]) {
|
|
299
|
+
if (input[field] !== void 0)
|
|
300
|
+
walkTemplates(input[field], `${path}.${field}`, issues);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
const ordered = issues.sort(issueOrder);
|
|
304
|
+
return ordered.some((issue) => issue.severity === "error") ? { issues: ordered } : { normalized, issues: ordered };
|
|
305
|
+
}
|
|
306
|
+
function renderValue(value, row) {
|
|
307
|
+
if (typeof value === "string" && value.includes("{{")) {
|
|
308
|
+
const context = Object.assign(/* @__PURE__ */ Object.create(null), row);
|
|
309
|
+
return _handlebars2.default.compile(value, {
|
|
310
|
+
noEscape: true,
|
|
311
|
+
strict: true,
|
|
312
|
+
knownHelpersOnly: true,
|
|
313
|
+
preventIndent: true
|
|
314
|
+
})(context, {
|
|
315
|
+
allowProtoMethodsByDefault: false,
|
|
316
|
+
allowProtoPropertiesByDefault: false,
|
|
317
|
+
helpers: /* @__PURE__ */ Object.create(null),
|
|
318
|
+
partials: /* @__PURE__ */ Object.create(null)
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
if (Array.isArray(value)) return value.map((item) => renderValue(item, row));
|
|
322
|
+
const input = record(value);
|
|
323
|
+
if (!input) return value;
|
|
324
|
+
return Object.fromEntries(
|
|
325
|
+
Object.entries(input).map(([key, item]) => [key, renderValue(item, row)])
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
function renderMonitorSpecTemplate(template, row) {
|
|
329
|
+
const lint = lintMonitorSpecTemplate(template);
|
|
330
|
+
if (!lint.normalized) return { issues: lint.issues };
|
|
331
|
+
try {
|
|
332
|
+
const rendered = renderValue(lint.normalized, row);
|
|
333
|
+
const issues = [];
|
|
334
|
+
const spec = monitorSpec(rendered, "monitor", issues);
|
|
335
|
+
return spec ? { spec, issues: issues.sort(issueOrder) } : { issues: issues.sort(issueOrder) };
|
|
336
|
+
} catch (error) {
|
|
337
|
+
return {
|
|
338
|
+
issues: [
|
|
339
|
+
{
|
|
340
|
+
severity: "error",
|
|
341
|
+
code: "monitor_template_render_failed",
|
|
342
|
+
path: "monitor",
|
|
343
|
+
message: error instanceof Error ? error.message : "Fleet template rendering failed."
|
|
344
|
+
}
|
|
345
|
+
]
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
exports.lintMonitorBatchInput = lintMonitorBatchInput; exports.lintMonitorSpecTemplate = lintMonitorSpecTemplate; exports.renderMonitorSpecTemplate = renderMonitorSpecTemplate;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunk2S5Y3TZPjs = require('./chunk-2S5Y3TZP.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkF35VOIQLjs = require('./chunk-F35VOIQL.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkXRK2TZT5js = require('./chunk-XRK2TZT5.js');
|
|
11
|
+
|
|
12
|
+
// src/cli/search-ref.ts
|
|
13
|
+
var _fs = require('fs');
|
|
14
|
+
var _path = require('path');
|
|
15
|
+
var SEARCH_REF_TTL_MS = 15 * 6e4;
|
|
16
|
+
function lastSearchPath() {
|
|
17
|
+
return _path.join.call(void 0, _chunkXRK2TZT5js.sdkCliStateDirPath.call(void 0, _chunkXRK2TZT5js.resolveConfig.call(void 0, ).baseUrl), "last-search.json");
|
|
18
|
+
}
|
|
19
|
+
function rememberSearchRef(searchRef) {
|
|
20
|
+
try {
|
|
21
|
+
_fs.mkdirSync.call(void 0, _path.dirname.call(void 0, lastSearchPath()), { recursive: true });
|
|
22
|
+
_fs.writeFileSync.call(void 0,
|
|
23
|
+
lastSearchPath(),
|
|
24
|
+
JSON.stringify({ searchRef, at: Date.now() }),
|
|
25
|
+
{ mode: 384 }
|
|
26
|
+
);
|
|
27
|
+
} catch (e) {
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function recentSearchRef() {
|
|
31
|
+
try {
|
|
32
|
+
const saved = JSON.parse(_fs.readFileSync.call(void 0, lastSearchPath(), "utf8"));
|
|
33
|
+
return typeof saved.searchRef === "string" && typeof saved.at === "number" && Date.now() - saved.at < SEARCH_REF_TTL_MS ? saved.searchRef : void 0;
|
|
34
|
+
} catch (e2) {
|
|
35
|
+
return void 0;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// src/cli/commands/search.ts
|
|
40
|
+
var SEARCH_TYPES = [
|
|
41
|
+
"tools",
|
|
42
|
+
"plays",
|
|
43
|
+
"monitors",
|
|
44
|
+
"prebuilts",
|
|
45
|
+
"custom"
|
|
46
|
+
];
|
|
47
|
+
var USAGE = "Usage: deepline search [query] [--type <types>] [--categories <categories>] [--search_terms <terms>] [--json]";
|
|
48
|
+
function parseTypes(flag, raw) {
|
|
49
|
+
const names = (_nullishCoalesce(raw, () => ( ""))).split(",").map((name) => name.trim().toLowerCase()).filter(Boolean);
|
|
50
|
+
const unknown = names.filter(
|
|
51
|
+
(name) => !SEARCH_TYPES.includes(name)
|
|
52
|
+
);
|
|
53
|
+
if (unknown.length > 0) {
|
|
54
|
+
throw new Error(
|
|
55
|
+
`Unknown ${flag} ${unknown.join(", ")}. Use any of: ${SEARCH_TYPES.join(", ")}.`
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return names;
|
|
59
|
+
}
|
|
60
|
+
function optionalInteger(raw) {
|
|
61
|
+
return raw === void 0 ? void 0 : Number.parseInt(raw, 10);
|
|
62
|
+
}
|
|
63
|
+
function appendCsv(value, previous) {
|
|
64
|
+
return previous ? `${previous},${value}` : value;
|
|
65
|
+
}
|
|
66
|
+
function addSearchOptions(command) {
|
|
67
|
+
return command.option(
|
|
68
|
+
"--categories <categories>",
|
|
69
|
+
"Comma-separated tool categories; may be used without a query"
|
|
70
|
+
).option(
|
|
71
|
+
"--search_terms <terms>",
|
|
72
|
+
"Comma-separated structured search terms; may be used without a query"
|
|
73
|
+
).option("--search-terms <terms>", "Alias for --search_terms").option(
|
|
74
|
+
"--task <sentence>",
|
|
75
|
+
"What you are trying to accomplish: input you have -> result you need"
|
|
76
|
+
).option("--limit <count>", "Maximum ranked results to return (1-50)").option("--offset <count>", "Zero-based ranked result offset").option("--search-mode <mode>", "Ranked search mode: v1 or v2").option("--include-search-debug", "Include ranked search debug metadata").option("--json", "Emit JSON output instead of the readable default");
|
|
77
|
+
}
|
|
78
|
+
async function runSearch(queryInput, options, types, exclude = []) {
|
|
79
|
+
const query = _nullishCoalesce(_optionalChain([queryInput, 'optionalAccess', _ => _.trim, 'call', _2 => _2()]), () => ( ""));
|
|
80
|
+
const searchTerms = _nullishCoalesce(options.searchTerms, () => ( options.search_terms));
|
|
81
|
+
if (!query && !_optionalChain([options, 'access', _3 => _3.categories, 'optionalAccess', _4 => _4.trim, 'call', _5 => _5()]) && !_optionalChain([searchTerms, 'optionalAccess', _6 => _6.trim, 'call', _7 => _7()])) {
|
|
82
|
+
console.error(USAGE);
|
|
83
|
+
return 1;
|
|
84
|
+
}
|
|
85
|
+
const { search_ref: searchRef, ...result } = await new (0, _chunk2S5Y3TZPjs.DeeplineClient)().search({
|
|
86
|
+
query,
|
|
87
|
+
types,
|
|
88
|
+
exclude,
|
|
89
|
+
categories: options.categories,
|
|
90
|
+
searchTerms,
|
|
91
|
+
task: options.task,
|
|
92
|
+
limit: optionalInteger(options.limit),
|
|
93
|
+
offset: optionalInteger(options.offset),
|
|
94
|
+
searchMode: options.searchMode === "v1" || options.searchMode === "v2" ? options.searchMode : void 0,
|
|
95
|
+
includeSearchDebug: Boolean(options.includeSearchDebug)
|
|
96
|
+
});
|
|
97
|
+
if (searchRef) rememberSearchRef(searchRef);
|
|
98
|
+
_chunkF35VOIQLjs.printCommandEnvelope.call(void 0, result, {
|
|
99
|
+
json: options.json === true
|
|
100
|
+
});
|
|
101
|
+
return 0;
|
|
102
|
+
}
|
|
103
|
+
function registerDeprecatedSearchCommand(parent, typesFor) {
|
|
104
|
+
const name = `deepline ${parent.name()} search`;
|
|
105
|
+
addSearchOptions(
|
|
106
|
+
parent.command("search [query]").description(`Deprecated. Use deepline search --type <types>.`).addHelpText(
|
|
107
|
+
"after",
|
|
108
|
+
`
|
|
109
|
+
Notes:
|
|
110
|
+
Deprecated alias for the unified search. It runs deepline search with the
|
|
111
|
+
matching --type and returns the same results envelope.
|
|
112
|
+
|
|
113
|
+
Examples:
|
|
114
|
+
deepline search email --type ${typesFor({}).join(",")}
|
|
115
|
+
`
|
|
116
|
+
).option("--all", "Include plays your workspace created").option("--compact", "Accepted for compatibility; results are compact")
|
|
117
|
+
).action(async (query, options) => {
|
|
118
|
+
const types = typesFor(options);
|
|
119
|
+
console.error(
|
|
120
|
+
`${name} is deprecated. Use: deepline search${query ? ` ${JSON.stringify(query)}` : ""} --type ${types.join(",")}`
|
|
121
|
+
);
|
|
122
|
+
process.exitCode = await runSearch(query, options, types);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function registerSearchCommand(program) {
|
|
126
|
+
addSearchOptions(
|
|
127
|
+
program.command("search [query]").description(
|
|
128
|
+
"Search tools, monitors, and plays together, ranked by intent."
|
|
129
|
+
).addHelpText(
|
|
130
|
+
"after",
|
|
131
|
+
`
|
|
132
|
+
Notes:
|
|
133
|
+
One ranked search across everything Deepline can run, deploy, or explain.
|
|
134
|
+
Every result carries a kind: tool, monitor_type, prebuilt_play, custom_play
|
|
135
|
+
(a play your workspace created), or doc. Narrow with --type, a
|
|
136
|
+
comma-separated list of:
|
|
137
|
+
tools atomic provider operations (deepline tools execute)
|
|
138
|
+
monitors monitor types you can deploy
|
|
139
|
+
prebuilts Deepline-maintained plays
|
|
140
|
+
custom plays your workspace created
|
|
141
|
+
plays prebuilts and custom together
|
|
142
|
+
--exclude takes the same names and leaves those kinds out instead.
|
|
143
|
+
Ranking uses a third-party AI relevance model. For plays your workspace
|
|
144
|
+
created it is sent only the play name and description, never play code.
|
|
145
|
+
Both flags may be repeated: --type tools --type prebuilts.
|
|
146
|
+
Provide a query, or omit it only when --categories and/or --search_terms is
|
|
147
|
+
supplied. Use --limit and --offset to page (limit 1-50, offset zero-based);
|
|
148
|
+
JSON includes next_offset. Pass --task with one sentence on what you are
|
|
149
|
+
trying to accomplish: the input you have and the result you need. It
|
|
150
|
+
materially improves ranking, especially for short queries.
|
|
151
|
+
Search prints a readable result list by default, piped or not, and that is
|
|
152
|
+
the recommended form. Pass --json only when a program parses the result.
|
|
153
|
+
|
|
154
|
+
Examples:
|
|
155
|
+
deepline search "find work email"
|
|
156
|
+
deepline search "find work email" --type tools --limit 10
|
|
157
|
+
deepline search "company to contacts" --type plays
|
|
158
|
+
deepline search "enrich a company" --exclude monitors,custom
|
|
159
|
+
deepline search linkedin --task "I have 200 LinkedIn profile URLs and need each person's current title and company"
|
|
160
|
+
deepline search --type tools --categories company_search --search_terms "investors,funding"
|
|
161
|
+
`
|
|
162
|
+
).option(
|
|
163
|
+
"--type <types>",
|
|
164
|
+
`Kinds to search, comma-separated or repeated: ${SEARCH_TYPES.join(", ")}`,
|
|
165
|
+
appendCsv
|
|
166
|
+
).option(
|
|
167
|
+
"--exclude <types>",
|
|
168
|
+
"Kinds to leave out, comma-separated or repeated; the opposite of --type",
|
|
169
|
+
appendCsv
|
|
170
|
+
)
|
|
171
|
+
).action(async (query, options) => {
|
|
172
|
+
let types;
|
|
173
|
+
let exclude;
|
|
174
|
+
try {
|
|
175
|
+
types = parseTypes("--type", options.type);
|
|
176
|
+
exclude = parseTypes("--exclude", options.exclude);
|
|
177
|
+
} catch (error) {
|
|
178
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
179
|
+
process.exitCode = 1;
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
process.exitCode = await runSearch(query, options, types, exclude);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
exports.recentSearchRef = recentSearchRef; exports.registerDeprecatedSearchCommand = registerDeprecatedSearchCommand; exports.registerSearchCommand = registerSearchCommand;
|