@akalsey/sapience-goals 0.2.1 → 0.2.4
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/README.md +1 -1
- package/dist/src/service.js +21 -2
- package/dist/src/status-artifact.js +17 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -129,7 +129,7 @@ The next delivery date is stored per-goal in `goals.json` and rolls forward auto
|
|
|
129
129
|
**Goal submitted but no decomposition prompt**
|
|
130
130
|
The cron fires every 15 minutes. Wait for the next pass, or trigger manually:
|
|
131
131
|
```bash
|
|
132
|
-
openclaw cron run sapience-goals-check
|
|
132
|
+
openclaw cron run sapience-goals-check
|
|
133
133
|
```
|
|
134
134
|
Also confirm the inbox path matches your config and that the file is readable.
|
|
135
135
|
|
package/dist/src/service.js
CHANGED
|
@@ -6,6 +6,7 @@ import { loadGoals, saveGoals, addGoal, updateNextDelivery } from "./goal-store.
|
|
|
6
6
|
import { readNewGoals, savePosition } from "./inbox-reader.js";
|
|
7
7
|
import { deliverDecomposition, deliverWeeklyStatus } from "./delivery.js";
|
|
8
8
|
import { appendEvent } from "./events.js";
|
|
9
|
+
import { writeStatusArtifact } from "./status-artifact.js";
|
|
9
10
|
function mergeConfig(raw, workspaceDir) {
|
|
10
11
|
return {
|
|
11
12
|
...DEFAULT_CONFIG,
|
|
@@ -29,10 +30,28 @@ export default definePluginEntry({
|
|
|
29
30
|
name: "Sapience Goals",
|
|
30
31
|
description: "Persistent fuzzy goal tracking with weekly status delivery",
|
|
31
32
|
register(api) {
|
|
32
|
-
|
|
33
|
+
let workspaceDir;
|
|
34
|
+
try {
|
|
35
|
+
workspaceDir = api.runtime.agent.resolveAgentWorkspaceDir(api.pluginConfig);
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
33
38
|
return;
|
|
34
|
-
|
|
39
|
+
}
|
|
35
40
|
const config = mergeConfig(api.pluginConfig, workspaceDir);
|
|
41
|
+
// Record what this plugin actually resolved, for `openclaw sapience doctor`.
|
|
42
|
+
void writeStatusArtifact({
|
|
43
|
+
pluginId: "sapience-goals",
|
|
44
|
+
version: (api.plugin?.version ?? api.manifest?.version ?? "unknown"),
|
|
45
|
+
agentId: api.config?.agent?.id ?? "default",
|
|
46
|
+
resolvedWorkspaceDir: workspaceDir,
|
|
47
|
+
outputPaths: {
|
|
48
|
+
goalsPath: config.output.goalsPath,
|
|
49
|
+
eventsPath: config.output.eventsPath,
|
|
50
|
+
inboxPath: config.inboxPath,
|
|
51
|
+
inboxPositionPath: config.inboxPositionPath,
|
|
52
|
+
},
|
|
53
|
+
initAt: new Date().toISOString(),
|
|
54
|
+
}).catch(() => { });
|
|
36
55
|
api.registerTool({
|
|
37
56
|
name: "goal_submit",
|
|
38
57
|
description: "Submit a new long-running goal. Call this when the user expresses a fuzzy objective that spans multiple sessions. Returns the new goal's id.",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { homedir } from "os";
|
|
2
|
+
import { join } from "path";
|
|
3
|
+
import { mkdir, writeFile } from "fs/promises";
|
|
4
|
+
function resolveStatusDir(env = process.env) {
|
|
5
|
+
const override = env.OPENCLAW_STATE_DIR?.trim();
|
|
6
|
+
const base = override && override.length > 0
|
|
7
|
+
? override.startsWith("~/")
|
|
8
|
+
? join(homedir(), override.slice(2))
|
|
9
|
+
: override
|
|
10
|
+
: join(homedir(), ".openclaw");
|
|
11
|
+
return join(base, "sapience", "status");
|
|
12
|
+
}
|
|
13
|
+
export async function writeStatusArtifact(a, env) {
|
|
14
|
+
const dir = resolveStatusDir(env);
|
|
15
|
+
await mkdir(dir, { recursive: true });
|
|
16
|
+
await writeFile(join(dir, `${a.pluginId}.json`), JSON.stringify(a, null, 2), "utf-8");
|
|
17
|
+
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "sapience-goals",
|
|
3
3
|
"name": "Sapience Goals",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.4",
|
|
5
5
|
"description": "Persistent fuzzy goal tracking: accepts vague objectives, decomposes them into candidate approaches, tracks incremental progress, and delivers weekly status",
|
|
6
6
|
"contracts": {
|
|
7
7
|
"tools": ["goal_submit", "check_goals"]
|