@hoilab/ada-cli 0.84.2 → 0.84.3
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 +1 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/project-memory.d.ts +28 -0
- package/dist/core/project-memory.d.ts.map +1 -0
- package/dist/core/project-memory.js +57 -0
- package/dist/core/project-memory.js.map +1 -0
- package/dist/core/resource-loader.d.ts +4 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +14 -0
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/tools/index.d.ts +2 -2
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +17 -2
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/project-memory-tool.d.ts +18 -0
- package/dist/core/tools/project-memory-tool.d.ts.map +1 -0
- package/dist/core/tools/project-memory-tool.js +47 -0
- package/dist/core/tools/project-memory-tool.js.map +1 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
import { saveProjectMemory } from "../project-memory.js";
|
|
3
|
+
const updateProjectMemorySchema = Type.Object({
|
|
4
|
+
content: Type.String({
|
|
5
|
+
description: "The complete new content of the shared project memory file (Markdown). The previous content is REPLACED by this value, so include everything worth keeping.",
|
|
6
|
+
}),
|
|
7
|
+
reason: Type.Optional(Type.String({
|
|
8
|
+
description: "Short reason for the update (shown in the confirmation message)",
|
|
9
|
+
})),
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Tool for persisting durable, cross-session project knowledge.
|
|
13
|
+
*
|
|
14
|
+
* The memory file is included in the context of every conversation in the
|
|
15
|
+
* project (CLI and desktop), so facts written here are available to future
|
|
16
|
+
* sessions. Use it for architecture notes, conventions, decisions and anything
|
|
17
|
+
* the user asks to remember.
|
|
18
|
+
*/
|
|
19
|
+
export function createUpdateProjectMemoryTool(cwd, agentDir) {
|
|
20
|
+
return {
|
|
21
|
+
name: "update_project_memory",
|
|
22
|
+
label: "update project memory",
|
|
23
|
+
description: "Update the shared project memory: durable knowledge (architecture, conventions, decisions, user preferences) that persists across ALL conversations of this project. Write concise Markdown. Replaces the previous content entirely.",
|
|
24
|
+
promptSnippet: "Persist durable project knowledge shared across conversations",
|
|
25
|
+
promptGuidelines: [
|
|
26
|
+
"Use update_project_memory to save facts worth remembering across sessions (architecture, conventions, decisions, user preferences).",
|
|
27
|
+
"Keep the memory concise: it is loaded into the context of every conversation in the project.",
|
|
28
|
+
],
|
|
29
|
+
parameters: updateProjectMemorySchema,
|
|
30
|
+
async execute(_toolCallId, input, _signal, _onUpdate, _ctx) {
|
|
31
|
+
const { content, reason } = input;
|
|
32
|
+
await saveProjectMemory(cwd, agentDir, content);
|
|
33
|
+
const summary = content.split("\n").find((l) => l.trim().length > 0)?.trim() ?? "";
|
|
34
|
+
const truncated = summary.length > 80 ? `${summary.slice(0, 80)}…` : summary;
|
|
35
|
+
return {
|
|
36
|
+
details: undefined,
|
|
37
|
+
content: [
|
|
38
|
+
{
|
|
39
|
+
type: "text",
|
|
40
|
+
text: `Project memory updated${reason ? ` (${reason})` : ""}. ${truncated ? `First line: ${truncated}` : "Empty memory."}`,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=project-memory-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-memory-tool.js","sourceRoot":"","sources":["../../../src/core/tools/project-memory-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,IAAI,EAAE,MAAM,SAAS,CAAC;AAO5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,yBAAyB,GAAG,IAAI,CAA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K,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,KAC1D,SAAS,CAAC,CAAC,CAAC,eAAe,SAAS,EAAE,CAAC,CAAC,CAAC,eAC1C,EAAE;qBACF;iBACD;aACD,CAAC;QAAA,CACF;KACD,CAAC;AAAA,CACF","sourcesContent":["import { type Static, Type } from \"typebox\";\nimport type {\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tExtensionContext,\n\tToolDefinition,\n} from \"../extensions/types.ts\";\nimport { saveProjectMemory } from \"../project-memory.ts\";\n\nconst updateProjectMemorySchema = Type.Object({\n\tcontent: Type.String({\n\t\tdescription:\n\t\t\t\"The complete new content of the shared project memory file (Markdown). The previous content is REPLACED by this value, so include everything worth keeping.\",\n\t}),\n\treason: Type.Optional(\n\t\tType.String({\n\t\t\tdescription: \"Short reason for the update (shown in the confirmation message)\",\n\t\t}),\n\t),\n});\n\nexport type UpdateProjectMemoryInput = Static<typeof updateProjectMemorySchema>;\n\n/**\n * Tool for persisting durable, cross-session project knowledge.\n *\n * The memory file is included in the context of every conversation in the\n * project (CLI and desktop), so facts written here are available to future\n * sessions. Use it for architecture notes, conventions, decisions and anything\n * the user asks to remember.\n */\nexport function createUpdateProjectMemoryTool(\n\tcwd: string,\n\tagentDir: string,\n): ToolDefinition<typeof updateProjectMemorySchema, undefined> {\n\treturn {\n\t\tname: \"update_project_memory\",\n\t\tlabel: \"update project memory\",\n\t\tdescription:\n\t\t\t\"Update the shared project memory: durable knowledge (architecture, conventions, decisions, user preferences) that persists across ALL conversations of this project. Write concise Markdown. Replaces the previous content entirely.\",\n\t\tpromptSnippet: \"Persist durable project knowledge shared across conversations\",\n\t\tpromptGuidelines: [\n\t\t\t\"Use update_project_memory to save facts worth remembering across sessions (architecture, conventions, decisions, user preferences).\",\n\t\t\t\"Keep the memory concise: it is loaded into the context of every conversation in the project.\",\n\t\t],\n\t\tparameters: updateProjectMemorySchema,\n\t\tasync execute(\n\t\t\t_toolCallId: string,\n\t\t\tinput: UpdateProjectMemoryInput,\n\t\t\t_signal: AbortSignal | undefined,\n\t\t\t_onUpdate: AgentToolUpdateCallback<undefined> | undefined,\n\t\t\t_ctx: ExtensionContext,\n\t\t): Promise<AgentToolResult<undefined>> {\n\t\t\tconst { content, reason } = input;\n\t\t\tawait saveProjectMemory(cwd, agentDir, content);\n\t\t\tconst summary = content.split(\"\\n\").find((l) => l.trim().length > 0)?.trim() ?? \"\";\n\t\t\tconst truncated = summary.length > 80 ? `${summary.slice(0, 80)}…` : summary;\n\t\t\treturn {\n\t\t\t\tdetails: undefined,\n\t\t\t\tcontent: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"text\" as const,\n\t\t\t\t\t\ttext: `Project memory updated${reason ? ` (${reason})` : \"\"}. ${\n\t\t\t\t\t\t\ttruncated ? `First line: ${truncated}` : \"Empty memory.\"\n\t\t\t\t\t\t}`,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t};\n\t\t},\n\t};\n}\n"]}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hoilab/ada-cli",
|
|
3
|
-
"version": "0.84.
|
|
3
|
+
"version": "0.84.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@hoilab/ada-cli",
|
|
9
|
-
"version": "0.84.
|
|
9
|
+
"version": "0.84.3",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@earendil-works/pi-agent-core": "^0.84.2",
|
package/package.json
CHANGED