{"draft":null,"from":89,"to":318,"files":[{"path":"server/src/env.ts","added":46,"removed":0,"diff":"--- /dev/null\n+++ b/server/src/env.ts\n@@ -0,0 +1,46 @@\n+// What the open server's Worker is given: wrangler.jsonc's bindings and the secrets set with `wrangler secret put`.\n+\n+import type { IssueProject } from \"./issues-entry.ts\";\n+import type { ProjectObject } from \"./project-object.ts\";\n+\n+export interface Env {\n+\t/** Explicit development opt-in while disk-first server acceptance is in progress. */\n+\tABSO_DISK_FIRST?: string;\n+\t/** One Durable Object per project, named by the project's name. */\n+\tPROJECT: DurableObjectNamespace<ProjectObject>;\n+\t/** Issues, asks and news: one Durable Object per project, named by the project's name. */\n+\tISSUES_DO: DurableObjectNamespace<IssueProject>;\n+\t/** Each project's shared, pushed out as a git repo abso-<project>. Unbound under local `wrangler dev`: skipped. */\n+\tARTIFACTS?: Artifacts;\n+\t/** \"off\" leaves Artifacts alone even where it is bound: local `wrangler dev --local` binds it but cannot reach it. */\n+\tABSO_ARTIFACTS?: string;\n+\tCF_VERSION_METADATA?: WorkerVersionMetadata;\n+\t/** The shared token every agent signs in with. AVCS_TOKEN is its old name. With neither set, every call is refused. */\n+\tABSO_TOKEN?: string;\n+\tAVCS_TOKEN?: string;\n+\t/** For /admin/agent-keys, sent as the x-abso-admin header beside the shared token. */\n+\tABSO_ADMIN_TOKEN?: string;\n+\tAVCS_ADMIN_TOKEN?: string;\n+\t/** Per-agent keys: \"on\" with KEY_HMAC_SECRET set. */\n+\tAGENT_KEYS?: string;\n+\tKEY_HMAC_SECRET?: string;\n+\t/** \"on\" gives a held push a first opinion on each collision from Workers AI (#19); \"act\" also has the client settle the ones advised a side. Needs the AI binding. */\n+\tAUTOSETTLE?: string;\n+\t/** Which model advises: clef (the default), clef-flash, or a Workers AI text model's id. */\n+\tAUTOSETTLE_MODEL?: string;\n+\t/** The confidence under which a lean to one side is left to an agent: 0.5 unless set. */\n+\tAUTOSETTLE_AT?: string;\n+\t/** Workers AI, for AUTOSETTLE. Unbound unless wrangler.jsonc names it. */\n+\tAI?: { run(model: string, input: unknown): Promise<unknown> };\n+}\n+\n+/** A secret by its abso name, or its avcs name from before the rename. Empty counts as unset. */\n+export function secret(env: Env, name: \"TOKEN\" | \"ADMIN_TOKEN\"): string | undefined {\n+\tfor (const v of [env[`ABSO_${name}`], env[`AVCS_${name}`]]) if (typeof v === \"string\" && v !== \"\") return v;\n+\treturn undefined;\n+}\n+\n+/** The Artifacts binding, unless it is unbound or ABSO_ARTIFACTS is \"off\": then nothing is pushed out or taken in. */\n+export function artifactsOf(env: Env): Artifacts | undefined {\n+\treturn env.ABSO_ARTIFACTS === \"off\" ? undefined : env.ARTIFACTS;\n+}"}],"unmatched":[]}