@neat.is/core 0.10.6-dev.20261010 → 0.10.7-dev.20261011

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.
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/incidents-render.ts
21
+ var incidents_render_exports = {};
22
+ __export(incidents_render_exports, {
23
+ deployHintLines: () => deployHintLines
24
+ });
25
+ module.exports = __toCommonJS(incidents_render_exports);
26
+ function deployHintLines(ev) {
27
+ const a = ev.attributes;
28
+ if (!a) return [];
29
+ const s = (k) => typeof a[k] === "string" ? a[k] : void 0;
30
+ const n = (k) => typeof a[k] === "number" ? a[k] : void 0;
31
+ const arr = (k) => Array.isArray(a[k]) ? a[k].filter((x) => typeof x === "string") : [];
32
+ const fault = s("k8s.fault");
33
+ const env = arr("k8s.containerEnv");
34
+ const args = arr("k8s.containerArgs");
35
+ const log = s("k8s.processLog");
36
+ if (!fault && env.length === 0 && args.length === 0 && !log) return [];
37
+ const out = [];
38
+ if (fault) {
39
+ const bits = [fault];
40
+ const wr = s("k8s.waitingReason");
41
+ if (wr) bits.push(wr);
42
+ const rc = n("k8s.restartCount");
43
+ if (rc !== void 0) bits.push(`restarts=${rc}`);
44
+ const ec = n("k8s.exitCode");
45
+ if (ec !== void 0) bits.push(`exit=${ec}`);
46
+ const tr = s("k8s.terminatedReason");
47
+ if (tr) bits.push(tr);
48
+ out.push(`deploy: ${bits.join(" ")}`);
49
+ }
50
+ const cap = (xs, max) => {
51
+ const joined = xs.join(" ");
52
+ return joined.length > max ? `${joined.slice(0, max)}\u2026(+${xs.length} entries)` : joined;
53
+ };
54
+ if (env.length > 0) out.push(`env: ${cap(env, 700)}`);
55
+ if (args.length > 0) out.push(`args: ${cap(args, 300)}`);
56
+ if (log) {
57
+ const tail = log.split("\n").filter((l) => l.trim().length > 0).slice(-4);
58
+ if (tail.length > 0) out.push(`log: ${tail.join(" \u23CE ")}`);
59
+ }
60
+ return out;
61
+ }
62
+ // Annotate the CommonJS export names for ESM import in node:
63
+ 0 && (module.exports = {
64
+ deployHintLines
65
+ });
66
+ //# sourceMappingURL=incidents-render.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/incidents-render.ts"],"sourcesContent":["import type { ErrorEvent } from '@neat.is/types'\n\n// The OBSERVED deploy/process/config context an incident may carry (ADR-237/240):\n// the deploy fault, the faulted container's redacted env/args, and its boot-time\n// stdout tail. Rendered compactly so the incident surfaces the wrong host / bad\n// flag / crash traceback inline instead of leaving it to the card.\n//\n// One renderer, two readers: the CLI `neat incidents` output (cli-client.ts) and\n// the MCP get_incident_history tool (packages/mcp) both call this, so the two\n// never drift (core #1373 — atomic, no feature mirrors another's fields).\n// Returns [] for a non-k8s incident, so those lines read exactly as before.\nexport function deployHintLines(ev: ErrorEvent): string[] {\n const a = ev.attributes\n if (!a) return []\n const s = (k: string): string | undefined => (typeof a[k] === 'string' ? (a[k] as string) : undefined)\n const n = (k: string): number | undefined => (typeof a[k] === 'number' ? (a[k] as number) : undefined)\n const arr = (k: string): string[] => (Array.isArray(a[k]) ? (a[k] as unknown[]).filter((x) => typeof x === 'string') as string[] : [])\n const fault = s('k8s.fault')\n const env = arr('k8s.containerEnv')\n const args = arr('k8s.containerArgs')\n const log = s('k8s.processLog')\n if (!fault && env.length === 0 && args.length === 0 && !log) return []\n const out: string[] = []\n if (fault) {\n const bits = [fault]\n const wr = s('k8s.waitingReason'); if (wr) bits.push(wr)\n const rc = n('k8s.restartCount'); if (rc !== undefined) bits.push(`restarts=${rc}`)\n const ec = n('k8s.exitCode'); if (ec !== undefined) bits.push(`exit=${ec}`)\n const tr = s('k8s.terminatedReason'); if (tr) bits.push(tr)\n out.push(`deploy: ${bits.join(' ')}`)\n }\n const cap = (xs: string[], max: number): string => {\n const joined = xs.join(' ')\n return joined.length > max ? `${joined.slice(0, max)}…(+${xs.length} entries)` : joined\n }\n if (env.length > 0) out.push(`env: ${cap(env, 700)}`)\n if (args.length > 0) out.push(`args: ${cap(args, 300)}`)\n if (log) {\n const tail = log.split('\\n').filter((l) => l.trim().length > 0).slice(-4)\n if (tail.length > 0) out.push(`log: ${tail.join(' ⏎ ')}`)\n }\n return out\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWO,SAAS,gBAAgB,IAA0B;AACxD,QAAM,IAAI,GAAG;AACb,MAAI,CAAC,EAAG,QAAO,CAAC;AAChB,QAAM,IAAI,CAAC,MAAmC,OAAO,EAAE,CAAC,MAAM,WAAY,EAAE,CAAC,IAAe;AAC5F,QAAM,IAAI,CAAC,MAAmC,OAAO,EAAE,CAAC,MAAM,WAAY,EAAE,CAAC,IAAe;AAC5F,QAAM,MAAM,CAAC,MAAyB,MAAM,QAAQ,EAAE,CAAC,CAAC,IAAK,EAAE,CAAC,EAAgB,OAAO,CAAC,MAAM,OAAO,MAAM,QAAQ,IAAgB,CAAC;AACpI,QAAM,QAAQ,EAAE,WAAW;AAC3B,QAAM,MAAM,IAAI,kBAAkB;AAClC,QAAM,OAAO,IAAI,mBAAmB;AACpC,QAAM,MAAM,EAAE,gBAAgB;AAC9B,MAAI,CAAC,SAAS,IAAI,WAAW,KAAK,KAAK,WAAW,KAAK,CAAC,IAAK,QAAO,CAAC;AACrE,QAAM,MAAgB,CAAC;AACvB,MAAI,OAAO;AACT,UAAM,OAAO,CAAC,KAAK;AACnB,UAAM,KAAK,EAAE,mBAAmB;AAAG,QAAI,GAAI,MAAK,KAAK,EAAE;AACvD,UAAM,KAAK,EAAE,kBAAkB;AAAG,QAAI,OAAO,OAAW,MAAK,KAAK,YAAY,EAAE,EAAE;AAClF,UAAM,KAAK,EAAE,cAAc;AAAG,QAAI,OAAO,OAAW,MAAK,KAAK,QAAQ,EAAE,EAAE;AAC1E,UAAM,KAAK,EAAE,sBAAsB;AAAG,QAAI,GAAI,MAAK,KAAK,EAAE;AAC1D,QAAI,KAAK,WAAW,KAAK,KAAK,GAAG,CAAC,EAAE;AAAA,EACtC;AACA,QAAM,MAAM,CAAC,IAAc,QAAwB;AACjD,UAAM,SAAS,GAAG,KAAK,IAAI;AAC3B,WAAO,OAAO,SAAS,MAAM,GAAG,OAAO,MAAM,GAAG,GAAG,CAAC,WAAM,GAAG,MAAM,cAAc;AAAA,EACnF;AACA,MAAI,IAAI,SAAS,EAAG,KAAI,KAAK,QAAQ,IAAI,KAAK,GAAG,CAAC,EAAE;AACpD,MAAI,KAAK,SAAS,EAAG,KAAI,KAAK,SAAS,IAAI,MAAM,GAAG,CAAC,EAAE;AACvD,MAAI,KAAK;AACP,UAAM,OAAO,IAAI,MAAM,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE;AACxE,QAAI,KAAK,SAAS,EAAG,KAAI,KAAK,QAAQ,KAAK,KAAK,UAAK,CAAC,EAAE;AAAA,EAC1D;AACA,SAAO;AACT;","names":[]}
@@ -0,0 +1,5 @@
1
+ import { ErrorEvent } from '@neat.is/types';
2
+
3
+ declare function deployHintLines(ev: ErrorEvent): string[];
4
+
5
+ export { deployHintLines };
@@ -0,0 +1,5 @@
1
+ import { ErrorEvent } from '@neat.is/types';
2
+
3
+ declare function deployHintLines(ev: ErrorEvent): string[];
4
+
5
+ export { deployHintLines };
@@ -0,0 +1,8 @@
1
+ import {
2
+ deployHintLines
3
+ } from "./chunk-AEMLUMHC.js";
4
+ import "./chunk-MR64ICXX.js";
5
+ export {
6
+ deployHintLines
7
+ };
8
+ //# sourceMappingURL=incidents-render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}