( ctx context.Context, callerScope toolspkg.Scope, id toolspkg.ToolID, selector memoryToolSelector, rawType string, )
| 5290 | } |
| 5291 | |
| 5292 | func (n *daemonNativeTools) memoryWriteStore( |
| 5293 | ctx context.Context, |
| 5294 | callerScope toolspkg.Scope, |
| 5295 | id toolspkg.ToolID, |
| 5296 | selector memoryToolSelector, |
| 5297 | rawType string, |
| 5298 | ) (memoryToolLocation, error) { |
| 5299 | scope, err := core.ParseOptionalMemoryScope(selector.Scope) |
| 5300 | if err != nil { |
| 5301 | return memoryToolLocation{}, err |
| 5302 | } |
| 5303 | if scope == "" { |
| 5304 | if strings.TrimSpace(firstNonEmpty(selector.AgentName, callerScope.AgentName)) != "" { |
| 5305 | scope = memcontract.ScopeAgent |
| 5306 | } else if inferred, inferErr := memcontract.DefaultScopeForType(memcontract.Type(rawType)); inferErr == nil { |
| 5307 | scope = inferred |
| 5308 | } else if strings.TrimSpace(firstNonEmpty(selector.Workspace, callerScope.WorkspaceID)) != "" { |
| 5309 | scope = memcontract.ScopeWorkspace |
| 5310 | } |
| 5311 | } |
| 5312 | return n.memoryStoreFor(ctx, callerScope, id, selector, scope) |
| 5313 | } |
| 5314 | |
| 5315 | func (n *daemonNativeTools) memoryCallerActorKind( |
| 5316 | ctx context.Context, |
no test coverage detected