@contractspec/example.learning-journey-platform-tour 3.7.17 → 3.7.19

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 (33) hide show
  1. package/.turbo/turbo-build.log +33 -33
  2. package/CHANGELOG.md +20 -0
  3. package/dist/browser/docs/index.js +1 -37
  4. package/dist/browser/docs/platform-tour.docblock.js +1 -37
  5. package/dist/browser/example.js +1 -34
  6. package/dist/browser/handlers/demo.handlers.js +1 -130
  7. package/dist/browser/index.js +1 -416
  8. package/dist/browser/learning-journey-platform-tour.feature.js +1 -48
  9. package/dist/browser/operations/index.js +1 -221
  10. package/dist/browser/presentations/index.js +1 -268
  11. package/dist/browser/tests/operations.test-spec.js +1 -34
  12. package/dist/browser/track.js +1 -107
  13. package/dist/docs/index.js +1 -37
  14. package/dist/docs/platform-tour.docblock.js +1 -37
  15. package/dist/example.js +1 -34
  16. package/dist/handlers/demo.handlers.js +1 -130
  17. package/dist/index.js +1 -416
  18. package/dist/learning-journey-platform-tour.feature.js +1 -48
  19. package/dist/node/docs/index.js +1 -37
  20. package/dist/node/docs/platform-tour.docblock.js +1 -37
  21. package/dist/node/example.js +1 -34
  22. package/dist/node/handlers/demo.handlers.js +1 -130
  23. package/dist/node/index.js +1 -416
  24. package/dist/node/learning-journey-platform-tour.feature.js +1 -48
  25. package/dist/node/operations/index.js +1 -221
  26. package/dist/node/presentations/index.js +1 -268
  27. package/dist/node/tests/operations.test-spec.js +1 -34
  28. package/dist/node/track.js +1 -107
  29. package/dist/operations/index.js +1 -221
  30. package/dist/presentations/index.js +1 -268
  31. package/dist/tests/operations.test-spec.js +1 -34
  32. package/dist/track.js +1 -107
  33. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -1,417 +1,2 @@
1
1
  // @bun
2
- // src/docs/platform-tour.docblock.ts
3
- import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
4
- var platformTourDocBlocks = [
5
- {
6
- id: "docs.learning-journey.platform-tour",
7
- title: "Learning Journey \u2014 Platform Primitives Tour",
8
- summary: "Cross-module tour that touches identity, audit, notifications, jobs, feature flags, files, and metering.",
9
- kind: "reference",
10
- visibility: "public",
11
- route: "/docs/learning-journey/platform-tour",
12
- tags: ["learning", "platform", "onboarding"],
13
- body: `## Track
14
- - **Key**: \`platform_primitives_tour\`
15
- - **Persona**: platform developer exploring primitives
16
- - **Goal**: Touch each cross-cutting module once, event-driven completion
17
-
18
- ## Steps & Events
19
- 1) \`identity_rbac\` \u2192 \`org.member.added\`
20
- 2) \`event_bus_audit\` \u2192 \`audit_log.created\`
21
- 3) \`notifications\` \u2192 \`notification.sent\`
22
- 4) \`jobs_scheduler\` \u2192 \`job.completed\`
23
- 5) \`feature_flags\` \u2192 \`flag.toggled\`
24
- 6) \`files_attachments\` \u2192 \`attachment.attached\`
25
- 7) \`usage_metering\` \u2192 \`usage.recorded\`
26
-
27
- XP: 20 per step, 20 bonus XP upon completion.
28
-
29
- ## Wiring
30
- - Tracks export from \`@contractspec/example.learning-journey-platform-tour/track\`.
31
- - Use onboarding API to surface progress:
32
- - \`learning.onboarding.listTracks\`
33
- - \`learning.onboarding.getProgress\`
34
- - \`learning.onboarding.recordEvent\` wired from each module's event bus handlers.
35
- - Align event payloads with modules: identity-rbac, audit-trail, notifications, jobs, feature-flags, files, metering.`
36
- }
37
- ];
38
- registerDocBlocks(platformTourDocBlocks);
39
- // src/example.ts
40
- import { defineExample } from "@contractspec/lib.contracts-spec";
41
- var example = defineExample({
42
- meta: {
43
- key: "learning-journey-platform-tour",
44
- version: "1.0.0",
45
- title: "Learning Journey \u2014 Platform Tour",
46
- description: "Learning journey track + contracts + presentations for a platform tour.",
47
- kind: "template",
48
- visibility: "public",
49
- stability: "experimental",
50
- owners: ["@platform.core"],
51
- tags: ["learning", "journey", "platform-tour"]
52
- },
53
- docs: {
54
- rootDocId: "docs.examples.platform-tour",
55
- goalDocId: "docs.examples.platform-tour.goal",
56
- usageDocId: "docs.examples.platform-tour.usage"
57
- },
58
- entrypoints: {
59
- packageName: "@contractspec/example.learning-journey-platform-tour",
60
- docs: "./docs"
61
- },
62
- surfaces: {
63
- templates: true,
64
- sandbox: { enabled: true, modes: ["markdown", "playground"] },
65
- studio: { enabled: true, installable: true },
66
- mcp: { enabled: true }
67
- }
68
- });
69
- var example_default = example;
70
-
71
- // src/track.ts
72
- var platformPrimitivesTourTrack = {
73
- id: "platform_primitives_tour",
74
- productId: "contractspec-platform",
75
- name: "Platform Primitives Tour",
76
- description: "Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.",
77
- targetUserSegment: "platform_developer",
78
- targetRole: "developer",
79
- totalXp: 140,
80
- completionRewards: { xpBonus: 20, badgeKey: "platform_primitives" },
81
- steps: [
82
- {
83
- id: "identity_rbac",
84
- title: "Create org and member",
85
- description: "Create an org and add at least one member.",
86
- order: 1,
87
- completion: {
88
- eventName: "org.member.added",
89
- sourceModule: "@contractspec/lib.identity-rbac"
90
- },
91
- xpReward: 20,
92
- metadata: { surface: "identity" }
93
- },
94
- {
95
- id: "event_bus_audit",
96
- title: "Emit an auditable event",
97
- description: "Emit an event that lands in the audit log.",
98
- order: 2,
99
- completion: {
100
- eventName: "audit_log.created",
101
- sourceModule: "@contractspec/module.audit-trail"
102
- },
103
- xpReward: 20,
104
- metadata: { surface: "bus+audit" }
105
- },
106
- {
107
- id: "notifications",
108
- title: "Send a notification",
109
- description: "Send yourself a notification and verify delivery.",
110
- order: 3,
111
- completion: {
112
- eventName: "notification.sent",
113
- sourceModule: "@contractspec/module.notifications"
114
- },
115
- xpReward: 20,
116
- metadata: { surface: "notifications" }
117
- },
118
- {
119
- id: "jobs_scheduler",
120
- title: "Schedule and run a job",
121
- description: "Schedule a background job and let it run once.",
122
- order: 4,
123
- completion: {
124
- eventName: "job.completed",
125
- sourceModule: "@contractspec/lib.jobs"
126
- },
127
- xpReward: 20,
128
- metadata: { surface: "jobs" }
129
- },
130
- {
131
- id: "feature_flags",
132
- title: "Create and toggle a feature flag",
133
- description: "Create a feature flag and toggle it at least once.",
134
- order: 5,
135
- completion: {
136
- eventName: "flag.toggled",
137
- sourceModule: "@contractspec/lib.feature-flags"
138
- },
139
- xpReward: 20,
140
- metadata: { surface: "feature-flags" }
141
- },
142
- {
143
- id: "files_attachments",
144
- title: "Attach a file",
145
- description: "Upload and attach a file to any entity.",
146
- order: 6,
147
- completion: {
148
- eventName: "attachment.attached",
149
- sourceModule: "@contractspec/lib.files"
150
- },
151
- xpReward: 20,
152
- metadata: { surface: "files" }
153
- },
154
- {
155
- id: "usage_metering",
156
- title: "Record usage",
157
- description: "Emit a usage metric (regeneration, agent run, or similar).",
158
- order: 7,
159
- completion: {
160
- eventName: "usage.recorded",
161
- sourceModule: "@contractspec/lib.metering"
162
- },
163
- xpReward: 20,
164
- metadata: { surface: "metering" }
165
- }
166
- ],
167
- metadata: {
168
- surfacedIn: ["studio/learning", "platform/dev-center"]
169
- }
170
- };
171
- var platformLearningTracks = [
172
- platformPrimitivesTourTrack
173
- ];
174
-
175
- // src/handlers/demo.handlers.ts
176
- var platformTourEvents = [
177
- "org.member.added",
178
- "audit_log.created",
179
- "notification.sent",
180
- "job.completed",
181
- "flag.toggled",
182
- "attachment.attached",
183
- "usage.recorded"
184
- ];
185
- var emitPlatformTourEvent = (eventName, { learnerId, occurredAt = new Date, payload }, record) => {
186
- const event = {
187
- learnerId,
188
- name: eventName,
189
- occurredAt,
190
- payload,
191
- trackId: platformPrimitivesTourTrack.id
192
- };
193
- return record ? record(event) : event;
194
- };
195
- var emitAllPlatformTourEvents = (params, record) => platformTourEvents.map((name) => emitPlatformTourEvent(name, params, record));
196
-
197
- // src/learning-journey-platform-tour.feature.ts
198
- import { defineFeature } from "@contractspec/lib.contracts-spec";
199
- var LearningJourneyPlatformTourFeature = defineFeature({
200
- meta: {
201
- key: "learning-journey-platform-tour",
202
- version: "1.0.0",
203
- title: "Learning Journey: Platform Tour",
204
- description: "Platform primitives tour journey for exploring ContractSpec core features",
205
- domain: "learning-journey",
206
- owners: ["@examples.learning-journey.platform-tour"],
207
- tags: ["learning", "platform", "tour", "journey"],
208
- stability: "experimental"
209
- },
210
- operations: [
211
- { key: "learningJourney.platformTour.recordEvent", version: "1.0.0" },
212
- { key: "learningJourney.platformTour.getTrack", version: "1.0.0" }
213
- ],
214
- events: [],
215
- presentations: [
216
- { key: "learning.journey.platform.track", version: "1.0.0" },
217
- { key: "learning.journey.platform.widget", version: "1.0.0" }
218
- ],
219
- opToPresentation: [
220
- {
221
- op: { key: "learningJourney.platformTour.getTrack", version: "1.0.0" },
222
- pres: { key: "learning.journey.platform.track", version: "1.0.0" }
223
- }
224
- ],
225
- presentationsTargets: [
226
- {
227
- key: "learning.journey.platform.track",
228
- version: "1.0.0",
229
- targets: ["react", "markdown", "application/json"]
230
- },
231
- {
232
- key: "learning.journey.platform.widget",
233
- version: "1.0.0",
234
- targets: ["react"]
235
- }
236
- ],
237
- capabilities: {
238
- requires: [{ key: "identity", version: "1.0.0" }]
239
- },
240
- docs: ["docs.learning-journey.platform-tour"]
241
- });
242
-
243
- // src/operations/index.ts
244
- import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
245
- import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
246
- var OWNERS = ["examples.learning-journey.platform-tour"];
247
- var StepModel = defineSchemaModel({
248
- name: "PlatformTourStep",
249
- description: "Step metadata for platform primitives tour",
250
- fields: {
251
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
252
- title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
253
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
254
- completionEvent: {
255
- type: ScalarTypeEnum.String_unsecure(),
256
- isOptional: false
257
- },
258
- sourceModule: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
259
- xpReward: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
260
- order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true }
261
- }
262
- });
263
- var PlatformTourTrackModel = defineSchemaModel({
264
- name: "PlatformTourTrack",
265
- description: "Platform primitives tour track definition",
266
- fields: {
267
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
268
- name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
269
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
270
- totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
271
- completionXpBonus: {
272
- type: ScalarTypeEnum.Int_unsecure(),
273
- isOptional: true
274
- },
275
- completionBadgeKey: {
276
- type: ScalarTypeEnum.String_unsecure(),
277
- isOptional: true
278
- },
279
- streakHoursWindow: {
280
- type: ScalarTypeEnum.Int_unsecure(),
281
- isOptional: true
282
- },
283
- streakBonusXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
284
- steps: { type: StepModel, isArray: true, isOptional: false }
285
- }
286
- });
287
- var TrackResponseModel = defineSchemaModel({
288
- name: "PlatformTourTrackResponse",
289
- description: "Response wrapper for platform tour track",
290
- fields: {
291
- track: { type: PlatformTourTrackModel, isOptional: false }
292
- }
293
- });
294
- var RecordDemoEventInput = defineSchemaModel({
295
- name: "PlatformTourRecordEventInput",
296
- description: "Emit a demo event to advance platform tour steps",
297
- fields: {
298
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
299
- eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
300
- payload: { type: ScalarTypeEnum.JSON(), isOptional: true },
301
- occurredAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
302
- }
303
- });
304
- var SuccessModel = defineSchemaModel({
305
- name: "PlatformTourSuccess",
306
- description: "Generic success response",
307
- fields: {
308
- success: { type: ScalarTypeEnum.Boolean(), isOptional: false }
309
- }
310
- });
311
- var GetPlatformTourTrack = defineQuery({
312
- meta: {
313
- key: "learningJourney.platformTour.getTrack",
314
- version: "1.0.0",
315
- stability: "experimental",
316
- owners: [...OWNERS],
317
- tags: ["learning", "platform", "tour"],
318
- description: "Fetch platform primitives tour track definition.",
319
- goal: "Expose track metadata to UIs and templates.",
320
- context: "Called by Studio/Playground to render journey steps."
321
- },
322
- io: {
323
- input: defineSchemaModel({
324
- name: "PlatformTourTrackInput",
325
- description: "Track input",
326
- fields: {}
327
- }),
328
- output: TrackResponseModel
329
- },
330
- policy: { auth: "user" }
331
- });
332
- var RecordPlatformTourEvent = defineCommand({
333
- meta: {
334
- key: "learningJourney.platformTour.recordEvent",
335
- version: "1.0.0",
336
- stability: "experimental",
337
- owners: [...OWNERS],
338
- tags: ["learning", "platform", "tour"],
339
- description: "Record an event to advance platform tour progress.",
340
- goal: "Advance steps via domain events in demo/sandbox contexts.",
341
- context: "Called by handlers or demo scripts to emit step completion events."
342
- },
343
- io: {
344
- input: RecordDemoEventInput,
345
- output: SuccessModel
346
- },
347
- policy: { auth: "user" }
348
- });
349
- var platformTourContracts = {
350
- GetPlatformTourTrack,
351
- RecordPlatformTourEvent,
352
- track: platformPrimitivesTourTrack
353
- };
354
-
355
- // src/presentations/index.ts
356
- import {
357
- definePresentation,
358
- StabilityEnum
359
- } from "@contractspec/lib.contracts-spec";
360
- var baseMeta = {
361
- domain: "learning-journey",
362
- title: "Platform Tour",
363
- owners: ["@examples.learning-journey.platform-tour"],
364
- tags: ["learning", "platform", "tour"],
365
- stability: StabilityEnum.Experimental,
366
- goal: "Visualize platform tour progress",
367
- context: "Used in platform tour dashboard and widgets"
368
- };
369
- var PlatformTourTrackPresentation = definePresentation({
370
- meta: {
371
- key: "learning.journey.platform.track",
372
- version: "1.0.0",
373
- description: "Platform primitives tour track detail",
374
- ...baseMeta
375
- },
376
- source: {
377
- type: "component",
378
- framework: "react",
379
- componentKey: "LearningTrackDetail",
380
- props: PlatformTourTrackModel
381
- },
382
- targets: ["react", "markdown", "application/json"]
383
- });
384
- var PlatformTourWidgetPresentation = definePresentation({
385
- meta: {
386
- key: "learning.journey.platform.widget",
387
- version: "1.0.0",
388
- description: "Compact widget for platform tour progress",
389
- ...baseMeta
390
- },
391
- source: {
392
- type: "component",
393
- framework: "react",
394
- componentKey: "LearningTrackProgressWidget"
395
- },
396
- targets: ["react"]
397
- });
398
- var platformTourPresentations = [
399
- PlatformTourTrackPresentation,
400
- PlatformTourWidgetPresentation
401
- ];
402
- export {
403
- platformTourPresentations,
404
- platformTourEvents,
405
- platformTourContracts,
406
- platformPrimitivesTourTrack,
407
- platformLearningTracks,
408
- example_default as example,
409
- emitPlatformTourEvent,
410
- emitAllPlatformTourEvents,
411
- RecordPlatformTourEvent,
412
- PlatformTourWidgetPresentation,
413
- PlatformTourTrackPresentation,
414
- PlatformTourTrackModel,
415
- LearningJourneyPlatformTourFeature,
416
- GetPlatformTourTrack
417
- };
2
+ import{registerDocBlocks as l}from"@contractspec/lib.contracts-spec/docs";var f=[{id:"docs.learning-journey.platform-tour",title:"Learning Journey \u2014 Platform Primitives Tour",summary:"Cross-module tour that touches identity, audit, notifications, jobs, feature flags, files, and metering.",kind:"reference",visibility:"public",route:"/docs/learning-journey/platform-tour",tags:["learning","platform","onboarding"],body:"## Track\n- **Key**: `platform_primitives_tour`\n- **Persona**: platform developer exploring primitives\n- **Goal**: Touch each cross-cutting module once, event-driven completion\n\n## Steps & Events\n1) `identity_rbac` \u2192 `org.member.added`\n2) `event_bus_audit` \u2192 `audit_log.created`\n3) `notifications` \u2192 `notification.sent`\n4) `jobs_scheduler` \u2192 `job.completed`\n5) `feature_flags` \u2192 `flag.toggled`\n6) `files_attachments` \u2192 `attachment.attached`\n7) `usage_metering` \u2192 `usage.recorded`\n\nXP: 20 per step, 20 bonus XP upon completion.\n\n## Wiring\n- Tracks export from `@contractspec/example.learning-journey-platform-tour/track`.\n- Use onboarding API to surface progress:\n - `learning.onboarding.listTracks`\n - `learning.onboarding.getProgress`\n - `learning.onboarding.recordEvent` wired from each module's event bus handlers.\n- Align event payloads with modules: identity-rbac, audit-trail, notifications, jobs, feature-flags, files, metering."}];l(f);import{defineExample as p}from"@contractspec/lib.contracts-spec";var v=p({meta:{key:"learning-journey-platform-tour",version:"1.0.0",title:"Learning Journey \u2014 Platform Tour",description:"Learning journey track + contracts + presentations for a platform tour.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","journey","platform-tour"]},docs:{rootDocId:"docs.examples.platform-tour",goalDocId:"docs.examples.platform-tour.goal",usageDocId:"docs.examples.platform-tour.usage"},entrypoints:{packageName:"@contractspec/example.learning-journey-platform-tour",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown","playground"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),b=v;var r={id:"platform_primitives_tour",productId:"contractspec-platform",name:"Platform Primitives Tour",description:"Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.",targetUserSegment:"platform_developer",targetRole:"developer",totalXp:140,completionRewards:{xpBonus:20,badgeKey:"platform_primitives"},steps:[{id:"identity_rbac",title:"Create org and member",description:"Create an org and add at least one member.",order:1,completion:{eventName:"org.member.added",sourceModule:"@contractspec/lib.identity-rbac"},xpReward:20,metadata:{surface:"identity"}},{id:"event_bus_audit",title:"Emit an auditable event",description:"Emit an event that lands in the audit log.",order:2,completion:{eventName:"audit_log.created",sourceModule:"@contractspec/module.audit-trail"},xpReward:20,metadata:{surface:"bus+audit"}},{id:"notifications",title:"Send a notification",description:"Send yourself a notification and verify delivery.",order:3,completion:{eventName:"notification.sent",sourceModule:"@contractspec/module.notifications"},xpReward:20,metadata:{surface:"notifications"}},{id:"jobs_scheduler",title:"Schedule and run a job",description:"Schedule a background job and let it run once.",order:4,completion:{eventName:"job.completed",sourceModule:"@contractspec/lib.jobs"},xpReward:20,metadata:{surface:"jobs"}},{id:"feature_flags",title:"Create and toggle a feature flag",description:"Create a feature flag and toggle it at least once.",order:5,completion:{eventName:"flag.toggled",sourceModule:"@contractspec/lib.feature-flags"},xpReward:20,metadata:{surface:"feature-flags"}},{id:"files_attachments",title:"Attach a file",description:"Upload and attach a file to any entity.",order:6,completion:{eventName:"attachment.attached",sourceModule:"@contractspec/lib.files"},xpReward:20,metadata:{surface:"files"}},{id:"usage_metering",title:"Record usage",description:"Emit a usage metric (regeneration, agent run, or similar).",order:7,completion:{eventName:"usage.recorded",sourceModule:"@contractspec/lib.metering"},xpReward:20,metadata:{surface:"metering"}}],metadata:{surfacedIn:["studio/learning","platform/dev-center"]}},y=[r];var _=["org.member.added","audit_log.created","notification.sent","job.completed","flag.toggled","attachment.attached","usage.recorded"],w=(a,{learnerId:i,occurredAt:o=new Date,payload:u},d)=>{let s={learnerId:i,name:a,occurredAt:o,payload:u,trackId:r.id};return d?d(s):s},P=(a,i)=>_.map((o)=>w(o,a,i));import{defineFeature as x}from"@contractspec/lib.contracts-spec";var Z=x({meta:{key:"learning-journey-platform-tour",version:"1.0.0",title:"Learning Journey: Platform Tour",description:"Platform primitives tour journey for exploring ContractSpec core features",domain:"learning-journey",owners:["@examples.learning-journey.platform-tour"],tags:["learning","platform","tour","journey"],stability:"experimental"},operations:[{key:"learningJourney.platformTour.recordEvent",version:"1.0.0"},{key:"learningJourney.platformTour.getTrack",version:"1.0.0"}],events:[],presentations:[{key:"learning.journey.platform.track",version:"1.0.0"},{key:"learning.journey.platform.widget",version:"1.0.0"}],opToPresentation:[{op:{key:"learningJourney.platformTour.getTrack",version:"1.0.0"},pres:{key:"learning.journey.platform.track",version:"1.0.0"}}],presentationsTargets:[{key:"learning.journey.platform.track",version:"1.0.0",targets:["react","markdown","application/json"]},{key:"learning.journey.platform.widget",version:"1.0.0",targets:["react"]}],capabilities:{requires:[{key:"identity",version:"1.0.0"}]},docs:["docs.learning-journey.platform-tour"]});import{defineCommand as R,defineQuery as j}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as e,ScalarTypeEnum as t}from"@contractspec/lib.schema";var g=["examples.learning-journey.platform-tour"],L=e({name:"PlatformTourStep",description:"Step metadata for platform primitives tour",fields:{id:{type:t.String_unsecure(),isOptional:!1},title:{type:t.String_unsecure(),isOptional:!1},description:{type:t.String_unsecure(),isOptional:!0},completionEvent:{type:t.String_unsecure(),isOptional:!1},sourceModule:{type:t.String_unsecure(),isOptional:!0},xpReward:{type:t.Int_unsecure(),isOptional:!0},order:{type:t.Int_unsecure(),isOptional:!0}}}),n=e({name:"PlatformTourTrack",description:"Platform primitives tour track definition",fields:{id:{type:t.String_unsecure(),isOptional:!1},name:{type:t.String_unsecure(),isOptional:!1},description:{type:t.String_unsecure(),isOptional:!0},totalXp:{type:t.Int_unsecure(),isOptional:!0},completionXpBonus:{type:t.Int_unsecure(),isOptional:!0},completionBadgeKey:{type:t.String_unsecure(),isOptional:!0},streakHoursWindow:{type:t.Int_unsecure(),isOptional:!0},streakBonusXp:{type:t.Int_unsecure(),isOptional:!0},steps:{type:L,isArray:!0,isOptional:!1}}}),J=e({name:"PlatformTourTrackResponse",description:"Response wrapper for platform tour track",fields:{track:{type:n,isOptional:!1}}}),h=e({name:"PlatformTourRecordEventInput",description:"Emit a demo event to advance platform tour steps",fields:{learnerId:{type:t.String_unsecure(),isOptional:!1},eventName:{type:t.String_unsecure(),isOptional:!1},payload:{type:t.JSON(),isOptional:!0},occurredAt:{type:t.DateTime(),isOptional:!0}}}),I=e({name:"PlatformTourSuccess",description:"Generic success response",fields:{success:{type:t.Boolean(),isOptional:!1}}}),N=j({meta:{key:"learningJourney.platformTour.getTrack",version:"1.0.0",stability:"experimental",owners:[...g],tags:["learning","platform","tour"],description:"Fetch platform primitives tour track definition.",goal:"Expose track metadata to UIs and templates.",context:"Called by Studio/Playground to render journey steps."},io:{input:e({name:"PlatformTourTrackInput",description:"Track input",fields:{}}),output:J},policy:{auth:"user"}}),A=R({meta:{key:"learningJourney.platformTour.recordEvent",version:"1.0.0",stability:"experimental",owners:[...g],tags:["learning","platform","tour"],description:"Record an event to advance platform tour progress.",goal:"Advance steps via domain events in demo/sandbox contexts.",context:"Called by handlers or demo scripts to emit step completion events."},io:{input:h,output:I},policy:{auth:"user"}}),Q={GetPlatformTourTrack:N,RecordPlatformTourEvent:A,track:r};import{definePresentation as c,StabilityEnum as k}from"@contractspec/lib.contracts-spec";var m={domain:"learning-journey",title:"Platform Tour",owners:["@examples.learning-journey.platform-tour"],tags:["learning","platform","tour"],stability:k.Experimental,goal:"Visualize platform tour progress",context:"Used in platform tour dashboard and widgets"},C=c({meta:{key:"learning.journey.platform.track",version:"1.0.0",description:"Platform primitives tour track detail",...m},source:{type:"component",framework:"react",componentKey:"LearningTrackDetail",props:n},targets:["react","markdown","application/json"]}),U=c({meta:{key:"learning.journey.platform.widget",version:"1.0.0",description:"Compact widget for platform tour progress",...m},source:{type:"component",framework:"react",componentKey:"LearningTrackProgressWidget"},targets:["react"]}),E=[C,U];export{E as platformTourPresentations,_ as platformTourEvents,Q as platformTourContracts,r as platformPrimitivesTourTrack,y as platformLearningTracks,b as example,w as emitPlatformTourEvent,P as emitAllPlatformTourEvents,A as RecordPlatformTourEvent,U as PlatformTourWidgetPresentation,C as PlatformTourTrackPresentation,n as PlatformTourTrackModel,Z as LearningJourneyPlatformTourFeature,N as GetPlatformTourTrack};
@@ -1,49 +1,2 @@
1
1
  // @bun
2
- // src/learning-journey-platform-tour.feature.ts
3
- import { defineFeature } from "@contractspec/lib.contracts-spec";
4
- var LearningJourneyPlatformTourFeature = defineFeature({
5
- meta: {
6
- key: "learning-journey-platform-tour",
7
- version: "1.0.0",
8
- title: "Learning Journey: Platform Tour",
9
- description: "Platform primitives tour journey for exploring ContractSpec core features",
10
- domain: "learning-journey",
11
- owners: ["@examples.learning-journey.platform-tour"],
12
- tags: ["learning", "platform", "tour", "journey"],
13
- stability: "experimental"
14
- },
15
- operations: [
16
- { key: "learningJourney.platformTour.recordEvent", version: "1.0.0" },
17
- { key: "learningJourney.platformTour.getTrack", version: "1.0.0" }
18
- ],
19
- events: [],
20
- presentations: [
21
- { key: "learning.journey.platform.track", version: "1.0.0" },
22
- { key: "learning.journey.platform.widget", version: "1.0.0" }
23
- ],
24
- opToPresentation: [
25
- {
26
- op: { key: "learningJourney.platformTour.getTrack", version: "1.0.0" },
27
- pres: { key: "learning.journey.platform.track", version: "1.0.0" }
28
- }
29
- ],
30
- presentationsTargets: [
31
- {
32
- key: "learning.journey.platform.track",
33
- version: "1.0.0",
34
- targets: ["react", "markdown", "application/json"]
35
- },
36
- {
37
- key: "learning.journey.platform.widget",
38
- version: "1.0.0",
39
- targets: ["react"]
40
- }
41
- ],
42
- capabilities: {
43
- requires: [{ key: "identity", version: "1.0.0" }]
44
- },
45
- docs: ["docs.learning-journey.platform-tour"]
46
- });
47
- export {
48
- LearningJourneyPlatformTourFeature
49
- };
2
+ import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({meta:{key:"learning-journey-platform-tour",version:"1.0.0",title:"Learning Journey: Platform Tour",description:"Platform primitives tour journey for exploring ContractSpec core features",domain:"learning-journey",owners:["@examples.learning-journey.platform-tour"],tags:["learning","platform","tour","journey"],stability:"experimental"},operations:[{key:"learningJourney.platformTour.recordEvent",version:"1.0.0"},{key:"learningJourney.platformTour.getTrack",version:"1.0.0"}],events:[],presentations:[{key:"learning.journey.platform.track",version:"1.0.0"},{key:"learning.journey.platform.widget",version:"1.0.0"}],opToPresentation:[{op:{key:"learningJourney.platformTour.getTrack",version:"1.0.0"},pres:{key:"learning.journey.platform.track",version:"1.0.0"}}],presentationsTargets:[{key:"learning.journey.platform.track",version:"1.0.0",targets:["react","markdown","application/json"]},{key:"learning.journey.platform.widget",version:"1.0.0",targets:["react"]}],capabilities:{requires:[{key:"identity",version:"1.0.0"}]},docs:["docs.learning-journey.platform-tour"]});export{j as LearningJourneyPlatformTourFeature};
@@ -1,37 +1 @@
1
- // src/docs/platform-tour.docblock.ts
2
- import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
3
- var platformTourDocBlocks = [
4
- {
5
- id: "docs.learning-journey.platform-tour",
6
- title: "Learning Journey — Platform Primitives Tour",
7
- summary: "Cross-module tour that touches identity, audit, notifications, jobs, feature flags, files, and metering.",
8
- kind: "reference",
9
- visibility: "public",
10
- route: "/docs/learning-journey/platform-tour",
11
- tags: ["learning", "platform", "onboarding"],
12
- body: `## Track
13
- - **Key**: \`platform_primitives_tour\`
14
- - **Persona**: platform developer exploring primitives
15
- - **Goal**: Touch each cross-cutting module once, event-driven completion
16
-
17
- ## Steps & Events
18
- 1) \`identity_rbac\` → \`org.member.added\`
19
- 2) \`event_bus_audit\` → \`audit_log.created\`
20
- 3) \`notifications\` → \`notification.sent\`
21
- 4) \`jobs_scheduler\` → \`job.completed\`
22
- 5) \`feature_flags\` → \`flag.toggled\`
23
- 6) \`files_attachments\` → \`attachment.attached\`
24
- 7) \`usage_metering\` → \`usage.recorded\`
25
-
26
- XP: 20 per step, 20 bonus XP upon completion.
27
-
28
- ## Wiring
29
- - Tracks export from \`@contractspec/example.learning-journey-platform-tour/track\`.
30
- - Use onboarding API to surface progress:
31
- - \`learning.onboarding.listTracks\`
32
- - \`learning.onboarding.getProgress\`
33
- - \`learning.onboarding.recordEvent\` wired from each module's event bus handlers.
34
- - Align event payloads with modules: identity-rbac, audit-trail, notifications, jobs, feature-flags, files, metering.`
35
- }
36
- ];
37
- registerDocBlocks(platformTourDocBlocks);
1
+ import{registerDocBlocks as h}from"@contractspec/lib.contracts-spec/docs";var j=[{id:"docs.learning-journey.platform-tour",title:"Learning Journey — Platform Primitives Tour",summary:"Cross-module tour that touches identity, audit, notifications, jobs, feature flags, files, and metering.",kind:"reference",visibility:"public",route:"/docs/learning-journey/platform-tour",tags:["learning","platform","onboarding"],body:"## Track\n- **Key**: `platform_primitives_tour`\n- **Persona**: platform developer exploring primitives\n- **Goal**: Touch each cross-cutting module once, event-driven completion\n\n## Steps & Events\n1) `identity_rbac` → `org.member.added`\n2) `event_bus_audit` → `audit_log.created`\n3) `notifications` → `notification.sent`\n4) `jobs_scheduler` → `job.completed`\n5) `feature_flags` → `flag.toggled`\n6) `files_attachments` → `attachment.attached`\n7) `usage_metering` → `usage.recorded`\n\nXP: 20 per step, 20 bonus XP upon completion.\n\n## Wiring\n- Tracks export from `@contractspec/example.learning-journey-platform-tour/track`.\n- Use onboarding API to surface progress:\n - `learning.onboarding.listTracks`\n - `learning.onboarding.getProgress`\n - `learning.onboarding.recordEvent` wired from each module's event bus handlers.\n- Align event payloads with modules: identity-rbac, audit-trail, notifications, jobs, feature-flags, files, metering."}];h(j);
@@ -1,37 +1 @@
1
- // src/docs/platform-tour.docblock.ts
2
- import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
3
- var platformTourDocBlocks = [
4
- {
5
- id: "docs.learning-journey.platform-tour",
6
- title: "Learning Journey — Platform Primitives Tour",
7
- summary: "Cross-module tour that touches identity, audit, notifications, jobs, feature flags, files, and metering.",
8
- kind: "reference",
9
- visibility: "public",
10
- route: "/docs/learning-journey/platform-tour",
11
- tags: ["learning", "platform", "onboarding"],
12
- body: `## Track
13
- - **Key**: \`platform_primitives_tour\`
14
- - **Persona**: platform developer exploring primitives
15
- - **Goal**: Touch each cross-cutting module once, event-driven completion
16
-
17
- ## Steps & Events
18
- 1) \`identity_rbac\` → \`org.member.added\`
19
- 2) \`event_bus_audit\` → \`audit_log.created\`
20
- 3) \`notifications\` → \`notification.sent\`
21
- 4) \`jobs_scheduler\` → \`job.completed\`
22
- 5) \`feature_flags\` → \`flag.toggled\`
23
- 6) \`files_attachments\` → \`attachment.attached\`
24
- 7) \`usage_metering\` → \`usage.recorded\`
25
-
26
- XP: 20 per step, 20 bonus XP upon completion.
27
-
28
- ## Wiring
29
- - Tracks export from \`@contractspec/example.learning-journey-platform-tour/track\`.
30
- - Use onboarding API to surface progress:
31
- - \`learning.onboarding.listTracks\`
32
- - \`learning.onboarding.getProgress\`
33
- - \`learning.onboarding.recordEvent\` wired from each module's event bus handlers.
34
- - Align event payloads with modules: identity-rbac, audit-trail, notifications, jobs, feature-flags, files, metering.`
35
- }
36
- ];
37
- registerDocBlocks(platformTourDocBlocks);
1
+ import{registerDocBlocks as h}from"@contractspec/lib.contracts-spec/docs";var j=[{id:"docs.learning-journey.platform-tour",title:"Learning Journey — Platform Primitives Tour",summary:"Cross-module tour that touches identity, audit, notifications, jobs, feature flags, files, and metering.",kind:"reference",visibility:"public",route:"/docs/learning-journey/platform-tour",tags:["learning","platform","onboarding"],body:"## Track\n- **Key**: `platform_primitives_tour`\n- **Persona**: platform developer exploring primitives\n- **Goal**: Touch each cross-cutting module once, event-driven completion\n\n## Steps & Events\n1) `identity_rbac` → `org.member.added`\n2) `event_bus_audit` → `audit_log.created`\n3) `notifications` → `notification.sent`\n4) `jobs_scheduler` → `job.completed`\n5) `feature_flags` → `flag.toggled`\n6) `files_attachments` → `attachment.attached`\n7) `usage_metering` → `usage.recorded`\n\nXP: 20 per step, 20 bonus XP upon completion.\n\n## Wiring\n- Tracks export from `@contractspec/example.learning-journey-platform-tour/track`.\n- Use onboarding API to surface progress:\n - `learning.onboarding.listTracks`\n - `learning.onboarding.getProgress`\n - `learning.onboarding.recordEvent` wired from each module's event bus handlers.\n- Align event payloads with modules: identity-rbac, audit-trail, notifications, jobs, feature-flags, files, metering."}];h(j);
@@ -1,34 +1 @@
1
- // src/example.ts
2
- import { defineExample } from "@contractspec/lib.contracts-spec";
3
- var example = defineExample({
4
- meta: {
5
- key: "learning-journey-platform-tour",
6
- version: "1.0.0",
7
- title: "Learning Journey — Platform Tour",
8
- description: "Learning journey track + contracts + presentations for a platform tour.",
9
- kind: "template",
10
- visibility: "public",
11
- stability: "experimental",
12
- owners: ["@platform.core"],
13
- tags: ["learning", "journey", "platform-tour"]
14
- },
15
- docs: {
16
- rootDocId: "docs.examples.platform-tour",
17
- goalDocId: "docs.examples.platform-tour.goal",
18
- usageDocId: "docs.examples.platform-tour.usage"
19
- },
20
- entrypoints: {
21
- packageName: "@contractspec/example.learning-journey-platform-tour",
22
- docs: "./docs"
23
- },
24
- surfaces: {
25
- templates: true,
26
- sandbox: { enabled: true, modes: ["markdown", "playground"] },
27
- studio: { enabled: true, installable: true },
28
- mcp: { enabled: true }
29
- }
30
- });
31
- var example_default = example;
32
- export {
33
- example_default as default
34
- };
1
+ import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({meta:{key:"learning-journey-platform-tour",version:"1.0.0",title:"Learning Journey — Platform Tour",description:"Learning journey track + contracts + presentations for a platform tour.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","journey","platform-tour"]},docs:{rootDocId:"docs.examples.platform-tour",goalDocId:"docs.examples.platform-tour.goal",usageDocId:"docs.examples.platform-tour.usage"},entrypoints:{packageName:"@contractspec/example.learning-journey-platform-tour",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown","playground"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),q=h;export{q as default};