clawcontainer 1.0.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/CONTRIBUTING.md +76 -0
- package/DOCS.md +370 -0
- package/LICENSE +21 -0
- package/README.md +147 -0
- package/black_logo.png +0 -0
- package/dist/assets/abap-DLDM7-KI.js +1 -0
- package/dist/assets/apex-DNDY2TF8.js +1 -0
- package/dist/assets/azcli-Y6nb8tq_.js +1 -0
- package/dist/assets/bat-BwHxbl9M.js +1 -0
- package/dist/assets/bicep-CFznDFnq.js +2 -0
- package/dist/assets/cameligo-Bf6VGUru.js +1 -0
- package/dist/assets/clojure-Dnu-v4kV.js +1 -0
- package/dist/assets/codicon-ngg6Pgfi.ttf +0 -0
- package/dist/assets/coffee-Bd8akH9Z.js +1 -0
- package/dist/assets/cpp-BbWJElDN.js +1 -0
- package/dist/assets/csharp-Co3qMtFm.js +1 -0
- package/dist/assets/csp-D-4FJmMZ.js +1 -0
- package/dist/assets/css-DdJfP1eB.js +3 -0
- package/dist/assets/css.worker-GxEd3MMM.js +93 -0
- package/dist/assets/cssMode-DM_ONlf-.js +1 -0
- package/dist/assets/cypher-cTPe9QuQ.js +1 -0
- package/dist/assets/dart-BOtBlQCF.js +1 -0
- package/dist/assets/dockerfile-BG73LgW2.js +1 -0
- package/dist/assets/ecl-BEgZUVRK.js +1 -0
- package/dist/assets/elixir-BkW5O-1t.js +1 -0
- package/dist/assets/flow9-BeJ5waoc.js +1 -0
- package/dist/assets/freemarker2-VbwzOQPq.js +3 -0
- package/dist/assets/fsharp-PahG7c26.js +1 -0
- package/dist/assets/go-acbASCJo.js +1 -0
- package/dist/assets/graphql-BxJiqAUM.js +1 -0
- package/dist/assets/handlebars-DLvQ802u.js +1 -0
- package/dist/assets/hcl-DtV1sZF8.js +1 -0
- package/dist/assets/html-DuEPBzmS.js +1 -0
- package/dist/assets/html.worker-lU17Tx2m.js +470 -0
- package/dist/assets/htmlMode-BfeYTJaB.js +1 -0
- package/dist/assets/index-BnBKg8GZ.js +1291 -0
- package/dist/assets/index-Dq3FlPWe.css +32 -0
- package/dist/assets/ini-Kd9XrMLS.js +1 -0
- package/dist/assets/java-CXBNlu9o.js +1 -0
- package/dist/assets/javascript-DQO1Leza.js +1 -0
- package/dist/assets/json.worker-CUJs-dtA.js +58 -0
- package/dist/assets/jsonMode--qsURhHr.js +7 -0
- package/dist/assets/julia-cl7-CwDS.js +1 -0
- package/dist/assets/kotlin-s7OhZKlX.js +1 -0
- package/dist/assets/less-9HpZscsL.js +2 -0
- package/dist/assets/lexon-OrD6JF1K.js +1 -0
- package/dist/assets/liquid-PL6MZtM8.js +1 -0
- package/dist/assets/lspLanguageFeatures-Cy5rDFeq.js +4 -0
- package/dist/assets/lua-Cyyb5UIc.js +1 -0
- package/dist/assets/m3-B8OfTtLu.js +1 -0
- package/dist/assets/markdown-BFxVWTOG.js +1 -0
- package/dist/assets/mdx-Cb3Jy14X.js +1 -0
- package/dist/assets/mips-CiqrrVzr.js +1 -0
- package/dist/assets/msdax-DmeGPVcC.js +1 -0
- package/dist/assets/mysql-C_tMU-Nz.js +1 -0
- package/dist/assets/objective-c-BDtDVThU.js +1 -0
- package/dist/assets/pascal-vHIfCaH5.js +1 -0
- package/dist/assets/pascaligo-DtZ0uQbO.js +1 -0
- package/dist/assets/perl-Ub6l9XKa.js +1 -0
- package/dist/assets/pgsql-BlNEE0v7.js +1 -0
- package/dist/assets/php-BBUBE1dy.js +1 -0
- package/dist/assets/pla-DSh2-awV.js +1 -0
- package/dist/assets/postiats-CocnycG-.js +1 -0
- package/dist/assets/powerquery-tScXyioY.js +1 -0
- package/dist/assets/powershell-COWaemsV.js +1 -0
- package/dist/assets/protobuf-Brw8urJB.js +2 -0
- package/dist/assets/pug-8SOpv6rk.js +1 -0
- package/dist/assets/python-Usm4OUwq.js +1 -0
- package/dist/assets/qsharp-Bw9ernYp.js +1 -0
- package/dist/assets/r-j7ic8hl3.js +1 -0
- package/dist/assets/razor-BIOole7a.js +1 -0
- package/dist/assets/redis-Bu5POkcn.js +1 -0
- package/dist/assets/redshift-Bs9aos_-.js +1 -0
- package/dist/assets/restructuredtext-CqXO7rUv.js +1 -0
- package/dist/assets/ruby-zBfavPgS.js +1 -0
- package/dist/assets/rust-BzKRNQWT.js +1 -0
- package/dist/assets/sb-BBc9UKZt.js +1 -0
- package/dist/assets/scala-D9hQfWCl.js +1 -0
- package/dist/assets/scheme-BPhDTwHR.js +1 -0
- package/dist/assets/scss-CBJaRo0y.js +3 -0
- package/dist/assets/shell-DiJ1NA_G.js +1 -0
- package/dist/assets/solidity-Db0IVjzk.js +1 -0
- package/dist/assets/sophia-CnS9iZB_.js +1 -0
- package/dist/assets/sparql-CJmd_6j2.js +1 -0
- package/dist/assets/sql-ClhHkBeG.js +1 -0
- package/dist/assets/st-CHwy0fLd.js +1 -0
- package/dist/assets/swift-Bqt4WxQ4.js +3 -0
- package/dist/assets/systemverilog-Bs9z6M-B.js +1 -0
- package/dist/assets/tcl-Dm6ycUr_.js +1 -0
- package/dist/assets/ts.worker-Dy9lDQQT.js +67731 -0
- package/dist/assets/tsMode-CDjF3DWK.js +11 -0
- package/dist/assets/twig-Csy3S7wG.js +1 -0
- package/dist/assets/typescript-CJR4sLnG.js +1 -0
- package/dist/assets/typespec-Btyra-wh.js +1 -0
- package/dist/assets/vb-Db0cS2oM.js +1 -0
- package/dist/assets/wgsl-DumH7NcR.js +298 -0
- package/dist/assets/xml-CJZS3uh7.js +1 -0
- package/dist/assets/yaml-DB88cW5z.js +1 -0
- package/dist/audit.d.ts +48 -0
- package/dist/container.d.ts +100 -0
- package/dist/event-emitter.d.ts +7 -0
- package/dist/favicon.png +0 -0
- package/dist/git-service.d.ts +31 -0
- package/dist/index.html +188 -0
- package/dist/logo-sm.png +0 -0
- package/dist/logo.png +0 -0
- package/dist/main.d.ts +1 -0
- package/dist/monaco-editor.d.ts +11 -0
- package/dist/monacoeditorwork/css.worker.bundle.js +54264 -0
- package/dist/monacoeditorwork/editor.worker.bundle.js +14317 -0
- package/dist/monacoeditorwork/html.worker.bundle.js +30449 -0
- package/dist/monacoeditorwork/json.worker.bundle.js +22085 -0
- package/dist/monacoeditorwork/ts.worker.bundle.js +225552 -0
- package/dist/net-intercept.d.ts +2 -0
- package/dist/network-hook.d.ts +1 -0
- package/dist/plugin.d.ts +20 -0
- package/dist/policy.d.ts +58 -0
- package/dist/sdk.d.ts +61 -0
- package/dist/tab-manager.d.ts +11 -0
- package/dist/templates.d.ts +46 -0
- package/dist/terminal.d.ts +19 -0
- package/dist/types.d.ts +109 -0
- package/dist/ui.d.ts +81 -0
- package/dist/workspace.d.ts +16 -0
- package/index.html +159 -0
- package/logo.png +0 -0
- package/package.json +31 -0
- package/public/favicon.png +0 -0
- package/public/logo-sm.png +0 -0
- package/public/logo.png +0 -0
- package/src/audit.ts +196 -0
- package/src/container.ts +723 -0
- package/src/event-emitter.ts +28 -0
- package/src/git-service.ts +202 -0
- package/src/main.ts +9 -0
- package/src/monaco-editor.ts +111 -0
- package/src/net-intercept.ts +74 -0
- package/src/network-hook.ts +248 -0
- package/src/plugin.ts +63 -0
- package/src/policy.ts +403 -0
- package/src/sdk.ts +355 -0
- package/src/style.css +432 -0
- package/src/tab-manager.ts +30 -0
- package/src/templates.ts +271 -0
- package/src/terminal.ts +78 -0
- package/src/types.ts +113 -0
- package/src/ui.ts +1266 -0
- package/src/workspace.ts +107 -0
- package/tsconfig.json +20 -0
- package/vite.config.ts +52 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Contributing to ClawLess
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to ClawLess! We welcome contributions from the community and are grateful for any time you can dedicate to improving this project.
|
|
4
|
+
|
|
5
|
+
## How to Contribute
|
|
6
|
+
|
|
7
|
+
1. **Fork** the repository on GitHub.
|
|
8
|
+
2. **Create a feature branch** from `main`:
|
|
9
|
+
```bash
|
|
10
|
+
git checkout -b feature/amazing-feature
|
|
11
|
+
```
|
|
12
|
+
3. **Commit your changes** with a clear message:
|
|
13
|
+
```bash
|
|
14
|
+
git commit -m 'Add amazing feature'
|
|
15
|
+
```
|
|
16
|
+
4. **Push to your branch**:
|
|
17
|
+
```bash
|
|
18
|
+
git push origin feature/amazing-feature
|
|
19
|
+
```
|
|
20
|
+
5. **Open a Pull Request** against the `main` branch.
|
|
21
|
+
|
|
22
|
+
## Development Setup
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
git clone https://github.com/open-gitagent/clawless.git
|
|
26
|
+
cd clawless
|
|
27
|
+
npm install
|
|
28
|
+
npm run dev
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The project uses **Vite + TypeScript**. All source code is located in the `src/` directory.
|
|
32
|
+
|
|
33
|
+
## Project Structure
|
|
34
|
+
|
|
35
|
+
| File | Description |
|
|
36
|
+
|------|-------------|
|
|
37
|
+
| `src/sdk.ts` | Main SDK facade (ClawContainer class) |
|
|
38
|
+
| `src/container.ts` | WebContainer orchestration |
|
|
39
|
+
| `src/policy.ts` | Policy engine |
|
|
40
|
+
| `src/audit.ts` | Audit logging |
|
|
41
|
+
| `src/git-service.ts` | GitHub API integration |
|
|
42
|
+
| `src/plugin.ts` | Plugin manager |
|
|
43
|
+
| `src/ui.ts` | UI manager |
|
|
44
|
+
| `src/terminal.ts` | Terminal manager |
|
|
45
|
+
| `src/templates.ts` | Template system |
|
|
46
|
+
| `src/net-intercept.ts` | Browser network interception |
|
|
47
|
+
| `src/network-hook.ts` | Node.js network hook |
|
|
48
|
+
|
|
49
|
+
## Code Style
|
|
50
|
+
|
|
51
|
+
- **TypeScript strict mode** is enabled. Do not disable it.
|
|
52
|
+
- **ES2022** is the compilation target.
|
|
53
|
+
- Use the **typed event emitter pattern** for component communication.
|
|
54
|
+
- Prefer **explicit types** over `any`. If you must use `any`, add a comment explaining why.
|
|
55
|
+
|
|
56
|
+
## Issue Reporting
|
|
57
|
+
|
|
58
|
+
Before opening a new issue, please:
|
|
59
|
+
|
|
60
|
+
1. **Search existing issues** to avoid duplicates.
|
|
61
|
+
2. When filing a bug report, include:
|
|
62
|
+
- **Browser version** and operating system.
|
|
63
|
+
- **Steps to reproduce** the issue.
|
|
64
|
+
- **Expected behavior** versus **actual behavior**.
|
|
65
|
+
- Any relevant error messages or console output.
|
|
66
|
+
|
|
67
|
+
## Pull Request Guidelines
|
|
68
|
+
|
|
69
|
+
- **Keep PRs focused and small.** One feature or fix per PR makes review easier.
|
|
70
|
+
- **Add tests** if applicable to cover new functionality or bug fixes.
|
|
71
|
+
- **Update documentation** for any API changes or new features.
|
|
72
|
+
- **Ensure `npm run build` passes** before submitting your PR.
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
By contributing to ClawLess, you agree that your contributions will be licensed under the **MIT License**.
|
package/DOCS.md
ADDED
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
# ClawLess Documentation
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
|
|
5
|
+
- [Architecture Overview](#architecture-overview)
|
|
6
|
+
- [SDK API Reference](#sdk-api-reference)
|
|
7
|
+
- [ClawContainer Class](#clawcontainer-class)
|
|
8
|
+
- [Plugin System](#plugin-system)
|
|
9
|
+
- [ClawContainerPlugin Interface](#clawcontainerplugin-interface)
|
|
10
|
+
- [TabDefinition](#tabdefinition)
|
|
11
|
+
- [Template System](#template-system)
|
|
12
|
+
- [Policy Engine](#policy-engine)
|
|
13
|
+
- [Policy Structure](#policy-structure)
|
|
14
|
+
- [PolicyAction Types](#policyaction-types)
|
|
15
|
+
- [Rules](#rules)
|
|
16
|
+
- [YAML Format](#yaml-format)
|
|
17
|
+
- [Glob Matching](#glob-matching)
|
|
18
|
+
- [PolicyEngine Methods](#policyengine-methods)
|
|
19
|
+
- [Audit Logging](#audit-logging)
|
|
20
|
+
- [AuditEntry](#auditentry)
|
|
21
|
+
- [AuditLog Methods](#auditlog-methods)
|
|
22
|
+
- [Git Service](#git-service)
|
|
23
|
+
- [GitService](#gitservice)
|
|
24
|
+
- [Supported URL Formats](#supported-url-formats)
|
|
25
|
+
- [Network Interception](#network-interception)
|
|
26
|
+
- [Browser-side (net-intercept.ts)](#browser-side-net-interceptts)
|
|
27
|
+
- [Container-side (network-hook.ts)](#container-side-network-hookts)
|
|
28
|
+
- [Configuration](#configuration)
|
|
29
|
+
- [Environment Variables](#environment-variables)
|
|
30
|
+
- [Supported Providers & Models](#supported-providers--models)
|
|
31
|
+
- [LocalStorage Persistence](#localstorage-persistence)
|
|
32
|
+
- [Security Model](#security-model)
|
|
33
|
+
|
|
34
|
+
## Architecture Overview
|
|
35
|
+
|
|
36
|
+
ClawLess is a browser-based AI agent container runtime built on WebContainers. Data flow:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
User Input → ClawContainer (SDK) → ContainerManager → WebContainer
|
|
40
|
+
→ PolicyEngine (enforce)
|
|
41
|
+
→ AuditLog (record)
|
|
42
|
+
→ GitService (sync)
|
|
43
|
+
→ TerminalManager (display)
|
|
44
|
+
→ UIManager → PluginManager
|
|
45
|
+
→ EventEmitter → Plugins
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## SDK API Reference
|
|
49
|
+
|
|
50
|
+
### ClawContainer Class
|
|
51
|
+
|
|
52
|
+
Constructor: `new ClawContainer(selector: string, options?: ClawContainerOptions)`
|
|
53
|
+
|
|
54
|
+
**ClawContainerOptions:**
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
interface ClawContainerOptions {
|
|
58
|
+
agent?: AgentConfig | false;
|
|
59
|
+
workspace?: Record<string, string>;
|
|
60
|
+
services?: Record<string, string>;
|
|
61
|
+
env?: Record<string, string>;
|
|
62
|
+
startupScript?: string;
|
|
63
|
+
template?: string | ContainerTemplate;
|
|
64
|
+
plugins?: ClawContainerPlugin[];
|
|
65
|
+
tabs?: TabDefinition[];
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Lifecycle Methods:**
|
|
70
|
+
|
|
71
|
+
- `start(): Promise<void>` - Boot container, install deps, configure env, launch agent
|
|
72
|
+
- `stop(): Promise<void>` - Stop container and dispatch onDestroy to plugins
|
|
73
|
+
- `restart(): Promise<void>` - Stop then start
|
|
74
|
+
|
|
75
|
+
**Command Execution:**
|
|
76
|
+
|
|
77
|
+
- `exec(cmd: string): Promise<string>` - Execute command and return output
|
|
78
|
+
- `shell(): Promise<void>` - Open interactive shell
|
|
79
|
+
- `sendInput(data: string): Promise<void>` - Send input to running process
|
|
80
|
+
|
|
81
|
+
**File System (cc.fs):**
|
|
82
|
+
|
|
83
|
+
- `read(path): Promise<string>`
|
|
84
|
+
- `write(path, content): Promise<void>`
|
|
85
|
+
- `list(dir?): Promise<string[]>`
|
|
86
|
+
- `mkdir(path): Promise<void>`
|
|
87
|
+
- `remove(path): Promise<void>`
|
|
88
|
+
|
|
89
|
+
**Git (cc.git):**
|
|
90
|
+
|
|
91
|
+
- `clone(url, token): Promise<void>`
|
|
92
|
+
- `push(message?): Promise<string>`
|
|
93
|
+
|
|
94
|
+
**Events:**
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
type ClawContainerEvents = {
|
|
98
|
+
ready: [];
|
|
99
|
+
error: [error: Error];
|
|
100
|
+
status: [status: string];
|
|
101
|
+
'file.change': [path: string];
|
|
102
|
+
'process.exit': [code: number];
|
|
103
|
+
'server.ready': [port: number, url: string];
|
|
104
|
+
log: [entry: AuditEntry];
|
|
105
|
+
};
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
- `on(event, fn)`, `off(event, fn)`, `once(event, fn)`
|
|
109
|
+
|
|
110
|
+
**Plugin & Tab:**
|
|
111
|
+
|
|
112
|
+
- `use(plugin: ClawContainerPlugin): void`
|
|
113
|
+
- `addTab(def: TabDefinition): void`
|
|
114
|
+
- `removeTab(id: string): void`
|
|
115
|
+
|
|
116
|
+
**Static:**
|
|
117
|
+
|
|
118
|
+
- `ClawContainer.registerTemplate(template): void`
|
|
119
|
+
- `ClawContainer.parseTemplate(yaml): ContainerTemplate`
|
|
120
|
+
|
|
121
|
+
## Plugin System
|
|
122
|
+
|
|
123
|
+
### ClawContainerPlugin Interface
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
interface ClawContainerPlugin {
|
|
127
|
+
name: string;
|
|
128
|
+
services?: Record<string, string>;
|
|
129
|
+
workspace?: Record<string, string>;
|
|
130
|
+
env?: Record<string, string>;
|
|
131
|
+
tabs?: TabDefinition[];
|
|
132
|
+
onInit?(cc: ClawContainerSDK): void;
|
|
133
|
+
onReady?(cc: ClawContainerSDK): void;
|
|
134
|
+
onDestroy?(cc: ClawContainerSDK): void;
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Lifecycle: onInit (after register, before boot) → onReady (after container ready) → onDestroy (on stop).
|
|
139
|
+
Plugins can merge services, workspace files, env vars, and custom tabs.
|
|
140
|
+
|
|
141
|
+
### TabDefinition
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
interface TabDefinition {
|
|
145
|
+
id: string;
|
|
146
|
+
label: string;
|
|
147
|
+
render: string | ((container: HTMLDivElement) => void);
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Template System
|
|
152
|
+
|
|
153
|
+
Templates pre-configure agent, workspace, services, env, tabs.
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
interface ContainerTemplate {
|
|
157
|
+
name: string;
|
|
158
|
+
description?: string;
|
|
159
|
+
agent?: AgentConfig | false;
|
|
160
|
+
workspace?: Record<string, string>;
|
|
161
|
+
services?: Record<string, string>;
|
|
162
|
+
env?: Record<string, string>;
|
|
163
|
+
startupScript?: string;
|
|
164
|
+
tabs?: TabDefinition[];
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Built-in template: `gitclaw` (gitclaw@1.1.4 agent).
|
|
169
|
+
|
|
170
|
+
YAML template format example:
|
|
171
|
+
|
|
172
|
+
```yaml
|
|
173
|
+
name: my-template
|
|
174
|
+
description: My custom template
|
|
175
|
+
agent:
|
|
176
|
+
package: gitclaw
|
|
177
|
+
version: 1.1.4
|
|
178
|
+
entry: dist/index.js
|
|
179
|
+
args: ["--dir", "<home>/workspace"]
|
|
180
|
+
workspace:
|
|
181
|
+
'src/index.ts': |
|
|
182
|
+
export function hello() {}
|
|
183
|
+
services:
|
|
184
|
+
lodash: "4.17.21"
|
|
185
|
+
env:
|
|
186
|
+
DEBUG: "true"
|
|
187
|
+
startupScript: npm run build
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Register via `ClawContainer.registerTemplate(template)` or pass template name/object in options.
|
|
191
|
+
|
|
192
|
+
## Policy Engine
|
|
193
|
+
|
|
194
|
+
YAML-based guardrails for controlling agent behavior.
|
|
195
|
+
|
|
196
|
+
### Policy Structure
|
|
197
|
+
|
|
198
|
+
```typescript
|
|
199
|
+
interface Policy {
|
|
200
|
+
version: '1';
|
|
201
|
+
mode: 'allow-all' | 'deny-all';
|
|
202
|
+
files: { read: FileRule[]; write: FileRule[] };
|
|
203
|
+
processes: ProcessRule[];
|
|
204
|
+
ports: PortRule[];
|
|
205
|
+
tools: ToolRule[];
|
|
206
|
+
limits: RuntimeLimits;
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### PolicyAction Types
|
|
211
|
+
|
|
212
|
+
`file.read`, `file.write`, `process.spawn`, `server.bind`, `env.configure`, `tool.use`, `git.clone`, `git.push`
|
|
213
|
+
|
|
214
|
+
### Rules
|
|
215
|
+
|
|
216
|
+
```typescript
|
|
217
|
+
interface FileRule { pattern: string; allow: boolean; }
|
|
218
|
+
interface ProcessRule { pattern: string; allow: boolean; }
|
|
219
|
+
interface PortRule { port: number | '*'; allow: boolean; }
|
|
220
|
+
interface ToolRule { name: string; allow: boolean; }
|
|
221
|
+
interface RuntimeLimits {
|
|
222
|
+
maxFileSize: number; // default 10MB
|
|
223
|
+
maxProcesses: number; // default 10
|
|
224
|
+
maxTurns: number; // default 50
|
|
225
|
+
timeoutSec: number; // default 120
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### YAML Format
|
|
230
|
+
|
|
231
|
+
```yaml
|
|
232
|
+
version: "1"
|
|
233
|
+
mode: allow-all
|
|
234
|
+
files:
|
|
235
|
+
read:
|
|
236
|
+
- pattern: "workspace/**"
|
|
237
|
+
allow: true
|
|
238
|
+
- pattern: "node_modules/**"
|
|
239
|
+
allow: false
|
|
240
|
+
write:
|
|
241
|
+
- pattern: "workspace/**"
|
|
242
|
+
allow: true
|
|
243
|
+
processes:
|
|
244
|
+
- pattern: "npm *"
|
|
245
|
+
allow: true
|
|
246
|
+
- pattern: "rm -rf *"
|
|
247
|
+
allow: false
|
|
248
|
+
ports:
|
|
249
|
+
- port: "*"
|
|
250
|
+
allow: true
|
|
251
|
+
tools:
|
|
252
|
+
- name: "*"
|
|
253
|
+
allow: true
|
|
254
|
+
limits:
|
|
255
|
+
maxFileSize: 10485760
|
|
256
|
+
maxProcesses: 10
|
|
257
|
+
maxTurns: 50
|
|
258
|
+
timeoutSec: 120
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Glob Matching
|
|
262
|
+
|
|
263
|
+
Supports `*` (single segment), `**` (any depth), `?` (single char).
|
|
264
|
+
|
|
265
|
+
### PolicyEngine Methods
|
|
266
|
+
|
|
267
|
+
- `check(action, subject, meta?): CheckResult` - Check without throwing
|
|
268
|
+
- `enforce(action, subject, meta?): CheckResult` - Throws PolicyDeniedError if denied
|
|
269
|
+
- `loadPolicy(policy)`, `getPolicy()`, `toYaml()`, `static fromYaml(yaml)`
|
|
270
|
+
|
|
271
|
+
## Audit Logging
|
|
272
|
+
|
|
273
|
+
### AuditEntry
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
interface AuditEntry {
|
|
277
|
+
timestamp: string; // ISO8601
|
|
278
|
+
event: AuditEvent;
|
|
279
|
+
detail: string;
|
|
280
|
+
meta?: Record<string, unknown>;
|
|
281
|
+
source?: AuditSource;
|
|
282
|
+
level?: AuditLevel;
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**Sources:** `boot`, `user`, `agent`, `system`, `policy`
|
|
287
|
+
|
|
288
|
+
**Levels:** `info`, `warn`, `error`
|
|
289
|
+
|
|
290
|
+
**Events:**
|
|
291
|
+
`process.spawn`, `process.exit`, `file.read`, `file.write`, `io.stdout`, `io.stdin`, `env.configure`, `server.ready`, `status.change`, `policy.deny`, `policy.load`, `boot.mount`, `net.request`, `net.response`, `git.clone`, `git.push`
|
|
292
|
+
|
|
293
|
+
### AuditLog Methods
|
|
294
|
+
|
|
295
|
+
- `log(event, detail, meta?, opts?)` - Log an entry
|
|
296
|
+
- `filter({ source?, level?, event? })` - Filter entries
|
|
297
|
+
- `toText()` - Export grouped by source
|
|
298
|
+
- `toJSON()` - Export as JSON
|
|
299
|
+
- `onEntry(fn)` - Subscribe (returns unsubscribe fn)
|
|
300
|
+
- `static maskKey(val)` - Mask API keys
|
|
301
|
+
- `static maskHeaders(headers)` - Mask sensitive headers
|
|
302
|
+
|
|
303
|
+
## Git Service
|
|
304
|
+
|
|
305
|
+
Browser-native GitHub integration using the GitHub REST API (no git binary).
|
|
306
|
+
|
|
307
|
+
### GitService
|
|
308
|
+
|
|
309
|
+
```typescript
|
|
310
|
+
constructor(token: string, owner: string, repo: string, branch?: string)
|
|
311
|
+
static parseRepoUrl(url: string): { owner: string; repo: string }
|
|
312
|
+
async detectDefaultBranch(): Promise<string>
|
|
313
|
+
async fetchRepoTree(): Promise<GitFile[]> // batch fetch, skip >1MB, max 10 concurrent
|
|
314
|
+
async pushChanges(files: GitFile[], message: string): Promise<string> // atomic: blobs→tree→commit→ref
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Supported URL Formats
|
|
318
|
+
|
|
319
|
+
Handles `https://github.com/owner/repo`, `https://github.com/owner/repo.git`, and other GitHub URL formats.
|
|
320
|
+
|
|
321
|
+
## Network Interception
|
|
322
|
+
|
|
323
|
+
### Browser-side (net-intercept.ts)
|
|
324
|
+
|
|
325
|
+
Patches `window.fetch` to log all outbound HTTP requests with:
|
|
326
|
+
|
|
327
|
+
- Request: method, headers (masked), body preview
|
|
328
|
+
- Response: status, headers, duration
|
|
329
|
+
|
|
330
|
+
### Container-side (network-hook.ts)
|
|
331
|
+
|
|
332
|
+
Node.js hook injected via `NODE_OPTIONS=--require ./network-hook.cjs`. Patches:
|
|
333
|
+
|
|
334
|
+
- `http.request()` & `http.get()`
|
|
335
|
+
- `https.request()` & `https.get()`
|
|
336
|
+
- `globalThis.fetch()` (Node 18+)
|
|
337
|
+
|
|
338
|
+
Output format: `__NET_AUDIT__:{json}` on stderr, parsed by ContainerManager.
|
|
339
|
+
Sensitive headers masked. Bodies truncated to 2000 chars. Skipped during npm install.
|
|
340
|
+
|
|
341
|
+
## Configuration
|
|
342
|
+
|
|
343
|
+
### Environment Variables
|
|
344
|
+
|
|
345
|
+
Configure through the UI config panel or programmatically via options.env:
|
|
346
|
+
|
|
347
|
+
- `ANTHROPIC_API_KEY` - Anthropic API key
|
|
348
|
+
- `OPENAI_API_KEY` - OpenAI API key
|
|
349
|
+
- `GOOGLE_API_KEY` - Google AI API key
|
|
350
|
+
- `GITHUB_TOKEN` - GitHub personal access token (for git operations)
|
|
351
|
+
|
|
352
|
+
### Supported Providers & Models
|
|
353
|
+
|
|
354
|
+
- **Anthropic:** claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5
|
|
355
|
+
- **OpenAI:** gpt-4o, gpt-4o-mini, o3-mini
|
|
356
|
+
- **Google:** gemini-2.0-flash, gemini-2.5-pro
|
|
357
|
+
|
|
358
|
+
### LocalStorage Persistence
|
|
359
|
+
|
|
360
|
+
Config persisted with `clawchef_` prefix:
|
|
361
|
+
|
|
362
|
+
- `clawchef_provider`, `clawchef_model`, `clawchef_envVars`, `clawchef_policy`
|
|
363
|
+
|
|
364
|
+
## Security Model
|
|
365
|
+
|
|
366
|
+
- **Sandboxing:** All code runs inside a WebContainer (WASM-based). No access to host filesystem or network beyond browser APIs.
|
|
367
|
+
- **Policy enforcement:** Every file read/write, process spawn, and port bind is checked against the policy engine before execution.
|
|
368
|
+
- **Network auditing:** All HTTP requests (browser and container) are intercepted, logged, and sensitive headers masked.
|
|
369
|
+
- **API key masking:** Keys are masked in logs (first 7 + last 4 chars visible).
|
|
370
|
+
- **COOP/COEP headers:** Required for SharedArrayBuffer (WebContainer). Configured via Vite dev server.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Shreyas Kapale / Lyzr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="black_logo.png" alt="ClawLess" width="200" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">ClawLess</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>A serverless browser-based runtime for Claw AI Agents powered by WebContainers</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/package/clawless-runtime"><img src="https://img.shields.io/npm/v/clawless-runtime?color=cb3837&label=npm&logo=npm" alt="npm version" /></a>
|
|
13
|
+
<a href="https://github.com/open-gitagent/clawless/releases"><img src="https://img.shields.io/github/v/release/open-gitagent/clawless?color=blue&logo=github" alt="GitHub release" /></a>
|
|
14
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /></a>
|
|
15
|
+
<a href="https://github.com/open-gitagent/clawless/stargazers"><img src="https://img.shields.io/github/stars/open-gitagent/clawless?style=social" alt="GitHub stars" /></a>
|
|
16
|
+
<a href="https://github.com/open-gitagent/clawless/issues"><img src="https://img.shields.io/github/issues/open-gitagent/clawless?color=yellow" alt="GitHub issues" /></a>
|
|
17
|
+
<a href="CONTRIBUTING.md"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome" /></a>
|
|
18
|
+
<img src="https://img.shields.io/badge/TypeScript-5.4-blue?logo=typescript&logoColor=white" alt="TypeScript" />
|
|
19
|
+
<img src="https://img.shields.io/badge/WebContainers-WASM-orange?logo=webassembly&logoColor=white" alt="WebContainers" />
|
|
20
|
+
<img src="https://img.shields.io/badge/platform-browser-lightgrey?logo=googlechrome&logoColor=white" alt="Platform: Browser" />
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<a href="#quick-start">Quick Start</a> ·
|
|
25
|
+
<a href="DOCS.md">Documentation</a> ·
|
|
26
|
+
<a href="#sdk-usage">SDK Usage</a> ·
|
|
27
|
+
<a href="CONTRIBUTING.md">Contributing</a> ·
|
|
28
|
+
<a href="https://github.com/open-gitagent/clawless/discussions">Discussions</a>
|
|
29
|
+
</p>
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
Run, observe, and control AI agents entirely in the browser — no backend required. ClawLess provides a full sandboxed Node.js environment via WebContainers (WASM) with built-in editor, terminal, policy engine, and audit logging.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Key Features
|
|
38
|
+
|
|
39
|
+
- **WebContainer-powered sandboxed runtime (WASM)** — full OS-level isolation in the browser
|
|
40
|
+
- **Monaco Editor with multi-file tabs** — rich editing experience out of the box
|
|
41
|
+
- **xterm.js terminal with full PTY support** — real terminal sessions, not a toy console
|
|
42
|
+
- **GitHub integration** — clone and push repositories via the GitHub API
|
|
43
|
+
- **YAML-based policy engine with glob patterns** — declarative guardrails for agent behavior
|
|
44
|
+
- **Complete audit logging** — process, file, network, and git events captured end-to-end
|
|
45
|
+
- **Plugin system with lifecycle hooks** — extend and customize every stage of execution
|
|
46
|
+
- **Template system for agent configurations** — bootstrap agents from reusable presets
|
|
47
|
+
- **Network interception** — intercepts both browser `fetch` and Node.js `http` calls
|
|
48
|
+
- **Multi-provider AI support** — Anthropic, OpenAI, and Google out of the box
|
|
49
|
+
|
|
50
|
+
## Quick Start
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Run locally
|
|
54
|
+
git clone https://github.com/open-gitagent/clawless.git
|
|
55
|
+
cd clawless
|
|
56
|
+
npm install
|
|
57
|
+
npm run dev
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Install as a dependency
|
|
62
|
+
npm install clawless-runtime
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## SDK Usage
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import { ClawContainer } from 'clawless-runtime';
|
|
69
|
+
|
|
70
|
+
const cc = new ClawContainer('#app', {
|
|
71
|
+
template: 'gitclaw',
|
|
72
|
+
env: { ANTHROPIC_API_KEY: 'sk-...' }
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
await cc.start();
|
|
76
|
+
cc.on('ready', () => console.log('Container ready!'));
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Architecture
|
|
80
|
+
|
|
81
|
+
| Component | Role |
|
|
82
|
+
|---|---|
|
|
83
|
+
| **ClawContainer** | SDK facade — the single entry point for consumers |
|
|
84
|
+
| **ContainerManager** | WebContainer orchestration and lifecycle |
|
|
85
|
+
| **PolicyEngine** | YAML-based guardrails enforcing file, process, and network rules |
|
|
86
|
+
| **AuditLog** | Complete event trail for every action inside the container |
|
|
87
|
+
| **GitService** | GitHub API integration (clone, commit, push) |
|
|
88
|
+
| **PluginManager** | Lifecycle hooks for extending container behavior |
|
|
89
|
+
| **UIManager** | Monaco Editor, xterm.js terminal, and tab management |
|
|
90
|
+
|
|
91
|
+
## Tech Stack
|
|
92
|
+
|
|
93
|
+
- **Vite + TypeScript** — fast builds, type-safe codebase
|
|
94
|
+
- **WebContainer API** — browser-native OS environment
|
|
95
|
+
- **xterm.js** — full-featured terminal emulator
|
|
96
|
+
- **Monaco Editor** — the editor behind VS Code
|
|
97
|
+
|
|
98
|
+
## Configuration
|
|
99
|
+
|
|
100
|
+
ClawLess is configured through environment variables passed to the `ClawContainer` constructor:
|
|
101
|
+
|
|
102
|
+
| Variable | Purpose |
|
|
103
|
+
|---|---|
|
|
104
|
+
| `ANTHROPIC_API_KEY` | Anthropic API key |
|
|
105
|
+
| `OPENAI_API_KEY` | OpenAI API key |
|
|
106
|
+
| `GOOGLE_AI_API_KEY` | Google AI API key |
|
|
107
|
+
| `CLAWLESS_MODEL` | Model selection (e.g. `claude-sonnet-4-20250514`, `gpt-4o`) |
|
|
108
|
+
|
|
109
|
+
All runtime state is persisted to `localStorage` under the `clawchef_` prefix, so sessions survive page reloads.
|
|
110
|
+
|
|
111
|
+
## Links
|
|
112
|
+
|
|
113
|
+
## Supported Providers
|
|
114
|
+
|
|
115
|
+
| Provider | Models |
|
|
116
|
+
|---|---|
|
|
117
|
+
| **Anthropic** | Claude Sonnet, Claude Opus, Claude Haiku |
|
|
118
|
+
| **OpenAI** | GPT-4o, GPT-4, GPT-3.5 |
|
|
119
|
+
| **Google** | Gemini Pro, Gemini Flash |
|
|
120
|
+
|
|
121
|
+
## Roadmap
|
|
122
|
+
|
|
123
|
+
- [ ] Custom agent template marketplace
|
|
124
|
+
- [ ] Multi-agent orchestration
|
|
125
|
+
- [ ] Persistent filesystem across sessions
|
|
126
|
+
- [ ] Cloud deployment support
|
|
127
|
+
- [ ] Built-in agent debugging tools
|
|
128
|
+
|
|
129
|
+
## Community
|
|
130
|
+
|
|
131
|
+
- [GitHub Discussions](https://github.com/open-gitagent/clawless/discussions) — ask questions, share ideas
|
|
132
|
+
- [Issues](https://github.com/open-gitagent/clawless/issues) — report bugs, request features
|
|
133
|
+
- [Contributing Guide](CONTRIBUTING.md) — how to contribute
|
|
134
|
+
|
|
135
|
+
## Links
|
|
136
|
+
|
|
137
|
+
[Documentation](DOCS.md) | [Contributing](CONTRIBUTING.md) | [License](LICENSE) | [GitAgent Standard](https://gitagent.sh)
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
<p align="center">
|
|
142
|
+
Built with care by <a href="https://github.com/shreyaskapale">Shreyas Kapale</a> / <a href="https://lyzr.ai">Lyzr</a>
|
|
143
|
+
</p>
|
|
144
|
+
|
|
145
|
+
<p align="center">
|
|
146
|
+
<sub>If ClawLess helps you, consider giving it a star on GitHub!</sub>
|
|
147
|
+
</p>
|
package/black_logo.png
ADDED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={comments:{lineComment:"*"},brackets:[["[","]"],["(",")"]]},t={defaultToken:"invalid",ignoreCase:!0,tokenPostfix:".abap",keywords:["abap-source","abbreviated","abstract","accept","accepting","according","activation","actual","add","add-corresponding","adjacent","after","alias","aliases","align","all","allocate","alpha","analysis","analyzer","and","append","appendage","appending","application","archive","area","arithmetic","as","ascending","aspect","assert","assign","assigned","assigning","association","asynchronous","at","attributes","authority","authority-check","avg","back","background","backup","backward","badi","base","before","begin","between","big","binary","bintohex","bit","black","blank","blanks","blob","block","blocks","blue","bound","boundaries","bounds","boxed","break-point","buffer","by","bypassing","byte","byte-order","call","calling","case","cast","casting","catch","center","centered","chain","chain-input","chain-request","change","changing","channels","character","char-to-hex","check","checkbox","ci_","circular","class","class-coding","class-data","class-events","class-methods","class-pool","cleanup","clear","client","clob","clock","close","coalesce","code","coding","col_background","col_group","col_heading","col_key","col_negative","col_normal","col_positive","col_total","collect","color","column","columns","comment","comments","commit","common","communication","comparing","component","components","compression","compute","concat","concat_with_space","concatenate","cond","condense","condition","connect","connection","constants","context","contexts","continue","control","controls","conv","conversion","convert","copies","copy","corresponding","country","cover","cpi","create","creating","critical","currency","currency_conversion","current","cursor","cursor-selection","customer","customer-function","dangerous","data","database","datainfo","dataset","date","dats_add_days","dats_add_months","dats_days_between","dats_is_valid","daylight","dd/mm/yy","dd/mm/yyyy","ddmmyy","deallocate","decimal_shift","decimals","declarations","deep","default","deferred","define","defining","definition","delete","deleting","demand","department","descending","describe","destination","detail","dialog","directory","disconnect","display","display-mode","distinct","divide","divide-corresponding","division","do","dummy","duplicate","duplicates","duration","during","dynamic","dynpro","edit","editor-call","else","elseif","empty","enabled","enabling","encoding","end","endat","endcase","endcatch","endchain","endclass","enddo","endenhancement","end-enhancement-section","endexec","endform","endfunction","endian","endif","ending","endinterface","end-lines","endloop","endmethod","endmodule","end-of-definition","end-of-editing","end-of-file","end-of-page","end-of-selection","endon","endprovide","endselect","end-test-injection","end-test-seam","endtry","endwhile","endwith","engineering","enhancement","enhancement-point","enhancements","enhancement-section","entries","entry","enum","environment","equiv","errormessage","errors","escaping","event","events","exact","except","exception","exceptions","exception-table","exclude","excluding","exec","execute","exists","exit","exit-command","expand","expanding","expiration","explicit","exponent","export","exporting","extend","extended","extension","extract","fail","fetch","field","field-groups","fields","field-symbol","field-symbols","file","filter","filters","filter-table","final","find","first","first-line","fixed-point","fkeq","fkge","flush","font","for","form","format","forward","found","frame","frames","free","friends","from","function","functionality","function-pool","further","gaps","generate","get","giving","gkeq","gkge","global","grant","green","group","groups","handle","handler","harmless","hashed","having","hdb","header","headers","heading","head-lines","help-id","help-request","hextobin","hide","high","hint","hold","hotspot","icon","id","identification","identifier","ids","if","ignore","ignoring","immediately","implementation","implementations","implemented","implicit","import","importing","in","inactive","incl","include","includes","including","increment","index","index-line","infotypes","inheriting","init","initial","initialization","inner","inout","input","insert","instance","instances","instr","intensified","interface","interface-pool","interfaces","internal","intervals","into","inverse","inverted-date","is","iso","job","join","keep","keeping","kernel","key","keys","keywords","kind","language","last","late","layout","leading","leave","left","left-justified","leftplus","leftspace","legacy","length","let","level","levels","like","line","lines","line-count","linefeed","line-selection","line-size","list","listbox","list-processing","little","llang","load","load-of-program","lob","local","locale","locator","logfile","logical","log-point","long","loop","low","lower","lpad","lpi","ltrim","mail","main","major-id","mapping","margin","mark","mask","match","matchcode","max","maximum","medium","members","memory","mesh","message","message-id","messages","messaging","method","methods","min","minimum","minor-id","mm/dd/yy","mm/dd/yyyy","mmddyy","mode","modif","modifier","modify","module","move","move-corresponding","multiply","multiply-corresponding","name","nametab","native","nested","nesting","new","new-line","new-page","new-section","next","no","no-display","no-extension","no-gap","no-gaps","no-grouping","no-heading","no-scrolling","no-sign","no-title","no-topofpage","no-zero","node","nodes","non-unicode","non-unique","not","null","number","object","objects","obligatory","occurrence","occurrences","occurs","of","off","offset","ole","on","only","open","option","optional","options","or","order","other","others","out","outer","output","output-length","overflow","overlay","pack","package","pad","padding","page","pages","parameter","parameters","parameter-table","part","partially","pattern","percentage","perform","performing","person","pf1","pf10","pf11","pf12","pf13","pf14","pf15","pf2","pf3","pf4","pf5","pf6","pf7","pf8","pf9","pf-status","pink","places","pool","pos_high","pos_low","position","pragmas","precompiled","preferred","preserving","primary","print","print-control","priority","private","procedure","process","program","property","protected","provide","public","push","pushbutton","put","queue-only","quickinfo","radiobutton","raise","raising","range","ranges","read","reader","read-only","receive","received","receiver","receiving","red","redefinition","reduce","reduced","ref","reference","refresh","regex","reject","remote","renaming","replace","replacement","replacing","report","request","requested","reserve","reset","resolution","respecting","responsible","result","results","resumable","resume","retry","return","returncode","returning","returns","right","right-justified","rightplus","rightspace","risk","rmc_communication_failure","rmc_invalid_status","rmc_system_failure","role","rollback","rows","rpad","rtrim","run","sap","sap-spool","saving","scale_preserving","scale_preserving_scientific","scan","scientific","scientific_with_leading_zero","scroll","scroll-boundary","scrolling","search","secondary","seconds","section","select","selection","selections","selection-screen","selection-set","selection-sets","selection-table","select-options","send","separate","separated","set","shared","shift","short","shortdump-id","sign_as_postfix","single","size","skip","skipping","smart","some","sort","sortable","sorted","source","specified","split","spool","spots","sql","sqlscript","stable","stamp","standard","starting","start-of-editing","start-of-selection","state","statement","statements","static","statics","statusinfo","step-loop","stop","structure","structures","style","subkey","submatches","submit","subroutine","subscreen","subtract","subtract-corresponding","suffix","sum","summary","summing","supplied","supply","suppress","switch","switchstates","symbol","syncpoints","syntax","syntax-check","syntax-trace","system-call","system-exceptions","system-exit","tab","tabbed","table","tables","tableview","tabstrip","target","task","tasks","test","testing","test-injection","test-seam","text","textpool","then","throw","time","times","timestamp","timezone","tims_is_valid","title","titlebar","title-lines","to","tokenization","tokens","top-lines","top-of-page","trace-file","trace-table","trailing","transaction","transfer","transformation","translate","transporting","trmac","truncate","truncation","try","tstmp_add_seconds","tstmp_current_utctimestamp","tstmp_is_valid","tstmp_seconds_between","type","type-pool","type-pools","types","uline","unassign","under","unicode","union","unique","unit_conversion","unix","unpack","until","unwind","up","update","upper","user","user-command","using","utf-8","valid","value","value-request","values","vary","varying","verification-message","version","via","view","visible","wait","warning","when","whenever","where","while","width","window","windows","with","with-heading","without","with-title","word","work","write","writer","xml","xsd","yellow","yes","yymmdd","zero","zone","abap_system_timezone","abap_user_timezone","access","action","adabas","adjust_numbers","allow_precision_loss","allowed","amdp","applicationuser","as_geo_json","as400","associations","balance","behavior","breakup","bulk","cds","cds_client","check_before_save","child","clients","corr","corr_spearman","cross","cycles","datn_add_days","datn_add_months","datn_days_between","dats_from_datn","dats_tims_to_tstmp","dats_to_datn","db2","db6","ddl","dense_rank","depth","deterministic","discarding","entities","entity","error","failed","finalize","first_value","fltp_to_dec","following","fractional","full","graph","grouping","hierarchy","hierarchy_ancestors","hierarchy_ancestors_aggregate","hierarchy_descendants","hierarchy_descendants_aggregate","hierarchy_siblings","incremental","indicators","lag","last_value","lead","leaves","like_regexpr","link","locale_sap","lock","locks","many","mapped","matched","measures","median","mssqlnt","multiple","nodetype","ntile","nulls","occurrences_regexpr","one","operations","oracle","orphans","over","parent","parents","partition","pcre","period","pfcg_mapping","preceding","privileged","product","projection","rank","redirected","replace_regexpr","reported","response","responses","root","row","row_number","sap_system_date","save","schema","session","sets","shortdump","siblings","spantree","start","stddev","string_agg","subtotal","sybase","tims_from_timn","tims_to_timn","to_blob","to_clob","total","trace-entry","tstmp_to_dats","tstmp_to_dst","tstmp_to_tims","tstmpl_from_utcl","tstmpl_to_utcl","unbounded","utcl_add_seconds","utcl_current","utcl_seconds_between","uuid","var","verbatim"],builtinFunctions:["abs","acos","asin","atan","bit-set","boolc","boolx","ceil","char_off","charlen","cmax","cmin","concat_lines_of","contains","contains_any_not_of","contains_any_of","cos","cosh","count","count_any_not_of","count_any_of","dbmaxlen","distance","escape","exp","find_any_not_of","find_any_of","find_end","floor","frac","from_mixed","ipow","line_exists","line_index","log","log10","matches","nmax","nmin","numofchar","repeat","rescale","reverse","round","segment","shift_left","shift_right","sign","sin","sinh","sqrt","strlen","substring","substring_after","substring_before","substring_from","substring_to","tan","tanh","to_lower","to_mixed","to_upper","trunc","utclong_add","utclong_current","utclong_diff","xsdbool","xstrlen"],typeKeywords:["b","c","d","decfloat16","decfloat34","f","i","int8","n","p","s","string","t","utclong","x","xstring","any","clike","csequence","decfloat","numeric","simple","xsequence","accp","char","clnt","cuky","curr","datn","dats","d16d","d16n","d16r","d34d","d34n","d34r","dec","df16_dec","df16_raw","df34_dec","df34_raw","fltp","geom_ewkb","int1","int2","int4","lang","lchr","lraw","numc","quan","raw","rawstring","sstring","timn","tims","unit","utcl","df16_scl","df34_scl","prec","varc","abap_bool","abap_false","abap_true","abap_undefined","me","screen","space","super","sy","syst","table_line","*sys*"],builtinMethods:["class_constructor","constructor"],derivedTypes:["%CID","%CID_REF","%CONTROL","%DATA","%ELEMENT","%FAIL","%KEY","%MSG","%PARAM","%PID","%PID_ASSOC","%PID_PARENT","%_HINTS"],cdsLanguage:["@AbapAnnotation","@AbapCatalog","@AccessControl","@API","@ClientDependent","@ClientHandling","@CompatibilityContract","@DataAging","@EndUserText","@Environment","@LanguageDependency","@MappingRole","@Metadata","@MetadataExtension","@ObjectModel","@Scope","@Semantics","$EXTENSION","$SELF"],selectors:["->","->*","=>","~","~*"],operators:[" +"," -","/","*","**","div","mod","=","#","@","+=","-=","*=","/=","**=","&&=","?=","&","&&","bit-and","bit-not","bit-or","bit-xor","m","o","z","<"," >","<=",">=","<>","><","=<","=>","bt","byte-ca","byte-cn","byte-co","byte-cs","byte-na","byte-ns","ca","cn","co","cp","cs","eq","ge","gt","le","lt","na","nb","ne","np","ns","*/","*:","--","/*","//"],symbols:/[=><!~?&+\-*\/\^%#@]+/,tokenizer:{root:[[/[a-z_\/$%@]([\w\/$%]|-(?!>))*/,{cases:{"@typeKeywords":"type","@keywords":"keyword","@cdsLanguage":"annotation","@derivedTypes":"type","@builtinFunctions":"type","@builtinMethods":"type","@operators":"key","@default":"identifier"}}],[/<[\w]+>/,"identifier"],[/##[\w|_]+/,"comment"],{include:"@whitespace"},[/[:,.]/,"delimiter"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@selectors":"tag","@operators":"key","@default":""}}],[/'/,{token:"string",bracket:"@open",next:"@stringquote"}],[/`/,{token:"string",bracket:"@open",next:"@stringping"}],[/\|/,{token:"string",bracket:"@open",next:"@stringtemplate"}],[/\d+/,"number"]],stringtemplate:[[/[^\\\|]+/,"string"],[/\\\|/,"string"],[/\|/,{token:"string",bracket:"@close",next:"@pop"}]],stringping:[[/[^\\`]+/,"string"],[/`/,{token:"string",bracket:"@close",next:"@pop"}]],stringquote:[[/[^\\']+/,"string"],[/'/,{token:"string",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/^\*.*$/,"comment"],[/\".*$/,"comment"]]}};export{e as conf,t as language};
|