@xpert-ai/contracts 3.15.8 → 3.15.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/package.json +1 -1
- package/src/artifact.model.d.ts +149 -0
- package/src/collaboration.model.d.ts +108 -0
- package/src/index.d.ts +2 -0
package/package.json
CHANGED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
|
|
2
|
+
/**
|
|
3
|
+
* Access policies supported by platform-managed Artifact links.
|
|
4
|
+
*
|
|
5
|
+
* `public_link` is the only mode intended for anonymous web access; `signed_preview`
|
|
6
|
+
* is a short-lived capability URL for temporary previews.
|
|
7
|
+
*/
|
|
8
|
+
export type ArtifactAccessMode = 'owner_only' | 'workspace_all' | 'organization_all' | 'custom_principals' | 'public_link' | 'signed_preview';
|
|
9
|
+
/** Lifecycle state of an Artifact container. */
|
|
10
|
+
export type ArtifactStatus = 'active' | 'archived' | 'deleted';
|
|
11
|
+
/** Lifecycle state of an immutable Artifact content version. */
|
|
12
|
+
export type ArtifactVersionStatus = 'active' | 'deleted';
|
|
13
|
+
/** Lifecycle state of a public or scoped Artifact access entrypoint. */
|
|
14
|
+
export type ArtifactLinkStatus = 'active' | 'revoked' | 'expired';
|
|
15
|
+
/** Artifact rendering/download family used by viewers and security policy. */
|
|
16
|
+
export type ArtifactKind = 'html' | 'markdown' | 'pdf' | 'pptx' | 'image' | 'file' | 'site' | 'presentation';
|
|
17
|
+
/** Whether an Artifact link follows the latest version or pins one immutable version. */
|
|
18
|
+
export type ArtifactLinkVersionMode = 'latest' | 'version';
|
|
19
|
+
/** Browser presentation hint for Artifact responses. */
|
|
20
|
+
export type ArtifactLinkDisposition = 'inline' | 'attachment';
|
|
21
|
+
/** HTML safety profile applied when serving interactive or strict single-file HTML. */
|
|
22
|
+
export type ArtifactSafeHtmlProfile = 'strict' | 'interactive';
|
|
23
|
+
/** Audited events emitted by Artifact open/download/management flows. */
|
|
24
|
+
export type ArtifactAccessEvent = 'access' | 'download' | 'denied' | 'revoked' | 'expired' | 'archived' | 'deleted';
|
|
25
|
+
/**
|
|
26
|
+
* Persistable reference to a Workspace Files object.
|
|
27
|
+
*
|
|
28
|
+
* The platform stores Artifact bytes in Workspace Files and keeps only this
|
|
29
|
+
* portable reference in Artifact metadata, so async jobs and public controllers
|
|
30
|
+
* can resolve content without leaking host filesystem paths.
|
|
31
|
+
*/
|
|
32
|
+
export interface IArtifactWorkspaceFileReference {
|
|
33
|
+
source: 'platform.workspace.files';
|
|
34
|
+
filePath: string;
|
|
35
|
+
workspacePath: string;
|
|
36
|
+
tenantId?: string | null;
|
|
37
|
+
userId?: string | null;
|
|
38
|
+
catalog?: 'projects' | 'users' | 'knowledges' | 'skills' | 'xperts' | null;
|
|
39
|
+
scopeId?: string | null;
|
|
40
|
+
projectId?: string | null;
|
|
41
|
+
knowledgeId?: string | null;
|
|
42
|
+
rootId?: string | null;
|
|
43
|
+
xpertId?: string | null;
|
|
44
|
+
isolateByUser?: boolean | null;
|
|
45
|
+
originalName?: string | null;
|
|
46
|
+
name?: string | null;
|
|
47
|
+
mimeType?: string | null;
|
|
48
|
+
size?: number | null;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Artifact is the durable product object created by Agents/plugins.
|
|
52
|
+
*
|
|
53
|
+
* It is a stable container for versioned content such as generated HTML, PDFs,
|
|
54
|
+
* decks, images, static sites, or other files. Content bytes live in versions;
|
|
55
|
+
* this record owns source identity, scope, title, and current-version pointer.
|
|
56
|
+
*/
|
|
57
|
+
export interface IArtifact extends IBasePerTenantAndOrganizationEntityModel {
|
|
58
|
+
pluginName: string;
|
|
59
|
+
resourceType: string;
|
|
60
|
+
resourceId: string;
|
|
61
|
+
checksum?: string | null;
|
|
62
|
+
kind: ArtifactKind;
|
|
63
|
+
status: ArtifactStatus;
|
|
64
|
+
title?: string | null;
|
|
65
|
+
description?: string | null;
|
|
66
|
+
currentVersionId?: string | null;
|
|
67
|
+
currentVersion?: IArtifactVersion | null;
|
|
68
|
+
workspaceId?: string | null;
|
|
69
|
+
projectId?: string | null;
|
|
70
|
+
xpertId?: string | null;
|
|
71
|
+
userId?: string | null;
|
|
72
|
+
metadata?: Record<string, unknown> | null;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Immutable content version of an Artifact.
|
|
76
|
+
*
|
|
77
|
+
* Version rows point at a Workspace Files reference and include enough content
|
|
78
|
+
* metadata to validate checksums, serve downloads, and reproduce a fixed share.
|
|
79
|
+
*/
|
|
80
|
+
export interface IArtifactVersion extends IBasePerTenantAndOrganizationEntityModel {
|
|
81
|
+
artifact?: IArtifact | null;
|
|
82
|
+
artifactId: string;
|
|
83
|
+
versionNumber: number;
|
|
84
|
+
status: ArtifactVersionStatus;
|
|
85
|
+
sourceVersionId?: string | null;
|
|
86
|
+
checksum?: string | null;
|
|
87
|
+
workspaceFileRef: IArtifactWorkspaceFileReference;
|
|
88
|
+
mimeType: string;
|
|
89
|
+
fileName?: string | null;
|
|
90
|
+
title?: string | null;
|
|
91
|
+
description?: string | null;
|
|
92
|
+
size?: number | null;
|
|
93
|
+
sha256?: string | null;
|
|
94
|
+
workspaceId?: string | null;
|
|
95
|
+
projectId?: string | null;
|
|
96
|
+
xpertId?: string | null;
|
|
97
|
+
userId?: string | null;
|
|
98
|
+
metadata?: Record<string, unknown> | null;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Access entrypoint for an Artifact.
|
|
102
|
+
*
|
|
103
|
+
* A link owns the externally copied slug/public URL, access policy, optional
|
|
104
|
+
* pinned version, and counters. It can point to `latest` or a fixed version.
|
|
105
|
+
*/
|
|
106
|
+
export interface IArtifactLink extends IBasePerTenantAndOrganizationEntityModel {
|
|
107
|
+
artifact?: IArtifact | null;
|
|
108
|
+
artifactId: string;
|
|
109
|
+
artifactVersionId?: string | null;
|
|
110
|
+
versionMode: ArtifactLinkVersionMode;
|
|
111
|
+
slug: string;
|
|
112
|
+
publicUrl: string;
|
|
113
|
+
accessMode: ArtifactAccessMode;
|
|
114
|
+
status: ArtifactLinkStatus;
|
|
115
|
+
customPrincipals?: string[] | null;
|
|
116
|
+
tokenHash?: string | null;
|
|
117
|
+
expiresAt?: Date | null;
|
|
118
|
+
revokedAt?: Date | null;
|
|
119
|
+
accessCount: number;
|
|
120
|
+
downloadCount: number;
|
|
121
|
+
disposition: ArtifactLinkDisposition;
|
|
122
|
+
allowDownload: boolean;
|
|
123
|
+
safeHtmlProfile?: ArtifactSafeHtmlProfile | null;
|
|
124
|
+
workspaceId?: string | null;
|
|
125
|
+
projectId?: string | null;
|
|
126
|
+
xpertId?: string | null;
|
|
127
|
+
userId?: string | null;
|
|
128
|
+
metadata?: Record<string, unknown> | null;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Append-only audit row for Artifact access and lifecycle events.
|
|
132
|
+
*
|
|
133
|
+
* Logs intentionally store hashes/summaries rather than public tokens or file
|
|
134
|
+
* contents, so public access remains auditable without leaking sensitive data.
|
|
135
|
+
*/
|
|
136
|
+
export interface IArtifactAccessLog extends IBasePerTenantAndOrganizationEntityModel {
|
|
137
|
+
link?: IArtifactLink | null;
|
|
138
|
+
linkId?: string | null;
|
|
139
|
+
artifactId?: string | null;
|
|
140
|
+
slug: string;
|
|
141
|
+
event: ArtifactAccessEvent;
|
|
142
|
+
accessMode?: ArtifactAccessMode | null;
|
|
143
|
+
principalUserId?: string | null;
|
|
144
|
+
ipHash?: string | null;
|
|
145
|
+
userAgent?: string | null;
|
|
146
|
+
statusCode?: number | null;
|
|
147
|
+
error?: string | null;
|
|
148
|
+
metadata?: Record<string, unknown> | null;
|
|
149
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { IBasePerTenantAndOrganizationEntityModel } from './base-entity.model';
|
|
2
|
+
export type CollaborationEngine = 'yjs';
|
|
3
|
+
export type CollaborationDocumentStatus = 'active' | 'archived' | 'deleted';
|
|
4
|
+
export type CollaborationMaterializationStatus = 'ready' | 'pending' | 'failed';
|
|
5
|
+
export type CollaborationActorType = 'user' | 'agent' | 'system';
|
|
6
|
+
export type CollaborationActorStatus = 'thinking' | 'editing' | 'done' | 'failed';
|
|
7
|
+
export type CollaborationAccess = 'read' | 'write' | 'manage';
|
|
8
|
+
/** Safe, presentation-ready identity exposed to collaboration clients. */
|
|
9
|
+
export interface ICollaborationActor {
|
|
10
|
+
/** Opaque, stable identity for presence; it must not reveal a platform user id. */
|
|
11
|
+
presenceId: string;
|
|
12
|
+
actorType: CollaborationActorType;
|
|
13
|
+
displayName: string;
|
|
14
|
+
color: string;
|
|
15
|
+
avatarUrl?: string | null;
|
|
16
|
+
}
|
|
17
|
+
/** Pointer coordinates normalized to the collaborative page, in the inclusive 0..1 range. */
|
|
18
|
+
export interface ICollaborationPointer {
|
|
19
|
+
pageId?: string | null;
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
visible: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** Optional viewport metadata used to render remote cursors at the correct scale. */
|
|
25
|
+
export interface ICollaborationViewport {
|
|
26
|
+
zoom: number;
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
}
|
|
30
|
+
/** Semantic location currently operated on by a collaborator. */
|
|
31
|
+
export interface ICollaborationFocus {
|
|
32
|
+
/** Plugin-defined focus category, for example `slide`, `text`, `control`, or `element`. */
|
|
33
|
+
kind: string;
|
|
34
|
+
key?: string | null;
|
|
35
|
+
pageId?: string | null;
|
|
36
|
+
elementId?: string | null;
|
|
37
|
+
fieldKey?: string | null;
|
|
38
|
+
}
|
|
39
|
+
/** A text range expressed as Yjs relative positions, or a set of selected element ids. */
|
|
40
|
+
export interface ICollaborationSelection {
|
|
41
|
+
kind: 'text' | 'elements';
|
|
42
|
+
fieldKey?: string | null;
|
|
43
|
+
elementIds?: string[] | null;
|
|
44
|
+
anchorRelativeBase64?: string | null;
|
|
45
|
+
headRelativeBase64?: string | null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Ephemeral presence shared by users, agents, and system actors.
|
|
49
|
+
* Presence is intentionally not part of the persisted collaboration document.
|
|
50
|
+
*/
|
|
51
|
+
export interface ICollaborationPresence extends ICollaborationActor {
|
|
52
|
+
/** Socket id for users, or the opaque presence id for virtual actors. */
|
|
53
|
+
clientId: string;
|
|
54
|
+
pageId?: string | null;
|
|
55
|
+
pointer?: ICollaborationPointer | null;
|
|
56
|
+
focus?: ICollaborationFocus | null;
|
|
57
|
+
selection?: ICollaborationSelection | null;
|
|
58
|
+
viewport?: ICollaborationViewport | null;
|
|
59
|
+
mode?: string | null;
|
|
60
|
+
status?: CollaborationActorStatus | null;
|
|
61
|
+
toolName?: string | null;
|
|
62
|
+
operationLabel?: string | null;
|
|
63
|
+
updatedAt: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Authoritative, platform-managed state of one plugin collaboration resource.
|
|
67
|
+
* Plugin business entities are materialized projections of this Yjs state.
|
|
68
|
+
*/
|
|
69
|
+
export interface ICollaborationDocument extends IBasePerTenantAndOrganizationEntityModel {
|
|
70
|
+
/** Provider registered by a plugin, such as `presentation-studio.deck`. */
|
|
71
|
+
providerKey: string;
|
|
72
|
+
/** Stable business-resource id understood by the provider. */
|
|
73
|
+
resourceId: string;
|
|
74
|
+
engine: CollaborationEngine;
|
|
75
|
+
/** Version of the plugin-owned Yjs schema, not the platform database schema. */
|
|
76
|
+
schemaVersion: number;
|
|
77
|
+
status: CollaborationDocumentStatus;
|
|
78
|
+
/** Complete Yjs state encoded as a base64 update. */
|
|
79
|
+
stateBase64: string;
|
|
80
|
+
/** State vector corresponding exactly to `stateBase64`. */
|
|
81
|
+
stateVectorBase64: string;
|
|
82
|
+
/** Monotonic platform sequence incremented once for each unique accepted update. */
|
|
83
|
+
sequenceNumber: number;
|
|
84
|
+
updateCount: number;
|
|
85
|
+
/** Highest sequence successfully projected into the plugin business entity. */
|
|
86
|
+
materializedSequence: number;
|
|
87
|
+
materializationStatus: CollaborationMaterializationStatus;
|
|
88
|
+
lastMaterializationError?: string | null;
|
|
89
|
+
workspaceId?: string | null;
|
|
90
|
+
projectId?: string | null;
|
|
91
|
+
xpertId?: string | null;
|
|
92
|
+
userId?: string | null;
|
|
93
|
+
metadata?: Record<string, unknown> | null;
|
|
94
|
+
}
|
|
95
|
+
/** Immutable update journal entry used for idempotency and bounded delta retention. */
|
|
96
|
+
export interface ICollaborationUpdate extends IBasePerTenantAndOrganizationEntityModel {
|
|
97
|
+
document?: ICollaborationDocument | null;
|
|
98
|
+
documentId: string;
|
|
99
|
+
/** Sequence assigned while the document row is locked. */
|
|
100
|
+
sequenceNumber: number;
|
|
101
|
+
updateBase64: string;
|
|
102
|
+
/** SHA-256 of the decoded update bytes; unique per document. */
|
|
103
|
+
updateHash: string;
|
|
104
|
+
origin?: string | null;
|
|
105
|
+
actorType?: CollaborationActorType | null;
|
|
106
|
+
presenceId?: string | null;
|
|
107
|
+
userId?: string | null;
|
|
108
|
+
}
|
package/src/index.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ export * from './integration/index';
|
|
|
48
48
|
export * from './ai/index';
|
|
49
49
|
export * from './agent/index';
|
|
50
50
|
export * from './api-key.model';
|
|
51
|
+
export * from './artifact.model';
|
|
52
|
+
export * from './collaboration.model';
|
|
51
53
|
export * from './schedule';
|
|
52
54
|
export * from './tools/index';
|
|
53
55
|
export * from './plain-object.model';
|