@plasius/ai-game 0.6.2 → 0.6.3
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 +16 -0
- package/README.md +23 -0
- package/dist/index.cjs +278 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +119 -1
- package/dist/index.d.ts +119 -1
- package/dist/index.js +263 -0
- package/dist/index.js.map +1 -1
- package/docs/adrs/adr-0018-apprenticeship-handoff-contract-boundary.md +58 -0
- package/docs/adrs/index.md +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/)**, and this project adheres to **[Semantic Versioning](https://semver.org/spec/v2.0.0.html)**.
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
- **Added**
|
|
9
|
+
- (placeholder)
|
|
10
|
+
|
|
11
|
+
- **Changed**
|
|
12
|
+
- (placeholder)
|
|
13
|
+
|
|
14
|
+
- **Fixed**
|
|
15
|
+
- (placeholder)
|
|
16
|
+
|
|
17
|
+
- **Security**
|
|
18
|
+
- (placeholder)
|
|
19
|
+
|
|
20
|
+
## [0.6.3] - 2026-07-11
|
|
21
|
+
|
|
8
22
|
- **Added**
|
|
9
23
|
- (placeholder)
|
|
10
24
|
|
|
@@ -52,6 +66,7 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
|
|
|
52
66
|
- **Added**
|
|
53
67
|
- Added observed-event log, recency-window, highlight-summary, and gossip-export contracts under `isekai.player-system.logs.enabled`.
|
|
54
68
|
- Added defensive validation and immutable factories so gossip highlights can only reference the observed events in their source window.
|
|
69
|
+
- Added apprenticeship sponsorship, supervision, readiness, and request-only handoff contracts for spellcraft, item-crafting, and dungeon-crafting under `isekai.training.apprenticeship.enabled`.
|
|
55
70
|
|
|
56
71
|
- **Changed**
|
|
57
72
|
- (placeholder)
|
|
@@ -262,3 +277,4 @@ The format is based on **[Keep a Changelog](https://keepachangelog.com/en/1.1.0/
|
|
|
262
277
|
[0.6.0]: https://github.com/Plasius-LTD/ai-game/releases/tag/v0.6.0
|
|
263
278
|
[0.6.1]: https://github.com/Plasius-LTD/ai-game/releases/tag/v0.6.1
|
|
264
279
|
[0.6.2]: https://github.com/Plasius-LTD/ai-game/releases/tag/v0.6.2
|
|
280
|
+
[0.6.3]: https://github.com/Plasius-LTD/ai-game/releases/tag/v0.6.3
|
package/README.md
CHANGED
|
@@ -232,6 +232,28 @@ npm run test:coverage
|
|
|
232
232
|
npm run pack:check
|
|
233
233
|
```
|
|
234
234
|
|
|
235
|
+
## Apprenticeship handoff contracts
|
|
236
|
+
|
|
237
|
+
The apprenticeship bridge is enabled by `isekai.training.apprenticeship.enabled`
|
|
238
|
+
and keeps authority separated across the Player System, training, and crafting
|
|
239
|
+
contexts.
|
|
240
|
+
|
|
241
|
+
- `createAiGameApprenticeshipSponsorship` models the institution and sponsor
|
|
242
|
+
relationship using opaque subject identifiers and bounded scope codes.
|
|
243
|
+
- `createAiGameApprenticeshipSupervision` models direct, delegated, or milestone
|
|
244
|
+
supervision and its checkpoints.
|
|
245
|
+
- `createAiGameApprenticeshipReadiness` carries trust, MCC track, and prerequisite
|
|
246
|
+
evidence. A `ready` record cannot contain unmet prerequisites.
|
|
247
|
+
- `createAiGameApprenticeshipHandoff` emits request-only payloads for
|
|
248
|
+
`spellcraft-system`, `item-crafting-system`, or `dungeon-crafting-system`,
|
|
249
|
+
and only accepts a `ready` readiness state.
|
|
250
|
+
|
|
251
|
+
The Player System may guide and route a request, but the target system remains
|
|
252
|
+
authoritative for validation, authorization, execution, and outcome. Handoff
|
|
253
|
+
payloads contain no secrets or hidden System state. See
|
|
254
|
+
[ADR-0018](./docs/adrs/adr-0018-apprenticeship-handoff-contract-boundary.md)
|
|
255
|
+
for the boundary and rollback rules.
|
|
256
|
+
|
|
235
257
|
## Feature flags
|
|
236
258
|
|
|
237
259
|
- `ai.game.event-recorder.contracts.enabled`
|
|
@@ -250,6 +272,7 @@ npm run pack:check
|
|
|
250
272
|
- `isekai.training.institutions.enabled`
|
|
251
273
|
- `isekai.training.academies.enabled`
|
|
252
274
|
- `isekai.training.martial.enabled`
|
|
275
|
+
- `isekai.training.apprenticeship.enabled`
|
|
253
276
|
|
|
254
277
|
## Governance
|
|
255
278
|
|
package/dist/index.cjs
CHANGED
|
@@ -21,6 +21,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
AI_GAME_ACTOR_ROLES: () => AI_GAME_ACTOR_ROLES,
|
|
24
|
+
AI_GAME_APPRENTICESHIP_CONTRACT_VERSION: () => AI_GAME_APPRENTICESHIP_CONTRACT_VERSION,
|
|
25
|
+
AI_GAME_APPRENTICESHIP_FEATURE_FLAG_ID: () => AI_GAME_APPRENTICESHIP_FEATURE_FLAG_ID,
|
|
26
|
+
AI_GAME_APPRENTICESHIP_GUIDANCE_OWNER: () => AI_GAME_APPRENTICESHIP_GUIDANCE_OWNER,
|
|
27
|
+
AI_GAME_APPRENTICESHIP_HANDOFF_COMMITMENT: () => AI_GAME_APPRENTICESHIP_HANDOFF_COMMITMENT,
|
|
28
|
+
AI_GAME_APPRENTICESHIP_HANDOFF_INTENTS: () => AI_GAME_APPRENTICESHIP_HANDOFF_INTENTS,
|
|
29
|
+
AI_GAME_APPRENTICESHIP_HANDOFF_KINDS: () => AI_GAME_APPRENTICESHIP_HANDOFF_KINDS,
|
|
30
|
+
AI_GAME_APPRENTICESHIP_HANDOFF_TARGETS: () => AI_GAME_APPRENTICESHIP_HANDOFF_TARGETS,
|
|
31
|
+
AI_GAME_APPRENTICESHIP_READINESS_STATES: () => AI_GAME_APPRENTICESHIP_READINESS_STATES,
|
|
32
|
+
AI_GAME_APPRENTICESHIP_SPONSORSHIP_STATUSES: () => AI_GAME_APPRENTICESHIP_SPONSORSHIP_STATUSES,
|
|
33
|
+
AI_GAME_APPRENTICESHIP_SUPERVISION_MODES: () => AI_GAME_APPRENTICESHIP_SUPERVISION_MODES,
|
|
24
34
|
AI_GAME_ENV_PREFIX: () => AI_GAME_ENV_PREFIX,
|
|
25
35
|
AI_GAME_EVENT_CONTRACTS_FEATURE_FLAG_ID: () => AI_GAME_EVENT_CONTRACTS_FEATURE_FLAG_ID,
|
|
26
36
|
AI_GAME_EVENT_INGESTION_FEATURE_FLAG_ID: () => AI_GAME_EVENT_INGESTION_FEATURE_FLAG_ID,
|
|
@@ -146,6 +156,10 @@ __export(index_exports, {
|
|
|
146
156
|
assertAiGameObservedEventLogContractVersion: () => assertAiGameObservedEventLogContractVersion,
|
|
147
157
|
classifyAiGameTask: () => classifyAiGameTask,
|
|
148
158
|
createAiGameAcademicTrainingSnapshot: () => createAiGameAcademicTrainingSnapshot,
|
|
159
|
+
createAiGameApprenticeshipHandoff: () => createAiGameApprenticeshipHandoff,
|
|
160
|
+
createAiGameApprenticeshipReadiness: () => createAiGameApprenticeshipReadiness,
|
|
161
|
+
createAiGameApprenticeshipSponsorship: () => createAiGameApprenticeshipSponsorship,
|
|
162
|
+
createAiGameApprenticeshipSupervision: () => createAiGameApprenticeshipSupervision,
|
|
149
163
|
createAiGameGossipExport: () => createAiGameGossipExport,
|
|
150
164
|
createAiGameIdentityProjectionContract: () => createAiGameIdentityProjectionContract,
|
|
151
165
|
createAiGameIdentitySelfProjection: () => createAiGameIdentitySelfProjection,
|
|
@@ -195,6 +209,7 @@ __export(index_exports, {
|
|
|
195
209
|
getAiGamePlayerSystemFocusModeContract: () => getAiGamePlayerSystemFocusModeContract,
|
|
196
210
|
getAiGamePlayerSystemGuidanceFallbackContract: () => getAiGamePlayerSystemGuidanceFallbackContract,
|
|
197
211
|
getAiGamePlayerSystemModuleContract: () => getAiGamePlayerSystemModuleContract,
|
|
212
|
+
isAiGameApprenticeshipReadinessState: () => isAiGameApprenticeshipReadinessState,
|
|
198
213
|
isAiGameGossipExportAudience: () => isAiGameGossipExportAudience,
|
|
199
214
|
isAiGameIdentityKnowledgeState: () => isAiGameIdentityKnowledgeState,
|
|
200
215
|
isAiGameIdentityProjectionRead: () => isAiGameIdentityProjectionRead,
|
|
@@ -2313,6 +2328,254 @@ function createAiGameTutorialTrack(input) {
|
|
|
2313
2328
|
});
|
|
2314
2329
|
}
|
|
2315
2330
|
|
|
2331
|
+
// src/apprenticeship-handoffs.ts
|
|
2332
|
+
var AI_GAME_APPRENTICESHIP_FEATURE_FLAG_ID = "isekai.training.apprenticeship.enabled";
|
|
2333
|
+
var AI_GAME_APPRENTICESHIP_CONTRACT_VERSION = "1.0";
|
|
2334
|
+
var AI_GAME_APPRENTICESHIP_SPONSORSHIP_STATUSES = [
|
|
2335
|
+
"proposed",
|
|
2336
|
+
"active",
|
|
2337
|
+
"suspended",
|
|
2338
|
+
"completed",
|
|
2339
|
+
"revoked"
|
|
2340
|
+
];
|
|
2341
|
+
var AI_GAME_APPRENTICESHIP_SUPERVISION_MODES = [
|
|
2342
|
+
"direct",
|
|
2343
|
+
"delegated",
|
|
2344
|
+
"milestone"
|
|
2345
|
+
];
|
|
2346
|
+
var AI_GAME_APPRENTICESHIP_READINESS_STATES = [
|
|
2347
|
+
"ready",
|
|
2348
|
+
"needs-prerequisites",
|
|
2349
|
+
"institution-gated",
|
|
2350
|
+
"supervision-required",
|
|
2351
|
+
"blocked"
|
|
2352
|
+
];
|
|
2353
|
+
var AI_GAME_APPRENTICESHIP_HANDOFF_TARGETS = [
|
|
2354
|
+
"spellcraft-system",
|
|
2355
|
+
"item-crafting-system",
|
|
2356
|
+
"dungeon-crafting-system"
|
|
2357
|
+
];
|
|
2358
|
+
var AI_GAME_APPRENTICESHIP_HANDOFF_KINDS = [
|
|
2359
|
+
"spellcraft",
|
|
2360
|
+
"item-crafting",
|
|
2361
|
+
"dungeon-crafting"
|
|
2362
|
+
];
|
|
2363
|
+
var AI_GAME_APPRENTICESHIP_HANDOFF_INTENTS = [
|
|
2364
|
+
"learn",
|
|
2365
|
+
"practice",
|
|
2366
|
+
"refine",
|
|
2367
|
+
"commission"
|
|
2368
|
+
];
|
|
2369
|
+
var AI_GAME_APPRENTICESHIP_HANDOFF_COMMITMENT = "request-only";
|
|
2370
|
+
var AI_GAME_APPRENTICESHIP_GUIDANCE_OWNER = "player-system";
|
|
2371
|
+
function freezeReadonlyArray8(items) {
|
|
2372
|
+
return Object.freeze([...items]);
|
|
2373
|
+
}
|
|
2374
|
+
function assertNonEmptyString8(value, label) {
|
|
2375
|
+
if (value.trim().length === 0) {
|
|
2376
|
+
throw new Error(`${label} must be a non-empty string`);
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
function assertIsoTimestamp4(value, label) {
|
|
2380
|
+
assertNonEmptyString8(value, label);
|
|
2381
|
+
if (Number.isNaN(Date.parse(value))) {
|
|
2382
|
+
throw new Error(`${label} must be an ISO-8601 timestamp`);
|
|
2383
|
+
}
|
|
2384
|
+
}
|
|
2385
|
+
function assertIsoTimestampOrNull2(value, label) {
|
|
2386
|
+
if (value !== null) {
|
|
2387
|
+
assertIsoTimestamp4(value, label);
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
function assertContractVersion7(value) {
|
|
2391
|
+
if (value !== AI_GAME_APPRENTICESHIP_CONTRACT_VERSION) {
|
|
2392
|
+
throw new Error(
|
|
2393
|
+
`contractVersion must be ${AI_GAME_APPRENTICESHIP_CONTRACT_VERSION}`
|
|
2394
|
+
);
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
function assertMember(value, values, label) {
|
|
2398
|
+
if (!values.includes(value)) {
|
|
2399
|
+
throw new Error(`${label} must be a supported apprenticeship value`);
|
|
2400
|
+
}
|
|
2401
|
+
}
|
|
2402
|
+
function createStringArray5(values, label) {
|
|
2403
|
+
values.forEach((value) => assertNonEmptyString8(value, `${label} entry`));
|
|
2404
|
+
return freezeReadonlyArray8(values);
|
|
2405
|
+
}
|
|
2406
|
+
function assertHandoffBase(input) {
|
|
2407
|
+
assertNonEmptyString8(input.handoffId, "handoffId");
|
|
2408
|
+
assertNonEmptyString8(input.requestId, "requestId");
|
|
2409
|
+
assertNonEmptyString8(input.apprenticeshipId, "apprenticeshipId");
|
|
2410
|
+
assertNonEmptyString8(input.sponsorshipId, "sponsorshipId");
|
|
2411
|
+
assertNonEmptyString8(input.supervisionId, "supervisionId");
|
|
2412
|
+
assertNonEmptyString8(input.readinessId, "readinessId");
|
|
2413
|
+
if (input.readinessState !== "ready") {
|
|
2414
|
+
throw new Error("readinessState must be ready for an apprenticeship handoff");
|
|
2415
|
+
}
|
|
2416
|
+
assertNonEmptyString8(input.apprenticeSubjectId, "apprenticeSubjectId");
|
|
2417
|
+
assertNonEmptyString8(input.disciplineCode, "disciplineCode");
|
|
2418
|
+
assertMember(
|
|
2419
|
+
input.intent,
|
|
2420
|
+
AI_GAME_APPRENTICESHIP_HANDOFF_INTENTS,
|
|
2421
|
+
"intent"
|
|
2422
|
+
);
|
|
2423
|
+
assertIsoTimestamp4(input.requestedAtIso, "requestedAtIso");
|
|
2424
|
+
}
|
|
2425
|
+
function isAiGameApprenticeshipReadinessState(value) {
|
|
2426
|
+
return AI_GAME_APPRENTICESHIP_READINESS_STATES.includes(value);
|
|
2427
|
+
}
|
|
2428
|
+
function createAiGameApprenticeshipSponsorship(input) {
|
|
2429
|
+
assertContractVersion7(input.contractVersion ?? AI_GAME_APPRENTICESHIP_CONTRACT_VERSION);
|
|
2430
|
+
assertNonEmptyString8(input.sponsorshipId, "sponsorshipId");
|
|
2431
|
+
assertNonEmptyString8(input.apprenticeSubjectId, "apprenticeSubjectId");
|
|
2432
|
+
assertNonEmptyString8(input.sponsorSubjectId, "sponsorSubjectId");
|
|
2433
|
+
assertNonEmptyString8(input.institutionId, "institutionId");
|
|
2434
|
+
assertNonEmptyString8(input.disciplineCode, "disciplineCode");
|
|
2435
|
+
assertMember(
|
|
2436
|
+
input.status,
|
|
2437
|
+
AI_GAME_APPRENTICESHIP_SPONSORSHIP_STATUSES,
|
|
2438
|
+
"status"
|
|
2439
|
+
);
|
|
2440
|
+
assertIsoTimestamp4(input.issuedAtIso, "issuedAtIso");
|
|
2441
|
+
assertIsoTimestampOrNull2(input.expiresAtIso, "expiresAtIso");
|
|
2442
|
+
return Object.freeze({
|
|
2443
|
+
contractVersion: input.contractVersion ?? AI_GAME_APPRENTICESHIP_CONTRACT_VERSION,
|
|
2444
|
+
featureFlagId: AI_GAME_APPRENTICESHIP_FEATURE_FLAG_ID,
|
|
2445
|
+
sponsorshipId: input.sponsorshipId,
|
|
2446
|
+
apprenticeSubjectId: input.apprenticeSubjectId,
|
|
2447
|
+
sponsorSubjectId: input.sponsorSubjectId,
|
|
2448
|
+
institutionId: input.institutionId,
|
|
2449
|
+
disciplineCode: input.disciplineCode,
|
|
2450
|
+
status: input.status,
|
|
2451
|
+
issuedAtIso: input.issuedAtIso,
|
|
2452
|
+
expiresAtIso: input.expiresAtIso,
|
|
2453
|
+
scopeCodes: createStringArray5(input.scopeCodes, "scopeCodes"),
|
|
2454
|
+
reasonCodes: createStringArray5(input.reasonCodes, "reasonCodes")
|
|
2455
|
+
});
|
|
2456
|
+
}
|
|
2457
|
+
function createAiGameApprenticeshipSupervision(input) {
|
|
2458
|
+
assertContractVersion7(input.contractVersion ?? AI_GAME_APPRENTICESHIP_CONTRACT_VERSION);
|
|
2459
|
+
assertNonEmptyString8(input.supervisionId, "supervisionId");
|
|
2460
|
+
assertNonEmptyString8(input.sponsorshipId, "sponsorshipId");
|
|
2461
|
+
assertNonEmptyString8(input.supervisorSubjectId, "supervisorSubjectId");
|
|
2462
|
+
assertMember(input.mode, AI_GAME_APPRENTICESHIP_SUPERVISION_MODES, "mode");
|
|
2463
|
+
assertIsoTimestamp4(input.startedAtIso, "startedAtIso");
|
|
2464
|
+
assertIsoTimestampOrNull2(input.endsAtIso, "endsAtIso");
|
|
2465
|
+
return Object.freeze({
|
|
2466
|
+
contractVersion: input.contractVersion ?? AI_GAME_APPRENTICESHIP_CONTRACT_VERSION,
|
|
2467
|
+
featureFlagId: AI_GAME_APPRENTICESHIP_FEATURE_FLAG_ID,
|
|
2468
|
+
supervisionId: input.supervisionId,
|
|
2469
|
+
sponsorshipId: input.sponsorshipId,
|
|
2470
|
+
supervisorSubjectId: input.supervisorSubjectId,
|
|
2471
|
+
mode: input.mode,
|
|
2472
|
+
checkpointCodes: createStringArray5(input.checkpointCodes, "checkpointCodes"),
|
|
2473
|
+
startedAtIso: input.startedAtIso,
|
|
2474
|
+
endsAtIso: input.endsAtIso,
|
|
2475
|
+
reasonCodes: createStringArray5(input.reasonCodes, "reasonCodes")
|
|
2476
|
+
});
|
|
2477
|
+
}
|
|
2478
|
+
function createAiGameApprenticeshipReadiness(input) {
|
|
2479
|
+
assertContractVersion7(input.contractVersion ?? AI_GAME_APPRENTICESHIP_CONTRACT_VERSION);
|
|
2480
|
+
assertNonEmptyString8(input.readinessId, "readinessId");
|
|
2481
|
+
assertNonEmptyString8(input.sponsorshipId, "sponsorshipId");
|
|
2482
|
+
assertNonEmptyString8(input.disciplineCode, "disciplineCode");
|
|
2483
|
+
assertMember(input.state, AI_GAME_APPRENTICESHIP_READINESS_STATES, "state");
|
|
2484
|
+
if (!(0, import_training.isTrainingTrustLevel)(input.requiredTrustLevel)) {
|
|
2485
|
+
throw new Error("requiredTrustLevel must be a supported training trust level");
|
|
2486
|
+
}
|
|
2487
|
+
if (!(0, import_training.isMccExpressionTrack)(input.requiredTrack)) {
|
|
2488
|
+
throw new Error("requiredTrack must be a supported MCC expression track");
|
|
2489
|
+
}
|
|
2490
|
+
assertIsoTimestamp4(input.evaluatedAtIso, "evaluatedAtIso");
|
|
2491
|
+
if (input.state === "ready" && input.unmetPrerequisiteCodes.length > 0) {
|
|
2492
|
+
throw new Error("ready apprenticeship state cannot have unmet prerequisites");
|
|
2493
|
+
}
|
|
2494
|
+
return Object.freeze({
|
|
2495
|
+
contractVersion: input.contractVersion ?? AI_GAME_APPRENTICESHIP_CONTRACT_VERSION,
|
|
2496
|
+
featureFlagId: AI_GAME_APPRENTICESHIP_FEATURE_FLAG_ID,
|
|
2497
|
+
readinessId: input.readinessId,
|
|
2498
|
+
sponsorshipId: input.sponsorshipId,
|
|
2499
|
+
disciplineCode: input.disciplineCode,
|
|
2500
|
+
state: input.state,
|
|
2501
|
+
requiredTrustLevel: input.requiredTrustLevel,
|
|
2502
|
+
requiredTrack: input.requiredTrack,
|
|
2503
|
+
supervisionRequired: input.supervisionRequired,
|
|
2504
|
+
unmetPrerequisiteCodes: createStringArray5(
|
|
2505
|
+
input.unmetPrerequisiteCodes,
|
|
2506
|
+
"unmetPrerequisiteCodes"
|
|
2507
|
+
),
|
|
2508
|
+
evaluatedAtIso: input.evaluatedAtIso,
|
|
2509
|
+
reasonCodes: createStringArray5(input.reasonCodes, "reasonCodes")
|
|
2510
|
+
});
|
|
2511
|
+
}
|
|
2512
|
+
function createAiGameApprenticeshipHandoff(input) {
|
|
2513
|
+
assertContractVersion7(input.contractVersion ?? AI_GAME_APPRENTICESHIP_CONTRACT_VERSION);
|
|
2514
|
+
assertHandoffBase(input);
|
|
2515
|
+
assertMember(input.kind, AI_GAME_APPRENTICESHIP_HANDOFF_KINDS, "kind");
|
|
2516
|
+
if (input.kind === "spellcraft") {
|
|
2517
|
+
if (!(0, import_training.isMccExpressionTrack)(input.requestedTrack)) {
|
|
2518
|
+
throw new Error("requestedTrack must be a supported MCC expression track");
|
|
2519
|
+
}
|
|
2520
|
+
if (input.recommendationId !== null && input.recommendationId !== void 0) {
|
|
2521
|
+
assertNonEmptyString8(input.recommendationId, "recommendationId");
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
if (input.kind === "item-crafting" && input.recipeFamilyCode !== null && input.recipeFamilyCode !== void 0) {
|
|
2525
|
+
assertNonEmptyString8(input.recipeFamilyCode, "recipeFamilyCode");
|
|
2526
|
+
}
|
|
2527
|
+
if (input.kind === "dungeon-crafting") {
|
|
2528
|
+
if (input.blueprintFamilyCode !== null && input.blueprintFamilyCode !== void 0) {
|
|
2529
|
+
assertNonEmptyString8(input.blueprintFamilyCode, "blueprintFamilyCode");
|
|
2530
|
+
}
|
|
2531
|
+
if (input.sealingObjectiveCode !== null && input.sealingObjectiveCode !== void 0) {
|
|
2532
|
+
assertNonEmptyString8(input.sealingObjectiveCode, "sealingObjectiveCode");
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
const base = {
|
|
2536
|
+
contractVersion: input.contractVersion ?? AI_GAME_APPRENTICESHIP_CONTRACT_VERSION,
|
|
2537
|
+
featureFlagId: AI_GAME_APPRENTICESHIP_FEATURE_FLAG_ID,
|
|
2538
|
+
handoffId: input.handoffId,
|
|
2539
|
+
requestId: input.requestId,
|
|
2540
|
+
apprenticeshipId: input.apprenticeshipId,
|
|
2541
|
+
sponsorshipId: input.sponsorshipId,
|
|
2542
|
+
supervisionId: input.supervisionId,
|
|
2543
|
+
readinessId: input.readinessId,
|
|
2544
|
+
readinessState: input.readinessState,
|
|
2545
|
+
apprenticeSubjectId: input.apprenticeSubjectId,
|
|
2546
|
+
disciplineCode: input.disciplineCode,
|
|
2547
|
+
intent: input.intent,
|
|
2548
|
+
requestedAtIso: input.requestedAtIso,
|
|
2549
|
+
commitment: AI_GAME_APPRENTICESHIP_HANDOFF_COMMITMENT,
|
|
2550
|
+
guidanceOwner: AI_GAME_APPRENTICESHIP_GUIDANCE_OWNER,
|
|
2551
|
+
reasonCodes: createStringArray5(input.reasonCodes, "reasonCodes")
|
|
2552
|
+
};
|
|
2553
|
+
if (input.kind === "spellcraft") {
|
|
2554
|
+
return Object.freeze({
|
|
2555
|
+
...base,
|
|
2556
|
+
kind: input.kind,
|
|
2557
|
+
targetSystem: "spellcraft-system",
|
|
2558
|
+
recommendationId: input.recommendationId ?? null,
|
|
2559
|
+
requestedTrack: input.requestedTrack
|
|
2560
|
+
});
|
|
2561
|
+
}
|
|
2562
|
+
if (input.kind === "item-crafting") {
|
|
2563
|
+
return Object.freeze({
|
|
2564
|
+
...base,
|
|
2565
|
+
kind: input.kind,
|
|
2566
|
+
targetSystem: "item-crafting-system",
|
|
2567
|
+
recipeFamilyCode: input.recipeFamilyCode ?? null
|
|
2568
|
+
});
|
|
2569
|
+
}
|
|
2570
|
+
return Object.freeze({
|
|
2571
|
+
...base,
|
|
2572
|
+
kind: input.kind,
|
|
2573
|
+
targetSystem: "dungeon-crafting-system",
|
|
2574
|
+
blueprintFamilyCode: input.blueprintFamilyCode ?? null,
|
|
2575
|
+
sealingObjectiveCode: input.sealingObjectiveCode ?? null
|
|
2576
|
+
});
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2316
2579
|
// src/world-events.ts
|
|
2317
2580
|
function isCanonicalWorldEvent(event) {
|
|
2318
2581
|
return event.recordType === "canonical";
|
|
@@ -3143,6 +3406,16 @@ var gameEventFeatureFlags = Object.freeze([
|
|
|
3143
3406
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3144
3407
|
0 && (module.exports = {
|
|
3145
3408
|
AI_GAME_ACTOR_ROLES,
|
|
3409
|
+
AI_GAME_APPRENTICESHIP_CONTRACT_VERSION,
|
|
3410
|
+
AI_GAME_APPRENTICESHIP_FEATURE_FLAG_ID,
|
|
3411
|
+
AI_GAME_APPRENTICESHIP_GUIDANCE_OWNER,
|
|
3412
|
+
AI_GAME_APPRENTICESHIP_HANDOFF_COMMITMENT,
|
|
3413
|
+
AI_GAME_APPRENTICESHIP_HANDOFF_INTENTS,
|
|
3414
|
+
AI_GAME_APPRENTICESHIP_HANDOFF_KINDS,
|
|
3415
|
+
AI_GAME_APPRENTICESHIP_HANDOFF_TARGETS,
|
|
3416
|
+
AI_GAME_APPRENTICESHIP_READINESS_STATES,
|
|
3417
|
+
AI_GAME_APPRENTICESHIP_SPONSORSHIP_STATUSES,
|
|
3418
|
+
AI_GAME_APPRENTICESHIP_SUPERVISION_MODES,
|
|
3146
3419
|
AI_GAME_ENV_PREFIX,
|
|
3147
3420
|
AI_GAME_EVENT_CONTRACTS_FEATURE_FLAG_ID,
|
|
3148
3421
|
AI_GAME_EVENT_INGESTION_FEATURE_FLAG_ID,
|
|
@@ -3268,6 +3541,10 @@ var gameEventFeatureFlags = Object.freeze([
|
|
|
3268
3541
|
assertAiGameObservedEventLogContractVersion,
|
|
3269
3542
|
classifyAiGameTask,
|
|
3270
3543
|
createAiGameAcademicTrainingSnapshot,
|
|
3544
|
+
createAiGameApprenticeshipHandoff,
|
|
3545
|
+
createAiGameApprenticeshipReadiness,
|
|
3546
|
+
createAiGameApprenticeshipSponsorship,
|
|
3547
|
+
createAiGameApprenticeshipSupervision,
|
|
3271
3548
|
createAiGameGossipExport,
|
|
3272
3549
|
createAiGameIdentityProjectionContract,
|
|
3273
3550
|
createAiGameIdentitySelfProjection,
|
|
@@ -3317,6 +3594,7 @@ var gameEventFeatureFlags = Object.freeze([
|
|
|
3317
3594
|
getAiGamePlayerSystemFocusModeContract,
|
|
3318
3595
|
getAiGamePlayerSystemGuidanceFallbackContract,
|
|
3319
3596
|
getAiGamePlayerSystemModuleContract,
|
|
3597
|
+
isAiGameApprenticeshipReadinessState,
|
|
3320
3598
|
isAiGameGossipExportAudience,
|
|
3321
3599
|
isAiGameIdentityKnowledgeState,
|
|
3322
3600
|
isAiGameIdentityProjectionRead,
|