@tsconfigdotjson/vibe-os 0.0.0-stage → 0.2.0-rc.1

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.
Files changed (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +988 -2
  3. package/THIRD_PARTY_NOTICES.md +2467 -0
  4. package/bin/vibe-os.mjs +13 -0
  5. package/dist/web/apple-touch-icon.png +0 -0
  6. package/dist/web/assets/index-B77Qk8B5.js +35 -0
  7. package/dist/web/assets/index-B77Qk8B5.js.br +0 -0
  8. package/dist/web/assets/index-B77Qk8B5.js.gz +0 -0
  9. package/dist/web/assets/index-CH5Em-Mo.css +1 -0
  10. package/dist/web/assets/index-CH5Em-Mo.css.br +0 -0
  11. package/dist/web/assets/index-CH5Em-Mo.css.gz +0 -0
  12. package/dist/web/icon-192.png +0 -0
  13. package/dist/web/icon-512.png +0 -0
  14. package/dist/web/icon-app.svg +19 -0
  15. package/dist/web/icon-maskable-512.png +0 -0
  16. package/dist/web/icon-maskable.svg +13 -0
  17. package/dist/web/icon.svg +15 -0
  18. package/dist/web/index.html +36 -0
  19. package/dist/web/ssh.wasm +0 -0
  20. package/dist/web/ssh.wasm.br +0 -0
  21. package/dist/web/ssh.wasm.gz +0 -0
  22. package/dist/web/sw.js +29 -0
  23. package/dist/web/wasm_exec.js +575 -0
  24. package/dist/web/wasm_exec.js.br +0 -0
  25. package/dist/web/wasm_exec.js.gz +0 -0
  26. package/package.json +82 -4
  27. package/scripts/compile.ts +62 -0
  28. package/scripts/compress.mjs +54 -0
  29. package/scripts/fetch-wasm.mjs +242 -0
  30. package/scripts/gen-assets.ts +76 -0
  31. package/scripts/lib/walk.ts +18 -0
  32. package/scripts/notices.ts +189 -0
  33. package/server/acme.ts +182 -0
  34. package/server/api.ts +515 -0
  35. package/server/assets.generated.ts +53 -0
  36. package/server/attach.ts +524 -0
  37. package/server/auth.ts +194 -0
  38. package/server/bridge.ts +145 -0
  39. package/server/browser.ts +519 -0
  40. package/server/cli.ts +857 -0
  41. package/server/config.ts +385 -0
  42. package/server/db.ts +262 -0
  43. package/server/doctor.ts +977 -0
  44. package/server/fsx.ts +88 -0
  45. package/server/harness.ts +655 -0
  46. package/server/http.ts +53 -0
  47. package/server/index.ts +469 -0
  48. package/server/log.ts +40 -0
  49. package/server/main.ts +7 -0
  50. package/server/mcp.ts +291 -0
  51. package/server/preflight.ts +87 -0
  52. package/server/profiles.ts +238 -0
  53. package/server/projects.ts +721 -0
  54. package/server/reaper.ts +303 -0
  55. package/server/runtime.ts +64 -0
  56. package/server/session.ts +330 -0
  57. package/server/setup.ts +1151 -0
  58. package/server/ssh-ca.ts +368 -0
  59. package/server/static.ts +147 -0
  60. package/server/wallpapers.ts +248 -0
  61. package/server/windows.ts +237 -0
  62. package/shared/args.ts +91 -0
  63. package/shared/grid.ts +32 -0
  64. package/shared/wire.ts +226 -0
package/shared/wire.ts ADDED
@@ -0,0 +1,226 @@
1
+ /**
2
+ * The shapes that cross the HTTP boundary, declared once.
3
+ *
4
+ * Every one of these used to exist twice — once in `server/`, once in `src/` —
5
+ * kept in step by hand and by comments that said "mirrors the other one". That
6
+ * held until it didn't: `ProfileInput` grew a `position` field on the server
7
+ * that the client's copy never got, which quietly made profile reordering
8
+ * unreachable from the only client there is.
9
+ *
10
+ * Types only, deliberately. Every import of this file is an `import type` and
11
+ * erases at build time, so nothing here has to be packaged, compiled into the
12
+ * standalone binary, or resolved at runtime by either side. Runtime values that
13
+ * happen to describe the same things — `PALETTE`, `HARNESSES` — stay in
14
+ * `server/profiles.ts`, where they are used, and are shipped to the browser as
15
+ * data on `ClientConfig` rather than duplicated as a second literal.
16
+ */
17
+
18
+ /** Which program a profile launches. */
19
+ export type Harness = "claude" | "hermes" | "cursor" | "shell" | "custom";
20
+
21
+ /** Whether a window has been handed off to a real terminal. */
22
+ export type Handoff = "ssh" | null;
23
+
24
+ /** `GET /api/config` — everything the browser needs before it can draw. */
25
+ export interface ClientConfig {
26
+ version: string;
27
+ hostname: string;
28
+ user: string;
29
+ workspaceRoot: string;
30
+ /** Windows are dtach-backed and survive a reload. */
31
+ sessions: boolean;
32
+ authRequired: boolean;
33
+ /** WebSocket endpoint, relative to the page so it follows http/https. */
34
+ endpoint: { name: string; url: string };
35
+ /** Host key to pin, or null to fall back to trust-on-first-use. */
36
+ hostKey: string | null;
37
+ /**
38
+ * Computed server-side on purpose: the browser cannot do it on plain HTTP,
39
+ * where `crypto.subtle` is unavailable because the origin is not secure.
40
+ */
41
+ hostKeyFingerprint: string | null;
42
+ certificateEndpoint: string;
43
+ maxWallpaperBytes: number;
44
+ /** Window-chrome colour, so a tab matches the installed app. */
45
+ themeColor: string;
46
+ /** Colour tokens a profile may use; `--profile-<token>` resolves each one. */
47
+ palette: readonly string[];
48
+ }
49
+
50
+ /** `GET /api/harness/claude` — what the installed Claude CLI accepts. */
51
+ export interface HarnessInfo {
52
+ available: boolean;
53
+ version: string | null;
54
+ /**
55
+ * Aliases like `opus`, which always resolve to the newest model of that tier.
56
+ *
57
+ * These are the right default for a profile precisely because they do not
58
+ * pin: a role called "Backend Manager" wants the best Opus, not the one that
59
+ * was current the day it was written.
60
+ */
61
+ aliases: string[];
62
+ /** Full model ids, for pinning a profile to one exact model. */
63
+ models: string[];
64
+ /** Values `--permission-mode` accepts. */
65
+ permissionModes: string[];
66
+ /** Values `--effort` accepts, weakest first — the order is the scale. */
67
+ effortLevels: string[];
68
+ }
69
+
70
+ /**
71
+ * Where Hermes' browser tools will land, and whether they will be the good ones.
72
+ *
73
+ * Hermes takes its CDP target from `browser.cdp_url` in `~/.hermes/config.yaml`
74
+ * and offers no per-invocation flag for it, so this is a property of the box
75
+ * rather than of a profile. The editor reads it to say which browser a role will
76
+ * drive instead of implying a choice it does not have.
77
+ */
78
+ export interface HermesBrowser {
79
+ /** `browser.cdp_url` as configured, or null when nothing is set. */
80
+ cdpUrl: string | null;
81
+ /** `browser.backend`, or null when unset, which means Browser Use mode. */
82
+ backend: string | null;
83
+ /** The port the installed Chrome unit actually opened, when there is one. */
84
+ cdpPort: number | null;
85
+ /** Whether `cdpUrl` names that port. False is the whole reason this exists. */
86
+ connected: boolean;
87
+ /**
88
+ * Whether the `browser-use` CLI could run, directly or through `uvx`.
89
+ *
90
+ * Without it Hermes quietly keeps its twelve built-in browser tools, which
91
+ * works but costs the token saving that Browser Use mode is for.
92
+ */
93
+ browserUse: boolean;
94
+ }
95
+
96
+ /** `GET /api/harness/hermes` — what the installed Hermes CLI is set up for. */
97
+ export interface HermesInfo {
98
+ available: boolean;
99
+ version: string | null;
100
+ /**
101
+ * Providers to offer in the datalist.
102
+ *
103
+ * A floor of the ones Hermes ships support for, merged with whatever its own
104
+ * config reports. `hermes model` is an interactive wizard with no listing
105
+ * mode, so unlike the Claude harness there is nothing authoritative to read.
106
+ */
107
+ providers: string[];
108
+ /** The provider `hermes chat` would use with no `--provider`, if readable. */
109
+ defaultProvider: string | null;
110
+ /** The model `hermes chat` would use with no `--model`, if readable. */
111
+ defaultModel: string | null;
112
+ /** Values `--reasoning` accepts, weakest first — the order is the scale. */
113
+ reasoningLevels: string[];
114
+ browser: HermesBrowser;
115
+ }
116
+
117
+ /** `GET /api/harness/cursor` — what the installed Cursor CLI is set up for. */
118
+ export interface CursorInfo {
119
+ available: boolean;
120
+ version: string | null;
121
+ /**
122
+ * Model ids `cursor-agent models` reports, in the order it printed them.
123
+ *
124
+ * Unlike Hermes, Cursor has a real listing mode — but the list is the
125
+ * account's, not the binary's: it needs a login and sometimes the network,
126
+ * so an empty list means "could not read", never "no models exist". The
127
+ * editor keeps the field free text with these as suggestions.
128
+ */
129
+ models: string[];
130
+ /** The model `models` marked as current, when it marked one. */
131
+ defaultModel: string | null;
132
+ /**
133
+ * Whether `cursor-agent status` says someone is logged in.
134
+ *
135
+ * Three-valued on purpose: null is "could not tell", which covers a status
136
+ * output this build cannot read as well as a command that failed to run.
137
+ * Only a definite false is worth warning about — a profile launched while
138
+ * logged out opens a window that sits at the login prompt.
139
+ */
140
+ loggedIn: boolean | null;
141
+ }
142
+
143
+ /**
144
+ * Where an MCP definition came from. `user` is machine-wide, `project` is the
145
+ * repo's `.mcp.json`, `local` is one directory.
146
+ */
147
+ export type McpScope = "user" | "project" | "local";
148
+
149
+ export interface McpServer {
150
+ /** The name Claude knows it by, and the key inside the generated file. */
151
+ name: string;
152
+ scope: McpScope;
153
+ /** The file or directory the definition came from, for the label. */
154
+ source: string;
155
+ /** `stdio`, `sse` or `http`. */
156
+ transport: string;
157
+ /** The URL, or the command it runs — enough to tell two servers apart. */
158
+ detail: string;
159
+ /** What a profile passes to `--mcp-config` to get exactly this one server. */
160
+ configPath: string;
161
+ }
162
+
163
+ export interface SshEndpoint {
164
+ user: string;
165
+ host: string;
166
+ port: number;
167
+ }
168
+
169
+ /** Everything the UI needs to offer an SSH handoff. */
170
+ export interface AttachInfo {
171
+ ref: string;
172
+ session: string;
173
+ cwd: string;
174
+ workspace: string;
175
+ project: string;
176
+ role: string | null;
177
+ endpoint: SshEndpoint;
178
+ /** The one command that gets you there. */
179
+ command: string;
180
+ }
181
+
182
+ export interface Wallpaper {
183
+ id: string;
184
+ name: string;
185
+ mime: string;
186
+ size: number;
187
+ }
188
+
189
+ export interface DesktopPrefs {
190
+ wallpaper: string | null;
191
+ fit: "cover" | "contain" | "tile";
192
+ /** 0…0.9 scrim over the wallpaper. Terminals have to stay readable. */
193
+ dim: number;
194
+ }
195
+
196
+ export interface Profile {
197
+ id: string;
198
+ projectId: string;
199
+ /** Palette token; `--profile-<color>` in the stylesheet resolves it. */
200
+ color: string;
201
+ name: string;
202
+ harness: Harness;
203
+ command: string | null;
204
+ /** argv tokens, already split and validated by the server. */
205
+ args: string[];
206
+ prompt: string;
207
+ position: number;
208
+ createdAt: number;
209
+ }
210
+
211
+ /**
212
+ * The write shape. Every field is optional because a PATCH may carry one.
213
+ *
214
+ * `args` is free text as typed in the editor, not the split array — the server
215
+ * is the only tokeniser, so the browser never has to agree with it about what
216
+ * a quote means.
217
+ */
218
+ export interface ProfileInput {
219
+ name?: string;
220
+ color?: string;
221
+ harness?: Harness;
222
+ command?: string | null;
223
+ args?: string;
224
+ prompt?: string;
225
+ position?: number;
226
+ }