@hue-run/sdk 0.3.2 → 0.4.1
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/CLI.md +270 -47
- package/ENVIRONMENTS.md +10 -0
- package/README.md +19 -3
- package/dist/client.d.ts +5 -5
- package/dist/client.js +13 -6
- package/dist/environment/tools.d.ts +6 -1
- package/dist/environment/tools.js +7 -1
- package/dist/environment/types.d.ts +6 -1
- package/dist/receipt.js +36 -8
- package/dist/setup/application.d.ts +74 -0
- package/dist/setup/application.js +766 -0
- package/dist/setup/backend.d.ts +229 -0
- package/dist/setup/backend.js +855 -0
- package/dist/setup/checkpoint.js +100 -30
- package/dist/setup/cli.js +20 -4
- package/dist/setup/configure.d.ts +13 -0
- package/dist/setup/configure.js +454 -0
- package/dist/setup/credential.d.ts +2 -0
- package/dist/setup/credential.js +9 -0
- package/dist/setup/detect.js +4 -1
- package/dist/setup/installation.d.ts +118 -0
- package/dist/setup/installation.js +605 -0
- package/dist/setup/lock.d.ts +2 -0
- package/dist/setup/lock.js +38 -0
- package/dist/setup/machine.d.ts +1 -10
- package/dist/setup/machine.js +8 -7
- package/dist/setup/render.d.ts +3 -1
- package/dist/setup/render.js +209 -6
- package/dist/setup/runner.d.ts +26 -76
- package/dist/setup/runner.js +320 -45
- package/dist/setup/socket.d.ts +7 -0
- package/dist/setup/socket.js +144 -0
- package/dist/setup/source.d.ts +9 -0
- package/dist/setup/source.js +269 -0
- package/dist/setup/types.d.ts +16 -9
- package/dist/setup/types.js +1 -1
- package/dist/setup.d.ts +6 -2
- package/dist/setup.js +3 -0
- package/dist/types.d.ts +24 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -1
- package/setup-events.schema.json +16 -9
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { SetupFileChange } from "./configure.js";
|
|
2
|
+
import { type FileSetupInstallationStore, type SetupInstallationRecord, type SetupStoredApplicationEvidence } from "./installation.js";
|
|
3
|
+
import type { SetupProjectDetection } from "./types.js";
|
|
4
|
+
/** Closed automatic application matrix; other projects require an explicit agent-owned integration. */
|
|
5
|
+
export type SetupApplicationPlan = {
|
|
6
|
+
/** JavaScript or TypeScript application using the shared TypeScript SDK. */
|
|
7
|
+
language: "typescript";
|
|
8
|
+
/** Package manager selected from the project's manifest and lockfile. */
|
|
9
|
+
manager: "bun" | "npm";
|
|
10
|
+
/** Recognized HTTP framework. */
|
|
11
|
+
framework: "express";
|
|
12
|
+
/** Runtime named by the recognized start script; defaults to Node when omitted. */
|
|
13
|
+
runtime?: "node" | "bun";
|
|
14
|
+
/** Whether the start script explicitly enables Node source maps. */
|
|
15
|
+
sourceMaps?: boolean;
|
|
16
|
+
/** Validated project-relative application entrypoint. */
|
|
17
|
+
entrypoint: string;
|
|
18
|
+
/** One literal loopback HTTP pathname selected for the application request. */
|
|
19
|
+
requestPath: string;
|
|
20
|
+
/** SHA-256 of the source inspected during planning. */
|
|
21
|
+
entryDigest: string;
|
|
22
|
+
} | {
|
|
23
|
+
/** Python application using the Python SDK. */
|
|
24
|
+
language: "python";
|
|
25
|
+
/** Environment manager for the supported Python application. */
|
|
26
|
+
manager: "uv";
|
|
27
|
+
/** Recognized HTTP framework. */
|
|
28
|
+
framework: "flask";
|
|
29
|
+
/** Supported project-relative Flask entrypoint. */
|
|
30
|
+
entrypoint: "app.py";
|
|
31
|
+
/** One literal loopback HTTP pathname selected for the application request. */
|
|
32
|
+
requestPath: string;
|
|
33
|
+
/** SHA-256 of the source inspected during planning. */
|
|
34
|
+
entryDigest: string;
|
|
35
|
+
};
|
|
36
|
+
/** Stable reason an automatic application integration is not safe. */
|
|
37
|
+
export declare class SetupApplicationActionRequired extends Error {
|
|
38
|
+
/** Stable reason the caller must resolve before automatic integration continues. */
|
|
39
|
+
readonly code: "ambiguous-project" | "unsupported-manager" | "unsupported-framework" | "ambiguous-entrypoint" | "custom-instrumentation";
|
|
40
|
+
constructor(
|
|
41
|
+
/** Stable reason the caller must resolve before automatic integration continues. */
|
|
42
|
+
code: "ambiguous-project" | "unsupported-manager" | "unsupported-framework" | "ambiguous-entrypoint" | "custom-instrumentation", message: string);
|
|
43
|
+
}
|
|
44
|
+
/** Fixed argv execution boundary used for package managers and application entrypoints. */
|
|
45
|
+
export interface SetupCommand {
|
|
46
|
+
/** Fixed executable name or runtime path; never evaluated by a shell. */
|
|
47
|
+
command: string;
|
|
48
|
+
/** Explicit argument vector supplied to the executable. */
|
|
49
|
+
args: string[];
|
|
50
|
+
/** Selected application's working directory. */
|
|
51
|
+
cwd: string;
|
|
52
|
+
/** Optional child environment; values are never included in command output. */
|
|
53
|
+
env?: NodeJS.ProcessEnv;
|
|
54
|
+
/** Maximum elapsed execution time before termination. */
|
|
55
|
+
timeoutMillis: number;
|
|
56
|
+
}
|
|
57
|
+
/** Executes a fixed argv without a shell and returns only its status. */
|
|
58
|
+
export type SetupCommandRunner = (command: SetupCommand) => Promise<void>;
|
|
59
|
+
/** Statically recognizes the deliberately narrow automatic matrix without executing project code. */
|
|
60
|
+
export declare function planSetupApplication(project: SetupProjectDetection): Promise<SetupApplicationPlan>;
|
|
61
|
+
/** Default command runner: fixed argv, no shell, bounded output and deadline. */
|
|
62
|
+
export declare function runSetupCommand(input: SetupCommand): Promise<void>;
|
|
63
|
+
/** Installs the exact runtime with the detected owner of the project's manifest and lockfile. */
|
|
64
|
+
export declare function installSetupRuntime(project: SetupProjectDetection, plan: SetupApplicationPlan, runner?: SetupCommandRunner): Promise<boolean>;
|
|
65
|
+
/** Adds only two owned wiring blocks around an existing app object; business logic is untouched. */
|
|
66
|
+
export declare function wireSetupApplication(store: FileSetupInstallationStore, record: SetupInstallationRecord, plan: SetupApplicationPlan): Promise<SetupFileChange | undefined>;
|
|
67
|
+
/** Starts the existing entrypoint without a shell and exercises one existing HTTP GET route. */
|
|
68
|
+
export declare function exerciseSetupApplication(store: FileSetupInstallationStore, record: SetupInstallationRecord, plan: SetupApplicationPlan, signal?: AbortSignal, deadlines?: {
|
|
69
|
+
readinessMillis: number;
|
|
70
|
+
requestMillis: number;
|
|
71
|
+
evidenceMillis: number;
|
|
72
|
+
/** Internal loopback test seam; the public CLI always chooses a random port. */
|
|
73
|
+
port?: number;
|
|
74
|
+
}): Promise<SetupStoredApplicationEvidence>;
|