@contractspec/example.learning-journey-platform-tour 1.44.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 (51) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +41 -0
  2. package/.turbo/turbo-build.log +42 -0
  3. package/CHANGELOG.md +178 -0
  4. package/LICENSE +21 -0
  5. package/README.md +43 -0
  6. package/dist/docs/index.d.ts +1 -0
  7. package/dist/docs/index.js +1 -0
  8. package/dist/docs/platform-tour.docblock.d.ts +1 -0
  9. package/dist/docs/platform-tour.docblock.js +42 -0
  10. package/dist/docs/platform-tour.docblock.js.map +1 -0
  11. package/dist/example.d.ts +35 -0
  12. package/dist/example.d.ts.map +1 -0
  13. package/dist/example.js +39 -0
  14. package/dist/example.js.map +1 -0
  15. package/dist/handlers/demo.handlers.d.ts +25 -0
  16. package/dist/handlers/demo.handlers.d.ts.map +1 -0
  17. package/dist/handlers/demo.handlers.js +27 -0
  18. package/dist/handlers/demo.handlers.js.map +1 -0
  19. package/dist/index.d.ts +7 -0
  20. package/dist/index.js +9 -0
  21. package/dist/learning-journey-platform-tour.feature.d.ts +12 -0
  22. package/dist/learning-journey-platform-tour.feature.d.ts.map +1 -0
  23. package/dist/learning-journey-platform-tour.feature.js +68 -0
  24. package/dist/learning-journey-platform-tour.feature.js.map +1 -0
  25. package/dist/operations/index.d.ts +271 -0
  26. package/dist/operations/index.d.ts.map +1 -0
  27. package/dist/operations/index.js +176 -0
  28. package/dist/operations/index.js.map +1 -0
  29. package/dist/presentations/index.d.ts +9 -0
  30. package/dist/presentations/index.d.ts.map +1 -0
  31. package/dist/presentations/index.js +55 -0
  32. package/dist/presentations/index.js.map +1 -0
  33. package/dist/track.d.ts +8 -0
  34. package/dist/track.d.ts.map +1 -0
  35. package/dist/track.js +106 -0
  36. package/dist/track.js.map +1 -0
  37. package/example.ts +1 -0
  38. package/package.json +67 -0
  39. package/src/docs/index.ts +1 -0
  40. package/src/docs/platform-tour.docblock.ts +40 -0
  41. package/src/example.ts +26 -0
  42. package/src/handlers/demo.handlers.ts +50 -0
  43. package/src/index.ts +7 -0
  44. package/src/learning-journey-platform-tour.feature.ts +66 -0
  45. package/src/operations/index.test.ts +49 -0
  46. package/src/operations/index.ts +122 -0
  47. package/src/presentations/index.ts +55 -0
  48. package/src/track.ts +106 -0
  49. package/tsconfig.json +9 -0
  50. package/tsconfig.tsbuildinfo +1 -0
  51. package/tsdown.config.js +17 -0
@@ -0,0 +1,271 @@
1
+ import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
2
+ import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
3
+ import * as _contractspec_module_learning_journey_track_spec0 from "@contractspec/module.learning-journey/track-spec";
4
+
5
+ //#region src/operations/index.d.ts
6
+ declare const PlatformTourTrackModel: _contractspec_lib_schema0.SchemaModel<{
7
+ id: {
8
+ type: _contractspec_lib_schema0.FieldType<string, string>;
9
+ isOptional: false;
10
+ };
11
+ name: {
12
+ type: _contractspec_lib_schema0.FieldType<string, string>;
13
+ isOptional: false;
14
+ };
15
+ description: {
16
+ type: _contractspec_lib_schema0.FieldType<string, string>;
17
+ isOptional: true;
18
+ };
19
+ totalXp: {
20
+ type: _contractspec_lib_schema0.FieldType<number, number>;
21
+ isOptional: true;
22
+ };
23
+ completionXpBonus: {
24
+ type: _contractspec_lib_schema0.FieldType<number, number>;
25
+ isOptional: true;
26
+ };
27
+ completionBadgeKey: {
28
+ type: _contractspec_lib_schema0.FieldType<string, string>;
29
+ isOptional: true;
30
+ };
31
+ streakHoursWindow: {
32
+ type: _contractspec_lib_schema0.FieldType<number, number>;
33
+ isOptional: true;
34
+ };
35
+ streakBonusXp: {
36
+ type: _contractspec_lib_schema0.FieldType<number, number>;
37
+ isOptional: true;
38
+ };
39
+ steps: {
40
+ type: _contractspec_lib_schema0.SchemaModel<{
41
+ id: {
42
+ type: _contractspec_lib_schema0.FieldType<string, string>;
43
+ isOptional: false;
44
+ };
45
+ title: {
46
+ type: _contractspec_lib_schema0.FieldType<string, string>;
47
+ isOptional: false;
48
+ };
49
+ description: {
50
+ type: _contractspec_lib_schema0.FieldType<string, string>;
51
+ isOptional: true;
52
+ };
53
+ completionEvent: {
54
+ type: _contractspec_lib_schema0.FieldType<string, string>;
55
+ isOptional: false;
56
+ };
57
+ sourceModule: {
58
+ type: _contractspec_lib_schema0.FieldType<string, string>;
59
+ isOptional: true;
60
+ };
61
+ xpReward: {
62
+ type: _contractspec_lib_schema0.FieldType<number, number>;
63
+ isOptional: true;
64
+ };
65
+ order: {
66
+ type: _contractspec_lib_schema0.FieldType<number, number>;
67
+ isOptional: true;
68
+ };
69
+ }>;
70
+ isArray: true;
71
+ isOptional: false;
72
+ };
73
+ }>;
74
+ declare const GetPlatformTourTrack: _contractspec_lib_contracts0.OperationSpec<_contractspec_lib_schema0.SchemaModel<{}>, _contractspec_lib_schema0.SchemaModel<{
75
+ track: {
76
+ type: _contractspec_lib_schema0.SchemaModel<{
77
+ id: {
78
+ type: _contractspec_lib_schema0.FieldType<string, string>;
79
+ isOptional: false;
80
+ };
81
+ name: {
82
+ type: _contractspec_lib_schema0.FieldType<string, string>;
83
+ isOptional: false;
84
+ };
85
+ description: {
86
+ type: _contractspec_lib_schema0.FieldType<string, string>;
87
+ isOptional: true;
88
+ };
89
+ totalXp: {
90
+ type: _contractspec_lib_schema0.FieldType<number, number>;
91
+ isOptional: true;
92
+ };
93
+ completionXpBonus: {
94
+ type: _contractspec_lib_schema0.FieldType<number, number>;
95
+ isOptional: true;
96
+ };
97
+ completionBadgeKey: {
98
+ type: _contractspec_lib_schema0.FieldType<string, string>;
99
+ isOptional: true;
100
+ };
101
+ streakHoursWindow: {
102
+ type: _contractspec_lib_schema0.FieldType<number, number>;
103
+ isOptional: true;
104
+ };
105
+ streakBonusXp: {
106
+ type: _contractspec_lib_schema0.FieldType<number, number>;
107
+ isOptional: true;
108
+ };
109
+ steps: {
110
+ type: _contractspec_lib_schema0.SchemaModel<{
111
+ id: {
112
+ type: _contractspec_lib_schema0.FieldType<string, string>;
113
+ isOptional: false;
114
+ };
115
+ title: {
116
+ type: _contractspec_lib_schema0.FieldType<string, string>;
117
+ isOptional: false;
118
+ };
119
+ description: {
120
+ type: _contractspec_lib_schema0.FieldType<string, string>;
121
+ isOptional: true;
122
+ };
123
+ completionEvent: {
124
+ type: _contractspec_lib_schema0.FieldType<string, string>;
125
+ isOptional: false;
126
+ };
127
+ sourceModule: {
128
+ type: _contractspec_lib_schema0.FieldType<string, string>;
129
+ isOptional: true;
130
+ };
131
+ xpReward: {
132
+ type: _contractspec_lib_schema0.FieldType<number, number>;
133
+ isOptional: true;
134
+ };
135
+ order: {
136
+ type: _contractspec_lib_schema0.FieldType<number, number>;
137
+ isOptional: true;
138
+ };
139
+ }>;
140
+ isArray: true;
141
+ isOptional: false;
142
+ };
143
+ }>;
144
+ isOptional: false;
145
+ };
146
+ }>, undefined>;
147
+ declare const RecordPlatformTourEvent: _contractspec_lib_contracts0.OperationSpec<_contractspec_lib_schema0.SchemaModel<{
148
+ learnerId: {
149
+ type: _contractspec_lib_schema0.FieldType<string, string>;
150
+ isOptional: false;
151
+ };
152
+ eventName: {
153
+ type: _contractspec_lib_schema0.FieldType<string, string>;
154
+ isOptional: false;
155
+ };
156
+ payload: {
157
+ type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
158
+ isOptional: true;
159
+ };
160
+ occurredAt: {
161
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
162
+ isOptional: true;
163
+ };
164
+ }>, _contractspec_lib_schema0.SchemaModel<{
165
+ success: {
166
+ type: _contractspec_lib_schema0.FieldType<boolean, boolean>;
167
+ isOptional: false;
168
+ };
169
+ }>, undefined>;
170
+ declare const platformTourContracts: {
171
+ GetPlatformTourTrack: _contractspec_lib_contracts0.OperationSpec<_contractspec_lib_schema0.SchemaModel<{}>, _contractspec_lib_schema0.SchemaModel<{
172
+ track: {
173
+ type: _contractspec_lib_schema0.SchemaModel<{
174
+ id: {
175
+ type: _contractspec_lib_schema0.FieldType<string, string>;
176
+ isOptional: false;
177
+ };
178
+ name: {
179
+ type: _contractspec_lib_schema0.FieldType<string, string>;
180
+ isOptional: false;
181
+ };
182
+ description: {
183
+ type: _contractspec_lib_schema0.FieldType<string, string>;
184
+ isOptional: true;
185
+ };
186
+ totalXp: {
187
+ type: _contractspec_lib_schema0.FieldType<number, number>;
188
+ isOptional: true;
189
+ };
190
+ completionXpBonus: {
191
+ type: _contractspec_lib_schema0.FieldType<number, number>;
192
+ isOptional: true;
193
+ };
194
+ completionBadgeKey: {
195
+ type: _contractspec_lib_schema0.FieldType<string, string>;
196
+ isOptional: true;
197
+ };
198
+ streakHoursWindow: {
199
+ type: _contractspec_lib_schema0.FieldType<number, number>;
200
+ isOptional: true;
201
+ };
202
+ streakBonusXp: {
203
+ type: _contractspec_lib_schema0.FieldType<number, number>;
204
+ isOptional: true;
205
+ };
206
+ steps: {
207
+ type: _contractspec_lib_schema0.SchemaModel<{
208
+ id: {
209
+ type: _contractspec_lib_schema0.FieldType<string, string>;
210
+ isOptional: false;
211
+ };
212
+ title: {
213
+ type: _contractspec_lib_schema0.FieldType<string, string>;
214
+ isOptional: false;
215
+ };
216
+ description: {
217
+ type: _contractspec_lib_schema0.FieldType<string, string>;
218
+ isOptional: true;
219
+ };
220
+ completionEvent: {
221
+ type: _contractspec_lib_schema0.FieldType<string, string>;
222
+ isOptional: false;
223
+ };
224
+ sourceModule: {
225
+ type: _contractspec_lib_schema0.FieldType<string, string>;
226
+ isOptional: true;
227
+ };
228
+ xpReward: {
229
+ type: _contractspec_lib_schema0.FieldType<number, number>;
230
+ isOptional: true;
231
+ };
232
+ order: {
233
+ type: _contractspec_lib_schema0.FieldType<number, number>;
234
+ isOptional: true;
235
+ };
236
+ }>;
237
+ isArray: true;
238
+ isOptional: false;
239
+ };
240
+ }>;
241
+ isOptional: false;
242
+ };
243
+ }>, undefined>;
244
+ RecordPlatformTourEvent: _contractspec_lib_contracts0.OperationSpec<_contractspec_lib_schema0.SchemaModel<{
245
+ learnerId: {
246
+ type: _contractspec_lib_schema0.FieldType<string, string>;
247
+ isOptional: false;
248
+ };
249
+ eventName: {
250
+ type: _contractspec_lib_schema0.FieldType<string, string>;
251
+ isOptional: false;
252
+ };
253
+ payload: {
254
+ type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
255
+ isOptional: true;
256
+ };
257
+ occurredAt: {
258
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
259
+ isOptional: true;
260
+ };
261
+ }>, _contractspec_lib_schema0.SchemaModel<{
262
+ success: {
263
+ type: _contractspec_lib_schema0.FieldType<boolean, boolean>;
264
+ isOptional: false;
265
+ };
266
+ }>, undefined>;
267
+ track: _contractspec_module_learning_journey_track_spec0.LearningJourneyTrackSpec;
268
+ };
269
+ //#endregion
270
+ export { GetPlatformTourTrack, PlatformTourTrackModel, RecordPlatformTourEvent, platformTourContracts };
271
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/operations/index.ts"],"sourcesContent":[],"mappings":";;;;;cAwBa,kDAAsB;;UAuBjC,yBAAA,CAAA;;;EAvBW,IAAA,EAAA;IAuBX,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;6CAvBiC,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;EAoDtB,CAAA;EAoBX,iBAAA,EAAA;IApB+B,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;;QAAA,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;QAAA,UAAA,EAAA,IAAA;MAsBpB,CAAA;MAiBX,eAAA,EAAA;;;;;iDAjBkC,CAAA,MAAA,EAAA,MAAA,CAAA;QAAA,UAAA,EAAA,IAAA;;;QAAA,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;QAmBvB,UAAA,EAIZ,IAAA;MAAA,CAAA;;;;;;;;;;cA7CY,sBAAoB,4BAAA,CAAA,cAoB/B,yBAAA,CApB+B,2CAAA;;;;cAAA,yBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsBpB,sDAAuB,wCAAA;;UAiBlC,yBAAA,CAAA;;;;;;;;;;;;;;;;;UAjBkC,yBAAA,CAAA;;;;cAmBvB;mEAIZ,yBAAA,CAAA"}
@@ -0,0 +1,176 @@
1
+ import { platformPrimitivesTourTrack } from "../track.js";
2
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
+ import { defineCommand, defineQuery } from "@contractspec/lib.contracts";
4
+
5
+ //#region src/operations/index.ts
6
+ const OWNERS = ["examples.learning-journey.platform-tour"];
7
+ const StepModel = defineSchemaModel({
8
+ name: "PlatformTourStep",
9
+ description: "Step metadata for platform primitives tour",
10
+ fields: {
11
+ id: {
12
+ type: ScalarTypeEnum.String_unsecure(),
13
+ isOptional: false
14
+ },
15
+ title: {
16
+ type: ScalarTypeEnum.String_unsecure(),
17
+ isOptional: false
18
+ },
19
+ description: {
20
+ type: ScalarTypeEnum.String_unsecure(),
21
+ isOptional: true
22
+ },
23
+ completionEvent: {
24
+ type: ScalarTypeEnum.String_unsecure(),
25
+ isOptional: false
26
+ },
27
+ sourceModule: {
28
+ type: ScalarTypeEnum.String_unsecure(),
29
+ isOptional: true
30
+ },
31
+ xpReward: {
32
+ type: ScalarTypeEnum.Int_unsecure(),
33
+ isOptional: true
34
+ },
35
+ order: {
36
+ type: ScalarTypeEnum.Int_unsecure(),
37
+ isOptional: true
38
+ }
39
+ }
40
+ });
41
+ const PlatformTourTrackModel = defineSchemaModel({
42
+ name: "PlatformTourTrack",
43
+ description: "Platform primitives tour track definition",
44
+ fields: {
45
+ id: {
46
+ type: ScalarTypeEnum.String_unsecure(),
47
+ isOptional: false
48
+ },
49
+ name: {
50
+ type: ScalarTypeEnum.String_unsecure(),
51
+ isOptional: false
52
+ },
53
+ description: {
54
+ type: ScalarTypeEnum.String_unsecure(),
55
+ isOptional: true
56
+ },
57
+ totalXp: {
58
+ type: ScalarTypeEnum.Int_unsecure(),
59
+ isOptional: true
60
+ },
61
+ completionXpBonus: {
62
+ type: ScalarTypeEnum.Int_unsecure(),
63
+ isOptional: true
64
+ },
65
+ completionBadgeKey: {
66
+ type: ScalarTypeEnum.String_unsecure(),
67
+ isOptional: true
68
+ },
69
+ streakHoursWindow: {
70
+ type: ScalarTypeEnum.Int_unsecure(),
71
+ isOptional: true
72
+ },
73
+ streakBonusXp: {
74
+ type: ScalarTypeEnum.Int_unsecure(),
75
+ isOptional: true
76
+ },
77
+ steps: {
78
+ type: StepModel,
79
+ isArray: true,
80
+ isOptional: false
81
+ }
82
+ }
83
+ });
84
+ const TrackResponseModel = defineSchemaModel({
85
+ name: "PlatformTourTrackResponse",
86
+ description: "Response wrapper for platform tour track",
87
+ fields: { track: {
88
+ type: PlatformTourTrackModel,
89
+ isOptional: false
90
+ } }
91
+ });
92
+ const RecordDemoEventInput = defineSchemaModel({
93
+ name: "PlatformTourRecordEventInput",
94
+ description: "Emit a demo event to advance platform tour steps",
95
+ fields: {
96
+ learnerId: {
97
+ type: ScalarTypeEnum.String_unsecure(),
98
+ isOptional: false
99
+ },
100
+ eventName: {
101
+ type: ScalarTypeEnum.String_unsecure(),
102
+ isOptional: false
103
+ },
104
+ payload: {
105
+ type: ScalarTypeEnum.JSON(),
106
+ isOptional: true
107
+ },
108
+ occurredAt: {
109
+ type: ScalarTypeEnum.DateTime(),
110
+ isOptional: true
111
+ }
112
+ }
113
+ });
114
+ const SuccessModel = defineSchemaModel({
115
+ name: "PlatformTourSuccess",
116
+ description: "Generic success response",
117
+ fields: { success: {
118
+ type: ScalarTypeEnum.Boolean(),
119
+ isOptional: false
120
+ } }
121
+ });
122
+ const GetPlatformTourTrack = defineQuery({
123
+ meta: {
124
+ key: "learningJourney.platformTour.getTrack",
125
+ version: 1,
126
+ stability: "experimental",
127
+ owners: [...OWNERS],
128
+ tags: [
129
+ "learning",
130
+ "platform",
131
+ "tour"
132
+ ],
133
+ description: "Fetch platform primitives tour track definition.",
134
+ goal: "Expose track metadata to UIs and templates.",
135
+ context: "Called by Studio/Playground to render journey steps."
136
+ },
137
+ io: {
138
+ input: defineSchemaModel({
139
+ name: "PlatformTourTrackInput",
140
+ description: "Track input",
141
+ fields: {}
142
+ }),
143
+ output: TrackResponseModel
144
+ },
145
+ policy: { auth: "user" }
146
+ });
147
+ const RecordPlatformTourEvent = defineCommand({
148
+ meta: {
149
+ key: "learningJourney.platformTour.recordEvent",
150
+ version: 1,
151
+ stability: "experimental",
152
+ owners: [...OWNERS],
153
+ tags: [
154
+ "learning",
155
+ "platform",
156
+ "tour"
157
+ ],
158
+ description: "Record an event to advance platform tour progress.",
159
+ goal: "Advance steps via domain events in demo/sandbox contexts.",
160
+ context: "Called by handlers or demo scripts to emit step completion events."
161
+ },
162
+ io: {
163
+ input: RecordDemoEventInput,
164
+ output: SuccessModel
165
+ },
166
+ policy: { auth: "user" }
167
+ });
168
+ const platformTourContracts = {
169
+ GetPlatformTourTrack,
170
+ RecordPlatformTourEvent,
171
+ track: platformPrimitivesTourTrack
172
+ };
173
+
174
+ //#endregion
175
+ export { GetPlatformTourTrack, PlatformTourTrackModel, RecordPlatformTourEvent, platformTourContracts };
176
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/operations/index.ts"],"sourcesContent":["import { ScalarTypeEnum, defineSchemaModel } from '@contractspec/lib.schema';\nimport { defineCommand, defineQuery } from '@contractspec/lib.contracts';\n\nimport { platformPrimitivesTourTrack } from '../track';\n\nconst OWNERS = ['examples.learning-journey.platform-tour'] as const;\n\nconst StepModel = defineSchemaModel({\n name: 'PlatformTourStep',\n description: 'Step metadata for platform primitives tour',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n completionEvent: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n sourceModule: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n xpReward: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n});\n\nexport const PlatformTourTrackModel = defineSchemaModel({\n name: 'PlatformTourTrack',\n description: 'Platform primitives tour track definition',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n completionXpBonus: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n },\n completionBadgeKey: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n streakHoursWindow: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n },\n streakBonusXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n steps: { type: StepModel, isArray: true, isOptional: false },\n },\n});\n\nconst TrackResponseModel = defineSchemaModel({\n name: 'PlatformTourTrackResponse',\n description: 'Response wrapper for platform tour track',\n fields: {\n track: { type: PlatformTourTrackModel, isOptional: false },\n },\n});\n\nconst RecordDemoEventInput = defineSchemaModel({\n name: 'PlatformTourRecordEventInput',\n description: 'Emit a demo event to advance platform tour steps',\n fields: {\n learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n payload: { type: ScalarTypeEnum.JSON(), isOptional: true },\n occurredAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n },\n});\n\nconst SuccessModel = defineSchemaModel({\n name: 'PlatformTourSuccess',\n description: 'Generic success response',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n});\n\nexport const GetPlatformTourTrack = defineQuery({\n meta: {\n key: 'learningJourney.platformTour.getTrack',\n version: 1,\n stability: 'experimental',\n owners: [...OWNERS],\n tags: ['learning', 'platform', 'tour'],\n description: 'Fetch platform primitives tour track definition.',\n goal: 'Expose track metadata to UIs and templates.',\n context: 'Called by Studio/Playground to render journey steps.',\n },\n io: {\n input: defineSchemaModel({\n name: 'PlatformTourTrackInput',\n description: 'Track input',\n fields: {},\n }),\n output: TrackResponseModel,\n },\n policy: { auth: 'user' },\n});\n\nexport const RecordPlatformTourEvent = defineCommand({\n meta: {\n key: 'learningJourney.platformTour.recordEvent',\n version: 1,\n stability: 'experimental',\n owners: [...OWNERS],\n tags: ['learning', 'platform', 'tour'],\n description: 'Record an event to advance platform tour progress.',\n goal: 'Advance steps via domain events in demo/sandbox contexts.',\n context:\n 'Called by handlers or demo scripts to emit step completion events.',\n },\n io: {\n input: RecordDemoEventInput,\n output: SuccessModel,\n },\n policy: { auth: 'user' },\n});\n\nexport const platformTourContracts = {\n GetPlatformTourTrack,\n RecordPlatformTourEvent,\n track: platformPrimitivesTourTrack,\n};\n"],"mappings":";;;;;AAKA,MAAM,SAAS,CAAC,0CAA0C;AAE1D,MAAM,YAAY,kBAAkB;CAClC,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,iBAAiB;GACf,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EAC1E,UAAU;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAM;EACnE,OAAO;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAM;EACjE;CACF,CAAC;AAEF,MAAa,yBAAyB,kBAAkB;CACtD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,SAAS;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAM;EAClE,mBAAmB;GACjB,MAAM,eAAe,cAAc;GACnC,YAAY;GACb;EACD,oBAAoB;GAClB,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,mBAAmB;GACjB,MAAM,eAAe,cAAc;GACnC,YAAY;GACb;EACD,eAAe;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAM;EACxE,OAAO;GAAE,MAAM;GAAW,SAAS;GAAM,YAAY;GAAO;EAC7D;CACF,CAAC;AAEF,MAAM,qBAAqB,kBAAkB;CAC3C,MAAM;CACN,aAAa;CACb,QAAQ,EACN,OAAO;EAAE,MAAM;EAAwB,YAAY;EAAO,EAC3D;CACF,CAAC;AAEF,MAAM,uBAAuB,kBAAkB;CAC7C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,SAAS;GAAE,MAAM,eAAe,MAAM;GAAE,YAAY;GAAM;EAC1D,YAAY;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EAClE;CACF,CAAC;AAEF,MAAM,eAAe,kBAAkB;CACrC,MAAM;CACN,aAAa;CACb,QAAQ,EACN,SAAS;EAAE,MAAM,eAAe,SAAS;EAAE,YAAY;EAAO,EAC/D;CACF,CAAC;AAEF,MAAa,uBAAuB,YAAY;CAC9C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAY;GAAY;GAAO;EACtC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO,kBAAkB;GACvB,MAAM;GACN,aAAa;GACb,QAAQ,EAAE;GACX,CAAC;EACF,QAAQ;EACT;CACD,QAAQ,EAAE,MAAM,QAAQ;CACzB,CAAC;AAEF,MAAa,0BAA0B,cAAc;CACnD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAY;GAAY;GAAO;EACtC,aAAa;EACb,MAAM;EACN,SACE;EACH;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EAAE,MAAM,QAAQ;CACzB,CAAC;AAEF,MAAa,wBAAwB;CACnC;CACA;CACA,OAAO;CACR"}
@@ -0,0 +1,9 @@
1
+ import { PresentationSpec } from "@contractspec/lib.contracts";
2
+
3
+ //#region src/presentations/index.d.ts
4
+ declare const PlatformTourTrackPresentation: PresentationSpec;
5
+ declare const PlatformTourWidgetPresentation: PresentationSpec;
6
+ declare const platformTourPresentations: PresentationSpec[];
7
+ //#endregion
8
+ export { PlatformTourTrackPresentation, PlatformTourWidgetPresentation, platformTourPresentations };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/presentations/index.ts"],"sourcesContent":[],"mappings":";;;cAoBa,+BAA+B;cAgB/B,gCAAgC;AAhBhC,cA+BA,yBAjBZ,EAiBqC,gBAjBrC,EAAA"}
@@ -0,0 +1,55 @@
1
+ import { PlatformTourTrackModel } from "../operations/index.js";
2
+ import { StabilityEnum } from "@contractspec/lib.contracts";
3
+
4
+ //#region src/presentations/index.ts
5
+ const baseMeta = {
6
+ domain: "learning-journey",
7
+ title: "Platform Tour",
8
+ owners: ["@examples.learning-journey.platform-tour"],
9
+ tags: [
10
+ "learning",
11
+ "platform",
12
+ "tour"
13
+ ],
14
+ stability: StabilityEnum.Experimental,
15
+ goal: "Visualize platform tour progress",
16
+ context: "Used in platform tour dashboard and widgets"
17
+ };
18
+ const PlatformTourTrackPresentation = {
19
+ meta: {
20
+ key: "learning.journey.platform.track",
21
+ version: 1,
22
+ description: "Platform primitives tour track detail",
23
+ ...baseMeta
24
+ },
25
+ source: {
26
+ type: "component",
27
+ framework: "react",
28
+ componentKey: "LearningTrackDetail",
29
+ props: PlatformTourTrackModel
30
+ },
31
+ targets: [
32
+ "react",
33
+ "markdown",
34
+ "application/json"
35
+ ]
36
+ };
37
+ const PlatformTourWidgetPresentation = {
38
+ meta: {
39
+ key: "learning.journey.platform.widget",
40
+ version: 1,
41
+ description: "Compact widget for platform tour progress",
42
+ ...baseMeta
43
+ },
44
+ source: {
45
+ type: "component",
46
+ framework: "react",
47
+ componentKey: "LearningTrackProgressWidget"
48
+ },
49
+ targets: ["react"]
50
+ };
51
+ const platformTourPresentations = [PlatformTourTrackPresentation, PlatformTourWidgetPresentation];
52
+
53
+ //#endregion
54
+ export { PlatformTourTrackPresentation, PlatformTourWidgetPresentation, platformTourPresentations };
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["baseMeta: Pick<\n PresentationSpecMeta,\n 'domain' | 'owners' | 'tags' | 'title' | 'stability' | 'goal' | 'context'\n>","PlatformTourTrackPresentation: PresentationSpec","PlatformTourWidgetPresentation: PresentationSpec"],"sources":["../../src/presentations/index.ts"],"sourcesContent":["import type {\n PresentationSpecMeta,\n PresentationSpec,\n} from '@contractspec/lib.contracts';\nimport { StabilityEnum } from '@contractspec/lib.contracts';\nimport { PlatformTourTrackModel } from '../operations';\n\nconst baseMeta: Pick<\n PresentationSpecMeta,\n 'domain' | 'owners' | 'tags' | 'title' | 'stability' | 'goal' | 'context'\n> = {\n domain: 'learning-journey',\n title: 'Platform Tour',\n owners: ['@examples.learning-journey.platform-tour'],\n tags: ['learning', 'platform', 'tour'],\n stability: StabilityEnum.Experimental,\n goal: 'Visualize platform tour progress',\n context: 'Used in platform tour dashboard and widgets',\n};\n\nexport const PlatformTourTrackPresentation: PresentationSpec = {\n meta: {\n key: 'learning.journey.platform.track',\n version: 1,\n description: 'Platform primitives tour track detail',\n ...baseMeta,\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'LearningTrackDetail',\n props: PlatformTourTrackModel,\n },\n targets: ['react', 'markdown', 'application/json'],\n};\n\nexport const PlatformTourWidgetPresentation: PresentationSpec = {\n meta: {\n key: 'learning.journey.platform.widget',\n version: 1,\n description: 'Compact widget for platform tour progress',\n ...baseMeta,\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'LearningTrackProgressWidget',\n },\n targets: ['react'],\n};\n\nexport const platformTourPresentations = [\n PlatformTourTrackPresentation,\n PlatformTourWidgetPresentation,\n];\n"],"mappings":";;;;AAOA,MAAMA,WAGF;CACF,QAAQ;CACR,OAAO;CACP,QAAQ,CAAC,2CAA2C;CACpD,MAAM;EAAC;EAAY;EAAY;EAAO;CACtC,WAAW,cAAc;CACzB,MAAM;CACN,SAAS;CACV;AAED,MAAaC,gCAAkD;CAC7D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,GAAG;EACJ;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS;EAAC;EAAS;EAAY;EAAmB;CACnD;AAED,MAAaC,iCAAmD;CAC9D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,GAAG;EACJ;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,QAAQ;CACnB;AAED,MAAa,4BAA4B,CACvC,+BACA,+BACD"}
@@ -0,0 +1,8 @@
1
+ import { LearningJourneyTrackSpec } from "@contractspec/module.learning-journey/track-spec";
2
+
3
+ //#region src/track.d.ts
4
+ declare const platformPrimitivesTourTrack: LearningJourneyTrackSpec;
5
+ declare const platformLearningTracks: LearningJourneyTrackSpec[];
6
+ //#endregion
7
+ export { platformLearningTracks, platformPrimitivesTourTrack };
8
+ //# sourceMappingURL=track.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"track.d.ts","names":[],"sources":["../src/track.ts"],"sourcesContent":[],"mappings":";;;cAEa,6BAA6B;cAqG7B,wBAAwB"}
package/dist/track.js ADDED
@@ -0,0 +1,106 @@
1
+ //#region src/track.ts
2
+ const platformPrimitivesTourTrack = {
3
+ id: "platform_primitives_tour",
4
+ productId: "contractspec-platform",
5
+ name: "Platform Primitives Tour",
6
+ description: "Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.",
7
+ targetUserSegment: "platform_developer",
8
+ targetRole: "developer",
9
+ totalXp: 140,
10
+ completionRewards: {
11
+ xpBonus: 20,
12
+ badgeKey: "platform_primitives"
13
+ },
14
+ steps: [
15
+ {
16
+ id: "identity_rbac",
17
+ title: "Create org and member",
18
+ description: "Create an org and add at least one member.",
19
+ order: 1,
20
+ completion: {
21
+ eventName: "org.member.added",
22
+ sourceModule: "@contractspec/lib.identity-rbac"
23
+ },
24
+ xpReward: 20,
25
+ metadata: { surface: "identity" }
26
+ },
27
+ {
28
+ id: "event_bus_audit",
29
+ title: "Emit an auditable event",
30
+ description: "Emit an event that lands in the audit log.",
31
+ order: 2,
32
+ completion: {
33
+ eventName: "audit_log.created",
34
+ sourceModule: "@contractspec/module.audit-trail"
35
+ },
36
+ xpReward: 20,
37
+ metadata: { surface: "bus+audit" }
38
+ },
39
+ {
40
+ id: "notifications",
41
+ title: "Send a notification",
42
+ description: "Send yourself a notification and verify delivery.",
43
+ order: 3,
44
+ completion: {
45
+ eventName: "notification.sent",
46
+ sourceModule: "@contractspec/module.notifications"
47
+ },
48
+ xpReward: 20,
49
+ metadata: { surface: "notifications" }
50
+ },
51
+ {
52
+ id: "jobs_scheduler",
53
+ title: "Schedule and run a job",
54
+ description: "Schedule a background job and let it run once.",
55
+ order: 4,
56
+ completion: {
57
+ eventName: "job.completed",
58
+ sourceModule: "@contractspec/lib.jobs"
59
+ },
60
+ xpReward: 20,
61
+ metadata: { surface: "jobs" }
62
+ },
63
+ {
64
+ id: "feature_flags",
65
+ title: "Create and toggle a feature flag",
66
+ description: "Create a feature flag and toggle it at least once.",
67
+ order: 5,
68
+ completion: {
69
+ eventName: "flag.toggled",
70
+ sourceModule: "@contractspec/lib.feature-flags"
71
+ },
72
+ xpReward: 20,
73
+ metadata: { surface: "feature-flags" }
74
+ },
75
+ {
76
+ id: "files_attachments",
77
+ title: "Attach a file",
78
+ description: "Upload and attach a file to any entity.",
79
+ order: 6,
80
+ completion: {
81
+ eventName: "attachment.attached",
82
+ sourceModule: "@contractspec/lib.files"
83
+ },
84
+ xpReward: 20,
85
+ metadata: { surface: "files" }
86
+ },
87
+ {
88
+ id: "usage_metering",
89
+ title: "Record usage",
90
+ description: "Emit a usage metric (regeneration, agent run, or similar).",
91
+ order: 7,
92
+ completion: {
93
+ eventName: "usage.recorded",
94
+ sourceModule: "@contractspec/lib.metering"
95
+ },
96
+ xpReward: 20,
97
+ metadata: { surface: "metering" }
98
+ }
99
+ ],
100
+ metadata: { surfacedIn: ["studio/learning", "platform/dev-center"] }
101
+ };
102
+ const platformLearningTracks = [platformPrimitivesTourTrack];
103
+
104
+ //#endregion
105
+ export { platformLearningTracks, platformPrimitivesTourTrack };
106
+ //# sourceMappingURL=track.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"track.js","names":["platformPrimitivesTourTrack: LearningJourneyTrackSpec","platformLearningTracks: LearningJourneyTrackSpec[]"],"sources":["../src/track.ts"],"sourcesContent":["import type { LearningJourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';\n\nexport const platformPrimitivesTourTrack: LearningJourneyTrackSpec = {\n id: 'platform_primitives_tour',\n productId: 'contractspec-platform',\n name: 'Platform Primitives Tour',\n description:\n 'Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.',\n targetUserSegment: 'platform_developer',\n targetRole: 'developer',\n totalXp: 140,\n completionRewards: { xpBonus: 20, badgeKey: 'platform_primitives' },\n steps: [\n {\n id: 'identity_rbac',\n title: 'Create org and member',\n description: 'Create an org and add at least one member.',\n order: 1,\n completion: {\n eventName: 'org.member.added',\n sourceModule: '@contractspec/lib.identity-rbac',\n },\n xpReward: 20,\n metadata: { surface: 'identity' },\n },\n {\n id: 'event_bus_audit',\n title: 'Emit an auditable event',\n description: 'Emit an event that lands in the audit log.',\n order: 2,\n completion: {\n eventName: 'audit_log.created',\n sourceModule: '@contractspec/module.audit-trail',\n },\n xpReward: 20,\n metadata: { surface: 'bus+audit' },\n },\n {\n id: 'notifications',\n title: 'Send a notification',\n description: 'Send yourself a notification and verify delivery.',\n order: 3,\n completion: {\n eventName: 'notification.sent',\n sourceModule: '@contractspec/module.notifications',\n },\n xpReward: 20,\n metadata: { surface: 'notifications' },\n },\n {\n id: 'jobs_scheduler',\n title: 'Schedule and run a job',\n description: 'Schedule a background job and let it run once.',\n order: 4,\n completion: {\n eventName: 'job.completed',\n sourceModule: '@contractspec/lib.jobs',\n },\n xpReward: 20,\n metadata: { surface: 'jobs' },\n },\n {\n id: 'feature_flags',\n title: 'Create and toggle a feature flag',\n description: 'Create a feature flag and toggle it at least once.',\n order: 5,\n completion: {\n eventName: 'flag.toggled',\n sourceModule: '@contractspec/lib.feature-flags',\n },\n xpReward: 20,\n metadata: { surface: 'feature-flags' },\n },\n {\n id: 'files_attachments',\n title: 'Attach a file',\n description: 'Upload and attach a file to any entity.',\n order: 6,\n completion: {\n eventName: 'attachment.attached',\n sourceModule: '@contractspec/lib.files',\n },\n xpReward: 20,\n metadata: { surface: 'files' },\n },\n {\n id: 'usage_metering',\n title: 'Record usage',\n description: 'Emit a usage metric (regeneration, agent run, or similar).',\n order: 7,\n completion: {\n eventName: 'usage.recorded',\n sourceModule: '@contractspec/lib.metering',\n },\n xpReward: 20,\n metadata: { surface: 'metering' },\n },\n ],\n metadata: {\n surfacedIn: ['studio/learning', 'platform/dev-center'],\n },\n};\n\nexport const platformLearningTracks: LearningJourneyTrackSpec[] = [\n platformPrimitivesTourTrack,\n];\n"],"mappings":";AAEA,MAAaA,8BAAwD;CACnE,IAAI;CACJ,WAAW;CACX,MAAM;CACN,aACE;CACF,mBAAmB;CACnB,YAAY;CACZ,SAAS;CACT,mBAAmB;EAAE,SAAS;EAAI,UAAU;EAAuB;CACnE,OAAO;EACL;GACE,IAAI;GACJ,OAAO;GACP,aAAa;GACb,OAAO;GACP,YAAY;IACV,WAAW;IACX,cAAc;IACf;GACD,UAAU;GACV,UAAU,EAAE,SAAS,YAAY;GAClC;EACD;GACE,IAAI;GACJ,OAAO;GACP,aAAa;GACb,OAAO;GACP,YAAY;IACV,WAAW;IACX,cAAc;IACf;GACD,UAAU;GACV,UAAU,EAAE,SAAS,aAAa;GACnC;EACD;GACE,IAAI;GACJ,OAAO;GACP,aAAa;GACb,OAAO;GACP,YAAY;IACV,WAAW;IACX,cAAc;IACf;GACD,UAAU;GACV,UAAU,EAAE,SAAS,iBAAiB;GACvC;EACD;GACE,IAAI;GACJ,OAAO;GACP,aAAa;GACb,OAAO;GACP,YAAY;IACV,WAAW;IACX,cAAc;IACf;GACD,UAAU;GACV,UAAU,EAAE,SAAS,QAAQ;GAC9B;EACD;GACE,IAAI;GACJ,OAAO;GACP,aAAa;GACb,OAAO;GACP,YAAY;IACV,WAAW;IACX,cAAc;IACf;GACD,UAAU;GACV,UAAU,EAAE,SAAS,iBAAiB;GACvC;EACD;GACE,IAAI;GACJ,OAAO;GACP,aAAa;GACb,OAAO;GACP,YAAY;IACV,WAAW;IACX,cAAc;IACf;GACD,UAAU;GACV,UAAU,EAAE,SAAS,SAAS;GAC/B;EACD;GACE,IAAI;GACJ,OAAO;GACP,aAAa;GACb,OAAO;GACP,YAAY;IACV,WAAW;IACX,cAAc;IACf;GACD,UAAU;GACV,UAAU,EAAE,SAAS,YAAY;GAClC;EACF;CACD,UAAU,EACR,YAAY,CAAC,mBAAmB,sBAAsB,EACvD;CACF;AAED,MAAaC,yBAAqD,CAChE,4BACD"}
package/example.ts ADDED
@@ -0,0 +1 @@
1
+ export { default } from './src/example';