{"_id":"@civ-clone/core-strategy-ai-client","_rev":"3-842d8ccef3e4ffce55ca825b3f5fc143","name":"@civ-clone/core-strategy-ai-client","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@civ-clone/core-strategy-ai-client","version":"0.1.0","keywords":["typescript","civilization"],"author":{"name":"dom111","email":"dom111@users.noreply.github.com"},"license":"MIT","_id":"@civ-clone/core-strategy-ai-client@0.1.0","maintainers":[{"name":"dom111","email":"npm@dom111.co.uk"}],"homepage":"https://github.com/civ-clone/core-strategy-ai-client#readme","bugs":{"url":"https://github.com/civ-clone/core-strategy-ai-client/issues"},"dist":{"shasum":"1f00802d39cc33897ad6caff4ad970a74edcba2c","tarball":"https://registry.npmjs.org/@civ-clone/core-strategy-ai-client/-/core-strategy-ai-client-0.1.0.tgz","fileCount":24,"integrity":"sha512-xJksjMZQz2Ig66B2JzaaXKkx8RaH9Fmjv8/Xi59U89BdqkL9E1GsQkgM9x9cqyd56XkR6p2CgfRyJVNfKgmhSQ==","signatures":[{"sig":"MEQCICHV1O7QeNWzkV2fU5yoGZm9zPpgbqK+IesEWzxzOM0+AiAqvZkGaqZ5n9874YLoJcAHzwJ6nqbRNgaBVPE9pd3Zgw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":11443,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTbb8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpmfBAAlMnyhbA0PANpUwgVaBo0PoaiMwRF66N7S6THHrbdXISVoF+M\r\nUqf47j90CQAzEROPK9+HhaLXlvJlqHfggmb16q1wOwEM6lzASV3Oc6FqWAQ/\r\n1quj8xOsQorUGdza7T5dzZ1FXTKxPnk6e30CCxtVyNpEyzUpVdH96tvjtGRL\r\nDwtarFZxW4eUz6cDyWDbcqqSHDNTyB+VwrkVv95mbdAjtD2iKwpzs0tYTUr6\r\nM84j0/v6PtxvcZj3YfkldvpLCzG99NYGdx2oqauLT9NqqaA/rhNNJwd7WgNa\r\nU+65Pu8bdtXuevhsvpbiXljTtohLT4Wcaf4nJy+qITOuFWj/QAzuQi+QkDW6\r\ntVHaTMK3uZmxYNFXG2yB+AI5gC2nnk6QEyfX5iSEjEXoaZbaIyZ4cjmnOBlH\r\nQKf8ErSktKMJUwhnLbDbcxFSVg0MusFKXmSXK7sS4KIlQ4wSVFWvnlyLTsTq\r\nWZN1Xmzym3qnKiyUrGWXYjGVrKEJy9WmawRGEo0b8imT3KOGA2/GW2bQLHG+\r\nswK3jf1SeL9ychkmhxOFI0XKMpJohOfDh01NwR6adeH1KlW7CJ99SnePfM83\r\n2CVhykshsUHKsH2tVi/QIBdfQE+o32IHylDVAIDC0zDBKDZ5PcgrYdWX09ys\r\nGGj+X0nGkt0TlCMGguxhHc8eP/Bpn0CBd1c=\r\n=lB4F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","types":"./index.d.ts","gitHead":"eaf224dd43ea0571f88134d63ba3efc3b999478b","private":false,"scripts":{"build":"npm run ts:compile && npm run prettier:format","ts:compile":"tsc --build tsconfig.json","prettier:check":"prettier --config .prettierrc '**/*.ts'","prettier:format":"prettier --config .prettierrc '**/*.ts' --write"},"_npmUser":{"name":"dom111","email":"npm@dom111.co.uk"},"repository":{"url":"git+ssh://git@github.com/civ-clone/core-strategy-ai-client.git","type":"git"},"_npmVersion":"8.19.1","description":"A simple[1] AI[2] client, that makes use of `Strategy`s and `Routine`s to be an extensible opponent client.","directories":{},"_nodeVersion":"18.1.0","dependencies":{"@civ-clone/core-player":"^0.1.4","@civ-clone/core-strategy":"^0.1.0","@civ-clone/core-ai-client":"^0.1.0","@civ-clone/core-civilization":"^0.1.1"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^2.1","typescript":"^4.0","@types/node":"^16.0"},"_npmOperationalInternal":{"tmp":"tmp/core-strategy-ai-client_0.1.0_1666037500095_0.6783564107471298","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"@civ-clone/core-strategy-ai-client","version":"0.1.1","keywords":["typescript","civilization"],"author":{"name":"dom111","email":"dom111@users.noreply.github.com"},"license":"MIT","_id":"@civ-clone/core-strategy-ai-client@0.1.1","maintainers":[{"name":"dom111","email":"npm@dom111.co.uk"}],"homepage":"https://github.com/civ-clone/core-strategy-ai-client#readme","bugs":{"url":"https://github.com/civ-clone/core-strategy-ai-client/issues"},"dist":{"shasum":"9e602232c190df2e2546518e1f4bc8c3c837dd91","tarball":"https://registry.npmjs.org/@civ-clone/core-strategy-ai-client/-/core-strategy-ai-client-0.1.1.tgz","fileCount":24,"integrity":"sha512-hJjpiz8CjtrhuhyvXmMfnrGILakUu9JGLqitYyEskZEcgfv7eXGamDhvH50rJFiBdYBiYiIHakGsF+3JLtn2Eg==","signatures":[{"sig":"MEQCIFYNmxhtnnB4lr3sZdmihqBGr9q9P2NNU5AFUi0i1JyCAiA5NwXDsCKLUwH1IMiXrZtjf1+07jeOWNMnc7LwJzVTCg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":12278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTce/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoz+RAAnkjPRJBMlFS+xTbx/vBTHAgh6YJ2+VOuzo9kULtnBlDjdZix\r\n5n6drA9bhJtXR1OPrWAXiHEwemWEdKiyGjQ9H5+lx/i5VOpGngNDGyu/ekkY\r\nLryKdrO5griDxT74GCPs6t3De3b6TUj7RD2BNiUBexBf1I/QbRvGz3jOGT7I\r\nRLthjuafvKwtMX8Ne5ii4AK8CxbIkRoBt1bvSwKXInUfEMKjF8EX5f7+ux7/\r\nc8FTcW5VTdtTcnKdMn7CaiTxfQ1TUT+vRru6jYV1JzLPolCR7CuUBhK3kjQP\r\nj1aIMLN4shRlc4rfUxjEptLps4SaCIZ6Wl+G7d+7uUQ5c6NWyVy7WWpagaRd\r\n/kGAkc72HaGUsc4RpgSRj+/DQ839SdG7y6cUi0CPb/5oMVLW5eUW466PUaQb\r\ntpzsQ3NswfoETT7/FeuUTL0p6jp/pK/NUWG50anN5fwXIKKmDSX85STjPHkH\r\nHfiko22u/v1M3+5VlBLUh5rWzTxpw0R3KMt22xSOmIMc/Rd2q0t6Q8QN7xEo\r\nqi2c8Km0RGlwcVOvKvoy3CsHKHk7lPMormhiAYfUKcNZ/R/4VVV16txqrnqb\r\n08Yq5N6NJsYYrFoccVGAFid+MHt1gP2hqySEoxqx9fs2QZ87gHcWzRlM+qGE\r\nQS+COiGNTchHvALrtxK/wkKqBGY9GN9Vg2U=\r\n=6jP0\r\n-----END PGP SIGNATURE-----\r\n"},"types":"./index.d.ts","gitHead":"bcb7b48759ceba1db82b7bb5108b9826ecbc15f0","private":false,"scripts":{"build":"npm run ts:compile && npm run prettier:format","ts:compile":"tsc --build tsconfig.json","prettier:check":"prettier --config .prettierrc '**/*.ts'","prettier:format":"prettier --config .prettierrc '**/*.ts' --write"},"_npmUser":{"name":"dom111","email":"npm@dom111.co.uk"},"repository":{"url":"git+ssh://git@github.com/civ-clone/core-strategy-ai-client.git","type":"git"},"_npmVersion":"8.19.1","description":"A simple[1] AI[2] client, that makes use of `Strategy`s and `Routine`s to be an extensible opponent client.","directories":{},"_nodeVersion":"18.1.0","dependencies":{"@civ-clone/core-player":"^0.1.4","@civ-clone/core-strategy":"^0.1.0","@civ-clone/core-ai-client":"^0.1.0","@civ-clone/core-data-object":"^0.1.9","@civ-clone/core-civilization":"^0.1.1"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^2.1","typescript":"^4.0","@types/node":"^16.0"},"_npmOperationalInternal":{"tmp":"tmp/core-strategy-ai-client_0.1.1_1666041791515_0.8373340118944401","host":"s3://npm-registry-packages"}},"0.1.2":{"_id":"@civ-clone/core-strategy-ai-client@0.1.2","bugs":{"url":"https://github.com/civ-clone/core-strategy-ai-client/issues"},"dist":{"shasum":"fab72434e1ef4b7e862a32dd8bc28b325f82cc9b","tarball":"https://registry.npmjs.org/@civ-clone/core-strategy-ai-client/-/core-strategy-ai-client-0.1.2.tgz","fileCount":37,"integrity":"sha512-DT/9dZda0vwmEhS1R8Ogc1sXF8Mw6o0uZxYB+HbzFD86z13DXB8ccCSKd42q7RjR5z9UwPE4aGNHjkDbsrAgjA==","signatures":[{"sig":"MEQCIAsdGIHeRdkxqQxL382BV9oQ42a9LmjP4qKDDPc6f52mAiAbNdpu4bJFJCxmvONMGZpr3y/TtlaqWjgmLGSx11SCyQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHupixhQqaJJ88SD1Fga94/wBffnGiOReGZsEyFk2ymcAiA8DoOX0S9+pTPR1TAubyxzd2W3ibtIAlh1bu/nBElMGQ=="}],"unpackedSize":56071},"name":"@civ-clone/core-strategy-ai-client","types":"./index.d.ts","author":{"name":"dom111","email":"dom111@users.noreply.github.com"},"gitHead":"0ea088a9c380af43098dcc15532a0b03873be89f","license":"MIT","private":false,"scripts":{"test":"ts-mocha ./tests/*.test.ts","build":"npm run ts:compile && npm run prettier:format","ts:compile":"tsc --build tsconfig.json","test:coverage":"c8 ts-mocha ./tests/*.test.ts","prettier:check":"prettier --config .prettierrc --check '**/*.ts'","prettier:format":"prettier --config .prettierrc '**/*.ts' --write"},"version":"0.1.2","_npmUser":{"name":"dom111","email":"npm@dom111.co.uk"},"homepage":"https://github.com/civ-clone/core-strategy-ai-client#readme","keywords":["typescript","civilization"],"repository":{"url":"git+ssh://git@github.com/civ-clone/core-strategy-ai-client.git","type":"git"},"_npmVersion":"11.19.0","description":"A simple[1] AI[2] client, that makes use of `Strategy`s to be an extensible opponent client.","directories":{},"maintainers":[{"name":"dom111","email":"npm@dom111.co.uk"}],"_nodeVersion":"24.21.0","dependencies":{"@civ-clone/core-client":"^0.1.4","@civ-clone/core-player":"^0.1.4","@civ-clone/core-random":"^0.1.1","@civ-clone/core-strategy":"^0.1.6","@civ-clone/core-ai-client":"^0.1.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^7.0","chai":"^4.0","mocha":"^9.0","prettier":"^2.1","ts-mocha":"^9.0","chai-spies":"^1.0","typescript":"^4.0","@types/chai":"^4.0","@types/node":"^16.0","@types/mocha":"^9.0","@types/chai-spies":"^1.0","@civ-clone/core-rule":"^0.1.1","@civ-clone/core-civilization":"^0.1.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core-strategy-ai-client_0.1.2_1790793097800_0.11841027349658395"}}},"time":{"created":"2022-10-17T20:11:39.982Z","modified":"2026-09-30T18:31:38.139Z","0.1.0":"2022-10-17T20:11:40.285Z","0.1.1":"2022-10-17T21:23:11.691Z","0.1.2":"2026-09-30T18:31:37.888Z"},"bugs":{"url":"https://github.com/civ-clone/core-strategy-ai-client/issues"},"author":{"name":"dom111","email":"dom111@users.noreply.github.com"},"license":"MIT","homepage":"https://github.com/civ-clone/core-strategy-ai-client#readme","keywords":["typescript","civilization"],"repository":{"url":"git+ssh://git@github.com/civ-clone/core-strategy-ai-client.git","type":"git"},"description":"A simple[1] AI[2] client, that makes use of `Strategy`s to be an extensible opponent client.","maintainers":[{"name":"dom111","email":"npm@dom111.co.uk"}],"readme":"# core-strategy-ai-client\n\nA simple[1] AI[2] client, that makes use of `Strategy`s to be an extensible opponent client.\n\nThe aims behind `core-strategy` are to continue to have a system that can be tweaked as needed, e.g. when adding\nreligion to the game, you'd need to handle those events, and instead of modifying the core with optional extensions,\nembracing the plugin mechanism to add a plugin pack that includes the relevant `Strategy`s.\n\n`StrategyAIClient` knows nothing about any ruleset. Each turn it:\n\n1. offers a `BeforeTurn` action to every `Strategy` that handles it (`StrategyRegistry.attemptAll`);\n2. takes the player's mandatory actions one at a time (`player.hasMandatoryActions()`, then\n   `player.mandatoryAction()`) and offers each to the `StrategyRegistry` until one `Strategy` handles it. The turn ends\n   at the first action nothing handles, which is normally the engine's end-turn action;\n3. offers an `AfterTurn` action to every `Strategy` that handles it.\n\nEach is awaited before the next, so a turn is deterministic. Non-mandatory actions are not offered.\n\n`chooseFromList` is offered to the `Strategy`s as a `ChooseFromList` action: a `Strategy` calls `choose()` on its value\nand returns `true`. If none does, the client picks at random, as `Client` does.\n\nA subclass can override these hooks:\n\n- `unhandledAction(action)`: called with the action that ended the turn. Does nothing by default.\n- `actionFailed(action, error)`: called when a `Strategy` throws. Return `true` to carry on with the next action, `false`\n  to end the turn, or throw to fail it. Rethrows by default.\n- `actionLimit()` and `actionLimitReached(action)`: a guard against a `Strategy` that keeps claiming an action without\n  dealing with it. Once more than `actionLimit()` (1,000) actions have been offered, `actionLimitReached` is called\n  and the turn ends.\n\nSee [core-strategy](https://github.com/civ-clone/core-strategy) for how to write a `Strategy`.\n\n[1]: \"Simple\". It's not intended to be complex, but inevitably could end up so.\n[2]: CPU player? It's not ML-based... Yet?\n","readmeFilename":"README.md"}