@gaunt-sloth/core 2.0.0-alpha.34 → 2.0.0-alpha.36
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/config/configDiscovery.d.ts +79 -0
- package/dist/config/configDiscovery.js +80 -0
- package/dist/config/configDiscovery.js.map +1 -0
- package/dist/config/loader.d.ts +6 -5
- package/dist/config/loader.js +229 -92
- package/dist/config/loader.js.map +1 -1
- package/dist/config/schema.d.ts +3 -2
- package/dist/config/schema.js +57 -9
- package/dist/config/schema.js.map +1 -1
- package/dist/config/shell-policy.d.ts +58 -26
- package/dist/config/shell-policy.js +60 -27
- package/dist/config/shell-policy.js.map +1 -1
- package/dist/config/tool-descriptions.d.ts +6 -6
- package/dist/config/tool-descriptions.js +7 -7
- package/dist/config/tool-descriptions.js.map +1 -1
- package/dist/config/types.d.ts +34 -31
- 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 +11 -13
- package/dist/core/GthAbstractAgent.js +9 -11
- package/dist/core/GthAbstractAgent.js.map +1 -1
- package/dist/core/GthAgentRunner.d.ts +17 -33
- package/dist/core/GthAgentRunner.js +31 -41
- package/dist/core/GthAgentRunner.js.map +1 -1
- package/dist/core/GthLangChainAgent.js +25 -34
- package/dist/core/GthLangChainAgent.js.map +1 -1
- package/dist/core/approvals/toolAnnotationSources.d.ts +4 -4
- package/dist/core/approvals/toolAnnotationSources.js +8 -8
- package/dist/core/debugCapture.d.ts +2 -3
- package/dist/core/debugCapture.js +1 -2
- package/dist/core/debugCapture.js.map +1 -1
- package/dist/core/gthLeanAgentFactory.d.ts +4 -4
- package/dist/core/gthLeanAgentFactory.js +4 -4
- package/dist/core/reasoningBlocks.d.ts +7 -2
- package/dist/core/reasoningBlocks.js +7 -2
- package/dist/core/reasoningBlocks.js.map +1 -1
- package/dist/core/shell/ShellCommandFailedError.d.ts +3 -4
- package/dist/core/shell/ShellCommandFailedError.js +3 -4
- package/dist/core/shell/ShellCommandFailedError.js.map +1 -1
- package/dist/core/shell/approvalStop.d.ts +68 -29
- package/dist/core/shell/approvalStop.js +178 -28
- package/dist/core/shell/approvalStop.js.map +1 -1
- package/dist/core/shell/hardline.d.ts +22 -0
- package/dist/core/shell/hardline.js +81 -0
- package/dist/core/shell/hardline.js.map +1 -1
- package/dist/core/shell/negotiation.d.ts +81 -2
- package/dist/core/shell/negotiation.js +144 -11
- package/dist/core/shell/negotiation.js.map +1 -1
- package/dist/core/shell/rater.d.ts +7 -69
- package/dist/core/shell/rater.js +5 -24
- package/dist/core/shell/rater.js.map +1 -1
- package/dist/core/shell/raterVocabulary.d.ts +119 -0
- package/dist/core/shell/raterVocabulary.js +114 -0
- package/dist/core/shell/raterVocabulary.js.map +1 -0
- package/dist/core/types.d.ts +17 -3
- package/dist/providers/anthropic.js +12 -0
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/configurationPassthrough.d.ts +107 -0
- package/dist/providers/configurationPassthrough.js +148 -0
- package/dist/providers/configurationPassthrough.js.map +1 -0
- package/dist/providers/geminiThinking.d.ts +8 -0
- package/dist/providers/geminiThinking.js +33 -13
- package/dist/providers/geminiThinking.js.map +1 -1
- package/dist/providers/google-genai.js +11 -0
- package/dist/providers/google-genai.js.map +1 -1
- package/dist/providers/groq.js +12 -0
- package/dist/providers/groq.js.map +1 -1
- package/dist/providers/ollama.js +12 -0
- package/dist/providers/ollama.js.map +1 -1
- package/dist/providers/openrouter.d.ts +23 -0
- package/dist/providers/openrouter.js +71 -4
- package/dist/providers/openrouter.js.map +1 -1
- package/dist/providers/vertexai.js +12 -0
- package/dist/providers/vertexai.js.map +1 -1
- package/dist/providers/xai.js +20 -0
- package/dist/providers/xai.js.map +1 -1
- package/dist/runtime/conversation.d.ts +2 -2
- package/dist/runtime/conversation.js +19 -4
- package/dist/runtime/conversation.js.map +1 -1
- package/dist/runtime/singleShot.d.ts +2 -3
- package/dist/runtime/singleShot.js +22 -7
- package/dist/runtime/singleShot.js.map +1 -1
- package/dist/utils/systemPromptNotes.d.ts +17 -20
- package/dist/utils/systemPromptNotes.js +22 -24
- package/dist/utils/systemPromptNotes.js.map +1 -1
- package/dist/utils/untrustedText.d.ts +24 -4
- package/dist/utils/untrustedText.js +25 -4
- package/dist/utils/untrustedText.js.map +1 -1
- package/package.json +4 -4
- package/schema/gsloth-config.schema.json +0 -1
|
@@ -36,14 +36,34 @@ export declare const QUOTED_COMMAND_FENCE_END = "[END QUOTED COMMAND TEXT]";
|
|
|
36
36
|
export declare const QUOTED_COMMAND_MAX_CHARS = 2000;
|
|
37
37
|
/** Appended when {@link QUOTED_COMMAND_MAX_CHARS} actually clipped the quoted command. */
|
|
38
38
|
export declare const QUOTED_COMMAND_TRUNCATION_MARKER = "\u2026 [truncated]";
|
|
39
|
+
/**
|
|
40
|
+
* [[EXT-46]] — the fence the ACP server quotes a prompt's non-text content blocks inside, emitted by
|
|
41
|
+
* `@gaunt-sloth/agent`'s `modules/acp/acpAgentApp.ts`.
|
|
42
|
+
*
|
|
43
|
+
* An ACP client attaches content blocks to a prompt, and the ones that are not the user's own typed
|
|
44
|
+
* text carry values the user did not author: a resource link's `name`, `uri` and `description` come
|
|
45
|
+
* from the editor, the filesystem or an MCP server, and a block's `type` is an arbitrary client
|
|
46
|
+
* string by the v2 schema. The agent has to tell the model that something was attached — dropping it
|
|
47
|
+
* silently is worse — so those values are quoted into the same message as the user's words, which is
|
|
48
|
+
* the situation this module exists for.
|
|
49
|
+
*/
|
|
50
|
+
export declare const ACP_ATTACHMENT_FENCE_BEGIN = "[BEGIN CLIENT-PROVIDED ATTACHMENT]";
|
|
51
|
+
export declare const ACP_ATTACHMENT_FENCE_END = "[END CLIENT-PROVIDED ATTACHMENT]";
|
|
52
|
+
/**
|
|
53
|
+
* How much of one attachment FIELD is quoted. These are metadata (a file name, a URI, a one-line
|
|
54
|
+
* description), not documents, so this is generous rather than a limit anything real should reach.
|
|
55
|
+
*/
|
|
56
|
+
export declare const ACP_ATTACHMENT_FIELD_MAX_CHARS = 1000;
|
|
57
|
+
/** Appended when {@link ACP_ATTACHMENT_FIELD_MAX_CHARS} actually clipped a field. */
|
|
58
|
+
export declare const ACP_ATTACHMENT_TRUNCATION_MARKER = "\u2026 [truncated]";
|
|
39
59
|
/**
|
|
40
60
|
* Neutralize every structural delimiter this codebase emits, inside UNTRUSTED text.
|
|
41
61
|
*
|
|
42
62
|
* The text is fully attacker-influenceable, so it may forge:
|
|
43
|
-
* -
|
|
44
|
-
* `[BEGIN|END QUOTED COMMAND TEXT]`) — the bracket run
|
|
45
|
-
* read as the real delimiter, while staying legible to a
|
|
46
|
-
* attempted; and
|
|
63
|
+
* - any fence's tokens (`[BEGIN|END MCP SERVER-PROVIDED CONTEXT]`,
|
|
64
|
+
* `[BEGIN|END QUOTED COMMAND TEXT]`, `[BEGIN|END CLIENT-PROVIDED ATTACHMENT]`) — the bracket run
|
|
65
|
+
* is collapsed so they can no longer be read as the real delimiter, while staying legible to a
|
|
66
|
+
* reader who wants to see what was attempted; and
|
|
47
67
|
* - a per-server label line `--- Server: …` (EXT-32) — the leading `---` run is broken so it
|
|
48
68
|
* cannot masquerade as one of ours.
|
|
49
69
|
*
|
|
@@ -36,14 +36,34 @@ export const QUOTED_COMMAND_FENCE_END = '[END QUOTED COMMAND TEXT]';
|
|
|
36
36
|
export const QUOTED_COMMAND_MAX_CHARS = 2000;
|
|
37
37
|
/** Appended when {@link QUOTED_COMMAND_MAX_CHARS} actually clipped the quoted command. */
|
|
38
38
|
export const QUOTED_COMMAND_TRUNCATION_MARKER = '… [truncated]';
|
|
39
|
+
/**
|
|
40
|
+
* [[EXT-46]] — the fence the ACP server quotes a prompt's non-text content blocks inside, emitted by
|
|
41
|
+
* `@gaunt-sloth/agent`'s `modules/acp/acpAgentApp.ts`.
|
|
42
|
+
*
|
|
43
|
+
* An ACP client attaches content blocks to a prompt, and the ones that are not the user's own typed
|
|
44
|
+
* text carry values the user did not author: a resource link's `name`, `uri` and `description` come
|
|
45
|
+
* from the editor, the filesystem or an MCP server, and a block's `type` is an arbitrary client
|
|
46
|
+
* string by the v2 schema. The agent has to tell the model that something was attached — dropping it
|
|
47
|
+
* silently is worse — so those values are quoted into the same message as the user's words, which is
|
|
48
|
+
* the situation this module exists for.
|
|
49
|
+
*/
|
|
50
|
+
export const ACP_ATTACHMENT_FENCE_BEGIN = '[BEGIN CLIENT-PROVIDED ATTACHMENT]';
|
|
51
|
+
export const ACP_ATTACHMENT_FENCE_END = '[END CLIENT-PROVIDED ATTACHMENT]';
|
|
52
|
+
/**
|
|
53
|
+
* How much of one attachment FIELD is quoted. These are metadata (a file name, a URI, a one-line
|
|
54
|
+
* description), not documents, so this is generous rather than a limit anything real should reach.
|
|
55
|
+
*/
|
|
56
|
+
export const ACP_ATTACHMENT_FIELD_MAX_CHARS = 1000;
|
|
57
|
+
/** Appended when {@link ACP_ATTACHMENT_FIELD_MAX_CHARS} actually clipped a field. */
|
|
58
|
+
export const ACP_ATTACHMENT_TRUNCATION_MARKER = '… [truncated]';
|
|
39
59
|
/**
|
|
40
60
|
* Neutralize every structural delimiter this codebase emits, inside UNTRUSTED text.
|
|
41
61
|
*
|
|
42
62
|
* The text is fully attacker-influenceable, so it may forge:
|
|
43
|
-
* -
|
|
44
|
-
* `[BEGIN|END QUOTED COMMAND TEXT]`) — the bracket run
|
|
45
|
-
* read as the real delimiter, while staying legible to a
|
|
46
|
-
* attempted; and
|
|
63
|
+
* - any fence's tokens (`[BEGIN|END MCP SERVER-PROVIDED CONTEXT]`,
|
|
64
|
+
* `[BEGIN|END QUOTED COMMAND TEXT]`, `[BEGIN|END CLIENT-PROVIDED ATTACHMENT]`) — the bracket run
|
|
65
|
+
* is collapsed so they can no longer be read as the real delimiter, while staying legible to a
|
|
66
|
+
* reader who wants to see what was attempted; and
|
|
47
67
|
* - a per-server label line `--- Server: …` (EXT-32) — the leading `---` run is broken so it
|
|
48
68
|
* cannot masquerade as one of ours.
|
|
49
69
|
*
|
|
@@ -58,6 +78,7 @@ export function defangUntrustedDelimiters(text) {
|
|
|
58
78
|
return text
|
|
59
79
|
.replace(/\[\s*(BEGIN|END)\s+MCP\s+SERVER-PROVIDED\s+CONTEXT\s*\]/gi, (_m, kw) => `(server text: ${kw.toUpperCase()} MCP SERVER-PROVIDED CONTEXT)`)
|
|
60
80
|
.replace(/\[\s*(BEGIN|END)\s+QUOTED\s+COMMAND\s+TEXT\s*\]/gi, (_m, kw) => `(quoted text: ${kw.toUpperCase()} QUOTED COMMAND TEXT)`)
|
|
81
|
+
.replace(/\[\s*(BEGIN|END)\s+CLIENT-PROVIDED\s+ATTACHMENT\s*\]/gi, (_m, kw) => `(client text: ${kw.toUpperCase()} CLIENT-PROVIDED ATTACHMENT)`)
|
|
61
82
|
.replace(/-{3,}(\s*Server\s*:)/gi, '- - -$1');
|
|
62
83
|
}
|
|
63
84
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"untrustedText.js","sourceRoot":"","sources":["../../src/utils/untrustedText.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,8FAA8F;AAC9F,MAAM,CAAC,MAAM,eAAe,GAAG,qCAAqC,CAAC;AACrE,MAAM,CAAC,MAAM,aAAa,GAAG,mCAAmC,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AACxE,MAAM,CAAC,MAAM,wBAAwB,GAAG,2BAA2B,CAAC;AAEpE,kGAAkG;AAClG,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAE7C,0FAA0F;AAC1F,MAAM,CAAC,MAAM,gCAAgC,GAAG,eAAe,CAAC;AAEhE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,yBAAyB,CAAC,IAAY;IACpD,OAAO,IAAI;SACR,OAAO,CACN,2DAA2D,EAC3D,CAAC,E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,KAAK,MAAM,EAAE,CAAC;AACtD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gaunt-sloth/core",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.36",
|
|
4
4
|
"description": "Core utilities and types for Gaunt Sloth",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Andrew Kondratev",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"#src/*.js": "./dist/*.js"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@langchain/core": "^1.2.
|
|
34
|
-
"@langchain/langgraph": "^1.4.
|
|
33
|
+
"@langchain/core": "^1.2.5",
|
|
34
|
+
"@langchain/langgraph": "^1.4.9",
|
|
35
35
|
"jiti": "^2.7.0",
|
|
36
36
|
"jsonc-parser": "^3.3.1",
|
|
37
|
-
"langchain": "^1.5.
|
|
37
|
+
"langchain": "^1.5.5",
|
|
38
38
|
"string-width": "^8.2.2",
|
|
39
39
|
"zod": "^4.4.3"
|
|
40
40
|
},
|