@contractspec/example.learning-journey-studio-onboarding 1.57.0 → 1.58.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 (67) hide show
  1. package/.turbo/turbo-build.log +46 -50
  2. package/.turbo/turbo-prebuild.log +1 -0
  3. package/CHANGELOG.md +14 -0
  4. package/dist/browser/docs/index.js +35 -0
  5. package/dist/browser/docs/studio-onboarding.docblock.js +35 -0
  6. package/dist/browser/example.js +32 -0
  7. package/dist/browser/handlers/demo.handlers.js +107 -0
  8. package/dist/browser/index.js +393 -0
  9. package/dist/browser/learning-journey-studio-onboarding.feature.js +50 -0
  10. package/dist/browser/operations/index.js +201 -0
  11. package/dist/browser/presentations/index.js +250 -0
  12. package/dist/browser/tests/operations.test-spec.js +34 -0
  13. package/dist/browser/track.js +87 -0
  14. package/dist/docs/index.d.ts +2 -1
  15. package/dist/docs/index.d.ts.map +1 -0
  16. package/dist/docs/index.js +36 -1
  17. package/dist/docs/studio-onboarding.docblock.d.ts +2 -1
  18. package/dist/docs/studio-onboarding.docblock.d.ts.map +1 -0
  19. package/dist/docs/studio-onboarding.docblock.js +21 -25
  20. package/dist/example.d.ts +2 -6
  21. package/dist/example.d.ts.map +1 -1
  22. package/dist/example.js +31 -39
  23. package/dist/handlers/demo.handlers.d.ts +12 -17
  24. package/dist/handlers/demo.handlers.d.ts.map +1 -1
  25. package/dist/handlers/demo.handlers.js +105 -21
  26. package/dist/index.d.ts +8 -7
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +394 -9
  29. package/dist/learning-journey-studio-onboarding.feature.d.ts +1 -6
  30. package/dist/learning-journey-studio-onboarding.feature.d.ts.map +1 -1
  31. package/dist/learning-journey-studio-onboarding.feature.js +49 -73
  32. package/dist/node/docs/index.js +35 -0
  33. package/dist/node/docs/studio-onboarding.docblock.js +35 -0
  34. package/dist/node/example.js +32 -0
  35. package/dist/node/handlers/demo.handlers.js +107 -0
  36. package/dist/node/index.js +393 -0
  37. package/dist/node/learning-journey-studio-onboarding.feature.js +50 -0
  38. package/dist/node/operations/index.js +201 -0
  39. package/dist/node/presentations/index.js +250 -0
  40. package/dist/node/tests/operations.test-spec.js +34 -0
  41. package/dist/node/track.js +87 -0
  42. package/dist/operations/index.d.ts +229 -236
  43. package/dist/operations/index.d.ts.map +1 -1
  44. package/dist/operations/index.js +193 -167
  45. package/dist/operations/index.test.d.ts +2 -0
  46. package/dist/operations/index.test.d.ts.map +1 -0
  47. package/dist/presentations/index.d.ts +3 -8
  48. package/dist/presentations/index.d.ts.map +1 -1
  49. package/dist/presentations/index.js +248 -54
  50. package/dist/tests/operations.test-spec.d.ts +1 -6
  51. package/dist/tests/operations.test-spec.d.ts.map +1 -1
  52. package/dist/tests/operations.test-spec.js +33 -34
  53. package/dist/track.d.ts +3 -7
  54. package/dist/track.d.ts.map +1 -1
  55. package/dist/track.js +87 -90
  56. package/package.json +118 -34
  57. package/tsdown.config.js +1 -2
  58. package/.turbo/turbo-build$colon$bundle.log +0 -50
  59. package/dist/docs/studio-onboarding.docblock.js.map +0 -1
  60. package/dist/example.js.map +0 -1
  61. package/dist/handlers/demo.handlers.js.map +0 -1
  62. package/dist/learning-journey-studio-onboarding.feature.js.map +0 -1
  63. package/dist/operations/index.js.map +0 -1
  64. package/dist/presentations/index.js.map +0 -1
  65. package/dist/tests/operations.test-spec.js.map +0 -1
  66. package/dist/track.js.map +0 -1
  67. package/tsconfig.tsbuildinfo +0 -1
@@ -1,176 +1,202 @@
1
- import { studioGettingStartedTrack } from "../track.js";
2
- import { defineCommand, defineQuery } from "@contractspec/lib.contracts";
3
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
1
+ // @bun
2
+ // src/track.ts
3
+ var studioGettingStartedTrack = {
4
+ id: "studio_getting_started",
5
+ productId: "contractspec-studio",
6
+ name: "Studio Getting Started",
7
+ description: "First 30 minutes in Studio: create a project, edit the spec, deploy/regenerate, and try key modules.",
8
+ targetUserSegment: "new_studio_user",
9
+ targetRole: "developer",
10
+ totalXp: 110,
11
+ streakRule: { hoursWindow: 48, bonusXp: 25 },
12
+ completionRewards: { xpBonus: 25, badgeKey: "studio_first_30m" },
13
+ steps: [
14
+ {
15
+ id: "choose_template",
16
+ title: "Choose a template",
17
+ description: "Create your first Studio project (starter template).",
18
+ order: 1,
19
+ completion: {
20
+ eventName: "studio.template.instantiated",
21
+ sourceModule: "@contractspec/bundle.studio"
22
+ },
23
+ xpReward: 20,
24
+ metadata: { surface: "projects" }
25
+ },
26
+ {
27
+ id: "edit_spec",
28
+ title: "Edit the spec",
29
+ description: "Change the spec (not generated code) and save.",
30
+ instructions: "Open spec editor, tweak a contract or presentation, save.",
31
+ order: 2,
32
+ completion: {
33
+ eventName: "spec.changed",
34
+ sourceModule: "@contractspec/bundle.studio"
35
+ },
36
+ xpReward: 20,
37
+ metadata: { surface: "spec-editor" }
38
+ },
39
+ {
40
+ id: "regenerate_app",
41
+ title: "Regenerate the app",
42
+ description: "Regenerate artifacts from the updated spec.",
43
+ order: 3,
44
+ completion: {
45
+ eventName: "regeneration.completed",
46
+ sourceModule: "@contractspec/lib.contracts/regenerator"
47
+ },
48
+ xpReward: 20,
49
+ metadata: { surface: "regenerator" }
50
+ },
51
+ {
52
+ id: "open_canvas",
53
+ title: "Open the canvas",
54
+ description: "Visit the canvas module for your project.",
55
+ order: 4,
56
+ completion: {
57
+ eventName: "module.navigated",
58
+ sourceModule: "@contractspec/bundle.studio",
59
+ payloadFilter: { moduleId: "canvas" }
60
+ },
61
+ xpReward: 20,
62
+ metadata: { surface: "canvas" }
63
+ },
64
+ {
65
+ id: "try_evolution_mode",
66
+ title: "Try evolution mode",
67
+ description: "Request a change via Evolution, then regenerate.",
68
+ order: 5,
69
+ completion: {
70
+ eventName: "studio.evolution.applied",
71
+ sourceModule: "@contractspec/lib.evolution"
72
+ },
73
+ xpReward: 30,
74
+ metadata: { surface: "evolution" }
75
+ }
76
+ ],
77
+ metadata: {
78
+ persona: "first_run",
79
+ surfacedIn: ["studio/home", "studio/sidebar/learning"]
80
+ }
81
+ };
82
+ var studioLearningTracks = [
83
+ studioGettingStartedTrack
84
+ ];
4
85
 
5
- //#region src/operations/index.ts
6
- const OWNERS = ["examples.learning-journey.studio-onboarding"];
7
- const StepModel = defineSchemaModel({
8
- name: "StudioOnboardingStep",
9
- description: "Step metadata for Studio onboarding journey",
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
- }
86
+ // src/operations/index.ts
87
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
88
+ import { defineCommand, defineQuery } from "@contractspec/lib.contracts";
89
+ var OWNERS = ["examples.learning-journey.studio-onboarding"];
90
+ var StepModel = defineSchemaModel({
91
+ name: "StudioOnboardingStep",
92
+ description: "Step metadata for Studio onboarding journey",
93
+ fields: {
94
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
95
+ title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
96
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
97
+ completionEvent: {
98
+ type: ScalarTypeEnum.String_unsecure(),
99
+ isOptional: false
100
+ },
101
+ sourceModule: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
102
+ xpReward: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
103
+ order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true }
104
+ }
40
105
  });
41
- const StudioOnboardingTrackModel = defineSchemaModel({
42
- name: "StudioOnboardingTrack",
43
- description: "Studio onboarding 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
- }
106
+ var StudioOnboardingTrackModel = defineSchemaModel({
107
+ name: "StudioOnboardingTrack",
108
+ description: "Studio onboarding track definition",
109
+ fields: {
110
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
111
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
112
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
113
+ totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
114
+ completionXpBonus: {
115
+ type: ScalarTypeEnum.Int_unsecure(),
116
+ isOptional: true
117
+ },
118
+ completionBadgeKey: {
119
+ type: ScalarTypeEnum.String_unsecure(),
120
+ isOptional: true
121
+ },
122
+ streakHoursWindow: {
123
+ type: ScalarTypeEnum.Int_unsecure(),
124
+ isOptional: true
125
+ },
126
+ streakBonusXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
127
+ steps: { type: StepModel, isArray: true, isOptional: false }
128
+ }
83
129
  });
84
- const TrackResponseModel = defineSchemaModel({
85
- name: "StudioOnboardingTrackResponse",
86
- description: "Response wrapper for studio onboarding track",
87
- fields: { track: {
88
- type: StudioOnboardingTrackModel,
89
- isOptional: false
90
- } }
130
+ var TrackResponseModel = defineSchemaModel({
131
+ name: "StudioOnboardingTrackResponse",
132
+ description: "Response wrapper for studio onboarding track",
133
+ fields: {
134
+ track: { type: StudioOnboardingTrackModel, isOptional: false }
135
+ }
91
136
  });
92
- const RecordDemoEventInput = defineSchemaModel({
93
- name: "StudioOnboardingRecordEventInput",
94
- description: "Emit a demo event to advance Studio onboarding 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
- }
137
+ var RecordDemoEventInput = defineSchemaModel({
138
+ name: "StudioOnboardingRecordEventInput",
139
+ description: "Emit a demo event to advance Studio onboarding steps",
140
+ fields: {
141
+ learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
142
+ eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
143
+ payload: { type: ScalarTypeEnum.JSON(), isOptional: true },
144
+ occurredAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
145
+ }
113
146
  });
114
- const SuccessModel = defineSchemaModel({
115
- name: "StudioOnboardingSuccess",
116
- description: "Generic success response",
117
- fields: { success: {
118
- type: ScalarTypeEnum.Boolean(),
119
- isOptional: false
120
- } }
147
+ var SuccessModel = defineSchemaModel({
148
+ name: "StudioOnboardingSuccess",
149
+ description: "Generic success response",
150
+ fields: {
151
+ success: { type: ScalarTypeEnum.Boolean(), isOptional: false }
152
+ }
121
153
  });
122
- const GetStudioOnboardingTrack = defineQuery({
123
- meta: {
124
- key: "learningJourney.studioOnboarding.getTrack",
125
- version: "1.0.0",
126
- stability: "experimental",
127
- owners: [...OWNERS],
128
- tags: [
129
- "learning",
130
- "onboarding",
131
- "studio"
132
- ],
133
- description: "Fetch the Studio onboarding 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: "StudioOnboardingTrackInput",
140
- description: "Track input",
141
- fields: {}
142
- }),
143
- output: TrackResponseModel
144
- },
145
- policy: { auth: "user" }
154
+ var GetStudioOnboardingTrack = defineQuery({
155
+ meta: {
156
+ key: "learningJourney.studioOnboarding.getTrack",
157
+ version: "1.0.0",
158
+ stability: "experimental",
159
+ owners: [...OWNERS],
160
+ tags: ["learning", "onboarding", "studio"],
161
+ description: "Fetch the Studio onboarding track definition.",
162
+ goal: "Expose track metadata to UIs and templates.",
163
+ context: "Called by Studio/Playground to render journey steps."
164
+ },
165
+ io: {
166
+ input: defineSchemaModel({
167
+ name: "StudioOnboardingTrackInput",
168
+ description: "Track input",
169
+ fields: {}
170
+ }),
171
+ output: TrackResponseModel
172
+ },
173
+ policy: { auth: "user" }
146
174
  });
147
- const RecordStudioOnboardingEvent = defineCommand({
148
- meta: {
149
- key: "learningJourney.studioOnboarding.recordEvent",
150
- version: "1.0.0",
151
- stability: "experimental",
152
- owners: [...OWNERS],
153
- tags: [
154
- "learning",
155
- "onboarding",
156
- "studio"
157
- ],
158
- description: "Record an event to advance Studio onboarding 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" }
175
+ var RecordStudioOnboardingEvent = defineCommand({
176
+ meta: {
177
+ key: "learningJourney.studioOnboarding.recordEvent",
178
+ version: "1.0.0",
179
+ stability: "experimental",
180
+ owners: [...OWNERS],
181
+ tags: ["learning", "onboarding", "studio"],
182
+ description: "Record an event to advance Studio onboarding progress.",
183
+ goal: "Advance steps via domain events in demo/sandbox contexts.",
184
+ context: "Called by handlers or demo scripts to emit step completion events."
185
+ },
186
+ io: {
187
+ input: RecordDemoEventInput,
188
+ output: SuccessModel
189
+ },
190
+ policy: { auth: "user" }
167
191
  });
168
- const studioOnboardingContracts = {
169
- GetStudioOnboardingTrack,
170
- RecordStudioOnboardingEvent,
171
- track: studioGettingStartedTrack
192
+ var studioOnboardingContracts = {
193
+ GetStudioOnboardingTrack,
194
+ RecordStudioOnboardingEvent,
195
+ track: studioGettingStartedTrack
196
+ };
197
+ export {
198
+ studioOnboardingContracts,
199
+ StudioOnboardingTrackModel,
200
+ RecordStudioOnboardingEvent,
201
+ GetStudioOnboardingTrack
172
202
  };
173
-
174
- //#endregion
175
- export { GetStudioOnboardingTrack, RecordStudioOnboardingEvent, StudioOnboardingTrackModel, studioOnboardingContracts };
176
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/operations/index.test.ts"],"names":[],"mappings":""}
@@ -1,9 +1,4 @@
1
- import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
2
-
3
- //#region src/presentations/index.d.ts
4
- declare const StudioOnboardingTrackPresentation: _contractspec_lib_contracts0.PresentationSpec;
5
- declare const StudioOnboardingWidgetPresentation: _contractspec_lib_contracts0.PresentationSpec;
6
- declare const studioOnboardingPresentations: _contractspec_lib_contracts0.PresentationSpec[];
7
- //#endregion
8
- export { StudioOnboardingTrackPresentation, StudioOnboardingWidgetPresentation, studioOnboardingPresentations };
1
+ export declare const StudioOnboardingTrackPresentation: import("@contractspec/lib.contracts").PresentationSpec;
2
+ export declare const StudioOnboardingWidgetPresentation: import("@contractspec/lib.contracts").PresentationSpec;
3
+ export declare const studioOnboardingPresentations: import("@contractspec/lib.contracts").PresentationSpec[];
9
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/presentations/index.ts"],"mappings":";;;cAkBa,iCAAA,EAgBX,4BAAA,CAhB4C,gBAAA;AAAA,cAkBjC,kCAAA,EAeX,4BAAA,CAf6C,gBAAA;AAAA,cAiBlC,6BAAA,EAGZ,4BAAA,CAHyC,gBAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/presentations/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,iCAAiC,wDAgB5C,CAAC;AAEH,eAAO,MAAM,kCAAkC,wDAe7C,CAAC;AAEH,eAAO,MAAM,6BAA6B,0DAGzC,CAAC"}