@haaaiawd/second-nature 0.1.16 → 0.1.17
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
|
@@ -771,6 +771,19 @@ function createLifecycleService() {
|
|
|
771
771
|
},
|
|
772
772
|
};
|
|
773
773
|
}
|
|
774
|
+
const SECOND_NATURE_TOOL_SCHEMA = {
|
|
775
|
+
type: "object",
|
|
776
|
+
additionalProperties: false,
|
|
777
|
+
properties: {
|
|
778
|
+
command: { type: "string" },
|
|
779
|
+
args: { type: "object", additionalProperties: true },
|
|
780
|
+
workspaceRoot: {
|
|
781
|
+
type: "string",
|
|
782
|
+
description: "Workspace root for packaged smoke/runtime alignment (optional; prefer SECOND_NATURE_WORKSPACE_ROOT).",
|
|
783
|
+
},
|
|
784
|
+
},
|
|
785
|
+
required: ["command"],
|
|
786
|
+
};
|
|
774
787
|
export default definePluginEntry({
|
|
775
788
|
id: "second-nature",
|
|
776
789
|
name: "Second Nature",
|
|
@@ -805,45 +818,36 @@ export default definePluginEntry({
|
|
|
805
818
|
};
|
|
806
819
|
},
|
|
807
820
|
});
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
additionalProperties: false,
|
|
814
|
-
properties: {
|
|
815
|
-
command: { type: "string" },
|
|
816
|
-
args: { type: "object", additionalProperties: true },
|
|
817
|
-
workspaceRoot: {
|
|
818
|
-
type: "string",
|
|
819
|
-
description: "Workspace root for packaged smoke/runtime alignment (optional; prefer SECOND_NATURE_WORKSPACE_ROOT).",
|
|
820
|
-
},
|
|
821
|
-
},
|
|
822
|
-
required: ["command"],
|
|
823
|
-
},
|
|
824
|
-
async execute(_id, params) {
|
|
825
|
-
const spine = ensureActivationSpine();
|
|
826
|
-
syncWorkspaceRootFromTool(spine, params.workspaceRoot);
|
|
827
|
-
const resolved = spine.router.resolve(params.command);
|
|
828
|
-
if (!resolved) {
|
|
829
|
-
return {
|
|
830
|
-
content: [
|
|
831
|
-
{
|
|
832
|
-
type: "text",
|
|
833
|
-
text: JSON.stringify({ ok: false, message: "Unknown Second Nature command." }),
|
|
834
|
-
},
|
|
835
|
-
],
|
|
836
|
-
};
|
|
837
|
-
}
|
|
838
|
-
const result = await routeSecondNatureCommand(spine, params.command, params.args);
|
|
821
|
+
const executeSecondNatureTool = async (params) => {
|
|
822
|
+
const spine = ensureActivationSpine();
|
|
823
|
+
syncWorkspaceRootFromTool(spine, params.workspaceRoot);
|
|
824
|
+
const resolved = spine.router.resolve(params.command);
|
|
825
|
+
if (!resolved) {
|
|
839
826
|
return {
|
|
840
827
|
content: [
|
|
841
828
|
{
|
|
842
829
|
type: "text",
|
|
843
|
-
text: JSON.stringify(
|
|
830
|
+
text: JSON.stringify({ ok: false, message: "Unknown Second Nature command." }),
|
|
844
831
|
},
|
|
845
832
|
],
|
|
846
833
|
};
|
|
834
|
+
}
|
|
835
|
+
const result = await routeSecondNatureCommand(spine, params.command, params.args);
|
|
836
|
+
return {
|
|
837
|
+
content: [
|
|
838
|
+
{
|
|
839
|
+
type: "text",
|
|
840
|
+
text: JSON.stringify(result),
|
|
841
|
+
},
|
|
842
|
+
],
|
|
843
|
+
};
|
|
844
|
+
};
|
|
845
|
+
api.registerTool({
|
|
846
|
+
name: "second_nature_ops",
|
|
847
|
+
description: "Access the Second Nature command surface through a single tool shell.",
|
|
848
|
+
parameters: SECOND_NATURE_TOOL_SCHEMA,
|
|
849
|
+
async execute(_id, params) {
|
|
850
|
+
return executeSecondNatureTool(params);
|
|
847
851
|
},
|
|
848
852
|
});
|
|
849
853
|
process.stderr.write("[second-nature] register() completed\n");
|
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.17",
|
|
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": true,
|
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.17";
|
|
31
31
|
activeHandle = {
|
|
32
32
|
ready: true,
|
|
33
33
|
version,
|