@straiffi/archon 1.0.0 → 1.0.5

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.
@@ -31,7 +31,8 @@ import { exportProjectMemoryArchive, importProjectMemoryArchive } from './lib/pr
31
31
  import { buildReviewFindingsResponse, computeDiffSignature, getLatestReviewRunForContext } from './lib/reviewFindings.js';
32
32
  import { getDiscoveredSkills, normalizeSkillNames } from './lib/skills.js';
33
33
  import { clearAllPreviewProxies } from './lib/previewProxy.js';
34
- import { resolveClientBuildPaths, shouldServeClientApp } from './lib/staticClient.js';
34
+ import { shutdownRealtimeServer } from './lib/shutdown.js';
35
+ import { resolveClientBuildPaths, shouldServeClientApp, STATIC_CLIENT_DIRECTORY_OPTIONS, STATIC_CLIENT_INDEX_OPTIONS, } from './lib/staticClient.js';
35
36
  import { deleteIntegrationConnection, getGitHubConnectionConfig, getJiraConnectionConfig, listIntegrationConnections, upsertIntegrationConnection, } from './lib/integrations/index.js';
36
37
  import { createGitHubPullRequest, findOpenGitHubPullRequest, findOpenGitHubPullRequestByHeadBranch, getGitHubPullRequestComments, getGitHubPullRequestReviews, getGitHubPullRequest, GitHubApiError, hasGitHubRemoteBranch, resolveGitHubRepository, validateGitHubConnection, } from './lib/integrations/github.js';
37
38
  import { importJiraIssue, JiraApiError, validateJiraConnection } from './lib/integrations/jira.js';
@@ -5017,7 +5018,7 @@ app.delete('/tickets/:id', async (req, res) => {
5017
5018
  });
5018
5019
  const clientBuild = resolveClientBuildPaths(import.meta.url);
5019
5020
  if (clientBuild) {
5020
- app.use(express.static(clientBuild.directoryPath, { index: false }));
5021
+ app.use(express.static(clientBuild.directoryPath, STATIC_CLIENT_DIRECTORY_OPTIONS));
5021
5022
  app.get(/.*/, (req, res, next) => {
5022
5023
  if (!shouldServeClientApp({
5023
5024
  method: req.method,
@@ -5027,7 +5028,7 @@ if (clientBuild) {
5027
5028
  next();
5028
5029
  return;
5029
5030
  }
5030
- res.sendFile(clientBuild.indexPath, error => {
5031
+ res.sendFile(clientBuild.indexPath, STATIC_CLIENT_INDEX_OPTIONS, error => {
5031
5032
  if (error) {
5032
5033
  next(error);
5033
5034
  }
@@ -5084,22 +5085,15 @@ export const startServer = ({ port = DEFAULT_PORT, host } = {}) => {
5084
5085
  });
5085
5086
  };
5086
5087
  export const shutdownServer = async (signal) => {
5087
- if (signal) {
5088
- console.log(`\nReceived ${signal}, shutting down...`);
5089
- }
5090
- closeAllTerminalSessions();
5091
- await Promise.all([clearAllPreviewProxies(), stopAllBuildAgents(), stopAllTickets()]);
5092
- if (httpServer.listening) {
5093
- await new Promise((resolve, reject) => {
5094
- httpServer.close(error => {
5095
- if (error) {
5096
- reject(error);
5097
- return;
5098
- }
5099
- resolve();
5100
- });
5101
- });
5102
- }
5088
+ await shutdownRealtimeServer({
5089
+ signal,
5090
+ io,
5091
+ httpServer,
5092
+ closeAllTerminalSessions,
5093
+ clearAllPreviewProxies,
5094
+ stopAllBuildAgents,
5095
+ stopAllTickets,
5096
+ });
5103
5097
  };
5104
5098
  export const registerShutdownHandlers = () => {
5105
5099
  const createHandler = (signal) => {