@haaaiawd/second-nature 0.1.14 → 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,17 +740,6 @@ function createLifecycleService() {
|
|
|
725
740
|
},
|
|
726
741
|
};
|
|
727
742
|
}
|
|
728
|
-
process.stderr.write("[second-nature] module evaluated\n");
|
|
729
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
730
|
-
let definePluginEntry;
|
|
731
|
-
try {
|
|
732
|
-
({ definePluginEntry } = await import("openclaw/plugin-sdk/plugin-entry"));
|
|
733
|
-
process.stderr.write("[second-nature] sdk_loaded openclaw/plugin-sdk/plugin-entry\n");
|
|
734
|
-
}
|
|
735
|
-
catch {
|
|
736
|
-
process.stderr.write("[second-nature] sdk_fallback identity wrapper (host capability brand missing)\n");
|
|
737
|
-
definePluginEntry = (opts) => opts;
|
|
738
|
-
}
|
|
739
743
|
export default definePluginEntry({
|
|
740
744
|
id: "second-nature",
|
|
741
745
|
name: "Second Nature",
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "second-nature",
|
|
3
3
|
"name": "Second Nature",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.15",
|
|
5
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).",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": false
|
package/package.json
CHANGED
|
@@ -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.
|
|
30
|
+
const version = "0.1.15";
|
|
31
31
|
activeHandle = {
|
|
32
32
|
ready: true,
|
|
33
33
|
version,
|