@cat-factory/local-server 0.6.0 → 0.7.2
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 +21 -21
- package/package.json +13 -8
- package/dist/LocalDockerRunnerTransport.d.ts +0 -95
- package/dist/LocalDockerRunnerTransport.d.ts.map +0 -1
- package/dist/LocalDockerRunnerTransport.js +0 -342
- package/dist/LocalDockerRunnerTransport.js.map +0 -1
- package/dist/config.d.ts +0 -9
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -42
- package/dist/config.js.map +0 -1
- package/dist/container.d.ts +0 -4
- package/dist/container.d.ts.map +0 -1
- package/dist/container.js +0 -84
- package/dist/container.js.map +0 -1
- package/dist/github.d.ts +0 -36
- package/dist/github.d.ts.map +0 -1
- package/dist/github.js +0 -174
- package/dist/github.js.map +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -21
- package/dist/index.js.map +0 -1
- package/dist/installations.d.ts +0 -31
- package/dist/installations.d.ts.map +0 -1
- package/dist/installations.js +0 -76
- package/dist/installations.js.map +0 -1
- package/dist/link-repo.d.ts +0 -2
- package/dist/link-repo.d.ts.map +0 -1
- package/dist/link-repo.js +0 -21
- package/dist/link-repo.js.map +0 -1
- package/dist/linkRepo.d.ts +0 -31
- package/dist/linkRepo.d.ts.map +0 -1
- package/dist/linkRepo.js +0 -113
- package/dist/linkRepo.js.map +0 -1
- package/dist/main.d.ts +0 -2
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js +0 -10
- package/dist/main.js.map +0 -1
- package/dist/server.d.ts +0 -5
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -50
- package/dist/server.js.map +0 -1
package/dist/linkRepo.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { createDbClient, schema } from '@cat-factory/node-server';
|
|
2
|
-
import { and, eq, ne } from 'drizzle-orm';
|
|
3
|
-
import { syntheticInstallationId } from './installations.js';
|
|
4
|
-
// Link a real GitHub repo to a board service frame for LOCAL mode. Container agent
|
|
5
|
-
// steps resolve which repo to operate on from the `github_repos` /
|
|
6
|
-
// `github_installations` projection (`buildResolveRepoTarget`). The cloud facades
|
|
7
|
-
// populate those rows from the GitHub App connect/sync flow; local mode has no App, so
|
|
8
|
-
// this helper seeds them directly from the repo's public metadata read with the PAT:
|
|
9
|
-
// - a synthetic per-workspace `github_installations` row (the executor's PAT token
|
|
10
|
-
// source ignores the installation id, but `resolveRepoTarget` requires a row to
|
|
11
|
-
// exist + reads its id back), and
|
|
12
|
-
// - a `github_repos` row linked to the frame via `block_id` (the legacy projection
|
|
13
|
-
// link `resolveRepoTarget` walks the block ancestry to find).
|
|
14
|
-
// Idempotent: re-linking the same repo/frame updates the rows in place.
|
|
15
|
-
const GITHUB_API_BASE = 'https://api.github.com';
|
|
16
|
-
export async function linkRepo(options) {
|
|
17
|
-
const env = options.env ?? process.env;
|
|
18
|
-
const pat = options.pat ?? env.GITHUB_PAT?.trim();
|
|
19
|
-
if (!pat)
|
|
20
|
-
throw new Error('A GitHub PAT is required (set GITHUB_PAT or pass options.pat)');
|
|
21
|
-
const apiBase = (options.apiBase ?? env.GITHUB_API_BASE?.trim() ?? GITHUB_API_BASE).replace(/\/+$/, '');
|
|
22
|
-
const slash = options.repo.indexOf('/');
|
|
23
|
-
if (slash <= 0 || slash === options.repo.length - 1) {
|
|
24
|
-
throw new Error(`Invalid repo '${options.repo}' — expected 'owner/name'`);
|
|
25
|
-
}
|
|
26
|
-
const owner = options.repo.slice(0, slash);
|
|
27
|
-
const name = options.repo.slice(slash + 1);
|
|
28
|
-
const fetchImpl = options.fetchImpl ?? fetch;
|
|
29
|
-
const res = await fetchImpl(`${apiBase}/repos/${owner}/${name}`, {
|
|
30
|
-
headers: {
|
|
31
|
-
authorization: `Bearer ${pat}`,
|
|
32
|
-
accept: 'application/vnd.github+json',
|
|
33
|
-
'user-agent': 'cat-factory',
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
if (!res.ok) {
|
|
37
|
-
const text = await res.text().catch(() => '');
|
|
38
|
-
throw new Error(`GitHub repo lookup failed (HTTP ${res.status}): ${text.slice(0, 200)}`);
|
|
39
|
-
}
|
|
40
|
-
const meta = (await res.json());
|
|
41
|
-
const installationId = syntheticInstallationId(options.workspaceId);
|
|
42
|
-
const defaultBranch = meta.default_branch ?? 'main';
|
|
43
|
-
const now = Date.now();
|
|
44
|
-
let db = options.db;
|
|
45
|
-
let close;
|
|
46
|
-
if (!db) {
|
|
47
|
-
const url = options.databaseUrl ?? env.DATABASE_URL;
|
|
48
|
-
if (!url)
|
|
49
|
-
throw new Error('DATABASE_URL is required to link a repo (or pass options.db)');
|
|
50
|
-
const client = createDbClient(url);
|
|
51
|
-
db = client.db;
|
|
52
|
-
close = () => client.pool.end();
|
|
53
|
-
}
|
|
54
|
-
try {
|
|
55
|
-
const installationValues = {
|
|
56
|
-
installation_id: installationId,
|
|
57
|
-
workspace_id: options.workspaceId,
|
|
58
|
-
account_id: meta.owner?.id != null ? String(meta.owner.id) : null,
|
|
59
|
-
account_login: meta.owner?.login ?? owner,
|
|
60
|
-
target_type: meta.owner?.type === 'Organization' ? 'Organization' : 'User',
|
|
61
|
-
app_id: null,
|
|
62
|
-
cached_token: null,
|
|
63
|
-
token_expires_at: null,
|
|
64
|
-
created_at: now,
|
|
65
|
-
deleted_at: null,
|
|
66
|
-
};
|
|
67
|
-
// `github_installations` has a partial UNIQUE index on (workspace_id) WHERE
|
|
68
|
-
// deleted_at IS NULL, so a pre-existing live row for this workspace under a DIFFERENT
|
|
69
|
-
// id (e.g. from a real GitHub-App connect) would collide with our synthetic-id
|
|
70
|
-
// insert — and the upsert below keys on installation_id, not workspace_id, so it
|
|
71
|
-
// wouldn't catch it. Clear any such row first so re-linking is robust.
|
|
72
|
-
await db
|
|
73
|
-
.delete(schema.githubInstallations)
|
|
74
|
-
.where(and(eq(schema.githubInstallations.workspace_id, options.workspaceId), ne(schema.githubInstallations.installation_id, installationId)));
|
|
75
|
-
await db.insert(schema.githubInstallations).values(installationValues).onConflictDoUpdate({
|
|
76
|
-
target: schema.githubInstallations.installation_id,
|
|
77
|
-
set: installationValues,
|
|
78
|
-
});
|
|
79
|
-
const repoValues = {
|
|
80
|
-
workspace_id: options.workspaceId,
|
|
81
|
-
github_id: meta.id,
|
|
82
|
-
installation_id: installationId,
|
|
83
|
-
owner,
|
|
84
|
-
name,
|
|
85
|
-
default_branch: defaultBranch,
|
|
86
|
-
private: meta.private ? 1 : 0,
|
|
87
|
-
block_id: options.frameBlockId,
|
|
88
|
-
is_monorepo: 0,
|
|
89
|
-
etag: null,
|
|
90
|
-
synced_at: now,
|
|
91
|
-
deleted_at: null,
|
|
92
|
-
};
|
|
93
|
-
await db
|
|
94
|
-
.insert(schema.githubRepos)
|
|
95
|
-
.values(repoValues)
|
|
96
|
-
.onConflictDoUpdate({
|
|
97
|
-
target: [schema.githubRepos.workspace_id, schema.githubRepos.github_id],
|
|
98
|
-
set: repoValues,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
finally {
|
|
102
|
-
await close?.();
|
|
103
|
-
}
|
|
104
|
-
return {
|
|
105
|
-
owner,
|
|
106
|
-
name,
|
|
107
|
-
githubId: meta.id,
|
|
108
|
-
installationId,
|
|
109
|
-
defaultBranch,
|
|
110
|
-
private: Boolean(meta.private),
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
//# sourceMappingURL=linkRepo.js.map
|
package/dist/linkRepo.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"linkRepo.js","sourceRoot":"","sources":["../src/linkRepo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,cAAc,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjF,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oB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,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7B,QAAQ,EAAE,OAAO,CAAC,YAAY;YAC9B,WAAW,EAAE,CAAC;YACd,IAAI,EAAE,IAAI;YACV,SAAS,EAAE,GAAG;YACd,UAAU,EAAE,IAAI;SACjB,CAAA;QACD,MAAM,EAAE;aACL,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;aAC1B,MAAM,CAAC,UAAU,CAAC;aAClB,kBAAkB,CAAC;YAClB,MAAM,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC;YACvE,GAAG,EAAE,UAAU;SAChB,CAAC,CAAA;IACN,CAAC;YAAS,CAAC;QACT,MAAM,KAAK,EAAE,EAAE,CAAA;IACjB,CAAC;IAED,OAAO;QACL,KAAK;QACL,IAAI;QACJ,QAAQ,EAAE,IAAI,CAAC,EAAE;QACjB,cAAc;QACd,aAAa;QACb,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;KAC/B,CAAA;AACH,CAAC"}
|
package/dist/main.d.ts
DELETED
package/dist/main.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":""}
|
package/dist/main.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { logger } from '@cat-factory/server';
|
|
2
|
-
import { startLocal } from './server.js';
|
|
3
|
-
// Default entrypoint: `pnpm build` then `node dist/main.js`. Requires DATABASE_URL
|
|
4
|
-
// (the local Postgres) and LOCAL_HARNESS_IMAGE (the executor-harness image run per
|
|
5
|
-
// job). Set PORT to override the listen port (PUBLIC_URL defaults from it).
|
|
6
|
-
startLocal().catch((err) => {
|
|
7
|
-
logger.error({ err: err instanceof Error ? err.message : String(err) }, 'failed to start');
|
|
8
|
-
process.exit(1);
|
|
9
|
-
});
|
|
10
|
-
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,mFAAmF;AACnF,mFAAmF;AACnF,4EAA4E;AAC5E,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAClC,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAA;IAC1F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
|
package/dist/server.d.ts
DELETED
package/dist/server.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAahD,wBAAsB,UAAU,CAC9B,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CAAO,GACxC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CA8C5C"}
|
package/dist/server.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { start } from '@cat-factory/node-server';
|
|
2
|
-
import { logger } from '@cat-factory/server';
|
|
3
|
-
import { applyLocalDefaults } from './config.js';
|
|
4
|
-
import { buildLocalContainer } from './container.js';
|
|
5
|
-
import { githubPatCreationUrl } from './github.js';
|
|
6
|
-
import { createLocalDockerTransportFromEnv } from './LocalDockerRunnerTransport.js';
|
|
7
|
-
// Boot the local-mode service. It reuses the Node facade's `start()` — Postgres +
|
|
8
|
-
// pg-boss + the execution worker + sweepers, served over @hono/node-server — passing
|
|
9
|
-
// the local composition root so agent jobs run in local Docker containers and GitHub
|
|
10
|
-
// is reached via a PAT. Requires DATABASE_URL (point it at the local Postgres); set
|
|
11
|
-
// LOCAL_HARNESS_IMAGE to run repo-operating agent jobs (without it the board still
|
|
12
|
-
// serves and only container kinds fail, loudly).
|
|
13
|
-
export async function startLocal(options = {}) {
|
|
14
|
-
const env = options.env ?? process.env;
|
|
15
|
-
// Best-effort: reap per-job containers a previous run orphaned (a crash or hard kill
|
|
16
|
-
// can leave exited `cat-factory.managed=local-docker` containers behind, since their
|
|
17
|
-
// `release()` never ran). Skipped when no image is configured (nothing to reap).
|
|
18
|
-
if (env.LOCAL_HARNESS_IMAGE?.trim()) {
|
|
19
|
-
try {
|
|
20
|
-
const reaped = await createLocalDockerTransportFromEnv(env).reapExited();
|
|
21
|
-
if (reaped > 0)
|
|
22
|
-
logger.info({ reaped }, 'reaped orphaned local job containers');
|
|
23
|
-
}
|
|
24
|
-
catch (err) {
|
|
25
|
-
logger.warn({ err: err instanceof Error ? err.message : String(err) }, 'could not reap orphaned local job containers');
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
// The auth gate defaults OPEN in local mode and the listener binds to all interfaces
|
|
29
|
-
// (so on native Linux Docker the agent containers can reach the LLM proxy via the
|
|
30
|
-
// bridge gateway). That combination means anyone on your network can reach the API —
|
|
31
|
-
// surface it so it is a choice, not a surprise. Lock it down with AUTH_DEV_OPEN=false,
|
|
32
|
-
// or HOST=127.0.0.1 on Docker Desktop (where host.docker.internal still resolves).
|
|
33
|
-
const localized = applyLocalDefaults(env);
|
|
34
|
-
// GitHub is reached via a PAT in local mode (there is no GitHub-App connect flow). Without
|
|
35
|
-
// one the board still serves, but every repo-operating agent step — clone, push, open PR,
|
|
36
|
-
// the CI gate, the real merge — fails. Surface it at boot with a click-through URL that
|
|
37
|
-
// pre-selects the scopes, so it is a one-step fix rather than a runtime surprise.
|
|
38
|
-
if (!localized.GITHUB_PAT?.trim()) {
|
|
39
|
-
logger.warn(`local mode: GITHUB_PAT is not set — agent steps that clone, push, open PRs, gate on ` +
|
|
40
|
-
`CI or merge will fail. Create a token (scopes pre-selected) at ${githubPatCreationUrl()} ` +
|
|
41
|
-
`then set GITHUB_PAT and restart.`);
|
|
42
|
-
}
|
|
43
|
-
if (localized.AUTH_DEV_OPEN !== 'false' && !env.HOST?.trim()) {
|
|
44
|
-
logger.warn('local mode: the auth gate is OPEN and the server binds to all interfaces — anyone ' +
|
|
45
|
-
'on your network can reach the API. Set AUTH_DEV_OPEN=false, or HOST=127.0.0.1 on ' +
|
|
46
|
-
'Docker Desktop, to restrict it.');
|
|
47
|
-
}
|
|
48
|
-
return start({ env, buildContainer: buildLocalContainer });
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,iCAAiC,EAAE,MAAM,iCAAiC,CAAA;AAEnF,kFAAkF;AAClF,qFAAqF;AACrF,qFAAqF;AACrF,oFAAoF;AACpF,mFAAmF;AACnF,iDAAiD;AACjD,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,OAAO,GAAgC,EAAE;IAEzC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAA;IAEtC,qFAAqF;IACrF,qFAAqF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