mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-21 22:21:33 +00:00
refactor: move tasks into bundled plugin
This commit is contained in:
@@ -115,6 +115,40 @@ await api.runtime.subagent.deleteSession({
|
||||
Untrusted plugins can still run subagents, but override requests are rejected.
|
||||
</Warning>
|
||||
|
||||
### `api.runtime.operations`
|
||||
|
||||
Dispatch and query durable operation records behind a plugin-owned operations
|
||||
runtime.
|
||||
|
||||
```typescript
|
||||
const created = await api.runtime.operations.dispatch({
|
||||
type: "create",
|
||||
namespace: "imports",
|
||||
kind: "csv",
|
||||
status: "queued",
|
||||
description: "Import contacts.csv",
|
||||
runId: "import-1",
|
||||
});
|
||||
|
||||
const progressed = await api.runtime.operations.dispatch({
|
||||
type: "transition",
|
||||
runId: "import-1",
|
||||
status: "running",
|
||||
progressSummary: "Parsing rows",
|
||||
});
|
||||
|
||||
const record = await api.runtime.operations.findByRunId("import-1");
|
||||
const list = await api.runtime.operations.list({ namespace: "imports" });
|
||||
const summary = await api.runtime.operations.summarize({ namespace: "imports" });
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- `api.registerOperationsRuntime(...)` installs the active runtime.
|
||||
- Core exposes the facade; plugins own the operation semantics and storage.
|
||||
- The built-in default runtime maps the existing background task ledger into the
|
||||
generic operations shape until a plugin overrides it.
|
||||
|
||||
### `api.runtime.tts`
|
||||
|
||||
Text-to-speech synthesis.
|
||||
|
||||
Reference in New Issue
Block a user