@playcademy/sdk 0.16.1-beta.13 → 0.16.1-beta.14
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/dist/contracts.d.ts +47 -0
- package/dist/contracts.js +23 -0
- package/dist/index.js +1 -1
- package/dist/internal.d.ts +15 -0
- package/dist/internal.js +1 -1
- package/dist/server/edge.d.ts +15 -0
- package/dist/server/edge.js +1 -1
- package/dist/server.d.ts +15 -0
- package/dist/server.js +1 -1
- package/dist/types.d.ts +15 -0
- package/package.json +7 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The child-catalog contract: what a child game publishes about its
|
|
3
|
+
* deliverable lessons, per lesson id and level. A parent course authority
|
|
4
|
+
* resolves its lesson references against this document at compile time and
|
|
5
|
+
* fails closed at runtime on anything not `ready` in production.
|
|
6
|
+
*
|
|
7
|
+
* Ownership and flow: each child repo generates `.playcademy/catalog.json`
|
|
8
|
+
* from its own registry (`playcademy catalog generate`); a sync workflow
|
|
9
|
+
* carries copies into parent repos. Children never read the parent's
|
|
10
|
+
* compiled authority — this file and the launch payload are the entire
|
|
11
|
+
* surface between them.
|
|
12
|
+
*
|
|
13
|
+
* The document deliberately carries no app identity. The consuming repo
|
|
14
|
+
* assigns the namespace key (e.g. 'form', 'math-cakes') from sync
|
|
15
|
+
* provenance via its own repo → app map, so a child cannot misdeclare
|
|
16
|
+
* who it is and a typo cannot mint a phantom namespace.
|
|
17
|
+
*/
|
|
18
|
+
/** Contract identifier carried by every catalog document. */
|
|
19
|
+
declare const CHILD_CATALOG_CONTRACT: 'playcademy-child-catalog-v1';
|
|
20
|
+
/** The completion-evidence contract a catalog declares its runs report. */
|
|
21
|
+
declare const CHILD_ATTEMPT_CONTRACT: 'playcademy-child-attempt-v1';
|
|
22
|
+
/** Delivery levels a catalog may declare (serving-id dialect, lowercase). */
|
|
23
|
+
declare const CATALOG_LEVELS: readonly ['e1', 'e2', 'e3', 'e4'];
|
|
24
|
+
type CatalogLevel = (typeof CATALOG_LEVELS)[number];
|
|
25
|
+
/**
|
|
26
|
+
* ready: real content. simulated: placeholder — playable for preview and
|
|
27
|
+
* simulation, never creditable in production. unavailable: intentionally
|
|
28
|
+
* absent at this level. Consumers must treat unknown values and missing
|
|
29
|
+
* levels as unavailable (fail closed).
|
|
30
|
+
*/
|
|
31
|
+
declare const CATALOG_READINESS: readonly ['ready', 'simulated', 'unavailable'];
|
|
32
|
+
type CatalogReadiness = (typeof CATALOG_READINESS)[number];
|
|
33
|
+
interface ChildCatalog {
|
|
34
|
+
/** The contract identifier. */
|
|
35
|
+
contract: typeof CHILD_CATALOG_CONTRACT;
|
|
36
|
+
/** The completion-evidence contract a catalog declares its runs report. */
|
|
37
|
+
evidence: typeof CHILD_ATTEMPT_CONTRACT;
|
|
38
|
+
/** The tool that generated this document (repo-relative path). */
|
|
39
|
+
generatedBy: string;
|
|
40
|
+
/** The in-repo source of truth the document was derived from. */
|
|
41
|
+
generatedFrom: string;
|
|
42
|
+
/** Lesson id → level → readiness. */
|
|
43
|
+
deliveries: Record<string, Partial<Record<CatalogLevel, CatalogReadiness>>>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { CATALOG_LEVELS, CATALOG_READINESS, CHILD_ATTEMPT_CONTRACT, CHILD_CATALOG_CONTRACT };
|
|
47
|
+
export type { CatalogLevel, CatalogReadiness, ChildCatalog };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, {
|
|
5
|
+
get: all[name],
|
|
6
|
+
enumerable: true,
|
|
7
|
+
configurable: true,
|
|
8
|
+
set: (newValue) => all[name] = () => newValue
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
12
|
+
|
|
13
|
+
// src/contracts/child-catalog.ts
|
|
14
|
+
var CHILD_CATALOG_CONTRACT = "playcademy-child-catalog-v1";
|
|
15
|
+
var CHILD_ATTEMPT_CONTRACT = "playcademy-child-attempt-v1";
|
|
16
|
+
var CATALOG_LEVELS = ["e1", "e2", "e3", "e4"];
|
|
17
|
+
var CATALOG_READINESS = ["ready", "simulated", "unavailable"];
|
|
18
|
+
export {
|
|
19
|
+
CHILD_CATALOG_CONTRACT,
|
|
20
|
+
CHILD_ATTEMPT_CONTRACT,
|
|
21
|
+
CATALOG_READINESS,
|
|
22
|
+
CATALOG_LEVELS
|
|
23
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -3484,7 +3484,7 @@ async function request({
|
|
|
3484
3484
|
return rawText && rawText.length > 0 ? rawText : undefined;
|
|
3485
3485
|
}
|
|
3486
3486
|
// src/version.ts
|
|
3487
|
-
var SDK_VERSION = "0.16.1-beta.
|
|
3487
|
+
var SDK_VERSION = "0.16.1-beta.14";
|
|
3488
3488
|
|
|
3489
3489
|
// src/clients/base.ts
|
|
3490
3490
|
class PlaycademyBaseClient {
|
package/dist/internal.d.ts
CHANGED
|
@@ -3489,6 +3489,19 @@ interface DashboardThemeConfig {
|
|
|
3489
3489
|
/** Secondary/accent color as a hex string, e.g. '#ffd166' */
|
|
3490
3490
|
secondary?: string;
|
|
3491
3491
|
}
|
|
3492
|
+
/**
|
|
3493
|
+
* Child-catalog contract generation (see @playcademy/sdk/contracts).
|
|
3494
|
+
* The extractor is a repo-local script (run with the CLI's runtime) that
|
|
3495
|
+
* prints `{ generatedFrom, deliveries }` as JSON on stdout; the CLI
|
|
3496
|
+
* validates, stamps the contract fields, and writes
|
|
3497
|
+
* `.playcademy/catalog.json` deterministically. The document carries no
|
|
3498
|
+
* app identity — consuming repos assign the namespace key from sync
|
|
3499
|
+
* provenance.
|
|
3500
|
+
*/
|
|
3501
|
+
interface CatalogConfig {
|
|
3502
|
+
/** Path to the extractor script, relative to the config file. */
|
|
3503
|
+
extractor: string;
|
|
3504
|
+
}
|
|
3492
3505
|
/**
|
|
3493
3506
|
* Unified Playcademy configuration
|
|
3494
3507
|
* Used for playcademy.config.{js,json}
|
|
@@ -3521,6 +3534,8 @@ interface PlaycademyConfig {
|
|
|
3521
3534
|
dashboard?: DashboardConfig | boolean;
|
|
3522
3535
|
/** Integrations (database, custom routes, external services) */
|
|
3523
3536
|
integrations?: IntegrationsConfig;
|
|
3537
|
+
/** Child-catalog contract generation (`playcademy catalog`) */
|
|
3538
|
+
catalog?: CatalogConfig;
|
|
3524
3539
|
}
|
|
3525
3540
|
|
|
3526
3541
|
/**
|
package/dist/internal.js
CHANGED
|
@@ -4360,7 +4360,7 @@ async function request({
|
|
|
4360
4360
|
return rawText && rawText.length > 0 ? rawText : undefined;
|
|
4361
4361
|
}
|
|
4362
4362
|
// src/version.ts
|
|
4363
|
-
var SDK_VERSION = "0.16.1-beta.
|
|
4363
|
+
var SDK_VERSION = "0.16.1-beta.14";
|
|
4364
4364
|
|
|
4365
4365
|
// src/clients/base.ts
|
|
4366
4366
|
class PlaycademyBaseClient {
|
package/dist/server/edge.d.ts
CHANGED
|
@@ -142,6 +142,19 @@ interface DashboardThemeConfig {
|
|
|
142
142
|
/** Secondary/accent color as a hex string, e.g. '#ffd166' */
|
|
143
143
|
secondary?: string;
|
|
144
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Child-catalog contract generation (see @playcademy/sdk/contracts).
|
|
147
|
+
* The extractor is a repo-local script (run with the CLI's runtime) that
|
|
148
|
+
* prints `{ generatedFrom, deliveries }` as JSON on stdout; the CLI
|
|
149
|
+
* validates, stamps the contract fields, and writes
|
|
150
|
+
* `.playcademy/catalog.json` deterministically. The document carries no
|
|
151
|
+
* app identity — consuming repos assign the namespace key from sync
|
|
152
|
+
* provenance.
|
|
153
|
+
*/
|
|
154
|
+
interface CatalogConfig {
|
|
155
|
+
/** Path to the extractor script, relative to the config file. */
|
|
156
|
+
extractor: string;
|
|
157
|
+
}
|
|
145
158
|
/**
|
|
146
159
|
* Unified Playcademy configuration
|
|
147
160
|
* Used for playcademy.config.{js,json}
|
|
@@ -174,6 +187,8 @@ interface PlaycademyConfig {
|
|
|
174
187
|
dashboard?: DashboardConfig | boolean;
|
|
175
188
|
/** Integrations (database, custom routes, external services) */
|
|
176
189
|
integrations?: IntegrationsConfig;
|
|
190
|
+
/** Child-catalog contract generation (`playcademy catalog`) */
|
|
191
|
+
catalog?: CatalogConfig;
|
|
177
192
|
}
|
|
178
193
|
|
|
179
194
|
/**
|
package/dist/server/edge.js
CHANGED
package/dist/server.d.ts
CHANGED
|
@@ -142,6 +142,19 @@ interface DashboardThemeConfig {
|
|
|
142
142
|
/** Secondary/accent color as a hex string, e.g. '#ffd166' */
|
|
143
143
|
secondary?: string;
|
|
144
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Child-catalog contract generation (see @playcademy/sdk/contracts).
|
|
147
|
+
* The extractor is a repo-local script (run with the CLI's runtime) that
|
|
148
|
+
* prints `{ generatedFrom, deliveries }` as JSON on stdout; the CLI
|
|
149
|
+
* validates, stamps the contract fields, and writes
|
|
150
|
+
* `.playcademy/catalog.json` deterministically. The document carries no
|
|
151
|
+
* app identity — consuming repos assign the namespace key from sync
|
|
152
|
+
* provenance.
|
|
153
|
+
*/
|
|
154
|
+
interface CatalogConfig {
|
|
155
|
+
/** Path to the extractor script, relative to the config file. */
|
|
156
|
+
extractor: string;
|
|
157
|
+
}
|
|
145
158
|
/**
|
|
146
159
|
* Unified Playcademy configuration
|
|
147
160
|
* Used for playcademy.config.{js,json}
|
|
@@ -174,6 +187,8 @@ interface PlaycademyConfig {
|
|
|
174
187
|
dashboard?: DashboardConfig | boolean;
|
|
175
188
|
/** Integrations (database, custom routes, external services) */
|
|
176
189
|
integrations?: IntegrationsConfig;
|
|
190
|
+
/** Child-catalog contract generation (`playcademy catalog`) */
|
|
191
|
+
catalog?: CatalogConfig;
|
|
177
192
|
}
|
|
178
193
|
|
|
179
194
|
/**
|
package/dist/server.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -363,6 +363,19 @@ interface DashboardThemeConfig {
|
|
|
363
363
|
/** Secondary/accent color as a hex string, e.g. '#ffd166' */
|
|
364
364
|
secondary?: string;
|
|
365
365
|
}
|
|
366
|
+
/**
|
|
367
|
+
* Child-catalog contract generation (see @playcademy/sdk/contracts).
|
|
368
|
+
* The extractor is a repo-local script (run with the CLI's runtime) that
|
|
369
|
+
* prints `{ generatedFrom, deliveries }` as JSON on stdout; the CLI
|
|
370
|
+
* validates, stamps the contract fields, and writes
|
|
371
|
+
* `.playcademy/catalog.json` deterministically. The document carries no
|
|
372
|
+
* app identity — consuming repos assign the namespace key from sync
|
|
373
|
+
* provenance.
|
|
374
|
+
*/
|
|
375
|
+
interface CatalogConfig {
|
|
376
|
+
/** Path to the extractor script, relative to the config file. */
|
|
377
|
+
extractor: string;
|
|
378
|
+
}
|
|
366
379
|
/**
|
|
367
380
|
* Unified Playcademy configuration
|
|
368
381
|
* Used for playcademy.config.{js,json}
|
|
@@ -395,6 +408,8 @@ interface PlaycademyConfig {
|
|
|
395
408
|
dashboard?: DashboardConfig | boolean;
|
|
396
409
|
/** Integrations (database, custom routes, external services) */
|
|
397
410
|
integrations?: IntegrationsConfig;
|
|
411
|
+
/** Child-catalog contract generation (`playcademy catalog`) */
|
|
412
|
+
catalog?: CatalogConfig;
|
|
398
413
|
}
|
|
399
414
|
|
|
400
415
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playcademy/sdk",
|
|
3
|
-
"version": "0.16.1-beta.
|
|
3
|
+
"version": "0.16.1-beta.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
"import": "./dist/types.js",
|
|
22
22
|
"require": "./dist/types.js"
|
|
23
23
|
},
|
|
24
|
+
"./contracts": {
|
|
25
|
+
"source": "./src/contracts.ts",
|
|
26
|
+
"types": "./dist/contracts.d.ts",
|
|
27
|
+
"import": "./dist/contracts.js",
|
|
28
|
+
"require": "./dist/contracts.js"
|
|
29
|
+
},
|
|
24
30
|
"./internal": {
|
|
25
31
|
"source": "./src/internal.ts",
|
|
26
32
|
"types": "./dist/internal.d.ts",
|