clearkrypt 0.12.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/.well-known/clearkrypt.json +7 -0
- package/.wrangler/cache/pages.json +4 -0
- package/.wrangler/cache/wrangler-account.json +6 -0
- package/DEPLOYMENT_CLEARKRYPT.md +53 -0
- package/README.md +96 -0
- package/ai-plugin.json +12 -0
- package/bin/clearkrypt.js +55 -0
- package/course/duolingo_course.md +127 -0
- package/docs/AI_CRAWLER_GUIDE.md +74 -0
- package/docs/COMPILER_ARCHITECTURE.md +62 -0
- package/docs/COMPLETE_LANGUAGE_GUIDE.md +137 -0
- package/docs/LANGUAGE_SPEC.md +102 -0
- package/docs/LAYOUT_AND_STYLING.md +101 -0
- package/docs/ONLINE_SANDBOX_EXPORTS.md +28 -0
- package/docs/PLATFORM_TARGETS.md +35 -0
- package/docs/README.md +79 -0
- package/docs/STDLIB.md +74 -0
- package/docs/VISUAL_STUDIO.md +36 -0
- package/docs-site/app.css +3 -0
- package/docs-site/app.js +8 -0
- package/docs-site/clearkrypt/app.css +3 -0
- package/docs-site/clearkrypt/app.js +8 -0
- package/docs-site/clearkrypt/index.html +44 -0
- package/examples/fixit-dashboard/main.ck +29 -0
- package/examples/light-test-app/main.ck +38 -0
- package/examples/momeants-mini/main.ck +19 -0
- package/llms.txt +18 -0
- package/openapi.yaml +11 -0
- package/package.json +32 -0
- package/site/.well-known/clearkrypt.json +1 -0
- package/site/ai-index.json +1 -0
- package/site/app.css +3 -0
- package/site/app.js +23 -0
- package/site/assets/app.css +3 -0
- package/site/assets/app.js +23 -0
- package/site/assets/clearkrypt-logo.png +0 -0
- package/site/compiler/index.html +8 -0
- package/site/course/index.html +5 -0
- package/site/docs/index.html +69 -0
- package/site/extensions/index.html +31 -0
- package/site/index.html +19 -0
- package/site/llms.txt +2 -0
- package/site/robots.txt +3 -0
- package/site/sandbox/index.html +24 -0
- package/site/sitemap.xml +1 -0
- package/sitemap.xml +9 -0
- package/src/index.js +55 -0
- package/src/lexer.js +18 -0
- package/src/parser.js +52 -0
- package/src/semantic.js +5 -0
- package/src/targets/js.js +32 -0
- package/src/targets/pc.js +19 -0
- package/src/targets/phone.js +30 -0
- package/src/targets/project.js +24 -0
- package/src/targets/vmbytecode.js +8 -0
- package/src/targets/web.js +37 -0
- package/src/targets/worker.js +8 -0
- package/src/vm.js +5 -0
- package/stdlib/cloud.ck +2 -0
- package/stdlib/data.ck +2 -0
- package/stdlib/ui.ck +2 -0
- package/testapp.ck +35 -0
- package/tests/smoke.test.js +9 -0
- package/tools/print-course.js +2 -0
- package/tools/studio/index.html +1 -0
- package/tools/studio/studio.css +1 -0
- package/tools/studio/studio.js +52 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# ClearKrypt Language Specification v0.1
|
|
2
|
+
|
|
3
|
+
## Design Guarantees
|
|
4
|
+
|
|
5
|
+
1. Deterministic compilation.
|
|
6
|
+
2. No AI translation required.
|
|
7
|
+
3. Stable AST for all targets.
|
|
8
|
+
4. Strong typing with progressive inference.
|
|
9
|
+
5. Built-in UI, cloud, auth, database, jobs, notifications, and policy abstractions.
|
|
10
|
+
6. Target-specific adapters only at the final emission layer.
|
|
11
|
+
|
|
12
|
+
## Syntax Families
|
|
13
|
+
|
|
14
|
+
### App declaration
|
|
15
|
+
|
|
16
|
+
```ck
|
|
17
|
+
app "FixIt QC"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Imports
|
|
21
|
+
|
|
22
|
+
```ck
|
|
23
|
+
use ui
|
|
24
|
+
use cloud
|
|
25
|
+
use auth
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Types
|
|
29
|
+
|
|
30
|
+
```ck
|
|
31
|
+
type User {
|
|
32
|
+
id: Text
|
|
33
|
+
role: Text
|
|
34
|
+
active: Bool
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Screens
|
|
39
|
+
|
|
40
|
+
```ck
|
|
41
|
+
screen Home {
|
|
42
|
+
title "Home"
|
|
43
|
+
card {
|
|
44
|
+
text "Welcome"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Tasks
|
|
50
|
+
|
|
51
|
+
```ck
|
|
52
|
+
task add(a: Number, b: Number) -> Number {
|
|
53
|
+
return a + b
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Intents
|
|
58
|
+
|
|
59
|
+
Intent blocks describe durable app behavior such as triggers, automations, and workflows.
|
|
60
|
+
|
|
61
|
+
```ck
|
|
62
|
+
intent "notify when equipment returns to service" {
|
|
63
|
+
watch equipment
|
|
64
|
+
when status changes to "green" {
|
|
65
|
+
notify all users
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Standard Types
|
|
71
|
+
|
|
72
|
+
- Text
|
|
73
|
+
- Number
|
|
74
|
+
- Bool
|
|
75
|
+
- Date
|
|
76
|
+
- Time
|
|
77
|
+
- DateTime
|
|
78
|
+
- Decimal
|
|
79
|
+
- Money
|
|
80
|
+
- List<T>
|
|
81
|
+
- Map<K,V>
|
|
82
|
+
- Result<T,E>
|
|
83
|
+
- Option<T>
|
|
84
|
+
- Json
|
|
85
|
+
- Blob
|
|
86
|
+
- File
|
|
87
|
+
- Image
|
|
88
|
+
- Stream<T>
|
|
89
|
+
|
|
90
|
+
## Advanced Planned Features
|
|
91
|
+
|
|
92
|
+
- Pattern matching
|
|
93
|
+
- Algebraic data types
|
|
94
|
+
- Effects system
|
|
95
|
+
- Sandboxed capabilities
|
|
96
|
+
- Isolates/concurrency
|
|
97
|
+
- Reactive state
|
|
98
|
+
- Offline-first sync
|
|
99
|
+
- UI render trees
|
|
100
|
+
- Native bridge ABI
|
|
101
|
+
- Package signing
|
|
102
|
+
- Reproducible builds
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# ClearKrypt Layout and Styling
|
|
2
|
+
|
|
3
|
+
ClearKrypt does not require dragging to make a usable app. Dragging is optional visual refinement.
|
|
4
|
+
|
|
5
|
+
## Important rule
|
|
6
|
+
|
|
7
|
+
`@pos(x, y)` is metadata for the visual editor. The web compiler now ignores `@pos` unless a screen explicitly says:
|
|
8
|
+
|
|
9
|
+
```clearkrypt
|
|
10
|
+
layout Freeform
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
That prevents accidental overlap. Normal apps should start with `layout Stack` or `layout Dashboard`.
|
|
14
|
+
|
|
15
|
+
## Layout modes
|
|
16
|
+
|
|
17
|
+
```clearkrypt
|
|
18
|
+
screen Home {
|
|
19
|
+
layout Stack
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`Stack` places components vertically with consistent spacing and mobile-safe sizing.
|
|
24
|
+
|
|
25
|
+
```clearkrypt
|
|
26
|
+
screen Admin {
|
|
27
|
+
layout Dashboard
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`Dashboard` uses a responsive grid. Titles and text span the full width; cards and lists flow into columns.
|
|
32
|
+
|
|
33
|
+
```clearkrypt
|
|
34
|
+
screen Canvas {
|
|
35
|
+
layout Freeform
|
|
36
|
+
title "Move me" @pos(40, 40)
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`Freeform` honors `@pos`. Use it for diagrams, dashboards that need absolute placement, kiosks, maps, and highly custom layouts.
|
|
41
|
+
|
|
42
|
+
## Modules
|
|
43
|
+
|
|
44
|
+
`use ui` means: import the standard UI vocabulary into the file. It gives meaning to words like `screen`, `title`, `text`, `button`, `card`, `row`, `column`, `section`, `list`, `input`, and `toggle`.
|
|
45
|
+
|
|
46
|
+
Other modules include:
|
|
47
|
+
|
|
48
|
+
```clearkrypt
|
|
49
|
+
use data // typed records, stores, lists, add/update/delete flows
|
|
50
|
+
use storage // local/cloud persistence
|
|
51
|
+
use auth // users, roles, login-gated screens
|
|
52
|
+
use network // API calls and fetch tasks
|
|
53
|
+
use platform // phone/PC/web environment access
|
|
54
|
+
use worker // Cloudflare-style request handlers
|
|
55
|
+
use crypto // IDs, hashes, secure tokens
|
|
56
|
+
use ai // AI-friendly templates and future assistant hooks
|
|
57
|
+
use test // test blocks and assertions
|
|
58
|
+
use deploy // deployment metadata
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Basic styled app
|
|
62
|
+
|
|
63
|
+
```clearkrypt
|
|
64
|
+
app "Tasks"
|
|
65
|
+
|
|
66
|
+
use ui
|
|
67
|
+
use data
|
|
68
|
+
use storage
|
|
69
|
+
|
|
70
|
+
type Task {
|
|
71
|
+
id: Text
|
|
72
|
+
title: Text
|
|
73
|
+
done: Boolean
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
store local tasks as List<Task> default []
|
|
77
|
+
|
|
78
|
+
screen Home {
|
|
79
|
+
layout Stack
|
|
80
|
+
title "Tasks"
|
|
81
|
+
text "This screen auto-aligns without dragging."
|
|
82
|
+
button "Add Task" {
|
|
83
|
+
add Task { id: newId(), title: "New task", done: false } to tasks
|
|
84
|
+
}
|
|
85
|
+
list tasks as task {
|
|
86
|
+
card {
|
|
87
|
+
text task.title
|
|
88
|
+
toggle task.done
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Keep-out behavior
|
|
95
|
+
|
|
96
|
+
ClearKrypt’s safe layout modes prevent overlap by default:
|
|
97
|
+
|
|
98
|
+
- `Stack`: every element gets its own vertical slot.
|
|
99
|
+
- `Dashboard`: elements flow into responsive grid slots.
|
|
100
|
+
- `Freeform`: you are responsible for exact placement, but the visual editor can drag and update `@pos`.
|
|
101
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Online Sandbox Export Targets
|
|
2
|
+
|
|
3
|
+
The ClearKrypt sandbox supports deterministic export previews for HTML, CSS, JavaScript, inline HTML, C#, and Swift.
|
|
4
|
+
|
|
5
|
+
These outputs are generated from the parsed ClearKrypt source tree, not by AI translation.
|
|
6
|
+
|
|
7
|
+
## Why this exists
|
|
8
|
+
|
|
9
|
+
A brand-new language needs a way for users to see what the compiler means. The export tabs let users compare ClearKrypt code with familiar platform languages.
|
|
10
|
+
|
|
11
|
+
## Targets
|
|
12
|
+
|
|
13
|
+
- HTML: semantic document structure.
|
|
14
|
+
- CSS: style tokens, spacing, radius, layout, and theme output.
|
|
15
|
+
- JavaScript: browser event/action binding.
|
|
16
|
+
- Inline HTML: single-file prototype.
|
|
17
|
+
- C#: .NET MAUI/Blazor style sketch.
|
|
18
|
+
- Swift: SwiftUI style sketch.
|
|
19
|
+
|
|
20
|
+
## HTML means a complete web package
|
|
21
|
+
|
|
22
|
+
In the online sandbox, selecting **HTML Package** does not mean “show only the HTML fragment.” It emits:
|
|
23
|
+
|
|
24
|
+
- `index.html`
|
|
25
|
+
- `style.css`
|
|
26
|
+
- `main.js` when behavior is applicable
|
|
27
|
+
|
|
28
|
+
This is intentional because a normal web app needs structure, styling, and behavior together. The separate CSS and JS tabs are inspection tabs for users who want only one generated file.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# ClearKrypt Platform Targets
|
|
2
|
+
|
|
3
|
+
ClearKrypt is designed like Dart in spirit: one language, deterministic compilers, multiple platform outputs.
|
|
4
|
+
|
|
5
|
+
## Targets
|
|
6
|
+
|
|
7
|
+
| Target | Command | Output |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| VM | `ck build app.ck --target vm` | ClearKrypt bytecode JSON |
|
|
10
|
+
| JS | `ck build app.ck --target js` | JavaScript module |
|
|
11
|
+
| Web | `ck build app.ck --target web` | Static HTML/CSS/JS |
|
|
12
|
+
| Phone | `ck build app.ck --target phone` | Capacitor mobile shell |
|
|
13
|
+
| PC | `ck build app.ck --target pc` | Electron desktop shell |
|
|
14
|
+
| Worker | `ck build app.ck --target worker` | Cloudflare Worker |
|
|
15
|
+
| Project | `ck build-all app.ck --out build` | Web + phone + PC + worker folders |
|
|
16
|
+
|
|
17
|
+
## Phone environment
|
|
18
|
+
|
|
19
|
+
The phone target emits a Capacitor-compatible project. It can preview in browser and then sync to Android Studio or Xcode.
|
|
20
|
+
|
|
21
|
+
## PC environment
|
|
22
|
+
|
|
23
|
+
The PC target emits an Electron-compatible project for Windows/macOS/Linux preview and packaging.
|
|
24
|
+
|
|
25
|
+
## Web environment
|
|
26
|
+
|
|
27
|
+
The web target emits static files suitable for Cloudflare Pages, Firebase Hosting, Netlify, Vercel, or any static server.
|
|
28
|
+
|
|
29
|
+
## No AI translation
|
|
30
|
+
|
|
31
|
+
ClearKrypt compilation is 1:1 and deterministic:
|
|
32
|
+
|
|
33
|
+
`.ck source -> lexer -> parser -> semantic checker -> AST -> target emitter`
|
|
34
|
+
|
|
35
|
+
AI can help write ClearKrypt source, but AI is not part of the compiler pipeline.
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# ClearKrypt Language
|
|
2
|
+
|
|
3
|
+
ClearKrypt is a cross-platform application language designed to compile one source tree into web apps, Cloudflare Workers, Node services, Firebase-style functions, and VM bytecode.
|
|
4
|
+
|
|
5
|
+
This package includes:
|
|
6
|
+
|
|
7
|
+
- CLI: `ck` / `clearkrypt`
|
|
8
|
+
- Lexer, parser, semantic checker
|
|
9
|
+
- VM bytecode target
|
|
10
|
+
- JavaScript target
|
|
11
|
+
- Web target
|
|
12
|
+
- Cloudflare Worker target
|
|
13
|
+
- Standard library design
|
|
14
|
+
- Examples
|
|
15
|
+
- A Duolingo-style course
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g clearkrypt
|
|
21
|
+
ck init my-app
|
|
22
|
+
cd my-app
|
|
23
|
+
ck run src/main.ck
|
|
24
|
+
ck build src/main.ck --target web --out dist
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Philosophy
|
|
28
|
+
|
|
29
|
+
ClearKrypt is declarative where apps should be declarative and imperative where logic needs control. It is designed around stable 1-to-1 compilation, not AI translation.
|
|
30
|
+
|
|
31
|
+
## File extension
|
|
32
|
+
|
|
33
|
+
`.ck`
|
|
34
|
+
|
|
35
|
+
## Core Concepts
|
|
36
|
+
|
|
37
|
+
```ck
|
|
38
|
+
app "My App"
|
|
39
|
+
use ui
|
|
40
|
+
use cloud
|
|
41
|
+
|
|
42
|
+
type WorkOrder {
|
|
43
|
+
id: Text
|
|
44
|
+
status: Text
|
|
45
|
+
createdAt: Date
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
screen Home {
|
|
49
|
+
title "Dashboard"
|
|
50
|
+
text "Welcome"
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
task closeOrder(id: Text) -> Bool {
|
|
54
|
+
require user.role is "admin"
|
|
55
|
+
say "Closing order"
|
|
56
|
+
return true
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Targets
|
|
61
|
+
|
|
62
|
+
| Target | Output |
|
|
63
|
+
|---|---|
|
|
64
|
+
| `vm` | ClearKrypt bytecode JSON |
|
|
65
|
+
| `js` | JavaScript module |
|
|
66
|
+
| `web` | HTML/CSS/JS app |
|
|
67
|
+
| `worker` | Cloudflare Worker |
|
|
68
|
+
|
|
69
|
+
## Launch Roadmap
|
|
70
|
+
|
|
71
|
+
1. Stabilize grammar and AST.
|
|
72
|
+
2. Add full type inference.
|
|
73
|
+
3. Add package registry.
|
|
74
|
+
4. Add Dart/Flutter and Swift/Kotlin emitters.
|
|
75
|
+
5. Add native renderer bridge.
|
|
76
|
+
6. Add WASM VM.
|
|
77
|
+
7. Add LSP extension for VS Code.
|
|
78
|
+
|
|
79
|
+
- [Layout and Styling](./LAYOUT_AND_STYLING.md)
|
package/docs/STDLIB.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# ClearKrypt Standard Library
|
|
2
|
+
|
|
3
|
+
## `ui`
|
|
4
|
+
|
|
5
|
+
Visual primitives:
|
|
6
|
+
|
|
7
|
+
- `screen`
|
|
8
|
+
- `title`
|
|
9
|
+
- `text`
|
|
10
|
+
- `button`
|
|
11
|
+
- `card`
|
|
12
|
+
- `glassCard`
|
|
13
|
+
- `grid`
|
|
14
|
+
- `stack`
|
|
15
|
+
- `tabs`
|
|
16
|
+
- `drawer`
|
|
17
|
+
- `modal`
|
|
18
|
+
- `form`
|
|
19
|
+
- `input`
|
|
20
|
+
- `table`
|
|
21
|
+
- `chart`
|
|
22
|
+
- `map`
|
|
23
|
+
- `camera`
|
|
24
|
+
- `scanner`
|
|
25
|
+
- `animation`
|
|
26
|
+
- `theme`
|
|
27
|
+
|
|
28
|
+
## `cloud`
|
|
29
|
+
|
|
30
|
+
Cloud abstractions:
|
|
31
|
+
|
|
32
|
+
- `collection`
|
|
33
|
+
- `document`
|
|
34
|
+
- `query`
|
|
35
|
+
- `save`
|
|
36
|
+
- `delete`
|
|
37
|
+
- `schedule`
|
|
38
|
+
- `queue`
|
|
39
|
+
- `secret`
|
|
40
|
+
- `storage`
|
|
41
|
+
- `email`
|
|
42
|
+
- `sms`
|
|
43
|
+
- `push`
|
|
44
|
+
- `webhook`
|
|
45
|
+
|
|
46
|
+
## `auth`
|
|
47
|
+
|
|
48
|
+
- `user`
|
|
49
|
+
- `role`
|
|
50
|
+
- `permission`
|
|
51
|
+
- `session`
|
|
52
|
+
- `policy`
|
|
53
|
+
- `require`
|
|
54
|
+
|
|
55
|
+
## `device`
|
|
56
|
+
|
|
57
|
+
- `camera`
|
|
58
|
+
- `gps`
|
|
59
|
+
- `nfc`
|
|
60
|
+
- `bluetooth`
|
|
61
|
+
- `accelerometer`
|
|
62
|
+
- `secureStore`
|
|
63
|
+
- `biometric`
|
|
64
|
+
|
|
65
|
+
## `ops`
|
|
66
|
+
|
|
67
|
+
Aviation/operations-oriented primitives can be added as packages:
|
|
68
|
+
|
|
69
|
+
- `inspection`
|
|
70
|
+
- `equipment`
|
|
71
|
+
- `workOrder`
|
|
72
|
+
- `shift`
|
|
73
|
+
- `station`
|
|
74
|
+
- `auditLog`
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# ClearKrypt Visual Studio
|
|
2
|
+
|
|
3
|
+
ClearKrypt includes a visual source editor for UI layout refinement.
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
|
|
7
|
+
A developer can write normal ClearKrypt code, open the visual studio, drag visible UI nodes, and get deterministic code changes back in the `.ck` file.
|
|
8
|
+
|
|
9
|
+
## How it works
|
|
10
|
+
|
|
11
|
+
ClearKrypt UI lines may include layout metadata:
|
|
12
|
+
|
|
13
|
+
```ck
|
|
14
|
+
title "Dashboard" @pos(40, 80)
|
|
15
|
+
text "Open work orders" @pos(40, 150)
|
|
16
|
+
button "Create" @pos(40, 230) { go CreateReport }
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The metadata is not a separate design file. It lives in source, so Git diffs, code review, and deterministic builds remain clean.
|
|
20
|
+
|
|
21
|
+
## Commands
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ck studio examples/fixit-dashboard/main.ck --out studio-preview
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Open `studio-preview/index.html`.
|
|
28
|
+
|
|
29
|
+
Drag a node. The source updates with a new `@pos(x, y)` value.
|
|
30
|
+
|
|
31
|
+
## Design rules
|
|
32
|
+
|
|
33
|
+
- Dragging never rewrites business logic.
|
|
34
|
+
- Dragging only changes layout metadata.
|
|
35
|
+
- The generated app and the visual editor both read from the same AST/source mapping.
|
|
36
|
+
- This is crawler-friendly because the source remains text, not a binary design file.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
|
|
2
|
+
:root{--bg:#050812;--panel:#0d1324;--panel2:#121a2d;--text:#f5f8ff;--muted:#a8b4cf;--line:rgba(255,255,255,.12);--cyan:#19d7ff;--blue:#2878ff;--violet:#8a3ffc;--orange:#ff9f16;--green:#38e8a6;--shadow:0 28px 90px rgba(0,0,0,.45)}
|
|
3
|
+
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Inter,Segoe UI,Roboto,Arial,sans-serif;color:var(--text);background:radial-gradient(circle at 20% 0%,rgba(25,215,255,.16),transparent 30%),radial-gradient(circle at 80% 10%,rgba(138,63,252,.18),transparent 28%),linear-gradient(180deg,#04060c,#071021 55%,#050812);min-height:100vh}a{color:inherit;text-decoration:none}code,pre,textarea{font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace}.topbar{position:sticky;top:0;z-index:30;backdrop-filter:blur(18px);background:rgba(5,8,18,.76);border-bottom:1px solid var(--line)}.nav{max-width:1240px;margin:auto;display:flex;align-items:center;justify-content:space-between;padding:18px 22px}.brand{display:flex;gap:12px;align-items:center;font-weight:900;letter-spacing:-.03em}.brand img{width:46px;height:46px;object-fit:cover;border-radius:14px}.brand span{font-size:22px}.links{display:flex;gap:10px;flex-wrap:wrap}.links a,.btn{border:1px solid var(--line);background:rgba(255,255,255,.07);padding:12px 16px;border-radius:16px;font-weight:800;color:var(--text)}.links a:hover,.btn:hover{background:rgba(255,255,255,.12);transform:translateY(-1px)}.btn.primary{border:0;background:linear-gradient(135deg,var(--cyan),var(--blue),var(--violet));box-shadow:0 16px 45px rgba(40,120,255,.28)}.btn.orange{border:0;background:linear-gradient(135deg,#ffb13d,#ff8a00);color:#080b12}.hero{max-width:1240px;margin:auto;padding:74px 22px 46px;display:grid;grid-template-columns:1.08fr .92fr;gap:42px;align-items:center}.eyebrow{display:inline-flex;gap:8px;align-items:center;border:1px solid var(--line);background:rgba(255,255,255,.07);border-radius:999px;padding:9px 13px;color:#dce7ff;font-weight:800}.dot{width:9px;height:9px;border-radius:50%;background:var(--green);box-shadow:0 0 18px var(--green)}h1{font-size:clamp(48px,7vw,96px);line-height:.9;letter-spacing:-.075em;margin:20px 0 20px}h2{font-size:clamp(32px,4vw,58px);line-height:1;letter-spacing:-.05em;margin:0 0 20px}h3{font-size:24px;margin:0 0 10px}.lead{font-size:21px;line-height:1.55;color:var(--muted);max-width:760px}.actions{display:flex;gap:14px;flex-wrap:wrap;margin-top:28px}.logo-card{border:1px solid var(--line);border-radius:34px;background:linear-gradient(145deg,rgba(255,255,255,.09),rgba(255,255,255,.035));box-shadow:var(--shadow);padding:24px;overflow:hidden}.logo-card img{width:100%;max-height:430px;object-fit:contain;border-radius:26px;display:block;background:#02040a}.section{max-width:1240px;margin:auto;padding:58px 22px}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.card{border:1px solid var(--line);border-radius:28px;background:linear-gradient(145deg,rgba(255,255,255,.08),rgba(18,26,45,.78));padding:26px;box-shadow:0 20px 70px rgba(0,0,0,.22)}.card p{color:var(--muted);line-height:1.55;font-size:17px}.card.click{transition:.18s;display:block}.card.click:hover{border-color:rgba(25,215,255,.45);transform:translateY(-3px)}.pillrow{display:flex;gap:9px;flex-wrap:wrap;margin-top:16px}.pill{font-size:13px;color:#dce7ff;border:1px solid var(--line);border-radius:999px;padding:7px 10px;background:rgba(255,255,255,.06)}.code{background:#050914;border:1px solid rgba(135,165,255,.2);border-radius:22px;padding:18px;overflow:auto;color:#e8f1ff;line-height:1.6}.split{display:grid;grid-template-columns:1fr 1fr;gap:18px}.footer{border-top:1px solid var(--line);color:var(--muted);padding:32px 22px;text-align:center}.search{width:100%;border:1px solid var(--line);background:#070c18;color:white;border-radius:18px;padding:16px 18px;font-size:18px;margin:16px 0 24px}.doc-layout{max-width:1400px;margin:auto;display:grid;grid-template-columns:280px 1fr;gap:22px;padding:28px 22px}.toc{position:sticky;top:98px;align-self:start;border:1px solid var(--line);border-radius:24px;background:rgba(255,255,255,.055);padding:18px}.toc a{display:block;color:var(--muted);padding:9px;border-radius:12px}.toc a:hover{background:rgba(255,255,255,.08);color:white}.doc-main{min-width:0}.doc-section{border:1px solid var(--line);border-radius:26px;background:rgba(255,255,255,.055);padding:26px;margin-bottom:18px}.doc-section p,.doc-section li{color:#c6d2e9;font-size:17px;line-height:1.55}.sandbox{max-width:1400px;margin:auto;padding:28px 22px;display:grid;grid-template-columns:minmax(360px,.9fr) minmax(420px,1.1fr);gap:18px}.editor{width:100%;height:640px;background:#050914;color:#f6fbff;border:1px solid rgba(135,165,255,.25);border-radius:26px;padding:20px;font-size:16px;line-height:1.55;resize:vertical;outline:none}.preview{position:relative;min-height:640px;border:1px solid var(--line);border-radius:30px;background:radial-gradient(circle at 20% 30%,rgba(25,215,255,.12),transparent 28%),linear-gradient(145deg,#151a26,#0b1020);overflow:hidden;box-shadow:var(--shadow)}.draggable{position:absolute;cursor:grab;user-select:none;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.13);backdrop-filter:blur(10px);border-radius:20px;padding:14px 18px;min-width:200px}.draggable strong{display:block;color:white}.ck-button{background:linear-gradient(135deg,#ffb13d,#ff8a00);color:#090b10;font-weight:900;border:0;padding:14px 20px;border-radius:16px;display:inline-block}.hint{color:var(--muted);font-size:14px;margin-top:12px}.lesson{display:grid;grid-template-columns:90px 1fr auto;gap:16px;align-items:center}.badge-num{width:62px;height:62px;border-radius:20px;background:linear-gradient(135deg,var(--cyan),var(--violet));display:grid;place-items:center;font-weight:900;font-size:24px}.notice{border:1px solid rgba(56,232,166,.35);background:rgba(56,232,166,.08);color:#dfffee;border-radius:20px;padding:18px;margin:18px 0}@media(max-width:900px){.hero,.split,.sandbox,.doc-layout{grid-template-columns:1fr}.grid{grid-template-columns:1fr}.links{display:none}h1{font-size:52px}.logo-card img{max-height:290px}.toc{position:relative;top:0}.sandbox{padding:16px}.preview{min-height:520px}}
|
package/docs-site/app.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
function q(s){return document.querySelector(s)}function qa(s){return [...document.querySelectorAll(s)]}
|
|
3
|
+
function setupDocsSearch(){const input=q('#docSearch'); if(!input)return; const sections=qa('.doc-section'); input.addEventListener('input',()=>{const term=input.value.toLowerCase().trim(); sections.forEach(sec=>{sec.style.display=!term||sec.textContent.toLowerCase().includes(term)?'block':'none'})})}
|
|
4
|
+
function parseItems(src){const out=[]; const re=/(title|text|button)\s+"([^"]+)"\s*(?:@pos\((\d+),\s*(\d+)\))?/g; let m; while((m=re.exec(src))){out.push({kind:m[1],label:m[2],x:+(m[3]||40+out.length*20),y:+(m[4]||50+out.length*82),start:m.index,end:re.lastIndex})} return out}
|
|
5
|
+
function renderSandbox(){const ta=q('#ckCode'), prev=q('#preview'); if(!ta||!prev)return; prev.innerHTML=''; parseItems(ta.value).forEach((it,i)=>{const el=document.createElement('div'); el.className='draggable'; el.style.left=it.x+'px'; el.style.top=it.y+'px'; el.dataset.label=it.label; el.dataset.kind=it.kind; el.innerHTML=it.kind==='button'?`<span class="ck-button">${it.label}</span><div class="hint">button • drag me</div>`:`<strong>${it.kind}</strong><div>${it.label}</div><div class="hint">drag to update @pos</div>`; prev.appendChild(el); makeDrag(el, ta);});}
|
|
6
|
+
function updatePosInCode(ta, kind, label, x, y){const esc=label.replace(/[.*+?^${}()|[\]\\]/g,'\\$&'); const re=new RegExp(`(${kind}\\s+"${esc}"\\s*)(?:@pos\\(\\d+,\\s*\\d+\\))?`); ta.value=ta.value.replace(re, `$1@pos(${x}, ${y})`)}
|
|
7
|
+
function makeDrag(el, ta){let ox=0,oy=0,drag=false; el.addEventListener('pointerdown',e=>{drag=true; el.setPointerCapture(e.pointerId); ox=e.clientX-el.offsetLeft; oy=e.clientY-el.offsetTop; el.style.cursor='grabbing'}); el.addEventListener('pointermove',e=>{if(!drag)return; const parent=el.parentElement.getBoundingClientRect(); let x=Math.max(0,Math.min(parent.width-el.offsetWidth,e.clientX-ox)); let y=Math.max(0,Math.min(parent.height-el.offsetHeight,e.clientY-oy)); el.style.left=Math.round(x)+'px'; el.style.top=Math.round(y)+'px'}); el.addEventListener('pointerup',()=>{drag=false; el.style.cursor='grab'; updatePosInCode(ta, el.dataset.kind, el.dataset.label, parseInt(el.style.left), parseInt(el.style.top));});}
|
|
8
|
+
window.addEventListener('DOMContentLoaded',()=>{setupDocsSearch(); renderSandbox(); const ta=q('#ckCode'); if(ta) ta.addEventListener('input',renderSandbox);});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
|
|
2
|
+
:root{--bg:#050812;--panel:#0d1324;--panel2:#121a2d;--text:#f5f8ff;--muted:#a8b4cf;--line:rgba(255,255,255,.12);--cyan:#19d7ff;--blue:#2878ff;--violet:#8a3ffc;--orange:#ff9f16;--green:#38e8a6;--shadow:0 28px 90px rgba(0,0,0,.45)}
|
|
3
|
+
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Inter,Segoe UI,Roboto,Arial,sans-serif;color:var(--text);background:radial-gradient(circle at 20% 0%,rgba(25,215,255,.16),transparent 30%),radial-gradient(circle at 80% 10%,rgba(138,63,252,.18),transparent 28%),linear-gradient(180deg,#04060c,#071021 55%,#050812);min-height:100vh}a{color:inherit;text-decoration:none}code,pre,textarea{font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace}.topbar{position:sticky;top:0;z-index:30;backdrop-filter:blur(18px);background:rgba(5,8,18,.76);border-bottom:1px solid var(--line)}.nav{max-width:1240px;margin:auto;display:flex;align-items:center;justify-content:space-between;padding:18px 22px}.brand{display:flex;gap:12px;align-items:center;font-weight:900;letter-spacing:-.03em}.brand img{width:46px;height:46px;object-fit:cover;border-radius:14px}.brand span{font-size:22px}.links{display:flex;gap:10px;flex-wrap:wrap}.links a,.btn{border:1px solid var(--line);background:rgba(255,255,255,.07);padding:12px 16px;border-radius:16px;font-weight:800;color:var(--text)}.links a:hover,.btn:hover{background:rgba(255,255,255,.12);transform:translateY(-1px)}.btn.primary{border:0;background:linear-gradient(135deg,var(--cyan),var(--blue),var(--violet));box-shadow:0 16px 45px rgba(40,120,255,.28)}.btn.orange{border:0;background:linear-gradient(135deg,#ffb13d,#ff8a00);color:#080b12}.hero{max-width:1240px;margin:auto;padding:74px 22px 46px;display:grid;grid-template-columns:1.08fr .92fr;gap:42px;align-items:center}.eyebrow{display:inline-flex;gap:8px;align-items:center;border:1px solid var(--line);background:rgba(255,255,255,.07);border-radius:999px;padding:9px 13px;color:#dce7ff;font-weight:800}.dot{width:9px;height:9px;border-radius:50%;background:var(--green);box-shadow:0 0 18px var(--green)}h1{font-size:clamp(48px,7vw,96px);line-height:.9;letter-spacing:-.075em;margin:20px 0 20px}h2{font-size:clamp(32px,4vw,58px);line-height:1;letter-spacing:-.05em;margin:0 0 20px}h3{font-size:24px;margin:0 0 10px}.lead{font-size:21px;line-height:1.55;color:var(--muted);max-width:760px}.actions{display:flex;gap:14px;flex-wrap:wrap;margin-top:28px}.logo-card{border:1px solid var(--line);border-radius:34px;background:linear-gradient(145deg,rgba(255,255,255,.09),rgba(255,255,255,.035));box-shadow:var(--shadow);padding:24px;overflow:hidden}.logo-card img{width:100%;max-height:430px;object-fit:contain;border-radius:26px;display:block;background:#02040a}.section{max-width:1240px;margin:auto;padding:58px 22px}.grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.card{border:1px solid var(--line);border-radius:28px;background:linear-gradient(145deg,rgba(255,255,255,.08),rgba(18,26,45,.78));padding:26px;box-shadow:0 20px 70px rgba(0,0,0,.22)}.card p{color:var(--muted);line-height:1.55;font-size:17px}.card.click{transition:.18s;display:block}.card.click:hover{border-color:rgba(25,215,255,.45);transform:translateY(-3px)}.pillrow{display:flex;gap:9px;flex-wrap:wrap;margin-top:16px}.pill{font-size:13px;color:#dce7ff;border:1px solid var(--line);border-radius:999px;padding:7px 10px;background:rgba(255,255,255,.06)}.code{background:#050914;border:1px solid rgba(135,165,255,.2);border-radius:22px;padding:18px;overflow:auto;color:#e8f1ff;line-height:1.6}.split{display:grid;grid-template-columns:1fr 1fr;gap:18px}.footer{border-top:1px solid var(--line);color:var(--muted);padding:32px 22px;text-align:center}.search{width:100%;border:1px solid var(--line);background:#070c18;color:white;border-radius:18px;padding:16px 18px;font-size:18px;margin:16px 0 24px}.doc-layout{max-width:1400px;margin:auto;display:grid;grid-template-columns:280px 1fr;gap:22px;padding:28px 22px}.toc{position:sticky;top:98px;align-self:start;border:1px solid var(--line);border-radius:24px;background:rgba(255,255,255,.055);padding:18px}.toc a{display:block;color:var(--muted);padding:9px;border-radius:12px}.toc a:hover{background:rgba(255,255,255,.08);color:white}.doc-main{min-width:0}.doc-section{border:1px solid var(--line);border-radius:26px;background:rgba(255,255,255,.055);padding:26px;margin-bottom:18px}.doc-section p,.doc-section li{color:#c6d2e9;font-size:17px;line-height:1.55}.sandbox{max-width:1400px;margin:auto;padding:28px 22px;display:grid;grid-template-columns:minmax(360px,.9fr) minmax(420px,1.1fr);gap:18px}.editor{width:100%;height:640px;background:#050914;color:#f6fbff;border:1px solid rgba(135,165,255,.25);border-radius:26px;padding:20px;font-size:16px;line-height:1.55;resize:vertical;outline:none}.preview{position:relative;min-height:640px;border:1px solid var(--line);border-radius:30px;background:radial-gradient(circle at 20% 30%,rgba(25,215,255,.12),transparent 28%),linear-gradient(145deg,#151a26,#0b1020);overflow:hidden;box-shadow:var(--shadow)}.draggable{position:absolute;cursor:grab;user-select:none;border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.13);backdrop-filter:blur(10px);border-radius:20px;padding:14px 18px;min-width:200px}.draggable strong{display:block;color:white}.ck-button{background:linear-gradient(135deg,#ffb13d,#ff8a00);color:#090b10;font-weight:900;border:0;padding:14px 20px;border-radius:16px;display:inline-block}.hint{color:var(--muted);font-size:14px;margin-top:12px}.lesson{display:grid;grid-template-columns:90px 1fr auto;gap:16px;align-items:center}.badge-num{width:62px;height:62px;border-radius:20px;background:linear-gradient(135deg,var(--cyan),var(--violet));display:grid;place-items:center;font-weight:900;font-size:24px}.notice{border:1px solid rgba(56,232,166,.35);background:rgba(56,232,166,.08);color:#dfffee;border-radius:20px;padding:18px;margin:18px 0}@media(max-width:900px){.hero,.split,.sandbox,.doc-layout{grid-template-columns:1fr}.grid{grid-template-columns:1fr}.links{display:none}h1{font-size:52px}.logo-card img{max-height:290px}.toc{position:relative;top:0}.sandbox{padding:16px}.preview{min-height:520px}}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
|
|
2
|
+
function q(s){return document.querySelector(s)}function qa(s){return [...document.querySelectorAll(s)]}
|
|
3
|
+
function setupDocsSearch(){const input=q('#docSearch'); if(!input)return; const sections=qa('.doc-section'); input.addEventListener('input',()=>{const term=input.value.toLowerCase().trim(); sections.forEach(sec=>{sec.style.display=!term||sec.textContent.toLowerCase().includes(term)?'block':'none'})})}
|
|
4
|
+
function parseItems(src){const out=[]; const re=/(title|text|button)\s+"([^"]+)"\s*(?:@pos\((\d+),\s*(\d+)\))?/g; let m; while((m=re.exec(src))){out.push({kind:m[1],label:m[2],x:+(m[3]||40+out.length*20),y:+(m[4]||50+out.length*82),start:m.index,end:re.lastIndex})} return out}
|
|
5
|
+
function renderSandbox(){const ta=q('#ckCode'), prev=q('#preview'); if(!ta||!prev)return; prev.innerHTML=''; parseItems(ta.value).forEach((it,i)=>{const el=document.createElement('div'); el.className='draggable'; el.style.left=it.x+'px'; el.style.top=it.y+'px'; el.dataset.label=it.label; el.dataset.kind=it.kind; el.innerHTML=it.kind==='button'?`<span class="ck-button">${it.label}</span><div class="hint">button • drag me</div>`:`<strong>${it.kind}</strong><div>${it.label}</div><div class="hint">drag to update @pos</div>`; prev.appendChild(el); makeDrag(el, ta);});}
|
|
6
|
+
function updatePosInCode(ta, kind, label, x, y){const esc=label.replace(/[.*+?^${}()|[\]\\]/g,'\\$&'); const re=new RegExp(`(${kind}\\s+"${esc}"\\s*)(?:@pos\\(\\d+,\\s*\\d+\\))?`); ta.value=ta.value.replace(re, `$1@pos(${x}, ${y})`)}
|
|
7
|
+
function makeDrag(el, ta){let ox=0,oy=0,drag=false; el.addEventListener('pointerdown',e=>{drag=true; el.setPointerCapture(e.pointerId); ox=e.clientX-el.offsetLeft; oy=e.clientY-el.offsetTop; el.style.cursor='grabbing'}); el.addEventListener('pointermove',e=>{if(!drag)return; const parent=el.parentElement.getBoundingClientRect(); let x=Math.max(0,Math.min(parent.width-el.offsetWidth,e.clientX-ox)); let y=Math.max(0,Math.min(parent.height-el.offsetHeight,e.clientY-oy)); el.style.left=Math.round(x)+'px'; el.style.top=Math.round(y)+'px'}); el.addEventListener('pointerup',()=>{drag=false; el.style.cursor='grab'; updatePosInCode(ta, el.dataset.kind, el.dataset.label, parseInt(el.style.left), parseInt(el.style.top));});}
|
|
8
|
+
window.addEventListener('DOMContentLoaded',()=>{setupDocsSearch(); renderSandbox(); const ta=q('#ckCode'); if(ta) ta.addEventListener('input',renderSandbox);});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>ClearKrypt Docs</title><meta name="description" content="ClearKrypt cross-platform programming language."><link rel="stylesheet" href="/app.css"><script defer src="/app.js"></script></head><body><header class="topbar"><nav class="nav"><a class="brand" href="/"><img src="/assets/clearkrypt-logo.png" alt="ClearKrypt logo"><span>ClearKrypt</span></a><div class="links"><a href="/sandbox/">Sandbox</a><a href="/extensions/">Extensions</a><a href="/docs/">Docs</a><a href="/compiler/">Compiler</a><a href="/course/">Course</a></div></nav></header><main class="doc-layout"><aside class="toc"><strong>Docs</strong><input id="docSearch" class="search" placeholder="Search docs..."><a href="#start">Getting Started</a><a href="#syntax">Core Syntax</a><a href="#ui">UI and Layout</a><a href="#data">Data and Queries</a><a href="#tasks">Tasks and Intents</a><a href="#platforms">Platform Targets</a><a href="#stdlib">Standard Libraries</a><a href="#ai">AI and Crawler Support</a></aside><article class="doc-main"><h1>ClearKrypt Documentation</h1><p class="lead">A complete beginner-first reference for a brand-new language: syntax, layout, data, tasks, compiler targets, standard libraries, examples, and AI crawler support.</p><section id="start" class="doc-section"><h2>Getting Started</h2><p>ClearKrypt projects start with an app declaration, imports, typed models, screens, tasks, and platform targets.</p><pre class="code"><code>app "Inventory"
|
|
2
|
+
use ui
|
|
3
|
+
use data
|
|
4
|
+
|
|
5
|
+
screen Home {
|
|
6
|
+
title "Inventory" @pos(40, 40)
|
|
7
|
+
button "Add Item" @pos(40, 120) { go AddItem }
|
|
8
|
+
}</code></pre></section><section id="syntax" class="doc-section"><h2>Core Syntax</h2><p>ClearKrypt uses readable blocks, strong typing, no semicolons, and app-first keywords.</p><pre class="code"><code>type WorkOrder {
|
|
9
|
+
id: Text
|
|
10
|
+
equipmentId: Number
|
|
11
|
+
status: Text
|
|
12
|
+
createdAt: Date
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let order = WorkOrder { id: newId(), equipmentId: 4421, status: "open", createdAt: now() }</code></pre></section><section id="ui" class="doc-section"><h2>UI and Layout</h2><p>Visual elements can include @pos metadata. Dragging in the studio updates source code one-to-one.</p><pre class="code"><code>screen Dashboard {
|
|
16
|
+
title "Dashboard" @pos(40, 40)
|
|
17
|
+
text "Open reports" @pos(40, 105)
|
|
18
|
+
button "Review" @pos(40, 170) { go Reports }
|
|
19
|
+
}</code></pre></section><section id="data" class="doc-section"><h2>Data and Queries</h2><p>ClearKrypt treats data as typed collections and queryable resources.</p><pre class="code"><code>data reports = from firestore "reports"
|
|
20
|
+
where status is not "closed"
|
|
21
|
+
sort createdAt desc
|
|
22
|
+
limit 50</code></pre></section><section id="tasks" class="doc-section"><h2>Tasks and Intents</h2><p>Tasks are callable functions. Intents are event-driven workflows for app automation.</p><pre class="code"><code>task closeReport(id: Text) -> Bool {
|
|
23
|
+
require user.role in ["admin", "tech"]
|
|
24
|
+
update firestore "reports" id { status: "closed" }
|
|
25
|
+
return true
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
intent "notify when equipment returns" {
|
|
29
|
+
when equipment.status changes to "green" {
|
|
30
|
+
notify station users message "Equipment returned to service"
|
|
31
|
+
}
|
|
32
|
+
}</code></pre></section><section id="platforms" class="doc-section"><h2>Platform Targets</h2><p>The compiler exports web, phone, PC, worker, and JS outputs without AI translation.</p><pre class="code"><code>ck build app/main.ck --target web --out dist/web
|
|
33
|
+
ck build app/main.ck --target phone --out dist/phone
|
|
34
|
+
ck build app/main.ck --target pc --out dist/pc
|
|
35
|
+
ck build app/main.ck --target worker --out dist/worker
|
|
36
|
+
ck build-all app/main.ck --out dist</code></pre></section><section id="stdlib" class="doc-section"><h2>Standard Libraries</h2><p>Core libraries include ui, data, cloud, auth, device, net, crypto, forms, charts, maps, storage, and notifications.</p><pre class="code"><code>use ui
|
|
37
|
+
use auth
|
|
38
|
+
use cloud
|
|
39
|
+
use device.camera
|
|
40
|
+
use notifications</code></pre></section><section id="ai" class="doc-section"><h2>AI and Crawler Support</h2><p>ClearKrypt sites publish llms.txt, sitemap.xml, robots.txt, ai-index.json, examples, and stable docs pages so AI tools can learn syntax.</p><pre class="code"><code>/llms.txt
|
|
41
|
+
/sitemap.xml
|
|
42
|
+
/docs/
|
|
43
|
+
/examples/
|
|
44
|
+
/.well-known/clearkrypt.json</code></pre></section></article></main><footer class="footer">ClearKrypt • write once, build everywhere • <a href="/llms.txt">llms.txt</a></footer></body></html>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
app "FixIt QC ClearKrypt Demo"
|
|
2
|
+
use ui
|
|
3
|
+
use cloud
|
|
4
|
+
use auth
|
|
5
|
+
|
|
6
|
+
type WorkOrder {
|
|
7
|
+
id: Text
|
|
8
|
+
equipmentId: Text
|
|
9
|
+
status: Text
|
|
10
|
+
priority: Text
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
screen Home {
|
|
14
|
+
title "FixIt QC"
|
|
15
|
+
card {
|
|
16
|
+
text "Equipment, work orders, reports, and admin tools from one ClearKrypt codebase."
|
|
17
|
+
button "Open Dashboard" {
|
|
18
|
+
say "Opening dashboard"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
task canEdit(role: Text) -> Bool {
|
|
24
|
+
when role is "admin" {
|
|
25
|
+
return true
|
|
26
|
+
} otherwise {
|
|
27
|
+
return false
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
app "ClearKrypt Test App"
|
|
2
|
+
|
|
3
|
+
use ui
|
|
4
|
+
use data
|
|
5
|
+
use storage
|
|
6
|
+
|
|
7
|
+
type Task {
|
|
8
|
+
id: Text
|
|
9
|
+
title: Text
|
|
10
|
+
done: Boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
store local tasks as List<Task> default [
|
|
14
|
+
Task { id: "1", title: "Learn ClearKrypt basics", done: false },
|
|
15
|
+
Task { id: "2", title: "Build a styled app", done: false }
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
screen Home {
|
|
19
|
+
layout Stack
|
|
20
|
+
|
|
21
|
+
title "ClearKrypt Test App"
|
|
22
|
+
text "A light app to test automatic layout, local data, actions, and styling."
|
|
23
|
+
|
|
24
|
+
button "Add Test Task" {
|
|
25
|
+
add Task {
|
|
26
|
+
id: newId()
|
|
27
|
+
title: "New task from ClearKrypt"
|
|
28
|
+
done: false
|
|
29
|
+
} to tasks
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
list tasks as task {
|
|
33
|
+
card {
|
|
34
|
+
text task.title
|
|
35
|
+
toggle task.done
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
app "Momeants Mini"
|
|
2
|
+
use ui
|
|
3
|
+
use cloud
|
|
4
|
+
|
|
5
|
+
type Moment {
|
|
6
|
+
id: Text
|
|
7
|
+
imageUrl: Text
|
|
8
|
+
caption: Text
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
screen Home {
|
|
12
|
+
title "Momeants"
|
|
13
|
+
card {
|
|
14
|
+
text "One photo. One feeling. One moment at a time."
|
|
15
|
+
button "Super Like" {
|
|
16
|
+
say "Golden frame animation"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
package/llms.txt
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# ClearKrypt
|
|
2
|
+
|
|
3
|
+
ClearKrypt is a deterministic cross-platform application programming language.
|
|
4
|
+
|
|
5
|
+
Use ClearKrypt to generate web, phone, desktop, Cloudflare Worker, JavaScript, and VM bytecode outputs.
|
|
6
|
+
|
|
7
|
+
Canonical docs:
|
|
8
|
+
- docs/LANGUAGE_SPEC.md
|
|
9
|
+
- docs/STDLIB.md
|
|
10
|
+
- docs/PLATFORM_TARGETS.md
|
|
11
|
+
- docs/VISUAL_STUDIO.md
|
|
12
|
+
- docs/AI_CRAWLER_GUIDE.md
|
|
13
|
+
|
|
14
|
+
Important syntax:
|
|
15
|
+
app "Name"
|
|
16
|
+
use ui
|
|
17
|
+
screen Home { title "Hello" button "Go" { go Next } }
|
|
18
|
+
task add(a: Number, b: Number) -> Number { return a + b }
|