@gaunt-sloth/core 2.0.0-alpha.37 → 2.0.0-alpha.38
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 +19 -0
- package/dist/config/schema.d.ts +22 -1
- package/dist/config/schema.js +45 -12
- package/dist/config/schema.js.map +1 -1
- package/dist/config/shell-policy.d.ts +74 -2
- package/dist/config/shell-policy.js +91 -2
- package/dist/config/shell-policy.js.map +1 -1
- package/dist/config/types.d.ts +17 -9
- package/dist/config/types.js.map +1 -1
- package/dist/config.d.ts +21 -1
- package/dist/config.js +3 -1
- package/dist/config.js.map +1 -1
- package/dist/core/GthAbstractAgent.d.ts +29 -3
- package/dist/core/GthAbstractAgent.js +45 -8
- package/dist/core/GthAbstractAgent.js.map +1 -1
- package/dist/core/GthAgentRunner.js +22 -12
- package/dist/core/GthAgentRunner.js.map +1 -1
- package/dist/core/GthLangChainAgent.d.ts +2 -2
- package/dist/core/GthLangChainAgent.js +6 -2
- package/dist/core/GthLangChainAgent.js.map +1 -1
- package/dist/core/approvals/promptHeader.d.ts +28 -0
- package/dist/core/approvals/promptHeader.js +62 -0
- package/dist/core/approvals/promptHeader.js.map +1 -0
- package/dist/core/launchBanner.d.ts +5 -8
- package/dist/core/launchBanner.js +5 -14
- package/dist/core/launchBanner.js.map +1 -1
- package/dist/core/modelLabel.d.ts +19 -0
- package/dist/core/modelLabel.js +26 -0
- package/dist/core/modelLabel.js.map +1 -0
- package/dist/core/shell/raterVocabulary.d.ts +6 -4
- package/dist/core/shell/raterVocabulary.js +6 -4
- package/dist/core/shell/raterVocabulary.js.map +1 -1
- package/dist/core/types.d.ts +55 -0
- package/dist/core/types.js.map +1 -1
- package/package.json +1 -1
- package/schema/gsloth-config.schema.json +30 -1
package/dist/core/types.d.ts
CHANGED
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
import type { GthConfig } from '#src/config.js';
|
|
2
2
|
import type { DeclaredToolAnnotations } from '#src/core/approvals/annotations.js';
|
|
3
|
+
import type { ApprovalSubject } from '#src/core/approvals/matcher.js';
|
|
3
4
|
import type { RaterNegotiationRound, ShellSafetyVerdict } from '#src/core/shell/rater.js';
|
|
4
5
|
import type { BaseMessage } from '@langchain/core/messages';
|
|
5
6
|
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
6
7
|
import type { StructuredToolInterface } from '@langchain/core/tools';
|
|
7
8
|
import type { IterableReadableStream } from '@langchain/core/utils/stream';
|
|
8
9
|
import type { BaseCheckpointSaver } from '@langchain/langgraph';
|
|
10
|
+
/**
|
|
11
|
+
* The approval and shell types this module's own surface is written in, re-exported so a consumer
|
|
12
|
+
* of the root barrel can NAME each of them. Every one is the declared type of something already
|
|
13
|
+
* reachable here — {@link PendingToolInterrupt}'s `subject`, `safetyVerdict` and
|
|
14
|
+
* `negotiationRounds`, and {@link GthAgentInterface#getDeclaredMcpToolAnnotations} — so without
|
|
15
|
+
* them an embedder receives values it cannot type, which is precisely what writing a typed
|
|
16
|
+
* {@link ToolApprovalCallback} asks of it.
|
|
17
|
+
*
|
|
18
|
+
* They stay declared where they are: the matcher owns the subject it matches on and the rater owns
|
|
19
|
+
* the verdict it returns, so a type moved here to become exportable would sit apart from the code
|
|
20
|
+
* that decides it. The re-export is type-only and erases at emit, so the barrel gains no runtime
|
|
21
|
+
* edge.
|
|
22
|
+
*
|
|
23
|
+
* The two modules' **runtime** surface is deliberately not re-exported, including the closed
|
|
24
|
+
* vocabularies `RATER_OUTCOMES` and `ShellSafetyVerdictSchema` that {@link RaterOutcome} and
|
|
25
|
+
* {@link ShellSafetyVerdict} are derived from: a type alias resolves its referent inside the
|
|
26
|
+
* declaration file it is emitted into, so naming either type needs neither value in scope. Values
|
|
27
|
+
* stay reachable at their own deep paths (`@gaunt-sloth/core/core/shell/rater.js`,
|
|
28
|
+
* `@gaunt-sloth/core/core/approvals/matcher.js`) at the usual deep-path risk.
|
|
29
|
+
*
|
|
30
|
+
* `packages/core/spec/coreBarrelTypeSurface.spec.ts` pins this: it type-checks a probe against the
|
|
31
|
+
* built `dist/` declarations, so dropping a name here fails as a named missing export rather than
|
|
32
|
+
* as a later consumer's problem.
|
|
33
|
+
*/
|
|
34
|
+
export type { DeclaredToolAnnotations } from '#src/core/approvals/annotations.js';
|
|
35
|
+
export type { ApprovalSubject, McpToolApprovalSubject, ShellApprovalSubject, ToolApprovalSubject, } from '#src/core/approvals/matcher.js';
|
|
36
|
+
export type { RaterNegotiationRound, RaterOutcome, ShellSafetyVerdict, } from '#src/core/shell/rater.js';
|
|
9
37
|
export type Message = BaseMessage;
|
|
10
38
|
export type StatusUpdateCallback = (level: StatusLevel, message: string) => void;
|
|
11
39
|
/**
|
|
@@ -158,6 +186,33 @@ export interface GthCompiledGraph {
|
|
|
158
186
|
export interface PendingToolInterrupt {
|
|
159
187
|
name: string;
|
|
160
188
|
args: Record<string, unknown>;
|
|
189
|
+
/**
|
|
190
|
+
* [[TUI-C67]] — **what kind of call this is, as the gate itself decided it** (§3.1/§4.7.5): a
|
|
191
|
+
* `shell` subject carrying the command, a `tool` subject, or an `mcpTool` subject carrying the
|
|
192
|
+
* user's own `mcpServers` key. It is the discriminator `decideToolApprovalInner` matched rules
|
|
193
|
+
* on, travelling to the surface so the prompt can branch on the same one.
|
|
194
|
+
*
|
|
195
|
+
* Both terminal approval surfaces used to open with *the agent wants to run a shell command*,
|
|
196
|
+
* which EXT-80 made false for the most common prompt in `manual` and `write` — a file write, an
|
|
197
|
+
* MCP call or a custom tool, each announced as a shell command.
|
|
198
|
+
* `core/approvals/promptHeader.ts` renders the sentence from this field for both of them;
|
|
199
|
+
* re-deriving the kind from {@link name} on each surface would be a second classifier, free to
|
|
200
|
+
* disagree with the one that gated the call.
|
|
201
|
+
*
|
|
202
|
+
* **The ACP server is currently that second classifier, and the rule above still stands.**
|
|
203
|
+
* `acpPermissions.ts` titles its permission request from its own `shellCommandOf`, keyed on
|
|
204
|
+
* {@link name} rather than on this field, which it never reads — a divergence pinned by an
|
|
205
|
+
* assertion in `packages/agent/spec/acpServer.spec.ts`. Closing it means reading this field there
|
|
206
|
+
* rather than the tool name, and that is [[TUI-C89]]'s work; do not read the divergence's
|
|
207
|
+
* existence as licence to re-derive the kind anywhere else.
|
|
208
|
+
*
|
|
209
|
+
* **The runner attaches it to every interrupt it hands the approval callback**, including the
|
|
210
|
+
* plainest case where nothing else on this interface is set. Optional only because an interrupt
|
|
211
|
+
* read back out of graph state (`getPendingToolInterrupts`) is assembled before any subject
|
|
212
|
+
* exists; a surface that renders through `promptHeader` and is handed one of those renders the
|
|
213
|
+
* generic tool sentence, never a wrong one.
|
|
214
|
+
*/
|
|
215
|
+
subject?: ApprovalSubject;
|
|
161
216
|
/**
|
|
162
217
|
* CFG-26 — when the AI rater escalated this `run_shell_command` to the human (rather than
|
|
163
218
|
* approving it or bouncing it back to the model), the rater's verdict is attached here so the
|
package/dist/core/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAmDA;;;;GAIG;AACH,MAAM,CAAN,IAAY,WAQX;AARD,WAAY,WAAW;IACrB,+CAAS,CAAA;IACT,6CAAQ,CAAA;IACR,mDAAW,CAAA;IACX,mDAAW,CAAA;IACX,mDAAW,CAAA;IACX,+CAAS,CAAA;IACT,iDAAU,CAAA;AACZ,CAAC,EARW,WAAW,KAAX,WAAW,QAQtB"}
|
package/package.json
CHANGED
|
@@ -382,6 +382,9 @@
|
|
|
382
382
|
"maxOutputBytes": {
|
|
383
383
|
"type": "number"
|
|
384
384
|
},
|
|
385
|
+
"maxBytes": {
|
|
386
|
+
"type": "number"
|
|
387
|
+
},
|
|
385
388
|
"fileSet": {
|
|
386
389
|
"type": "string",
|
|
387
390
|
"enum": [
|
|
@@ -728,6 +731,9 @@
|
|
|
728
731
|
"maxOutputBytes": {
|
|
729
732
|
"type": "number"
|
|
730
733
|
},
|
|
734
|
+
"maxBytes": {
|
|
735
|
+
"type": "number"
|
|
736
|
+
},
|
|
731
737
|
"fileSet": {
|
|
732
738
|
"type": "string",
|
|
733
739
|
"enum": [
|
|
@@ -1046,6 +1052,9 @@
|
|
|
1046
1052
|
"maxOutputBytes": {
|
|
1047
1053
|
"type": "number"
|
|
1048
1054
|
},
|
|
1055
|
+
"maxBytes": {
|
|
1056
|
+
"type": "number"
|
|
1057
|
+
},
|
|
1049
1058
|
"fileSet": {
|
|
1050
1059
|
"type": "string",
|
|
1051
1060
|
"enum": [
|
|
@@ -1355,6 +1364,9 @@
|
|
|
1355
1364
|
"maxOutputBytes": {
|
|
1356
1365
|
"type": "number"
|
|
1357
1366
|
},
|
|
1367
|
+
"maxBytes": {
|
|
1368
|
+
"type": "number"
|
|
1369
|
+
},
|
|
1358
1370
|
"fileSet": {
|
|
1359
1371
|
"type": "string",
|
|
1360
1372
|
"enum": [
|
|
@@ -1644,6 +1656,9 @@
|
|
|
1644
1656
|
"maxOutputBytes": {
|
|
1645
1657
|
"type": "number"
|
|
1646
1658
|
},
|
|
1659
|
+
"maxBytes": {
|
|
1660
|
+
"type": "number"
|
|
1661
|
+
},
|
|
1647
1662
|
"fileSet": {
|
|
1648
1663
|
"type": "string",
|
|
1649
1664
|
"enum": [
|
|
@@ -1933,6 +1948,9 @@
|
|
|
1933
1948
|
"maxOutputBytes": {
|
|
1934
1949
|
"type": "number"
|
|
1935
1950
|
},
|
|
1951
|
+
"maxBytes": {
|
|
1952
|
+
"type": "number"
|
|
1953
|
+
},
|
|
1936
1954
|
"fileSet": {
|
|
1937
1955
|
"type": "string",
|
|
1938
1956
|
"enum": [
|
|
@@ -2222,6 +2240,9 @@
|
|
|
2222
2240
|
"maxOutputBytes": {
|
|
2223
2241
|
"type": "number"
|
|
2224
2242
|
},
|
|
2243
|
+
"maxBytes": {
|
|
2244
|
+
"type": "number"
|
|
2245
|
+
},
|
|
2225
2246
|
"fileSet": {
|
|
2226
2247
|
"type": "string",
|
|
2227
2248
|
"enum": [
|
|
@@ -2511,6 +2532,9 @@
|
|
|
2511
2532
|
"maxOutputBytes": {
|
|
2512
2533
|
"type": "number"
|
|
2513
2534
|
},
|
|
2535
|
+
"maxBytes": {
|
|
2536
|
+
"type": "number"
|
|
2537
|
+
},
|
|
2514
2538
|
"fileSet": {
|
|
2515
2539
|
"type": "string",
|
|
2516
2540
|
"enum": [
|
|
@@ -2693,7 +2717,12 @@
|
|
|
2693
2717
|
"type": "object",
|
|
2694
2718
|
"properties": {
|
|
2695
2719
|
"header": {
|
|
2696
|
-
"type": "
|
|
2720
|
+
"type": "string",
|
|
2721
|
+
"enum": [
|
|
2722
|
+
"none",
|
|
2723
|
+
"compact",
|
|
2724
|
+
"debug"
|
|
2725
|
+
]
|
|
2697
2726
|
}
|
|
2698
2727
|
}
|
|
2699
2728
|
},
|