@vincemakes/kiso-tui-cells 0.12.0 → 0.14.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.
@@ -63,6 +63,44 @@ export interface SaferRuntime {
63
63
  * all still there, which is the only thing they need to know to keep
64
64
  * going. */
65
65
  export declare const SAFER_DEGRADED = "couldn't get safer options \u2014 the original choices stand";
66
+ /**
67
+ * R3v2-F1 — the same sentence, for the one failure the reply's own text
68
+ * can PROVE.
69
+ *
70
+ * The unqualified line is true of every failure the ask has, which is
71
+ * exactly why it explains nothing when the cause was knowable. A reply
72
+ * the token budget cut in half is knowable: the JSON opens and never
73
+ * closes. So that case gets the cause in a parenthesis and keeps
74
+ * everything else — one line, dim, still leading with what is still
75
+ * true — because the human is mid-approval and the shape of the sentence
76
+ * is what they have already learned to read.
77
+ */
78
+ export declare const SAFER_DEGRADED_TRUNCATED = "couldn't get safer options (the reply was cut short) \u2014 the original choices stand";
79
+ /**
80
+ * R3v2-F1 — a failure that knows why it failed.
81
+ *
82
+ * `truncated` is the only cause the caller can demonstrate from the
83
+ * text, and it is deliberately the only member: a diagnosis the product
84
+ * cannot prove is worse than no diagnosis, so every other failure stays
85
+ * the unqualified line rather than growing a guess.
86
+ */
87
+ export interface SaferFailure {
88
+ readonly reason: "truncated";
89
+ }
90
+ /**
91
+ * R3v2-F1 — what the safer-options provider hands back.
92
+ *
93
+ * A list is the answer. `null` is a failure with nothing to add, and is
94
+ * still the whole contract for any caller that has nothing to add — the
95
+ * widening is additive, so an existing provider's behaviour is
96
+ * byte-identical. A SaferFailure is a failure that can name its cause.
97
+ */
98
+ export type SaferAnswer = readonly SaferOption[] | SaferFailure | null;
99
+ /** R3v2-F1: the line a failed ask owes the human — the unqualified one,
100
+ * unless the answer named a cause. The panel asks this instead of
101
+ * reaching for a constant, so the choice of sentence lives with the
102
+ * sentences. */
103
+ export declare function saferDegradedNote(answer: SaferAnswer): string;
66
104
  /** The row that returns to state 1. Rendered last, always present — an
67
105
  * alternatives list you cannot back out of would be a trap. */
68
106
  export declare const SAFER_BACK = "back to the original choices";
@@ -35,6 +35,27 @@ import { escapeTerminal, palette } from "./render.js";
35
35
  * all still there, which is the only thing they need to know to keep
36
36
  * going. */
37
37
  export const SAFER_DEGRADED = "couldn't get safer options — the original choices stand";
38
+ /**
39
+ * R3v2-F1 — the same sentence, for the one failure the reply's own text
40
+ * can PROVE.
41
+ *
42
+ * The unqualified line is true of every failure the ask has, which is
43
+ * exactly why it explains nothing when the cause was knowable. A reply
44
+ * the token budget cut in half is knowable: the JSON opens and never
45
+ * closes. So that case gets the cause in a parenthesis and keeps
46
+ * everything else — one line, dim, still leading with what is still
47
+ * true — because the human is mid-approval and the shape of the sentence
48
+ * is what they have already learned to read.
49
+ */
50
+ export const SAFER_DEGRADED_TRUNCATED = "couldn't get safer options (the reply was cut short) — the original choices stand";
51
+ /** R3v2-F1: the line a failed ask owes the human — the unqualified one,
52
+ * unless the answer named a cause. The panel asks this instead of
53
+ * reaching for a constant, so the choice of sentence lives with the
54
+ * sentences. */
55
+ export function saferDegradedNote(answer) {
56
+ const failure = answer === null || Array.isArray(answer) ? null : answer;
57
+ return failure?.reason === "truncated" ? SAFER_DEGRADED_TRUNCATED : SAFER_DEGRADED;
58
+ }
38
59
  /** The row that returns to state 1. Rendered last, always present — an
39
60
  * alternatives list you cannot back out of would be a trap. */
40
61
  export const SAFER_BACK = "back to the original choices";
package/dist/strings.d.ts CHANGED
@@ -61,6 +61,14 @@ export declare function projectUntrustedNote(count: number, root: string): strin
61
61
  * goes stale silently. The tool name is escaped for the dock-less
62
62
  * fallback question because it reaches the terminal as raw text there;
63
63
  * the panel's own rows are escaped by the panel renderer. */
64
+ /**
65
+ * TV-1B — the verification offer (the thin task driver's one question):
66
+ * shown at a NORMAL settle when every item is claimed done and no
67
+ * passing check is fresh. The panel's simple flavor; bare-Enter
68
+ * approves, Esc dismisses. The fallback question serves a dock-less
69
+ * TTY; non-interactive paths never reach askPanel at all.
70
+ */
71
+ export declare function verifyOfferView(): PanelView;
64
72
  export declare function uncertainView(name: string, executionId: string): PanelView;
65
73
  /**
66
74
  * KC3.5 — the SAME uncertainty gate, said honestly for an ask_user call.
package/dist/strings.js CHANGED
@@ -72,6 +72,26 @@ export function projectUntrustedNote(count, root) {
72
72
  * goes stale silently. The tool name is escaped for the dock-less
73
73
  * fallback question because it reaches the terminal as raw text there;
74
74
  * the panel's own rows are escaped by the panel renderer. */
75
+ /**
76
+ * TV-1B — the verification offer (the thin task driver's one question):
77
+ * shown at a NORMAL settle when every item is claimed done and no
78
+ * passing check is fresh. The panel's simple flavor; bare-Enter
79
+ * approves, Esc dismisses. The fallback question serves a dock-less
80
+ * TTY; non-interactive paths never reach askPanel at all.
81
+ */
82
+ export function verifyOfferView() {
83
+ return {
84
+ flavor: "simple",
85
+ name: "verification",
86
+ title: "finish the checklist?",
87
+ speaker: "kiso",
88
+ statusText: "\u25b8 run paused",
89
+ args: { kind: "text", lines: [] },
90
+ ruleOverride: "every item is marked done \u2014 run a check?",
91
+ simpleOptions: ["run a verification pass", "not now"],
92
+ fallbackQuestion: "run a verification pass? (y/n) ",
93
+ };
94
+ }
75
95
  export function uncertainView(name, executionId) {
76
96
  return {
77
97
  flavor: "simple",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincemakes/kiso-tui-cells",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "kiso tui-cells — the components cell renderer (components, diff, width, the render slice). Zero runtime dependencies: input is data, output is bytes.",
5
5
  "type": "module",
6
6
  "license": "MIT",