@gaunt-sloth/core 2.0.0-alpha.24 → 2.0.0-alpha.26
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 +1 -1
- package/dist/config/colour.d.ts +38 -0
- package/dist/config/colour.js +36 -0
- package/dist/config/colour.js.map +1 -0
- package/dist/config/defaults.d.ts +1 -0
- package/dist/config/defaults.js +1 -0
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/loader.d.ts +13 -6
- package/dist/config/loader.js +171 -28
- package/dist/config/loader.js.map +1 -1
- package/dist/config/mouse.d.ts +50 -0
- package/dist/config/mouse.js +44 -0
- package/dist/config/mouse.js.map +1 -0
- package/dist/config/schema.d.ts +2372 -114
- package/dist/config/schema.js +845 -16
- package/dist/config/schema.js.map +1 -1
- package/dist/config/shell-policy.d.ts +466 -116
- package/dist/config/shell-policy.js +273 -62
- package/dist/config/shell-policy.js.map +1 -1
- package/dist/config/tool-descriptions.d.ts +165 -0
- package/dist/config/tool-descriptions.js +229 -0
- package/dist/config/tool-descriptions.js.map +1 -0
- package/dist/config/types.d.ts +36 -1
- package/dist/config/types.js.map +1 -1
- package/dist/config.d.ts +3 -0
- package/dist/config.js +3 -0
- package/dist/config.js.map +1 -1
- package/dist/core/GthAbstractAgent.d.ts +59 -1
- package/dist/core/GthAbstractAgent.js +72 -0
- package/dist/core/GthAbstractAgent.js.map +1 -1
- package/dist/core/GthAgentRunner.d.ts +341 -58
- package/dist/core/GthAgentRunner.js +817 -149
- package/dist/core/GthAgentRunner.js.map +1 -1
- package/dist/core/GthLangChainAgent.d.ts +16 -0
- package/dist/core/GthLangChainAgent.js +72 -2
- package/dist/core/GthLangChainAgent.js.map +1 -1
- package/dist/core/approvals/annotations.d.ts +122 -0
- package/dist/core/approvals/annotations.js +137 -0
- package/dist/core/approvals/annotations.js.map +1 -0
- package/dist/core/approvals/grants.d.ts +216 -0
- package/dist/core/approvals/grants.js +469 -0
- package/dist/core/approvals/grants.js.map +1 -0
- package/dist/core/approvals/matcher.d.ts +202 -0
- package/dist/core/approvals/matcher.js +267 -0
- package/dist/core/approvals/matcher.js.map +1 -0
- package/dist/core/approvals/mcpSubjects.d.ts +40 -0
- package/dist/core/approvals/mcpSubjects.js +99 -0
- package/dist/core/approvals/mcpSubjects.js.map +1 -0
- package/dist/core/approvals/toolAnnotationSources.d.ts +105 -0
- package/dist/core/approvals/toolAnnotationSources.js +277 -0
- package/dist/core/approvals/toolAnnotationSources.js.map +1 -0
- package/dist/core/approvals/toolHost.d.ts +46 -0
- package/dist/core/approvals/toolHost.js +108 -0
- package/dist/core/approvals/toolHost.js.map +1 -0
- package/dist/core/launchBanner.d.ts +120 -0
- package/dist/core/launchBanner.js +399 -0
- package/dist/core/launchBanner.js.map +1 -0
- package/dist/core/plainToolIndication.js +13 -7
- package/dist/core/plainToolIndication.js.map +1 -1
- package/dist/core/shell/approvalStop.d.ts +75 -0
- package/dist/core/shell/approvalStop.js +108 -0
- package/dist/core/shell/approvalStop.js.map +1 -0
- package/dist/core/shell/arity.d.ts +6 -0
- package/dist/core/shell/arity.js +20 -6
- package/dist/core/shell/arity.js.map +1 -1
- package/dist/core/shell/denylist.d.ts +11 -0
- package/dist/core/shell/denylist.js +37 -0
- package/dist/core/shell/denylist.js.map +1 -0
- package/dist/core/shell/normalize.d.ts +41 -1
- package/dist/core/shell/normalize.js +58 -4
- package/dist/core/shell/normalize.js.map +1 -1
- package/dist/core/shell/openWorld.d.ts +138 -0
- package/dist/core/shell/openWorld.js +523 -0
- package/dist/core/shell/openWorld.js.map +1 -0
- package/dist/core/shell/rater.d.ts +560 -0
- package/dist/core/shell/rater.js +895 -0
- package/dist/core/shell/rater.js.map +1 -0
- package/dist/core/shell/raterModel.d.ts +41 -0
- package/dist/core/shell/raterModel.js +51 -0
- package/dist/core/shell/raterModel.js.map +1 -0
- package/dist/core/shell/rejection.d.ts +66 -0
- package/dist/core/shell/rejection.js +38 -0
- package/dist/core/shell/rejection.js.map +1 -0
- package/dist/core/types.d.ts +71 -9
- package/dist/core/types.js.map +1 -1
- package/dist/runtime/askStructured.d.ts +8 -7
- package/dist/runtime/askStructured.js +8 -7
- package/dist/runtime/askStructured.js.map +1 -1
- package/dist/runtime/conversation.js +89 -76
- package/dist/runtime/conversation.js.map +1 -1
- package/dist/runtime/singleShot.js +71 -60
- package/dist/runtime/singleShot.js.map +1 -1
- package/dist/utils/ProgressIndicator.d.ts +21 -0
- package/dist/utils/ProgressIndicator.js +30 -3
- package/dist/utils/ProgressIndicator.js.map +1 -1
- package/dist/utils/consoleUtils.d.ts +30 -0
- package/dist/utils/consoleUtils.js +27 -2
- package/dist/utils/consoleUtils.js.map +1 -1
- package/dist/utils/systemUtils.d.ts +17 -0
- package/dist/utils/systemUtils.js +17 -0
- package/dist/utils/systemUtils.js.map +1 -1
- package/package.json +5 -2
- package/schema/gsloth-config.schema.json +1216 -417
- package/dist/core/shell/allowlist.d.ts +0 -75
- package/dist/core/shell/allowlist.js +0 -187
- package/dist/core/shell/allowlist.js.map +0 -1
- package/dist/core/shell/judge.d.ts +0 -161
- package/dist/core/shell/judge.js +0 -261
- package/dist/core/shell/judge.js.map +0 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI-C37 — the single place that decides whether the Ink TUI turns on terminal mouse reporting.
|
|
3
|
+
*
|
|
4
|
+
* Shaped exactly like the colour decision in `colour.ts`: everything the answer depends on arrives
|
|
5
|
+
* as an argument, so the ladder is testable rung by rung without touching process globals.
|
|
6
|
+
*
|
|
7
|
+
* Mouse reporting is ON by default, which is what makes the TUI's clickable affordances
|
|
8
|
+
* discoverable at all. The cost is real and is why the off-ramps below exist: while tracking is on
|
|
9
|
+
* the terminal hands drag events to the application, so its own text selection needs a modifier
|
|
10
|
+
* (Shift, or Option on macOS terminals). {@link MOUSE_SELECTION_HINT} is the one wording for that,
|
|
11
|
+
* so `/help` and the `/mouse` feedback cannot drift apart.
|
|
12
|
+
*/
|
|
13
|
+
/** Everything the mouse decision depends on. See {@link resolveUseMouse}. */
|
|
14
|
+
export interface UseMouseInput {
|
|
15
|
+
/**
|
|
16
|
+
* Raw `GTH_NO_MOUSE` environment value; `undefined` when the variable is not set at all. Set and
|
|
17
|
+
* non-empty means mouse OFF. This rung outranks config because it is the escape hatch that works
|
|
18
|
+
* WITHOUT editing a config file — the state someone is in when their terminal mishandles tracking
|
|
19
|
+
* and the session is already unpleasant to use.
|
|
20
|
+
*/
|
|
21
|
+
noMouse?: string;
|
|
22
|
+
/**
|
|
23
|
+
* `useMouse` as the user actually wrote it — read from the RAW config, BEFORE `DEFAULT_CONFIG` is
|
|
24
|
+
* merged in. `undefined` means the user set nothing. After the default merge an explicit `true` is
|
|
25
|
+
* indistinguishable from the default `true`, so this must be captured pre-merge or the rung
|
|
26
|
+
* collapses (the same trap `explicitUseColour` documents).
|
|
27
|
+
*/
|
|
28
|
+
explicitUseMouse?: boolean;
|
|
29
|
+
/** Raw `TERM`; `dumb`, empty or unset describes a terminal that cannot be expected to track. */
|
|
30
|
+
term?: string;
|
|
31
|
+
/** Whether stdout is a terminal. */
|
|
32
|
+
stdoutIsTTY: boolean;
|
|
33
|
+
/** Whether stdin is a terminal — mouse REPORTS arrive on stdin, so both ends must be a TTY. */
|
|
34
|
+
stdinIsTTY: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The user-facing sentence explaining how to select text while tracking is on. Terminals disagree
|
|
38
|
+
* about which modifier restores native selection, so this names both rather than promising one.
|
|
39
|
+
*/
|
|
40
|
+
export declare const MOUSE_SELECTION_HINT = "To select text while the mouse is on, hold Shift (Option in some macOS terminals) while dragging.";
|
|
41
|
+
/**
|
|
42
|
+
* Resolve mouse reporting from the four-rung precedence ladder, highest wins:
|
|
43
|
+
*
|
|
44
|
+
* 1. `GTH_NO_MOUSE` is set and non-empty — mouse OFF, no config file needed.
|
|
45
|
+
* 2. `useMouse` was set explicitly in config — use it verbatim.
|
|
46
|
+
* 3. `TERM` is unset, empty or `dumb` — mouse OFF; nothing useful can be reported.
|
|
47
|
+
* 4. Otherwise — ON when BOTH stdout and stdin are terminals. A piped, redirected or captured run
|
|
48
|
+
* never enables tracking, so its bytes are identical to a run with mouse compiled out.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveUseMouse(input: UseMouseInput): boolean;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI-C37 — the single place that decides whether the Ink TUI turns on terminal mouse reporting.
|
|
3
|
+
*
|
|
4
|
+
* Shaped exactly like the colour decision in `colour.ts`: everything the answer depends on arrives
|
|
5
|
+
* as an argument, so the ladder is testable rung by rung without touching process globals.
|
|
6
|
+
*
|
|
7
|
+
* Mouse reporting is ON by default, which is what makes the TUI's clickable affordances
|
|
8
|
+
* discoverable at all. The cost is real and is why the off-ramps below exist: while tracking is on
|
|
9
|
+
* the terminal hands drag events to the application, so its own text selection needs a modifier
|
|
10
|
+
* (Shift, or Option on macOS terminals). {@link MOUSE_SELECTION_HINT} is the one wording for that,
|
|
11
|
+
* so `/help` and the `/mouse` feedback cannot drift apart.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* The user-facing sentence explaining how to select text while tracking is on. Terminals disagree
|
|
15
|
+
* about which modifier restores native selection, so this names both rather than promising one.
|
|
16
|
+
*/
|
|
17
|
+
export const MOUSE_SELECTION_HINT = 'To select text while the mouse is on, hold Shift (Option in some macOS terminals) while dragging.';
|
|
18
|
+
/**
|
|
19
|
+
* Resolve mouse reporting from the four-rung precedence ladder, highest wins:
|
|
20
|
+
*
|
|
21
|
+
* 1. `GTH_NO_MOUSE` is set and non-empty — mouse OFF, no config file needed.
|
|
22
|
+
* 2. `useMouse` was set explicitly in config — use it verbatim.
|
|
23
|
+
* 3. `TERM` is unset, empty or `dumb` — mouse OFF; nothing useful can be reported.
|
|
24
|
+
* 4. Otherwise — ON when BOTH stdout and stdin are terminals. A piped, redirected or captured run
|
|
25
|
+
* never enables tracking, so its bytes are identical to a run with mouse compiled out.
|
|
26
|
+
*/
|
|
27
|
+
export function resolveUseMouse(input) {
|
|
28
|
+
// Rung 1 — the no-config escape hatch.
|
|
29
|
+
if (input.noMouse !== undefined && input.noMouse !== '') {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
// Rung 2 — the user's own config. Only reachable with an explicit value, never the default.
|
|
33
|
+
if (input.explicitUseMouse !== undefined) {
|
|
34
|
+
return input.explicitUseMouse;
|
|
35
|
+
}
|
|
36
|
+
// Rung 3 — a terminal that cannot track. Checked below config so someone on an unusual TERM that
|
|
37
|
+
// does support tracking can still force it on.
|
|
38
|
+
if (input.term === undefined || input.term === '' || input.term === 'dumb') {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
// Rung 4 — default on, but only for a genuine interactive terminal at both ends.
|
|
42
|
+
return input.stdoutIsTTY && input.stdinIsTTY;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=mouse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mouse.js","sourceRoot":"","sources":["../../src/config/mouse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA0BH;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,mGAAmG,CAAC;AAEtG;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,KAAoB;IAClD,uCAAuC;IACvC,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,KAAK,EAAE,EAAE,CAAC;QACxD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,4FAA4F;IAC5F,IAAI,KAAK,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC,gBAAgB,CAAC;IAChC,CAAC;IAED,iGAAiG;IACjG,+CAA+C;IAC/C,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,EAAE,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC3E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,iFAAiF;IACjF,OAAO,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,UAAU,CAAC;AAC/C,CAAC"}
|