@haaaiawd/second-nature 0.1.13 → 0.1.15

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/index.js CHANGED
@@ -30,6 +30,21 @@
30
30
  import { startRuntimeService, } from "./runtime/core/second-nature/runtime/service-entry.js";
31
31
  import { getLifecycleState, recordRegistration, } from "./runtime/core/second-nature/runtime/lifecycle-service.js";
32
32
  import { openWorkspaceOpsBridge } from "./workspace-ops-bridge.js";
33
+ // SDK factory marker is mandatory: OpenClaw 2026.5.x identifies a plugin as
34
+ // "plain-capability" only when its default export is produced by definePluginEntry
35
+ // (or sibling factories). Plain-object exports get classified as "non-capability"
36
+ // and the host silently skips register(api), so tools never reach agent sessions.
37
+ //
38
+ // IMPORTANT — keep this a STATIC import. The packaged runtime is loaded inside
39
+ // OpenClaw's vm sandbox, which rejects top-level await (manifests as
40
+ // "SyntaxError: Unexpected identifier 'Promise'" at host load time). The same
41
+ // constraint is documented above about sql.js async bootstrap. In production the
42
+ // host always provides `openclaw` as a sibling module under
43
+ // ~/.openclaw/npm/node_modules/, so this resolves synchronously. Locally,
44
+ // `openclaw` is declared as a devDependency so build and tests resolve
45
+ // the same path.
46
+ import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
47
+ process.stderr.write("[second-nature] module evaluated\n");
33
48
  const INTERNAL_RUNTIME_TRACE_PREFIX = "sn-runtime-";
34
49
  const HOST_SAFE_LIMITATION_MESSAGE = "Host-safe plugin package keeps synchronous register/load semantics, but mutating workspace runtime flows remain unavailable here.";
35
50
  let activationSpine = null;
@@ -725,11 +740,12 @@ function createLifecycleService() {
725
740
  },
726
741
  };
727
742
  }
728
- export default {
743
+ export default definePluginEntry({
729
744
  id: "second-nature",
730
745
  name: "Second Nature",
731
746
  description: "Registers command/tool/service surface with load-reload lifecycle semantics.",
732
747
  register(api) {
748
+ process.stderr.write(`[second-nature] register() entered, api keys=${Object.keys(api).join(",")}\n`);
733
749
  const runtimeService = createRuntimeService();
734
750
  const lifecycleService = createLifecycleService();
735
751
  api.registerService(runtimeService);
@@ -799,5 +815,6 @@ export default {
799
815
  };
800
816
  },
801
817
  });
818
+ process.stderr.write("[second-nature] register() completed\n");
802
819
  },
803
- };
820
+ });
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "id": "second-nature",
3
3
  "name": "Second Nature",
4
- "version": "0.1.13",
5
- "entry": "./index.js",
4
+ "version": "0.1.15",
6
5
  "description": "OpenClaw native plugin with synchronous surface registration and bundled runtime spine. Set SECOND_NATURE_WORKSPACE_ROOT or tool workspaceRoot to the same path as the agent workspace (see README / T1.1.4 ops norm).",
7
- "capabilities": {
6
+ "activation": {
7
+ "onStartup": false
8
+ },
9
+ "contracts": {
8
10
  "commands": [
9
11
  "second-nature"
10
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haaaiawd/second-nature",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "OpenClaw native plugin with synchronous registration, a packaged runtime artifact, and operator-facing status/explain flows.",
5
5
  "keywords": [
6
6
  "openclaw",
@@ -28,7 +28,21 @@
28
28
  "manifest": "./openclaw.plugin.json",
29
29
  "extensions": [
30
30
  "./index.js"
31
- ]
31
+ ],
32
+ "runtimeExtensions": [
33
+ "./index.js"
34
+ ],
35
+ "compat": {
36
+ "pluginApi": ">=2026.5.4"
37
+ }
38
+ },
39
+ "peerDependencies": {
40
+ "openclaw": ">=2026.5.4"
41
+ },
42
+ "peerDependenciesMeta": {
43
+ "openclaw": {
44
+ "optional": true
45
+ }
32
46
  },
33
47
  "dependencies": {
34
48
  "drizzle-orm": "^0.44.4",
@@ -27,7 +27,7 @@ export function startRuntimeService(ctx) {
27
27
  // - control-plane-system (heartbeat bridge preparation)
28
28
  const workspaceRoot = ctx?.workspaceRoot ?? process.cwd();
29
29
  /** Keep in sync with `plugin/package.json` when cutting releases. */
30
- const version = "0.1.13";
30
+ const version = "0.1.15";
31
31
  activeHandle = {
32
32
  ready: true,
33
33
  version,