( ctx context.Context, scope toolspkg.Scope, req toolspkg.CallRequest, )
| 2531 | } |
| 2532 | |
| 2533 | func (n *daemonNativeTools) memoryNote( |
| 2534 | ctx context.Context, |
| 2535 | scope toolspkg.Scope, |
| 2536 | req toolspkg.CallRequest, |
| 2537 | ) (toolspkg.ToolResult, error) { |
| 2538 | var input memoryNoteInput |
| 2539 | if err := decodeNativeInput(req, &input); err != nil { |
| 2540 | return toolspkg.ToolResult{}, err |
| 2541 | } |
| 2542 | content, err := requiredNativeString(req.ToolID, "content", input.Content) |
| 2543 | if err != nil { |
| 2544 | return toolspkg.ToolResult{}, err |
| 2545 | } |
| 2546 | location, err := n.memoryWriteStore(ctx, scope, req.ToolID, memoryToolSelector{ |
| 2547 | Scope: input.Scope, |
| 2548 | Workspace: input.Workspace, |
| 2549 | AgentName: input.AgentName, |
| 2550 | AgentTier: input.AgentTier, |
| 2551 | }, "") |
| 2552 | if err != nil { |
| 2553 | return toolspkg.ToolResult{}, nativeMemoryToolError(req.ToolID, err) |
| 2554 | } |
| 2555 | actorKind, err := n.memoryCallerActorKind(ctx, scope, req) |
| 2556 | if err != nil { |
| 2557 | return toolspkg.ToolResult{}, nativeMemoryToolError(req.ToolID, err) |
| 2558 | } |
| 2559 | if err := n.denySubagentMemoryWrite(ctx, req, location, actorKind, input.Slug); err != nil { |
| 2560 | return toolspkg.ToolResult{}, err |
| 2561 | } |
| 2562 | filename := nativeMemoryAdHocFilename(input.Slug, content, time.Now().UTC()) |
| 2563 | document, err := renderNativeMemoryDocument(nativeMemoryWriteDocument{ |
| 2564 | Filename: filename, |
| 2565 | Scope: location.Scope, |
| 2566 | AgentName: location.AgentName, |
| 2567 | AgentTier: location.AgentTier, |
| 2568 | Name: "Ad Hoc Memory Note", |
| 2569 | Description: nativeMemoryDescription(content), |
| 2570 | Type: string(nativeMemoryTypeForScope("", location.Scope)), |
| 2571 | Content: nativeMemoryTaggedContent(content, input.Tags), |
| 2572 | }) |
| 2573 | if err != nil { |
| 2574 | return toolspkg.ToolResult{}, nativeMemoryToolError(req.ToolID, err) |
| 2575 | } |
| 2576 | result, err := location.Store.ProposeWrite(ctx, location.Scope, filename, document, memcontract.OriginTool) |
| 2577 | if err != nil { |
| 2578 | return toolspkg.ToolResult{}, nativeMemoryToolError(req.ToolID, err) |
| 2579 | } |
| 2580 | n.recordMemoryToolWrite(scope, req, actorKind) |
| 2581 | return nativeMemoryDecisionResult(result) |
| 2582 | } |
| 2583 | |
| 2584 | func (n *daemonNativeTools) listLogs( |
| 2585 | ctx context.Context, |
nothing calls this directly
no test coverage detected