hoi4-agent-tools 4.8.0 → 4.9.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.
Files changed (79) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/hoi4_agent_tools/core/index.js +28 -0
  3. package/dist/hoi4_agent_tools/decision/service.js +39 -2
  4. package/dist/hoi4_agent_tools/event/queries.js +25 -2
  5. package/dist/hoi4_agent_tools/event/service.js +66 -11
  6. package/dist/hoi4_agent_tools/impact/service.js +15 -0
  7. package/dist/hoi4_agent_tools/map/appearance-validation.js +14 -2
  8. package/dist/hoi4_agent_tools/map/geography/resolve.js +3 -2
  9. package/dist/hoi4_agent_tools/map/tool-operations.js +41 -0
  10. package/dist/hoi4_agent_tools/map/world-edge.js +117 -15
  11. package/dist/hoi4_agent_tools/map/world.js +158 -34
  12. package/dist/hoi4_agent_tools/mcp/server/argument-errors.js +57 -9
  13. package/dist/hoi4_agent_tools/mcp/server/create-modern-operations.js +1 -1
  14. package/dist/hoi4_agent_tools/mcp/server/request-lifecycle.js +1 -1
  15. package/dist/hoi4_agent_tools/mcp/tools/analysis.js +4 -2
  16. package/dist/hoi4_agent_tools/mcp/tools/event.js +13 -0
  17. package/dist/hoi4_agent_tools/mcp/tools/gui.js +1 -1
  18. package/dist/hoi4_agent_tools/mcp/tools/reference.js +25 -0
  19. package/dist/hoi4_agent_tools/reference/error-log.js +35 -1
  20. package/dist/hoi4_agent_tools/reference/operations.js +141 -14
  21. package/dist/hoi4_agent_tools/reference/script-validation.js +113 -2
  22. package/dist/hoi4_agent_tools/schemas/ideas.js +4 -4
  23. package/dist/hoi4_agent_tools/schemas/map.js +32 -4
  24. package/dist/hoi4_agent_tools/schemas/script-validation.js +8 -1
  25. package/dist/hoi4_agent_tools/schemas/system.js +157 -0
  26. package/dist/hoi4_agent_tools/system/inspect.js +55 -0
  27. package/dist/hoi4_agent_tools/version.js +1 -1
  28. package/docs/analysis.md +2 -2
  29. package/docs/events.md +1 -1
  30. package/docs/map.md +19 -8
  31. package/docs/tools.md +49 -43
  32. package/engine/README.md +9 -0
  33. package/engine/bin/darwin-arm64/hoi4-engine +0 -0
  34. package/engine/bin/linux-arm64/hoi4-engine +0 -0
  35. package/engine/bin/linux-x64/hoi4-engine +0 -0
  36. package/engine/bin/manifest.json +8 -8
  37. package/engine/bin/win32-x64/hoi4-engine.exe +0 -0
  38. package/npm-shrinkwrap.json +2 -2
  39. package/package.json +1 -1
  40. package/schemas/configuration.schema.json +1 -1
  41. package/schemas/continuous-focus-palette.schema.json +1 -1
  42. package/schemas/custom-weighted-pool.schema.json +1 -1
  43. package/schemas/decision-inspect-input.schema.json +1 -1
  44. package/schemas/error-log-input.schema.json +1 -1
  45. package/schemas/event-feature-manifest.schema.json +1 -1
  46. package/schemas/focus-plan.schema.json +1 -1
  47. package/schemas/focus-planning-sidecar.schema.json +1 -1
  48. package/schemas/geography-model.schema.json +1 -1
  49. package/schemas/gui-animation-source.schema.json +1 -1
  50. package/schemas/gui-helper.schema.json +1 -1
  51. package/schemas/gui-scenario.schema.json +1 -1
  52. package/schemas/helper-expansion-request.schema.json +1 -1
  53. package/schemas/helper-expansion-summary.schema.json +1 -1
  54. package/schemas/impact-inspect-input.schema.json +1 -1
  55. package/schemas/map-operation.schema.json +165 -101
  56. package/schemas/mechanic-test-input.schema.json +1 -1
  57. package/schemas/mod-index-input.schema.json +1 -1
  58. package/schemas/operation-result.schema.json +1 -1
  59. package/schemas/package-check-input.schema.json +1 -1
  60. package/schemas/package-manifest.schema.json +1 -1
  61. package/schemas/probability-analysis-result.schema.json +1 -1
  62. package/schemas/probability-compare-input.schema.json +1 -1
  63. package/schemas/probability-evaluate-input.schema.json +1 -1
  64. package/schemas/probability-inspect-input.schema.json +1 -1
  65. package/schemas/probability-render-input.schema.json +1 -1
  66. package/schemas/probability-scenario-set.schema.json +1 -1
  67. package/schemas/probability-sequence-input.schema.json +1 -1
  68. package/schemas/probability-simulate-input.schema.json +1 -1
  69. package/schemas/probability-sweep-input.schema.json +1 -1
  70. package/schemas/reference-context-input.schema.json +1 -1
  71. package/schemas/reference-read-input.schema.json +1 -1
  72. package/schemas/reference-search-input.schema.json +1 -1
  73. package/schemas/reference-sheets.schema.json +1 -1
  74. package/schemas/scenario-suite.schema.json +1 -1
  75. package/schemas/scenario-test-input.schema.json +1 -1
  76. package/schemas/script-validate-input.schema.json +1 -1
  77. package/schemas/shared-scenario.schema.json +1 -1
  78. package/schemas/source-lookup-input.schema.json +1 -1
  79. package/server.json +2 -2
@@ -193,9 +193,9 @@ export const worldReferenceSchema = z
193
193
  export const worldEdgeSchema = z
194
194
  .object({
195
195
  mode: z
196
- .enum(['sea-band', 'rim', 'none'])
196
+ .enum(['sea-band', 'rim', 'wall', 'none'])
197
197
  .optional()
198
- .describe('sea-band (default when edge is given) clears land from the east and west edges and the poles to open sea; rim ends land at the seam in an impassable snow range with impassable adjacencies across the seam; none keeps the picture and warns about land cut by the wrapping seam.'),
198
+ .describe('sea-band (default when edge is given) clears land from the east and west edges and the poles to open sea; rim ends land at the seam in an impassable snow range with impassable adjacencies across the seam, but sea at the seam stays sailable; wall fills rimPx at the east and west edges with land over the full height, in impassable states, so nothing crosses the seam by land or sea; none keeps the picture and warns about land cut by the wrapping seam.'),
199
199
  bandPx: z
200
200
  .number()
201
201
  .int()
@@ -209,14 +209,42 @@ export const worldEdgeSchema = z
209
209
  .min(0)
210
210
  .max(1_024)
211
211
  .optional()
212
- .describe('North and south sea band in pixels; default 64, at most a quarter of the height.'),
212
+ .describe('North and south sea band in pixels; default 64, at most a quarter of the height. 0 lets land reach the top and bottom edges.'),
213
213
  rimPx: z
214
214
  .number()
215
215
  .int()
216
216
  .min(16)
217
217
  .max(2_048)
218
218
  .optional()
219
- .describe('Rim range width in pixels for mode rim; default 160, at most a quarter of the width.'),
219
+ .describe('Rim range or wall width in pixels for mode rim or wall; default 160 for rim and 48 for wall, at most a quarter of the width. The inner edge of the wall is ragged between 60% and 100% of it.'),
220
+ wallTerrain: z
221
+ .union([
222
+ z.literal('auto'),
223
+ z
224
+ .array(z
225
+ .object({
226
+ y0: z.number().int().min(0).max(16_384),
227
+ y1: z.number().int().min(0).max(16_384),
228
+ kind: z.enum([
229
+ 'snow',
230
+ 'mountain',
231
+ 'hills',
232
+ 'desert',
233
+ 'forest',
234
+ 'plains',
235
+ 'marsh',
236
+ 'jungle',
237
+ ]),
238
+ })
239
+ .strict()
240
+ .refine((segment) => segment.y1 >= segment.y0, {
241
+ message: 'y1 must not be above y0',
242
+ }))
243
+ .min(1)
244
+ .max(256),
245
+ ])
246
+ .optional()
247
+ .describe('Mode wall only: the look of the wall. auto (default) takes, for each row, the terrain of the nearest land the wall meets on that side, or snow toward the poles and mountain elsewhere where it meets only water, smoothed along the edge. A list of {y0, y1, kind} segments (rows counted from the top, inclusive) sets it by rows; uncovered rows fall back to auto.'),
220
248
  })
221
249
  .strict();
222
250
  /** Relief synthesis from a geography model (ADR 0056). */
@@ -63,8 +63,13 @@ export const scriptValidateDataSchema = z
63
63
  'player_text',
64
64
  'event_popups',
65
65
  'known_mistakes',
66
+ 'identifier_arguments',
66
67
  ])),
67
- parametersChecked: z.literal(false),
68
+ /**
69
+ * Identifier arguments (ideas, events, decisions, focuses, technologies) were checked against
70
+ * the workspace's definitions. Other argument values are not checked.
71
+ */
72
+ parametersChecked: z.boolean(),
68
73
  documentation: z
69
74
  .object({
70
75
  source: z.enum(['game_doc', 'script_doc']),
@@ -96,6 +101,8 @@ export const scriptValidateDataSchema = z
96
101
  unresolvedCount: z.number().int().min(0),
97
102
  truncated: z.boolean(),
98
103
  argumentBlocksUnchecked: z.number().int().min(0),
104
+ /** What made the result partial when `valid` is null, one plain sentence each. */
105
+ partialReasons: z.array(z.string().max(600)).max(5).optional(),
99
106
  file: z
100
107
  .object({
101
108
  path: z.string().max(4096),
@@ -0,0 +1,157 @@
1
+ import { z } from 'zod/v4';
2
+ import { workspaceIdSchema } from './common.js';
3
+ import { fieldSchema, placeSchema, problemSchema, textSchema } from './ideas.js';
4
+ /** The systems `hoi4.system_inspect` reads, one engine kind each. */
5
+ export const systemKinds = [
6
+ 'on_actions',
7
+ 'mio',
8
+ 'balance_of_power',
9
+ 'special_project',
10
+ 'operation',
11
+ 'raid',
12
+ ];
13
+ /** `hoi4.system_inspect`, answered by `hoi4-engine system`. */
14
+ export const systemInspectRequestSchema = z
15
+ .object({
16
+ workspaceId: workspaceIdSchema,
17
+ /** on_actions: a hook. mio: an organization or policy. special_project: a project, prototype reward, specialization or tag. operation: an operation, phase or token. raid: a raid or raid category. */
18
+ kind: z.enum(systemKinds),
19
+ /** The definition (or on_actions hook) to inspect. Leave it out with audit. */
20
+ id: z.string().min(1).max(256).optional(),
21
+ /** Check every definition of this system the mod makes instead of one. */
22
+ audit: z.boolean().default(false),
23
+ /** One: mentions listed. Audit: examples kept per problem code. */
24
+ limit: z.number().int().min(1).max(50).default(5),
25
+ })
26
+ .strict()
27
+ .refine((input) => input.audit || input.id !== undefined, {
28
+ message: 'pass an id, or audit: true',
29
+ path: ['id'],
30
+ });
31
+ /** The kinds `hoi4.unit_inspect` reads, answered by `hoi4-engine units`. */
32
+ export const unitKinds = ['oob', 'sub_unit', 'equipment', 'variant'];
33
+ /** One definition, as the engine answers it. */
34
+ const engineInspectionShape = (kinds) => z
35
+ .object({
36
+ kind: z.enum(kinds),
37
+ id: z.string().max(256),
38
+ found: z.boolean(),
39
+ definitions: z.array(placeSchema.extend({ what: z.string().max(64) })).max(512),
40
+ fields: z.array(fieldSchema).max(32),
41
+ parts: z
42
+ .array(z
43
+ .object({ what: z.string().max(64), id: z.string().max(256), line: z.number().int() })
44
+ .strict())
45
+ .max(100),
46
+ partsTruncated: z.boolean(),
47
+ references: z
48
+ .array(z
49
+ .object({
50
+ field: z.string().max(128),
51
+ target: z.string().max(64),
52
+ value: z.string().max(512),
53
+ known: z.boolean(),
54
+ line: z.number().int(),
55
+ })
56
+ .strict())
57
+ .max(100),
58
+ referencesTruncated: z.boolean(),
59
+ texts: z
60
+ .array(z.object({ key: z.string().max(512), texts: z.array(textSchema).max(64) }).strict())
61
+ .max(8),
62
+ mentions: z
63
+ .array(z
64
+ .object({ path: z.string().max(1024), line: z.number().int(), layer: z.string() })
65
+ .strict())
66
+ .max(100),
67
+ mentionsTruncated: z.boolean(),
68
+ problems: z.array(problemSchema).max(1000),
69
+ suggestions: z.array(z.string().max(256)).max(3).optional(),
70
+ })
71
+ .strict();
72
+ export const systemEngineInspectionSchema = engineInspectionShape(systemKinds);
73
+ /** Every definition of the system the mod makes, as the engine answers an audit. */
74
+ const engineAuditShape = (kinds) => z
75
+ .object({
76
+ kind: z.enum(kinds),
77
+ checked: z.number().int().min(0),
78
+ counts: z.record(z.string(), z.number().int().min(0)),
79
+ problems: z
80
+ .array(z
81
+ .object({
82
+ code: z.string().max(64),
83
+ severity: z.enum(['warning', 'info']),
84
+ id: z.string().max(256),
85
+ path: z.string().max(1024),
86
+ line: z.number().int().min(0),
87
+ message: z.string().max(1200),
88
+ })
89
+ .strict())
90
+ .max(5000),
91
+ truncated: z.boolean(),
92
+ })
93
+ .strict();
94
+ export const systemEngineAuditSchema = engineAuditShape(systemKinds);
95
+ export const systemInspectDataSchema = z
96
+ .object({
97
+ inspection: systemEngineInspectionSchema.optional(),
98
+ audit: systemEngineAuditSchema.optional(),
99
+ durationMs: z.number().int().min(0),
100
+ })
101
+ .strict();
102
+ /** `hoi4.unit_inspect`, answered by `hoi4-engine units`. */
103
+ export const unitInspectRequestSchema = z
104
+ .object({
105
+ workspaceId: workspaceIdSchema,
106
+ /** oob: a history/units file name without .txt. sub_unit, equipment (or module): its id. variant: its name. */
107
+ kind: z.enum(unitKinds),
108
+ /** The definition to inspect. Leave it out with audit. */
109
+ id: z.string().min(1).max(256).optional(),
110
+ /** Check every definition of this kind the mod makes instead of one. */
111
+ audit: z.boolean().default(false),
112
+ /** One: mentions listed. Audit: examples kept per problem code. */
113
+ limit: z.number().int().min(1).max(50).default(5),
114
+ })
115
+ .strict()
116
+ .refine((input) => input.audit || input.id !== undefined, {
117
+ message: 'pass an id, or audit: true',
118
+ path: ['id'],
119
+ });
120
+ export const unitEngineInspectionSchema = engineInspectionShape(unitKinds);
121
+ export const unitEngineAuditSchema = engineAuditShape(unitKinds);
122
+ export const unitInspectDataSchema = z
123
+ .object({
124
+ inspection: unitEngineInspectionSchema.optional(),
125
+ audit: unitEngineAuditSchema.optional(),
126
+ durationMs: z.number().int().min(0),
127
+ })
128
+ .strict();
129
+ /** The kinds `hoi4.asset_inspect` reads, answered by `hoi4-engine assets`. */
130
+ export const assetKinds = ['sprite', 'sound', 'flag'];
131
+ /** `hoi4.asset_inspect`, answered by `hoi4-engine assets`. */
132
+ export const assetInspectRequestSchema = z
133
+ .object({
134
+ workspaceId: workspaceIdSchema,
135
+ /** sprite: a sprite name. sound: a sound, sound effect, category or music name. flag: TAG or TAG_ideology. */
136
+ kind: z.enum(assetKinds),
137
+ /** The asset to inspect. Leave it out with audit. */
138
+ id: z.string().min(1).max(256).optional(),
139
+ /** Check every asset of this kind the mod defines instead of one. */
140
+ audit: z.boolean().default(false),
141
+ /** One: mentions listed. Audit: examples kept per problem code. */
142
+ limit: z.number().int().min(1).max(50).default(5),
143
+ })
144
+ .strict()
145
+ .refine((input) => input.audit || input.id !== undefined, {
146
+ message: 'pass an id, or audit: true',
147
+ path: ['id'],
148
+ });
149
+ export const assetEngineInspectionSchema = engineInspectionShape(assetKinds);
150
+ export const assetEngineAuditSchema = engineAuditShape(assetKinds);
151
+ export const assetInspectDataSchema = z
152
+ .object({
153
+ inspection: assetEngineInspectionSchema.optional(),
154
+ audit: assetEngineAuditSchema.optional(),
155
+ durationMs: z.number().int().min(0),
156
+ })
157
+ .strict();
@@ -0,0 +1,55 @@
1
+ import { runEngineCommand } from '../core/engine-client.js';
2
+ import { ServiceError } from '../core/result.js';
3
+ import { assetEngineAuditSchema, assetEngineInspectionSchema, systemEngineAuditSchema, systemEngineInspectionSchema, unitEngineAuditSchema, unitEngineInspectionSchema, } from '../schemas/system.js';
4
+ /** An audit reads the system's files, the sprites and every localisation file. */
5
+ const SYSTEM_TIMEOUT_MS = 180_000;
6
+ /**
7
+ * Runs one engine command that answers a definition or an audit. This side passes the workspace's
8
+ * roots and turns the engine's answer into the tool's data. A missing engine is
9
+ * `ENGINE_UNAVAILABLE`, with no TypeScript fallback.
10
+ */
11
+ async function inspectDefinitions(command, schemas, notFound, workspace, input, signal) {
12
+ const started = Date.now();
13
+ const request = {
14
+ ...(workspace.gameRoot === undefined ? {} : { game: workspace.gameRoot }),
15
+ ...(workspace.registration.kind === 'game' ? {} : { mod: workspace.modRoot }),
16
+ dependencies: workspace.dependencyRoots,
17
+ includeDlc: workspace.dlcLayers.length > 0,
18
+ kind: input.kind,
19
+ ...(input.id === undefined ? {} : { id: input.id }),
20
+ audit: input.audit,
21
+ limit: input.limit,
22
+ };
23
+ const options = { timeoutMs: SYSTEM_TIMEOUT_MS, ...(signal === undefined ? {} : { signal }) };
24
+ if (input.audit) {
25
+ const result = await runEngineCommand(command, request, schemas.audit, options);
26
+ if (!result.available)
27
+ throw new ServiceError('ENGINE_UNAVAILABLE', result.message, { reason: result.reason });
28
+ if (result.outcome === 'invalid_request')
29
+ throw new ServiceError(result.error.code, result.error.message);
30
+ return { audit: result.response, durationMs: Date.now() - started };
31
+ }
32
+ const result = await runEngineCommand(command, request, schemas.inspection, options);
33
+ if (!result.available)
34
+ throw new ServiceError('ENGINE_UNAVAILABLE', result.message, { reason: result.reason });
35
+ if (result.outcome === 'invalid_request')
36
+ throw new ServiceError(result.error.code, result.error.message);
37
+ const inspection = result.response;
38
+ if (!inspection.found) {
39
+ const suggestions = inspection.suggestions ?? [];
40
+ throw new ServiceError(notFound, `No loaded ${input.kind} file defines ${input.id ?? ''}${suggestions.length === 0 ? '' : `; did you mean ${suggestions.join(', ')}?`}`, { kind: input.kind, id: input.id ?? '', suggestions });
41
+ }
42
+ return { inspection: result.response, durationMs: Date.now() - started };
43
+ }
44
+ /** `hoi4.system_inspect` on the shared Rust engine (`hoi4-engine system`). */
45
+ export async function inspectSystem(workspace, input, signal) {
46
+ return inspectDefinitions('system', { inspection: systemEngineInspectionSchema, audit: systemEngineAuditSchema }, 'SYSTEM_DEFINITION_NOT_FOUND', workspace, input, signal);
47
+ }
48
+ /** `hoi4.unit_inspect` on the shared Rust engine (`hoi4-engine units`). */
49
+ export async function inspectUnits(workspace, input, signal) {
50
+ return inspectDefinitions('units', { inspection: unitEngineInspectionSchema, audit: unitEngineAuditSchema }, 'UNIT_DEFINITION_NOT_FOUND', workspace, input, signal);
51
+ }
52
+ /** `hoi4.asset_inspect` on the shared Rust engine (`hoi4-engine assets`). */
53
+ export async function inspectAssets(workspace, input, signal) {
54
+ return inspectDefinitions('assets', { inspection: assetEngineInspectionSchema, audit: assetEngineAuditSchema }, 'ASSET_NOT_FOUND', workspace, input, signal);
55
+ }
@@ -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.8.0';
3
+ export const PACKAGE_VERSION = '4.9.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/analysis.md CHANGED
@@ -31,7 +31,7 @@ Each entry is an object with `relativePath` and `content`, and a request takes b
31
31
 
32
32
  Impact and decision proposals name the text field `content`.
33
33
  Event and technology proposals for `hoi4.event_inspect` and `hoi4.tech_inspect` with `mode: compare` name the same field `source` and also accept an optional `expectedSourceHash`.
34
- When `changedFiles` is omitted, each proposed file seeds all its active definitions alongside any selected symbols.
34
+ When `changedFiles` is omitted, each proposed file seeds all its active definitions alongside any selected symbols. A symbol that nothing defines or uses, in the source or the proposal, answers `IMPACT_SYMBOL_NOT_FOUND` with close names.
35
35
  The report compares the original and proposed consumer graph, including added and removed consumers and affected files.
36
36
  Moving a source location within one file does not count an unchanged reference as a new or removed consumer.
37
37
  `expectedRevision` prevents analysis against a source revision different from the one the caller reviewed.
@@ -97,7 +97,7 @@ Inspect one decision under declared actor and target state:
97
97
  ```
98
98
 
99
99
  `ROOT` is the actor country and `FROM` is the declared target country or state.
100
- The inventory lists active decisions, category fragments, overridden source definitions, and each decision's explicit targets, target arrays, state filters, and target trigger declarations.
100
+ The inventory lists active decisions, category fragments, overridden source definitions, and each decision's explicit targets, target arrays, state filters, and target trigger declarations. With an `id`, it lists only that category's decisions, or that one decision, and returns their ids inline in `data.decisionIds`. Any other id answers `DECISION_NOT_FOUND` with close names.
101
101
  Category and decision `allowed`, `visible`, and `available` results remain separate; mission visibility is reported as ignored where documented.
102
102
  Target selection covers explicit lists and arrays plus supported state ownership, control, and continent filters.
103
103
  When a target, flag, variable, or helper input is unknown, the corresponding gate remains unresolved.
package/docs/events.md CHANGED
@@ -49,7 +49,7 @@ Selectors use one of these forms:
49
49
  { "kind": "manifest", "manifest": { "eventIds": ["namespace.1", "namespace.2"] } }
50
50
  ```
51
51
 
52
- `trace` uses `selector`; `explain_path` uses `from` and `to`; and `state_flow` may add a `stateSubject` object with `kind` and `name`. Allowed state kinds are `country_flag`, `global_flag`, `state_flag`, `variable`, `global_variable`, `array`, `event_target`, `global_event_target`, and `saved_scope`.
52
+ `trace` uses `selector`; `explain_path` uses `from` and `to`; and `state_flow` may add a `stateSubject` object with `kind` and `name`. Allowed state kinds are `country_flag`, `global_flag`, `state_flag`, `variable`, `global_variable`, `array`, `event_target`, `global_event_target`, and `saved_scope`. A subject narrows the findings as well as the flow, and `data.summary.flow` gives its producers and readers inline. `scan`, `roots`, `lint` and `state_flow` apply a `selector` too. A selector that matches nothing answers `EVENT_NOT_FOUND`, `EVENT_NAMESPACE_NOT_FOUND`, `EVENT_NODE_NOT_FOUND` or `EVENT_SOURCE_NOT_FOUND` with close names, and a subject nothing uses answers `EVENT_STATE_NOT_FOUND`.
53
53
 
54
54
  `impact` requires an `impactSubject` object with `kind` and `name`. Allowed impact kinds are `event`, `helper`, `flag`, `variable`, `array`, `event_target`, and `saved_scope`. Set `refresh: true` after source changes when a prior graph may be cached.
55
55
 
package/docs/map.md CHANGED
@@ -133,7 +133,7 @@ Every feature also takes `id` (letters, digits, `_`, `.`, `-`; unique across the
133
133
 
134
134
  A model that needs an edit is reported by `MAP_GEOGRAPHY_*` diagnostics that name the feature. Errors: `ID_DUPLICATE`, `RING_DEGENERATE`, `RING_SELF_INTERSECTION`, `POLYGONS_OVERLAP`, `HOLE_OUTSIDE`, `HOLES_WITHOUT_POLYGONS`, `REF_UNKNOWN`, `REF_KIND`, `PASS_SHAPE`, `PASS_OFF_RANGE`, `RIVER_SOURCE_NOT_LAND`, `RIVER_MOUTH_NOT_WATER`, `RIVER_CYCLE`, `LAKE_SHAPE`, `LAKE_NOT_IN_LAND`, `LAKE_OUT_OF_FRAME`, `VOLCANO_NOT_ON_LAND`, `VOLCANO_CRATER_RADIUS`, `STRAIT_SHAPE`, `STRAIT_ENDPOINT`, `STRAIT_SAME_LAND`, `SITE_IN_WATER`, `BIOME_CONFLICT` (different kinds overlap at the same `z`), `BIOME_OVER_WATER`, `PATH_DEGENERATE`, `CLIMATE_TEMPERATURE_ORDER`, `REGION_DENSITY_ORDER`, `NO_LAND` (no lands and no reference picture), `LIMIT_FEATURES` and `LIMIT_POINTS`. Warnings: `LAND_OVERLAP`, `SEA_OVER_LAND`, `LAKE_TOO_SMALL`, `LAKE_OUTFLOW_MISMATCH`, `PASS_OVERLAP`, `VOLCANO_OVERLAP`, `RANGE_ON_WATER`, `PATH_SELF_INTERSECTION`, `RIVER_VIA_NOT_LAND`, `STRAIT_PATH_ON_LAND`, `STRAIT_NO_WATER`, `SITE_DUPLICATE_POSITION`, `REGION_EMPTY`, `REGION_TERRAIN_SUM`, `NAME_DUPLICATE`, `RING_DUPLICATE_VERTEX`, `PATH_DUPLICATE_VERTEX`, `FEATURE_IN_EDGE_BAND` and `DIAGNOSTICS_TRUNCATED` (more than 1,000 findings; the worst severity is kept). A file that cannot be used at all fails the call instead, with `MAP_GEOGRAPHY_PATH_INVALID`, `SOURCE_TOO_LARGE`, `JSON_INVALID`, `SCHEMA_INVALID` or `SOURCE_AMBIGUOUS`. A point within 0.003 map widths of a coast counts as land, so a river mouth or a port drawn on the shore does not fail on a simplified coastline; the error for an inland mouth reports its `inlandDistance` so it can be snapped.
135
135
 
136
- `FEATURE_IN_EDGE_BAND` marks land, plateaus, ranges, volcanoes, sites, passes and river points inside `max(192 pixels, 4% of the width)` east and west or 64 pixels north and south of the frame, because the game wraps the map horizontally. It is a warning, and an error when the request sets `edge.mode` to `sea-band` (`rim` and `none` skip it).
136
+ `FEATURE_IN_EDGE_BAND` marks land, plateaus, ranges, volcanoes, sites, passes and river points inside `max(192 pixels, 4% of the width)` east and west or 64 pixels north and south of the frame, because the game wraps the map horizontally. It is a warning, and an error when the request sets `edge.mode` to `sea-band` (`rim`, `wall` and `none` skip it).
137
137
 
138
138
  `geographyPath` follows the rules of `reference.imagePath`: relative paths inside the authorized mod workspace only; URLs, absolute paths, traversal, symlink and junction escapes are refused; the file is read once, its SHA-256 is taken from the bytes that are parsed, and a change after preparation blocks the write as stale. A file that is not JSON or does not match the schema is an error, not a partial preview. CI models are synthetic and project-owned.
139
139
 
@@ -169,7 +169,7 @@ Not synthesised yet: biomes, climate, fertility, tree and colour-map classes fro
169
169
 
170
170
  The linked JSON catalog contains every active province definition, state, and strategic region with resolved names, alternate localisation values, source paths and lines, raster bounds and centers, memberships, neighbors, victory points, resources, buildings, ports, supply nodes, railways, normal and special adjacencies, building positions, unit positions, weather positions, and entity locators. Large catalog and render data remain in MCP resources instead of filling the agent prompt.
171
171
 
172
- Use `query` for a compact name or ID result list and `coordinates` for exact pixel or map-coordinate lookup. Use `provinceIds`, `stateIds`, and `regionIds` for focused records. Up to 32 selected provinces can also produce exact geometry as maximal `[y, startX, endXExclusive]` row runs.
172
+ Use `query` for a compact name or ID result list and `coordinates` for exact pixel or map-coordinate lookup. Use `provinceIds`, `stateIds`, and `regionIds` for focused records. Up to 32 selected provinces can also produce exact geometry as maximal `[y, startX, endXExclusive]` row runs. When none of the requested ids exists, the call answers `MAP_ENTITY_ID_NOT_FOUND` with the highest id of each kind, before any validation or render. A selection with some known ids reports the unknown ones.
173
173
 
174
174
  Set `lookupOnly: true` for coordinate, query, and selected-ID lookups without full validation, the complete catalog artifact, overview rendering, or province geometry export. The lookup artifact contains only the requested matches and source revision. Use full inspection for allocation previews or province row runs.
175
175
 
@@ -626,15 +626,25 @@ Water that does not read as a lake is not written as one. Enclosed water below 6
626
626
 
627
627
  The engine wraps the map horizontally, so land that touches the first or last column is cut by a straight line where the world repeats. Without `edge` nothing changes and validation reports `MAP_EDGE_LAND_CUT` for such rows. With `edge`:
628
628
 
629
- | `edge` field | Default | Meaning |
630
- | ------------ | ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
631
- | `mode` | `sea-band` when `edge` is given | `sea-band` clears land from the east and west edges and the poles to open sea with a ragged outline; `rim` ends land at the seam in an impassable snow range; `none` opts out. |
632
- | `bandPx` | `max(192, 4% of the width)`, at most a quarter of the width | East and west sea band. |
633
- | `polarPx` | 64, at most a quarter of the height | North and south sea band. |
634
- | `rimPx` | 160, at most a quarter of the width | Width of the rim range for `rim`. Heights rise from 150 to 230, the colour map darkens and `adjacencies.csv` gets one `impassable` row per pair of land provinces across the seam. |
629
+ | `edge` field | Default | Meaning |
630
+ | ------------- | ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
631
+ | `mode` | `sea-band` when `edge` is given | `sea-band` clears land from the east and west edges and the poles to open sea with a ragged outline; `rim` ends land at the seam in an impassable snow range; `wall` closes the seam with impassable land over the full height; `none` opts out. |
632
+ | `bandPx` | `max(192, 4% of the width)`, at most a quarter of the width | East and west sea band. |
633
+ | `polarPx` | 64, at most a quarter of the height | North and south sea band; 0 lets land reach the top and bottom edges. |
634
+ | `rimPx` | 160 for `rim`, 48 for `wall`, at most a quarter of the width | Width of the rim range for `rim` or of the wall for `wall`. Heights rise from 150 to 230, the colour map darkens and `adjacencies.csv` gets one `impassable` row per pair of land provinces across the seam. |
635
+ | `wallTerrain` | `auto` | `wall` only: the look of the wall. `auto` takes, for each row and side, the terrain of the nearest land beyond the wall within four wall widths (snow where the land is snowy), or snow in the outer fifths of the map and mountain elsewhere where it meets only water, smoothed over about half a wall width of rows. A list of `{y0, y1, kind}` segments (rows from the top, inclusive; kind one of `snow`, `mountain`, `hills`, `desert`, `forest`, `plains`, `marsh`, `jungle`) sets it by rows; uncovered rows stay `auto`. |
635
636
 
636
637
  A band wider than a quarter of the world is refused (`MAP_EDGE_BAND_TOO_WIDE`). A city inside a band that would be cleared is an error (`MAP_EDGE_FEATURE_IN_BAND`) naming it; land that is cleared is reported with its pixel count (`MAP_EDGE_LAND_CLEARED`). `ambientFrame: true` writes the north and south frame borders and the logo frame into `ambient_object.txt` at the base map's positions scaled to the world height (the north frame at `z = height + 142`, the south frame at `z = -140`); by default the file is a comment, which drops the frame. The wrap cannot be removed with data; the band makes it invisible and the rim makes it a wall. Which looks better in the game is for you to judge with a probe map. Rivers are routed before the rim is raised, so keep them out of a rim.
637
638
 
639
+ A `rim` leaves sea at the seam as sea, and ships sail across it, because the sea at both edges is one connected sea and an `impassable` adjacency is only known to separate land provinces (the base game's 93 all do). `wall` closes the seam for armies and fleets alike:
640
+
641
+ - 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.
642
+ - 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.
643
+ - 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.
644
+ - 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.
645
+ - 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`.
646
+ - 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.
647
+
638
648
  ### Appearance validation
639
649
 
640
650
  `hoi4.map_inspect` and every `create_world` check the files that decide the look, for the files the mod ships: `heightmap.bmp`, `terrain.bmp`, `rivers.bmp`, `trees.bmp`, `cities.bmp`, `world_normal.bmp` and the colour maps. Format and size defects are errors; statistical deviations are warnings. Severities are set so the installed base game raises no error.
@@ -653,6 +663,7 @@ A band wider than a quarter of the world is refused (`MAP_EDGE_BAND_TOO_WIDE`).
653
663
  | `MAP_COLORMAP_RANGE`, `MAP_WATER_COLORMAP_FLAT` | warning | Land mean value outside 50 to 100, fewer than 400 distinct 5-bit colours or a deviation under 15; a flat water map. |
654
664
  | `MAP_NORMAL_SIZE`, `_NOT_UNIT`, `_RESPONSE`, `MAP_CITIES_SIZE`, `_INDEX_UNDEFINED` | error or warning | Normal map size and unit length, its response to the height step (the base game's is about 2.6) and the city map. |
655
665
  | `MAP_EDGE_LAND_CUT` | warning or error | Land on the first or last column; an error when the world was created with `sea-band`. |
666
+ | `MAP_EDGE_WALL_OPEN` | error | Water on the first or last column of a world created with `wall`. |
656
667
  | `MAP_SEAM_LAND_ADJACENCY`, `MAP_POLAR_LAND`, `MAP_COLORMAP_ALPHA_CITY` | info | Land provinces that meet across the seam (and how many are blocked), land in the top and bottom rows, city lights over water. |
657
668
 
658
669
  Not implemented: a check that river widths never narrow downstream (it needs a flow direction the file does not hold), and a mesh check for `trees.bmp` beyond the declared palette. Bitmaps are read in row strips and validation yields between strips, so a 13-million-pixel map stays cancellable and within memory.
package/docs/tools.md CHANGED
@@ -15,17 +15,20 @@ MCP clients may ask for approval to create review files.
15
15
 
16
16
  ## References and source
17
17
 
18
- | Tool | Purpose | Writes |
19
- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------ |
20
- | `hoi4.reference_context` | Get compact, cited wiki and installed documentation pointers for a modding surface. | — |
21
- | `hoi4.reference_search` | Search local documentation in plain words or script names; each result names its answering line. | — |
22
- | `hoi4.reference_read` | Read one revision-bound section: up to 80 lines (40 by default) and 8,000 bytes, with line continuation. | — |
23
- | `hoi4.source_lookup` | Find exact definitions, overrides and usages across game, DLC and mod, or the definition containing a file line. | — |
24
- | `hoi4.script_validate` | Check a snippet or a whole mod file for syntax, command kinds, and scopes against local documentation. | — |
25
- | `hoi4.error_log` | Group the game's `error.log` from its last launch by category, with the source file, line and layer, and whether that file changed since. | — |
26
- | `hoi4.mod_index` | Summarize the mod's descriptor and definitions, or find the next free numbered ID for an event namespace or prefix across every layer. | — |
27
- | `hoi4.localisation_inspect` | Read localisation in every language: one key per language with file, line and layer, or audit the mod for undefined, untranslated and duplicate keys and file problems. Runs on the Rust engine. | — |
28
- | `hoi4.idea_inspect` | Read an idea (picture, modifiers, conditions, name in every language, advisor) or a character (roles, traits, portraits), or audit every idea or character of the mod. Runs on the Rust engine. | — |
18
+ | Tool | Purpose | Writes |
19
+ | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
20
+ | `hoi4.reference_context` | Get compact, cited wiki and installed documentation pointers for a modding surface. | — |
21
+ | `hoi4.reference_search` | Search local documentation in plain words or script names; each result names its answering line. | — |
22
+ | `hoi4.reference_read` | Read one revision-bound section: up to 80 lines (40 by default) and 8,000 bytes, with line continuation. | — |
23
+ | `hoi4.source_lookup` | Find exact definitions, overrides and usages across game, DLC and mod, or the definition containing a file line. | — |
24
+ | `hoi4.script_validate` | Check a snippet or a whole mod file for syntax, command kinds, and scopes against local documentation. | — |
25
+ | `hoi4.error_log` | Group the game's `error.log` from its last launch by category, with the source file, line and layer, and whether that file changed since. | — |
26
+ | `hoi4.mod_index` | Summarize the mod's descriptor and definitions, or find the next free numbered ID for an event namespace or prefix across every layer. | — |
27
+ | `hoi4.localisation_inspect` | Read localisation in every language: one key per language with file, line and layer, or audit the mod for undefined, untranslated and duplicate keys and file problems. Runs on the Rust engine. | — |
28
+ | `hoi4.idea_inspect` | Read an idea (picture, modifiers, conditions, name in every language, advisor) or a character (roles, traits, portraits), or audit every idea or character of the mod. Runs on the Rust engine. | — |
29
+ | `hoi4.system_inspect` | Read one definition of a newer system (an on_actions hook, a MIO or policy, a balance of power, a special project, reward, specialization or tag, an operation, phase or token, a raid or raid category) with its parts, each reference and whether something defines it, pictures and names in every language, or audit every one the mod makes. Runs on the Rust engine. | — |
30
+ | `hoi4.unit_inspect` | Read an order of battle (templates on the designer grid, divisions, fleets, air wings), a sub-unit, equipment or module (slots, default modules, upgrades), or an equipment variant, with each name it uses and whether something defines it, or audit every one the mod makes. The audit also finds `oob` and `set_oob` names no history/units file has. Runs on the Rust engine. | — |
31
+ | `hoi4.asset_inspect` | Read a sprite (its texture with size, format and mipmaps, and its frames), a sound, sound effect, category or music track (its audio file and the sounds it plays), or a flag (all three sizes), or audit every one the mod defines. The flag audit also finds country tags without any flag. Runs on the Rust engine. | — |
29
32
 
30
33
  ## Focus trees
31
34
 
@@ -112,38 +115,41 @@ Every tool description in `tools/list` ends with a call like these, and an inval
112
115
  Fields not shown take their defaults; `workspaceId` is `"current"` unless you pass one.
113
116
  The CI stdio smoke suite sends each of these shapes to a real server process.
114
117
 
115
- | Tool | Example arguments |
116
- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
117
- | `hoi4.reference_context` | `{"surface":"event","question":"fire an event after a delay"}` |
118
- | `hoi4.reference_search` | `{"query":"add_timed_idea"}` |
119
- | `hoi4.reference_read` | `{"id":"<hit id>","revision":"<hit revision>"}` from a search or context hit |
120
- | `hoi4.source_lookup` | `{"symbol":"my_scripted_effect"}` or `{"path":"events/my_events.txt","line":42}` |
121
- | `hoi4.script_validate` | `{"source":"add_political_power = 10","kind":"effect","scope":"country"}` or `{"path":"events/my_events.txt"}` |
122
- | `hoi4.error_log` | `{"scope":"mod","category":"effect"}` |
123
- | `hoi4.mod_index` | `{"mode":"overview"}` or `{"mode":"next_id","kind":"event","namespace":"my_mod"}` |
124
- | `hoi4.localisation_inspect` | `{"mode":"key","key":"my_event.1.t"}` or `{"mode":"audit"}` |
125
- | `hoi4.idea_inspect` | `{"kind":"idea","id":"my_idea"}` or `{"kind":"character","audit":true}` |
126
- | `hoi4.focus_inspect` | `{"treeId":"my_focus_tree"}` |
127
- | `hoi4.focus_render` | `{"relativePath":"common/national_focus/my_tree.txt","treeId":"my_focus_tree"}` |
128
- | `hoi4.focus_rewrite` | `{"relativePath":"common/national_focus/my_tree.txt","treeId":"my_focus_tree","layoutMode":"compact"}` |
129
- | `hoi4.gui_inspect` | `{"windowName":"my_window"}` |
130
- | `hoi4.gui_render` | `{"windowName":"my_window","scenario":{"id":"normal"}}` |
131
- | `hoi4.gui_rewrite` | `{"mode":"helpers","relativePath":"interface/my_window.gui","windowName":"my_window","scenario":{"id":"normal"},"helper":{…}}` |
132
- | `hoi4.map_inspect` | `{"query":"Brandenburg","lookupOnly":true}` or `{"layer":"state","tile":{"x":2600,"y":500,"width":256,"height":256}}` |
133
- | `hoi4.map_rewrite` | `{"operations":[{"id":"s1","kind":"create_state","provinceIds":[120,121],"displayName":"New State"}]}` |
134
- | `hoi4.event_inspect` | `{"mode":"trace","selector":"my_mod.1","direction":"downstream"}` |
135
- | `hoi4.event_render` | `{"view":"overview","selector":"my_mod"}` |
136
- | `hoi4.tech_inspect` | `{"mode":"explain","technologyId":"my_tech"}` |
137
- | `hoi4.tech_render` | `{"view":"folder","folderId":"my_folder"}` |
138
- | `hoi4.probability_inspect` | `{"candidatePool":["my_decision"],"scenarioSet":[{"actor":"GER","state":{"has_war":false}}]}` |
139
- | `hoi4.probability_analyze` | `{"analysis":"sweep","source":"common/decisions/my_decisions.txt","candidatePool":["my_decision"],"scenarioSet":[{"actor":"GER","state":{"variable.pressure":10}}],"sweep":{"paths":["variable.pressure"],"steps":10}}` |
140
- | `hoi4.impact_inspect` | `{"symbols":[{"kind":"scripted_effect","id":"my_effect"}]}` |
141
- | `hoi4.decision_inspect` | `{"mode":"inspect","id":"my_decision","scenarios":[{"id":"base","actor":"GER","state":{}}]}` |
142
- | `hoi4.mechanic_test` | `{"test":{"id":"t","scenario":{…},"steps":[…],"assertions":[…]}}`, see [Mechanic tests](mechanics.md) |
143
- | `hoi4.package_check` | `{"manifest":{"schemaVersion":"1.0","id":"my_package","definitions":[{"kind":"scripted_effect","id":"my_effect"}]}}` |
144
- | `hoi4.scenario_test` | `{"suitePath":"tests/my_suite.json","maxCases":20}` |
145
- | `hoi4.job_inspect` | `{"jobId":"job_<64 hex characters>"}` from a native task id |
146
- | `hoi4.job_cancel` | `{"jobId":"job_<64 hex characters>"}` |
118
+ | Tool | Example arguments |
119
+ | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
120
+ | `hoi4.reference_context` | `{"surface":"event","question":"fire an event after a delay"}` |
121
+ | `hoi4.reference_search` | `{"query":"add_timed_idea"}` |
122
+ | `hoi4.reference_read` | `{"id":"<hit id>","revision":"<hit revision>"}` from a search or context hit |
123
+ | `hoi4.source_lookup` | `{"symbol":"my_scripted_effect"}` or `{"path":"events/my_events.txt","line":42}` |
124
+ | `hoi4.script_validate` | `{"source":"add_political_power = 10","kind":"effect","scope":"country"}` or `{"path":"events/my_events.txt"}` |
125
+ | `hoi4.error_log` | `{"scope":"mod","category":"effect"}` |
126
+ | `hoi4.mod_index` | `{"mode":"overview"}` or `{"mode":"next_id","kind":"event","namespace":"my_mod"}` |
127
+ | `hoi4.localisation_inspect` | `{"mode":"key","key":"my_event.1.t"}` or `{"mode":"audit"}` |
128
+ | `hoi4.idea_inspect` | `{"kind":"idea","id":"my_idea"}` or `{"kind":"character","audit":true}` |
129
+ | `hoi4.system_inspect` | `{"kind":"mio","id":"my_organization"}` or `{"kind":"on_actions","audit":true}` |
130
+ | `hoi4.unit_inspect` | `{"kind":"oob","id":"GER_1936"}` or `{"kind":"variant","audit":true}` |
131
+ | `hoi4.asset_inspect` | `{"kind":"sprite","id":"GFX_my_icon"}` or `{"kind":"flag","audit":true}` |
132
+ | `hoi4.focus_inspect` | `{"treeId":"my_focus_tree"}` |
133
+ | `hoi4.focus_render` | `{"relativePath":"common/national_focus/my_tree.txt","treeId":"my_focus_tree"}` |
134
+ | `hoi4.focus_rewrite` | `{"relativePath":"common/national_focus/my_tree.txt","treeId":"my_focus_tree","layoutMode":"compact"}` |
135
+ | `hoi4.gui_inspect` | `{"windowName":"my_window"}` |
136
+ | `hoi4.gui_render` | `{"windowName":"my_window","scenario":{"id":"normal"}}` |
137
+ | `hoi4.gui_rewrite` | `{"mode":"helpers","relativePath":"interface/my_window.gui","windowName":"my_window","scenario":{"id":"normal"},"helper":{"root":{"id":"my_window","kind":"column","name":"my_window","width":320,"height":200,"children":[]}}}` |
138
+ | `hoi4.map_inspect` | `{"query":"Brandenburg","lookupOnly":true}` or `{"layer":"state","tile":{"x":2600,"y":500,"width":256,"height":256}}` |
139
+ | `hoi4.map_rewrite` | `{"operations":[{"id":"s1","kind":"create_state","provinceIds":[120,121],"displayName":"New State"}]}` |
140
+ | `hoi4.event_inspect` | `{"mode":"trace","selector":"my_mod.1","direction":"downstream"}` |
141
+ | `hoi4.event_render` | `{"view":"overview","selector":"my_mod"}` |
142
+ | `hoi4.tech_inspect` | `{"mode":"explain","technologyId":"my_tech"}` |
143
+ | `hoi4.tech_render` | `{"view":"folder","folderId":"my_folder"}` |
144
+ | `hoi4.probability_inspect` | `{"candidatePool":["my_decision"],"scenarioSet":[{"actor":"GER","state":{"has_war":false}}]}` |
145
+ | `hoi4.probability_analyze` | `{"analysis":"sweep","source":"common/decisions/my_decisions.txt","candidatePool":["my_decision"],"scenarioSet":[{"actor":"GER","state":{"variable.pressure":10}}],"sweep":{"paths":["variable.pressure"],"steps":10}}` |
146
+ | `hoi4.impact_inspect` | `{"symbols":[{"kind":"scripted_effect","id":"my_effect"}]}` |
147
+ | `hoi4.decision_inspect` | `{"mode":"inspect","id":"my_decision","scenarios":[{"id":"base","actor":"GER","state":{}}]}` |
148
+ | `hoi4.mechanic_test` | `{"test":{"id":"t","scenario":{"schemaVersion":"1.0","id":"t","state":{}},"steps":[{"kind":"effect","source":{"kind":"scripted_effect","id":"e"}}],"assertions":[{"id":"a","kind":"conservation","paths":[{"key":"x"},{"key":"y"}]}]}}`, see [Mechanic tests](mechanics.md) |
149
+ | `hoi4.package_check` | `{"manifest":{"schemaVersion":"1.0","id":"my_package","definitions":[{"kind":"scripted_effect","id":"my_effect"}]}}` |
150
+ | `hoi4.scenario_test` | `{"suitePath":"tests/my_suite.json","maxCases":20}` |
151
+ | `hoi4.job_inspect` | `{"jobId":"job_<64 hex characters>"}` from a native task id |
152
+ | `hoi4.job_cancel` | `{"jobId":"job_<64 hex characters>"}` |
147
153
 
148
154
  ## Result sizes
149
155
 
package/engine/README.md CHANGED
@@ -39,6 +39,9 @@ hoi4-engine drawio sketch.drawio --prefix GER
39
39
  hoi4-engine focus-layout --request request.json
40
40
  hoi4-engine localisation --request request.json
41
41
  hoi4-engine ideas --request request.json
42
+ hoi4-engine system --request request.json
43
+ hoi4-engine units --request request.json
44
+ hoi4-engine assets --request request.json
42
45
  hoi4-engine texture <file or folder>... [--format text|json] [--output out.png]
43
46
  hoi4-engine focus-render [--game DIR] [--mod DIR] [--dependency DIR]... --output out.png [--request FILE]
44
47
  hoi4-engine serve
@@ -53,6 +56,12 @@ and writes its answer to stdout. It backs `hoi4.localisation_inspect`; see `crat
53
56
 
54
57
  `ideas` reads one JSON request with `game`, `mod`, `dependencies`, `includeDlc`, `kind` (`idea` or `character`), `id` or `audit`, and `limit`. It backs `hoi4.idea_inspect`; see `crates/engine/src/ideas.rs`.
55
58
 
59
+ `system` reads one JSON request with `game`, `mod`, `dependencies`, `includeDlc`, `kind` (`on_actions`, `mio`, `balance_of_power`, `special_project`, `operation` or `raid`), `id` or `audit`, and `limit`. It backs `hoi4.system_inspect`; see `crates/engine/src/system.rs`.
60
+
61
+ `units` reads the same request with `kind` `oob`, `sub_unit`, `equipment` (equipment and modules) or `variant`. It backs `hoi4.unit_inspect`; see `crates/engine/src/system/units.rs`.
62
+
63
+ `assets` reads the same request with `kind` `sprite`, `sound` (sounds, sound effects, categories and music) or `flag`. It backs `hoi4.asset_inspect`; see `crates/engine/src/assets.rs`.
64
+
56
65
  `--game` defaults to the `HOI4_GAME_DIR` environment variable. Without `--mod` the game itself is
57
66
  checked. `--dependency` adds a mod loaded before the checked one; repeat it in load order.
58
67
 
Binary file
Binary file
Binary file