@arcadia-eternity/content-sdk 4.15.7 → 4.16.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 +1 -1
- package/dist/author-reference.d.ts +181 -2
- package/dist/author-reference.js +69 -2
- package/dist/creator-docs.d.ts +20 -0
- package/dist/creator-docs.js +89 -0
- package/dist/mcp-contracts.d.ts +12 -0
- package/dist/mcp-contracts.js +20 -1
- package/dist/mcp.js +5 -2
- package/dist/sdk-reference.d.ts +53 -0
- package/dist/sdk-reference.js +99 -0
- package/dist/sdk-reference.json +1 -0
- package/dist/template/package.json +2 -2
- package/dist/template/src/effects/slow.effect.ts +5 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -87,7 +87,7 @@ The desktop MCP configuration includes an optional `--context-file` path under E
|
|
|
87
87
|
|
|
88
88
|
Cooperating author processes serialize version checks and writes within each project under `.arcadia/author-locks`, outside source revisions. Busy writes fail after bounded waiting; a live writer is never displaced. This coordinates the desktop, CLI and MCP, not arbitrary external editors, and does not make multi-file saves transactional. Context describes unsaved content but does not lock a project: MCP writes update disk, while the desktop retains dirty drafts and their base versions for explicit reconciliation. File-version conflicts remain authoritative even if context has expired. Partial `content_apply` results set `isError` and retain per-file receipts.
|
|
89
89
|
|
|
90
|
-
`author_reference` and `arcadia://authoring/<topic>` provide installed SDK schemas/examples for species, skills, marks, teams, environments, descriptions and effects. Parser schema notes distinguish linked runtime data from source references. The `authoring` topic provides the installed guide to CLI initialization and environment debugging. The `git` and `release` topics cover source control and content-pack releases. `asset_inspect` returns metadata for a declared resource ID; `includeImage` returns local image bytes up to 2 MiB as standard MCP image content. MIME types follow source filenames via `mime-types`; unknown extensions remain metadata-only. Decoding and display belong to the MCP client: no image dimension parsing, container validation or transcoding is performed, and `imageAvailable` indicates transport eligibility rather than decodability. Remote URLs are metadata only, with no fetching or caching; audio and SWF are not executed.
|
|
90
|
+
`author_reference` and `arcadia://authoring/<topic>` provide installed SDK schemas/examples for species, skills, marks, teams, environments, descriptions and effects. Parser schema notes distinguish linked runtime data from source references. Pass an exact `symbol` from a topic’s `entries` to retrieve the same Markdown and template excerpts as the [creator docs](https://arcadia-creator-docs.pages.dev). Start with `{"topic":"tutorials","symbol":"frost-strike"}` or `{"topic":"effects","symbol":"EffectTrigger.OnHit"}`. The `authoring` topic provides the installed guide to CLI initialization and environment debugging. The `git` and `release` topics cover source control and content-pack releases. `asset_inspect` returns metadata for a declared resource ID; `includeImage` returns local image bytes up to 2 MiB as standard MCP image content. MIME types follow source filenames via `mime-types`; unknown extensions remain metadata-only. Decoding and display belong to the MCP client: no image dimension parsing, container validation or transcoding is performed, and `imageAvailable` indicates transport eligibility rather than decodability. Remote URLs are metadata only, with no fetching or caching; audio and SWF are not executed.
|
|
91
91
|
|
|
92
92
|
Execution-enabled sessions expose `battle_create`, `battle_read`, `battle_events`, `battle_action`, `battle_reset` and `battle_close`. Supply a running preview `jobId`; creation requires two saved team IDs and a fixed seed. Creation and reset read the latest saved team files and retain their versions in that automation battle. They use the captured candidate rules without rebuilding for team-only changes. These tools never operate on the human preview battle or local team drafts. Mutations require `sessionId` and `expectedRevision`; submit a selection returned by `battle_read`. Events use bounded cursor pagination. A failed engine step returns its revision and diagnosis with `stateCurrent: false`, allowing reset/close while preserving the last valid state. At most four automation battles exist per preview; stopping the preview releases all of them. A stale candidate remains an old-source result.
|
|
93
93
|
|
|
@@ -1,23 +1,169 @@
|
|
|
1
|
-
|
|
1
|
+
import { sdkGroups } from './sdk-reference.js';
|
|
2
|
+
export declare const referenceTopics: readonly ['sdk', 'authoring', 'tutorials', 'mcp', 'species', 'skills', 'marks', 'team', 'environment', 'descriptions', 'effects', 'git', 'release'];
|
|
2
3
|
/** Discover installed SDK contracts, without importing a content project's executable effects. */
|
|
3
|
-
export declare function authorReference({ topic }?: {
|
|
4
|
+
export declare function authorReference({ topic, symbol, query, offset, }?: {
|
|
4
5
|
topic?: string;
|
|
6
|
+
symbol?: string;
|
|
7
|
+
query?: string;
|
|
8
|
+
offset?: number;
|
|
5
9
|
}): Promise<{
|
|
10
|
+
symbol: string;
|
|
11
|
+
source?: {
|
|
12
|
+
path: string;
|
|
13
|
+
line: number;
|
|
14
|
+
};
|
|
15
|
+
dispatches?: {
|
|
16
|
+
path: string;
|
|
17
|
+
line: number;
|
|
18
|
+
}[];
|
|
19
|
+
group: keyof typeof sdkGroups;
|
|
20
|
+
kind: string;
|
|
21
|
+
signature: string;
|
|
22
|
+
description: string;
|
|
23
|
+
owner?: string;
|
|
24
|
+
context?: string;
|
|
25
|
+
parent?: string;
|
|
26
|
+
fields?: string[];
|
|
27
|
+
methods?: {
|
|
28
|
+
receiver: string;
|
|
29
|
+
symbol: string;
|
|
30
|
+
}[];
|
|
31
|
+
variants?: string[];
|
|
32
|
+
example?: string;
|
|
33
|
+
exampleSource?: string;
|
|
34
|
+
related: string[];
|
|
35
|
+
topic: string;
|
|
36
|
+
title: string;
|
|
37
|
+
sdkVersion: string;
|
|
38
|
+
path: string;
|
|
39
|
+
url: string;
|
|
40
|
+
members: string[] | undefined;
|
|
41
|
+
markdown: string;
|
|
42
|
+
groups?: undefined;
|
|
43
|
+
total?: undefined;
|
|
44
|
+
matches?: undefined;
|
|
45
|
+
nextOffset?: undefined;
|
|
46
|
+
markdownUrl?: undefined;
|
|
47
|
+
instructions?: undefined;
|
|
48
|
+
stage?: undefined;
|
|
49
|
+
schema?: undefined;
|
|
50
|
+
entries?: undefined;
|
|
51
|
+
tags?: undefined;
|
|
52
|
+
examples?: undefined;
|
|
53
|
+
notes?: undefined;
|
|
54
|
+
} | {
|
|
55
|
+
topic: string;
|
|
56
|
+
title: string;
|
|
57
|
+
sdkVersion: string;
|
|
58
|
+
groups: {
|
|
59
|
+
readonly triggers: '触发器';
|
|
60
|
+
readonly objects: '战斗对象与上下文';
|
|
61
|
+
readonly functions: '创作函数与装饰器';
|
|
62
|
+
readonly values: 'SDK 对象与常量';
|
|
63
|
+
readonly enums: '枚举';
|
|
64
|
+
readonly types: '类型声明';
|
|
65
|
+
readonly host: '宿主专用函数';
|
|
66
|
+
};
|
|
67
|
+
total: number;
|
|
68
|
+
matches: {
|
|
69
|
+
symbol: string;
|
|
70
|
+
kind: string;
|
|
71
|
+
path: string;
|
|
72
|
+
}[];
|
|
73
|
+
nextOffset: number | null;
|
|
74
|
+
symbol?: undefined;
|
|
75
|
+
path?: undefined;
|
|
76
|
+
url?: undefined;
|
|
77
|
+
markdownUrl?: undefined;
|
|
78
|
+
markdown?: undefined;
|
|
79
|
+
instructions?: undefined;
|
|
80
|
+
stage?: undefined;
|
|
81
|
+
schema?: undefined;
|
|
82
|
+
entries?: undefined;
|
|
83
|
+
source?: undefined;
|
|
84
|
+
tags?: undefined;
|
|
85
|
+
examples?: undefined;
|
|
86
|
+
notes?: undefined;
|
|
87
|
+
} | {
|
|
88
|
+
groups?: undefined;
|
|
89
|
+
total?: undefined;
|
|
90
|
+
matches?: undefined;
|
|
91
|
+
nextOffset?: undefined;
|
|
92
|
+
topic: string;
|
|
93
|
+
symbol: string;
|
|
94
|
+
title: string;
|
|
95
|
+
path: string;
|
|
96
|
+
url: string;
|
|
97
|
+
markdownUrl: string;
|
|
98
|
+
sdkVersion: string;
|
|
99
|
+
markdown: string;
|
|
100
|
+
instructions?: undefined;
|
|
101
|
+
stage?: undefined;
|
|
102
|
+
schema?: undefined;
|
|
103
|
+
entries?: undefined;
|
|
104
|
+
source?: undefined;
|
|
105
|
+
tags?: undefined;
|
|
106
|
+
examples?: undefined;
|
|
107
|
+
notes?: undefined;
|
|
108
|
+
} | {
|
|
109
|
+
groups?: undefined;
|
|
110
|
+
total?: undefined;
|
|
111
|
+
matches?: undefined;
|
|
112
|
+
nextOffset?: undefined;
|
|
113
|
+
symbol?: undefined;
|
|
114
|
+
path?: undefined;
|
|
115
|
+
url?: undefined;
|
|
116
|
+
markdownUrl?: undefined;
|
|
117
|
+
markdown?: undefined;
|
|
118
|
+
topic: string;
|
|
119
|
+
title: string;
|
|
120
|
+
sdkVersion: string;
|
|
121
|
+
entries: import("./creator-docs.js").CreatorPage[];
|
|
122
|
+
instructions?: undefined;
|
|
123
|
+
stage?: undefined;
|
|
124
|
+
schema?: undefined;
|
|
125
|
+
source?: undefined;
|
|
126
|
+
tags?: undefined;
|
|
127
|
+
examples?: undefined;
|
|
128
|
+
notes?: undefined;
|
|
129
|
+
} | {
|
|
130
|
+
groups?: undefined;
|
|
131
|
+
total?: undefined;
|
|
132
|
+
matches?: undefined;
|
|
133
|
+
nextOffset?: undefined;
|
|
134
|
+
symbol?: undefined;
|
|
135
|
+
path?: undefined;
|
|
136
|
+
url?: undefined;
|
|
137
|
+
markdownUrl?: undefined;
|
|
138
|
+
markdown?: undefined;
|
|
139
|
+
sdkVersion?: undefined;
|
|
6
140
|
topic: string;
|
|
7
141
|
title: string;
|
|
8
142
|
source: string;
|
|
9
143
|
instructions: string;
|
|
144
|
+
entries: import("./creator-docs.js").CreatorPage[];
|
|
10
145
|
stage?: undefined;
|
|
11
146
|
schema?: undefined;
|
|
12
147
|
tags?: undefined;
|
|
13
148
|
examples?: undefined;
|
|
14
149
|
notes?: undefined;
|
|
15
150
|
} | {
|
|
151
|
+
groups?: undefined;
|
|
152
|
+
total?: undefined;
|
|
153
|
+
matches?: undefined;
|
|
154
|
+
nextOffset?: undefined;
|
|
155
|
+
symbol?: undefined;
|
|
156
|
+
path?: undefined;
|
|
157
|
+
url?: undefined;
|
|
158
|
+
markdownUrl?: undefined;
|
|
159
|
+
markdown?: undefined;
|
|
160
|
+
sdkVersion?: undefined;
|
|
16
161
|
instructions?: undefined;
|
|
17
162
|
topic: string;
|
|
18
163
|
title: string;
|
|
19
164
|
source: string;
|
|
20
165
|
stage: string;
|
|
166
|
+
entries: import("./creator-docs.js").CreatorPage[];
|
|
21
167
|
schema: {
|
|
22
168
|
[x: string]: unknown;
|
|
23
169
|
};
|
|
@@ -28,11 +174,22 @@ export declare function authorReference({ topic }?: {
|
|
|
28
174
|
notes: string[];
|
|
29
175
|
tags?: undefined;
|
|
30
176
|
} | {
|
|
177
|
+
groups?: undefined;
|
|
178
|
+
total?: undefined;
|
|
179
|
+
matches?: undefined;
|
|
180
|
+
nextOffset?: undefined;
|
|
181
|
+
symbol?: undefined;
|
|
182
|
+
path?: undefined;
|
|
183
|
+
url?: undefined;
|
|
184
|
+
markdownUrl?: undefined;
|
|
185
|
+
markdown?: undefined;
|
|
186
|
+
sdkVersion?: undefined;
|
|
31
187
|
instructions?: undefined;
|
|
32
188
|
topic: string;
|
|
33
189
|
title: string;
|
|
34
190
|
source: string;
|
|
35
191
|
stage: string;
|
|
192
|
+
entries: import("./creator-docs.js").CreatorPage[];
|
|
36
193
|
schema: {
|
|
37
194
|
properties: {
|
|
38
195
|
team: {
|
|
@@ -47,11 +204,22 @@ export declare function authorReference({ topic }?: {
|
|
|
47
204
|
notes: string[];
|
|
48
205
|
tags?: undefined;
|
|
49
206
|
} | {
|
|
207
|
+
groups?: undefined;
|
|
208
|
+
total?: undefined;
|
|
209
|
+
matches?: undefined;
|
|
210
|
+
nextOffset?: undefined;
|
|
211
|
+
symbol?: undefined;
|
|
212
|
+
path?: undefined;
|
|
213
|
+
url?: undefined;
|
|
214
|
+
markdownUrl?: undefined;
|
|
215
|
+
markdown?: undefined;
|
|
216
|
+
sdkVersion?: undefined;
|
|
50
217
|
instructions?: undefined;
|
|
51
218
|
stage?: undefined;
|
|
52
219
|
schema?: undefined;
|
|
53
220
|
topic: string;
|
|
54
221
|
title: string;
|
|
222
|
+
entries: import("./creator-docs.js").CreatorPage[];
|
|
55
223
|
source: string;
|
|
56
224
|
examples: {
|
|
57
225
|
language: string;
|
|
@@ -60,11 +228,22 @@ export declare function authorReference({ topic }?: {
|
|
|
60
228
|
notes: string[];
|
|
61
229
|
tags?: undefined;
|
|
62
230
|
} | {
|
|
231
|
+
groups?: undefined;
|
|
232
|
+
total?: undefined;
|
|
233
|
+
matches?: undefined;
|
|
234
|
+
nextOffset?: undefined;
|
|
235
|
+
symbol?: undefined;
|
|
236
|
+
path?: undefined;
|
|
237
|
+
url?: undefined;
|
|
238
|
+
markdownUrl?: undefined;
|
|
239
|
+
markdown?: undefined;
|
|
240
|
+
sdkVersion?: undefined;
|
|
63
241
|
instructions?: undefined;
|
|
64
242
|
stage?: undefined;
|
|
65
243
|
schema?: undefined;
|
|
66
244
|
topic: string;
|
|
67
245
|
title: string;
|
|
246
|
+
entries: import("./creator-docs.js").CreatorPage[];
|
|
68
247
|
source: string;
|
|
69
248
|
tags: string[];
|
|
70
249
|
examples: {
|
package/dist/author-reference.js
CHANGED
|
@@ -5,8 +5,13 @@ import { teamEnvelopeSchema, portablePetSchema } from './project-teams.js';
|
|
|
5
5
|
import { EnvironmentDocumentSchema } from './debug-environments.js';
|
|
6
6
|
import { WorkspaceError } from './workspace.js';
|
|
7
7
|
import { errorCode } from './types.js';
|
|
8
|
+
import { creatorDocsOrigin, creatorPages, creatorSdkVersion } from './creator-docs.js';
|
|
9
|
+
import { installedSdkCatalog, sdkGroups, sdkPath } from './sdk-reference.js';
|
|
8
10
|
export const referenceTopics = [
|
|
11
|
+
'sdk',
|
|
9
12
|
'authoring',
|
|
13
|
+
'tutorials',
|
|
14
|
+
'mcp',
|
|
10
15
|
'species',
|
|
11
16
|
'skills',
|
|
12
17
|
'marks',
|
|
@@ -38,9 +43,65 @@ async function template(file) {
|
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
45
|
/** Discover installed SDK contracts, without importing a content project's executable effects. */
|
|
41
|
-
export async function authorReference({ topic } = {}) {
|
|
46
|
+
export async function authorReference({ topic, symbol, query, offset = 0, } = {}) {
|
|
47
|
+
if (topic === 'sdk' || topic === undefined) {
|
|
48
|
+
if ((query !== undefined && typeof query !== 'string') || !Number.isSafeInteger(offset) || offset < 0)
|
|
49
|
+
throw new WorkspaceError('INPUT_INVALID', 'query 需要字符串,offset 需要非负整数');
|
|
50
|
+
const catalog = await installedSdkCatalog();
|
|
51
|
+
if (symbol) {
|
|
52
|
+
const item = catalog.byName.get(symbol);
|
|
53
|
+
if (!item)
|
|
54
|
+
throw new WorkspaceError('REFERENCE_UNKNOWN', `未知 SDK 符号:${symbol}。使用 query 搜索名称。`);
|
|
55
|
+
const path = sdkPath(item);
|
|
56
|
+
return {
|
|
57
|
+
...item,
|
|
58
|
+
topic: 'sdk',
|
|
59
|
+
title: symbol,
|
|
60
|
+
sdkVersion: creatorSdkVersion,
|
|
61
|
+
path,
|
|
62
|
+
url: new URL(path, creatorDocsOrigin).href,
|
|
63
|
+
members: catalog.children.get(symbol)?.map(child => child.symbol),
|
|
64
|
+
markdown: catalog.markdown(item),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const matches = query
|
|
68
|
+
? catalog.records.filter(item => item.symbol.toLowerCase().includes(query.toLowerCase()))
|
|
69
|
+
: catalog.records;
|
|
70
|
+
const end = offset + 50;
|
|
71
|
+
return {
|
|
72
|
+
topic: 'sdk',
|
|
73
|
+
title: '战斗 SDK 符号索引',
|
|
74
|
+
sdkVersion: creatorSdkVersion,
|
|
75
|
+
groups: sdkGroups,
|
|
76
|
+
total: matches.length,
|
|
77
|
+
matches: matches.slice(offset, end).map(item => ({ symbol: item.symbol, kind: item.kind, path: sdkPath(item) })),
|
|
78
|
+
nextOffset: end < matches.length ? end : null,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
42
81
|
if (!topic || !referenceTopics.includes(topic))
|
|
43
82
|
throw new WorkspaceError('REFERENCE_UNKNOWN', '请选择有效的作者参考主题');
|
|
83
|
+
const entries = creatorPages.filter(page => page.topic === topic);
|
|
84
|
+
const symbols = entries.flatMap(page => page.symbols);
|
|
85
|
+
if (symbol !== undefined) {
|
|
86
|
+
const page = entries.find(entry => entry.symbols.includes(symbol));
|
|
87
|
+
if (!page)
|
|
88
|
+
throw new WorkspaceError('REFERENCE_UNKNOWN', `未知的 ${topic} 条目:${symbol}。可查询:${symbols.join('、')}`);
|
|
89
|
+
const path = '/' + page.path;
|
|
90
|
+
const url = new URL(path, creatorDocsOrigin).href;
|
|
91
|
+
const markdownUrl = new URL('/reference' + path + '.md', creatorDocsOrigin).href;
|
|
92
|
+
return {
|
|
93
|
+
topic,
|
|
94
|
+
symbol,
|
|
95
|
+
title: page.title,
|
|
96
|
+
path,
|
|
97
|
+
url,
|
|
98
|
+
markdownUrl,
|
|
99
|
+
sdkVersion: creatorSdkVersion,
|
|
100
|
+
markdown: `# ${page.title}\n\n[在线阅读](${url}) · [Markdown 原文](${markdownUrl})\n`,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
if (topic === 'tutorials' || topic === 'mcp')
|
|
104
|
+
return { topic, title: topic === 'tutorials' ? '创作教程' : 'MCP 工具', sdkVersion: creatorSdkVersion, entries };
|
|
44
105
|
if (topic === 'authoring') {
|
|
45
106
|
const source = 'skills/arcadia-content-authoring/SKILL.md';
|
|
46
107
|
const instructions = await template(source).catch(error => {
|
|
@@ -48,12 +109,13 @@ export async function authorReference({ topic } = {}) {
|
|
|
48
109
|
throw error;
|
|
49
110
|
return readFile(new URL('../../../docs/guides/ugc-authoring-agent/SKILL.md', import.meta.url), 'utf8');
|
|
50
111
|
});
|
|
51
|
-
return { topic, title: 'Create and debug a pack or environment', source, instructions };
|
|
112
|
+
return { topic, title: 'Create and debug a pack or environment', source, instructions, entries };
|
|
52
113
|
}
|
|
53
114
|
if (topic === 'git' || topic === 'release') {
|
|
54
115
|
const source = `skills/arcadia-content-${topic}/SKILL.md`;
|
|
55
116
|
return {
|
|
56
117
|
topic,
|
|
118
|
+
entries,
|
|
57
119
|
title: topic === 'git' ? '提交与同步内容包' : '发布内容包',
|
|
58
120
|
source,
|
|
59
121
|
instructions: await template(source),
|
|
@@ -65,6 +127,7 @@ export async function authorReference({ topic } = {}) {
|
|
|
65
127
|
title: `${topic}: parser fields and source example`,
|
|
66
128
|
source: '@arcadia-eternity/battle/engine',
|
|
67
129
|
stage: 'linked-runtime',
|
|
130
|
+
entries,
|
|
68
131
|
schema: toJsonSchemaCompat(parserSchemas[topic]),
|
|
69
132
|
examples: [{ language: 'yaml', text: await template(examples[topic] ?? '') }],
|
|
70
133
|
notes: [
|
|
@@ -83,6 +146,7 @@ export async function authorReference({ topic } = {}) {
|
|
|
83
146
|
title: 'Portable project team',
|
|
84
147
|
source: '@arcadia-eternity/content-sdk/project-teams',
|
|
85
148
|
stage: 'source',
|
|
149
|
+
entries,
|
|
86
150
|
schema,
|
|
87
151
|
examples: [{ language: 'yaml', text: 'schemaVersion: 1\nid: blue\nname: 蓝队\nteam: []\n' }],
|
|
88
152
|
notes: [
|
|
@@ -97,6 +161,7 @@ export async function authorReference({ topic } = {}) {
|
|
|
97
161
|
title: 'Standalone and named battle environments',
|
|
98
162
|
source: '@arcadia-eternity/content-sdk/debug-environments',
|
|
99
163
|
stage: 'source',
|
|
164
|
+
entries,
|
|
100
165
|
schema: toJsonSchemaCompat(EnvironmentDocumentSchema),
|
|
101
166
|
examples: [
|
|
102
167
|
{
|
|
@@ -124,6 +189,7 @@ export async function authorReference({ topic } = {}) {
|
|
|
124
189
|
return {
|
|
125
190
|
topic,
|
|
126
191
|
title: 'Native TypeScript effects',
|
|
192
|
+
entries,
|
|
127
193
|
source: '@arcadia-eternity/content-sdk/dist/template/src/effects/slow.effect.ts',
|
|
128
194
|
examples: [{ language: 'typescript', text: await template('src/effects/slow.effect.ts') }],
|
|
129
195
|
notes: [
|
|
@@ -136,6 +202,7 @@ export async function authorReference({ topic } = {}) {
|
|
|
136
202
|
return {
|
|
137
203
|
topic,
|
|
138
204
|
title: 'ICU descriptions and semantic tags',
|
|
205
|
+
entries,
|
|
139
206
|
source: 'docs/guides/content-presentation.md; packages/web-ui/src/i18n/richDescription.ts',
|
|
140
207
|
tags: [
|
|
141
208
|
'markName',
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface CreatorPage {
|
|
2
|
+
path: string;
|
|
3
|
+
title: string;
|
|
4
|
+
topic: string;
|
|
5
|
+
symbols: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare const creatorSections: ({
|
|
8
|
+
title: string;
|
|
9
|
+
outcome: string;
|
|
10
|
+
reference: boolean;
|
|
11
|
+
pages: CreatorPage[];
|
|
12
|
+
} | {
|
|
13
|
+
outcome?: undefined;
|
|
14
|
+
title: string;
|
|
15
|
+
reference: boolean;
|
|
16
|
+
pages: CreatorPage[];
|
|
17
|
+
})[];
|
|
18
|
+
export declare const creatorPages: CreatorPage[];
|
|
19
|
+
export declare const creatorDocsOrigin = "https://arcadia-creator-docs.pages.dev";
|
|
20
|
+
export declare const creatorSdkVersion: string;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
function page(path, title, topic, ...symbols) {
|
|
3
|
+
return { path, title, topic, symbols };
|
|
4
|
+
}
|
|
5
|
+
export const creatorSections = [
|
|
6
|
+
{
|
|
7
|
+
title: '从工作台开始',
|
|
8
|
+
outcome: '建立资料包,用霜团打一场可复现的对战,再连接 AI 助手。',
|
|
9
|
+
reference: false,
|
|
10
|
+
pages: [
|
|
11
|
+
page('start/first-battle', '创建项目,打第一场对战', 'tutorials', 'first-battle'),
|
|
12
|
+
page('start/project', '资料包、源文件与对战环境', 'authoring', 'project-layout'),
|
|
13
|
+
page('start/assistant', '连接工作台和 AI 助手', 'tutorials', 'connect-assistant'),
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
title: '实作课程 · 霜击',
|
|
18
|
+
outcome: '把减速从两回合延长到三回合,验证再次命中只刷新持续时间。',
|
|
19
|
+
reference: false,
|
|
20
|
+
pages: [
|
|
21
|
+
page('frost-strike', '把霜击的减速延长到三回合', 'tutorials', 'frost-strike'),
|
|
22
|
+
page('tutorials/frost-strike/trace', '追踪命中后的减速效果', 'tutorials', 'frost-strike.trace'),
|
|
23
|
+
page('tutorials/frost-strike/change', '修改印记的持续时间', 'tutorials', 'frost-strike.change'),
|
|
24
|
+
page('tutorials/frost-strike/verify', '验证刷新与到期恢复', 'tutorials', 'frost-strike.verify'),
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
title: '制作精灵与技能',
|
|
29
|
+
outcome: '制作冰砾和雪芽,配置配招、立绘和技能描述。',
|
|
30
|
+
reference: false,
|
|
31
|
+
pages: [
|
|
32
|
+
page('make/first-skill', '给霜团做一招新技能', 'tutorials', 'first-skill'),
|
|
33
|
+
page('make/first-species', '制作第一只精灵', 'tutorials', 'first-species'),
|
|
34
|
+
page('make/presentation', '替换立绘与编写技能描述', 'descriptions', 'presentation', 'locales'),
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
title: '编排赛制',
|
|
39
|
+
outcome: '举办单精灵杯,用两支队伍检查报名规则。',
|
|
40
|
+
reference: false,
|
|
41
|
+
pages: [page('make/singles-cup', '举办单精灵杯', 'tutorials', 'singles-cup')],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: '测试与发布',
|
|
45
|
+
outcome: '把机制写成断言,安装到本机环境,生成可分享的发行归档。',
|
|
46
|
+
reference: false,
|
|
47
|
+
pages: [
|
|
48
|
+
page('test/scenarios', '编写战斗场景测试', 'effects', 'prepareContentPack', 'attack'),
|
|
49
|
+
page('test/troubleshooting', '排查保存、试玩和入场问题', 'authoring', 'troubleshooting'),
|
|
50
|
+
page('publish/local', '把作品安装到本机环境', 'release', 'local-install'),
|
|
51
|
+
page('publish/release', '用 Git 和发行归档分享作品', 'release', 'release-workflow', 'release_check'),
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
title: '内容格式',
|
|
56
|
+
reference: true,
|
|
57
|
+
pages: [
|
|
58
|
+
page('api/species', '物种、属性与可学习技能', 'species', 'baseStats', 'learnable_skills', 'learnable_skills[].skill_id'),
|
|
59
|
+
page('api/skill-fields', '技能基础字段', 'skills', 'power', 'accuracy', 'rage', 'category', 'element'),
|
|
60
|
+
page('api/skill-behaviors', '技能绑定 · behaviors', 'skills', 'behaviors', 'behaviors[].definitionId'),
|
|
61
|
+
page('api/mark-duration', '印记持续与刷新 · duration', 'marks', 'config.duration', 'config.stackStrategy', 'config.maxStacks'),
|
|
62
|
+
page('api/team', '队伍、首发与配招', 'team', 'team', 'team_list', 'team_save'),
|
|
63
|
+
page('api/environment', '环境规则与队伍校验', 'environment', 'rules.team.maxSize', 'environment_list', 'environment_save', 'team_validate'),
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
title: '效果用法',
|
|
68
|
+
reference: true,
|
|
69
|
+
pages: [
|
|
70
|
+
page('api/effect-lifecycle', '效果声明与触发时机', 'effects', 'effect', 'on', 'NativeEffectContext', 'HealContext'),
|
|
71
|
+
page('api/on-hit', '命中后施加印记 · OnHit', 'effects', 'EffectTrigger.OnHit', 'Pet.addMark', 'AddMarkContext'),
|
|
72
|
+
page('api/bind-attribute', '绑定速度 · bindAttribute', 'effects', 'ops.bindAttribute', 'EffectTrigger.OnMarkCreated'),
|
|
73
|
+
page('api/effect-state', '参数、随机数与跨回合状态', 'effects', 'numberParam', 'defineEffectState', 'getEffectState', 'setEffectState'),
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
title: 'MCP 与命令行',
|
|
78
|
+
reference: true,
|
|
79
|
+
pages: [
|
|
80
|
+
page('api/author-reference', '按符号查询 · author_reference', 'mcp', 'author_reference'),
|
|
81
|
+
page('api/workspace', '项目上下文、内容查询与保存', 'mcp', 'workspace_describe', 'workspace_context', 'content_query', 'content_apply', 'source_read', 'source_apply'),
|
|
82
|
+
page('api/battle-test', '测试与试战 · battle_create', 'mcp', 'test_start', 'job_get', 'preview_start', 'battle_create', 'battle_read', 'battle_action', 'battle_events', 'battle_close'),
|
|
83
|
+
page('api/cli', '创作 CLI 命令', 'authoring', 'arcadia-content'),
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
export const creatorPages = creatorSections.flatMap(section => section.pages);
|
|
88
|
+
export const creatorDocsOrigin = 'https://arcadia-creator-docs.pages.dev';
|
|
89
|
+
export const creatorSdkVersion = createRequire(import.meta.url)('../package.json').version;
|
package/dist/mcp-contracts.d.ts
CHANGED
|
@@ -730,6 +730,18 @@ export declare const outputSchemas: {
|
|
|
730
730
|
reference: z.ZodObject<{
|
|
731
731
|
topic: z.ZodString;
|
|
732
732
|
title: z.ZodString;
|
|
733
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
734
|
+
sdkVersion: z.ZodOptional<z.ZodString>;
|
|
735
|
+
path: z.ZodOptional<z.ZodString>;
|
|
736
|
+
url: z.ZodOptional<z.ZodString>;
|
|
737
|
+
markdownUrl: z.ZodOptional<z.ZodString>;
|
|
738
|
+
markdown: z.ZodOptional<z.ZodString>;
|
|
739
|
+
entries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
740
|
+
path: z.ZodString;
|
|
741
|
+
title: z.ZodString;
|
|
742
|
+
topic: z.ZodString;
|
|
743
|
+
symbols: z.ZodArray<z.ZodString>;
|
|
744
|
+
}, z.core.$strip>>>;
|
|
733
745
|
}, z.core.$loose>;
|
|
734
746
|
'asset-inspect': z.ZodObject<{
|
|
735
747
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
package/dist/mcp-contracts.js
CHANGED
|
@@ -148,7 +148,26 @@ export const outputSchemas = {
|
|
|
148
148
|
integrity: z.string(),
|
|
149
149
|
})
|
|
150
150
|
.passthrough(),
|
|
151
|
-
reference: z
|
|
151
|
+
reference: z
|
|
152
|
+
.object({
|
|
153
|
+
topic: z.string(),
|
|
154
|
+
title: z.string(),
|
|
155
|
+
symbol: z.string().optional(),
|
|
156
|
+
sdkVersion: z.string().optional(),
|
|
157
|
+
path: z.string().optional(),
|
|
158
|
+
url: z.string().url().optional(),
|
|
159
|
+
markdownUrl: z.string().url().optional(),
|
|
160
|
+
markdown: z.string().optional(),
|
|
161
|
+
entries: z
|
|
162
|
+
.array(z.object({
|
|
163
|
+
path: z.string(),
|
|
164
|
+
title: z.string(),
|
|
165
|
+
topic: z.string(),
|
|
166
|
+
symbols: z.array(z.string()),
|
|
167
|
+
}))
|
|
168
|
+
.optional(),
|
|
169
|
+
})
|
|
170
|
+
.passthrough(),
|
|
152
171
|
'asset-inspect': z.object({ metadata: record }),
|
|
153
172
|
battle: z
|
|
154
173
|
.object({
|
package/dist/mcp.js
CHANGED
|
@@ -205,8 +205,11 @@ if (!session.workspace.readOnly) {
|
|
|
205
205
|
expectedVersion: version.nullable(),
|
|
206
206
|
}, 'environment-save');
|
|
207
207
|
}
|
|
208
|
-
tool('author_reference', '
|
|
209
|
-
topic: z.enum(referenceTopics),
|
|
208
|
+
tool('author_reference', 'Look up an exact creator SDK symbol (e.g. EffectTrigger.OnHit or Pet.addMark), or search SDK names with query and offset. A trigger includes its typed parent, accessible fields, method receivers and example. Exact symbols include the documentation URL. Supply a handbook topic and symbol for online HTML and Markdown links, or a topic alone for its index or schema.', {
|
|
209
|
+
topic: z.enum(referenceTopics).optional(),
|
|
210
|
+
query: z.string().min(1).max(128).optional(),
|
|
211
|
+
offset: z.number().int().min(0).optional(),
|
|
212
|
+
symbol: z.string().min(1).max(128).optional(),
|
|
210
213
|
}, 'reference', undefined, true);
|
|
211
214
|
tool('asset_inspect', 'Inspect one declared project resource by ID. Local images up to 2 MiB may be returned as standard image content when includeImage is true. MIME follows the filename; decoding/display is handled by the client. No dimensions or image integrity validation are provided. HTTP resources return metadata only and are never fetched or cached. Audio/SWF are not executed.', {
|
|
212
215
|
id: z.string().min(1).max(200),
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export declare const sdkGroups: {
|
|
2
|
+
readonly triggers: '触发器';
|
|
3
|
+
readonly objects: '战斗对象与上下文';
|
|
4
|
+
readonly functions: '创作函数与装饰器';
|
|
5
|
+
readonly values: 'SDK 对象与常量';
|
|
6
|
+
readonly enums: '枚举';
|
|
7
|
+
readonly types: '类型声明';
|
|
8
|
+
readonly host: '宿主专用函数';
|
|
9
|
+
};
|
|
10
|
+
export interface SdkSymbol {
|
|
11
|
+
symbol: string;
|
|
12
|
+
source?: {
|
|
13
|
+
path: string;
|
|
14
|
+
line: number;
|
|
15
|
+
};
|
|
16
|
+
dispatches?: {
|
|
17
|
+
path: string;
|
|
18
|
+
line: number;
|
|
19
|
+
}[];
|
|
20
|
+
group: keyof typeof sdkGroups;
|
|
21
|
+
kind: string;
|
|
22
|
+
signature: string;
|
|
23
|
+
description: string;
|
|
24
|
+
owner?: string;
|
|
25
|
+
context?: string;
|
|
26
|
+
parent?: string;
|
|
27
|
+
fields?: string[];
|
|
28
|
+
methods?: {
|
|
29
|
+
receiver: string;
|
|
30
|
+
symbol: string;
|
|
31
|
+
}[];
|
|
32
|
+
variants?: string[];
|
|
33
|
+
example?: string;
|
|
34
|
+
exampleSource?: string;
|
|
35
|
+
related: string[];
|
|
36
|
+
}
|
|
37
|
+
export declare function sdkPath(item: SdkSymbol): string;
|
|
38
|
+
export declare function sdkCatalog(records: SdkSymbol[]): {
|
|
39
|
+
records: SdkSymbol[];
|
|
40
|
+
byName: Map<string, SdkSymbol>;
|
|
41
|
+
children: Map<string, SdkSymbol[]>;
|
|
42
|
+
link: (name: string) => string;
|
|
43
|
+
body: (item: SdkSymbol) => string;
|
|
44
|
+
markdown: (item: SdkSymbol) => string;
|
|
45
|
+
};
|
|
46
|
+
export declare function installedSdkCatalog(): Promise<{
|
|
47
|
+
records: SdkSymbol[];
|
|
48
|
+
byName: Map<string, SdkSymbol>;
|
|
49
|
+
children: Map<string, SdkSymbol[]>;
|
|
50
|
+
link: (name: string) => string;
|
|
51
|
+
body: (item: SdkSymbol) => string;
|
|
52
|
+
markdown: (item: SdkSymbol) => string;
|
|
53
|
+
}>;
|