@contractspec/example.learning-journey-studio-onboarding 3.7.6 → 3.7.7
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/.turbo/turbo-build.log +3 -3
- package/AGENTS.md +48 -26
- package/README.md +62 -31
- package/dist/browser/index.js +50 -50
- package/dist/browser/operations/index.js +1 -1
- package/dist/browser/presentations/index.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +50 -50
- package/dist/node/index.js +50 -50
- package/dist/node/operations/index.js +1 -1
- package/dist/node/presentations/index.js +1 -1
- package/dist/operations/index.js +1 -1
- package/dist/presentations/index.js +1 -1
- package/package.json +5 -5
- package/src/docs/studio-onboarding.docblock.ts +11 -11
- package/src/example.ts +25 -25
- package/src/handlers/demo.handlers.ts +27 -27
- package/src/index.ts +4 -4
- package/src/learning-journey-studio-onboarding.feature.ts +51 -51
- package/src/operations/index.test.ts +36 -37
- package/src/operations/index.ts +93 -93
- package/src/presentations/index.ts +41 -41
- package/src/tests/operations.test-spec.ts +27 -27
- package/src/track.ts +79 -79
- package/tsconfig.json +7 -7
- package/tsdown.config.js +7 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/example.learning-journey-studio-onboarding",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.7",
|
|
4
4
|
"description": "Learning journey track for first 30 minutes in ContractSpec Studio.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -85,15 +85,15 @@
|
|
|
85
85
|
"dev": "contractspec-bun-build dev",
|
|
86
86
|
"clean": "rimraf dist .turbo",
|
|
87
87
|
"lint": "bun lint:fix",
|
|
88
|
-
"lint:fix": "
|
|
89
|
-
"lint:check": "
|
|
88
|
+
"lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
|
|
89
|
+
"lint:check": "biome check .",
|
|
90
90
|
"prebuild": "contractspec-bun-build prebuild",
|
|
91
91
|
"typecheck": "tsc --noEmit"
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@contractspec/lib.contracts-spec": "
|
|
94
|
+
"@contractspec/lib.contracts-spec": "4.0.0",
|
|
95
95
|
"@contractspec/lib.schema": "3.7.6",
|
|
96
|
-
"@contractspec/module.learning-journey": "3.7.
|
|
96
|
+
"@contractspec/module.learning-journey": "3.7.7"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@contractspec/tool.typescript": "3.7.6",
|
|
@@ -2,16 +2,16 @@ import type { DocBlock } from '@contractspec/lib.contracts-spec';
|
|
|
2
2
|
import { registerDocBlocks } from '@contractspec/lib.contracts-spec';
|
|
3
3
|
|
|
4
4
|
const studioOnboardingDocBlocks: DocBlock[] = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
{
|
|
6
|
+
id: 'docs.learning-journey.studio-onboarding',
|
|
7
|
+
title: 'Learning Journey — Studio Getting Started',
|
|
8
|
+
summary:
|
|
9
|
+
'Track that guides a new Studio user through template spawn, spec edit, regeneration, playground, and evolution.',
|
|
10
|
+
kind: 'reference',
|
|
11
|
+
visibility: 'public',
|
|
12
|
+
route: '/docs/learning-journey/studio-onboarding',
|
|
13
|
+
tags: ['learning', 'onboarding', 'studio'],
|
|
14
|
+
body: `## Track
|
|
15
15
|
- **Key**: \`studio_getting_started\`
|
|
16
16
|
- **Persona**: new Studio developer, first 30 minutes
|
|
17
17
|
- **Goal**: instantiate template → edit spec → regenerate → play → run evolution
|
|
@@ -32,7 +32,7 @@ XP: 20/20/20/20/30 with bonus 25 XP if completed within 48h (streak rule). Badge
|
|
|
32
32
|
- \`learning.onboarding.getProgress\` to render progress
|
|
33
33
|
- \`learning.onboarding.recordEvent\` to advance from bus events
|
|
34
34
|
- Events should be emitted by Studio surfaces (template creation, spec save, regeneration, playground session start, evolution apply).`,
|
|
35
|
-
|
|
35
|
+
},
|
|
36
36
|
];
|
|
37
37
|
|
|
38
38
|
registerDocBlocks(studioOnboardingDocBlocks);
|
package/src/example.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { defineExample } from '@contractspec/lib.contracts-spec';
|
|
2
2
|
|
|
3
3
|
const example = defineExample({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
4
|
+
meta: {
|
|
5
|
+
key: 'learning-journey-studio-onboarding',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
title: 'Learning Journey — Studio Getting Started',
|
|
8
|
+
description:
|
|
9
|
+
'Onboarding track guiding a new Studio user through template spawn, spec edit, regeneration, playground, and evolution.',
|
|
10
|
+
kind: 'template',
|
|
11
|
+
visibility: 'public',
|
|
12
|
+
stability: 'experimental',
|
|
13
|
+
owners: ['@platform.core'],
|
|
14
|
+
tags: ['learning', 'onboarding', 'studio'],
|
|
15
|
+
},
|
|
16
|
+
docs: {
|
|
17
|
+
rootDocId: 'docs.learning-journey.studio-onboarding',
|
|
18
|
+
},
|
|
19
|
+
entrypoints: {
|
|
20
|
+
packageName: '@contractspec/example.learning-journey-studio-onboarding',
|
|
21
|
+
docs: './docs',
|
|
22
|
+
},
|
|
23
|
+
surfaces: {
|
|
24
|
+
templates: true,
|
|
25
|
+
sandbox: { enabled: true, modes: ['playground', 'markdown'] },
|
|
26
|
+
studio: { enabled: true, installable: true },
|
|
27
|
+
mcp: { enabled: true },
|
|
28
|
+
},
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
export default example;
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import { studioGettingStartedTrack } from '../track';
|
|
2
2
|
|
|
3
3
|
interface EmitParams {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
learnerId: string;
|
|
5
|
+
occurredAt?: Date;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
interface LearningJourneyEvent {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
learnerId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
occurredAt: Date;
|
|
12
|
+
trackId: string;
|
|
13
|
+
payload?: Record<string, unknown>;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
type RecordEvent = (event: LearningJourneyEvent) => unknown;
|
|
17
17
|
|
|
18
18
|
export const studioOnboardingEvents = [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
'studio.template.instantiated',
|
|
20
|
+
'spec.changed',
|
|
21
|
+
'regeneration.completed',
|
|
22
|
+
'playground.session.started',
|
|
23
|
+
'studio.evolution.applied',
|
|
24
24
|
] as const;
|
|
25
25
|
|
|
26
26
|
export type StudioEvent = (typeof studioOnboardingEvents)[number];
|
|
27
27
|
|
|
28
28
|
export const emitStudioOnboardingEvent = (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
eventName: StudioEvent,
|
|
30
|
+
{ learnerId, occurredAt = new Date() }: EmitParams,
|
|
31
|
+
record?: RecordEvent
|
|
32
32
|
) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
const event: LearningJourneyEvent = {
|
|
34
|
+
learnerId,
|
|
35
|
+
name: eventName,
|
|
36
|
+
occurredAt,
|
|
37
|
+
trackId: studioGettingStartedTrack.id,
|
|
38
|
+
};
|
|
39
|
+
return record ? record(event) : event;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
export const emitAllStudioOnboardingEvents = (
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
params: EmitParams,
|
|
44
|
+
record?: RecordEvent
|
|
45
45
|
) =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
studioOnboardingEvents.map((name) =>
|
|
47
|
+
emitStudioOnboardingEvent(name, params, record)
|
|
48
|
+
);
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './track';
|
|
2
1
|
export * from './docs';
|
|
3
|
-
export
|
|
2
|
+
export { default as example } from './example';
|
|
4
3
|
export * from './handlers/demo.handlers';
|
|
5
|
-
export * from './presentations';
|
|
6
4
|
export * from './learning-journey-studio-onboarding.feature';
|
|
7
|
-
export
|
|
5
|
+
export * from './operations';
|
|
6
|
+
export * from './presentations';
|
|
7
|
+
export * from './track';
|
|
@@ -10,62 +10,62 @@ import { defineFeature } from '@contractspec/lib.contracts-spec';
|
|
|
10
10
|
* Studio-specific onboarding track operations and presentations.
|
|
11
11
|
*/
|
|
12
12
|
export const LearningJourneyStudioOnboardingFeature = defineFeature({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
meta: {
|
|
14
|
+
key: 'learning-journey-studio-onboarding',
|
|
15
|
+
title: 'Learning Journey: Studio Onboarding',
|
|
16
|
+
description:
|
|
17
|
+
'Studio onboarding journey for getting started with ContractSpec Studio',
|
|
18
|
+
domain: 'learning-journey',
|
|
19
|
+
owners: ['@examples.learning-journey.studio-onboarding'],
|
|
20
|
+
tags: ['learning', 'onboarding', 'studio', 'journey'],
|
|
21
|
+
stability: 'experimental',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
},
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
// All contract operations included in this feature
|
|
26
|
+
operations: [
|
|
27
|
+
{ key: 'learningJourney.studioOnboarding.recordEvent', version: '1.0.0' },
|
|
28
|
+
{ key: 'learningJourney.studioOnboarding.getTrack', version: '1.0.0' },
|
|
29
|
+
],
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
// Events emitted by this feature
|
|
32
|
+
events: [],
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
// Presentations associated with this feature
|
|
35
|
+
presentations: [
|
|
36
|
+
{ key: 'learning.journey.studio.track', version: '1.0.0' },
|
|
37
|
+
{ key: 'learning.journey.studio.widget', version: '1.0.0' },
|
|
38
|
+
],
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
// Link operations to their primary presentations
|
|
41
|
+
opToPresentation: [
|
|
42
|
+
{
|
|
43
|
+
op: {
|
|
44
|
+
key: 'learningJourney.studioOnboarding.getTrack',
|
|
45
|
+
version: '1.0.0',
|
|
46
|
+
},
|
|
47
|
+
pres: { key: 'learning.journey.studio.track', version: '1.0.0' },
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
51
|
+
// Target requirements for multi-surface rendering
|
|
52
|
+
presentationsTargets: [
|
|
53
|
+
{
|
|
54
|
+
key: 'learning.journey.studio.track',
|
|
55
|
+
version: '1.0.0',
|
|
56
|
+
targets: ['react', 'markdown', 'application/json'],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: 'learning.journey.studio.widget',
|
|
60
|
+
version: '1.0.0',
|
|
61
|
+
targets: ['react'],
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
// Capability requirements
|
|
66
|
+
capabilities: {
|
|
67
|
+
requires: [{ key: 'identity', version: '1.0.0' }],
|
|
68
|
+
},
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
docs: ['docs.learning-journey.studio-onboarding'],
|
|
71
71
|
});
|
|
@@ -1,49 +1,48 @@
|
|
|
1
1
|
import { describe, expect, it } from 'bun:test';
|
|
2
|
-
|
|
2
|
+
import type { StudioEvent } from '../handlers/demo.handlers';
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from './index';
|
|
4
|
+
emitStudioOnboardingEvent,
|
|
5
|
+
studioOnboardingEvents,
|
|
6
|
+
} from '../handlers/demo.handlers';
|
|
8
7
|
import { studioGettingStartedTrack } from '../track';
|
|
9
8
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
GetStudioOnboardingTrack,
|
|
10
|
+
RecordStudioOnboardingEvent,
|
|
11
|
+
studioOnboardingContracts,
|
|
12
|
+
} from './index';
|
|
14
13
|
|
|
15
14
|
describe('studio onboarding contracts', () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
it('exposes track metadata', () => {
|
|
16
|
+
expect(studioOnboardingContracts.track.id).toBe('studio_getting_started');
|
|
17
|
+
expect(studioOnboardingContracts.track.steps.length).toBeGreaterThan(0);
|
|
18
|
+
expect(GetStudioOnboardingTrack.meta.key).toBe(
|
|
19
|
+
'learningJourney.studioOnboarding.getTrack'
|
|
20
|
+
);
|
|
21
|
+
});
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
it('allows recording events via demo handler', async () => {
|
|
24
|
+
const step = studioGettingStartedTrack.steps[0];
|
|
25
|
+
expect(step).toBeDefined();
|
|
26
|
+
if (!step) throw new Error('Expected at least one onboarding step');
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const eventName = step.completion.eventName;
|
|
29
|
+
const isStudioEvent = (value: string): value is StudioEvent =>
|
|
30
|
+
studioOnboardingEvents.includes(value as StudioEvent);
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
expect(isStudioEvent(eventName)).toBe(true);
|
|
33
|
+
if (!isStudioEvent(eventName)) {
|
|
34
|
+
throw new Error(`Unexpected event name: ${eventName}`);
|
|
35
|
+
}
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
const result = await emitStudioOnboardingEvent(eventName, {
|
|
38
|
+
learnerId: 'demo-learner',
|
|
39
|
+
});
|
|
40
|
+
expect(result).toBeDefined();
|
|
41
|
+
});
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
it('exposes record event contract', () => {
|
|
44
|
+
expect(RecordStudioOnboardingEvent.meta.key).toBe(
|
|
45
|
+
'learningJourney.studioOnboarding.recordEvent'
|
|
46
|
+
);
|
|
47
|
+
});
|
|
49
48
|
});
|
package/src/operations/index.ts
CHANGED
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
import { ScalarTypeEnum, defineSchemaModel } from '@contractspec/lib.schema';
|
|
2
1
|
import { defineCommand, defineQuery } from '@contractspec/lib.contracts-spec';
|
|
2
|
+
import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
|
|
3
3
|
|
|
4
4
|
import { studioGettingStartedTrack } from '../track';
|
|
5
5
|
|
|
6
6
|
const OWNERS = ['examples.learning-journey.studio-onboarding'] as const;
|
|
7
7
|
|
|
8
8
|
const StepModel = defineSchemaModel({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
name: 'StudioOnboardingStep',
|
|
10
|
+
description: 'Step metadata for Studio onboarding journey',
|
|
11
|
+
fields: {
|
|
12
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
13
|
+
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
14
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
15
|
+
completionEvent: {
|
|
16
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
17
|
+
isOptional: false,
|
|
18
|
+
},
|
|
19
|
+
sourceModule: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
20
|
+
xpReward: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
21
|
+
order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
22
|
+
},
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
export const StudioOnboardingTrackModel = defineSchemaModel({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
26
|
+
name: 'StudioOnboardingTrack',
|
|
27
|
+
description: 'Studio onboarding track definition',
|
|
28
|
+
fields: {
|
|
29
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
30
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
31
|
+
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
32
|
+
totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
33
|
+
completionXpBonus: {
|
|
34
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
35
|
+
isOptional: true,
|
|
36
|
+
},
|
|
37
|
+
completionBadgeKey: {
|
|
38
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
39
|
+
isOptional: true,
|
|
40
|
+
},
|
|
41
|
+
streakHoursWindow: {
|
|
42
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
43
|
+
isOptional: true,
|
|
44
|
+
},
|
|
45
|
+
streakBonusXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
46
|
+
steps: { type: StepModel, isArray: true, isOptional: false },
|
|
47
|
+
},
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
const TrackResponseModel = defineSchemaModel({
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
name: 'StudioOnboardingTrackResponse',
|
|
52
|
+
description: 'Response wrapper for studio onboarding track',
|
|
53
|
+
fields: {
|
|
54
|
+
track: { type: StudioOnboardingTrackModel, isOptional: false },
|
|
55
|
+
},
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
const RecordDemoEventInput = defineSchemaModel({
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
name: 'StudioOnboardingRecordEventInput',
|
|
60
|
+
description: 'Emit a demo event to advance Studio onboarding steps',
|
|
61
|
+
fields: {
|
|
62
|
+
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
63
|
+
eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
64
|
+
payload: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
65
|
+
occurredAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
66
|
+
},
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
const SuccessModel = defineSchemaModel({
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
name: 'StudioOnboardingSuccess',
|
|
71
|
+
description: 'Generic success response',
|
|
72
|
+
fields: {
|
|
73
|
+
success: { type: ScalarTypeEnum.Boolean(), isOptional: false },
|
|
74
|
+
},
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
export const GetStudioOnboardingTrack = defineQuery({
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
78
|
+
meta: {
|
|
79
|
+
key: 'learningJourney.studioOnboarding.getTrack',
|
|
80
|
+
version: '1.0.0',
|
|
81
|
+
stability: 'experimental',
|
|
82
|
+
owners: [...OWNERS],
|
|
83
|
+
tags: ['learning', 'onboarding', 'studio'],
|
|
84
|
+
description: 'Fetch the Studio onboarding track definition.',
|
|
85
|
+
goal: 'Expose track metadata to UIs and templates.',
|
|
86
|
+
context: 'Called by Studio/Playground to render journey steps.',
|
|
87
|
+
},
|
|
88
|
+
io: {
|
|
89
|
+
input: defineSchemaModel({
|
|
90
|
+
name: 'StudioOnboardingTrackInput',
|
|
91
|
+
description: 'Track input',
|
|
92
|
+
fields: {},
|
|
93
|
+
}),
|
|
94
|
+
output: TrackResponseModel,
|
|
95
|
+
},
|
|
96
|
+
policy: { auth: 'user' },
|
|
97
97
|
});
|
|
98
98
|
|
|
99
99
|
export const RecordStudioOnboardingEvent = defineCommand({
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
100
|
+
meta: {
|
|
101
|
+
key: 'learningJourney.studioOnboarding.recordEvent',
|
|
102
|
+
version: '1.0.0',
|
|
103
|
+
stability: 'experimental',
|
|
104
|
+
owners: [...OWNERS],
|
|
105
|
+
tags: ['learning', 'onboarding', 'studio'],
|
|
106
|
+
description: 'Record an event to advance Studio onboarding progress.',
|
|
107
|
+
goal: 'Advance steps via domain events in demo/sandbox contexts.',
|
|
108
|
+
context:
|
|
109
|
+
'Called by handlers or demo scripts to emit step completion events.',
|
|
110
|
+
},
|
|
111
|
+
io: {
|
|
112
|
+
input: RecordDemoEventInput,
|
|
113
|
+
output: SuccessModel,
|
|
114
|
+
},
|
|
115
|
+
policy: { auth: 'user' },
|
|
116
116
|
});
|
|
117
117
|
|
|
118
118
|
export const studioOnboardingContracts = {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
GetStudioOnboardingTrack,
|
|
120
|
+
RecordStudioOnboardingEvent,
|
|
121
|
+
track: studioGettingStartedTrack,
|
|
122
122
|
};
|