refactor(goal): call entity methods through remote API

This commit is contained in:
imccyu
2026-08-07 10:47:17 +08:00
parent 2f619b1b88
commit da1ebd2b68
16 changed files with 140 additions and 204 deletions

View File

@@ -718,7 +718,7 @@ create(agent: Agent, request: CreateGoalRequest): GoalView
* @param request - at least one replacement field.
* @returns the edited view.
*/
edit(agent: Agent, ref: GoalRef, request: EditGoalRequest): GoalView
@Remote('edit') edit(agent: Agent, ref: GoalRef, request: EditGoalRequest): GoalView
/**
* Pause an active goal and disarm automatic continuation.
@@ -726,7 +726,7 @@ edit(agent: Agent, ref: GoalRef, request: EditGoalRequest): GoalView
* @param ref - expected current revision.
* @returns the paused view.
*/
pause(agent: Agent, ref: GoalRef): GoalView
@Remote('pause') pause(agent: Agent, ref: GoalRef): GoalView
/**
* Resume and arm a stopped goal, or rearm an active goal after a
@@ -735,7 +735,7 @@ pause(agent: Agent, ref: GoalRef): GoalView
* @param ref - expected current revision.
* @returns the active view.
*/
resume(agent: Agent, ref: GoalRef): GoalView
@Remote('resume') resume(agent: Agent, ref: GoalRef): GoalView
/**
* Mark a current non-complete goal complete and disarm it.
@@ -743,7 +743,7 @@ resume(agent: Agent, ref: GoalRef): GoalView
* @param ref - expected current revision.
* @returns the completed view.
*/
complete(agent: Agent, ref: GoalRef): GoalView
@Remote('complete') complete(agent: Agent, ref: GoalRef): GoalView
/**
* Mark an active goal blocked and disarm it.
@@ -760,7 +760,7 @@ block(agent: Agent, ref: GoalRef, reason: GoalBlockReason): GoalView
* @param ref - expected current revision.
* @returns the tombstone ref whose revision is one past the cleared snapshot.
*/
clear(agent: Agent, ref: GoalRef): GoalRef
@Remote('clear') clear(agent: Agent, ref: GoalRef): GoalRef
/**
* Create one Goal through the remote boundary.
@@ -769,47 +769,6 @@ clear(agent: Agent, ref: GoalRef): GoalRef
* @returns the created Goal identity.
*/
@Remote('create') remoteExportCreate(agent: Agent, request: CreateGoalRequest): CreateGoalResult
/**
* Edit one Goal through the remote boundary.
* @param agent - exact live Agent resolved from the wire identity.
* @param ref - expected current revision.
* @param request - replacement fields.
* @returns the edited Goal view.
*/
@Remote('edit') remoteExportEdit(agent: Agent, ref: GoalRef, request: EditGoalRequest): GoalView
/**
* Pause one Goal through the remote boundary.
* @param agent - exact live Agent resolved from the wire identity.
* @param ref - expected current revision.
* @returns the paused Goal view.
*/
@Remote('pause') remoteExportPause(agent: Agent, ref: GoalRef): GoalView
/**
* Resume one Goal through the remote boundary.
* @param agent - exact live Agent resolved from the wire identity.
* @param ref - expected current revision.
* @returns the resumed Goal view.
*/
@Remote('resume') remoteExportResume(agent: Agent, ref: GoalRef): GoalView
/**
* Complete one Goal through the remote boundary.
* @param agent - exact live Agent resolved from the wire identity.
* @param ref - expected current revision.
* @returns the completed Goal view.
*/
@Remote('complete') remoteExportComplete(agent: Agent, ref: GoalRef): GoalView
/**
* Clear one terminal Goal through the remote boundary.
* @param agent - exact live Agent resolved from the wire identity.
* @param ref - expected current revision.
* @returns the committed clear revision.
*/
@Remote('clear') remoteExportClear(agent: Agent, ref: GoalRef): GoalRef
```
Types: [Agent](../core-data-structures/core.md) · [CreateGoalRequest](../core-data-structures/goal.md) · [CreateGoalResult](../core-data-structures/goal.md) · [EditGoalRequest](../core-data-structures/goal.md) · [GoalBlockReason](../core-data-structures/goal.md) · [GoalRef](../core-data-structures/goal.md) · [GoalView](../core-data-structures/goal.md)