hoi4-agent-tools 4.11.0 → 4.12.0
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/CHANGELOG.md +18 -0
- package/dist/bin/stdio.js +8 -10
- package/dist/hoi4_agent_tools/core/configuration.js +13 -0
- package/dist/hoi4_agent_tools/core/engine.js +18 -2
- package/dist/hoi4_agent_tools/core/job-store.js +1 -1
- package/dist/hoi4_agent_tools/focus/native-effects.js +1 -1
- package/dist/hoi4_agent_tools/map/gameplay/crossings.js +55 -16
- package/dist/hoi4_agent_tools/map/operations.js +37 -8
- package/dist/hoi4_agent_tools/map/partition-fields.js +14 -0
- package/dist/hoi4_agent_tools/map/partition-geography.js +55 -6
- package/dist/hoi4_agent_tools/map/partition-provinces.js +105 -24
- package/dist/hoi4_agent_tools/map/references.js +87 -0
- package/dist/hoi4_agent_tools/map/relief/hydrology.js +16 -2
- package/dist/hoi4_agent_tools/map/relief/macro-relief.js +21 -1
- package/dist/hoi4_agent_tools/map/relief/painted-relief.js +8 -5
- package/dist/hoi4_agent_tools/map/relief/terrain-synthesis.js +1 -0
- package/dist/hoi4_agent_tools/map/service.js +13 -4
- package/dist/hoi4_agent_tools/map/tool-operations.js +6 -0
- package/dist/hoi4_agent_tools/map/world-provinces.js +36 -19
- package/dist/hoi4_agent_tools/map/world.js +168 -40
- package/dist/hoi4_agent_tools/mcp/plugins.js +74 -0
- package/dist/hoi4_agent_tools/mcp/server/create-modern-operations.js +7 -18
- package/dist/hoi4_agent_tools/mcp/transports/negotiated-stdio.js +64 -6
- package/dist/hoi4_agent_tools/probability/model.js +4 -4
- package/dist/hoi4_agent_tools/reference/mod-index.js +63 -65
- package/dist/hoi4_agent_tools/runtime.js +6 -2
- package/dist/hoi4_agent_tools/schemas/map.js +4 -0
- package/dist/hoi4_agent_tools/schemas/mod-tools.js +50 -0
- package/dist/hoi4_agent_tools/version.js +1 -1
- package/docs/configuration.md +10 -10
- package/docs/development.md +2 -0
- package/docs/jobs.md +1 -0
- package/docs/map.md +22 -18
- package/docs/reference.md +2 -0
- package/docs/research/probability-adapter-evidence.md +11 -1
- package/docs/tools.md +2 -3
- package/docs/troubleshooting.md +1 -1
- package/engine/bin/darwin-arm64/hoi4-engine +0 -0
- package/engine/bin/linux-arm64/hoi4-engine +0 -0
- package/engine/bin/linux-x64/hoi4-engine +0 -0
- package/engine/bin/manifest.json +8 -8
- package/engine/bin/win32-x64/hoi4-engine.exe +0 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/schemas/configuration.schema.json +154 -138
- package/schemas/continuous-focus-palette.schema.json +1 -1
- package/schemas/custom-weighted-pool.schema.json +1 -1
- package/schemas/decision-inspect-input.schema.json +1 -1
- package/schemas/error-log-input.schema.json +1 -1
- package/schemas/event-feature-manifest.schema.json +1 -1
- package/schemas/focus-plan.schema.json +1 -1
- package/schemas/focus-planning-sidecar.schema.json +1 -1
- package/schemas/geography-model.schema.json +1 -1
- package/schemas/gui-animation-source.schema.json +1 -1
- package/schemas/gui-helper.schema.json +1 -1
- package/schemas/gui-scenario.schema.json +1 -1
- package/schemas/helper-expansion-request.schema.json +1 -1
- package/schemas/helper-expansion-summary.schema.json +1 -1
- package/schemas/impact-inspect-input.schema.json +1 -1
- package/schemas/map-operation.schema.json +152 -138
- package/schemas/mechanic-test-input.schema.json +1 -1
- package/schemas/mod-index-input.schema.json +1 -1
- package/schemas/operation-result.schema.json +1 -1
- package/schemas/package-check-input.schema.json +1 -1
- package/schemas/package-manifest.schema.json +1 -1
- package/schemas/probability-analysis-result.schema.json +1 -1
- package/schemas/probability-compare-input.schema.json +1 -1
- package/schemas/probability-evaluate-input.schema.json +1 -1
- package/schemas/probability-inspect-input.schema.json +1 -1
- package/schemas/probability-render-input.schema.json +1 -1
- package/schemas/probability-scenario-set.schema.json +1 -1
- package/schemas/probability-sequence-input.schema.json +1 -1
- package/schemas/probability-simulate-input.schema.json +1 -1
- package/schemas/probability-sweep-input.schema.json +1 -1
- package/schemas/reference-context-input.schema.json +1 -1
- package/schemas/reference-read-input.schema.json +1 -1
- package/schemas/reference-search-input.schema.json +1 -1
- package/schemas/reference-sheets.schema.json +1 -1
- package/schemas/scenario-suite.schema.json +1 -1
- package/schemas/scenario-test-input.schema.json +1 -1
- package/schemas/script-validate-input.schema.json +1 -1
- package/schemas/shared-scenario.schema.json +1 -1
- package/schemas/source-lookup-input.schema.json +1 -1
- package/server.json +2 -2
- package/dist/hoi4_agent_tools/mcp/tools/chaosx.js +0 -509
|
@@ -1,30 +1,57 @@
|
|
|
1
|
+
import { defaultPatterns } from '../core/engine.js';
|
|
2
|
+
import { runEngineCommand } from '../core/engine-client.js';
|
|
1
3
|
import { ServiceError } from '../core/result.js';
|
|
2
4
|
import { readModDescriptor } from '../core/workspace.js';
|
|
5
|
+
import { modIndexEngineResponseSchema, } from '../schemas/mod-tools.js';
|
|
3
6
|
const MAX_NAMESPACES = 200;
|
|
4
7
|
const MAX_FOLDERS = 60;
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
/** A cold index of the game, its DLC and a large mod. */
|
|
9
|
+
const MOD_INDEX_TIMEOUT_MS = 180_000;
|
|
10
|
+
const MOD_INDEX_REQUEST_SCHEMA = 'hoi4-mod-index-request/1';
|
|
11
|
+
/** The roots the shared scan reads; artifacts and caches are never sources. */
|
|
12
|
+
export const SOURCE_ROOT_KINDS = [
|
|
13
|
+
'game',
|
|
14
|
+
'dlc',
|
|
15
|
+
'dependency',
|
|
16
|
+
'mod',
|
|
17
|
+
'fixture',
|
|
18
|
+
];
|
|
19
|
+
/** The engine request for the workspace's source roots of `rootKinds` (scan roots of ADR 0080). */
|
|
20
|
+
export function modIndexEngineRequest(workspace, config, rootKinds) {
|
|
21
|
+
return {
|
|
22
|
+
schema: MOD_INDEX_REQUEST_SCHEMA,
|
|
23
|
+
roots: workspace.roots
|
|
24
|
+
.filter(({ kind }) => rootKinds.includes(kind))
|
|
25
|
+
.map(({ kind, path, loadOrder, label, replacePaths }) => ({
|
|
26
|
+
kind,
|
|
27
|
+
path,
|
|
28
|
+
loadOrder,
|
|
29
|
+
...(label === undefined ? {} : { label }),
|
|
30
|
+
replacePaths,
|
|
31
|
+
})),
|
|
32
|
+
patterns: defaultPatterns(workspace),
|
|
33
|
+
limits: {
|
|
34
|
+
maxFiles: config.scanMaxFiles,
|
|
35
|
+
maxBytes: config.scanMaxBytes,
|
|
36
|
+
maxFileBytes: config.scanMaxFileBytes,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
async function runModIndex(engine, workspaceId, request, principal, signal) {
|
|
41
|
+
signal?.throwIfAborted();
|
|
42
|
+
await engine.resolver.refreshDescriptors(workspaceId, principal);
|
|
43
|
+
const workspace = engine.resolver.get(workspaceId, principal);
|
|
44
|
+
const result = await runEngineCommand('mod-index', {
|
|
45
|
+
...modIndexEngineRequest(workspace, engine.resolver.config(), request.rootKinds),
|
|
46
|
+
mode: request.mode,
|
|
47
|
+
...(request.kind === undefined ? {} : { kind: request.kind }),
|
|
48
|
+
...(request.prefix === undefined ? {} : { prefix: request.prefix }),
|
|
49
|
+
}, modIndexEngineResponseSchema, { timeoutMs: MOD_INDEX_TIMEOUT_MS, ...(signal === undefined ? {} : { signal }) });
|
|
50
|
+
if (!result.available)
|
|
51
|
+
throw new ServiceError('ENGINE_UNAVAILABLE', result.message, { reason: result.reason });
|
|
52
|
+
if (result.outcome === 'invalid_request')
|
|
53
|
+
throw new ServiceError(result.error.code, result.error.message);
|
|
54
|
+
return result.response;
|
|
28
55
|
}
|
|
29
56
|
export async function modIndex(engine, workspaceId, input, principal, signal) {
|
|
30
57
|
if (input.mode === 'next_id') {
|
|
@@ -33,51 +60,25 @@ export async function modIndex(engine, workspaceId, input, principal, signal) {
|
|
|
33
60
|
if (prefix === undefined)
|
|
34
61
|
throw new ServiceError('MOD_INDEX_PREFIX_REQUIRED', 'next_id needs prefix or namespace');
|
|
35
62
|
// Every layer: a new identifier must not collide with game or dependency definitions.
|
|
36
|
-
const
|
|
37
|
-
const used =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
continue;
|
|
41
|
-
const suffix = symbol.id.slice(prefix.length);
|
|
42
|
-
if (/^\d{1,9}$/u.test(suffix))
|
|
43
|
-
used.add(Number(suffix));
|
|
44
|
-
}
|
|
45
|
-
const highest = used.size === 0 ? undefined : Math.max(...used);
|
|
46
|
-
let firstGap;
|
|
47
|
-
for (let number = 1; highest !== undefined && number < highest; number += 1)
|
|
48
|
-
if (!used.has(number)) {
|
|
49
|
-
firstGap = number;
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
const next = (highest ?? 0) + 1;
|
|
63
|
+
const answer = await runModIndex(engine, workspaceId, { mode: 'next_id', rootKinds: SOURCE_ROOT_KINDS, kind: input.kind, prefix }, principal, signal);
|
|
64
|
+
const used = answer.next?.used ?? 0;
|
|
65
|
+
const highest = answer.next?.highest;
|
|
66
|
+
const firstGap = answer.next?.firstGap;
|
|
53
67
|
return {
|
|
54
68
|
mode: 'next_id',
|
|
55
|
-
complete:
|
|
69
|
+
complete: answer.complete,
|
|
56
70
|
next: {
|
|
57
71
|
kind: input.kind,
|
|
58
72
|
prefix,
|
|
59
|
-
used
|
|
73
|
+
used,
|
|
60
74
|
...(highest === undefined ? {} : { highest }),
|
|
61
|
-
nextId: `${prefix}${
|
|
75
|
+
nextId: `${prefix}${(highest ?? 0) + 1}`,
|
|
62
76
|
...(firstGap === undefined ? {} : { firstGapId: `${prefix}${firstGap}` }),
|
|
63
77
|
},
|
|
64
78
|
};
|
|
65
79
|
}
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const kinds = new Map();
|
|
69
|
-
for (const symbol of symbols)
|
|
70
|
-
kinds.set(symbol.kind, (kinds.get(symbol.kind) ?? 0) + 1);
|
|
71
|
-
const folders = new Map();
|
|
72
|
-
for (const file of snapshot.files) {
|
|
73
|
-
const parts = file.relativePath.split('/');
|
|
74
|
-
const folder = parts.length > 2 && parts[0] === 'common' ? parts.slice(0, 2).join('/') : parts[0];
|
|
75
|
-
const totals = folders.get(folder) ?? { files: 0, bytes: 0 };
|
|
76
|
-
totals.files += 1;
|
|
77
|
-
totals.bytes += file.size;
|
|
78
|
-
folders.set(folder, totals);
|
|
79
|
-
}
|
|
80
|
-
const allNamespaces = namespaces(symbols);
|
|
80
|
+
const answer = await runModIndex(engine, workspaceId, { mode: 'overview', rootKinds: input.layer === 'mod' ? ['mod'] : SOURCE_ROOT_KINDS }, principal, signal);
|
|
81
|
+
const allNamespaces = [...(answer.namespaces ?? [])].sort((left, right) => left.namespace.localeCompare(right.namespace, 'en'));
|
|
81
82
|
const modRoot = engine.resolver
|
|
82
83
|
.get(workspaceId, principal)
|
|
83
84
|
.roots.find(({ kind }) => kind === 'mod')?.path;
|
|
@@ -85,14 +86,11 @@ export async function modIndex(engine, workspaceId, input, principal, signal) {
|
|
|
85
86
|
return {
|
|
86
87
|
mode: 'overview',
|
|
87
88
|
layer: input.layer,
|
|
88
|
-
complete:
|
|
89
|
+
complete: answer.complete,
|
|
89
90
|
...(descriptor === undefined ? {} : { descriptor }),
|
|
90
|
-
files:
|
|
91
|
-
kinds: [...kinds]
|
|
92
|
-
|
|
93
|
-
.sort((left, right) => right.count - left.count || left.kind.localeCompare(right.kind)),
|
|
94
|
-
folders: [...folders]
|
|
95
|
-
.map(([folder, totals]) => ({ folder, ...totals }))
|
|
91
|
+
files: answer.files ?? 0,
|
|
92
|
+
kinds: [...(answer.kinds ?? [])].sort((left, right) => right.count - left.count || left.kind.localeCompare(right.kind)),
|
|
93
|
+
folders: [...(answer.folders ?? [])]
|
|
96
94
|
.sort((left, right) => right.files - left.files || left.folder.localeCompare(right.folder))
|
|
97
95
|
.slice(0, MAX_FOLDERS),
|
|
98
96
|
namespaces: allNamespaces.slice(0, MAX_NAMESPACES),
|
|
@@ -221,7 +221,7 @@ async function configurationExists(configPath) {
|
|
|
221
221
|
return false;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
export async function createEngine(configPath = configurationPath()) {
|
|
224
|
+
export async function createEngine(configPath = configurationPath(), options = {}) {
|
|
225
225
|
let configuration;
|
|
226
226
|
try {
|
|
227
227
|
configuration = await loadConfiguration(configPath);
|
|
@@ -250,6 +250,10 @@ export async function createEngine(configPath = configurationPath()) {
|
|
|
250
250
|
],
|
|
251
251
|
}).catch(() => undefined);
|
|
252
252
|
const engine = new CoreEngine(resolver);
|
|
253
|
-
|
|
253
|
+
// A failed background recovery is the caller's to report through `engine.recovered()`.
|
|
254
|
+
if (options.recovery === 'background')
|
|
255
|
+
engine.initialize().catch(() => undefined);
|
|
256
|
+
else
|
|
257
|
+
await engine.initialize();
|
|
254
258
|
return engine;
|
|
255
259
|
}
|
|
@@ -1068,6 +1068,10 @@ export const mapOperationSchema = z.discriminatedUnion('kind', [
|
|
|
1068
1068
|
.optional()
|
|
1069
1069
|
.describe('Countries the world generates and writes (an array), or { source: "workspace", realms } for countries the workspace already declares: the world then places them from their capital, seeds, claims and exclusions and writes no country, flag, unit, country history, country name or bookmark file.'),
|
|
1070
1070
|
continentNames: z.array(worldName).max(12).optional(),
|
|
1071
|
+
inheritedContinents: z
|
|
1072
|
+
.enum(['keep', 'drop'])
|
|
1073
|
+
.optional()
|
|
1074
|
+
.describe('keep (the default) also lists the continents of the active continent.txt after the generated ones; drop writes only the generated continents and warns about every active script that still names a dropped one (MAP_CONTINENT_DROPPED_REFERENCED).'),
|
|
1071
1075
|
startDate: z
|
|
1072
1076
|
.string()
|
|
1073
1077
|
.regex(/^\d{3,4}\.\d{1,2}\.\d{1,2}$/u)
|
|
@@ -190,3 +190,53 @@ export const modIndexDataSchema = z
|
|
|
190
190
|
.optional(),
|
|
191
191
|
})
|
|
192
192
|
.strict();
|
|
193
|
+
/** `hoi4-engine mod-index` (`hoi4-mod-index/1`): what the shared Rust engine answers. */
|
|
194
|
+
export const modIndexEngineResponseSchema = z
|
|
195
|
+
.object({
|
|
196
|
+
schema: z.literal('hoi4-mod-index/1'),
|
|
197
|
+
status: z.literal('ok'),
|
|
198
|
+
complete: z.boolean(),
|
|
199
|
+
skippedSourceCount: z.number().int().min(0),
|
|
200
|
+
skippedSources: z
|
|
201
|
+
.array(z
|
|
202
|
+
.object({
|
|
203
|
+
path: z.string(),
|
|
204
|
+
reasonCodes: z.array(z.string()),
|
|
205
|
+
possibleSymbolKinds: z.array(z.string()),
|
|
206
|
+
})
|
|
207
|
+
.strict())
|
|
208
|
+
.max(100),
|
|
209
|
+
files: z.number().int().min(0).optional(),
|
|
210
|
+
kinds: z
|
|
211
|
+
.array(z.object({ kind: z.string(), count: z.number().int().min(0) }).strict())
|
|
212
|
+
.optional(),
|
|
213
|
+
folders: z
|
|
214
|
+
.array(z
|
|
215
|
+
.object({
|
|
216
|
+
folder: z.string(),
|
|
217
|
+
files: z.number().int().min(0),
|
|
218
|
+
bytes: z.number().int().min(0),
|
|
219
|
+
})
|
|
220
|
+
.strict())
|
|
221
|
+
.optional(),
|
|
222
|
+
namespaces: z
|
|
223
|
+
.array(z
|
|
224
|
+
.object({
|
|
225
|
+
namespace: z.string(),
|
|
226
|
+
events: z.number().int().min(0),
|
|
227
|
+
lowest: z.number().int().min(0),
|
|
228
|
+
highest: z.number().int().min(0),
|
|
229
|
+
files: z.number().int().min(0),
|
|
230
|
+
})
|
|
231
|
+
.strict())
|
|
232
|
+
.optional(),
|
|
233
|
+
next: z
|
|
234
|
+
.object({
|
|
235
|
+
used: z.number().int().min(0),
|
|
236
|
+
highest: z.number().int().min(0).optional(),
|
|
237
|
+
firstGap: z.number().int().min(1).optional(),
|
|
238
|
+
})
|
|
239
|
+
.strict()
|
|
240
|
+
.optional(),
|
|
241
|
+
})
|
|
242
|
+
.strict();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LATEST_PROTOCOL_VERSION } from '@modelcontextprotocol/sdk/types.js';
|
|
2
2
|
export const PACKAGE_NAME = 'hoi4-agent-tools';
|
|
3
|
-
export const PACKAGE_VERSION = '4.
|
|
3
|
+
export const PACKAGE_VERSION = '4.12.0';
|
|
4
4
|
export const MCP_PROTOCOL_VERSION = LATEST_PROTOCOL_VERSION;
|
|
5
5
|
export const CONFIG_VERSION = 1;
|
|
6
6
|
export const TRANSACTION_VERSION = 2;
|
package/docs/configuration.md
CHANGED
|
@@ -153,15 +153,16 @@ Each `roots` key takes up to 16 folders, and setting `roots` replaces only the k
|
|
|
153
153
|
|
|
154
154
|
## Tools, jobs and lifetime
|
|
155
155
|
|
|
156
|
-
| Key | Type
|
|
157
|
-
| ----------------------- |
|
|
158
|
-
| `maxConcurrentTools` | integer
|
|
159
|
-
| `maxSharedTools` | integer
|
|
160
|
-
| `jobDeadlineSeconds` | integer
|
|
161
|
-
| `jobCancelGraceSeconds` | integer
|
|
162
|
-
| `jobWorkerMaxHeapMiB` | integer
|
|
163
|
-
| `jobWorkerIdleSeconds` | integer
|
|
164
|
-
| `
|
|
156
|
+
| Key | Type | Range | Default | Purpose |
|
|
157
|
+
| ----------------------- | -------- | ---------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
158
|
+
| `maxConcurrentTools` | integer | 1–32 | 2 | Expensive tool calls one server process runs at once. |
|
|
159
|
+
| `maxSharedTools` | integer | 1–128 | 4 | Expensive calls and job workers that run at once across every server process sharing the same `serverStateRoot`. |
|
|
160
|
+
| `jobDeadlineSeconds` | integer | 1–86,400 | 1,800 | A read-only job still running this long after dispatch is stopped and fails with `JOB_DEADLINE_EXCEEDED`. Rewrite jobs are never stopped this way. |
|
|
161
|
+
| `jobCancelGraceSeconds` | integer | 1–600 | 10 | A read-only job still running this long after cancellation is stopped and settles as cancelled. |
|
|
162
|
+
| `jobWorkerMaxHeapMiB` | integer | 256–65,536 | unset | Memory ceiling for each job worker's JavaScript heap, in MiB. Unset keeps Node's default. |
|
|
163
|
+
| `jobWorkerIdleSeconds` | integer | 0–3,600 | 180 | How long a job worker stays warm after a job so the next job reuses its loaded indexes. `0` starts a fresh worker for every job. |
|
|
164
|
+
| `plugins` | string[] | up to 8 absolute paths | `[]` | Plugin modules (`.mjs` or `.js`) the stdio server loads to add its own tools. The server loads nothing from a mod folder or the environment, only these paths; a listed file that does not exist is skipped with a warning on stderr, so one shared configuration can name a plugin that exists on one machine. The HTTP server never loads plugins. See [Tools](tools.md#plugins). |
|
|
165
|
+
| `stdioIdleExitMinutes` | integer | 0–10,080 | 0 | A stdio server with no client traffic and no open request for this many minutes exits. `0` never exits. `HOI4_AGENT_STDIO_IDLE_EXIT_MINUTES` overrides it per client. |
|
|
165
166
|
|
|
166
167
|
See [Persistent jobs and MCP tasks](jobs.md) for how jobs, cancellation and recovery behave.
|
|
167
168
|
|
|
@@ -270,7 +271,6 @@ HTTP server only:
|
|
|
270
271
|
| `HOI4_GAME_ROOT` | automatic configuration, setup `--init` and `--discover` | First game folder to try, before the standard Steam locations. |
|
|
271
272
|
| `HOI4_MOD_ROOTS` | setup `--init` and `--discover` | Extra mod parent folders to discover, separated by `;` on Windows and `:` elsewhere. `--init` uses discovered folders only when no `--mod-root` is given. |
|
|
272
273
|
| `HOI4_AGENT_STDIO_IDLE_EXIT_MINUTES` | `hoi4-agent-tools` | Overrides `stdioIdleExitMinutes` for one client registration. It must be a whole number from 0 to 10,080; an empty value keeps the configured setting, and any other value stops startup. |
|
|
273
|
-
| `HOI4_AGENT_TOOLS_CHAOSX` | `hoi4-agent-tools` | `1` exposes the optional Chaos Redux workflow tools listed in [Tools](tools.md). The HTTP server never exposes them. |
|
|
274
274
|
| the variable named by `tokenEnv` | `hoi4-agent-tools-http` | Secret for a static bearer token, at least 32 characters. |
|
|
275
275
|
| `APPDATA`, `XDG_CONFIG_HOME` | every command | Location of the default configuration file. |
|
|
276
276
|
| `XDG_STATE_HOME`, `XDG_DATA_HOME`, `LOCALAPPDATA` | automatic configuration, setup `--init` | Default `serverStateRoot` and `workspaceStorageRoot`. |
|
package/docs/development.md
CHANGED
|
@@ -17,6 +17,8 @@ npm run build
|
|
|
17
17
|
npm run inspector
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
Tools on the shared Rust engine (`hoi4.mod_index`, `hoi4.localisation_inspect`, `hoi4.idea_inspect`, `hoi4.system_inspect`, `hoi4.unit_inspect`, `hoi4.asset_inspect`) need a `hoi4-engine` binary in the tests. Build it once with `cargo build -p hoi4-engine-cli` in `engine/`; the test setup uses that build (in `CARGO_TARGET_DIR` or `engine/target`) unless `HOI4_ENGINE` names another binary.
|
|
21
|
+
|
|
20
22
|
Keep changes focused and include tests for behavior changes. CI fixtures must be synthetic and project-owned; never commit installed-game or third-party-mod content. Public tool or schema changes require compatibility review and a versioned release.
|
|
21
23
|
|
|
22
24
|
Vitest tracks temporary fixtures created with `mkdtemp` and removes them after each test or suite teardown, with process-exit cleanup as a fallback. Fixture writes and truncations reserve a 256 MiB aggregate disk budget. Test oversized inputs with a small injected limit or mocked metadata; do not allocate gigabyte fixtures. Startup recovery preserves live owners, locks and dated benchmark evidence; see [temporary fixture ownership](adr/0048-temporary-fixture-lifetimes.md).
|
package/docs/jobs.md
CHANGED
|
@@ -48,6 +48,7 @@ Both native and ordinary calls use that same receipt, while a conflicting retry
|
|
|
48
48
|
|
|
49
49
|
The server binds an applied rewrite to its authenticated transaction journal before source replacement starts.
|
|
50
50
|
If execution stops after a commit, recovery reads that journal and reconstructs the domain result without planning or applying the rewrite again.
|
|
51
|
+
At startup the server checks every retained journal and recovers interrupted ones before any call reads or writes a workspace. A stdio server answers `initialize`, `ping`, `server/discover`, `tools/list`, `prompts/list` and `logging/setLevel` meanwhile and holds other requests, in arrival order, until the check ends; more than 128 held requests, or a failed check, closes the connection. The HTTP server finishes the check before it listens.
|
|
51
52
|
Blocked and unchanged plans do not bind a transaction because they never mutate source.
|
|
52
53
|
|
|
53
54
|
## Cancellation and recovery
|
package/docs/map.md
CHANGED
|
@@ -141,12 +141,12 @@ A model that needs an edit is reported by `MAP_GEOGRAPHY_*` diagnostics that nam
|
|
|
141
141
|
|
|
142
142
|
`create_world` with a geography writes `heightmap.bmp`, `world_normal.bmp`, `rivers.bmp`, the land and lake mask, and the permanent-snow terrain from the model; every other output follows the usual generator. Without a geography nothing changes. [ADR 0056](adr/0056-terrain-relief-and-hydrology-synthesis.md) records the design.
|
|
143
143
|
|
|
144
|
-
| Input | Meaning
|
|
145
|
-
| ---------------- |
|
|
146
|
-
| `relief.scale` | `vanilla` (default), `low` (everything above the lowland 25% lower) or `dramatic` (15% higher).
|
|
147
|
-
| `relief.detail` | 0 to 1, default 0.5: full-resolution roughness.
|
|
148
|
-
| `relief.painted` | With a reference picture: `true` or `{falloffPx, mountainPeak, hillsPeak, volcanoPeak, impassablePeak}`. Raises the macro relief toward the picture's painted mountain, hills and volcano classes before the rivers are routed, so the drawn ranges stand out and the model's rivers flow around them. Each class is blurred over `falloffPx` (default 24; below 16 the slopes steepen fast), mountains follow ridged noise, a cell keeps the model's height where that is higher, and painted mountains get permanent snow above a height that falls from 232 at the equator to 140 at the poles. Peaks are 0 to 1 on the range scale (defaults 0.82, 0.27, 0.9, 0.95). Impassable land is raised even when this is off. `MAP_RELIEF_PAINTED` reports the cells raised. |
|
|
149
|
-
| `rivers` | `{ "density": 0.02 }`: the share of land pixels the unnamed network covers (0 to 0.04, default 0.02; never more than 2.5% of the land or 130,000 pixels in all). An integer instead limits the number of unnamed river systems.
|
|
144
|
+
| Input | Meaning |
|
|
145
|
+
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
146
|
+
| `relief.scale` | `vanilla` (default), `low` (everything above the lowland 25% lower) or `dramatic` (15% higher). |
|
|
147
|
+
| `relief.detail` | 0 to 1, default 0.5: full-resolution roughness. |
|
|
148
|
+
| `relief.painted` | With a reference picture: `true` or `{falloffPx, mountainPeak, hillsPeak, volcanoPeak, impassablePeak}`. Raises the macro relief toward the picture's painted mountain, hills and volcano classes before the rivers are routed, so the drawn ranges stand out and the model's rivers flow around them. Each class is blurred over `falloffPx` (default 24; below 16 the slopes steepen fast), mountains follow ridged noise, a cell keeps the model's height where that is higher, and painted mountains get permanent snow above a height that falls from 232 at the equator to 140 at the poles. Peaks are 0 to 1 on the range scale (defaults 0.82, 0.27, 0.9, 0.95). A declared pass keeps the saddle carved for it: inside its corridor the raise is capped at the saddle level, so a painted or impassable range over a pass does not fill it (`MAP_PASS_NOT_LOWER`). Impassable land is raised even when this is off. `MAP_RELIEF_PAINTED` reports the cells raised. |
|
|
149
|
+
| `rivers` | `{ "density": 0.02 }`: the share of land pixels the unnamed network covers (0 to 0.04, default 0.02; never more than 2.5% of the land or 130,000 pixels in all). An integer instead limits the number of unnamed river systems. |
|
|
150
150
|
|
|
151
151
|
What each feature becomes. Heights are heightmap values: land from 96, sea 89 (ADR 0053), a crest of `peak` stands at `100 + 148 * peak`, a plateau of `height` at `96 + 148 * height`, and the base game reaches 239 (the synthesis stops at 252).
|
|
152
152
|
|
|
@@ -156,7 +156,7 @@ What each feature becomes. Heights are heightmap values: land from 96, sea 89 (A
|
|
|
156
156
|
- **Volcanoes** are cones from the rim of a `crater`, with radial gullies; the crater bowl is eight height units deep or more.
|
|
157
157
|
- **Plateaus** blend to their height inside the polygon with a short cliff or a ramp; height 0 is the land floor and, inside higher ground, a chasm.
|
|
158
158
|
- **Lakes** are carved out of the land and lie at 89; a lake with an `outflow` river starts that river on its lowest or nearest free shore.
|
|
159
|
-
- **Rivers** are routed over the land from the source (or lake shore) through the `via` points to the mouth, with bends, so a mouth that lies across a range or on another landmass is an error. Tributaries (`mouth: { river }`) join with a red pixel (index 1), a `delta` river splits into two distributaries that start in a yellow pixel (index 2), the main branch of every connected river has one green source (index 0), and widths from 3 to 11 follow the catchment and never narrow downstream. The network of unnamed rivers drains the rest of the land into them. Rivers avoid the high ground, keep a pixel apart, never form a 2 x 2 block and flow downhill in the written heights.
|
|
159
|
+
- **Rivers** are routed over the land from the source (or lake shore) through the `via` points to the mouth, with bends (a point mouth that the course already passes through, as when the last `via` lies within a half-resolution cell of it, ends the river there), so a mouth that lies across a range or on another landmass is an error. Tributaries (`mouth: { river }`) join with a red pixel (index 1), a `delta` river splits into two distributaries that start in a yellow pixel (index 2), the main branch of every connected river has one green source (index 0), and widths from 3 to 11 follow the catchment and never narrow downstream. The network of unnamed rivers drains the rest of the land into them. Rivers avoid the high ground, keep a pixel apart, never form a 2 x 2 block and flow downhill in the written heights.
|
|
160
160
|
|
|
161
161
|
The synthesis checks its own output and reports: `MAP_RELIEF_SYNTHESIZED` (info: land median, 99th percentile, maximum, mean step per half-resolution pixel, river pixels and share, the first named rivers), `MAP_PASS_NOT_LOWER` (error: a pass that is not lower than the crest either side), `MAP_RIVER_UNREACHABLE_MOUTH` (error: a named river that cannot reach its mouth over land or would climb more than 22 height units), `MAP_RANGE_CREST_LOW`, `MAP_VOLCANO_NO_CRATER`, `MAP_RELIEF_FLAT`, `MAP_RIVER_STRAIGHT_RUN` (more than 3% of river pixels on straight 41-pixel stretches; the base game has 1.1%), `MAP_RIVER_DENSITY` and `MAP_RIVER_PIXEL_ROUTE_INCOMPLETE` (warnings), and `MAP_LAKE_ENDORHEIC` and `MAP_RIVER_STREAMS_DROPPED` (info). They need the model, so `hoi4.map_inspect` cannot repeat them on an existing mod; the [appearance validators](#appearance-validation) read every file written.
|
|
162
162
|
|
|
@@ -467,15 +467,15 @@ Keys that take exactly one value (`capital`, `state`, `to_state`, `start_state`,
|
|
|
467
467
|
|
|
468
468
|
A world built from a geography also gets its gameplay facts from the model (ADR [0062](adr/0062-straits-passes-and-impassable-ranges.md) and [0063](adr/0063-geography-driven-ports-development-names-and-railways.md)). A world without a geography is unchanged.
|
|
469
469
|
|
|
470
|
-
| Model feature | What the world gets
|
|
471
|
-
| ------------------------------------ |
|
|
472
|
-
| `strait` | A named `sea` row in `adjacencies.csv` (land to land through a sea province; sea to sea through land when the path crosses an isthmus) and a rule in `adjacency_rules.txt` whose access follows `rule`: `open`, `army-closed` or `navy-closed`. The closest shores give the crossing line.
|
|
473
|
-
| `range` with `barrier: "impassable"` | `impassable` rows for every pair of land provinces whose border crosses the range's path, except at its passes. The partition cuts along the
|
|
474
|
-
| `pass` | A gap in the wall: the province pairs whose border passes through it carry no row. `fort` above 0 puts `bunker = level` on both provinces of the gate (the same for `fort-line` ranges, which write no rows).
|
|
475
|
-
| `lake` with `gameplay: "inland-sea"` | Sea provinces, so ships and naval bases can use it; a canal row joins a sealed one to the nearest ocean unless a declared strait does. Other lakes stay `lake` provinces and cannot hold a port.
|
|
476
|
-
| `site` | Victory points and names for capital, city, port and fortress sites (importance 1 to 5 gives 3 to 20 points); a port site holds a port; a `mine` site gives its `resource` (steel by default); a `country` anchor chooses that country's capital.
|
|
477
|
-
| fertility, rivers, coast, passes | Population, state category, infrastructure, factories and the harbour score of each coastal province, with no random rolls.
|
|
478
|
-
| names | State, strategic region, victory-point and lake-province names from sites, lake shores, river valleys, ranges, regions, lands and seas by containment; shared names get a compass adjective.
|
|
470
|
+
| Model feature | What the world gets |
|
|
471
|
+
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
472
|
+
| `strait` | A named `sea` row in `adjacencies.csv` (land to land through a sea province; sea to sea through land when the path crosses an isthmus) and a rule in `adjacency_rules.txt` whose access follows `rule`: `open`, `army-closed` or `navy-closed`. The closest shores give the crossing line. |
|
|
473
|
+
| `range` with `barrier: "impassable"` | `impassable` rows for every pair of land provinces whose border crosses the range's path, except at its passes; a border that touches across the path at a single pixel counts. The partition cuts along the path itself, also where the synthesis draws the range's barrier band many pixels wide, so provinces do not straddle it and their borders run on it. `MAP_RANGE_NOT_CLOSED` samples the provinces that meet at the path. |
|
|
474
|
+
| `pass` | A gap in the wall: the province pairs whose border passes through it carry no row. `fort` above 0 puts `bunker = level` on both provinces of the gate (the same for `fort-line` ranges, which write no rows). |
|
|
475
|
+
| `lake` with `gameplay: "inland-sea"` | Sea provinces, so ships and naval bases can use it; a canal row joins a sealed one to the nearest ocean unless a declared strait does. Other lakes stay `lake` provinces and cannot hold a port. |
|
|
476
|
+
| `site` | Victory points and names for capital, city, port and fortress sites (importance 1 to 5 gives 3 to 20 points); a port site holds a port; a `mine` site gives its `resource` (steel by default); a `country` anchor chooses that country's capital. |
|
|
477
|
+
| fertility, rivers, coast, passes | Population, state category, infrastructure, factories and the harbour score of each coastal province, with no random rolls. |
|
|
478
|
+
| names | State, strategic region, victory-point and lake-province names from sites, lake shores, river valleys, ranges, regions, lands and seas by containment; shared names get a compass adjective. |
|
|
479
479
|
|
|
480
480
|
Impassable land (ADR 0079) comes from painted `impassable_mountain` pixels and from model `regions` with `impassable: true`. A land province with most of its pixels in it becomes part of an impassable state, written as the base game writes its impassable states: `impassable = yes`, `force_link_ownership_to` the nearest passable state and its owner, category `enclave` where the mod defines it, infrastructure 0 and nothing built. Generated capitals and ports avoid it; a city on it, or a workspace capital in one of its provinces, is the error `MAP_FEATURE_IN_IMPASSABLE`. The relief raises it toward `relief.painted.impassablePeak`. Range lines with `barrier: "impassable"` and their gated passes are unchanged and work beside it. Whenever impassable land or rows exist, `MAP_REALM_CUT_OFF` (warning) lists land of a realm that impassable land or borders separate from its capital, and `MAP_REALM_ENCLOSED` (warning) a realm whose land reaches no other realm except through them; islands are never reported.
|
|
481
481
|
|
|
@@ -519,6 +519,10 @@ Width and height are multiples of 256 with at most 13,238,272 pixels. Land comes
|
|
|
519
519
|
|
|
520
520
|
The operation writes `provinces.bmp`, `definition.csv`, `default.map`, `continent.txt`, `heightmap.bmp`, `terrain.bmp`, `rivers.bmp` (rivers run downhill to the coast), `trees.bmp`, `cities.bmp`, `world_normal.bmp`, the land and water colour maps, `adjacencies.csv`, strategic regions (`landProvincesPerRegion`, `seaProvincesPerRegion`) with weather by latitude, states (`provincesPerState`) with population, category, buildings, resources, victory points and ports, country tags, country files, history and three-band flags, a bookmark, localisation, and every position, supply node and railway. Countries grow from spread-out capitals in proportion to `share`; each state lies within one country and one strategic region.
|
|
521
521
|
|
|
522
|
+
Continents are the largest landmasses, numbered `world_continent_1` and up and named by `continentNames`; smaller islands join the nearest one. Impassable land (the `wall` edge, painted `impassable_mountain` and impassable model regions) joins no landmass: two lands that only impassable land connects get separate continents, and each connected piece of impassable land takes the continent of the largest landmass it borders, or of the nearest passable province when it borders only water. Strategic regions never cross impassable land either: a piece no larger than a region joins the passable region it borders most, and a larger piece, or one beside only water, forms regions of its own, so no region or state spans the seam over the wall. Countries, generated or workspace realms, grow over passable land only and never cross impassable land or the wall from one edge to the other; land reached only that way follows the island rule (`realms.islands` for workspace realms, the nearest capital otherwise). Impassable provinces take no owner while countries grow: their states take the owner of the passable state they link to with `force_link_ownership_to`.
|
|
523
|
+
|
|
524
|
+
`continent.txt` lists the generated continents first, then by default every continent of the active `continent.txt`, so scripts and portraits that name the base game's continents still load; the in-game trade window then shows a filter for each of them. Set `inheritedContinents: "drop"` (default `"keep"`) to write only the generated continents. The call then reads the scripts that stay active after the write (all of `common`, `events`, `history/countries` and `portraits`, after the `replace_path` folders the world adds) and reports every reference to a dropped continent as `MAP_CONTINENT_DROPPED_REFERENCED` (warning) with its file and line: `is_on_continent = europe`, `continent = europe` (the state set of `any_state_in` and its effects), an AI area's `continents = { europe }` and a portrait pool's `continent = { name = europe }`. `MAP_CONTINENTS_DROPPED` (information) lists the dropped keys and counts the references. An AI strategy's `area = europe` names an AI area, not a continent, and is not reported; localisation keys of the dropped continents are not read.
|
|
525
|
+
|
|
522
526
|
Each write records its generated files in `.hoi4-agent-world.json`. A later `create_world` deletes the recorded files it no longer writes (retires them) in the same transaction and refuses with `MANAGED_OUTPUT_EDITED` when a recorded file was edited since. `MAP_WORLD_OUTPUTS_RECONCILED` and `data.outputs` give the counts of written, retired and released files with up to 200 paths each; `map-world-outputs.json` lists them all.
|
|
523
527
|
|
|
524
528
|
Every applied map rewrite also returns `data.changedSummary` with the number of changed files (`total`, `created`, `removed`, `modified`) and the same counts for the 40 folders with the most changes (two levels deep, `.` for the mod root, `omittedFolders` for the rest), so the size of a write is visible even when the inline `changedFiles` list is cut.
|
|
@@ -567,7 +571,7 @@ Only a course that cannot exist is refused with `MAP_RIVER_UNREACHABLE_MOUTH`: a
|
|
|
567
571
|
|
|
568
572
|
A declared pass is a saddle lower than the crest on both sides (ADR 0072): the heights in its corridor are capped at the saddle level after all relief is composed, so a volcano cone or plateau on the pass is cut down there (move the volcano if the cone should stay whole). Another range's body is not touched.
|
|
569
573
|
|
|
570
|
-
To check all of this without a write, call `hoi4.map_rewrite` with `preview: true` and `synthesisCheck: true` on the `create_world` operation: it runs the relief and river synthesis only, writes nothing and returns `MAP_SYNTHESIS_CHECK_READY` or `MAP_SYNTHESIS_CHECK_BLOCKED` with `data.synthesisCheck` (unreachable rivers, carved crossings and passes that are not lower than their crest). It does not run the partition, the countries or the climate stage (ADR 0070). A world that fails to generate returns only its own blockers, never the findings of the map it would replace.
|
|
574
|
+
To check all of this without a write, call `hoi4.map_rewrite` with `preview: true` and `synthesisCheck: true` on the `create_world` operation: it runs the relief and river synthesis only, writes nothing and returns `MAP_SYNTHESIS_CHECK_READY` or `MAP_SYNTHESIS_CHECK_BLOCKED` with `data.synthesisCheck` (unreachable rivers, carved crossings and passes that are not lower than their crest). It reports every blocking problem it finds in one answer, each in `blockers`: realm points that cannot be placed, cities and capitals on impassable land, rivers that cannot reach their mouths, and passes that are not lower than their crest, checked after a river fails too. A write still stops at its first blocking problem. Leaks through a wall (`MAP_RANGE_NOT_CLOSED`) and capitals in provinces that are only mostly impassable need the partition, so only a write finds them. It does not run the partition, the countries or the climate stage (ADR 0070). A world that fails to generate returns only its own blockers, never the findings of the map it would replace.
|
|
571
575
|
|
|
572
576
|
### Feature-aware provinces, states and strategic regions
|
|
573
577
|
|
|
@@ -643,7 +647,7 @@ A `rim` leaves sea at the seam as sea, and ships sail across it, because the sea
|
|
|
643
647
|
|
|
644
648
|
- A band between 60% and 100% of `rimPx` wide at the east and west edges, over the full height, becomes land; sea and lakes in it are filled (`MAP_EDGE_WALL_FILLED`, information). Its inner edge follows fractal noise, so it reads as a coast or cliff line rather than a ruled line. It gets the rim's heights and darker colours, the look `wallTerrain` sets, and the impassable rows across the seam.
|
|
645
649
|
- The seam is closed at any width, because the seam columns themselves are land. The default of 48 pixels keeps the wall at least one default land province (400 pixels, about 20 across) wide even where it is narrowest; for other province sizes, about 1.7 times the square root of `landProvincePixels` does the same.
|
|
646
|
-
- A land province with most of its pixels in the band belongs to the wall. The wall's provinces form their own states with `impassable = yes`, `force_link_ownership_to` the nearest passable state (counted in province steps over land and water) and that state's owner, as the base game's 21 impassable states do; the category is `enclave` where the mod defines it, with infrastructure 0 and no buildings, resources, victory points, ports or forts. A province that straddles the inner edge of the band goes wholly to the side holding most of its pixels.
|
|
650
|
+
- A land province with most of its pixels in the band belongs to the wall. The wall joins no landmass, strategic region or country across the seam (see [Create a new world](#create-a-new-world)): each side of it takes the continent of the land beside it, and its states the owner of the state they link to. The wall's provinces form their own states with `impassable = yes`, `force_link_ownership_to` the nearest passable state (counted in province steps over land and water) and that state's owner, as the base game's 21 impassable states do; the category is `enclave` where the mod defines it, with infrastructure 0 and no buildings, resources, victory points, ports or forts. A province that straddles the inner edge of the band goes wholly to the side holding most of its pixels.
|
|
647
651
|
- A city in the band (`MAP_EDGE_FEATURE_IN_BAND`) or a workspace capital in a wall province is an error. Capitals are never placed in the wall.
|
|
648
652
|
- Validation of a `wall` world reports water on the first or last column as `MAP_EDGE_WALL_OPEN` (error) instead of `MAP_EDGE_LAND_CUT`.
|
|
649
653
|
- With `polarPx: 0` land runs off the top and bottom edges, which validation reports as `MAP_POLAR_LAND` (information); the frame borders are drawn over those rows.
|
package/docs/reference.md
CHANGED
|
@@ -168,6 +168,8 @@ The result gives `nextId` after the highest used number, and `firstGapId` when a
|
|
|
168
168
|
{ "mode": "next_id", "kind": "event", "namespace": "my_mod" }
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
+
Both modes run on the shared Rust engine (`hoi4-engine mod-index`). Without a usable engine binary the call answers `ENGINE_UNAVAILABLE`; nothing is counted in TypeScript instead.
|
|
172
|
+
|
|
171
173
|
## Read the mod's skills
|
|
172
174
|
|
|
173
175
|
`hoi4.skill` serves the modding skills HOI4 Mod Setup installed in the mod, so every client reads the same text.
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
# Probability adapter evidence
|
|
2
2
|
|
|
3
|
-
The AI and MTTH Scenario Analyzer targets Hearts of Iron IV **Operation Postern 1.19.4.
|
|
3
|
+
The AI and MTTH Scenario Analyzer targets Hearts of Iron IV **Operation Postern 1.19.4.2 (checksum 0bdb)**. Adapter behavior is versioned as `hoi4-1.19.4.2.v1`. Results always include that adapter version and game build. When the installed build differs, results carry the warning `PROBABILITY_GAME_BUILD_UNVERIFIED`, and the nightly game-update watcher lists the adapters under "Checked against another build" on every run until the pin moves.
|
|
4
|
+
|
|
5
|
+
## Re-check for 1.19.4.2 (2026-11-08)
|
|
6
|
+
|
|
7
|
+
Every reviewed file was hashed again on the installed game 1.19.4.2:
|
|
8
|
+
|
|
9
|
+
- **Unchanged:** all six reviewed documentation files are byte-identical to the 1.19.4.1 review: `common/decisions/_documentation.md`, `common/doctrines/_documentation.md`, `common/script_constants/documentation.md`, `documentation/script_concept_documentation.md`, `documentation/effects_documentation.md` and `common/ai_strategy/_documentation.md` (`cd19fa14…c715`).
|
|
10
|
+
- **Examples:** each vanilla example below keeps its construct at the line given for 1.19.4.1: `events/Yugoslavia.txt:49`, `events/AAT_Generic_Events.txt:44`, `common/decisions/_generic_decisions.txt:56`, `common/national_focus/austria.txt:122`, `common/technologies/industry.txt:30`, `common/doctrines/grand_doctrines/land_grand_doctrines.txt:14`, `events/AAT_Sweden.txt:1760`, `events/BBA_Switzerland.txt:1205` and the `research_weight_factor` strategy at `common/ai_strategy/ENG.txt:3202`.
|
|
11
|
+
- **Installed build:** `launcher-settings.json` reads `Operation Postern v1.19.4.2.2da5 (0bdb)`, raw version `1.19.4.2`.
|
|
12
|
+
|
|
13
|
+
No adapter rule changed, so only the version pin moved.
|
|
4
14
|
|
|
5
15
|
## Re-check for 1.19.4.1 (2026-11-06)
|
|
6
16
|
|
package/docs/tools.md
CHANGED
|
@@ -192,7 +192,6 @@ Other clients receive the ordinary synchronous result.
|
|
|
192
192
|
Use `hoi4.job_inspect` to inspect an authorized job or retrieve its result, and `hoi4.job_cancel` to request cancellation.
|
|
193
193
|
See [Background jobs](jobs.md) for request keys, cancellation and recovery.
|
|
194
194
|
|
|
195
|
-
##
|
|
195
|
+
## Plugins
|
|
196
196
|
|
|
197
|
-
|
|
198
|
-
These workflow-specific tools are absent from the default list, and the HTTP server never exposes them.
|
|
197
|
+
A private extension can add tools to the stdio server (`hoi4-agent-tools`). List its module (`.mjs` or `.js`, absolute path) in the configuration key `plugins`; the server loads plugins only from those paths, never from a mod folder or the environment, and the HTTP server never loads them. A plugin tool is named `<plugin>.<tool>` and never starts with `hoi4.`, which this package reserves. A plugin exports a default function that receives a host (`importServerModule` to borrow the server's own modules, `dependency` for the shared `zod` and `sharp`) and returns a factory of tools; each tool has the same definition as a built-in one (name, title, description, input and optional output schema, annotations) and a `call` function. A plugin file that does not exist is skipped with a warning on stderr; a file that is a link, is not a `.mjs` or `.js` file, or exports no factory stops the server at startup.
|
package/docs/troubleshooting.md
CHANGED
|
@@ -14,7 +14,7 @@ This page lists the codes you are most likely to meet, then the checks for probl
|
|
|
14
14
|
| Renders lack icons or fonts, native commands are unresolved | The game folder is not configured. Set `--game-root` (or `gameRoot`) to the Hearts of Iron IV folder; `hoi4-agent-tools-setup --discover` prints the folders it can find. |
|
|
15
15
|
| `ERROR_LOG_NOT_FOUND` | Launch the game once, or set `gameUserRoot` to the folder that holds `logs/`, `mod/` and `save games/` (with OneDrive that is often under `OneDrive\Documents`). |
|
|
16
16
|
| `AUTH_INVALID` over HTTP | The bearer token is missing, expired or for another server. See the [HTTP guide](http.md). |
|
|
17
|
-
| Startup or a call times out in the client | A cold scan of a large mod takes minutes. Raise the client's startup and tool timeouts (the printed Codex entries use 120 and 600 seconds), or use [background jobs](jobs.md).
|
|
17
|
+
| Startup or a call times out in the client | A cold scan of a large mod takes minutes. Raise the client's startup and tool timeouts (the printed Codex entries use 120 and 600 seconds), or use [background jobs](jobs.md). The stdio server answers the handshake before it checks retained rewrite journals; the first tool call waits for that check. |
|
|
18
18
|
| Many idle `node` processes | Some clients keep a server per subagent. Set `HOI4_AGENT_STDIO_IDLE_EXIT_MINUTES`; see [Server lifetime](setup.md#server-lifetime). |
|
|
19
19
|
|
|
20
20
|
## Arguments and results
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/engine/bin/manifest.json
CHANGED
|
@@ -4,23 +4,23 @@
|
|
|
4
4
|
"binaries": {
|
|
5
5
|
"darwin-arm64": {
|
|
6
6
|
"file": "darwin-arm64/hoi4-engine",
|
|
7
|
-
"sha256": "
|
|
8
|
-
"size":
|
|
7
|
+
"sha256": "f6dc22cb5f75ff544df60684edd6ff73bfd3bc03b36f0cf281bf1b04e620b871",
|
|
8
|
+
"size": 4562496
|
|
9
9
|
},
|
|
10
10
|
"linux-arm64": {
|
|
11
11
|
"file": "linux-arm64/hoi4-engine",
|
|
12
|
-
"sha256": "
|
|
13
|
-
"size":
|
|
12
|
+
"sha256": "a535f718dd730b4687c679780a0f063fdc7e7dd81b6aeb7f5fa232d65b1e6b76",
|
|
13
|
+
"size": 4891992
|
|
14
14
|
},
|
|
15
15
|
"linux-x64": {
|
|
16
16
|
"file": "linux-x64/hoi4-engine",
|
|
17
|
-
"sha256": "
|
|
18
|
-
"size":
|
|
17
|
+
"sha256": "5ecb3b90e7d97c9513064f640d41116cc2b209c71478f627919f43ab8d36141a",
|
|
18
|
+
"size": 5274640
|
|
19
19
|
},
|
|
20
20
|
"win32-x64": {
|
|
21
21
|
"file": "win32-x64/hoi4-engine.exe",
|
|
22
|
-
"sha256": "
|
|
23
|
-
"size":
|
|
22
|
+
"sha256": "dac9fd231db24a4e70fd6048da3dc1673185385cd823bb69da8b7c1f2b32fb18",
|
|
23
|
+
"size": 4414464
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
Binary file
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hoi4-agent-tools",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "hoi4-agent-tools",
|
|
9
|
-
"version": "4.
|
|
9
|
+
"version": "4.12.0",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@fontsource-variable/roboto": "5.3.0",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hoi4-agent-tools",
|
|
3
3
|
"mcpName": "io.github.klimPaskov/hoi4-agent-tools",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.12.0",
|
|
5
5
|
"description": "Build HOI4 mods: focus trees, events, decisions, worlds, GUI previews, docs and AI balance.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "Apache-2.0",
|