@percher/core 0.4.28 → 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/LICENSE +132 -0
- package/dist/appstore-artifacts.d.ts +8 -0
- package/dist/appstore-artifacts.d.ts.map +1 -1
- package/dist/appstore-artifacts.js +11 -15
- package/dist/appstore-artifacts.js.map +1 -1
- package/dist/commands/account.d.ts +1 -1
- package/dist/commands/account.js +3 -3
- package/dist/commands/account.js.map +1 -1
- package/dist/commands/admin-legacy-audit.d.ts +40 -0
- package/dist/commands/admin-legacy-audit.d.ts.map +1 -0
- package/dist/commands/admin-legacy-audit.js +57 -0
- package/dist/commands/admin-legacy-audit.js.map +1 -0
- package/dist/commands/admin-legacy-inventory.d.ts +27 -0
- package/dist/commands/admin-legacy-inventory.d.ts.map +1 -0
- package/dist/commands/admin-legacy-inventory.js +37 -0
- package/dist/commands/admin-legacy-inventory.js.map +1 -0
- package/dist/commands/admin-migrate-networks.d.ts +15 -0
- package/dist/commands/admin-migrate-networks.d.ts.map +1 -0
- package/dist/commands/admin-migrate-networks.js +15 -0
- package/dist/commands/admin-migrate-networks.js.map +1 -0
- package/dist/commands/alerts.js.map +1 -1
- package/dist/commands/analytics.js.map +1 -1
- package/dist/commands/app-resources.d.ts +1 -1
- package/dist/commands/app-resources.js.map +1 -1
- package/dist/commands/app-topology.js.map +1 -1
- package/dist/commands/appstore-kit.d.ts +1 -1
- package/dist/commands/appstore-kit.js +1 -1
- package/dist/commands/appstore-kit.js.map +1 -1
- package/dist/commands/billing.d.ts +1 -1
- package/dist/commands/billing.js.map +1 -1
- package/dist/commands/cache.js.map +1 -1
- package/dist/commands/capabilities.js.map +1 -1
- package/dist/commands/claim.js.map +1 -1
- package/dist/commands/dashboard.js.map +1 -1
- package/dist/commands/data-export.d.ts.map +1 -1
- package/dist/commands/data-export.js +5 -4
- package/dist/commands/data-export.js.map +1 -1
- package/dist/commands/data-oauth.js.map +1 -1
- package/dist/commands/data.js.map +1 -1
- package/dist/commands/deploy-repo.js.map +1 -1
- package/dist/commands/deploys.js.map +1 -1
- package/dist/commands/diagnose.js.map +1 -1
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/doctor.d.ts +23 -4
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +58 -9
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/domains.js.map +1 -1
- package/dist/commands/env-scan.js.map +1 -1
- package/dist/commands/env.d.ts +3 -3
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/export.d.ts +1 -1
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/hooks.js.map +1 -1
- package/dist/commands/import-project.d.ts +1 -1
- package/dist/commands/import-project.js.map +1 -1
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/insights.d.ts +28 -0
- package/dist/commands/insights.d.ts.map +1 -1
- package/dist/commands/insights.js.map +1 -1
- package/dist/commands/inspect-link.d.ts +1 -1
- package/dist/commands/inspect-link.js.map +1 -1
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logs.d.ts +3 -3
- package/dist/commands/logs.js.map +1 -1
- package/dist/commands/mcp.d.ts +4 -4
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +28 -8
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/migrate-supabase-map.d.ts +1 -1
- package/dist/commands/migrate-supabase-map.js.map +1 -1
- package/dist/commands/migrate-supabase-schema.d.ts +4 -1
- package/dist/commands/migrate-supabase-schema.d.ts.map +1 -1
- package/dist/commands/migrate-supabase-schema.js +4 -1
- package/dist/commands/migrate-supabase-schema.js.map +1 -1
- package/dist/commands/migrate-supabase-scripts.d.ts.map +1 -1
- package/dist/commands/migrate-supabase-sdk.d.ts +1 -1
- package/dist/commands/migrate-supabase-sdk.js.map +1 -1
- package/dist/commands/migrate-supabase-status.js.map +1 -1
- package/dist/commands/migrate-supabase.d.ts +1 -1
- package/dist/commands/migrate-supabase.js +1 -1
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/preview-branch.js.map +1 -1
- package/dist/commands/publish-api-error.d.ts +12 -2
- package/dist/commands/publish-api-error.d.ts.map +1 -1
- package/dist/commands/publish-api-error.js +128 -5
- package/dist/commands/publish-api-error.js.map +1 -1
- package/dist/commands/publish-failure.d.ts.map +1 -1
- package/dist/commands/publish-failure.js +47 -32
- package/dist/commands/publish-failure.js.map +1 -1
- package/dist/commands/publish-inline.d.ts +1 -1
- package/dist/commands/publish-inline.js +1 -1
- package/dist/commands/publish.d.ts.map +1 -1
- package/dist/commands/publish.js +48 -10
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +11 -1
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/redeploy.js.map +1 -1
- package/dist/commands/reproduce.js.map +1 -1
- package/dist/commands/reset-superuser.js.map +1 -1
- package/dist/commands/restore.d.ts +1 -1
- package/dist/commands/restore.js.map +1 -1
- package/dist/commands/resume.js.map +1 -1
- package/dist/commands/rollback.d.ts +2 -1
- package/dist/commands/rollback.d.ts.map +1 -1
- package/dist/commands/rollback.js +74 -4
- package/dist/commands/rollback.js.map +1 -1
- package/dist/commands/sharing.js.map +1 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/token.d.ts +2 -2
- package/dist/commands/transfers.js.map +1 -1
- package/dist/commands/versions.d.ts +12 -0
- package/dist/commands/versions.d.ts.map +1 -1
- package/dist/commands/versions.js.map +1 -1
- package/dist/commands/wait-deploy.d.ts +1 -1
- package/dist/error-classifier.d.ts +1 -1
- package/dist/error-classifier.d.ts.map +1 -1
- package/dist/error-classifier.js +66 -0
- package/dist/error-classifier.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/event-renderer.d.ts.map +1 -1
- package/dist/event-renderer.js +12 -2
- package/dist/event-renderer.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/plans.d.ts +23 -1
- package/dist/plans.d.ts.map +1 -1
- package/dist/plans.js +26 -1
- package/dist/plans.js.map +1 -1
- package/dist/publish-retry.d.ts.map +1 -1
- package/dist/publish-retry.js +26 -1
- package/dist/publish-retry.js.map +1 -1
- package/dist/recovery.d.ts +25 -2
- package/dist/recovery.d.ts.map +1 -1
- package/dist/recovery.js +59 -4
- package/dist/recovery.js.map +1 -1
- package/dist/static-docker.d.ts +8 -13
- package/dist/static-docker.d.ts.map +1 -1
- package/dist/static-docker.js +38 -27
- package/dist/static-docker.js.map +1 -1
- package/dist/stream-utils.d.ts +9 -14
- package/dist/stream-utils.d.ts.map +1 -1
- package/dist/stream-utils.js +164 -0
- package/dist/stream-utils.js.map +1 -1
- package/dist/structured-error-codes.d.ts +1 -1
- package/dist/structured-error-codes.d.ts.map +1 -1
- package/dist/structured-error-codes.js +123 -0
- package/dist/structured-error-codes.js.map +1 -1
- package/dist/templates/ai-files/claude-md.d.ts.map +1 -1
- package/dist/templates/ai-files/claude-md.js +18 -1
- package/dist/templates/ai-files/claude-md.js.map +1 -1
- package/dist/templates/ai-files/cursor-percher-mdc.d.ts.map +1 -1
- package/dist/templates/ai-files/cursor-percher-mdc.js +18 -1
- package/dist/templates/ai-files/cursor-percher-mdc.js.map +1 -1
- package/dist/templates.js.map +1 -1
- package/dist/untrusted.js.map +1 -1
- package/package.json +9 -8
- package/templates/LICENSE +14 -0
- package/templates/astro/Caddyfile +6 -0
- package/templates/astro/Dockerfile +51 -0
- package/templates/astro/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/astro/astro.config.mjs +3 -0
- package/templates/astro/package.json +14 -0
- package/templates/astro/percher.toml +11 -0
- package/templates/astro/src/pages/index.astro +15 -0
- package/templates/bun/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/bun/index.ts +23 -0
- package/templates/bun/package.json +8 -0
- package/templates/bun/percher.toml +10 -0
- package/templates/capsule/Caddyfile +7 -0
- package/templates/capsule/Dockerfile +57 -0
- package/templates/capsule/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/capsule/index.html +12 -0
- package/templates/capsule/package.json +20 -0
- package/templates/capsule/pb/schema.json +18 -0
- package/templates/capsule/percher.toml +13 -0
- package/templates/capsule/src/App.tsx +65 -0
- package/templates/capsule/src/components/Auth.tsx +75 -0
- package/templates/capsule/src/components/SignInWithGoogle.tsx +27 -0
- package/templates/capsule/src/lib/ai-client.ts +193 -0
- package/templates/capsule/src/lib/ai.ts +15 -0
- package/templates/capsule/src/lib/db.ts +14 -0
- package/templates/capsule/src/lib/realtime.ts +16 -0
- package/templates/capsule/src/main.tsx +5 -0
- package/templates/capsule/tsconfig.json +15 -0
- package/templates/capsule/vite.config.ts +6 -0
- package/templates/django/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/django/Procfile +1 -0
- package/templates/django/app/__init__.py +0 -0
- package/templates/django/app/settings.py +44 -0
- package/templates/django/app/urls.py +21 -0
- package/templates/django/app/wsgi.py +5 -0
- package/templates/django/manage.py +19 -0
- package/templates/django/percher.toml +12 -0
- package/templates/django/requirements.txt +2 -0
- package/templates/dotnet/Dockerfile +18 -0
- package/templates/dotnet/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/dotnet/Program.cs +23 -0
- package/templates/dotnet/app.csproj +9 -0
- package/templates/dotnet/percher.toml +11 -0
- package/templates/eleventy/.eleventy.js +12 -0
- package/templates/eleventy/Caddyfile +6 -0
- package/templates/eleventy/Dockerfile +51 -0
- package/templates/eleventy/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/eleventy/package.json +12 -0
- package/templates/eleventy/percher.toml +11 -0
- package/templates/eleventy/src/_includes/base.njk +12 -0
- package/templates/eleventy/src/assets/style.css +12 -0
- package/templates/eleventy/src/index.md +10 -0
- package/templates/elysia/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/elysia/index.ts +8 -0
- package/templates/elysia/package.json +12 -0
- package/templates/elysia/percher.toml +11 -0
- package/templates/express/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/express/index.ts +16 -0
- package/templates/express/package.json +12 -0
- package/templates/express/percher.toml +11 -0
- package/templates/fastify/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/fastify/index.ts +13 -0
- package/templates/fastify/package.json +12 -0
- package/templates/fastify/percher.toml +11 -0
- package/templates/flask/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/flask/main.py +23 -0
- package/templates/flask/percher.toml +12 -0
- package/templates/flask/requirements.txt +2 -0
- package/templates/go/Dockerfile +11 -0
- package/templates/go/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/go/go.mod +3 -0
- package/templates/go/main.go +53 -0
- package/templates/go/percher.toml +11 -0
- package/templates/hono/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/hono/index.ts +14 -0
- package/templates/hono/package.json +13 -0
- package/templates/hono/percher.toml +11 -0
- package/templates/htmx/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/htmx/index.ts +32 -0
- package/templates/htmx/package.json +15 -0
- package/templates/htmx/percher.toml +11 -0
- package/templates/hugo/Caddyfile +6 -0
- package/templates/hugo/Dockerfile +49 -0
- package/templates/hugo/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/hugo/content/_index.md +7 -0
- package/templates/hugo/hugo.toml +11 -0
- package/templates/hugo/layouts/index.html +22 -0
- package/templates/hugo/percher.toml +11 -0
- package/templates/java/Dockerfile +15 -0
- package/templates/java/Main.java +77 -0
- package/templates/java/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/java/percher.toml +11 -0
- package/templates/laravel/Dockerfile +19 -0
- package/templates/laravel/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/laravel/composer.json +15 -0
- package/templates/laravel/percher.toml +11 -0
- package/templates/laravel/public/index.php +37 -0
- package/templates/nextjs/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/nextjs/app/api/health/route.ts +3 -0
- package/templates/nextjs/app/layout.tsx +11 -0
- package/templates/nextjs/app/page.tsx +10 -0
- package/templates/nextjs/next.config.mjs +8 -0
- package/templates/nextjs/package.json +21 -0
- package/templates/nextjs/percher.toml +15 -0
- package/templates/node/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/node/index.js +26 -0
- package/templates/node/package.json +8 -0
- package/templates/node/percher.toml +10 -0
- package/templates/nuxt/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/nuxt/app.vue +6 -0
- package/templates/nuxt/nuxt.config.ts +4 -0
- package/templates/nuxt/package.json +15 -0
- package/templates/nuxt/percher.toml +15 -0
- package/templates/nuxt/server/api/health.ts +1 -0
- package/templates/phoenix/Dockerfile +15 -0
- package/templates/phoenix/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/phoenix/lib/application.ex +15 -0
- package/templates/phoenix/lib/router.ex +39 -0
- package/templates/phoenix/mix.exs +30 -0
- package/templates/phoenix/percher.toml +11 -0
- package/templates/preact/Caddyfile +7 -0
- package/templates/preact/Dockerfile +51 -0
- package/templates/preact/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/preact/index.html +12 -0
- package/templates/preact/package.json +19 -0
- package/templates/preact/percher.toml +11 -0
- package/templates/preact/src/main.tsx +13 -0
- package/templates/preact/vite.config.ts +6 -0
- package/templates/python/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/python/main.py +13 -0
- package/templates/python/nixpacks.toml +8 -0
- package/templates/python/percher.toml +12 -0
- package/templates/python/requirements.txt +2 -0
- package/templates/rails/Dockerfile +11 -0
- package/templates/rails/Gemfile +12 -0
- package/templates/rails/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/rails/config.ru +32 -0
- package/templates/rails/percher.toml +11 -0
- package/templates/remix/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/remix/app/root.tsx +19 -0
- package/templates/remix/app/routes/_index.tsx +10 -0
- package/templates/remix/app/routes/health.tsx +5 -0
- package/templates/remix/package.json +30 -0
- package/templates/remix/percher.toml +15 -0
- package/templates/remix/vite.config.ts +7 -0
- package/templates/rust/Cargo.toml +19 -0
- package/templates/rust/Dockerfile +18 -0
- package/templates/rust/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/rust/percher.toml +11 -0
- package/templates/rust/src/main.rs +45 -0
- package/templates/solid/Caddyfile +7 -0
- package/templates/solid/Dockerfile +51 -0
- package/templates/solid/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/solid/index.html +12 -0
- package/templates/solid/package.json +19 -0
- package/templates/solid/percher.toml +11 -0
- package/templates/solid/src/main.tsx +13 -0
- package/templates/solid/vite.config.ts +6 -0
- package/templates/static/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/static/index.html +15 -0
- package/templates/static/percher.toml +6 -0
- package/templates/static/style.css +32 -0
- package/templates/sveltekit/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/sveltekit/package.json +19 -0
- package/templates/sveltekit/percher.toml +15 -0
- package/templates/sveltekit/src/app.html +12 -0
- package/templates/sveltekit/src/routes/+page.svelte +2 -0
- package/templates/sveltekit/src/routes/health/+server.ts +5 -0
- package/templates/sveltekit/svelte.config.js +8 -0
- package/templates/sveltekit/vite.config.js +6 -0
- package/templates/vite-react/Caddyfile +7 -0
- package/templates/vite-react/Dockerfile +51 -0
- package/templates/vite-react/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/vite-react/index.html +12 -0
- package/templates/vite-react/package.json +22 -0
- package/templates/vite-react/percher.toml +11 -0
- package/templates/vite-react/src/main.tsx +20 -0
- package/templates/vite-react/vite.config.ts +6 -0
- package/templates/vite-vue/Caddyfile +7 -0
- package/templates/vite-vue/Dockerfile +51 -0
- package/templates/vite-vue/PERCHER-TEMPLATE-LICENSE.txt +14 -0
- package/templates/vite-vue/index.html +12 -0
- package/templates/vite-vue/package.json +19 -0
- package/templates/vite-vue/percher.toml +11 -0
- package/templates/vite-vue/src/main.ts +12 -0
- package/templates/vite-vue/vite.config.ts +6 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
export type ManagedInferenceOptions = {
|
|
2
|
+
model?: string;
|
|
3
|
+
maxTokens?: number;
|
|
4
|
+
signal?: AbortSignal;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export class ManagedInferenceError extends Error {
|
|
8
|
+
constructor(
|
|
9
|
+
message: string,
|
|
10
|
+
readonly status?: number,
|
|
11
|
+
readonly code?: string,
|
|
12
|
+
readonly retryAt?: string,
|
|
13
|
+
) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = "ManagedInferenceError";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function createManagedInferenceClient(config: {
|
|
20
|
+
endpoint?: string;
|
|
21
|
+
getSession: () => { valid: boolean; token: string };
|
|
22
|
+
fetch?: typeof globalThis.fetch;
|
|
23
|
+
}) {
|
|
24
|
+
const fetcher = config.fetch ?? globalThis.fetch;
|
|
25
|
+
|
|
26
|
+
function isConfigured(): boolean {
|
|
27
|
+
return Boolean(config.endpoint);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function assertReady(): string {
|
|
31
|
+
if (!config.endpoint) {
|
|
32
|
+
throw new ManagedInferenceError(
|
|
33
|
+
"Managed inference is not available for this deployment.",
|
|
34
|
+
503,
|
|
35
|
+
"INFERENCE_DISABLED",
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
const session = config.getSession();
|
|
39
|
+
if (!session.valid || !session.token) {
|
|
40
|
+
throw new ManagedInferenceError("Sign in to use AI.", 401, "INFERENCE_AUTH_REQUIRED");
|
|
41
|
+
}
|
|
42
|
+
return session.token;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
async function safeError(response: Response): Promise<ManagedInferenceError> {
|
|
46
|
+
let code: string | undefined;
|
|
47
|
+
let resetAt: string | undefined;
|
|
48
|
+
try {
|
|
49
|
+
const body = (await response.json()) as {
|
|
50
|
+
error?: { code?: unknown; resetAt?: unknown; retryAfterSec?: unknown };
|
|
51
|
+
};
|
|
52
|
+
if (typeof body.error?.code === "string") code = body.error.code;
|
|
53
|
+
if (typeof body.error?.resetAt === "string") resetAt = body.error.resetAt;
|
|
54
|
+
if (!resetAt && typeof body.error?.retryAfterSec === "number") {
|
|
55
|
+
resetAt = new Date(Date.now() + body.error.retryAfterSec * 1000).toISOString();
|
|
56
|
+
}
|
|
57
|
+
} catch {
|
|
58
|
+
// Never show raw upstream/proxy response bodies to capsule users.
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (response.status === 401) {
|
|
62
|
+
return new ManagedInferenceError("Your session expired. Sign in again.", 401, code);
|
|
63
|
+
}
|
|
64
|
+
if (response.status === 403) {
|
|
65
|
+
return new ManagedInferenceError(
|
|
66
|
+
"Managed inference is not included for this app's plan.",
|
|
67
|
+
403,
|
|
68
|
+
code,
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
if (response.status === 429) {
|
|
72
|
+
return new ManagedInferenceError(
|
|
73
|
+
resetAt ? `AI usage is limited until ${resetAt}.` : "AI usage is temporarily limited.",
|
|
74
|
+
429,
|
|
75
|
+
code,
|
|
76
|
+
resetAt,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
if (response.status === 503) {
|
|
80
|
+
return new ManagedInferenceError(
|
|
81
|
+
"Managed inference is currently unavailable.",
|
|
82
|
+
503,
|
|
83
|
+
code ?? "INFERENCE_DISABLED",
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
return new ManagedInferenceError(
|
|
87
|
+
"The AI request could not be completed. Try again.",
|
|
88
|
+
response.status,
|
|
89
|
+
code,
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async function request(prompt: string, opts: ManagedInferenceOptions, stream: boolean) {
|
|
94
|
+
// Validate configuration/auth before the network-error wrapper so a local
|
|
95
|
+
// disabled or signed-out state keeps its precise user-facing error.
|
|
96
|
+
const authorization = `Bearer ${assertReady()}`;
|
|
97
|
+
let response: Response;
|
|
98
|
+
try {
|
|
99
|
+
response = await fetcher(config.endpoint!, {
|
|
100
|
+
method: "POST",
|
|
101
|
+
headers: {
|
|
102
|
+
"content-type": "application/json",
|
|
103
|
+
authorization,
|
|
104
|
+
},
|
|
105
|
+
body: JSON.stringify({
|
|
106
|
+
model: opts.model,
|
|
107
|
+
max_tokens: opts.maxTokens ?? 512,
|
|
108
|
+
messages: [{ role: "user", content: prompt }],
|
|
109
|
+
...(stream ? { stream: true } : {}),
|
|
110
|
+
}),
|
|
111
|
+
signal: opts.signal,
|
|
112
|
+
});
|
|
113
|
+
} catch (error) {
|
|
114
|
+
if (opts.signal?.aborted) throw error;
|
|
115
|
+
throw new ManagedInferenceError("Managed inference could not be reached. Try again.");
|
|
116
|
+
}
|
|
117
|
+
if (!response.ok) throw await safeError(response);
|
|
118
|
+
return response;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async function complete(
|
|
122
|
+
prompt: string,
|
|
123
|
+
opts: ManagedInferenceOptions = {},
|
|
124
|
+
): Promise<string> {
|
|
125
|
+
const response = await request(prompt, opts, false);
|
|
126
|
+
const data = (await response.json()) as {
|
|
127
|
+
choices?: Array<{ message?: { content?: unknown } }>;
|
|
128
|
+
};
|
|
129
|
+
const content = data.choices?.[0]?.message?.content;
|
|
130
|
+
if (typeof content !== "string") {
|
|
131
|
+
throw new ManagedInferenceError("The AI provider returned an invalid response.");
|
|
132
|
+
}
|
|
133
|
+
return content;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
async function streamComplete(
|
|
137
|
+
prompt: string,
|
|
138
|
+
onToken: (delta: string) => void,
|
|
139
|
+
opts: ManagedInferenceOptions = {},
|
|
140
|
+
): Promise<string> {
|
|
141
|
+
const response = await request(prompt, opts, true);
|
|
142
|
+
if (!response.body) throw new ManagedInferenceError("The AI stream could not be opened.");
|
|
143
|
+
|
|
144
|
+
const reader = response.body.getReader();
|
|
145
|
+
const decoder = new TextDecoder();
|
|
146
|
+
let buffer = "";
|
|
147
|
+
let full = "";
|
|
148
|
+
let sawDone = false;
|
|
149
|
+
try {
|
|
150
|
+
for (;;) {
|
|
151
|
+
const { done, value } = await reader.read();
|
|
152
|
+
if (done) break;
|
|
153
|
+
buffer += decoder.decode(value, { stream: true }).replaceAll("\r\n", "\n");
|
|
154
|
+
let separator = buffer.indexOf("\n\n");
|
|
155
|
+
while (separator !== -1) {
|
|
156
|
+
const event = buffer.slice(0, separator);
|
|
157
|
+
buffer = buffer.slice(separator + 2);
|
|
158
|
+
separator = buffer.indexOf("\n\n");
|
|
159
|
+
const payload = event
|
|
160
|
+
.split("\n")
|
|
161
|
+
.filter((line) => line.startsWith("data:"))
|
|
162
|
+
.map((line) => line.slice(5).trimStart())
|
|
163
|
+
.join("\n")
|
|
164
|
+
.trim();
|
|
165
|
+
if (!payload) continue;
|
|
166
|
+
if (payload === "[DONE]") {
|
|
167
|
+
sawDone = true;
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
try {
|
|
171
|
+
const chunk = JSON.parse(payload) as {
|
|
172
|
+
choices?: Array<{ delta?: { content?: unknown } }>;
|
|
173
|
+
};
|
|
174
|
+
const delta = chunk.choices?.[0]?.delta?.content;
|
|
175
|
+
if (typeof delta === "string" && delta) {
|
|
176
|
+
full += delta;
|
|
177
|
+
onToken(delta);
|
|
178
|
+
}
|
|
179
|
+
} catch {
|
|
180
|
+
// Ignore SSE comments/keep-alives and malformed non-data events.
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (!sawDone) throw new ManagedInferenceError("The AI stream ended unexpectedly.");
|
|
185
|
+
return full;
|
|
186
|
+
} finally {
|
|
187
|
+
if (opts.signal?.aborted) await reader.cancel().catch(() => undefined);
|
|
188
|
+
reader.releaseLock();
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return { isConfigured, complete, streamComplete };
|
|
193
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createManagedInferenceClient } from "./ai-client";
|
|
2
|
+
import { pb } from "./db";
|
|
3
|
+
|
|
4
|
+
// This is a public URL, never a provider credential. Percher injects it only
|
|
5
|
+
// when the shared server-side feature gate is operational.
|
|
6
|
+
const client = createManagedInferenceClient({
|
|
7
|
+
endpoint: import.meta.env.VITE_PERCHER_AI_URL as string | undefined,
|
|
8
|
+
getSession: () => ({ valid: pb.authStore.isValid, token: pb.authStore.token }),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { ManagedInferenceError } from "./ai-client";
|
|
12
|
+
export type { ManagedInferenceOptions } from "./ai-client";
|
|
13
|
+
export const isManagedInferenceConfigured = client.isConfigured;
|
|
14
|
+
export const complete = client.complete;
|
|
15
|
+
export const streamComplete = client.streamComplete;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import PocketBase from "pocketbase";
|
|
2
|
+
|
|
3
|
+
// The app's own PocketBase, injected at build time via the Dockerfile's
|
|
4
|
+
// ARG VITE_POCKETBASE_URL (the pb-<app>.<suffix> origin). Auth state persists in
|
|
5
|
+
// localStorage automatically.
|
|
6
|
+
export const pb = new PocketBase(import.meta.env.VITE_POCKETBASE_URL);
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Typed data client. Write `db.collection<Message>("messages").create(...)`
|
|
10
|
+
* instead of hand-rolling the REST API.
|
|
11
|
+
*/
|
|
12
|
+
export const db = {
|
|
13
|
+
collection: <T = Record<string, unknown>>(name: string) => pb.collection<T>(name),
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { pb } from "./db";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Subscribe to live changes on a collection — one call closes the cross-tab /
|
|
5
|
+
* cross-user realtime glue. The callback fires on every create/update/delete;
|
|
6
|
+
* resolves to an unsubscribe function.
|
|
7
|
+
*
|
|
8
|
+
* const off = await subscribe<Message>("messages", (e) => refresh());
|
|
9
|
+
* // later: off();
|
|
10
|
+
*/
|
|
11
|
+
export function subscribe<T = Record<string, unknown>>(
|
|
12
|
+
collection: string,
|
|
13
|
+
cb: (e: { action: string; record: T }) => void,
|
|
14
|
+
) {
|
|
15
|
+
return pb.collection<T>(collection).subscribe("*", cb);
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"jsx": "react-jsx",
|
|
7
|
+
"jsxImportSource": "preact",
|
|
8
|
+
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
|
9
|
+
"types": ["vite/client"],
|
|
10
|
+
"strict": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"noEmit": true
|
|
13
|
+
},
|
|
14
|
+
"include": ["src"]
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
BSD Zero Clause License (0BSD)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mattias Malmborg
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
web: gunicorn app.wsgi:application --bind 0.0.0.0:8000
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""Minimal Django settings for Percher deploys."""
|
|
2
|
+
import os
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
6
|
+
|
|
7
|
+
SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY", "change-me-set-via-percher-env")
|
|
8
|
+
DEBUG = os.environ.get("DJANGO_DEBUG", "").lower() == "true"
|
|
9
|
+
ALLOWED_HOSTS = ["*"]
|
|
10
|
+
|
|
11
|
+
INSTALLED_APPS = [
|
|
12
|
+
"django.contrib.contenttypes",
|
|
13
|
+
"django.contrib.auth",
|
|
14
|
+
"django.contrib.staticfiles",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
MIDDLEWARE = [
|
|
18
|
+
"django.middleware.common.CommonMiddleware",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
ROOT_URLCONF = "app.urls"
|
|
22
|
+
|
|
23
|
+
TEMPLATES = [
|
|
24
|
+
{
|
|
25
|
+
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
26
|
+
"DIRS": [],
|
|
27
|
+
"APP_DIRS": True,
|
|
28
|
+
"OPTIONS": {},
|
|
29
|
+
},
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
WSGI_APPLICATION = "app.wsgi.application"
|
|
33
|
+
|
|
34
|
+
DATABASES = {
|
|
35
|
+
"default": {
|
|
36
|
+
"ENGINE": "django.db.backends.sqlite3",
|
|
37
|
+
"NAME": BASE_DIR / "/app/data/db.sqlite3",
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
STATIC_URL = "static/"
|
|
42
|
+
STATIC_ROOT = BASE_DIR / "staticfiles"
|
|
43
|
+
|
|
44
|
+
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from django.http import JsonResponse, HttpResponse
|
|
2
|
+
from django.urls import path
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def index(_request):
|
|
6
|
+
return HttpResponse(
|
|
7
|
+
"<main style='font-family: system-ui; padding: 40px;'>"
|
|
8
|
+
"<h1>Hello from __APP_NAME__</h1>"
|
|
9
|
+
"<p>Django on Percher.</p>"
|
|
10
|
+
"</main>"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def health(_request):
|
|
15
|
+
return JsonResponse({"status": "ok"})
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
urlpatterns = [
|
|
19
|
+
path("", index),
|
|
20
|
+
path("health/", health),
|
|
21
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""Django's command-line utility for administrative tasks."""
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def main():
|
|
8
|
+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")
|
|
9
|
+
try:
|
|
10
|
+
from django.core.management import execute_from_command_line
|
|
11
|
+
except ImportError as exc:
|
|
12
|
+
raise ImportError(
|
|
13
|
+
"Couldn't import Django. Is it installed and on PYTHONPATH?"
|
|
14
|
+
) from exc
|
|
15
|
+
execute_from_command_line(sys.argv)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
if __name__ == "__main__":
|
|
19
|
+
main()
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
|
|
2
|
+
WORKDIR /src
|
|
3
|
+
COPY app.csproj ./
|
|
4
|
+
RUN dotnet restore
|
|
5
|
+
COPY Program.cs ./
|
|
6
|
+
RUN dotnet publish -c Release -o /out --no-restore
|
|
7
|
+
|
|
8
|
+
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine
|
|
9
|
+
WORKDIR /app
|
|
10
|
+
# aspnet:8.0-alpine ships with a non-root `app` user (uid 1654)
|
|
11
|
+
# pre-baked. We explicitly chown + USER here so the image runs as
|
|
12
|
+
# non-root regardless of any future base-image USER-default change.
|
|
13
|
+
COPY --from=build --chown=app:app /out ./
|
|
14
|
+
USER app
|
|
15
|
+
ENV ASPNETCORE_URLS=http://+:8080
|
|
16
|
+
ENV ASPNETCORE_ENVIRONMENT=Production
|
|
17
|
+
EXPOSE 8080
|
|
18
|
+
ENTRYPOINT ["dotnet", "app.dll"]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
BSD Zero Clause License (0BSD)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mattias Malmborg
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var builder = WebApplication.CreateBuilder(args);
|
|
2
|
+
var app = builder.Build();
|
|
3
|
+
|
|
4
|
+
app.MapGet("/health", () => Results.Json(new { ok = true }));
|
|
5
|
+
|
|
6
|
+
app.MapGet("/", () => Results.Content(@"<!doctype html>
|
|
7
|
+
<html lang=""en"">
|
|
8
|
+
<head>
|
|
9
|
+
<meta charset=""utf-8"" />
|
|
10
|
+
<title>__APP_NAME__</title>
|
|
11
|
+
<style>
|
|
12
|
+
body { font-family: system-ui, sans-serif; max-width: 640px; margin: 48px auto; padding: 0 24px; line-height: 1.6; }
|
|
13
|
+
h1 { letter-spacing: -0.5px; }
|
|
14
|
+
</style>
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<h1>__APP_NAME__</h1>
|
|
18
|
+
<p>A .NET app deployed on Percher.</p>
|
|
19
|
+
<p>Add endpoints in <code>Program.cs</code> and push to redeploy.</p>
|
|
20
|
+
</body>
|
|
21
|
+
</html>", "text/html; charset=utf-8"));
|
|
22
|
+
|
|
23
|
+
app.Run();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
2
|
+
<PropertyGroup>
|
|
3
|
+
<TargetFramework>net8.0</TargetFramework>
|
|
4
|
+
<Nullable>enable</Nullable>
|
|
5
|
+
<ImplicitUsings>enable</ImplicitUsings>
|
|
6
|
+
<AssemblyName>app</AssemblyName>
|
|
7
|
+
<RootNamespace>PercherApp</RootNamespace>
|
|
8
|
+
</PropertyGroup>
|
|
9
|
+
</Project>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Multi-stage build: a Bun stage compiles the static bundle, then a
|
|
2
|
+
# minimal Caddy image serves it. This project uses runtime = "docker"
|
|
3
|
+
# (not "static") because Percher's static runtime serves pre-built
|
|
4
|
+
# files only — it does not run a build command. Generated by Percher;
|
|
5
|
+
# safe to edit and own.
|
|
6
|
+
|
|
7
|
+
# --- Build stage: install deps and build the static bundle -----------
|
|
8
|
+
FROM oven/bun:1-alpine AS build
|
|
9
|
+
WORKDIR /app
|
|
10
|
+
COPY . .
|
|
11
|
+
RUN bun install && bun run build
|
|
12
|
+
|
|
13
|
+
# --- Serve stage: minimal Caddy image --------------------------------
|
|
14
|
+
# Build pinned Caddy source with refreshed security modules. The scratch
|
|
15
|
+
# runtime carries no shell, package manager, or file capabilities and listens
|
|
16
|
+
# on the unprivileged port :8080.
|
|
17
|
+
FROM golang:1.26.7-alpine3.23@sha256:b17af760035fc2f338eed92d448a6c67f2d45438844fc6c60678fa5f99e44b57 AS caddy-source
|
|
18
|
+
ADD --checksum=sha256:78e660d838e45c0b8c89338b325946238f153641aa9925df9ef2ad5e8eced31b \
|
|
19
|
+
https://github.com/caddyserver/caddy/commit/b2693fb63a30e6d7be0972c3645e9a2c0a500e93.patch /tmp/caddy-cel-go.patch
|
|
20
|
+
RUN go mod download github.com/caddyserver/caddy/v2@v2.11.4 \
|
|
21
|
+
&& cp -R /go/pkg/mod/github.com/caddyserver/caddy/v2@v2.11.4 /src \
|
|
22
|
+
&& chmod -R u+w /src
|
|
23
|
+
WORKDIR /src
|
|
24
|
+
RUN apk add --no-cache patch \
|
|
25
|
+
&& patch -p1 < /tmp/caddy-cel-go.patch \
|
|
26
|
+
&& go get github.com/go-chi/chi/v5@v5.3.0 github.com/google/cel-go@v0.29.2 \
|
|
27
|
+
github.com/klauspost/compress@v1.18.7 go.opentelemetry.io/otel@v1.44.0 \
|
|
28
|
+
golang.org/x/crypto@v0.55.0 golang.org/x/net@v0.58.0 \
|
|
29
|
+
golang.org/x/text@v0.41.0 google.golang.org/grpc@v1.83.2 \
|
|
30
|
+
&& go mod tidy \
|
|
31
|
+
&& CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o /out/caddy ./cmd/caddy \
|
|
32
|
+
&& printf '%s\n' \
|
|
33
|
+
'package main' \
|
|
34
|
+
'import ("net/http"; "os"; "time")' \
|
|
35
|
+
'func main(){ if len(os.Args)!=2 { os.Exit(2) }; c:=http.Client{Timeout:2500*time.Millisecond,Transport:&http.Transport{Proxy:nil},CheckRedirect:func(_ *http.Request,_ []*http.Request) error{return http.ErrUseLastResponse}}; r,e:=c.Get(os.Args[1]); if e!=nil { os.Exit(1) }; defer r.Body.Close(); if r.StatusCode!=http.StatusOK { os.Exit(1) } }' \
|
|
36
|
+
> /tmp/percher-healthcheck.go \
|
|
37
|
+
&& CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" -o /out/percher-healthcheck /tmp/percher-healthcheck.go
|
|
38
|
+
FROM scratch
|
|
39
|
+
COPY --from=caddy-source /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
|
40
|
+
COPY --from=caddy-source /out/caddy /usr/bin/caddy
|
|
41
|
+
COPY --from=caddy-source /out/percher-healthcheck /usr/bin/percher-healthcheck
|
|
42
|
+
COPY Caddyfile /etc/caddy/Caddyfile
|
|
43
|
+
COPY --from=build /app/_site /srv
|
|
44
|
+
LABEL dev.percher.health-client="static-http-v1"
|
|
45
|
+
# HOME points at the writable tmpfs so non-root Caddy can persist its
|
|
46
|
+
# XDG state (storage-clean lock, config autosave) under Percher's
|
|
47
|
+
# read-only root filesystem.
|
|
48
|
+
ENV HOME=/tmp
|
|
49
|
+
USER 10001:10001
|
|
50
|
+
EXPOSE 8080
|
|
51
|
+
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
BSD Zero Clause License (0BSD)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mattias Malmborg
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>{{ title or "__APP_NAME__" }}</title>
|
|
7
|
+
<link rel="stylesheet" href="/assets/style.css" />
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<main>{{ content | safe }}</main>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
BSD Zero Clause License (0BSD)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mattias Malmborg
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|