@consensus-tools/consensus-tools 0.1.6 → 0.1.7
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/{LICENSE.txt → LICENSE} +1 -1
- package/package.json +1 -1
- package/src/config.ts +1 -31
package/{LICENSE.txt → LICENSE}
RENAMED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2026 consensus.tools
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -19,8 +19,7 @@ export const configSchema = {
|
|
|
19
19
|
properties: {
|
|
20
20
|
kind: { type: 'string', enum: ['sqlite', 'json'], default: 'json' },
|
|
21
21
|
path: { type: 'string', default: './.openclaw/consensus-tools.json' }
|
|
22
|
-
}
|
|
23
|
-
required: ['kind', 'path']
|
|
22
|
+
}
|
|
24
23
|
},
|
|
25
24
|
server: {
|
|
26
25
|
type: 'object',
|
|
@@ -31,7 +30,6 @@ export const configSchema = {
|
|
|
31
30
|
port: { type: 'integer', default: 9888, minimum: 1, maximum: 65535 },
|
|
32
31
|
authToken: { type: 'string', default: '' }
|
|
33
32
|
},
|
|
34
|
-
required: ['enabled', 'host', 'port', 'authToken']
|
|
35
33
|
},
|
|
36
34
|
slashingEnabled: { type: 'boolean', default: false },
|
|
37
35
|
jobDefaults: {
|
|
@@ -82,7 +80,6 @@ export const configSchema = {
|
|
|
82
80
|
}
|
|
83
81
|
}
|
|
84
82
|
},
|
|
85
|
-
required: ['type', 'trustedArbiterAgentId']
|
|
86
83
|
},
|
|
87
84
|
slashingPolicy: {
|
|
88
85
|
type: 'object',
|
|
@@ -92,18 +89,8 @@ export const configSchema = {
|
|
|
92
89
|
slashPercent: { type: 'number', default: 0, minimum: 0, maximum: 1 },
|
|
93
90
|
slashFlat: { type: 'number', default: 0, minimum: 0 }
|
|
94
91
|
},
|
|
95
|
-
required: ['enabled', 'slashPercent', 'slashFlat']
|
|
96
92
|
}
|
|
97
93
|
},
|
|
98
|
-
required: [
|
|
99
|
-
'reward',
|
|
100
|
-
'stakeRequired',
|
|
101
|
-
'maxParticipants',
|
|
102
|
-
'minParticipants',
|
|
103
|
-
'expiresSeconds',
|
|
104
|
-
'consensusPolicy',
|
|
105
|
-
'slashingPolicy'
|
|
106
|
-
]
|
|
107
94
|
},
|
|
108
95
|
consensusPolicies: {
|
|
109
96
|
type: 'object',
|
|
@@ -145,7 +132,6 @@ export const configSchema = {
|
|
|
145
132
|
}
|
|
146
133
|
}
|
|
147
134
|
},
|
|
148
|
-
required: ['type']
|
|
149
135
|
},
|
|
150
136
|
default: {}
|
|
151
137
|
},
|
|
@@ -162,10 +148,8 @@ export const configSchema = {
|
|
|
162
148
|
default: {}
|
|
163
149
|
}
|
|
164
150
|
},
|
|
165
|
-
required: ['faucetEnabled', 'initialCreditsPerAgent', 'balancesMode', 'balances']
|
|
166
151
|
}
|
|
167
152
|
},
|
|
168
|
-
required: ['storage', 'server', 'slashingEnabled', 'jobDefaults', 'ledger']
|
|
169
153
|
},
|
|
170
154
|
global: {
|
|
171
155
|
type: 'object',
|
|
@@ -174,7 +158,6 @@ export const configSchema = {
|
|
|
174
158
|
baseUrl: { type: 'string', default: 'http://localhost:9888' },
|
|
175
159
|
accessToken: { type: 'string', default: '' }
|
|
176
160
|
},
|
|
177
|
-
required: ['baseUrl', 'accessToken']
|
|
178
161
|
},
|
|
179
162
|
agentIdentity: {
|
|
180
163
|
type: 'object',
|
|
@@ -183,7 +166,6 @@ export const configSchema = {
|
|
|
183
166
|
agentIdSource: { type: 'string', enum: ['openclaw', 'env', 'manual'], default: 'openclaw' },
|
|
184
167
|
manualAgentId: { type: 'string', default: '' }
|
|
185
168
|
},
|
|
186
|
-
required: ['agentIdSource', 'manualAgentId']
|
|
187
169
|
},
|
|
188
170
|
safety: {
|
|
189
171
|
type: 'object',
|
|
@@ -192,20 +174,8 @@ export const configSchema = {
|
|
|
192
174
|
requireOptionalToolsOptIn: { type: 'boolean', default: true },
|
|
193
175
|
allowNetworkSideEffects: { type: 'boolean', default: false }
|
|
194
176
|
},
|
|
195
|
-
required: ['requireOptionalToolsOptIn', 'allowNetworkSideEffects']
|
|
196
177
|
}
|
|
197
178
|
},
|
|
198
|
-
required: ['mode', 'agentIdentity', 'safety'],
|
|
199
|
-
allOf: [
|
|
200
|
-
{
|
|
201
|
-
if: { properties: { mode: { const: 'local' } } },
|
|
202
|
-
then: { required: ['local'] }
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
if: { properties: { mode: { const: 'global' } } },
|
|
206
|
-
then: { required: ['global'] }
|
|
207
|
-
}
|
|
208
|
-
]
|
|
209
179
|
} as const;
|
|
210
180
|
|
|
211
181
|
export const defaultConfig: ConsensusToolsConfig = {
|