{"draft":null,"from":116,"to":318,"files":[{"path":"client/src/issues.ts","added":13,"removed":4,"diff":"--- a/client/src/issues.ts\n+++ b/client/src/issues.ts\n@@ -23,25 +23,34 @@\n import { bool, type Parsed, str, UsageError } from \"./args.ts\";\n import { type Env, type Output, open, plural } from \"./commands.ts\";\n import { type Config, readMachineServers, trustedServers } from \"./config.ts\";\n-import { issuesServerFor, tokenGoesTo } from \"./core.ts\";\n+import { issuesServerFor, tokenGoesToIssues } from \"./core.ts\";\n import { fromEnv } from \"./env-names.ts\";\n import { ignoredHere } from \"./fetch.ts\";\n import { loadIgnore, relativeTo } from \"./folder.ts\";\n import type { AskReply } from \"./issues-wire.ts\";\n+import { isLocal, LOCAL_BASE } from \"./local-store.ts\";\n import { queuedLines, standing } from \"./queue.ts\";\n import { seenText, shortWhen } from \"./times.ts\";\n \n const q = (s: string): string => JSON.stringify(s);\n \n /** The folder, with its Api pointed at the Issues Worker: the token goes only where tokenGoesTo allows, as for the avcs server. */\n-function openIssues(env: Env): { root: string; config: Config; api: Api } {\n+export function openIssues(env: Env): { root: string; config: Config; api: Api } {\n \tconst { root, config, api } = open(env);\n-\tconst server = fromEnv(env.env, \"ISSUES_SERVER\") || issuesServerFor(config.server, readMachineServers(env.env));\n+\t// A local project's issues are in its store, where the open server keeps them: at /issues.\n+\tif (isLocal(config.server)) {\n+\t\tapi.issuesServer = `${LOCAL_BASE}/issues`;\n+\t\treturn { root, config, api };\n+\t}\n+\t// An explicit --server goes to that server's own Issues Worker: ABSO_ISSUES_SERVER doesn't redirect it.\n+\tconst server =\n+\t\t(env.server === undefined ? fromEnv(env.env, \"ISSUES_SERVER\") : undefined) ||\n+\t\tissuesServerFor(config.server, readMachineServers(env.env));\n \tif (server === undefined)\n \t\tthrow new UsageError(\n \t\t\t`${config.server} has no Issues Worker beside it that abso knows; ~/.abso/servers.json or ABSO_ISSUES_SERVER names one`,\n \t\t);\n-\tif (config.token !== undefined && !tokenGoesTo(server, trustedServers(env.env))) {\n+\tif (config.token !== undefined && !tokenGoesToIssues(server, trustedServers(env.env))) {\n \t\tthrow new UsageError(\n \t\t\t`the Issues Worker is ${server}, and abso sends your token only to its own servers and this machine. If ${server} is yours, name it in ~/.abso/servers.json or ABSO_TRUSTED_SERVERS.`,\n \t\t);"}],"unmatched":[]}