@hoilab/ada-cli 0.84.14 → 0.84.17
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/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +29 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/memory-engine/engine.d.ts +20 -2
- package/dist/core/memory-engine/engine.d.ts.map +1 -1
- package/dist/core/memory-engine/engine.js +77 -56
- package/dist/core/memory-engine/engine.js.map +1 -1
- package/dist/core/memory-engine/security.d.ts +7 -0
- package/dist/core/memory-engine/security.d.ts.map +1 -1
- package/dist/core/memory-engine/security.js +29 -0
- package/dist/core/memory-engine/security.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +24 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -38,6 +38,7 @@ import { buildSystemPrompt } from "./system-prompt.js";
|
|
|
38
38
|
import { createLocalBashOperations } from "./tools/bash.js";
|
|
39
39
|
import { createAllToolDefinitions } from "./tools/index.js";
|
|
40
40
|
import { createMemoryEngineTools } from "./memory-engine/tools.js";
|
|
41
|
+
import { redactSensitive } from "./memory-engine/security.js";
|
|
41
42
|
import { createToolDefinitionFromAgentTool } from "./tools/tool-definition-wrapper.js";
|
|
42
43
|
import { addUsageToTotals, createUsageTotals } from "./usage-totals.js";
|
|
43
44
|
/**
|
|
@@ -180,6 +181,22 @@ export class AgentSession {
|
|
|
180
181
|
memoryEngine.setNotify((message, level) => {
|
|
181
182
|
this._emit({ type: "notification", message, level });
|
|
182
183
|
});
|
|
184
|
+
memoryEngine.setSensitiveDetected((reason) => {
|
|
185
|
+
// Persistent, highlighted message inside the conversation (CLI +
|
|
186
|
+
// desktop) — never a transient banner.
|
|
187
|
+
void this.sendCustomMessage({
|
|
188
|
+
customType: "sensitive-notice",
|
|
189
|
+
content: [
|
|
190
|
+
{
|
|
191
|
+
type: "text",
|
|
192
|
+
text: "Has introducido un dato sensible que no se almacenará en memoria. " +
|
|
193
|
+
reason,
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
display: true,
|
|
197
|
+
details: { engine: "ada-memory", kind: "sensitive" },
|
|
198
|
+
});
|
|
199
|
+
});
|
|
183
200
|
void memoryEngine.initialize().catch(() => {
|
|
184
201
|
// Memory must never break the session.
|
|
185
202
|
});
|
|
@@ -981,6 +998,18 @@ Task: given the CURRENT MEMORY and the LATEST CONVERSATION TURN, produce the COM
|
|
|
981
998
|
expandedText = this._expandSkillCommand(expandedText);
|
|
982
999
|
expandedText = expandPromptTemplate(expandedText, [...this.promptTemplates]);
|
|
983
1000
|
}
|
|
1001
|
+
// Enterprise security: detect sensitive data in the raw text (warning
|
|
1002
|
+
// + audit) and redact it BEFORE it reaches the LLM, the session file
|
|
1003
|
+
// or the chat transcript. The user sees censored content; the raw
|
|
1004
|
+
// secret is never persisted anywhere.
|
|
1005
|
+
// The engine exists whenever the SDK is built with the memory module;
|
|
1006
|
+
// detection + redaction only need config (not the initialized stores),
|
|
1007
|
+
// so they are ALWAYS applied — a failed init must never disable them.
|
|
1008
|
+
const memoryEngine = this._resourceLoader.getMemoryEngine();
|
|
1009
|
+
if (memoryEngine) {
|
|
1010
|
+
memoryEngine.checkUserTextForSensitive(expandedText);
|
|
1011
|
+
expandedText = redactSensitive(expandedText, memoryEngine.privacyLevel);
|
|
1012
|
+
}
|
|
984
1013
|
// If streaming, queue via steer() or followUp() based on option
|
|
985
1014
|
if (this.isStreaming) {
|
|
986
1015
|
if (!options?.streamingBehavior) {
|