@akalsey/sapience-goals 0.2.3 → 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.
@@ -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,
@@ -37,6 +38,20 @@ export default definePluginEntry({
37
38
  return;
38
39
  }
39
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(() => { });
40
55
  api.registerTool({
41
56
  name: "goal_submit",
42
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
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "sapience-goals",
3
3
  "name": "Sapience Goals",
4
- "version": "0.2.3",
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"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akalsey/sapience-goals",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "exports": {