castle-web-cli 0.4.10 → 0.4.12
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/dist/agent-prompts.d.ts +31 -0
- package/dist/agent-prompts.js +100 -0
- package/dist/agent.d.ts +17 -0
- package/dist/agent.js +894 -0
- package/dist/chat-client.d.ts +1 -0
- package/dist/chat-client.js +398 -0
- package/dist/commonInstructions.d.ts +1 -0
- package/dist/commonInstructions.js +8 -0
- package/dist/ide-client.js +46 -14
- package/dist/ide.d.ts +2 -0
- package/dist/ide.js +321 -36
- package/dist/init.js +12 -2
- package/dist/serve.js +62 -3
- package/kits/basic-2d/CLAUDE.md +3 -1
- package/kits/basic-2d/package.json +0 -1
- package/kits/basic-3d/.prettierrc +8 -0
- package/kits/basic-3d/CLAUDE.md +162 -0
- package/kits/basic-3d/behaviors/Camera.jsx +56 -0
- package/kits/basic-3d/behaviors/Collider.jsx +78 -0
- package/kits/basic-3d/behaviors/Mesh.jsx +82 -0
- package/kits/basic-3d/behaviors/Model.jsx +61 -0
- package/kits/basic-3d/behaviors/Transform.jsx +35 -0
- package/kits/basic-3d/editors/App.jsx +147 -0
- package/kits/basic-3d/editors/CodeEditor.jsx +112 -0
- package/kits/basic-3d/editors/FileBrowser.jsx +143 -0
- package/kits/basic-3d/editors/ModelEditor.jsx +400 -0
- package/kits/basic-3d/editors/PlayOnly.jsx +14 -0
- package/kits/basic-3d/editors/SceneEditor.jsx +1087 -0
- package/kits/basic-3d/editors/behaviorRegistry.js +24 -0
- package/kits/basic-3d/editors/editorHistory.js +52 -0
- package/kits/basic-3d/editors/viewportRig.js +90 -0
- package/kits/basic-3d/engine/ScenePlayer.jsx +55 -0
- package/kits/basic-3d/engine/SceneUI.jsx +67 -0
- package/kits/basic-3d/engine/SceneViewport.jsx +102 -0
- package/kits/basic-3d/engine/TouchControls.jsx +136 -0
- package/kits/basic-3d/engine/autoInspector.jsx +51 -0
- package/kits/basic-3d/engine/files.js +73 -0
- package/kits/basic-3d/engine/scene.js +502 -0
- package/kits/basic-3d/engine/threeUtil.js +260 -0
- package/kits/basic-3d/engine/ui.jsx +352 -0
- package/kits/basic-3d/engine/ui.module.css +944 -0
- package/kits/basic-3d/eslint.config.js +51 -0
- package/kits/basic-3d/index.html +11 -0
- package/kits/basic-3d/main.jsx +10 -0
- package/kits/basic-3d/models/block.model +14 -0
- package/kits/basic-3d/package-lock.json +2713 -0
- package/kits/basic-3d/package.json +41 -0
- package/kits/basic-3d/scenes/main.scene +76 -0
- package/kits/basic-3d/vite.config.js +1 -0
- package/package.json +6 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
{
|
|
6
|
+
ignores: ['node_modules/**', 'dist/**', '.castle/**', '*.config.js'],
|
|
7
|
+
},
|
|
8
|
+
js.configs.recommended,
|
|
9
|
+
{
|
|
10
|
+
files: ['engine/**/*.{js,jsx}', 'editors/**/*.{js,jsx}', 'behaviors/**/*.{js,jsx}', '*.js', '*.jsx'],
|
|
11
|
+
languageOptions: {
|
|
12
|
+
ecmaVersion: 'latest',
|
|
13
|
+
sourceType: 'module',
|
|
14
|
+
parserOptions: {
|
|
15
|
+
ecmaFeatures: { jsx: true },
|
|
16
|
+
},
|
|
17
|
+
globals: {
|
|
18
|
+
window: 'readonly',
|
|
19
|
+
document: 'readonly',
|
|
20
|
+
console: 'readonly',
|
|
21
|
+
performance: 'readonly',
|
|
22
|
+
requestAnimationFrame: 'readonly',
|
|
23
|
+
cancelAnimationFrame: 'readonly',
|
|
24
|
+
setTimeout: 'readonly',
|
|
25
|
+
clearTimeout: 'readonly',
|
|
26
|
+
URL: 'readonly',
|
|
27
|
+
fetch: 'readonly',
|
|
28
|
+
navigator: 'readonly',
|
|
29
|
+
location: 'readonly',
|
|
30
|
+
HTMLCanvasElement: 'readonly',
|
|
31
|
+
Image: 'readonly',
|
|
32
|
+
FileReader: 'readonly',
|
|
33
|
+
KeyboardEvent: 'readonly',
|
|
34
|
+
PointerEvent: 'readonly',
|
|
35
|
+
MouseEvent: 'readonly',
|
|
36
|
+
TouchEvent: 'readonly',
|
|
37
|
+
ResizeObserver: 'readonly',
|
|
38
|
+
structuredClone: 'readonly',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
plugins: {
|
|
42
|
+
'react-hooks': reactHooks,
|
|
43
|
+
},
|
|
44
|
+
rules: {
|
|
45
|
+
'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
|
|
46
|
+
'no-undef': 'off',
|
|
47
|
+
'max-lines-per-function': ['warn', { max: 200, skipBlankLines: true, skipComments: true }],
|
|
48
|
+
complexity: ['warn', 12],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
|
|
5
|
+
<title>Castle Basic 3D JS Kit</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<div id="root"></div>
|
|
9
|
+
<script type="module" src="/main.jsx"></script>
|
|
10
|
+
</body>
|
|
11
|
+
</html>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
import { isEdit, setup } from 'castle-web-sdk';
|
|
4
|
+
import { App } from './editors/App';
|
|
5
|
+
import { PlayOnly } from './editors/PlayOnly';
|
|
6
|
+
document.body.dataset.castleScreenshotTarget = 'viewport';
|
|
7
|
+
setup();
|
|
8
|
+
const root = document.getElementById('root');
|
|
9
|
+
if (!root) throw new Error('Missing root element');
|
|
10
|
+
createRoot(root).render(isEdit() ? <App /> : <PlayOnly />);
|