@kumwe/studio-core 0.1.0-alpha.10
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/LICENSE +21 -0
- package/README.md +86 -0
- package/THIRD_PARTY_NOTICES.md +9 -0
- package/dist/binding-projection.d.ts +47 -0
- package/dist/binding-projection.d.ts.map +1 -0
- package/dist/binding-projection.js +253 -0
- package/dist/binding-projection.js.map +1 -0
- package/dist/canonical.d.ts +20 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/canonical.js +100 -0
- package/dist/canonical.js.map +1 -0
- package/dist/clone.d.ts +2 -0
- package/dist/clone.d.ts.map +1 -0
- package/dist/clone.js +4 -0
- package/dist/clone.js.map +1 -0
- package/dist/commands.d.ts +18 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/commands.js +799 -0
- package/dist/commands.js.map +1 -0
- package/dist/contributions.d.ts +93 -0
- package/dist/contributions.d.ts.map +1 -0
- package/dist/contributions.js +435 -0
- package/dist/contributions.js.map +1 -0
- package/dist/entry-commands.d.ts +3 -0
- package/dist/entry-commands.d.ts.map +1 -0
- package/dist/entry-commands.js +36 -0
- package/dist/entry-commands.js.map +1 -0
- package/dist/extension-sdk.d.ts +51 -0
- package/dist/extension-sdk.d.ts.map +1 -0
- package/dist/extension-sdk.js +260 -0
- package/dist/extension-sdk.js.map +1 -0
- package/dist/history.d.ts +22 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +81 -0
- package/dist/history.js.map +1 -0
- package/dist/host-session.d.ts +74 -0
- package/dist/host-session.d.ts.map +1 -0
- package/dist/host-session.js +713 -0
- package/dist/host-session.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/layout.d.ts +66 -0
- package/dist/layout.d.ts.map +1 -0
- package/dist/layout.js +240 -0
- package/dist/layout.js.map +1 -0
- package/dist/migrations.d.ts +47 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/migrations.js +83 -0
- package/dist/migrations.js.map +1 -0
- package/dist/model-commands.d.ts +3 -0
- package/dist/model-commands.d.ts.map +1 -0
- package/dist/model-commands.js +21 -0
- package/dist/model-commands.js.map +1 -0
- package/dist/modes.d.ts +47 -0
- package/dist/modes.d.ts.map +1 -0
- package/dist/modes.js +280 -0
- package/dist/modes.js.map +1 -0
- package/dist/negotiation.d.ts +23 -0
- package/dist/negotiation.d.ts.map +1 -0
- package/dist/negotiation.js +65 -0
- package/dist/negotiation.js.map +1 -0
- package/dist/production-values.d.ts +12 -0
- package/dist/production-values.d.ts.map +1 -0
- package/dist/production-values.js +224 -0
- package/dist/production-values.js.map +1 -0
- package/dist/production.d.ts +86 -0
- package/dist/production.d.ts.map +1 -0
- package/dist/production.js +811 -0
- package/dist/production.js.map +1 -0
- package/dist/profile-validator.d.ts +47 -0
- package/dist/profile-validator.d.ts.map +1 -0
- package/dist/profile-validator.js +887 -0
- package/dist/profile-validator.js.map +1 -0
- package/dist/recipes.d.ts +15 -0
- package/dist/recipes.d.ts.map +1 -0
- package/dist/recipes.js +34 -0
- package/dist/recipes.js.map +1 -0
- package/dist/registry.d.ts +17 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +56 -0
- package/dist/registry.js.map +1 -0
- package/dist/schema-profile.d.ts +27 -0
- package/dist/schema-profile.d.ts.map +1 -0
- package/dist/schema-profile.js +1015 -0
- package/dist/schema-profile.js.map +1 -0
- package/dist/semver.d.ts +20 -0
- package/dist/semver.d.ts.map +1 -0
- package/dist/semver.js +128 -0
- package/dist/semver.js.map +1 -0
- package/dist/session.d.ts +73 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +191 -0
- package/dist/session.js.map +1 -0
- package/dist/url-policy.d.ts +45 -0
- package/dist/url-policy.d.ts.map +1 -0
- package/dist/url-policy.js +248 -0
- package/dist/url-policy.js.map +1 -0
- package/dist/validation.d.ts +13 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +444 -0
- package/dist/validation.js.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { cloneContractValue } from './clone.js';
|
|
2
|
+
import { StudioCommandError } from './commands.js';
|
|
3
|
+
export function applyEntryCommand(entry, command) {
|
|
4
|
+
if (command.artifactId !== entry.id) {
|
|
5
|
+
throw new StudioCommandError('node-not-found', `Command targets ${command.artifactId}, not entry ${entry.id}.`);
|
|
6
|
+
}
|
|
7
|
+
if (command.payload.locale !== undefined &&
|
|
8
|
+
entry.locale !== undefined &&
|
|
9
|
+
command.payload.locale !== entry.locale) {
|
|
10
|
+
throw new StudioCommandError('locale-mismatch', `Command targets locale ${command.payload.locale}, but the entry stores ${entry.locale}.`);
|
|
11
|
+
}
|
|
12
|
+
const next = cloneContractValue(entry);
|
|
13
|
+
const path = command.payload.fieldPath;
|
|
14
|
+
let container = next.values;
|
|
15
|
+
for (const [index, segment] of path.entries()) {
|
|
16
|
+
if (index === path.length - 1) {
|
|
17
|
+
setOwnMember(container, segment, cloneContractValue(command.payload.value));
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
const child = Object.hasOwn(container, segment) ? container[segment] : undefined;
|
|
21
|
+
if (child === null || typeof child !== 'object' || Array.isArray(child)) {
|
|
22
|
+
throw new StudioCommandError('property-not-found', `Field path segment ${segment} does not resolve to an object value.`);
|
|
23
|
+
}
|
|
24
|
+
container = child;
|
|
25
|
+
}
|
|
26
|
+
return next;
|
|
27
|
+
}
|
|
28
|
+
function setOwnMember(container, member, value) {
|
|
29
|
+
Object.defineProperty(container, member, {
|
|
30
|
+
configurable: true,
|
|
31
|
+
enumerable: true,
|
|
32
|
+
value,
|
|
33
|
+
writable: true,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=entry-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-commands.js","sourceRoot":"","sources":["../src/entry-commands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O,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACjF,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACxE,MAAM,IAAI,kBAAkB,CAC1B,oBAAoB,EACpB,sBAAsB,OAAO,uCAAuC,CACrE,CAAC;QACJ,CAAC;QACD,SAAS,GAAG,KAAK,CAAC;IACpB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,YAAY,CAAC,SAAqB,EAAE,MAAc,EAAE,KAAgB;IAC3E,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE;QACvC,YAAY,EAAE,IAAI;QAClB,UAAU,EAAE,IAAI;QAChB,KAAK;QACL,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { BlockDefinition, DesignVocabulary, FieldAdapterContribution, InspectorContribution, MigrationDeclaration, PatternDocument, PluginManifest, UnresolvedContribution, UnresolvedContributionReference } from '@kumwe/studio-protocol';
|
|
2
|
+
import { ContributionRuntime, type GenerationOptions, type RegistryGeneration } from './contributions.js';
|
|
3
|
+
/**
|
|
4
|
+
* One authored Studio plugin: the declarative manifest plus the concrete
|
|
5
|
+
* canonical composition payloads the manifest declares. All six payload
|
|
6
|
+
* families are validated and activated transactionally; other manifest kinds
|
|
7
|
+
* remain resource-backed host declarations.
|
|
8
|
+
*/
|
|
9
|
+
export interface StudioPluginDefinition {
|
|
10
|
+
blocks?: readonly BlockDefinition[];
|
|
11
|
+
designVocabularies?: readonly DesignVocabulary[];
|
|
12
|
+
fieldAdapters?: readonly FieldAdapterContribution[];
|
|
13
|
+
inspectors?: readonly InspectorContribution[];
|
|
14
|
+
manifest: PluginManifest;
|
|
15
|
+
migrations?: readonly MigrationDeclaration[];
|
|
16
|
+
patterns?: readonly PatternDocument[];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The typed authoring entry point for extension developers. At compile time
|
|
20
|
+
* this is an identity function: the argument is checked against the closed
|
|
21
|
+
* protocol types, so a typo is an editor error. At runtime it front-loads
|
|
22
|
+
* activation: the canonical plugin-manifest schema, the namespace and
|
|
23
|
+
* declaration coherence rules of the plugin contract, and the contribution
|
|
24
|
+
* runtime's own activation checks (applied through a dry-run activation, not
|
|
25
|
+
* a reimplementation). It adds no invariant of its own — everything it
|
|
26
|
+
* rejects would be rejected identically at activation. Violations throw the
|
|
27
|
+
* runtime's `StudioContributionError` with blocking diagnostics; the
|
|
28
|
+
* validated definition is deep-frozen and returned.
|
|
29
|
+
*/
|
|
30
|
+
export declare function defineStudioPlugin<TDefinition extends StudioPluginDefinition>(definition: TDefinition): TDefinition;
|
|
31
|
+
/**
|
|
32
|
+
* Activate an authored plugin definition on a contribution runtime. The
|
|
33
|
+
* manifest-level coherence checks run first and fail closed before the
|
|
34
|
+
* runtime transaction begins; the runtime then applies its own activation
|
|
35
|
+
* rules unchanged, so a rejected definition never disturbs the active
|
|
36
|
+
* generation.
|
|
37
|
+
*/
|
|
38
|
+
export declare function activateStudioPlugin(runtime: ContributionRuntime, definition: StudioPluginDefinition, options: Readonly<GenerationOptions>): RegistryGeneration;
|
|
39
|
+
/**
|
|
40
|
+
* The portable unresolved-contribution documents for declared, non-block
|
|
41
|
+
* contribution references (field adapters, patterns, transforms, renderer
|
|
42
|
+
* capabilities, and the other manifest kinds). This mirrors the reason
|
|
43
|
+
* mapping the runtime applies to Blueprint block nodes, lifted from
|
|
44
|
+
* registered block versions to manifest declarations: an unknown id is
|
|
45
|
+
* `not-installed`, an undeclared version is `incompatible`, a trust-revoked
|
|
46
|
+
* owner is `owner-revoked`, and any other inactive owner is
|
|
47
|
+
* `owner-disabled`. References the current generation resolves produce no
|
|
48
|
+
* document.
|
|
49
|
+
*/
|
|
50
|
+
export declare function unresolvedDeclaredContributions(runtime: ContributionRuntime, plugins: readonly StudioPluginDefinition[], references: readonly UnresolvedContributionReference[]): UnresolvedContribution[];
|
|
51
|
+
//# sourceMappingURL=extension-sdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-sdk.d.ts","sourceRoot":"","sources":["../src/extension-sdk.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAEhB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EAEpB,eAAe,EAEf,cAAc,EAGd,sBAAsB,EAEtB,+BAA+B,EAChC,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,mBAAmB,EAGnB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAG5B;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACpC,kBAAkB,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACjD,aAAa,CAAC,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACpD,UAAU,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAC9C,QAAQ,EAAE,cAAc,CAAC;IACzB,UAAU,CAAC,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC7C,QAAQ,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;CACvC;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,SAAS,sBAAsB,EAC3E,UAAU,EAAE,WAAW,GACtB,WAAW,CAOb;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,mBAAmB,EAC5B,UAAU,EAAE,sBAAsB,EAClC,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GACnC,kBAAkB,CAGpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,SAAS,sBAAsB,EAAE,EAC1C,UAAU,EAAE,SAAS,+BAA+B,EAAE,GACrD,sBAAsB,EAAE,CAsC1B"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { commonSchema, pluginManifestSchema, STUDIO_CONTRACT_VERSION, } from '@kumwe/studio-protocol';
|
|
2
|
+
import { cloneContractValue } from './clone.js';
|
|
3
|
+
import { ContributionRuntime, StudioContributionError, } from './contributions.js';
|
|
4
|
+
import { compileProfileSchema } from './profile-validator.js';
|
|
5
|
+
const validateManifestSchema = compileProfileSchema(pluginManifestSchema, {
|
|
6
|
+
schemas: [commonSchema],
|
|
7
|
+
});
|
|
8
|
+
const canonicalContributionKinds = new Set([
|
|
9
|
+
'block',
|
|
10
|
+
'design-vocabulary',
|
|
11
|
+
'field-adapter',
|
|
12
|
+
'inspector',
|
|
13
|
+
'migration',
|
|
14
|
+
'pattern',
|
|
15
|
+
]);
|
|
16
|
+
/**
|
|
17
|
+
* The typed authoring entry point for extension developers. At compile time
|
|
18
|
+
* this is an identity function: the argument is checked against the closed
|
|
19
|
+
* protocol types, so a typo is an editor error. At runtime it front-loads
|
|
20
|
+
* activation: the canonical plugin-manifest schema, the namespace and
|
|
21
|
+
* declaration coherence rules of the plugin contract, and the contribution
|
|
22
|
+
* runtime's own activation checks (applied through a dry-run activation, not
|
|
23
|
+
* a reimplementation). It adds no invariant of its own — everything it
|
|
24
|
+
* rejects would be rejected identically at activation. Violations throw the
|
|
25
|
+
* runtime's `StudioContributionError` with blocking diagnostics; the
|
|
26
|
+
* validated definition is deep-frozen and returned.
|
|
27
|
+
*/
|
|
28
|
+
export function defineStudioPlugin(definition) {
|
|
29
|
+
assertCoherentDefinition(definition);
|
|
30
|
+
const dryRun = new ContributionRuntime({ generation: 'authoring-mirror-0' });
|
|
31
|
+
dryRun.activate(definition.manifest.owner, mutableContributions(definition), {
|
|
32
|
+
generation: 'authoring-mirror-1',
|
|
33
|
+
});
|
|
34
|
+
return deepFreeze(definition);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Activate an authored plugin definition on a contribution runtime. The
|
|
38
|
+
* manifest-level coherence checks run first and fail closed before the
|
|
39
|
+
* runtime transaction begins; the runtime then applies its own activation
|
|
40
|
+
* rules unchanged, so a rejected definition never disturbs the active
|
|
41
|
+
* generation.
|
|
42
|
+
*/
|
|
43
|
+
export function activateStudioPlugin(runtime, definition, options) {
|
|
44
|
+
assertCoherentDefinition(definition);
|
|
45
|
+
return runtime.activate(definition.manifest.owner, mutableContributions(definition), options);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The portable unresolved-contribution documents for declared, non-block
|
|
49
|
+
* contribution references (field adapters, patterns, transforms, renderer
|
|
50
|
+
* capabilities, and the other manifest kinds). This mirrors the reason
|
|
51
|
+
* mapping the runtime applies to Blueprint block nodes, lifted from
|
|
52
|
+
* registered block versions to manifest declarations: an unknown id is
|
|
53
|
+
* `not-installed`, an undeclared version is `incompatible`, a trust-revoked
|
|
54
|
+
* owner is `owner-revoked`, and any other inactive owner is
|
|
55
|
+
* `owner-disabled`. References the current generation resolves produce no
|
|
56
|
+
* document.
|
|
57
|
+
*/
|
|
58
|
+
export function unresolvedDeclaredContributions(runtime, plugins, references) {
|
|
59
|
+
const states = new Map(runtime.inventory().map((entry) => [entry.owner.id, entry.state]));
|
|
60
|
+
const unresolved = [];
|
|
61
|
+
const seen = new Set();
|
|
62
|
+
for (const reference of references) {
|
|
63
|
+
const key = `${reference.contribution}:${reference.id}@${reference.version}`;
|
|
64
|
+
if (seen.has(key)) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
seen.add(key);
|
|
68
|
+
const resolution = canonicalContributionKinds.has(reference.contribution)
|
|
69
|
+
? runtime.unresolvedReference(reference)
|
|
70
|
+
: resolveDeclaredReference(states, plugins, reference);
|
|
71
|
+
if (resolution === undefined) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const document = {
|
|
75
|
+
contractVersion: STUDIO_CONTRACT_VERSION,
|
|
76
|
+
diagnostics: [
|
|
77
|
+
{
|
|
78
|
+
code: 'studio.validation/contribution-unavailable',
|
|
79
|
+
message: {
|
|
80
|
+
defaultMessage: `The ${reference.id} ${reference.contribution} contribution is currently unavailable; its content is preserved.`,
|
|
81
|
+
key: 'studio.validation/contribution-unavailable',
|
|
82
|
+
},
|
|
83
|
+
severity: 'warning',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
kind: 'unresolved-contribution',
|
|
87
|
+
reason: resolution.reason,
|
|
88
|
+
reference: cloneContractValue(reference),
|
|
89
|
+
};
|
|
90
|
+
if (resolution.owner !== undefined) {
|
|
91
|
+
document.owner = cloneContractValue(resolution.owner);
|
|
92
|
+
}
|
|
93
|
+
unresolved.push(document);
|
|
94
|
+
}
|
|
95
|
+
return unresolved;
|
|
96
|
+
}
|
|
97
|
+
function resolveDeclaredReference(states, plugins, reference) {
|
|
98
|
+
for (const plugin of plugins) {
|
|
99
|
+
const versions = plugin.manifest.contributions
|
|
100
|
+
.filter((contribution) => contribution.kind === reference.contribution && contribution.id === reference.id)
|
|
101
|
+
.map((contribution) => contribution.version);
|
|
102
|
+
if (versions.length === 0) {
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
const owner = plugin.manifest.owner;
|
|
106
|
+
const state = states.get(owner.id);
|
|
107
|
+
if (state === undefined) {
|
|
108
|
+
return { reason: 'not-installed' };
|
|
109
|
+
}
|
|
110
|
+
if (!versions.includes(reference.version)) {
|
|
111
|
+
return { owner, reason: 'incompatible' };
|
|
112
|
+
}
|
|
113
|
+
if (state === 'trust-revoked') {
|
|
114
|
+
return { owner, reason: 'owner-revoked' };
|
|
115
|
+
}
|
|
116
|
+
if (state === 'active') {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
return { owner, reason: 'owner-disabled' };
|
|
120
|
+
}
|
|
121
|
+
return { reason: 'not-installed' };
|
|
122
|
+
}
|
|
123
|
+
function assertCoherentDefinition(definition) {
|
|
124
|
+
const diagnostics = collectDefinitionDiagnostics(definition);
|
|
125
|
+
if (diagnostics.length > 0) {
|
|
126
|
+
throw new StudioContributionError(`Definition of ${definition.manifest.id} was rejected: ${diagnostics
|
|
127
|
+
.map((diagnostic) => diagnostic.code)
|
|
128
|
+
.join(', ')}.`, diagnostics);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function collectDefinitionDiagnostics(definition) {
|
|
132
|
+
const diagnostics = [];
|
|
133
|
+
const manifest = definition.manifest;
|
|
134
|
+
if (!validateManifestSchema.validate(manifest)) {
|
|
135
|
+
for (const error of validateManifestSchema.errors ?? []) {
|
|
136
|
+
diagnostics.push(coherenceDiagnostic('studio.contribution/invalid-manifest', `Manifest ${error.instancePath === '' ? 'document' : error.instancePath} ${error.message}.`, error.instancePath === '' ? undefined : error.instancePath));
|
|
137
|
+
}
|
|
138
|
+
return diagnostics;
|
|
139
|
+
}
|
|
140
|
+
const namespace = namespaceOf(manifest.id);
|
|
141
|
+
const declared = new Set();
|
|
142
|
+
for (const contribution of manifest.contributions) {
|
|
143
|
+
if (!isUnderNamespace(contribution.id, namespace)) {
|
|
144
|
+
diagnostics.push(coherenceDiagnostic('studio.contribution/foreign-namespace', `Contribution ${contribution.id} is outside the ${namespace} namespace owned by ${manifest.id}.`));
|
|
145
|
+
}
|
|
146
|
+
const key = declarationKey(contribution.kind, contribution.id, contribution.version);
|
|
147
|
+
if (declared.has(key)) {
|
|
148
|
+
diagnostics.push(coherenceDiagnostic('studio.contribution/duplicate-contribution', `${contribution.kind} contribution ${contribution.id}@${contribution.version} is declared twice by ${manifest.id}.`));
|
|
149
|
+
}
|
|
150
|
+
declared.add(key);
|
|
151
|
+
if (contribution.executable === true && manifest.activation !== 'executable') {
|
|
152
|
+
diagnostics.push(coherenceDiagnostic('studio.contribution/undeclared-executable', `Contribution ${contribution.id} is executable, but ${manifest.id} declares declarative activation.`));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
const declaredCapabilities = new Set([...manifest.requiredCapabilities, ...manifest.optionalCapabilities].map((capability) => capability.id));
|
|
156
|
+
const payloadEntries = definitionContributionEntries(definition);
|
|
157
|
+
const payloadKeys = new Set();
|
|
158
|
+
for (const entry of payloadEntries) {
|
|
159
|
+
const key = declarationKey(entry.kind, entry.id, entry.version);
|
|
160
|
+
payloadKeys.add(key);
|
|
161
|
+
if (!declared.has(key)) {
|
|
162
|
+
diagnostics.push(coherenceDiagnostic('studio.contribution/undeclared-registration', `${entry.kind} ${entry.id}@${entry.version} is not declared by ${manifest.id}.`));
|
|
163
|
+
}
|
|
164
|
+
for (const capability of entry.requiredCapabilities) {
|
|
165
|
+
if (!declaredCapabilities.has(capability)) {
|
|
166
|
+
diagnostics.push(coherenceDiagnostic('studio.contribution/undeclared-capability', `${entry.kind} ${entry.id} requires the ${capability} capability, which ${manifest.id} does not declare.`));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
for (const contribution of manifest.contributions) {
|
|
171
|
+
if (canonicalContributionKinds.has(contribution.kind) &&
|
|
172
|
+
!payloadKeys.has(declarationKey(contribution.kind, contribution.id, contribution.version))) {
|
|
173
|
+
diagnostics.push(coherenceDiagnostic('studio.contribution/missing-registration', `${contribution.kind} ${contribution.id}@${contribution.version} has no canonical payload in ${manifest.id}.`));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return diagnostics;
|
|
177
|
+
}
|
|
178
|
+
function definitionContributionEntries(definition) {
|
|
179
|
+
return [
|
|
180
|
+
...(definition.blocks ?? []).map((payload) => ({
|
|
181
|
+
id: payload.type,
|
|
182
|
+
kind: 'block',
|
|
183
|
+
requiredCapabilities: payload.rendererRequirements.map((requirement) => requirement.capability),
|
|
184
|
+
version: payload.version,
|
|
185
|
+
})),
|
|
186
|
+
...(definition.designVocabularies ?? []).map((payload) => ({
|
|
187
|
+
id: payload.id,
|
|
188
|
+
kind: 'design-vocabulary',
|
|
189
|
+
requiredCapabilities: [],
|
|
190
|
+
version: payload.version,
|
|
191
|
+
})),
|
|
192
|
+
...(definition.fieldAdapters ?? []).map((payload) => ({
|
|
193
|
+
id: payload.id,
|
|
194
|
+
kind: 'field-adapter',
|
|
195
|
+
requiredCapabilities: payload.requiredCapability === undefined ? [] : [payload.requiredCapability],
|
|
196
|
+
version: payload.version,
|
|
197
|
+
})),
|
|
198
|
+
...(definition.inspectors ?? []).map((payload) => ({
|
|
199
|
+
id: payload.id,
|
|
200
|
+
kind: 'inspector',
|
|
201
|
+
requiredCapabilities: payload.requiredCapability === undefined ? [] : [payload.requiredCapability],
|
|
202
|
+
version: payload.version,
|
|
203
|
+
})),
|
|
204
|
+
...(definition.migrations ?? []).map((payload) => ({
|
|
205
|
+
id: payload.id,
|
|
206
|
+
kind: 'migration',
|
|
207
|
+
requiredCapabilities: [],
|
|
208
|
+
version: payload.version,
|
|
209
|
+
})),
|
|
210
|
+
...(definition.patterns ?? []).map((payload) => ({
|
|
211
|
+
id: payload.id,
|
|
212
|
+
kind: 'pattern',
|
|
213
|
+
requiredCapabilities: [],
|
|
214
|
+
version: payload.version,
|
|
215
|
+
})),
|
|
216
|
+
];
|
|
217
|
+
}
|
|
218
|
+
function mutableContributions(definition) {
|
|
219
|
+
return {
|
|
220
|
+
blocks: [...(definition.blocks ?? [])],
|
|
221
|
+
designVocabularies: [...(definition.designVocabularies ?? [])],
|
|
222
|
+
fieldAdapters: [...(definition.fieldAdapters ?? [])],
|
|
223
|
+
inspectors: [...(definition.inspectors ?? [])],
|
|
224
|
+
migrations: [...(definition.migrations ?? [])],
|
|
225
|
+
patterns: [...(definition.patterns ?? [])],
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
function declarationKey(kind, id, version) {
|
|
229
|
+
return `${kind}\u0000${id}\u0000${version}`;
|
|
230
|
+
}
|
|
231
|
+
function namespaceOf(id) {
|
|
232
|
+
const separator = id.indexOf('/');
|
|
233
|
+
return separator === -1 ? id : id.slice(0, separator);
|
|
234
|
+
}
|
|
235
|
+
function isUnderNamespace(id, namespace) {
|
|
236
|
+
const candidate = namespaceOf(id);
|
|
237
|
+
return candidate === namespace || candidate.startsWith(`${namespace}.`);
|
|
238
|
+
}
|
|
239
|
+
function coherenceDiagnostic(code, message, jsonPointer) {
|
|
240
|
+
const diagnostic = {
|
|
241
|
+
code,
|
|
242
|
+
message: { defaultMessage: message, key: 'studio.contribution/activation' },
|
|
243
|
+
severity: 'blocking',
|
|
244
|
+
};
|
|
245
|
+
if (jsonPointer !== undefined) {
|
|
246
|
+
diagnostic.location = { jsonPointer };
|
|
247
|
+
}
|
|
248
|
+
return diagnostic;
|
|
249
|
+
}
|
|
250
|
+
function deepFreeze(value) {
|
|
251
|
+
if (value === null || typeof value !== 'object' || Object.isFrozen(value)) {
|
|
252
|
+
return value;
|
|
253
|
+
}
|
|
254
|
+
Object.freeze(value);
|
|
255
|
+
for (const entry of Object.values(value)) {
|
|
256
|
+
deepFreeze(entry);
|
|
257
|
+
}
|
|
258
|
+
return value;
|
|
259
|
+
}
|
|
260
|
+
//# sourceMappingURL=extension-sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-sdk.js","sourceRoot":"","sources":["../src/extension-sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAkBhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EACL,mBAAmB,EACnB,uBAAuB,GAIxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAgC,MAAM,wBAAwB,CAAC;AAkB5F,MAAM,sBAAsB,GAA4B,oBAAoB,CAAC,oBAAoB,EAAE;IACjG,OAAO,EAAE,CAAC,YAAY,CAAC;CACxB,CAAC,CAAC;AAEH,MAAM,0BAA0B,GAAwC,IAAI,GAAG,CAAC;IAC9E,OAAO;IACP,mBAAmB;IACnB,eAAe;IACf,WAAW;IACX,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,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,gBAAgB,CAAC,EAAiB,EAAE,SAAiB;IAC5D,MAAM,SAAS,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;IAClC,OAAO,SAAS,KAAK,SAAS,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,mBAAmB,CAC1B,IAA8B,EAC9B,OAAe,EACf,WAAoB;IAEpB,MAAM,UAAU,GAAqB;QACnC,IAAI;QACJ,OAAO,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,EAAE,gCAAgC,EAAE;QAC3E,QAAQ,EAAE,UAAU;KACrB,CAAC;IACF,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,UAAU,CAAC,QAAQ,GAAG,EAAE,WAAW,EAAE,CAAC;IACxC,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,UAAU,CAAS,KAAa;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1E,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACrB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,KAAgC,CAAC,EAAE,CAAC;QACpE,UAAU,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BlueprintCommand, BlueprintDocument, Revision } from '@kumwe/studio-protocol';
|
|
2
|
+
export declare class StudioHistory {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(document: BlueprintDocument, maximumEntries?: number);
|
|
5
|
+
get canRedo(): boolean;
|
|
6
|
+
get canUndo(): boolean;
|
|
7
|
+
get current(): BlueprintDocument;
|
|
8
|
+
get stateVersion(): number;
|
|
9
|
+
/**
|
|
10
|
+
* Advances the host-authored revision carried by every local snapshot.
|
|
11
|
+
*
|
|
12
|
+
* A successful optimistic save establishes one new base revision for the
|
|
13
|
+
* complete local timeline. Rebasing the current, past, and future snapshots
|
|
14
|
+
* keeps later commands and preview staging on that base without fabricating
|
|
15
|
+
* an edit, changing the history topology, or advancing `stateVersion`.
|
|
16
|
+
*/
|
|
17
|
+
rebaseRevision(revision: Revision): BlueprintDocument;
|
|
18
|
+
execute(command: BlueprintCommand): BlueprintDocument;
|
|
19
|
+
redo(): BlueprintDocument;
|
|
20
|
+
undo(): BlueprintDocument;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAI5F,qBAAa,aAAa;;gBAOL,QAAQ,EAAE,iBAAiB,EAAE,cAAc,SAAM;IAQpE,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED,IAAW,OAAO,IAAI,iBAAiB,CAEtC;IAED,IAAW,YAAY,IAAI,MAAM,CAEhC;IAED;;;;;;;OAOG;IACI,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,iBAAiB;IAWrD,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,iBAAiB;IAkBrD,IAAI,IAAI,iBAAiB;IAWzB,IAAI,IAAI,iBAAiB;CAUjC"}
|
package/dist/history.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { applyCommand, StudioCommandError } from './commands.js';
|
|
2
|
+
import { cloneContractValue } from './clone.js';
|
|
3
|
+
export class StudioHistory {
|
|
4
|
+
#maximumEntries;
|
|
5
|
+
#current;
|
|
6
|
+
#future = [];
|
|
7
|
+
#past = [];
|
|
8
|
+
#stateVersion = 0;
|
|
9
|
+
constructor(document, maximumEntries = 100) {
|
|
10
|
+
if (!Number.isInteger(maximumEntries) || maximumEntries < 1) {
|
|
11
|
+
throw new RangeError('History maximum must be a positive integer.');
|
|
12
|
+
}
|
|
13
|
+
this.#current = cloneContractValue(document);
|
|
14
|
+
this.#maximumEntries = maximumEntries;
|
|
15
|
+
}
|
|
16
|
+
get canRedo() {
|
|
17
|
+
return this.#future.length > 0;
|
|
18
|
+
}
|
|
19
|
+
get canUndo() {
|
|
20
|
+
return this.#past.length > 0;
|
|
21
|
+
}
|
|
22
|
+
get current() {
|
|
23
|
+
return cloneContractValue(this.#current);
|
|
24
|
+
}
|
|
25
|
+
get stateVersion() {
|
|
26
|
+
return this.#stateVersion;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Advances the host-authored revision carried by every local snapshot.
|
|
30
|
+
*
|
|
31
|
+
* A successful optimistic save establishes one new base revision for the
|
|
32
|
+
* complete local timeline. Rebasing the current, past, and future snapshots
|
|
33
|
+
* keeps later commands and preview staging on that base without fabricating
|
|
34
|
+
* an edit, changing the history topology, or advancing `stateVersion`.
|
|
35
|
+
*/
|
|
36
|
+
rebaseRevision(revision) {
|
|
37
|
+
const rebase = (document) => ({
|
|
38
|
+
...document,
|
|
39
|
+
revision,
|
|
40
|
+
});
|
|
41
|
+
this.#current = rebase(this.#current);
|
|
42
|
+
this.#past = this.#past.map(rebase);
|
|
43
|
+
this.#future = this.#future.map(rebase);
|
|
44
|
+
return this.current;
|
|
45
|
+
}
|
|
46
|
+
execute(command) {
|
|
47
|
+
if (command.baseStateVersion !== this.#stateVersion) {
|
|
48
|
+
throw new StudioCommandError('stale-state', `Command state ${command.baseStateVersion} does not match ${this.#stateVersion}.`);
|
|
49
|
+
}
|
|
50
|
+
const next = applyCommand(this.#current, command);
|
|
51
|
+
this.#past.push(this.#current);
|
|
52
|
+
if (this.#past.length > this.#maximumEntries) {
|
|
53
|
+
this.#past.shift();
|
|
54
|
+
}
|
|
55
|
+
this.#current = next;
|
|
56
|
+
this.#future = [];
|
|
57
|
+
this.#stateVersion += 1;
|
|
58
|
+
return this.current;
|
|
59
|
+
}
|
|
60
|
+
redo() {
|
|
61
|
+
const next = this.#future.pop();
|
|
62
|
+
if (next === undefined) {
|
|
63
|
+
return this.current;
|
|
64
|
+
}
|
|
65
|
+
this.#past.push(this.#current);
|
|
66
|
+
this.#current = next;
|
|
67
|
+
this.#stateVersion += 1;
|
|
68
|
+
return this.current;
|
|
69
|
+
}
|
|
70
|
+
undo() {
|
|
71
|
+
const previous = this.#past.pop();
|
|
72
|
+
if (previous === undefined) {
|
|
73
|
+
return this.current;
|
|
74
|
+
}
|
|
75
|
+
this.#future.push(this.#current);
|
|
76
|
+
this.#current = previous;
|
|
77
|
+
this.#stateVersion += 1;
|
|
78
|
+
return this.current;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,OAAO,aAAa;IACf,eAAe,CAAS;IACjC,QAAQ,CAAoB;IAC5B,OAAO,GAAwB,EAAE,CAAC;IAClC,KAAK,GAAwB,EAAE,CAAC;IAChC,aAAa,GAAG,CAAC,CAAC;IAElB,YAAmB,QAA2B,EAAE,cAAc,GAAG,GAAG;QAClE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,cAAc,GAAG,CAAC,EAAE,CAAC;YAC5D,MAAM,IAAI,UAAU,CAAC,6CAA6C,CAAC,CAAC;QAC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AAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/B,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;YAC7C,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEM,IAAI;QACT,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QAChC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEM,IAAI;QACT,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QAClC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type ArtifactReference, type ContentModelDocument, type HostAdapter, type HostPortResult, type JsonObject, type QualifiedName, type ResourceSearchPage, type ResourceSearchQuery, type Revision, type StableId, type StudioConfiguration, type StudioDiagnostic } from '@kumwe/studio-protocol';
|
|
2
|
+
import { type CapabilityNegotiationResult } from './negotiation.js';
|
|
3
|
+
import { StudioSession } from './session.js';
|
|
4
|
+
/** Public bounds enforced before a composed session invokes resource search. */
|
|
5
|
+
export declare const STUDIO_RESOURCE_SEARCH_LIMITS: Readonly<{
|
|
6
|
+
maximumCursorLength: number;
|
|
7
|
+
maximumLimit: number;
|
|
8
|
+
maximumSearchLength: number;
|
|
9
|
+
minimumLimit: number;
|
|
10
|
+
}>;
|
|
11
|
+
export interface StudioHostSessionIdentifierFactories {
|
|
12
|
+
/** Allocates a session-unique request identifier for one host attempt. */
|
|
13
|
+
requestId(operationId: QualifiedName): StableId;
|
|
14
|
+
/** Allocates a mutation identifier; exact failed-intent retries reuse it. */
|
|
15
|
+
idempotencyKey(operationId: QualifiedName): StableId;
|
|
16
|
+
}
|
|
17
|
+
export interface OpenStudioSessionOptions {
|
|
18
|
+
/** A schema-valid, resolved, immutable configuration supplied by the host. */
|
|
19
|
+
configuration: StudioConfiguration;
|
|
20
|
+
/** Injected so core never depends on clocks, randomness, DOM, or Node APIs. */
|
|
21
|
+
identifiers: StudioHostSessionIdentifierFactories;
|
|
22
|
+
/** Additional port capabilities whose absence should be diagnosed as degradation. */
|
|
23
|
+
optionalPorts?: readonly QualifiedName[];
|
|
24
|
+
}
|
|
25
|
+
export interface StudioHostSessionRecovery {
|
|
26
|
+
discard(): Promise<HostPortResult<null>>;
|
|
27
|
+
load(): Promise<HostPortResult<JsonObject | null>>;
|
|
28
|
+
store(envelope: JsonObject): Promise<HostPortResult<null>>;
|
|
29
|
+
}
|
|
30
|
+
/** Read-only access to the authorized model projection behind this session. */
|
|
31
|
+
export interface StudioHostSessionModels {
|
|
32
|
+
get(reference: ArtifactReference): Promise<HostPortResult<ContentModelDocument>>;
|
|
33
|
+
list(): Promise<HostPortResult<ContentModelDocument[]>>;
|
|
34
|
+
}
|
|
35
|
+
/** Read-only discovery of host-authorized resources behind this session. */
|
|
36
|
+
export interface StudioHostSessionResources {
|
|
37
|
+
search(query: ResourceSearchQuery): Promise<HostPortResult<ResourceSearchPage>>;
|
|
38
|
+
}
|
|
39
|
+
export interface StudioHostSessionHandle {
|
|
40
|
+
/** The complete open-time negotiation and profile diagnostics. */
|
|
41
|
+
readonly diagnostics: readonly StudioDiagnostic[];
|
|
42
|
+
readonly disposed: boolean;
|
|
43
|
+
readonly invalidated: boolean;
|
|
44
|
+
readonly negotiation: CapabilityNegotiationResult;
|
|
45
|
+
/** Present only when the model port advertises and implements both read operations. */
|
|
46
|
+
readonly models: StudioHostSessionModels | undefined;
|
|
47
|
+
/** Present only when feature policy, advertised operations, and adapter agree. */
|
|
48
|
+
readonly recovery: StudioHostSessionRecovery | undefined;
|
|
49
|
+
/** Present only when the resource port advertises and implements search. */
|
|
50
|
+
readonly resources: StudioHostSessionResources | undefined;
|
|
51
|
+
/** The most recent host-accepted Blueprint revision. */
|
|
52
|
+
readonly revision: Revision;
|
|
53
|
+
readonly session: StudioSession;
|
|
54
|
+
/** Local, idempotent teardown. It never invents a host teardown operation. */
|
|
55
|
+
dispose(): void;
|
|
56
|
+
save(): Promise<HostPortResult<null>>;
|
|
57
|
+
}
|
|
58
|
+
export type StudioHostSessionErrorCode = 'configuration-blocked' | 'disposed' | 'invalid-identifier' | 'invalid-model-reference' | 'invalid-resource-query' | 'read-only-session' | 'unexpected-artifact';
|
|
59
|
+
/** A local composition/state failure, distinct from a host-port rejection. */
|
|
60
|
+
export declare class StudioHostSessionError extends Error {
|
|
61
|
+
readonly code: StudioHostSessionErrorCode;
|
|
62
|
+
readonly diagnostics: readonly StudioDiagnostic[];
|
|
63
|
+
constructor(code: StudioHostSessionErrorCode, message: string, diagnostics?: readonly StudioDiagnostic[]);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Composes the DOM-free editing engine with one resolved host configuration.
|
|
67
|
+
*
|
|
68
|
+
* The current contract-safe profile opens a single Blueprint only. It does
|
|
69
|
+
* not fabricate entry/model state, infer a transport, stage preview drafts,
|
|
70
|
+
* or reconcile recovery data. Those capabilities require their own explicit
|
|
71
|
+
* contracts.
|
|
72
|
+
*/
|
|
73
|
+
export declare function openStudioSession(adapter: HostAdapter, options: Readonly<OpenStudioSessionOptions>): Promise<StudioHostSessionHandle>;
|
|
74
|
+
//# sourceMappingURL=host-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-session.d.ts","sourceRoot":"","sources":["../src/host-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAEhB,KAAK,cAAc,EAEnB,KAAK,UAAU,EAIf,KAAK,aAAa,EAElB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAyB,KAAK,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAG3F,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAmB7C,gFAAgF;AAChF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC;IACnD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;CACtB,CAKC,CAAC;AAiBH,MAAM,WAAW,oCAAoC;IACnD,0EAA0E;IAC1E,SAAS,CAAC,WAAW,EAAE,aAAa,GAAG,QAAQ,CAAC;IAChD,6EAA6E;IAC7E,cAAc,CAAC,WAAW,EAAE,aAAa,GAAG,QAAQ,CAAC;CACtD;AAED,MAAM,WAAW,wBAAwB;IACvC,8EAA8E;IAC9E,aAAa,EAAE,mBAAmB,CAAC;IACnC,+EAA+E;IAC/E,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