@arcadia-eternity/content-sdk 4.5.3 → 4.7.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 +2 -2
- package/dist/author-api.d.ts +12 -2
- package/dist/author-api.js +11 -2
- package/dist/author-git.d.ts +63 -0
- package/dist/author-git.js +324 -0
- package/dist/author-reference.d.ts +15 -1
- package/dist/author-reference.js +20 -1
- package/dist/cli.js +5 -4
- package/dist/content-query.d.ts +15 -1
- package/dist/content-query.js +53 -11
- package/dist/content-workspace.d.ts +435 -6
- package/dist/content-workspace.js +238 -77
- package/dist/debug-environments.d.ts +393 -33
- package/dist/debug-environments.js +10 -50
- package/dist/demo.js +1 -1
- package/dist/effect-declarations.d.ts +14 -0
- package/dist/effect-declarations.js +103 -0
- package/dist/environment-host-base.d.ts +175 -0
- package/dist/environment-host-base.js +86 -0
- package/dist/environment-member-transfer.d.ts +5 -0
- package/dist/environment-member-transfer.js +95 -0
- package/dist/environment-rules.d.ts +728 -3
- package/dist/environment-rules.js +158 -74
- package/dist/environment-sharing.d.ts +51 -0
- package/dist/environment-sharing.js +321 -0
- package/dist/environment.d.ts +2 -0
- package/dist/environment.js +32 -9
- package/dist/jobs.d.ts +5 -0
- package/dist/jobs.js +59 -10
- package/dist/learnsets.d.ts +47 -0
- package/dist/learnsets.js +124 -0
- package/dist/lib/content.d.ts +1 -1
- package/dist/lib/content.js +26 -2
- package/dist/lib/presentation.js +5 -11
- package/dist/managed-projects.d.ts +6 -0
- package/dist/managed-projects.js +137 -45
- package/dist/managed-sources.d.ts +17 -0
- package/dist/managed-sources.js +28 -10
- package/dist/mcp-contracts.d.ts +405 -12
- package/dist/mcp-contracts.js +3 -1
- package/dist/mcp.js +23 -1
- package/dist/pack-project.d.ts +2 -1
- package/dist/pack-project.js +40 -5
- package/dist/prepared-document.d.ts +476 -0
- package/dist/prepared-document.js +47 -0
- package/dist/preview.js +5 -5
- package/dist/project.d.ts +3 -1
- package/dist/project.js +47 -4
- package/dist/rule-composition.d.ts +290 -0
- package/dist/rule-composition.js +267 -0
- package/dist/template/.github/scripts/release-payload.mjs +91 -0
- package/dist/template/.github/scripts/release-test-npm.mjs +27 -0
- package/dist/template/.github/scripts/verify-release.mjs +138 -0
- package/dist/template/.github/workflows/release-pack.yml +77 -0
- package/dist/template/README.md +15 -2
- package/dist/template/gitignore-template +7 -0
- package/dist/template/npm-lock-template.json +2319 -0
- package/dist/template/package.json +4 -2
- package/dist/template/skills/arcadia-content-authoring/references/tool-workflows.md +1 -1
- package/dist/template/skills/arcadia-content-git/SKILL.md +14 -0
- package/dist/template/skills/arcadia-content-release/SKILL.md +29 -0
- package/dist/template/test/pack.test.mjs +24 -5
- package/dist/testing.d.ts +1 -0
- package/dist/testing.js +26 -7
- package/dist/workspace-cli.js +2 -2
- package/dist/workspace-materials.d.ts +4 -1
- package/dist/workspace-materials.js +8 -2
- package/dist/workspace.d.ts +11 -0
- package/dist/workspace.js +191 -31
- package/package.json +16 -4
- package/release-payload.mjs +91 -0
- package/release-test-npm.mjs +27 -0
package/dist/content-query.js
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
|
+
import { contentLocaleCollection } from '@arcadia-eternity/schema';
|
|
1
2
|
import { lstat, readFile, realpath } from 'node:fs/promises';
|
|
2
3
|
import { dirname, join } from 'node:path';
|
|
3
4
|
import { AuthorWorkspace, WorkspaceError, diagnostic, } from './workspace.js';
|
|
4
5
|
import { recordSharing } from './lib/yaml-sharing.js';
|
|
5
6
|
import { errorCode, isRecord } from './types.js';
|
|
6
7
|
const kinds = ['content', 'presentations', 'resources', 'assets', 'files', 'locales', 'diagnostics'];
|
|
7
|
-
const contentKinds = [
|
|
8
|
+
const contentKinds = [
|
|
9
|
+
'species',
|
|
10
|
+
'skills',
|
|
11
|
+
'marks',
|
|
12
|
+
'behaviors',
|
|
13
|
+
'natures',
|
|
14
|
+
'enhancements',
|
|
15
|
+
'elements',
|
|
16
|
+
'parameterGroups',
|
|
17
|
+
'parameterProfiles',
|
|
18
|
+
'parameterBindings',
|
|
19
|
+
'ruleSets',
|
|
20
|
+
'matchupTables',
|
|
21
|
+
'presentations',
|
|
22
|
+
'resources',
|
|
23
|
+
];
|
|
8
24
|
const scopes = ['project', 'dependencies', 'all'];
|
|
9
25
|
const details = ['summary', 'full'];
|
|
10
|
-
const localeKinds = {
|
|
11
|
-
species: 'species',
|
|
12
|
-
skill: 'skills',
|
|
13
|
-
mark: 'marks',
|
|
14
|
-
mark_ability: 'marks',
|
|
15
|
-
mark_emblem: 'marks',
|
|
16
|
-
mark_global: 'marks',
|
|
17
|
-
};
|
|
18
26
|
const compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
19
27
|
function invalid(message) {
|
|
20
28
|
throw new WorkspaceError('QUERY_INVALID', message);
|
|
@@ -181,7 +189,9 @@ function translations(snapshot, row, locale) {
|
|
|
181
189
|
.flatMap((source) => {
|
|
182
190
|
const entries = isRecord(source.entries) ? source.entries : undefined;
|
|
183
191
|
const entry = entries?.[row.record.id];
|
|
184
|
-
return
|
|
192
|
+
return contentLocaleCollection(source.namespace) === row.kind &&
|
|
193
|
+
(!locale || source.language === locale) &&
|
|
194
|
+
isRecord(entry)
|
|
185
195
|
? [{ locale: source.language, localeNamespace: source.namespace, ...entry }]
|
|
186
196
|
: [];
|
|
187
197
|
})
|
|
@@ -205,6 +215,38 @@ function nameFields(localizations, requested, fallback) {
|
|
|
205
215
|
...(names.length > 1 ? { ambiguousName: true } : {}),
|
|
206
216
|
};
|
|
207
217
|
}
|
|
218
|
+
export async function dependencyReferences(workspace, locale) {
|
|
219
|
+
const { catalogs: sources, diagnostics } = await catalogs(workspace, 'all');
|
|
220
|
+
const items = [];
|
|
221
|
+
const projectIds = new Set();
|
|
222
|
+
const conflicts = new Set();
|
|
223
|
+
for (const { owner } of sources) {
|
|
224
|
+
if (!owner.projectId)
|
|
225
|
+
continue;
|
|
226
|
+
if (projectIds.has(owner.projectId)) {
|
|
227
|
+
conflicts.add(owner.projectId);
|
|
228
|
+
diagnostics.push({ message: `多个内容包使用项目标识 ${owner.projectId},请检查项目依赖。` });
|
|
229
|
+
}
|
|
230
|
+
projectIds.add(owner.projectId);
|
|
231
|
+
}
|
|
232
|
+
for (const { owner, snapshot } of sources) {
|
|
233
|
+
if (owner.scope !== 'dependencies' || !owner.projectId || !owner.packageName || conflicts.has(owner.projectId))
|
|
234
|
+
continue;
|
|
235
|
+
for (const row of snapshot.records) {
|
|
236
|
+
if (row.kind !== 'skills' && row.kind !== 'marks')
|
|
237
|
+
continue;
|
|
238
|
+
const { name } = nameFields(translations(snapshot, row, locale), locale, row.record.name);
|
|
239
|
+
items.push({
|
|
240
|
+
projectId: owner.projectId,
|
|
241
|
+
packageName: owner.packageName,
|
|
242
|
+
kind: row.kind,
|
|
243
|
+
id: row.record.id,
|
|
244
|
+
label: name ?? row.record.id,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return { items, diagnostics: diagnostics.map(entry => entry.message) };
|
|
249
|
+
}
|
|
208
250
|
function rowsFor(catalog, query) {
|
|
209
251
|
const { snapshot, owner } = catalog;
|
|
210
252
|
const identify = (id, kind, source = {}) => ({
|
|
@@ -221,7 +263,7 @@ function rowsFor(catalog, query) {
|
|
|
221
263
|
if (!isRecord(record))
|
|
222
264
|
return [];
|
|
223
265
|
const row = identify(id, 'locales', {
|
|
224
|
-
contentKind:
|
|
266
|
+
contentKind: contentLocaleCollection(source.namespace),
|
|
225
267
|
file: source.file,
|
|
226
268
|
version: source.version,
|
|
227
269
|
locale: source.language,
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { type SkillParameterCatalog, readElementCatalog } from '@arcadia-eternity/const';
|
|
1
2
|
import { type EnvironmentDocumentV2 } from './debug-environments.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { exportDependencies, type ArchiveReference } from './environment-sharing.js';
|
|
5
|
+
export { copyEnvironmentMember } from './environment-member-transfer.js';
|
|
6
|
+
export { readInstalledEnvironmentDocument } from './prepared-document.js';
|
|
2
7
|
export { normalizeEnvironmentDocument } from './debug-environments.js';
|
|
3
8
|
export type { EnvironmentRules } from './debug-environments.js';
|
|
4
9
|
export type EnvironmentDocument = EnvironmentDocumentV2;
|
|
@@ -6,6 +11,387 @@ export interface EnvironmentDraft {
|
|
|
6
11
|
document: EnvironmentDocument;
|
|
7
12
|
revision: string;
|
|
8
13
|
}
|
|
14
|
+
declare const compositionSchema: z.ZodObject<{
|
|
15
|
+
rules: z.ZodObject<{
|
|
16
|
+
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
17
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
allOf: z.ZodArray<z.ZodObject<{
|
|
20
|
+
kind: z.ZodEnum<{
|
|
21
|
+
mark: "mark";
|
|
22
|
+
skill: "skill";
|
|
23
|
+
species: "species";
|
|
24
|
+
}>;
|
|
25
|
+
ids: z.ZodArray<z.ZodString>;
|
|
26
|
+
}, z.core.$strict>>;
|
|
27
|
+
kind: z.ZodLiteral<"ban">;
|
|
28
|
+
scope: z.ZodEnum<{
|
|
29
|
+
pet: "pet";
|
|
30
|
+
team: "team";
|
|
31
|
+
}>;
|
|
32
|
+
exceptWhen: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
33
|
+
kind: z.ZodEnum<{
|
|
34
|
+
mark: "mark";
|
|
35
|
+
skill: "skill";
|
|
36
|
+
species: "species";
|
|
37
|
+
}>;
|
|
38
|
+
ids: z.ZodArray<z.ZodString>;
|
|
39
|
+
}, z.core.$strict>>>;
|
|
40
|
+
exceptAny: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
41
|
+
kind: z.ZodEnum<{
|
|
42
|
+
mark: "mark";
|
|
43
|
+
skill: "skill";
|
|
44
|
+
species: "species";
|
|
45
|
+
}>;
|
|
46
|
+
ids: z.ZodArray<z.ZodString>;
|
|
47
|
+
}, z.core.$strict>>>>;
|
|
48
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
49
|
+
id: z.ZodString;
|
|
50
|
+
allOf: z.ZodArray<z.ZodObject<{
|
|
51
|
+
kind: z.ZodEnum<{
|
|
52
|
+
mark: "mark";
|
|
53
|
+
skill: "skill";
|
|
54
|
+
species: "species";
|
|
55
|
+
}>;
|
|
56
|
+
ids: z.ZodArray<z.ZodString>;
|
|
57
|
+
}, z.core.$strict>>;
|
|
58
|
+
kind: z.ZodLiteral<"memberLimit">;
|
|
59
|
+
max: z.ZodNumber;
|
|
60
|
+
}, z.core.$strict>], "kind">>>;
|
|
61
|
+
mechanics: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
skillSlots: z.ZodOptional<z.ZodObject<{
|
|
63
|
+
normalMax: z.ZodNumber;
|
|
64
|
+
climaxMax: z.ZodNumber;
|
|
65
|
+
climaxMin: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
}, z.core.$strict>>;
|
|
67
|
+
individualValueDefault: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
individualValues: z.ZodOptional<z.ZodObject<{
|
|
69
|
+
max: z.ZodNumber;
|
|
70
|
+
}, z.core.$strict>>;
|
|
71
|
+
allowFaintSwitch: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
inheritance: z.ZodOptional<z.ZodObject<{
|
|
73
|
+
eligible: z.ZodUnion<readonly [z.ZodEnum<{
|
|
74
|
+
all: "all";
|
|
75
|
+
off: "off";
|
|
76
|
+
species: "species";
|
|
77
|
+
}>, z.ZodArray<z.ZodString>]>;
|
|
78
|
+
pool: z.ZodOptional<z.ZodObject<{
|
|
79
|
+
mode: z.ZodEnum<{
|
|
80
|
+
append: "append";
|
|
81
|
+
fallback: "fallback";
|
|
82
|
+
replace: "replace";
|
|
83
|
+
}>;
|
|
84
|
+
skills: z.ZodArray<z.ZodString>;
|
|
85
|
+
}, z.core.$strict>>;
|
|
86
|
+
}, z.core.$strict>>;
|
|
87
|
+
enhancement: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
mode: z.ZodEnum<{
|
|
89
|
+
active: "active";
|
|
90
|
+
forbidden: "forbidden";
|
|
91
|
+
suppressed: "suppressed";
|
|
92
|
+
}>;
|
|
93
|
+
stages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
94
|
+
species: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
95
|
+
}, z.core.$strict>>;
|
|
96
|
+
secondGenerationNatures: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
97
|
+
all: "all";
|
|
98
|
+
off: "off";
|
|
99
|
+
species: "species";
|
|
100
|
+
}>, z.ZodArray<z.ZodString>]>>;
|
|
101
|
+
}, z.core.$strict>>;
|
|
102
|
+
skillParameters: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
104
|
+
groups: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
105
|
+
overrides: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
106
|
+
skill: z.ZodString;
|
|
107
|
+
useId: z.ZodString;
|
|
108
|
+
parameter: z.ZodString;
|
|
109
|
+
value: z.ZodNumber;
|
|
110
|
+
}, z.core.$strict>>>;
|
|
111
|
+
}, z.core.$strict>>;
|
|
112
|
+
matchups: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
table: z.ZodOptional<z.ZodString>;
|
|
114
|
+
adjustments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
115
|
+
attack: z.ZodString;
|
|
116
|
+
defense: z.ZodString;
|
|
117
|
+
multiplier: z.ZodNumber;
|
|
118
|
+
}, z.core.$strict>>>;
|
|
119
|
+
}, z.core.$strict>>;
|
|
120
|
+
learnsetAdjustments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
121
|
+
species: z.ZodString;
|
|
122
|
+
source: z.ZodEnum<{
|
|
123
|
+
inherited: "inherited";
|
|
124
|
+
normal: "normal";
|
|
125
|
+
}>;
|
|
126
|
+
skill: z.ZodString;
|
|
127
|
+
action: z.ZodEnum<{
|
|
128
|
+
add: "add";
|
|
129
|
+
remove: "remove";
|
|
130
|
+
}>;
|
|
131
|
+
level: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
}, z.core.$strict>>>;
|
|
133
|
+
tier: z.ZodOptional<z.ZodLiteral<"standard">>;
|
|
134
|
+
allow: z.ZodOptional<z.ZodObject<{
|
|
135
|
+
species: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
136
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
137
|
+
marks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
138
|
+
}, z.core.$strict>>;
|
|
139
|
+
deny: z.ZodOptional<z.ZodObject<{
|
|
140
|
+
species: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
141
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
142
|
+
marks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
143
|
+
}, z.core.$strict>>;
|
|
144
|
+
team: z.ZodOptional<z.ZodObject<{
|
|
145
|
+
minSize: z.ZodOptional<z.ZodNumber>;
|
|
146
|
+
maxSize: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
uniqueSpecies: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
+
}, z.core.$strict>>;
|
|
149
|
+
}, z.core.$strict>;
|
|
150
|
+
requiredCapabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
151
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
152
|
+
path: z.ZodArray<z.ZodString>;
|
|
153
|
+
value: z.ZodUnknown;
|
|
154
|
+
sources: z.ZodArray<z.ZodString>;
|
|
155
|
+
effectiveSources: z.ZodArray<z.ZodString>;
|
|
156
|
+
}, z.core.$strip>>;
|
|
157
|
+
ruleSets: z.ZodArray<z.ZodObject<{
|
|
158
|
+
id: z.ZodString;
|
|
159
|
+
name: z.ZodString;
|
|
160
|
+
rules: z.ZodObject<{
|
|
161
|
+
schemaVersion: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>;
|
|
162
|
+
mechanics: z.ZodOptional<z.ZodObject<{
|
|
163
|
+
skillSlots: z.ZodOptional<z.ZodObject<{
|
|
164
|
+
normalMax: z.ZodNumber;
|
|
165
|
+
climaxMax: z.ZodNumber;
|
|
166
|
+
climaxMin: z.ZodOptional<z.ZodNumber>;
|
|
167
|
+
}, z.core.$strict>>;
|
|
168
|
+
individualValueDefault: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
individualValues: z.ZodOptional<z.ZodObject<{
|
|
170
|
+
max: z.ZodNumber;
|
|
171
|
+
}, z.core.$strict>>;
|
|
172
|
+
allowFaintSwitch: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
+
inheritance: z.ZodOptional<z.ZodObject<{
|
|
174
|
+
eligible: z.ZodUnion<readonly [z.ZodEnum<{
|
|
175
|
+
all: "all";
|
|
176
|
+
off: "off";
|
|
177
|
+
species: "species";
|
|
178
|
+
}>, z.ZodArray<z.ZodString>]>;
|
|
179
|
+
pool: z.ZodOptional<z.ZodObject<{
|
|
180
|
+
mode: z.ZodEnum<{
|
|
181
|
+
append: "append";
|
|
182
|
+
fallback: "fallback";
|
|
183
|
+
replace: "replace";
|
|
184
|
+
}>;
|
|
185
|
+
skills: z.ZodArray<z.ZodString>;
|
|
186
|
+
}, z.core.$strict>>;
|
|
187
|
+
}, z.core.$strict>>;
|
|
188
|
+
enhancement: z.ZodOptional<z.ZodObject<{
|
|
189
|
+
mode: z.ZodEnum<{
|
|
190
|
+
active: "active";
|
|
191
|
+
forbidden: "forbidden";
|
|
192
|
+
suppressed: "suppressed";
|
|
193
|
+
}>;
|
|
194
|
+
stages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
195
|
+
species: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
196
|
+
}, z.core.$strict>>;
|
|
197
|
+
secondGenerationNatures: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
198
|
+
all: "all";
|
|
199
|
+
off: "off";
|
|
200
|
+
species: "species";
|
|
201
|
+
}>, z.ZodArray<z.ZodString>]>>;
|
|
202
|
+
}, z.core.$strict>>;
|
|
203
|
+
skillParameters: z.ZodOptional<z.ZodObject<{
|
|
204
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
205
|
+
groups: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
206
|
+
overrides: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
207
|
+
skill: z.ZodString;
|
|
208
|
+
useId: z.ZodString;
|
|
209
|
+
parameter: z.ZodString;
|
|
210
|
+
value: z.ZodNumber;
|
|
211
|
+
}, z.core.$strict>>>;
|
|
212
|
+
}, z.core.$strict>>;
|
|
213
|
+
matchups: z.ZodOptional<z.ZodObject<{
|
|
214
|
+
table: z.ZodOptional<z.ZodString>;
|
|
215
|
+
adjustments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
216
|
+
attack: z.ZodString;
|
|
217
|
+
defense: z.ZodString;
|
|
218
|
+
multiplier: z.ZodNumber;
|
|
219
|
+
}, z.core.$strict>>>;
|
|
220
|
+
}, z.core.$strict>>;
|
|
221
|
+
learnsetAdjustments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
222
|
+
species: z.ZodString;
|
|
223
|
+
source: z.ZodEnum<{
|
|
224
|
+
inherited: "inherited";
|
|
225
|
+
normal: "normal";
|
|
226
|
+
}>;
|
|
227
|
+
skill: z.ZodString;
|
|
228
|
+
action: z.ZodEnum<{
|
|
229
|
+
add: "add";
|
|
230
|
+
remove: "remove";
|
|
231
|
+
}>;
|
|
232
|
+
level: z.ZodOptional<z.ZodNumber>;
|
|
233
|
+
}, z.core.$strict>>>;
|
|
234
|
+
tier: z.ZodOptional<z.ZodLiteral<"standard">>;
|
|
235
|
+
allow: z.ZodOptional<z.ZodObject<{
|
|
236
|
+
species: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
237
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
238
|
+
marks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
239
|
+
}, z.core.$strict>>;
|
|
240
|
+
deny: z.ZodOptional<z.ZodObject<{
|
|
241
|
+
species: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
242
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
243
|
+
marks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
244
|
+
}, z.core.$strict>>;
|
|
245
|
+
team: z.ZodOptional<z.ZodObject<{
|
|
246
|
+
minSize: z.ZodOptional<z.ZodNumber>;
|
|
247
|
+
maxSize: z.ZodOptional<z.ZodNumber>;
|
|
248
|
+
uniqueSpecies: z.ZodOptional<z.ZodBoolean>;
|
|
249
|
+
}, z.core.$strict>>;
|
|
250
|
+
constraints: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
251
|
+
id: z.ZodString;
|
|
252
|
+
allOf: z.ZodArray<z.ZodObject<{
|
|
253
|
+
kind: z.ZodEnum<{
|
|
254
|
+
mark: "mark";
|
|
255
|
+
skill: "skill";
|
|
256
|
+
species: "species";
|
|
257
|
+
}>;
|
|
258
|
+
ids: z.ZodArray<z.ZodString>;
|
|
259
|
+
fromCollections: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
260
|
+
}, z.core.$strict>>;
|
|
261
|
+
kind: z.ZodLiteral<"ban">;
|
|
262
|
+
scope: z.ZodEnum<{
|
|
263
|
+
pet: "pet";
|
|
264
|
+
team: "team";
|
|
265
|
+
}>;
|
|
266
|
+
exceptWhen: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
267
|
+
kind: z.ZodEnum<{
|
|
268
|
+
mark: "mark";
|
|
269
|
+
skill: "skill";
|
|
270
|
+
species: "species";
|
|
271
|
+
}>;
|
|
272
|
+
ids: z.ZodArray<z.ZodString>;
|
|
273
|
+
fromCollections: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
274
|
+
}, z.core.$strict>>>;
|
|
275
|
+
exceptAny: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
276
|
+
kind: z.ZodEnum<{
|
|
277
|
+
mark: "mark";
|
|
278
|
+
skill: "skill";
|
|
279
|
+
species: "species";
|
|
280
|
+
}>;
|
|
281
|
+
ids: z.ZodArray<z.ZodString>;
|
|
282
|
+
fromCollections: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
283
|
+
}, z.core.$strict>>>>;
|
|
284
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
285
|
+
id: z.ZodString;
|
|
286
|
+
allOf: z.ZodArray<z.ZodObject<{
|
|
287
|
+
kind: z.ZodEnum<{
|
|
288
|
+
mark: "mark";
|
|
289
|
+
skill: "skill";
|
|
290
|
+
species: "species";
|
|
291
|
+
}>;
|
|
292
|
+
ids: z.ZodArray<z.ZodString>;
|
|
293
|
+
fromCollections: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
294
|
+
}, z.core.$strict>>;
|
|
295
|
+
kind: z.ZodLiteral<"memberLimit">;
|
|
296
|
+
max: z.ZodNumber;
|
|
297
|
+
}, z.core.$strict>], "kind">>>;
|
|
298
|
+
collections: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
299
|
+
id: z.ZodString;
|
|
300
|
+
kind: z.ZodEnum<{
|
|
301
|
+
mark: "mark";
|
|
302
|
+
skill: "skill";
|
|
303
|
+
species: "species";
|
|
304
|
+
}>;
|
|
305
|
+
ids: z.ZodArray<z.ZodString>;
|
|
306
|
+
}, z.core.$strict>>>;
|
|
307
|
+
include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
308
|
+
constraintEdits: z.ZodOptional<z.ZodObject<{
|
|
309
|
+
remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
310
|
+
replace: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
311
|
+
id: z.ZodString;
|
|
312
|
+
allOf: z.ZodArray<z.ZodObject<{
|
|
313
|
+
kind: z.ZodEnum<{
|
|
314
|
+
mark: "mark";
|
|
315
|
+
skill: "skill";
|
|
316
|
+
species: "species";
|
|
317
|
+
}>;
|
|
318
|
+
ids: z.ZodArray<z.ZodString>;
|
|
319
|
+
fromCollections: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
320
|
+
}, z.core.$strict>>;
|
|
321
|
+
kind: z.ZodLiteral<"ban">;
|
|
322
|
+
scope: z.ZodEnum<{
|
|
323
|
+
pet: "pet";
|
|
324
|
+
team: "team";
|
|
325
|
+
}>;
|
|
326
|
+
exceptWhen: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
327
|
+
kind: z.ZodEnum<{
|
|
328
|
+
mark: "mark";
|
|
329
|
+
skill: "skill";
|
|
330
|
+
species: "species";
|
|
331
|
+
}>;
|
|
332
|
+
ids: z.ZodArray<z.ZodString>;
|
|
333
|
+
fromCollections: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
334
|
+
}, z.core.$strict>>>;
|
|
335
|
+
exceptAny: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
336
|
+
kind: z.ZodEnum<{
|
|
337
|
+
mark: "mark";
|
|
338
|
+
skill: "skill";
|
|
339
|
+
species: "species";
|
|
340
|
+
}>;
|
|
341
|
+
ids: z.ZodArray<z.ZodString>;
|
|
342
|
+
fromCollections: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
343
|
+
}, z.core.$strict>>>>;
|
|
344
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
345
|
+
id: z.ZodString;
|
|
346
|
+
allOf: z.ZodArray<z.ZodObject<{
|
|
347
|
+
kind: z.ZodEnum<{
|
|
348
|
+
mark: "mark";
|
|
349
|
+
skill: "skill";
|
|
350
|
+
species: "species";
|
|
351
|
+
}>;
|
|
352
|
+
ids: z.ZodArray<z.ZodString>;
|
|
353
|
+
fromCollections: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
354
|
+
}, z.core.$strict>>;
|
|
355
|
+
kind: z.ZodLiteral<"memberLimit">;
|
|
356
|
+
max: z.ZodNumber;
|
|
357
|
+
}, z.core.$strict>], "kind">>>;
|
|
358
|
+
clearExceptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
359
|
+
exceptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
360
|
+
target: z.ZodString;
|
|
361
|
+
allOf: z.ZodArray<z.ZodObject<{
|
|
362
|
+
kind: z.ZodEnum<{
|
|
363
|
+
mark: "mark";
|
|
364
|
+
skill: "skill";
|
|
365
|
+
species: "species";
|
|
366
|
+
}>;
|
|
367
|
+
ids: z.ZodArray<z.ZodString>;
|
|
368
|
+
fromCollections: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
369
|
+
}, z.core.$strict>>;
|
|
370
|
+
}, z.core.$strict>>>;
|
|
371
|
+
}, z.core.$strict>>;
|
|
372
|
+
}, z.core.$strict>;
|
|
373
|
+
}, z.core.$strip>>;
|
|
374
|
+
}, z.core.$strict>;
|
|
375
|
+
declare const contentCatalogSchema: z.ZodObject<{
|
|
376
|
+
species: z.ZodArray<z.ZodObject<{
|
|
377
|
+
id: z.ZodString;
|
|
378
|
+
name: z.ZodOptional<z.ZodString>;
|
|
379
|
+
}, z.core.$strip>>;
|
|
380
|
+
skills: z.ZodArray<z.ZodObject<{
|
|
381
|
+
id: z.ZodString;
|
|
382
|
+
name: z.ZodOptional<z.ZodString>;
|
|
383
|
+
}, z.core.$strip>>;
|
|
384
|
+
marks: z.ZodArray<z.ZodObject<{
|
|
385
|
+
id: z.ZodString;
|
|
386
|
+
name: z.ZodOptional<z.ZodString>;
|
|
387
|
+
}, z.core.$strip>>;
|
|
388
|
+
stages: z.ZodArray<z.ZodObject<{
|
|
389
|
+
id: z.ZodString;
|
|
390
|
+
name: z.ZodOptional<z.ZodString>;
|
|
391
|
+
}, z.core.$strip>>;
|
|
392
|
+
}, z.core.$strip>;
|
|
393
|
+
type EnvironmentContentCatalog = z.infer<typeof contentCatalogSchema>;
|
|
394
|
+
export type PreparedRuleComposition = z.infer<typeof compositionSchema>;
|
|
9
395
|
export interface EnvironmentInstallation {
|
|
10
396
|
format: 'arcadia.environment-installation/1';
|
|
11
397
|
installationId: string;
|
|
@@ -14,6 +400,10 @@ export interface EnvironmentInstallation {
|
|
|
14
400
|
document: EnvironmentDocument;
|
|
15
401
|
draftRevision: string;
|
|
16
402
|
contentRevision: string;
|
|
403
|
+
ruleComposition?: PreparedRuleComposition;
|
|
404
|
+
skillParameters?: SkillParameterCatalog;
|
|
405
|
+
contentCatalog?: EnvironmentContentCatalog;
|
|
406
|
+
elementCatalog?: ReturnType<typeof readElementCatalog>;
|
|
17
407
|
members?: EnvironmentMember[];
|
|
18
408
|
packages: unknown[];
|
|
19
409
|
createdAt: number;
|
|
@@ -38,6 +428,7 @@ export interface PrepareEnvironmentInput {
|
|
|
38
428
|
expectedRevision: string | null;
|
|
39
429
|
document?: EnvironmentDocument;
|
|
40
430
|
projectDirectory?: string;
|
|
431
|
+
seedDirectory?: string;
|
|
41
432
|
directory?: string;
|
|
42
433
|
signal?: AbortSignal;
|
|
43
434
|
beforeCommit?: () => Promise<void>;
|
|
@@ -49,8 +440,15 @@ export type StaticPreparer = (input: {
|
|
|
49
440
|
}) => Promise<{
|
|
50
441
|
contentRevision: string;
|
|
51
442
|
packages?: unknown[];
|
|
443
|
+
ruleComposition?: PreparedRuleComposition;
|
|
444
|
+
skillParameters?: SkillParameterCatalog;
|
|
445
|
+
contentCatalog?: EnvironmentContentCatalog;
|
|
446
|
+
elementCatalog?: ReturnType<typeof readElementCatalog>;
|
|
52
447
|
}>;
|
|
53
448
|
export interface ContentWorkspaceOptions {
|
|
449
|
+
allowShareDownloads?: boolean;
|
|
450
|
+
bundledPackageRoot?: string;
|
|
451
|
+
npmCache?: string;
|
|
54
452
|
maxBytes?: number;
|
|
55
453
|
maxFiles?: number;
|
|
56
454
|
stagingRetentionMs?: number;
|
|
@@ -61,8 +459,27 @@ export interface ContentWorkspaceOptions {
|
|
|
61
459
|
remove?(retentionId: string): Promise<void>;
|
|
62
460
|
};
|
|
63
461
|
}
|
|
462
|
+
export declare const exportSelectionSchema: z.ZodObject<{
|
|
463
|
+
revision: z.ZodString;
|
|
464
|
+
locations: z.ZodArray<z.ZodString>;
|
|
465
|
+
}, z.core.$strict>;
|
|
466
|
+
export type EnvironmentExportSelection = z.infer<typeof exportSelectionSchema>;
|
|
467
|
+
export type EnvironmentExportMode = 'share' | 'offline' | EnvironmentExportSelection;
|
|
468
|
+
export interface EnvironmentExportPreview {
|
|
469
|
+
revision: string;
|
|
470
|
+
dependencies: ReturnType<typeof exportDependencies>;
|
|
471
|
+
}
|
|
472
|
+
export interface EnvironmentImportProbe {
|
|
473
|
+
lock: {
|
|
474
|
+
path: string;
|
|
475
|
+
data: string;
|
|
476
|
+
};
|
|
477
|
+
archives: ArchiveReference[];
|
|
478
|
+
}
|
|
64
479
|
export interface EnvironmentExport {
|
|
65
|
-
format: 'arcadia.environment-export/2';
|
|
480
|
+
format: 'arcadia.environment-export/2' | 'arcadia.environment-export/3' | 'arcadia.environment-export/4';
|
|
481
|
+
suppliedArchives?: Record<string, string>;
|
|
482
|
+
archives?: ArchiveReference[];
|
|
66
483
|
document: EnvironmentDocument;
|
|
67
484
|
contentRevision: string;
|
|
68
485
|
files: {
|
|
@@ -118,9 +535,10 @@ export interface ContentWorkspace {
|
|
|
118
535
|
}>;
|
|
119
536
|
retain(installationId: string, retentionId: string): Promise<void>;
|
|
120
537
|
releaseRetention(retentionId: string): Promise<void>;
|
|
121
|
-
references(installationId: string): Promise<Record<string, unknown>[]>;
|
|
122
538
|
clearInstallation(installationId: string): Promise<void>;
|
|
123
|
-
|
|
539
|
+
previewEnvironmentExport(installationId: string): Promise<EnvironmentExportPreview>;
|
|
540
|
+
missingEnvironmentArchives(probe: EnvironmentImportProbe): Promise<string[]>;
|
|
541
|
+
exportEnvironment(installationId: string, mode?: EnvironmentExportMode): Promise<EnvironmentExport>;
|
|
124
542
|
exportSnapshot(): Promise<WorkspaceSnapshot>;
|
|
125
543
|
captureSnapshot(): Promise<WorkspaceSnapshotCapture>;
|
|
126
544
|
isSnapshotCurrent(stamp: WorkspaceSnapshotStamp): Promise<boolean>;
|
|
@@ -136,6 +554,7 @@ export interface ContentWorkspace {
|
|
|
136
554
|
signal?: AbortSignal;
|
|
137
555
|
beforeCommit?: () => Promise<void>;
|
|
138
556
|
importId?: string;
|
|
557
|
+
allowDownload?: boolean;
|
|
139
558
|
}, preparer: StaticPreparer): Promise<EnvironmentInstallation>;
|
|
140
559
|
recoverImport(importId: string): Promise<EnvironmentInstallation>;
|
|
141
560
|
forgetImport(importId: string, input?: {
|
|
@@ -156,6 +575,7 @@ export interface ContentWorkspaceConstructor {
|
|
|
156
575
|
open(directory: string, options?: ContentWorkspaceOptions): Promise<ContentWorkspace>;
|
|
157
576
|
}
|
|
158
577
|
export interface EnvironmentMember {
|
|
578
|
+
archiveIntegrity?: string;
|
|
159
579
|
name: string;
|
|
160
580
|
version: string;
|
|
161
581
|
projectId: string;
|
|
@@ -166,10 +586,19 @@ export interface EnvironmentMember {
|
|
|
166
586
|
}
|
|
167
587
|
export declare const ContentWorkspace: ContentWorkspaceConstructor;
|
|
168
588
|
/** Change desired roots only. Resolved material and all published installations remain immutable. */
|
|
169
|
-
export
|
|
589
|
+
export type AddEnvironmentPackageInput = {
|
|
590
|
+
environmentId: string;
|
|
591
|
+
expectedRevision: string;
|
|
592
|
+
name: string;
|
|
593
|
+
version?: string;
|
|
594
|
+
source?: boolean;
|
|
595
|
+
};
|
|
596
|
+
export type RemoveEnvironmentPackageInput = {
|
|
170
597
|
environmentId: string;
|
|
171
598
|
expectedRevision: string;
|
|
172
599
|
name: string;
|
|
173
|
-
enabled: boolean;
|
|
174
600
|
cascade?: boolean;
|
|
175
|
-
}
|
|
601
|
+
};
|
|
602
|
+
type PackageWorkspace = Pick<ContentWorkspace, 'listDrafts' | 'listInstallations' | 'saveDraft'>;
|
|
603
|
+
export declare function addEnvironmentPackage(workspace: PackageWorkspace, input: AddEnvironmentPackageInput): Promise<EnvironmentDraft>;
|
|
604
|
+
export declare function removeEnvironmentPackage(workspace: PackageWorkspace, input: RemoveEnvironmentPackageInput): Promise<EnvironmentDraft>;
|