simmer-automaton 0.1.2 → 0.1.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/dist/index.js +9 -4
- package/package.json +2 -4
- package/src/index.ts +10 -4
package/dist/index.js
CHANGED
|
@@ -64,15 +64,19 @@ async function refreshState(logger) {
|
|
|
64
64
|
logger.error(`[simmer] Failed to refresh state: ${e}`);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
+
function currencyLabel() {
|
|
68
|
+
return config.venue === "simmer" ? "$SIM" : "$";
|
|
69
|
+
}
|
|
67
70
|
function buildPromptContext() {
|
|
68
71
|
if (!cachedState || !cachedState.initialized) {
|
|
69
72
|
return "[Simmer Automaton] Not initialized. Run: POST /api/sdk/automaton/init";
|
|
70
73
|
}
|
|
74
|
+
const c = currencyLabel();
|
|
71
75
|
const lines = [
|
|
72
76
|
"## Simmer Automaton — Survival Context (read-only)",
|
|
73
77
|
"",
|
|
74
78
|
`**Tier:** ${currentTier} | **Venue:** ${config.venue}`,
|
|
75
|
-
`**Budget:**
|
|
79
|
+
`**Budget:** ${c}${cachedState.budget_usd.toFixed(2)} | **Spent:** ${c}${cachedState.spent_usd.toFixed(2)} | **Remaining:** ${c}${cachedState.remaining_usd.toFixed(2)}`,
|
|
76
80
|
`**Halted:** ${cachedState.halted ? "YES — all trades blocked" : "no"}`,
|
|
77
81
|
`**Horizon:** ${cachedState.horizon_days} days`,
|
|
78
82
|
"",
|
|
@@ -110,12 +114,13 @@ function formatStatus() {
|
|
|
110
114
|
if (!cachedState || !cachedState.initialized) {
|
|
111
115
|
return "Automaton not initialized. Use POST /api/sdk/automaton/init to start.";
|
|
112
116
|
}
|
|
117
|
+
const c = currencyLabel();
|
|
113
118
|
const lines = [
|
|
114
119
|
`Tier: ${currentTier}`,
|
|
115
120
|
`Venue: ${config.venue}`,
|
|
116
|
-
`Budget:
|
|
117
|
-
`Spent:
|
|
118
|
-
`Remaining:
|
|
121
|
+
`Budget: ${c}${cachedState.budget_usd.toFixed(2)}`,
|
|
122
|
+
`Spent: ${c}${cachedState.spent_usd.toFixed(2)}`,
|
|
123
|
+
`Remaining: ${c}${cachedState.remaining_usd.toFixed(2)}`,
|
|
119
124
|
`Halted: ${cachedState.halted ? "YES" : "no"}`,
|
|
120
125
|
`Horizon: ${cachedState.horizon_days} days`,
|
|
121
126
|
`Cycles: ${cycleCount}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "simmer-automaton",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Simmer Automaton plugin for OpenClaw — adaptive trading skill orchestration",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,9 +9,7 @@
|
|
|
9
9
|
"dev": "tsc --watch"
|
|
10
10
|
},
|
|
11
11
|
"openclaw": {
|
|
12
|
-
"extensions":
|
|
13
|
-
"plugin": "dist/index.js"
|
|
14
|
-
}
|
|
12
|
+
"extensions": ["./dist/index.js"]
|
|
15
13
|
},
|
|
16
14
|
"keywords": ["openclaw", "plugin", "simmer", "prediction-markets", "trading"],
|
|
17
15
|
"license": "MIT",
|
package/src/index.ts
CHANGED
|
@@ -80,16 +80,21 @@ async function refreshState(logger: { info: (m: string) => void; error: (m: stri
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
function currencyLabel(): string {
|
|
84
|
+
return config.venue === "simmer" ? "$SIM" : "$";
|
|
85
|
+
}
|
|
86
|
+
|
|
83
87
|
function buildPromptContext(): string {
|
|
84
88
|
if (!cachedState || !cachedState.initialized) {
|
|
85
89
|
return "[Simmer Automaton] Not initialized. Run: POST /api/sdk/automaton/init";
|
|
86
90
|
}
|
|
87
91
|
|
|
92
|
+
const c = currencyLabel();
|
|
88
93
|
const lines = [
|
|
89
94
|
"## Simmer Automaton — Survival Context (read-only)",
|
|
90
95
|
"",
|
|
91
96
|
`**Tier:** ${currentTier} | **Venue:** ${config.venue}`,
|
|
92
|
-
`**Budget:**
|
|
97
|
+
`**Budget:** ${c}${cachedState.budget_usd.toFixed(2)} | **Spent:** ${c}${cachedState.spent_usd.toFixed(2)} | **Remaining:** ${c}${cachedState.remaining_usd.toFixed(2)}`,
|
|
93
98
|
`**Halted:** ${cachedState.halted ? "YES — all trades blocked" : "no"}`,
|
|
94
99
|
`**Horizon:** ${cachedState.horizon_days} days`,
|
|
95
100
|
"",
|
|
@@ -132,12 +137,13 @@ function formatStatus(): string {
|
|
|
132
137
|
return "Automaton not initialized. Use POST /api/sdk/automaton/init to start.";
|
|
133
138
|
}
|
|
134
139
|
|
|
140
|
+
const c = currencyLabel();
|
|
135
141
|
const lines = [
|
|
136
142
|
`Tier: ${currentTier}`,
|
|
137
143
|
`Venue: ${config.venue}`,
|
|
138
|
-
`Budget:
|
|
139
|
-
`Spent:
|
|
140
|
-
`Remaining:
|
|
144
|
+
`Budget: ${c}${cachedState.budget_usd.toFixed(2)}`,
|
|
145
|
+
`Spent: ${c}${cachedState.spent_usd.toFixed(2)}`,
|
|
146
|
+
`Remaining: ${c}${cachedState.remaining_usd.toFixed(2)}`,
|
|
141
147
|
`Halted: ${cachedState.halted ? "YES" : "no"}`,
|
|
142
148
|
`Horizon: ${cachedState.horizon_days} days`,
|
|
143
149
|
`Cycles: ${cycleCount}`,
|