@kumwe/studio-core 0.1.0-alpha.7 → 0.1.0-rc.1
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/README.md +62 -3
- 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/contributions.d.ts +30 -2
- package/dist/contributions.d.ts.map +1 -1
- package/dist/contributions.js +150 -17
- package/dist/contributions.js.map +1 -1
- package/dist/extension-sdk.d.ts +9 -4
- package/dist/extension-sdk.d.ts.map +1 -1
- package/dist/extension-sdk.js +87 -15
- package/dist/extension-sdk.js.map +1 -1
- package/dist/history.d.ts +10 -1
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +18 -0
- package/dist/history.js.map +1 -1
- 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 +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- 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/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 +2 -2
- package/dist/profile-validator.d.ts.map +1 -1
- package/dist/profile-validator.js +144 -40
- package/dist/profile-validator.js.map +1 -1
- package/dist/schema-profile.d.ts +23 -5
- package/dist/schema-profile.d.ts.map +1 -1
- package/dist/schema-profile.js +785 -160
- package/dist/schema-profile.js.map +1 -1
- package/dist/session.d.ts +8 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +15 -2
- package/dist/session.js.map +1 -1
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +52 -6
- package/dist/validation.js.map +1 -1
- package/package.json +4 -2
|
@@ -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,WAA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