@codori/server 0.0.3 → 0.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.
Files changed (44) hide show
  1. package/README.md +34 -0
  2. package/client-dist/200.html +1 -1
  3. package/client-dist/404.html +1 -1
  4. package/client-dist/_nuxt/BsofOenw.js +1 -0
  5. package/client-dist/_nuxt/C1GdLDfB.js +1 -0
  6. package/client-dist/_nuxt/{CaHFvrMF.js → CNSSoePX.js} +1 -1
  7. package/client-dist/_nuxt/CQVB8E20.js +1 -0
  8. package/client-dist/_nuxt/{Cvj6lHH1.js → CsE-687t.js} +51 -51
  9. package/client-dist/_nuxt/{Bn41X3Zq.js → DJfsg7Kb.js} +1 -1
  10. package/client-dist/_nuxt/DcJmCJZR.js +1 -0
  11. package/client-dist/_nuxt/{CxIrrT6Q.js → Dg2XLMZm.js} +1 -1
  12. package/client-dist/_nuxt/DhLoSG-h.js +3 -0
  13. package/client-dist/_nuxt/DhRbzQPR.js +1 -0
  14. package/client-dist/_nuxt/{B9M-aXlQ.js → OylMiRf9.js} +3 -3
  15. package/client-dist/_nuxt/builds/latest.json +1 -1
  16. package/client-dist/_nuxt/builds/meta/468a0ff2-bd27-45c6-bd89-5ac776d98662.json +1 -0
  17. package/client-dist/_nuxt/{ClvUKBzL.js → ecRbsnab.js} +1 -1
  18. package/client-dist/index.html +1 -1
  19. package/dist/cli.d.ts +5 -1
  20. package/dist/cli.js +171 -19
  21. package/dist/config.d.ts +2 -0
  22. package/dist/config.js +26 -2
  23. package/dist/http-server.d.ts +8 -0
  24. package/dist/http-server.js +59 -1
  25. package/dist/index.d.ts +3 -0
  26. package/dist/index.js +3 -0
  27. package/dist/process-manager.d.ts +19 -0
  28. package/dist/process-manager.js +126 -3
  29. package/dist/runtime-store.js +5 -3
  30. package/dist/service-adapters.d.ts +39 -0
  31. package/dist/service-adapters.js +185 -0
  32. package/dist/service-update.d.ts +26 -0
  33. package/dist/service-update.js +196 -0
  34. package/dist/service.d.ts +86 -0
  35. package/dist/service.js +616 -0
  36. package/dist/types.d.ts +13 -0
  37. package/package.json +1 -1
  38. package/client-dist/_nuxt/B13tqEXg.js +0 -1
  39. package/client-dist/_nuxt/Bgck3A5L.js +0 -1
  40. package/client-dist/_nuxt/DS99AY4f.js +0 -1
  41. package/client-dist/_nuxt/Dp21CzWX.js +0 -1
  42. package/client-dist/_nuxt/ER2AV0-Z.js +0 -1
  43. package/client-dist/_nuxt/builds/meta/5f4263d4-eac2-4ff0-9a82-eb8be28751d5.json +0 -1
  44. package/client-dist/_nuxt/nHwHvv6y.js +0 -3
@@ -0,0 +1,86 @@
1
+ export type ServiceScope = 'user' | 'system';
2
+ export type ServicePlatform = 'darwin' | 'linux';
3
+ export type ServiceInstallMetadata = {
4
+ installId: string;
5
+ root: string;
6
+ host: string;
7
+ port: number;
8
+ scope: ServiceScope;
9
+ platform: ServicePlatform;
10
+ serviceName: string;
11
+ serviceFilePath: string;
12
+ launcherPath: string;
13
+ installedAt: string;
14
+ };
15
+ export type RootPromptDefault = {
16
+ value: string | null;
17
+ reason: 'git' | 'workspace-marker' | 'nested-git-projects' | 'none';
18
+ shouldConfirm: boolean;
19
+ };
20
+ export type HostPromptDefault = {
21
+ value: string;
22
+ source: 'explicit' | 'tailscale' | 'wildcard';
23
+ warning: string | null;
24
+ };
25
+ export type CommandResult = {
26
+ exitCode: number | null;
27
+ stdout: string;
28
+ stderr: string;
29
+ };
30
+ export type CommandRunner = (command: string, args: string[]) => Promise<CommandResult>;
31
+ export type LauncherScriptInput = {
32
+ installId: string;
33
+ root: string;
34
+ host: string;
35
+ port: number;
36
+ scope: ServiceScope;
37
+ nodePath: string;
38
+ npxPath: string;
39
+ };
40
+ export type ServicePrompt = {
41
+ input: (message: string, defaultValue?: string) => Promise<string>;
42
+ confirm: (message: string, defaultValue: boolean) => Promise<boolean>;
43
+ close: () => Promise<void> | void;
44
+ };
45
+ export type ServiceCommandName = 'install-service' | 'setup-service' | 'restart-service' | 'uninstall-service';
46
+ export type ServiceCommandOptions = {
47
+ root?: string;
48
+ host?: string;
49
+ port?: string | number;
50
+ scope?: string;
51
+ yes?: boolean;
52
+ };
53
+ export type ServiceCommandDependencies = {
54
+ cwd?: string;
55
+ homeDir?: string;
56
+ platform?: NodeJS.Platform;
57
+ nodePath?: string;
58
+ npxPath?: string;
59
+ stdin?: NodeJS.ReadableStream;
60
+ stdout?: NodeJS.WritableStream;
61
+ runCommand?: CommandRunner;
62
+ prompt?: ServicePrompt;
63
+ now?: () => Date;
64
+ };
65
+ export type ServiceOperationResult = {
66
+ action: 'install' | 'restart' | 'uninstall';
67
+ metadata: ServiceInstallMetadata;
68
+ };
69
+ export declare const CODORI_SERVICE_MANAGED_ENV = "CODORI_SERVICE_MANAGED";
70
+ export declare const CODORI_SERVICE_INSTALL_ID_ENV = "CODORI_SERVICE_INSTALL_ID";
71
+ export declare const CODORI_SERVICE_SCOPE_ENV = "CODORI_SERVICE_SCOPE";
72
+ export declare const toServiceInstallId: (root: string) => string;
73
+ export declare const getServiceMetadataDirectory: (installId: string, homeDir?: string) => string;
74
+ export declare const getServiceMetadataPath: (installId: string, homeDir?: string) => string;
75
+ export declare const getServiceLauncherPath: (installId: string, homeDir?: string) => string;
76
+ export declare const detectRootPromptDefault: (cwd: string) => RootPromptDefault;
77
+ export declare const resolveServiceScope: (value: string | undefined) => ServiceScope;
78
+ export declare const parseServicePort: (value: string | number | undefined) => number | undefined;
79
+ export declare const resolveDefaultServicePort: (value: number | undefined) => number;
80
+ export declare const getWildcardHostWarning: () => string;
81
+ export declare const detectTailscaleIpv4: (runCommand?: CommandRunner) => Promise<string | null>;
82
+ export declare const resolveHostPromptDefault: (explicitHost: string | undefined, runCommand?: CommandRunner) => Promise<HostPromptDefault>;
83
+ export declare const buildLauncherScript: ({ installId, root, host, port, scope, nodePath, npxPath }: LauncherScriptInput) => string;
84
+ export declare const installService: (options?: ServiceCommandOptions, dependencies?: ServiceCommandDependencies) => Promise<ServiceOperationResult>;
85
+ export declare const restartService: (options?: ServiceCommandOptions, dependencies?: ServiceCommandDependencies) => Promise<ServiceOperationResult>;
86
+ export declare const uninstallService: (options?: ServiceCommandOptions, dependencies?: ServiceCommandDependencies) => Promise<ServiceOperationResult>;