Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ FEISHU_STARTUP_REQUIRED=true

# Service storage
PORT=3000
SERVICE_NAME=slack-codex-broker
SERVICE_NAME=workwork
# Optional admin origin used in Slack session trace links.
# ADMIN_BASE_URL=https://admin.example.com
# Optional: protects /admin/api/* when set.
Expand Down
564 changes: 157 additions & 407 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
services:
slack-codex-broker:
workwork:
build:
context: .
environment:
Expand All @@ -10,7 +10,7 @@ services:
SLACK_INITIAL_THREAD_HISTORY_COUNT: ${SLACK_INITIAL_THREAD_HISTORY_COUNT:-8}
SLACK_HISTORY_API_MAX_LIMIT: ${SLACK_HISTORY_API_MAX_LIMIT:-50}
PORT: ${PORT:-3000}
SERVICE_NAME: ${SERVICE_NAME:-slack-codex-broker}
SERVICE_NAME: ${SERVICE_NAME:-workwork}
DATA_ROOT: ${DATA_ROOT:-/app/.data}
SESSIONS_ROOT: ${SESSIONS_ROOT:-/app/.data/sessions}
REPOS_ROOT: ${REPOS_ROOT:-/app/.data/repos}
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "agent-session-broker-repo",
"name": "workwork",
"version": "0.1.26",
"private": true,
"description": "Slack + China Feishu broker that routes chat sessions into Codex app-server sessions with isolated workspaces.",
"homepage": "https://github.com/HOOLC/slack-codex-broker#readme",
"homepage": "https://github.com/HOOLC/workwork#readme",
"bugs": {
"url": "https://github.com/HOOLC/slack-codex-broker/issues"
"url": "https://github.com/HOOLC/workwork/issues"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/HOOLC/slack-codex-broker.git"
"url": "git+https://github.com/HOOLC/workwork.git"
},
"type": "module",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions packages/admin/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@agent-session-broker/admin",
"version": "0.1.26",
"description": "Admin service and UI for the agent session broker.",
"homepage": "https://github.com/HOOLC/slack-codex-broker#readme",
"description": "Admin service and UI for Workwork.",
"homepage": "https://github.com/HOOLC/workwork#readme",
"bugs": {
"url": "https://github.com/HOOLC/slack-codex-broker/issues"
"url": "https://github.com/HOOLC/workwork/issues"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/HOOLC/slack-codex-broker.git"
"url": "git+https://github.com/HOOLC/workwork.git"
},
"bin": {
"agent-session-broker-macos-bootstrap": "./scripts/ops/macos-bootstrap.mjs"
Expand Down
8 changes: 4 additions & 4 deletions packages/worker/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@agent-session-broker/worker",
"version": "0.1.26",
"description": "Worker runtime for the agent session broker.",
"homepage": "https://github.com/HOOLC/slack-codex-broker#readme",
"description": "Worker runtime for Workwork.",
"homepage": "https://github.com/HOOLC/workwork#readme",
"bugs": {
"url": "https://github.com/HOOLC/slack-codex-broker/issues"
"url": "https://github.com/HOOLC/workwork/issues"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/HOOLC/slack-codex-broker.git"
"url": "git+https://github.com/HOOLC/workwork.git"
},
"files": [
"dist/src/",
Expand Down
4 changes: 2 additions & 2 deletions src/admin-ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>slack-codex-broker 管理台</title>
<title>workwork 管理台</title>
</head>
<body>
<div id="admin-root"></div>
<script id="admin-config" type="application/json">
{ "serviceName": "slack-codex-broker" }
{ "serviceName": "workwork" }
</script>
<script type="module" src="/main.tsx"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion src/admin-ui/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ if (!rootElement) {

document.body.classList.toggle("session-permalink-page", sessionPermalinkPage);

createRoot(rootElement).render(<AdminShell serviceName={config.serviceName || "slack-codex-broker"} />);
createRoot(rootElement).render(<AdminShell serviceName={config.serviceName || "workwork"} />);
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export function loadConfig(env = process.env): AppConfig {
workerBaseUrl: env.WORKER_BASE_URL ?? `http://${workerBindHost}:${workerPort}`,
adminBaseUrl: env.ADMIN_BASE_URL ?? `http://127.0.0.1:${port}`,
brokerHttpBaseUrl: env.BROKER_HTTP_BASE_URL ?? `http://127.0.0.1:${port}`,
serviceName: env.SERVICE_NAME ?? "slack-codex-broker",
serviceName: env.SERVICE_NAME ?? "workwork",
brokerAdminToken: getOptional(env, "BROKER_ADMIN_TOKEN"),
adminLaunchdLabel: getOptional(env, "ADMIN_LAUNCHD_LABEL"),
workerLaunchdLabel: getOptional(env, "WORKER_LAUNCHD_LABEL"),
Expand Down
6 changes: 3 additions & 3 deletions src/services/codex/isolated-mcp-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class IsolatedMcpService {
authProvider,
});
const client = new Client({
name: "slack-codex-broker",
name: "workwork",
version: "0.1.0",
});
await client.connect(transport as unknown as Transport);
Expand Down Expand Up @@ -204,8 +204,8 @@ class StoredOauthProvider implements OAuthClientProvider {
get clientMetadata(): OAuthClientMetadata {
return {
redirect_uris: [],
client_name: "slack-codex-broker",
client_uri: "https://github.com/HOOLC/slack-codex-broker",
client_name: "workwork",
client_uri: "https://github.com/HOOLC/workwork",
grant_types: this.#entry.refresh_token ? ["refresh_token"] : ["authorization_code", "refresh_token"],
response_types: ["code"],
token_endpoint_auth_method: this.#entry.client_secret ? "client_secret_post" : "none",
Expand Down
4 changes: 2 additions & 2 deletions src/services/github-pr-identity-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ export class GitHubPrIdentityService {
headers: {
accept: "application/vnd.github+json",
authorization: `Bearer ${token}`,
"user-agent": "slack-codex-broker",
"user-agent": "workwork",
},
});
const raw = await readJsonResponse(response);
Expand All @@ -521,7 +521,7 @@ export class GitHubPrIdentityService {
headers: {
accept: "application/vnd.github+json",
authorization: `Bearer ${token}`,
"user-agent": "slack-codex-broker",
"user-agent": "workwork",
},
}),
);
Expand Down
2 changes: 1 addition & 1 deletion test/admin-routes-part2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe("admin routes", () => {
const previous = process.env.ADMIN_UI_DEV_ORIGIN;
process.env.ADMIN_UI_DEV_ORIGIN = "http://127.0.0.1:5173/";
try {
const html = renderAdminPage({ serviceName: "slack-codex-broker" });
const html = renderAdminPage({ serviceName: "workwork" });
expect(html).toContain("http://127.0.0.1:5173/admin/@react-refresh");
expect(html).toContain("__vite_plugin_react_preamble_installed__");
expect(html).toContain("http://127.0.0.1:5173/admin/@vite/client");
Expand Down
4 changes: 2 additions & 2 deletions test/manual/run-rfc-0001-local-audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,8 @@ export const RFC0001_REQUIRED_LOCAL_EVIDENCE_PATTERNS: ReadonlyArray<{
"Feishu group `@bot ...`: create or resume a group session; private chats are ignored",
"FEISHU_GROUP_MESSAGE_MODE=all",
"`at_only` is a visible degraded mode",
"generic platform-aware chat endpoints",
"Invalid `platform` values return 400 `invalid_platform` with allowed values `slack` and `feishu`",
"Generic chat APIs are platform-aware",
"For generic chat and job APIs, invalid `platform` values return 400 `invalid_platform` with allowed values `slack` and `feishu`",
"pnpm test:e2e:feishu-mock",
"pnpm rfc:feishu-audit",
"pnpm rfc:feishu-audit:local",
Expand Down
28 changes: 24 additions & 4 deletions test/npm-package-deployment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,31 +25,51 @@ describe("npm package deployment contract", () => {
};
const adminPackageJson = JSON.parse(await fs.readFile(new URL("../packages/admin/package.json", import.meta.url), "utf8")) as {
readonly name?: string;
readonly repository?: { readonly url?: string };
readonly bugs?: { readonly url?: string };
readonly homepage?: string;
readonly publishConfig?: Record<string, string>;
readonly files?: readonly string[];
readonly bin?: Record<string, string>;
};
const workerPackageJson = JSON.parse(await fs.readFile(new URL("../packages/worker/package.json", import.meta.url), "utf8")) as {
readonly name?: string;
readonly repository?: { readonly url?: string };
readonly bugs?: { readonly url?: string };
readonly homepage?: string;
readonly publishConfig?: Record<string, string>;
readonly files?: readonly string[];
};

expect(packageJson).toMatchObject({
name: "agent-session-broker-repo",
name: "workwork",
private: true,
});
expect(packageJson.repository?.url).toBe("git+https://github.com/HOOLC/slack-codex-broker.git");
expect(packageJson.bugs?.url).toBe("https://github.com/HOOLC/slack-codex-broker/issues");
expect(packageJson.homepage).toBe("https://github.com/HOOLC/slack-codex-broker#readme");
expect(packageJson.repository?.url).toBe("git+https://github.com/HOOLC/workwork.git");
expect(packageJson.bugs?.url).toBe("https://github.com/HOOLC/workwork/issues");
expect(packageJson.homepage).toBe("https://github.com/HOOLC/workwork#readme");
expect(adminPackageJson).toMatchObject({
name: "@agent-session-broker/admin",
homepage: "https://github.com/HOOLC/workwork#readme",
bugs: {
url: "https://github.com/HOOLC/workwork/issues",
},
repository: {
url: "git+https://github.com/HOOLC/workwork.git",
},
bin: {
"agent-session-broker-macos-bootstrap": "./scripts/ops/macos-bootstrap.mjs",
},
});
expect(workerPackageJson).toMatchObject({
name: "@agent-session-broker/worker",
homepage: "https://github.com/HOOLC/workwork#readme",
bugs: {
url: "https://github.com/HOOLC/workwork/issues",
},
repository: {
url: "git+https://github.com/HOOLC/workwork.git",
},
});
expect(adminPackageJson.publishConfig).toMatchObject({
access: "public",
Expand Down
13 changes: 6 additions & 7 deletions test/rfc-0001-docs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,16 +514,15 @@ describe("RFC 0001 documentation", () => {
expect(readme).toContain("metadata recursively redacts unsafe string fields while preserving safe posture text such as `FEISHU_APP_SECRET=missing`");
expect(readme).toContain("sanitized pre-rollout log snapshot");
expect(readme).toContain("redacts non-structured lines instead of copying raw Docker log text");
expect(readme).toContain("platform-aware `Slack/Feishu user -> GitHub author` mappings");
expect(readme).toContain("GET /admin/api/status?platform=slack|feishu");
expect(readme).toContain("DELETE /admin/api/github-authors/:userId?platform=slack|feishu");
expect(readme).toContain("filters sessions, jobs, and GitHub author mappings to that platform");
expect(readme).toContain("admin UI exposes platform health and platform-aware session state");
expect(readme).toContain("Generic chat APIs are platform-aware");
expect(readme).toContain("broker-managed job callbacks that carry chat coordinates");
expect(readme).toContain("without implying that every admin endpoint accepts a `platform` filter");
expect(readme).toContain("Generic chat/job `platform` query/body values must be `slack` or `feishu`; invalid values return 400 `invalid_platform` instead of falling back to Slack");
expect(readme).toContain("allowlisted `recentBrokerLogs` remain cross-platform");
expect(readme).toContain("Platform query/body values must be `slack` or `feishu`; invalid values return 400 `invalid_platform` instead of falling back to Slack");
expect(readme).toContain("generic platform-aware chat endpoints");
expect(readme).toContain("Generic `/chat/*` JSON/query contracts use canonical `conversationId` and `rootMessageId` fields");
expect(readme).toContain("also accepts `conversation_id` and `root_message_id` aliases");
expect(readme).toContain("Invalid `platform` values return 400 `invalid_platform` with allowed values `slack` and `feishu`");
expect(readme).toContain("For generic chat and job APIs, invalid `platform` values return 400 `invalid_platform` with allowed values `slack` and `feishu`");
expect(readme).toContain("Generic file uploads use canonical `filePath` or `contentBase64`");
expect(readme).toContain("`file_path` and `content_base64` aliases accepted and named in validation errors");
expect(readme).toContain("Inline `contentBase64`/`content_base64` uploads require `filename` and must decode to non-empty file content");
Expand Down
Loading