@soederpop/luca 0.0.3 → 0.0.4
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/AGENTS.md +98 -0
- package/CLAUDE.md +27 -0
- package/SPEC.md +304 -0
- package/bun.lock +110 -265
- package/docs/CLI.md +1 -1
- package/docs/apis/features/node/content-db.md +16 -0
- package/docs/apis/features/node/fs.md +24 -0
- package/docs/apis/features/node/ipc-socket.md +0 -1
- package/docs/apis/features/node/package-finder.md +1 -11
- package/docs/apis/features/node/proc.md +0 -41
- package/docs/apis/features/node/ui.md +0 -2
- package/package.json +12 -8
- package/src/agi/container.server.ts +16 -3
- package/src/agi/features/assistant.ts +3 -7
- package/src/agi/features/assistants-manager.ts +3 -7
- package/src/agi/features/claude-code.ts +3 -7
- package/src/agi/features/conversation-history.ts +3 -7
- package/src/agi/features/conversation.ts +4 -8
- package/src/agi/features/openai-codex.ts +3 -7
- package/src/agi/features/openapi.ts +4 -2
- package/src/agi/features/skills-library.ts +4 -8
- package/src/cli/cli.ts +22 -0
- package/src/client.ts +69 -26
- package/src/clients/civitai/index.ts +3 -7
- package/src/clients/comfyui/index.ts +5 -9
- package/src/clients/elevenlabs/index.ts +39 -19
- package/src/clients/openai/index.ts +3 -7
- package/src/clients/supabase/index.ts +4 -13
- package/src/commands/console.ts +0 -3
- package/src/commands/eval.ts +1 -1
- package/src/commands/index.ts +1 -0
- package/src/commands/introspect.ts +128 -0
- package/src/commands/prompt.ts +1 -4
- package/src/commands/run.ts +6 -13
- package/src/commands/sandbox-mcp.ts +1 -13
- package/src/feature.ts +45 -2
- package/src/introspection/generated.agi.ts +175 -101
- package/src/introspection/generated.node.ts +175 -101
- package/src/introspection/generated.web.ts +113 -29
- package/src/introspection/index.ts +1 -1
- package/src/introspection/scan.ts +3 -1
- package/src/node/features/container-link.ts +3 -2
- package/src/node/features/content-db.ts +10 -2
- package/src/node/features/disk-cache.ts +3 -4
- package/src/node/features/dns.ts +3 -2
- package/src/node/features/docker.ts +3 -2
- package/src/node/features/downloader.ts +3 -16
- package/src/node/features/esbuild.ts +3 -12
- package/src/node/features/file-manager.ts +3 -2
- package/src/node/features/fs.ts +12 -3
- package/src/node/features/git.ts +3 -2
- package/src/node/features/google-auth.ts +3 -2
- package/src/node/features/google-calendar.ts +3 -2
- package/src/node/features/google-docs.ts +3 -2
- package/src/node/features/google-drive.ts +3 -2
- package/src/node/features/google-sheets.ts +3 -2
- package/src/node/features/grep.ts +3 -2
- package/src/node/features/helpers.ts +13 -2
- package/src/node/features/ink.ts +3 -3
- package/src/node/features/ipc-socket.ts +3 -3
- package/src/node/features/json-tree.ts +3 -21
- package/src/node/features/launcher-app-command-listener.ts +3 -2
- package/src/node/features/networking.ts +3 -2
- package/src/node/features/nlp.ts +3 -2
- package/src/node/features/opener.ts +8 -7
- package/src/node/features/os.ts +3 -2
- package/src/node/features/package-finder.ts +3 -2
- package/src/node/features/port-exposer.ts +3 -4
- package/src/node/features/postgres.ts +3 -3
- package/src/node/features/proc.ts +37 -64
- package/src/node/features/process-manager.ts +3 -2
- package/src/node/features/python.ts +3 -3
- package/src/node/features/repl.ts +3 -2
- package/src/node/features/runpod.ts +3 -3
- package/src/node/features/secure-shell.ts +3 -2
- package/src/node/features/semantic-search.ts +4 -6
- package/src/node/features/sqlite.ts +3 -3
- package/src/node/features/telegram.ts +3 -2
- package/src/node/features/tts.ts +3 -2
- package/src/node/features/ui.ts +3 -3
- package/src/node/features/vault.ts +3 -14
- package/src/node/features/vm.ts +41 -3
- package/src/node/features/window-manager.ts +165 -22
- package/src/node/features/yaml-tree.ts +3 -4
- package/src/node/features/yaml.ts +3 -2
- package/src/registry.ts +1 -1
- package/src/scaffolds/generated.ts +1 -1
- package/src/server.ts +43 -0
- package/src/servers/express.ts +24 -8
- package/src/servers/mcp.ts +2 -6
- package/src/servers/socket.ts +22 -7
- package/src/web/clients/socket.ts +3 -5
- package/src/web/features/asset-loader.ts +20 -12
- package/src/web/features/container-link.ts +3 -6
- package/src/web/features/esbuild.ts +21 -7
- package/src/web/features/helpers.ts +4 -2
- package/src/web/features/network.ts +24 -7
- package/src/web/features/speech.ts +24 -7
- package/src/web/features/vault.ts +21 -3
- package/src/web/features/vm.ts +20 -13
- package/src/web/features/voice-recognition.ts +26 -9
- package/commands/update-introspection.ts +0 -67
- package/docs/ideas/class-registration-refactor-possibilities.md +0 -197
- package/docs/ideas/container-use-api.md +0 -9
- package/docs/ideas/easy-auth-for-express-servers-and-luca-serve.md +0 -0
- package/docs/ideas/feature-stacks.md +0 -22
- package/docs/ideas/luca-cli-self-sufficiency-demo.md +0 -23
- package/docs/ideas/mcp-design.md +0 -9
- package/docs/ideas/web-container-debugging-feature.md +0 -13
- package/scripts/animations/chrome-glitch.ts +0 -55
- package/scripts/animations/index.ts +0 -16
- package/scripts/animations/neon-pulse.ts +0 -64
- package/scripts/animations/types.ts +0 -6
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
import type { ContainerContext } from '@soederpop/luca'
|
|
3
|
-
import { CommandOptionsSchema } from '@soederpop/luca/schemas'
|
|
4
|
-
import '../src/introspection/scan.js'
|
|
5
|
-
import { NodeContainer } from '../src/node/container.js'
|
|
6
|
-
|
|
7
|
-
export const argsSchema = CommandOptionsSchema.extend({})
|
|
8
|
-
|
|
9
|
-
const targets = [
|
|
10
|
-
{
|
|
11
|
-
name: 'node',
|
|
12
|
-
src: ['src/node/features', 'src/servers', 'src/container.ts', 'src/node/container.ts'],
|
|
13
|
-
outputPath: 'src/introspection/generated.node.ts',
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'web',
|
|
17
|
-
src: ['src/web/features', 'src/container.ts', 'src/web/container.ts'],
|
|
18
|
-
outputPath: 'src/introspection/generated.web.ts',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: 'agi',
|
|
22
|
-
src: ['src/node/features', 'src/servers', 'src/agi/features', 'src/container.ts', 'src/node/container.ts', 'src/agi/container.server.ts'],
|
|
23
|
-
outputPath: 'src/introspection/generated.agi.ts',
|
|
24
|
-
},
|
|
25
|
-
]
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Generates per-container introspection metadata files.
|
|
29
|
-
*
|
|
30
|
-
* Each container type gets its own generated file containing only the
|
|
31
|
-
* metadata relevant to that environment:
|
|
32
|
-
*
|
|
33
|
-
* - generated.node.ts: node features + servers
|
|
34
|
-
* - generated.web.ts: web features
|
|
35
|
-
* - generated.agi.ts: node features + servers + agi features
|
|
36
|
-
*/
|
|
37
|
-
async function updateIntrospection(options: z.infer<typeof argsSchema>, context: ContainerContext) {
|
|
38
|
-
const container = new NodeContainer()
|
|
39
|
-
|
|
40
|
-
for (const target of targets) {
|
|
41
|
-
console.log(`\n📦 Generating ${target.name} introspection data...`)
|
|
42
|
-
console.log(` 📁 Sources: ${target.src.join(', ')}`)
|
|
43
|
-
console.log(` 📄 Output: ${target.outputPath}`)
|
|
44
|
-
|
|
45
|
-
const scanner = container.feature('introspectionScanner', {
|
|
46
|
-
src: target.src,
|
|
47
|
-
outputPath: target.outputPath,
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
scanner.on('scanCompleted', (data) => {
|
|
51
|
-
console.log(` ✅ Found ${data.results} helpers in ${data.files} files (${data.duration}ms)`)
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
await scanner.scan()
|
|
55
|
-
await scanner.generateRegistryScript()
|
|
56
|
-
|
|
57
|
-
console.log(` 📝 Wrote ${target.outputPath}`)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
console.log('\n✨ All introspection data generated.')
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export default {
|
|
64
|
-
description: 'Generate per-container introspection metadata files from source.',
|
|
65
|
-
argsSchema,
|
|
66
|
-
handler: updateIntrospection,
|
|
67
|
-
}
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
tags: [dx, registration, metaprogramming]
|
|
3
|
-
status: spark
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Class Registration Refactor Possibilities
|
|
7
|
-
|
|
8
|
-
Exploring how static initialization blocks and class-level hooks could simplify helper registration, inspired by Ruby's `self.inherited(subclass)` pattern and how ActiveRecord::Base uses it.
|
|
9
|
-
|
|
10
|
-
## The Ruby Inspiration
|
|
11
|
-
|
|
12
|
-
In Ruby, when you write `class Post < ActiveRecord::Base`, the `inherited` hook fires automatically:
|
|
13
|
-
|
|
14
|
-
```ruby
|
|
15
|
-
class ActiveRecord::Base
|
|
16
|
-
def self.inherited(subclass)
|
|
17
|
-
subclass.table_name = subclass.name.tableize
|
|
18
|
-
subclass.establish_connection
|
|
19
|
-
# The parent configures the child at definition time
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
class Post < ActiveRecord::Base
|
|
24
|
-
end
|
|
25
|
-
# That's it. Full ORM-backed model. No registration call needed.
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
The magic: `inherited` fires at **class definition time**, receives the subclass, and lets the parent **reach into the child and set it up**. The empty class that does everything.
|
|
29
|
-
|
|
30
|
-
## Current Luca Registration Pattern
|
|
31
|
-
|
|
32
|
-
Today, every helper requires explicit registration at the bottom of the file:
|
|
33
|
-
|
|
34
|
-
```typescript
|
|
35
|
-
// src/node/features/fs.ts
|
|
36
|
-
import { features, Feature } from "../feature.js"
|
|
37
|
-
|
|
38
|
-
export class FS extends Feature {
|
|
39
|
-
static override shortcut = "features.fs" as const
|
|
40
|
-
static override stateSchema = FeatureStateSchema
|
|
41
|
-
static override optionsSchema = FeatureOptionsSchema
|
|
42
|
-
|
|
43
|
-
// ... methods ...
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export default features.register("fs", FS)
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
And for extension features (AGI, etc), there's the `attach` pattern:
|
|
50
|
-
|
|
51
|
-
```typescript
|
|
52
|
-
export class Assistant extends Feature<AssistantState, AssistantOptions> {
|
|
53
|
-
static attach(container: Container<AvailableFeatures, any>) {
|
|
54
|
-
features.register('assistant', Assistant)
|
|
55
|
-
return container
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export default features.register('assistant', Assistant)
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
The registration is always a separate, imperative call disconnected from the class definition itself. The class doesn't know it's been registered. The registry doesn't know until that line runs.
|
|
63
|
-
|
|
64
|
-
## The Static Block Approach
|
|
65
|
-
|
|
66
|
-
ES2022 static initialization blocks let code run at **class definition time**, inside the class body. This is JavaScript's closest equivalent to Ruby's `inherited`:
|
|
67
|
-
|
|
68
|
-
```typescript
|
|
69
|
-
class Feature {
|
|
70
|
-
static registry: Registry
|
|
71
|
-
|
|
72
|
-
// This is our "inherited" hook
|
|
73
|
-
static __initSubclass(SubClass: typeof Feature, id: string) {
|
|
74
|
-
this.registry.register(id, SubClass)
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### What it could look like for authors
|
|
80
|
-
|
|
81
|
-
```typescript
|
|
82
|
-
// The dream: define, register, and export in one declaration
|
|
83
|
-
export default class FS extends Feature {
|
|
84
|
-
static {
|
|
85
|
-
Feature.register(this, "fs")
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
static override shortcut = "features.fs" as const
|
|
89
|
-
static override stateSchema = FeatureStateSchema
|
|
90
|
-
static override optionsSchema = FeatureOptionsSchema
|
|
91
|
-
|
|
92
|
-
async readFile(path: string) { /* ... */ }
|
|
93
|
-
}
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
No trailing `features.register()` call. No disconnect between the class and its registration. The class **declares itself** as a registered member of the system.
|
|
97
|
-
|
|
98
|
-
### The id could be derived from convention
|
|
99
|
-
|
|
100
|
-
If we adopt a naming convention (like ActiveRecord derives table names from class names), we could eliminate the explicit id entirely:
|
|
101
|
-
|
|
102
|
-
```typescript
|
|
103
|
-
export default class DiskCache extends Feature {
|
|
104
|
-
static {
|
|
105
|
-
Feature.register(this) // id inferred as "diskCache" from class name
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
The `register` implementation:
|
|
111
|
-
|
|
112
|
-
```typescript
|
|
113
|
-
class Feature {
|
|
114
|
-
static register(SubClass: typeof Feature, id?: string) {
|
|
115
|
-
// Convention: PascalCase class name -> camelCase registry id
|
|
116
|
-
const registryId = id ?? SubClass.name[0].toLowerCase() + SubClass.name.slice(1)
|
|
117
|
-
features.register(registryId, SubClass)
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
## Going Further: The Base Class Does All The Work
|
|
123
|
-
|
|
124
|
-
What if the base classes (`Feature`, `Client`, `Server`) provided a static `register` that also handled module augmentation hints and the `attach` pattern?
|
|
125
|
-
|
|
126
|
-
```typescript
|
|
127
|
-
// Before: 15+ lines of boilerplate per feature
|
|
128
|
-
import { z } from 'zod'
|
|
129
|
-
import { features, Feature } from '@soederpop/luca/feature'
|
|
130
|
-
import type { AvailableFeatures } from '@soederpop/luca/feature'
|
|
131
|
-
|
|
132
|
-
declare module '@soederpop/luca/feature' {
|
|
133
|
-
interface AvailableFeatures {
|
|
134
|
-
conversation: typeof Conversation
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export class Conversation extends Feature<ConversationState, ConversationOptions> {
|
|
139
|
-
static override shortcut = 'features.conversation' as const
|
|
140
|
-
static attach(container: Container<AvailableFeatures, any>) {
|
|
141
|
-
features.register('conversation', Conversation)
|
|
142
|
-
return container
|
|
143
|
-
}
|
|
144
|
-
// ...
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export default features.register('conversation', Conversation)
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
```typescript
|
|
151
|
-
// After: the class IS the registration
|
|
152
|
-
import { Feature } from '@soederpop/luca/feature'
|
|
153
|
-
|
|
154
|
-
export default class Conversation extends Feature<ConversationState, ConversationOptions> {
|
|
155
|
-
static {
|
|
156
|
-
Feature.register(this, 'conversation')
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// shortcut derived automatically from registry + id
|
|
160
|
-
// attach() provided by base class using the registered id
|
|
161
|
-
// ...
|
|
162
|
-
}
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
The base `Feature.register()` could:
|
|
166
|
-
1. Call `features.register(id, SubClass)`
|
|
167
|
-
2. Set `SubClass.shortcut` automatically (`features.${id}`)
|
|
168
|
-
3. Generate a default `attach()` that registers and returns the container
|
|
169
|
-
4. Emit a `"subclass:registered"` event on the registry for any other wiring
|
|
170
|
-
|
|
171
|
-
## Comparison With Other Approaches
|
|
172
|
-
|
|
173
|
-
| Approach | When it runs | Cooperation needed | Ceremony |
|
|
174
|
-
|----------|-------------|-------------------|----------|
|
|
175
|
-
| Ruby `inherited` | Class definition | None | Zero — just `extends` |
|
|
176
|
-
| Static block + `register` | Class definition | One line in static block | Minimal — inside the class |
|
|
177
|
-
| Trailing `registry.register()` | Module evaluation | Separate call after class | Moderate — disconnected |
|
|
178
|
-
| `defineFeature()` factory | Module evaluation | Wrap entire definition | Different paradigm entirely |
|
|
179
|
-
| Decorators (`@tracked`) | Class definition | One line above class | Minimal — but external |
|
|
180
|
-
|
|
181
|
-
The static block approach is the sweet spot for Luca: it's **standard JavaScript**, runs at **definition time**, lives **inside the class body**, and keeps the class as the primary authoring unit (unlike `defineFeature()` which replaces the class with a factory call).
|
|
182
|
-
|
|
183
|
-
## The `defineFeature` Relationship
|
|
184
|
-
|
|
185
|
-
This is complementary to the [`defineFeature()` idea](./luca-feature-authoring-dx.md), not a replacement. They solve different problems:
|
|
186
|
-
|
|
187
|
-
- **`defineFeature()`** reduces boilerplate for simple features that are mostly a bag of methods — you skip writing a class entirely
|
|
188
|
-
- **Static block registration** reduces boilerplate for full class-based helpers — you still write the class, but registration is self-contained
|
|
189
|
-
|
|
190
|
-
For complex features that need class inheritance, lifecycle hooks, and full OOP — the static block pattern is cleaner. For simple features that are essentially a named collection of functions — `defineFeature()` is cleaner.
|
|
191
|
-
|
|
192
|
-
## Open Questions
|
|
193
|
-
|
|
194
|
-
- **Registry detection**: Can `Feature.register(this)` figure out which registry to use automatically? The base class (`Feature` vs `Client` vs `Server`) already implies it. A shared `Helper.register(this)` could dispatch to the right registry.
|
|
195
|
-
- **Module augmentation**: The `declare module` blocks for TypeScript are the remaining boilerplate that can't be eliminated by runtime mechanics. Could a codegen step or a TS plugin handle this?
|
|
196
|
-
- **Import side effects**: Today, importing a feature file triggers registration. With static blocks, this is still true — but the registration is more visible and intentional. Is there value in making registration lazy or explicit via `container.use()`?
|
|
197
|
-
- **`attach()` consolidation**: Many `attach()` methods just call `register()` and return the container. If `Feature.register()` generates a default `attach()`, do we still need custom ones? The ones that do more (like wiring up other features) would still override.
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# COntainer `.use()` API
|
|
2
|
-
|
|
3
|
-
Can we find a way to support using dynamic imports
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
container.use(import("whatever))
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
these are promises, but the expectation is the default has an attach method. if not, any function or class they export which has an attach property
|
|
File without changes
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Feature Stacks
|
|
2
|
-
|
|
3
|
-
The number of features in the node container is getting a little absurd.
|
|
4
|
-
|
|
5
|
-
We have the `container.use` API. We can bundle / group features like the google related ones into their own folder's and start to build on our plugin / layers concept
|
|
6
|
-
|
|
7
|
-
The startup time for the luca cli is getting slower and I'm wondering if it is all of these features causing it.
|
|
8
|
-
|
|
9
|
-
## Group features into folders
|
|
10
|
-
|
|
11
|
-
- don't autoload all of them, let's make it trivial like to load these features into scripts or commands
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
import container from '@soederpop/luca/agi'
|
|
15
|
-
import GoogleFeatures from '@soederpop/luca/features/google'
|
|
16
|
-
|
|
17
|
-
container.use(GoogleFeatures)
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Feature Marketplace ( long term )
|
|
21
|
-
|
|
22
|
-
Long term as I'm the only one using this shit, but the ability to publish a server that other containers could load features from is cool. We have all the pieces on the frontend ( asset loader ) to go from a blankpage to a fully functional SPA
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Luca CLI Self Sufficiency Demo
|
|
2
|
-
|
|
3
|
-
With the `luca` cli you can have a project folder like:
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
- public/
|
|
7
|
-
- index.html
|
|
8
|
-
- commands/
|
|
9
|
-
- setup-db.ts
|
|
10
|
-
- endpoints/
|
|
11
|
-
- health.ts
|
|
12
|
-
- docs/
|
|
13
|
-
- models.ts
|
|
14
|
-
- luca.cli.ts
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
This should work without there necessarily being a `node_modules` folder here, because each of these things are loaded by luca, transpiled, and run through the VM.
|
|
18
|
-
|
|
19
|
-
Even the `contentDb` feature which depends on contentbase should work here.
|
|
20
|
-
|
|
21
|
-
This is what I mean by luca being a dependency injection framework.
|
|
22
|
-
|
|
23
|
-
The only downside of this is - how do we provide type support without them installing '@soederpop/luca'
|
package/docs/ideas/mcp-design.md
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# MCP Design
|
|
2
|
-
|
|
3
|
-
I have a hunch that the best way to get coding assistants to be aware of our MCP is to have as verbose of tool descriptions as the spec allows, as this seems to be the primary form of guidance.
|
|
4
|
-
|
|
5
|
-
One neat trick I learned from the excalidraw and other mcps is to have a tool_call called read_me, which we can probably really tune the tool description for, to make sure it gets called as early on as possible by the MCP, and as a way to further refine how it understands to use tool calls.
|
|
6
|
-
|
|
7
|
-
## Current State
|
|
8
|
-
|
|
9
|
-
We've got a `luca sandbox-mcp` command in this project which can be used to eval snippets of code inside the luca vm, as well as some other tools. Claude code consistently fails to use them, however.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Web Container Debugging Feature
|
|
2
|
-
|
|
3
|
-
How cool would it be if, from an application that uses WebContainer, we had a client side feature called `serverPlug`
|
|
4
|
-
|
|
5
|
-
The `serverPlug` would `connect` to a remote server over an API endpoint, to register itself, with info about the url it is on, its container's uuid. The server would respond with a websocket url and other necessary info.
|
|
6
|
-
|
|
7
|
-
On the server side `NodeContainer` there's server side `serverPlug` feature which can act as a host, that accepts registrations. It spawns its own websocket server to handle communication.
|
|
8
|
-
|
|
9
|
-
From server side code, I can connect to any individual web container instance, and eval code inside its vm.
|
|
10
|
-
|
|
11
|
-
We need to think about auth, disconnection events, heartbeats, etc
|
|
12
|
-
|
|
13
|
-
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { AsciiAnimation } from './types'
|
|
2
|
-
|
|
3
|
-
const frames = [
|
|
4
|
-
String.raw`
|
|
5
|
-
###### ###### ########
|
|
6
|
-
## ## ## ## ##
|
|
7
|
-
###### ## ## ##
|
|
8
|
-
## ## ## ## ##
|
|
9
|
-
## ## ###### ##
|
|
10
|
-
## ## ###### ##
|
|
11
|
-
|
|
12
|
-
[o_o] channel-open
|
|
13
|
-
/|\ packet-sync
|
|
14
|
-
/ \ pulse: 71%
|
|
15
|
-
|
|
16
|
-
<<..................>>
|
|
17
|
-
`,
|
|
18
|
-
String.raw`
|
|
19
|
-
###### ###### ########
|
|
20
|
-
## ## ## ## ##
|
|
21
|
-
###### ## ## ##
|
|
22
|
-
## ## ## ## ##
|
|
23
|
-
## ## ###### ##
|
|
24
|
-
## ## ###### ##
|
|
25
|
-
|
|
26
|
-
[0_0] channel-open
|
|
27
|
-
/|\ packet-sync
|
|
28
|
-
/ \ pulse: 84%
|
|
29
|
-
|
|
30
|
-
<<##..##..##..##..##..>>
|
|
31
|
-
`,
|
|
32
|
-
String.raw`
|
|
33
|
-
###### ###### ########
|
|
34
|
-
## ## ## ## ##
|
|
35
|
-
###### ## ## ##
|
|
36
|
-
## ## ## ## ##
|
|
37
|
-
## ## ###### ##
|
|
38
|
-
## ## ###### ##
|
|
39
|
-
|
|
40
|
-
[O_O] channel-open
|
|
41
|
-
/|\ packet-sync
|
|
42
|
-
/ \ pulse: 96%
|
|
43
|
-
|
|
44
|
-
<<##################>>
|
|
45
|
-
`,
|
|
46
|
-
]
|
|
47
|
-
|
|
48
|
-
const chromeGlitch: AsciiAnimation = {
|
|
49
|
-
id: 'chromeGlitch',
|
|
50
|
-
name: 'Chrome Glitch Totem',
|
|
51
|
-
fps: 5,
|
|
52
|
-
frames,
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export default chromeGlitch
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { AsciiAnimation } from './types'
|
|
2
|
-
import neonPulse from './neon-pulse'
|
|
3
|
-
import chromeGlitch from './chrome-glitch'
|
|
4
|
-
|
|
5
|
-
const animations: AsciiAnimation[] = [neonPulse, chromeGlitch]
|
|
6
|
-
|
|
7
|
-
export function listAnimations(): AsciiAnimation[] {
|
|
8
|
-
return animations
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function resolveAnimation(id: string): AsciiAnimation {
|
|
12
|
-
const match = animations.find((animation) => animation.id.toLowerCase() === id.toLowerCase())
|
|
13
|
-
if (match) return match
|
|
14
|
-
if (!animations[0]) throw new Error('No animations are registered.')
|
|
15
|
-
return animations[0]
|
|
16
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { AsciiAnimation } from './types'
|
|
2
|
-
|
|
3
|
-
const frames = [
|
|
4
|
-
String.raw`
|
|
5
|
-
.-""-.
|
|
6
|
-
.' .--. '.
|
|
7
|
-
/ / \ \
|
|
8
|
-
| | 0 0 | |
|
|
9
|
-
| | __ | |
|
|
10
|
-
| | /__\ | |
|
|
11
|
-
| | \__/ | |
|
|
12
|
-
| | | |
|
|
13
|
-
/| '.__.' |\
|
|
14
|
-
.' | /::\ | '.
|
|
15
|
-
/ | |::::| | \
|
|
16
|
-
/____|__|::::|__|____\
|
|
17
|
-
/_/ |::| \_\
|
|
18
|
-
/____\
|
|
19
|
-
~ ~ ~ SIGNAL: STABLE ~ ~ ~
|
|
20
|
-
`,
|
|
21
|
-
String.raw`
|
|
22
|
-
.-""-.
|
|
23
|
-
.' .--. '.
|
|
24
|
-
/ / /\ \ \
|
|
25
|
-
| | ^ ^ | |
|
|
26
|
-
| | -- | |
|
|
27
|
-
| | /__\ | |
|
|
28
|
-
| | \__/ | |
|
|
29
|
-
| | /\ | |
|
|
30
|
-
/| '.__.' |\
|
|
31
|
-
.' | _/::\_ | '.
|
|
32
|
-
/ | |::::::| | \
|
|
33
|
-
/____|_|::::::|_|____\
|
|
34
|
-
/_/ |::| \_\
|
|
35
|
-
/____\
|
|
36
|
-
~ ~ ~ SIGNAL: BREATHING ~ ~ ~
|
|
37
|
-
`,
|
|
38
|
-
String.raw`
|
|
39
|
-
.-""-.
|
|
40
|
-
.' .--. '.
|
|
41
|
-
/ / __ \ \
|
|
42
|
-
| | o o | |
|
|
43
|
-
| | .. | |
|
|
44
|
-
| | /__\ | |
|
|
45
|
-
| | \__/ | |
|
|
46
|
-
| | .--. | |
|
|
47
|
-
/| '.__.' |\
|
|
48
|
-
.' | /::\ | '.
|
|
49
|
-
/ | |::::| | \
|
|
50
|
-
/____|__|::::|__|____\
|
|
51
|
-
/_/ |::| \_\
|
|
52
|
-
/____\
|
|
53
|
-
~ ~ ~ SIGNAL: SCANNING ~ ~ ~
|
|
54
|
-
`,
|
|
55
|
-
]
|
|
56
|
-
|
|
57
|
-
const neonPulse: AsciiAnimation = {
|
|
58
|
-
id: 'neonPulse',
|
|
59
|
-
name: 'Neon Pulse Bot',
|
|
60
|
-
fps: 4,
|
|
61
|
-
frames,
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export default neonPulse
|