1tube 0.1.53 → 0.2.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/.env.example +27 -27
- package/LICENSE +21 -21
- package/README.md +6 -6
- package/dist/edge.js +10 -3
- package/drizzle/20260610161429_init_logs/migration.sql +29 -29
- package/drizzle/20260610161429_init_logs/snapshot.json +305 -305
- package/drizzle/20260610161430_logs_fts/migration.sql +25 -25
- package/drizzle/20260610161430_logs_fts/snapshot.json +305 -305
- package/eslint-plugin.js +275 -275
- package/package.json +80 -70
- package/scripts/npm-cli.js +151 -150
- package/src/backends/bun/dep-graph.ts +310 -0
- package/src/backends/bun/function-host.ts +1190 -0
- package/src/backends/bun/hot-reloader.ts +385 -0
- package/src/backends/bun/shared-runtime.ts +176 -0
- package/src/backends/env-hot-reloader.ts +171 -170
- package/src/backends/vercel/bundle-profile.ts +162 -159
- package/src/backends/vercel/capture-config.ts +212 -122
- package/src/backends/vercel/wrapper.ts +361 -332
- package/src/backends/workerd/backend.ts +2148 -2112
- package/src/backends/workerd/bundle-profile.ts +246 -246
- package/src/backends/workerd/capnp.ts +413 -413
- package/src/backends/workerd/hot-reloader.ts +347 -347
- package/src/backends/workerd/prebuilt.ts +206 -206
- package/src/backends/workerd/proc-stats.ts +159 -147
- package/src/backends/workerd/process.ts +584 -570
- package/src/backends/workerd/runtime-overrides.ts +767 -756
- package/src/backends/workerd/shared-runtime.ts +147 -104
- package/src/backends/workerd/watchdog.ts +282 -282
- package/src/boot-progress.ts +234 -230
- package/src/bundler/core.ts +968 -867
- package/src/bundler/profile.ts +77 -77
- package/src/cli/build.ts +755 -792
- package/src/cli/deno-config.ts +74 -83
- package/src/cli/envelope.ts +283 -283
- package/src/cli/package.ts +729 -719
- package/src/cli/vercel-build.ts +808 -692
- package/src/cli.ts +12 -12
- package/src/compat/deno-shim.ts +540 -0
- package/src/compat/deps.ts +359 -0
- package/src/compat/environment.ts +65 -0
- package/src/compat/esbuild-plugin.ts +109 -0
- package/src/compat/globals.ts +158 -0
- package/src/compat/import-map.ts +183 -0
- package/src/compat/plugin.ts +416 -0
- package/src/compat/remote.ts +145 -0
- package/src/compat/shared-deps.ts +178 -0
- package/src/compat/specifiers.ts +103 -0
- package/src/discovery.ts +216 -217
- package/src/edge-caller.ts +141 -141
- package/src/edge.ts +985 -976
- package/src/env-file.ts +266 -254
- package/src/firmware-content-hash.ts +193 -192
- package/src/fs-watch.ts +78 -0
- package/src/gateway/auth.ts +291 -291
- package/src/gateway/body-watchdog.ts +153 -153
- package/src/gateway/cors.ts +249 -245
- package/src/gateway/logging.ts +396 -396
- package/src/gateway/rate-limit.ts +189 -189
- package/src/gateway/route-prefix.ts +83 -83
- package/src/health.ts +156 -156
- package/src/launch.ts +369 -685
- package/src/log-buffer.ts +159 -158
- package/src/logs/api.ts +137 -137
- package/src/logs/console-marker.ts +54 -54
- package/src/logs/db.ts +85 -85
- package/src/logs/id.ts +33 -33
- package/src/logs/query.ts +398 -398
- package/src/logs/schema.ts +90 -90
- package/src/logs/writer.ts +390 -390
- package/src/manifest.ts +225 -226
- package/src/registry.ts +404 -367
- package/src/server.ts +2650 -2756
- package/src/stdio.ts +37 -0
- package/src/supervisor.ts +184 -184
- package/src/types/bun-module-graph.d.ts +26 -0
- package/src/version.ts +15 -16
- package/src/warmup-client.ts +159 -159
- package/tsconfig.json +17 -0
- package/deno.json +0 -38
- package/deno.lock +0 -572
- package/src/backends/deno/dep-graph.ts +0 -404
- package/src/backends/deno/hot-reloader.ts +0 -471
- package/src/backends/deno/shared-runtime.ts +0 -218
- package/src/backends/deno/source-rewriter.ts +0 -637
- package/src/backends/deno/worker-entry-colocated.ts +0 -406
- package/src/backends/deno/worker-entry.ts +0 -375
- package/src/backends/deno/worker-host.ts +0 -2166
- package/src/cli/dep-pin.ts +0 -126
- package/src/env-scope.ts +0 -124
package/.env.example
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
# Supabase connection (required)
|
|
2
|
-
SUPABASE_URL=http://127.0.0.1:54321
|
|
3
|
-
SUPABASE_SERVICE_ROLE_KEY=
|
|
4
|
-
|
|
5
|
-
# JWT secret -- must match the Supabase JWT secret for RLS compatibility
|
|
6
|
-
JWT_SECRET=super-secret-jwt-token-with-at-least-32-characters-long
|
|
7
|
-
|
|
8
|
-
# ScioBot / priprava backend
|
|
9
|
-
SCIOBOT_URL=http://localhost:44298
|
|
10
|
-
SCIOBOT_KEY=
|
|
11
|
-
|
|
12
|
-
# AI providers
|
|
13
|
-
GOOGLE_API_KEY=
|
|
14
|
-
OPENAI_API_KEY=
|
|
15
|
-
ELEVENLABS_API_KEY=
|
|
16
|
-
TAVILY_API_KEY=
|
|
17
|
-
|
|
18
|
-
# Gateway config
|
|
19
|
-
PORT=3100
|
|
20
|
-
FUNCTIONS_PATH=../sciobot-next/supabase/functions
|
|
21
|
-
# INTERNAL_KEY=00000000-0000-0000-0000-000000000000 # optional, random GUID is fine
|
|
22
|
-
|
|
23
|
-
# Optional: Sentry error tracking
|
|
24
|
-
# SENTRY_DSN=
|
|
25
|
-
|
|
26
|
-
# Optional: log function invocations to Supabase table
|
|
27
|
-
# LOG_TO_DB=true
|
|
1
|
+
# Supabase connection (required)
|
|
2
|
+
SUPABASE_URL=http://127.0.0.1:54321
|
|
3
|
+
SUPABASE_SERVICE_ROLE_KEY=
|
|
4
|
+
|
|
5
|
+
# JWT secret -- must match the Supabase JWT secret for RLS compatibility
|
|
6
|
+
JWT_SECRET=super-secret-jwt-token-with-at-least-32-characters-long
|
|
7
|
+
|
|
8
|
+
# ScioBot / priprava backend
|
|
9
|
+
SCIOBOT_URL=http://localhost:44298
|
|
10
|
+
SCIOBOT_KEY=
|
|
11
|
+
|
|
12
|
+
# AI providers
|
|
13
|
+
GOOGLE_API_KEY=
|
|
14
|
+
OPENAI_API_KEY=
|
|
15
|
+
ELEVENLABS_API_KEY=
|
|
16
|
+
TAVILY_API_KEY=
|
|
17
|
+
|
|
18
|
+
# Gateway config
|
|
19
|
+
PORT=3100
|
|
20
|
+
FUNCTIONS_PATH=../sciobot-next/supabase/functions
|
|
21
|
+
# INTERNAL_KEY=00000000-0000-0000-0000-000000000000 # optional, random GUID is fine
|
|
22
|
+
|
|
23
|
+
# Optional: Sentry error tracking
|
|
24
|
+
# SENTRY_DSN=
|
|
25
|
+
|
|
26
|
+
# Optional: log function invocations to Supabase table
|
|
27
|
+
# LOG_TO_DB=true
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Matěj Štágl
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matěj Štágl
|
|
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-

|
|
2
|
-

|
|
3
|
-
|
|
4
|
-
# 1tube
|
|
5
|
-
|
|
6
|
-
🕯☽ Black magic. ☾🕯
|
|
1
|
+

|
|
2
|
+

|
|
3
|
+
|
|
4
|
+
# 1tube
|
|
5
|
+
|
|
6
|
+
🕯☽ Black magic. ☾🕯
|
package/dist/edge.js
CHANGED
|
@@ -152,9 +152,16 @@ export function normalizeRateLimit(rl) {
|
|
|
152
152
|
export function getStandaloneServe() {
|
|
153
153
|
const runtime = globalThis;
|
|
154
154
|
const standaloneServe = runtime.Deno?.serve;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
if (typeof standaloneServe === "function")
|
|
156
|
+
return standaloneServe.bind(runtime.Deno);
|
|
157
|
+
// `bun supabase/functions/<name>/index.ts` outside the gateway.
|
|
158
|
+
const bunServe = runtime.Bun?.serve;
|
|
159
|
+
if (typeof bunServe === "function") {
|
|
160
|
+
return (handler) => {
|
|
161
|
+
bunServe.call(runtime.Bun, { fetch: handler });
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
158
165
|
}
|
|
159
166
|
export function normalizeRoutePath(path) {
|
|
160
167
|
const trimmed = path.trim();
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
CREATE TABLE `invocations` (
|
|
2
|
-
`id` text PRIMARY KEY,
|
|
3
|
-
`ts_ms` integer NOT NULL,
|
|
4
|
-
`function_name` text NOT NULL,
|
|
5
|
-
`method` text NOT NULL,
|
|
6
|
-
`path` text NOT NULL,
|
|
7
|
-
`status` integer NOT NULL,
|
|
8
|
-
`duration_ms` integer NOT NULL,
|
|
9
|
-
`user_id` text,
|
|
10
|
-
`backend` text NOT NULL,
|
|
11
|
-
`error_kind` text,
|
|
12
|
-
`error_message` text,
|
|
13
|
-
`error_stack` text
|
|
14
|
-
);
|
|
15
|
-
--> statement-breakpoint
|
|
16
|
-
CREATE TABLE `logs` (
|
|
17
|
-
`id` integer PRIMARY KEY AUTOINCREMENT,
|
|
18
|
-
`invocation_id` text,
|
|
19
|
-
`ts_ms` integer NOT NULL,
|
|
20
|
-
`level` text NOT NULL,
|
|
21
|
-
`function_name` text,
|
|
22
|
-
`source` text DEFAULT 'function' NOT NULL,
|
|
23
|
-
`message` text NOT NULL
|
|
24
|
-
);
|
|
25
|
-
--> statement-breakpoint
|
|
26
|
-
CREATE INDEX `idx_invocations_ts` ON `invocations` (`ts_ms`);--> statement-breakpoint
|
|
27
|
-
CREATE INDEX `idx_invocations_fn_ts` ON `invocations` (`function_name`,`ts_ms`);--> statement-breakpoint
|
|
28
|
-
CREATE INDEX `idx_invocations_status_ts` ON `invocations` (`status`,`ts_ms`);--> statement-breakpoint
|
|
29
|
-
CREATE INDEX `idx_logs_invocation` ON `logs` (`invocation_id`);--> statement-breakpoint
|
|
1
|
+
CREATE TABLE `invocations` (
|
|
2
|
+
`id` text PRIMARY KEY,
|
|
3
|
+
`ts_ms` integer NOT NULL,
|
|
4
|
+
`function_name` text NOT NULL,
|
|
5
|
+
`method` text NOT NULL,
|
|
6
|
+
`path` text NOT NULL,
|
|
7
|
+
`status` integer NOT NULL,
|
|
8
|
+
`duration_ms` integer NOT NULL,
|
|
9
|
+
`user_id` text,
|
|
10
|
+
`backend` text NOT NULL,
|
|
11
|
+
`error_kind` text,
|
|
12
|
+
`error_message` text,
|
|
13
|
+
`error_stack` text
|
|
14
|
+
);
|
|
15
|
+
--> statement-breakpoint
|
|
16
|
+
CREATE TABLE `logs` (
|
|
17
|
+
`id` integer PRIMARY KEY AUTOINCREMENT,
|
|
18
|
+
`invocation_id` text,
|
|
19
|
+
`ts_ms` integer NOT NULL,
|
|
20
|
+
`level` text NOT NULL,
|
|
21
|
+
`function_name` text,
|
|
22
|
+
`source` text DEFAULT 'function' NOT NULL,
|
|
23
|
+
`message` text NOT NULL
|
|
24
|
+
);
|
|
25
|
+
--> statement-breakpoint
|
|
26
|
+
CREATE INDEX `idx_invocations_ts` ON `invocations` (`ts_ms`);--> statement-breakpoint
|
|
27
|
+
CREATE INDEX `idx_invocations_fn_ts` ON `invocations` (`function_name`,`ts_ms`);--> statement-breakpoint
|
|
28
|
+
CREATE INDEX `idx_invocations_status_ts` ON `invocations` (`status`,`ts_ms`);--> statement-breakpoint
|
|
29
|
+
CREATE INDEX `idx_logs_invocation` ON `logs` (`invocation_id`);--> statement-breakpoint
|
|
30
30
|
CREATE INDEX `idx_logs_ts` ON `logs` (`ts_ms`);
|