@khorsheed/dsh-game 0.0.0-stage → 0.1.0
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/CHANGELOG.md +17 -0
- package/README.en.md +53 -0
- package/README.i18n.yaml +6 -0
- package/README.md +52 -2
- package/cordis.patch.yml +23 -0
- package/lib/client.js +30348 -0
- package/lib/index.js +4154 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +3769 -0
- package/lib/typert.remote-client.d.ts +101 -0
- package/lib/typert.remote-client.js +2082 -0
- package/lib/types/agent.d.ts +20 -0
- package/lib/types/agent.js +42 -0
- package/lib/types/checks.d.ts +44 -0
- package/lib/types/checks.js +267 -0
- package/lib/types/client/DesignView.d.ts +22 -0
- package/lib/types/client/DesignView.js +134 -0
- package/lib/types/client/ElementsView.d.ts +21 -0
- package/lib/types/client/ElementsView.js +187 -0
- package/lib/types/client/GameTab.d.ts +14 -0
- package/lib/types/client/GameTab.js +256 -0
- package/lib/types/client/PlayFrame.d.ts +54 -0
- package/lib/types/client/PlayFrame.js +129 -0
- package/lib/types/client/PlayView.d.ts +19 -0
- package/lib/types/client/PlayView.js +161 -0
- package/lib/types/client/Preview3D.d.ts +50 -0
- package/lib/types/client/Preview3D.js +176 -0
- package/lib/types/client/ProjectSwitcher.d.ts +20 -0
- package/lib/types/client/ProjectSwitcher.js +75 -0
- package/lib/types/client/Recipe3DEditor.d.ts +19 -0
- package/lib/types/client/Recipe3DEditor.js +44 -0
- package/lib/types/client/StyleGallery.d.ts +18 -0
- package/lib/types/client/StyleGallery.js +27 -0
- package/lib/types/client/TurnCard.d.ts +62 -0
- package/lib/types/client/TurnCard.js +100 -0
- package/lib/types/client/VersionsView.d.ts +17 -0
- package/lib/types/client/VersionsView.js +68 -0
- package/lib/types/client/chat-node.d.ts +42 -0
- package/lib/types/client/chat-node.js +77 -0
- package/lib/types/client/contract.d.ts +125 -0
- package/lib/types/client/contract.js +6 -0
- package/lib/types/client/definition.d.ts +22 -0
- package/lib/types/client/definition.js +28 -0
- package/lib/types/client/index.d.ts +21 -0
- package/lib/types/client/index.js +229 -0
- package/lib/types/client/locales.d.ts +376 -0
- package/lib/types/client/locales.js +727 -0
- package/lib/types/client/looks.d.ts +36 -0
- package/lib/types/client/looks.js +105 -0
- package/lib/types/client/markdown.d.ts +11 -0
- package/lib/types/client/markdown.js +52 -0
- package/lib/types/client/preset-visibility.d.ts +94 -0
- package/lib/types/client/preset-visibility.js +115 -0
- package/lib/types/client/preview-entry.d.ts +24 -0
- package/lib/types/client/preview-entry.js +107 -0
- package/lib/types/client/refs.d.ts +36 -0
- package/lib/types/client/refs.js +44 -0
- package/lib/types/client/style-samples.d.ts +5 -0
- package/lib/types/client/style-samples.js +196 -0
- package/lib/types/fsutil.d.ts +26 -0
- package/lib/types/fsutil.js +104 -0
- package/lib/types/hooks.d.ts +83 -0
- package/lib/types/hooks.js +108 -0
- package/lib/types/index.d.ts +30 -0
- package/lib/types/index.js +22 -0
- package/lib/types/kits/canvas2d.d.ts +6 -0
- package/lib/types/kits/canvas2d.js +60 -0
- package/lib/types/kits/ids.d.ts +11 -0
- package/lib/types/kits/ids.js +6 -0
- package/lib/types/kits/index.d.ts +26 -0
- package/lib/types/kits/index.js +28 -0
- package/lib/types/kits/three3d.d.ts +12 -0
- package/lib/types/kits/three3d.js +188 -0
- package/lib/types/kits/types.d.ts +52 -0
- package/lib/types/kits/types.js +6 -0
- package/lib/types/look3d.d.ts +20 -0
- package/lib/types/look3d.js +175 -0
- package/lib/types/panel-session.d.ts +21 -0
- package/lib/types/panel-session.js +16 -0
- package/lib/types/project.d.ts +132 -0
- package/lib/types/project.js +494 -0
- package/lib/types/remote.d.ts +182 -0
- package/lib/types/remote.js +256 -0
- package/lib/types/skills.d.ts +13 -0
- package/lib/types/skills.js +140 -0
- package/lib/types/store.d.ts +325 -0
- package/lib/types/store.js +1285 -0
- package/lib/types/tools.d.ts +12 -0
- package/lib/types/tools.js +301 -0
- package/lib/types/trash.d.ts +5 -0
- package/lib/types/trash.js +64 -0
- package/lib/types/types.d.ts +522 -0
- package/lib/types/types.js +85 -0
- package/lib/types/vfs.d.ts +92 -0
- package/lib/types/vfs.js +217 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +132 -3
- package/runtime/dsh3d.js +1279 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stage one of the right-Sidebar registration: what the `game` tab type IS —
|
|
3
|
+
* a page (no address claims), opened from the guide or by kind.
|
|
4
|
+
*/
|
|
5
|
+
import type { SidebarRightTabDefinition } from '@deepseek-ai/dsh-client-ui-sidebar-right/client';
|
|
6
|
+
import type { TranslateNS } from '@deepseek-ai/dsh-client-locale/client';
|
|
7
|
+
/** The tab kind this package owns. */
|
|
8
|
+
export declare const GAME_KIND = "game";
|
|
9
|
+
/** This implementation's identity in the tab system, and the key its body registers under. */
|
|
10
|
+
export declare const GAME_TAB_ID = "@khorsheed/dsh-game";
|
|
11
|
+
/** The guide glyph: a gamepad on a tinted tile, in currentColor. */
|
|
12
|
+
export declare function GameGlyph({ size, className }: {
|
|
13
|
+
size?: number | undefined;
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* The type's registry definition (default `extension` band).
|
|
18
|
+
* @param t - namespace-bound translate.
|
|
19
|
+
* @returns the definition to register.
|
|
20
|
+
*/
|
|
21
|
+
export declare function gameDefinition(t: TranslateNS<'game'>): SidebarRightTabDefinition;
|
|
22
|
+
//# sourceMappingURL=definition.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** The tab kind this package owns. */
|
|
3
|
+
export const GAME_KIND = 'game';
|
|
4
|
+
/** This implementation's identity in the tab system, and the key its body registers under. */
|
|
5
|
+
export const GAME_TAB_ID = '@khorsheed/dsh-game';
|
|
6
|
+
/** The guide glyph: a gamepad on a tinted tile, in currentColor. */
|
|
7
|
+
export function GameGlyph({ size = 16, className }) {
|
|
8
|
+
return (_jsxs("svg", { width: size, height: size, className: className, viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [_jsx("rect", { width: "16", height: "16", rx: "4", fill: "currentColor", fillOpacity: "0.1" }), _jsx("path", { d: "M5.2 5.5h5.6a2.6 2.6 0 0 1 2.5 1.9l.6 2.3a1.4 1.4 0 0 1-2.3 1.4L10.4 10H5.6l-1.2 1.1a1.4 1.4 0 0 1-2.3-1.4l.6-2.3a2.6 2.6 0 0 1 2.5-1.9Z", stroke: "currentColor", strokeWidth: "1.1", strokeLinejoin: "round" }), _jsx("path", { d: "M5.4 7v1.6M4.6 7.8h1.6", stroke: "currentColor", strokeWidth: "1.1", strokeLinecap: "round" }), _jsx("circle", { cx: "10.4", cy: "7.4", r: ".6", fill: "currentColor" }), _jsx("circle", { cx: "11.4", cy: "8.4", r: ".6", fill: "currentColor" })] }));
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The type's registry definition (default `extension` band).
|
|
12
|
+
* @param t - namespace-bound translate.
|
|
13
|
+
* @returns the definition to register.
|
|
14
|
+
*/
|
|
15
|
+
export function gameDefinition(t) {
|
|
16
|
+
return {
|
|
17
|
+
id: GAME_TAB_ID,
|
|
18
|
+
kind: GAME_KIND,
|
|
19
|
+
title: () => t('tab.title'),
|
|
20
|
+
guide: [{
|
|
21
|
+
id: GAME_KIND,
|
|
22
|
+
order: 55,
|
|
23
|
+
title: () => t('guide.title'),
|
|
24
|
+
description: () => t('guide.description'),
|
|
25
|
+
icon: GameGlyph,
|
|
26
|
+
}],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Game mode, browser half: mounts the `game` Remote, registers the `game`
|
|
3
|
+
* right-Sidebar tab type (self-hidden where the session cannot reach the game
|
|
4
|
+
* tools) and its body in the keyed pane seat. Turn-boundary pushes
|
|
5
|
+
* (`api-session/status` / `api-session/activity`, the two the official
|
|
6
|
+
* allowlist forwards) refresh the tab, which is how a version deployed at the
|
|
7
|
+
* end of a turn reaches the play area.
|
|
8
|
+
* @module @khorsheed/dsh-game/client
|
|
9
|
+
*/
|
|
10
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
11
|
+
import { GAME_KIND, GAME_TAB_ID } from './definition.tsx';
|
|
12
|
+
import { GameTab } from './GameTab.tsx';
|
|
13
|
+
export { GameTab, GAME_KIND, GAME_TAB_ID };
|
|
14
|
+
/** `remote.game` is mounted here and read back through ctx.get (never injected — that would deadlock the loader). */
|
|
15
|
+
export declare const inject: string[];
|
|
16
|
+
/**
|
|
17
|
+
* Client plugin body.
|
|
18
|
+
* @param ctx - client root context.
|
|
19
|
+
*/
|
|
20
|
+
export declare function apply(ctx: Context): Promise<() => Promise<void>>;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import gameRemote from '@khorsheed/dsh-game/remote';
|
|
2
|
+
import { GAME_CHAT_KIND, GameChatRow, gameMessageDefinition } from "./chat-node.js";
|
|
3
|
+
import { gameTurnDefinition, GameTurnCard } from "./TurnCard.js";
|
|
4
|
+
import { encodeGameRef, GAME_REF_SOURCE, gameRefCodec } from "./refs.js";
|
|
5
|
+
import { GAME_KIND, GAME_TAB_ID, gameDefinition } from "./definition.js";
|
|
6
|
+
import { GameTab } from "./GameTab.js";
|
|
7
|
+
import { en, NS, zh } from "./locales.js";
|
|
8
|
+
import { GameTabVisibility, RegistrationToggle } from "./preset-visibility.js";
|
|
9
|
+
export { GameTab, GAME_KIND, GAME_TAB_ID };
|
|
10
|
+
function mainSessionId(list) {
|
|
11
|
+
const view = list;
|
|
12
|
+
return Object.values(view.byId).find(s => (s.retainedBy?.mainView ?? 0) > 0)?.id ?? view.current;
|
|
13
|
+
}
|
|
14
|
+
/** `remote.game` is mounted here and read back through ctx.get (never injected — that would deadlock the loader). */
|
|
15
|
+
export const inject = ['slots', 'remote', 'locale', 'sessions', 'sidebarRight', 'sidebarRightTabs'];
|
|
16
|
+
/**
|
|
17
|
+
* Client plugin body.
|
|
18
|
+
* @param ctx - client root context.
|
|
19
|
+
*/
|
|
20
|
+
export async function apply(ctx) {
|
|
21
|
+
const disposers = [];
|
|
22
|
+
try {
|
|
23
|
+
disposers.push(await ctx.remote.$mount(gameRemote));
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
/* v8 ignore next -- double-mount is a composition error, not a runtime path */
|
|
27
|
+
ctx.logger.error(error);
|
|
28
|
+
}
|
|
29
|
+
ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'game: dictionaries');
|
|
30
|
+
const t = ctx.locale.bind(NS);
|
|
31
|
+
const remote = ctx.get('remote.game');
|
|
32
|
+
const pluginInventory = ctx.get('remote.pluginInventory');
|
|
33
|
+
const listeners = new Set();
|
|
34
|
+
const emit = (sessionId) => { for (const listener of listeners)
|
|
35
|
+
listener(sessionId); };
|
|
36
|
+
const carrier = ctx.remote;
|
|
37
|
+
if (typeof carrier.$on === 'function') {
|
|
38
|
+
for (const forwarded of ['api-session/status', 'api-session/activity']) {
|
|
39
|
+
const off = carrier.$on(forwarded, (sessionId) => { emit(sessionId); });
|
|
40
|
+
disposers.push(async () => { off(); });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const tabVisibility = new GameTabVisibility(ctx, pluginInventory);
|
|
44
|
+
ctx.effect(() => {
|
|
45
|
+
const toggle = new RegistrationToggle(() => ctx.sidebarRightTabs.register(gameDefinition(t)), () => tabVisibility.show(mainSessionId(ctx.sessions.list.getSnapshot())));
|
|
46
|
+
toggle.setReady(true);
|
|
47
|
+
const unsubscribe = tabVisibility.subscribe(() => { toggle.sync(); });
|
|
48
|
+
return () => { unsubscribe(); toggle.setReady(false); };
|
|
49
|
+
}, 'game: tab type visibility');
|
|
50
|
+
const api = {
|
|
51
|
+
state: sid => remote.state(sid),
|
|
52
|
+
projectCards: () => remote.projectCards(),
|
|
53
|
+
turnReport: (sid, turn) => remote.turnReport(sid, { turn }),
|
|
54
|
+
bind: (sid, projectId) => remote.bind(sid, { projectId }),
|
|
55
|
+
deleteProject: (sid, projectId, mode) => remote.deleteProject(sid, { projectId, mode }),
|
|
56
|
+
bundle: (projectId, which) => remote.bundle({ projectId, which }),
|
|
57
|
+
versionBundle: (projectId, version) => remote.versionBundle({ projectId, version }),
|
|
58
|
+
workingFile: (projectId, path) => remote.workingFile({ projectId, path }),
|
|
59
|
+
confirm: (sid, projectId) => remote.confirm(sid, { projectId }),
|
|
60
|
+
commit: (sid, projectId) => remote.commit(sid, { projectId }),
|
|
61
|
+
changes: projectId => remote.changes({ projectId }),
|
|
62
|
+
reject: (sid, projectId, reason) => remote.reject(sid, { projectId, reason }),
|
|
63
|
+
rollback: (sid, projectId, version) => remote.rollback(sid, { projectId, version }),
|
|
64
|
+
diff: (projectId, from, to) => remote.diff({ projectId, from, to }),
|
|
65
|
+
checkShot: (projectId, version) => remote.checkShot({ projectId, ...(version === undefined ? {} : { version }) }),
|
|
66
|
+
setAutoConfirm: (sid, projectId, on) => remote.setAutoConfirm(sid, { projectId, on }),
|
|
67
|
+
logPlay: (sid, entry) => remote.logPlay(sid, entry),
|
|
68
|
+
setParam: (sid, projectId, key, value) => remote.setParam(sid, { projectId, key, value }),
|
|
69
|
+
finalizeParams: (sid, projectId) => remote.finalizeParams(sid, { projectId }),
|
|
70
|
+
resetParams: (sid, projectId) => remote.resetParams(sid, { projectId }),
|
|
71
|
+
editElement: (sid, projectId, elementId, patch) => remote.editElement(sid, { projectId, elementId, ...patch }),
|
|
72
|
+
pickProposal: (sid, projectId, elementId, at, index) => remote.pickProposal(sid, { projectId, elementId, at, index }),
|
|
73
|
+
writeChapter: (sid, projectId, chapterId, text) => remote.writeChapter(sid, { projectId, chapterId, text }),
|
|
74
|
+
requestRestyle: (sid, projectId, styleId) => remote.requestRestyle(sid, { projectId, styleId }),
|
|
75
|
+
setOnePager: (sid, projectId, patch) => remote.setOnePager(sid, { projectId, ...patch }),
|
|
76
|
+
dropPending: (sid, projectId, key) => remote.dropPending(sid, { projectId, key }),
|
|
77
|
+
};
|
|
78
|
+
// Reference chips (the quote precedent): a headless trigger source carries
|
|
79
|
+
// the codec the submit-time serializer resolves by source name; the chip
|
|
80
|
+
// itself rides the scoped `slash/input-insert-reference` bail event. The
|
|
81
|
+
// source registers on a deferred inject arm (mount order is unconstrained);
|
|
82
|
+
// without the service, or when the host declines, the reference falls back
|
|
83
|
+
// to plain draft text.
|
|
84
|
+
let chipsReady = false;
|
|
85
|
+
ctx.inject(['inputTriggers'], (lctx) => {
|
|
86
|
+
lctx.effect(() => {
|
|
87
|
+
try {
|
|
88
|
+
const service = lctx.get('inputTriggers');
|
|
89
|
+
if (service === undefined)
|
|
90
|
+
return () => { };
|
|
91
|
+
const dispose = service.registerSource({
|
|
92
|
+
trigger: '@',
|
|
93
|
+
name: GAME_REF_SOURCE,
|
|
94
|
+
candidates: async () => [],
|
|
95
|
+
onPick: () => undefined,
|
|
96
|
+
codec: gameRefCodec,
|
|
97
|
+
openReference: () => false,
|
|
98
|
+
});
|
|
99
|
+
chipsReady = true;
|
|
100
|
+
return () => { chipsReady = false; dispose(); };
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
ctx.logger.error(error);
|
|
104
|
+
return () => { };
|
|
105
|
+
}
|
|
106
|
+
}, 'game: reference chips');
|
|
107
|
+
});
|
|
108
|
+
const inputFor = (sessionId) => {
|
|
109
|
+
try {
|
|
110
|
+
const scope = ctx.get('sessions')?.scope?.(sessionId);
|
|
111
|
+
const input = scope?.get('conversation')?.input?.for(scope);
|
|
112
|
+
const face = input;
|
|
113
|
+
return typeof face?.setDraft === 'function' && typeof face.state?.getSnapshot === 'function' ? face : undefined;
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const navListeners = new Set();
|
|
120
|
+
let parkedNav = null;
|
|
121
|
+
const face = {
|
|
122
|
+
openAt: (target) => {
|
|
123
|
+
parkedNav = target;
|
|
124
|
+
try {
|
|
125
|
+
ctx.sidebarRight.openTab(GAME_KIND);
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
ctx.logger.warn('game: openTab failed (tab type not registered?)', error);
|
|
129
|
+
}
|
|
130
|
+
for (const listener of navListeners)
|
|
131
|
+
listener(target);
|
|
132
|
+
},
|
|
133
|
+
subscribeNav: (listener) => {
|
|
134
|
+
navListeners.add(listener);
|
|
135
|
+
return () => { navListeners.delete(listener); };
|
|
136
|
+
},
|
|
137
|
+
takeNav: () => {
|
|
138
|
+
const target = parkedNav;
|
|
139
|
+
parkedNav = null;
|
|
140
|
+
return target;
|
|
141
|
+
},
|
|
142
|
+
api,
|
|
143
|
+
insertDraft: (sessionId, text) => {
|
|
144
|
+
const input = inputFor(sessionId);
|
|
145
|
+
if (input === undefined)
|
|
146
|
+
return false;
|
|
147
|
+
const kept = input.state.getSnapshot().draft.replace(/\s+$/, '');
|
|
148
|
+
input.setDraft(kept.length === 0 ? text : `${kept}\n\n${text}`);
|
|
149
|
+
if (typeof input.focus === 'function')
|
|
150
|
+
input.focus();
|
|
151
|
+
return true;
|
|
152
|
+
},
|
|
153
|
+
insertRef: (sessionId, ref) => {
|
|
154
|
+
const scope = ctx.get('sessions')?.scope?.(sessionId);
|
|
155
|
+
const input = inputFor(sessionId);
|
|
156
|
+
if (input === undefined)
|
|
157
|
+
return false;
|
|
158
|
+
if (chipsReady && scope?.bail !== undefined) {
|
|
159
|
+
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
160
|
+
const snapshot = input.state.getSnapshot();
|
|
161
|
+
if (typeof snapshot.draftRev !== 'number')
|
|
162
|
+
break;
|
|
163
|
+
// The span speaks the detect projection: each existing chip folds to one character.
|
|
164
|
+
const folded = (snapshot.occurrences ?? []).reduce((extra, o) => extra + o.length - 1, 0);
|
|
165
|
+
const end = snapshot.draft.length - folded;
|
|
166
|
+
const applied = scope.bail(scope, 'slash/input-insert-reference', {
|
|
167
|
+
reference: { source: GAME_REF_SOURCE, ref: encodeGameRef(ref), label: ref.label, clipboardText: ref.text },
|
|
168
|
+
span: { start: end, end, draftRev: snapshot.draftRev },
|
|
169
|
+
}) === true;
|
|
170
|
+
if (applied) {
|
|
171
|
+
input.focus?.();
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
const kept = input.state.getSnapshot().draft.replace(/\s+$/, '');
|
|
177
|
+
input.setDraft(kept.length === 0 ? `${ref.text} ` : `${kept} ${ref.text} `);
|
|
178
|
+
input.focus?.();
|
|
179
|
+
return true;
|
|
180
|
+
},
|
|
181
|
+
subscribeSessionEvents: (listener) => {
|
|
182
|
+
listeners.add(listener);
|
|
183
|
+
return () => { listeners.delete(listener); };
|
|
184
|
+
},
|
|
185
|
+
touch: sessionId => { emit(sessionId); },
|
|
186
|
+
};
|
|
187
|
+
ctx.effect(() => ctx.slots.inject('sidebar.right.pane.tab', () => ctx.slots.register({
|
|
188
|
+
name: 'sidebar.right.pane.tab',
|
|
189
|
+
key: GAME_TAB_ID,
|
|
190
|
+
locale: NS,
|
|
191
|
+
inject: () => face,
|
|
192
|
+
}, GameTab)), 'game: tab body');
|
|
193
|
+
// The turn card: what each agent turn changed in the game, beneath the
|
|
194
|
+
// turn's closing prose (outside the fold), with jumps into the tab. The
|
|
195
|
+
// canvas-novel turn-tail precedent.
|
|
196
|
+
// The seat's owner props are typed by ui-chat; this card reads them
|
|
197
|
+
// structurally (the canvas-novel precedent), so it registers structurally.
|
|
198
|
+
const seats = ctx.slots;
|
|
199
|
+
ctx.effect(() => seats.inject('conversation.chat.turnTail', () => {
|
|
200
|
+
const conversation = ctx.get.bind(ctx)('uiConversation');
|
|
201
|
+
const register = conversation?.events?.register;
|
|
202
|
+
if (register === undefined)
|
|
203
|
+
return () => undefined;
|
|
204
|
+
const disposeDefinition = register.call(conversation?.events, gameTurnDefinition);
|
|
205
|
+
const disposeEntry = seats.register({
|
|
206
|
+
name: 'conversation.chat.turnTail',
|
|
207
|
+
id: '@khorsheed/dsh-game/turn',
|
|
208
|
+
order: 45,
|
|
209
|
+
locale: NS,
|
|
210
|
+
inject: () => face,
|
|
211
|
+
}, GameTurnCard);
|
|
212
|
+
return () => {
|
|
213
|
+
disposeEntry();
|
|
214
|
+
disposeDefinition();
|
|
215
|
+
};
|
|
216
|
+
}), 'game: turn-tail card');
|
|
217
|
+
// The conversation rows for dsh-game messages (check findings, attached changes).
|
|
218
|
+
ctx.inject(['uiConversation'], (lctx) => {
|
|
219
|
+
lctx.effect(() => lctx.uiConversation.events.register(gameMessageDefinition), 'game: chat projection');
|
|
220
|
+
});
|
|
221
|
+
ctx.effect(() => ctx.slots.inject('conversation.chat.node', () => ctx.slots.register({
|
|
222
|
+
name: 'conversation.chat.node',
|
|
223
|
+
key: GAME_CHAT_KIND,
|
|
224
|
+
locale: NS,
|
|
225
|
+
}, GameChatRow)), 'game: chat row');
|
|
226
|
+
return async () => {
|
|
227
|
+
await Promise.all(disposers.map(dispose => dispose()));
|
|
228
|
+
};
|
|
229
|
+
}
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
/** `game` namespace dictionaries. */
|
|
2
|
+
/** Simplified Chinese dictionary (the key-set source of truth). */
|
|
3
|
+
export declare const zh: {
|
|
4
|
+
'tab.title': string;
|
|
5
|
+
'guide.title': string;
|
|
6
|
+
'guide.description': string;
|
|
7
|
+
more: string;
|
|
8
|
+
refresh: string;
|
|
9
|
+
switch: string;
|
|
10
|
+
loading: string;
|
|
11
|
+
error: string;
|
|
12
|
+
'common.back': string;
|
|
13
|
+
'common.cancel': string;
|
|
14
|
+
'common.save': string;
|
|
15
|
+
'common.close': string;
|
|
16
|
+
'home.title': string;
|
|
17
|
+
'home.eyebrow': string;
|
|
18
|
+
'home.headline': string;
|
|
19
|
+
'home.step1': string;
|
|
20
|
+
'home.step1d': string;
|
|
21
|
+
'home.step2': string;
|
|
22
|
+
'home.step2d': string;
|
|
23
|
+
'home.step3': string;
|
|
24
|
+
'home.step3d': string;
|
|
25
|
+
'home.start': string;
|
|
26
|
+
'pick.title': string;
|
|
27
|
+
'pick.current': string;
|
|
28
|
+
'pick.all': string;
|
|
29
|
+
'switcher.new': string;
|
|
30
|
+
'switcher.newHint': string;
|
|
31
|
+
'switcher.here': string;
|
|
32
|
+
'switcher.noVersion': string;
|
|
33
|
+
'switcher.elements': string;
|
|
34
|
+
'switcher.justNow': string;
|
|
35
|
+
'switcher.minutes': string;
|
|
36
|
+
'switcher.hours': string;
|
|
37
|
+
'switcher.days': string;
|
|
38
|
+
'draft.newProject': string;
|
|
39
|
+
'toast.switched': string;
|
|
40
|
+
'toast.newDrafted': string;
|
|
41
|
+
'pick.existing': string;
|
|
42
|
+
'pick.unbind': string;
|
|
43
|
+
'autoConfirm.label': string;
|
|
44
|
+
'autoConfirm.onHint': string;
|
|
45
|
+
'autoConfirm.offHint': string;
|
|
46
|
+
'tabs.label': string;
|
|
47
|
+
'tabs.play': string;
|
|
48
|
+
'tabs.elements': string;
|
|
49
|
+
'tabs.design': string;
|
|
50
|
+
'tabs.versions': string;
|
|
51
|
+
'meta.version': string;
|
|
52
|
+
'meta.noVersion': string;
|
|
53
|
+
'play.live': string;
|
|
54
|
+
'play.candidateShort': string;
|
|
55
|
+
'play.candidateTitle': string;
|
|
56
|
+
'play.candidate': string;
|
|
57
|
+
'play.tryCandidate': string;
|
|
58
|
+
'play.backToCurrent': string;
|
|
59
|
+
'play.reject': string;
|
|
60
|
+
'play.rejectReason': string;
|
|
61
|
+
'play.rejectGo': string;
|
|
62
|
+
'play.confirm': string;
|
|
63
|
+
'play.checkFailed': string;
|
|
64
|
+
'play.checkGaveUp': string;
|
|
65
|
+
'play.seeChecks': string;
|
|
66
|
+
'play.restyling': string;
|
|
67
|
+
'play.none': string;
|
|
68
|
+
'play.noEntry': string;
|
|
69
|
+
'play.loadFailed': string;
|
|
70
|
+
'play.focus': string;
|
|
71
|
+
'play.pick': string;
|
|
72
|
+
'play.pickHint': string;
|
|
73
|
+
'play.pickNothing': string;
|
|
74
|
+
'play.pickUnsupported': string;
|
|
75
|
+
'play.openElement': string;
|
|
76
|
+
'play.refElement': string;
|
|
77
|
+
'play.restart': string;
|
|
78
|
+
'play.errors': string;
|
|
79
|
+
'play.clearSaves': string;
|
|
80
|
+
'params.title': string;
|
|
81
|
+
'params.hint': string;
|
|
82
|
+
'params.changed': string;
|
|
83
|
+
'params.reset': string;
|
|
84
|
+
'params.finalize': string;
|
|
85
|
+
'params.was': string;
|
|
86
|
+
'params.none': string;
|
|
87
|
+
'elements.filter': string;
|
|
88
|
+
'elements.all': string;
|
|
89
|
+
'elements.empty': string;
|
|
90
|
+
'elements.errors': string;
|
|
91
|
+
'elements.name': string;
|
|
92
|
+
'elements.open': string;
|
|
93
|
+
'elements.proposalsWaiting': string;
|
|
94
|
+
'elements.select': string;
|
|
95
|
+
'elements.selectOne': string;
|
|
96
|
+
'elements.selected': string;
|
|
97
|
+
'elements.clear': string;
|
|
98
|
+
'elements.toModel': string;
|
|
99
|
+
'elements.back': string;
|
|
100
|
+
'look.none': string;
|
|
101
|
+
'look.start': string;
|
|
102
|
+
'look.inGame': string;
|
|
103
|
+
'look.idle': string;
|
|
104
|
+
'look.saving': string;
|
|
105
|
+
'look.saved': string;
|
|
106
|
+
'look.failed': string;
|
|
107
|
+
'look.states': string;
|
|
108
|
+
'look.tools': string;
|
|
109
|
+
'look.pen': string;
|
|
110
|
+
'look.recolor': string;
|
|
111
|
+
'look.penHint': string;
|
|
112
|
+
'look.recolorPick': string;
|
|
113
|
+
'look.recolorTo': string;
|
|
114
|
+
'look.ownColors': string;
|
|
115
|
+
'look.styleColors': string;
|
|
116
|
+
'look.erase': string;
|
|
117
|
+
'look.paletteNote': string;
|
|
118
|
+
'look.askTitle': string;
|
|
119
|
+
'look.askPlaceholder': string;
|
|
120
|
+
'look.askSend': string;
|
|
121
|
+
'look.proposalsFor': string;
|
|
122
|
+
'look.pickThis': string;
|
|
123
|
+
'look.model3d': string;
|
|
124
|
+
'look.history': string;
|
|
125
|
+
'look.useAgain': string;
|
|
126
|
+
'fields.title': string;
|
|
127
|
+
'fields.none': string;
|
|
128
|
+
'fields.note': string;
|
|
129
|
+
'design.onePager': string;
|
|
130
|
+
'design.style': string;
|
|
131
|
+
'design.noPitch': string;
|
|
132
|
+
'design.pillars': string;
|
|
133
|
+
'design.noPillars': string;
|
|
134
|
+
'design.openPillars': string;
|
|
135
|
+
'design.editOnePager': string;
|
|
136
|
+
'design.pitchLabel': string;
|
|
137
|
+
'design.typesLabel': string;
|
|
138
|
+
'design.pillarsLabel': string;
|
|
139
|
+
'design.onePagerInvalid': string;
|
|
140
|
+
'design.pillarNotesHint': string;
|
|
141
|
+
'design.collapse': string;
|
|
142
|
+
'design.progress': string;
|
|
143
|
+
'design.fresh': string;
|
|
144
|
+
'design.generated': string;
|
|
145
|
+
'design.todo': string;
|
|
146
|
+
'design.draft': string;
|
|
147
|
+
'design.done': string;
|
|
148
|
+
'design.empty': string;
|
|
149
|
+
'design.pillarNotesEmpty': string;
|
|
150
|
+
'design.emptyGenerated': string;
|
|
151
|
+
'design.edit': string;
|
|
152
|
+
'design.editNote': string;
|
|
153
|
+
'design.numbersNote': string;
|
|
154
|
+
'design.chart': string;
|
|
155
|
+
'style.change': string;
|
|
156
|
+
'style.current': string;
|
|
157
|
+
'style.galleryTitle': string;
|
|
158
|
+
'style.galleryHint': string;
|
|
159
|
+
'style.restyleTitle': string;
|
|
160
|
+
'style.restyleHint': string;
|
|
161
|
+
'versions.lastCheck': string;
|
|
162
|
+
'versions.title': string;
|
|
163
|
+
'versions.none': string;
|
|
164
|
+
'versions.status.current': string;
|
|
165
|
+
'versions.status.candidate': string;
|
|
166
|
+
'versions.status.rejected': string;
|
|
167
|
+
'versions.status.past': string;
|
|
168
|
+
'versions.rollback': string;
|
|
169
|
+
'versions.compare': string;
|
|
170
|
+
'versions.same': string;
|
|
171
|
+
'versions.export': string;
|
|
172
|
+
'versions.exportCurrent': string;
|
|
173
|
+
'versions.exportFailed': string;
|
|
174
|
+
'versions.exportNone': string;
|
|
175
|
+
'versions.share': string;
|
|
176
|
+
'versions.shareNote': string;
|
|
177
|
+
'versions.later': string;
|
|
178
|
+
'versions.log': string;
|
|
179
|
+
'versions.logEmpty': string;
|
|
180
|
+
'versions.shotAlt': string;
|
|
181
|
+
'versions.shotCaption': string;
|
|
182
|
+
'checks.none': string;
|
|
183
|
+
'checks.ok': string;
|
|
184
|
+
'checks.fail': string;
|
|
185
|
+
'checks.gaveUp': string;
|
|
186
|
+
'checks.passed': string;
|
|
187
|
+
'checks.attempt': string;
|
|
188
|
+
'checks.layerData': string;
|
|
189
|
+
'checks.layerSmoke': string;
|
|
190
|
+
'checks.layerTests': string;
|
|
191
|
+
'nudge.picked': string;
|
|
192
|
+
'nudge.finalized': string;
|
|
193
|
+
'nudge.rejected': string;
|
|
194
|
+
'play.stop': string;
|
|
195
|
+
'play.idleHint': string;
|
|
196
|
+
'play.start': string;
|
|
197
|
+
'params.tell': string;
|
|
198
|
+
'params.tellLead': string;
|
|
199
|
+
'turn.title': string;
|
|
200
|
+
'turn.openPanel': string;
|
|
201
|
+
'turn.see': string;
|
|
202
|
+
'turn.deployed': string;
|
|
203
|
+
'turn.candidate': string;
|
|
204
|
+
'turn.checkOk': string;
|
|
205
|
+
'turn.fixed': string;
|
|
206
|
+
'turn.checkFailed': string;
|
|
207
|
+
'turn.gaveUp': string;
|
|
208
|
+
'turn.elementNew': string;
|
|
209
|
+
'turn.elementLook': string;
|
|
210
|
+
'turn.elementFields': string;
|
|
211
|
+
'turn.elementRemoved': string;
|
|
212
|
+
'turn.chapter': string;
|
|
213
|
+
'turn.params': string;
|
|
214
|
+
'turn.code': string;
|
|
215
|
+
'turn.tests': string;
|
|
216
|
+
'chat.attached': string;
|
|
217
|
+
'chat.checkFailed': string;
|
|
218
|
+
'chat.fixing': string;
|
|
219
|
+
'chat.lastAttempt': string;
|
|
220
|
+
'chat.other': string;
|
|
221
|
+
'draft.start': string;
|
|
222
|
+
'draft.pickStyle': string;
|
|
223
|
+
'draft.restyle': string;
|
|
224
|
+
'draft.restyleElement': string;
|
|
225
|
+
'draft.elementRef': string;
|
|
226
|
+
'draft.elementsRef': string;
|
|
227
|
+
'toast.drafted': string;
|
|
228
|
+
'toast.confirmed': string;
|
|
229
|
+
'toast.rejected': string;
|
|
230
|
+
'toast.finalized': string;
|
|
231
|
+
'toast.fieldSaved': string;
|
|
232
|
+
'toast.picked': string;
|
|
233
|
+
'toast.chapterSaved': string;
|
|
234
|
+
'toast.restyleDrafted': string;
|
|
235
|
+
'toast.rolledBack': string;
|
|
236
|
+
'toast.exported': string;
|
|
237
|
+
'toast.savesCleared': string;
|
|
238
|
+
'toast.autoOn': string;
|
|
239
|
+
'toast.autoOff': string;
|
|
240
|
+
'recipe.base': string;
|
|
241
|
+
'recipe.proportions': string;
|
|
242
|
+
'recipe.parts': string;
|
|
243
|
+
'recipe.palette': string;
|
|
244
|
+
'recipe.motion': string;
|
|
245
|
+
'look.preview3dEmpty': string;
|
|
246
|
+
'look.drag3d': string;
|
|
247
|
+
'play.inserted': string;
|
|
248
|
+
'play.pickHover': string;
|
|
249
|
+
'play.diff': string;
|
|
250
|
+
'play.diffHint': string;
|
|
251
|
+
'turn.lookBefore': string;
|
|
252
|
+
'turn.lookAfter': string;
|
|
253
|
+
'recipe.key.quadruped': string;
|
|
254
|
+
'recipe.key.bird': string;
|
|
255
|
+
'recipe.key.fish': string;
|
|
256
|
+
'recipe.key.serpent': string;
|
|
257
|
+
'recipe.key.humanoid': string;
|
|
258
|
+
'recipe.key.bodyLength': string;
|
|
259
|
+
'recipe.key.bodyHeight': string;
|
|
260
|
+
'recipe.key.legLength': string;
|
|
261
|
+
'recipe.key.headSize': string;
|
|
262
|
+
'recipe.key.snout': string;
|
|
263
|
+
'recipe.key.legs': string;
|
|
264
|
+
'recipe.key.heads': string;
|
|
265
|
+
'recipe.key.beak': string;
|
|
266
|
+
'recipe.key.length': string;
|
|
267
|
+
'recipe.key.thickness': string;
|
|
268
|
+
'recipe.key.segments': string;
|
|
269
|
+
'recipe.key.height': string;
|
|
270
|
+
'recipe.key.ear': string;
|
|
271
|
+
'recipe.key.horn': string;
|
|
272
|
+
'recipe.key.tail': string;
|
|
273
|
+
'recipe.key.wing': string;
|
|
274
|
+
'recipe.key.fin': string;
|
|
275
|
+
'recipe.key.eye': string;
|
|
276
|
+
'recipe.key.face': string;
|
|
277
|
+
'recipe.key.count': string;
|
|
278
|
+
'recipe.key.size': string;
|
|
279
|
+
'recipe.key.fan': string;
|
|
280
|
+
'recipe.key.body': string;
|
|
281
|
+
'recipe.key.accent': string;
|
|
282
|
+
'recipe.key.belly': string;
|
|
283
|
+
'recipe.key.skin': string;
|
|
284
|
+
'recipe.key.tailSway': string;
|
|
285
|
+
'recipe.key.breath': string;
|
|
286
|
+
'recipe.key.flap': string;
|
|
287
|
+
'recipe.key.swim': string;
|
|
288
|
+
'recipe.key.bob': string;
|
|
289
|
+
'recipe.key.amplitude': string;
|
|
290
|
+
'recipe.key.period': string;
|
|
291
|
+
'recipe.key.scale': string;
|
|
292
|
+
'play.ground': string;
|
|
293
|
+
'play.pickedNote': string;
|
|
294
|
+
'switcher.delete': string;
|
|
295
|
+
'switcher.deleteTitle': string;
|
|
296
|
+
'switcher.deleteBody': string;
|
|
297
|
+
'switcher.deleteTrash': string;
|
|
298
|
+
'switcher.deleteForget': string;
|
|
299
|
+
'switcher.deleteCancel': string;
|
|
300
|
+
'switcher.deletedTrash': string;
|
|
301
|
+
'switcher.deletedForget': string;
|
|
302
|
+
'switcher.deleteTrashFailed': string;
|
|
303
|
+
'switcher.deleteNotProject': string;
|
|
304
|
+
'switcher.deleteIsWorkspace': string;
|
|
305
|
+
'switcher.deleteDenied': string;
|
|
306
|
+
'commit.more': string;
|
|
307
|
+
'commit.retry': string;
|
|
308
|
+
'commit.details': string;
|
|
309
|
+
'commit.toAgent': string;
|
|
310
|
+
'commit.deployed': string;
|
|
311
|
+
'commit.candidate': string;
|
|
312
|
+
'commit.unchanged': string;
|
|
313
|
+
'commit.noEntry': string;
|
|
314
|
+
'commit.failedToast': string;
|
|
315
|
+
'commit.error': string;
|
|
316
|
+
'draft.commitFailed': string;
|
|
317
|
+
'lore.title': string;
|
|
318
|
+
'lore.placeholder': string;
|
|
319
|
+
'lore.note': string;
|
|
320
|
+
'look.fineTune': string;
|
|
321
|
+
'commit.title': string;
|
|
322
|
+
'commit.titleFirst': string;
|
|
323
|
+
'commit.summary': string;
|
|
324
|
+
'commit.firstSummary': string;
|
|
325
|
+
'commit.edits': string;
|
|
326
|
+
'commit.showFiles': string;
|
|
327
|
+
'commit.hideFiles': string;
|
|
328
|
+
'commit.moreFiles': string;
|
|
329
|
+
'commit.go': string;
|
|
330
|
+
'commit.busyTitle': string;
|
|
331
|
+
'commit.busyTurn': string;
|
|
332
|
+
'commit.busyRecent': string;
|
|
333
|
+
'commit.checking': string;
|
|
334
|
+
'commit.checkingSteps': string;
|
|
335
|
+
'commit.failed': string;
|
|
336
|
+
'commit.failedFirst': string;
|
|
337
|
+
'ago.now': string;
|
|
338
|
+
'ago.s': string;
|
|
339
|
+
'ago.m': string;
|
|
340
|
+
'ago.h': string;
|
|
341
|
+
'versions.by.user': string;
|
|
342
|
+
'versions.by.agent': string;
|
|
343
|
+
'versions.by.turn': string;
|
|
344
|
+
'gltf.file': string;
|
|
345
|
+
'gltf.material': string;
|
|
346
|
+
'gltf.toon': string;
|
|
347
|
+
'gltf.original': string;
|
|
348
|
+
'gltf.scale': string;
|
|
349
|
+
'gltf.clips': string;
|
|
350
|
+
'look.views': string;
|
|
351
|
+
'look.front': string;
|
|
352
|
+
'look.side': string;
|
|
353
|
+
'look.back': string;
|
|
354
|
+
'gltf.colors': string;
|
|
355
|
+
'gltf.vertexColors': string;
|
|
356
|
+
'gltf.vertexColorsHint': string;
|
|
357
|
+
'gltf.reset': string;
|
|
358
|
+
'gltf.morphs': string;
|
|
359
|
+
'gltf.bones': string;
|
|
360
|
+
'gltf.boneSearch': string;
|
|
361
|
+
'gltf.rotate': string;
|
|
362
|
+
'gltf.moreBones': string;
|
|
363
|
+
};
|
|
364
|
+
/** English dictionary. */
|
|
365
|
+
export declare const en: Record<keyof typeof zh, string>;
|
|
366
|
+
/** The dictionary namespace this view binds. */
|
|
367
|
+
export declare const NS = "game";
|
|
368
|
+
/** The game namespace key union. */
|
|
369
|
+
export type GameKey = keyof typeof zh;
|
|
370
|
+
declare module '@deepseek-ai/dsh-client-ui-slots' {
|
|
371
|
+
interface LocaleNamespaceMap {
|
|
372
|
+
/** The game tab copy. */
|
|
373
|
+
'game': GameKey;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
//# sourceMappingURL=locales.d.ts.map
|