@jini-ai/devops 0.6.22 → 0.7.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/CHANGELOG.md +24 -0
- package/dist/checks/coverage/disk.js +2 -2
- package/dist/checks/coverage/floors.js +2 -2
- package/dist/checks/coverage/lcov.d.ts +15 -1
- package/dist/checks/coverage/lcov.js +77 -7
- package/dist/core/export-failure-summary.d.ts +9 -2
- package/dist/deploy/config-contracts.d.ts +82 -0
- package/dist/deploy/config-contracts.js +7 -0
- package/dist/deploy/config-descriptors.d.ts +47 -0
- package/dist/deploy/config-descriptors.js +92 -0
- package/dist/deploy/index.d.ts +12 -0
- package/dist/deploy/index.js +12 -0
- package/dist/deploy/ops-contracts.d.ts +168 -0
- package/dist/deploy/ops-contracts.js +2 -0
- package/dist/deploy/ops-descriptors.d.ts +23 -0
- package/dist/deploy/ops-descriptors.js +77 -0
- package/dist/deploy/ops-registry.d.ts +7 -0
- package/dist/deploy/ops-registry.js +15 -0
- package/dist/deploy/ops-runner.d.ts +103 -0
- package/dist/deploy/ops-runner.js +343 -0
- package/dist/deploy/ops-secret-card.d.ts +13 -0
- package/dist/deploy/ops-secret-card.js +62 -0
- package/dist/deploy/ops-secrets.d.ts +74 -0
- package/dist/deploy/ops-secrets.js +221 -0
- package/dist/deploy/ops-tool-contracts.d.ts +223 -0
- package/dist/deploy/ops-tool-contracts.js +2 -0
- package/dist/deploy/ops-tools.d.ts +8 -0
- package/dist/deploy/ops-tools.js +117 -0
- package/dist/deploy/target-contracts.d.ts +231 -0
- package/dist/deploy/target-contracts.js +2 -0
- package/dist/deploy/target-descriptors.d.ts +23 -0
- package/dist/deploy/target-descriptors.js +273 -0
- package/dist/local-dev/node-runtime.d.ts +3 -1
- package/dist/local-dev/node-runtime.js +4 -4
- package/dist/static-export/contracts.d.ts +3 -0
- package/dist/static-export/runner.js +2 -1
- package/package.json +6 -6
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/** Generic deployment observation and deploy contract; vendor code belongs to trusted plugins. */
|
|
2
|
+
export type DeployOpsState = "healthy" | "deploying" | "failing" | "stopped" | "unknown";
|
|
3
|
+
export interface DeployOpsStatus {
|
|
4
|
+
platform: string;
|
|
5
|
+
target: string;
|
|
6
|
+
state: DeployOpsState;
|
|
7
|
+
summary: string;
|
|
8
|
+
items: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
state: string;
|
|
12
|
+
detail?: string;
|
|
13
|
+
}>;
|
|
14
|
+
url?: string;
|
|
15
|
+
checkedAt: string;
|
|
16
|
+
}
|
|
17
|
+
export interface DeployOpsLogs {
|
|
18
|
+
platform: string;
|
|
19
|
+
target: string;
|
|
20
|
+
lines: Array<{
|
|
21
|
+
at?: string;
|
|
22
|
+
source?: string;
|
|
23
|
+
level?: string;
|
|
24
|
+
message: string;
|
|
25
|
+
}>;
|
|
26
|
+
truncated: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface DeployOpsTargets {
|
|
29
|
+
platform: string;
|
|
30
|
+
targets: Array<{
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
state?: string;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
export interface DeployOpsInput {
|
|
37
|
+
platform: string;
|
|
38
|
+
target: string;
|
|
39
|
+
credentialLabel?: string | undefined;
|
|
40
|
+
runId?: string | undefined;
|
|
41
|
+
branch?: string | undefined;
|
|
42
|
+
limit?: number;
|
|
43
|
+
org?: string | undefined;
|
|
44
|
+
ref?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface DeployOpsResponse {
|
|
47
|
+
status: number;
|
|
48
|
+
json?: unknown;
|
|
49
|
+
text: string;
|
|
50
|
+
truncated?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/** A JSON write. The host serializes `body`; a module never sets headers or chooses the credential.
|
|
53
|
+
* DELETE is only bound for the secret-removal verb; every other verb's facade refuses it. */
|
|
54
|
+
export interface DeployOpsSendRequest {
|
|
55
|
+
method: "POST" | "PATCH" | "PUT" | "DELETE";
|
|
56
|
+
url: string;
|
|
57
|
+
body?: unknown;
|
|
58
|
+
}
|
|
59
|
+
export interface DeployOpsDeployInput {
|
|
60
|
+
target: string;
|
|
61
|
+
ref?: string;
|
|
62
|
+
workflowFile?: string;
|
|
63
|
+
workflowFiles?: readonly string[];
|
|
64
|
+
}
|
|
65
|
+
/** `started` means the platform accepted the request; landing is observed with status/wait afterwards. */
|
|
66
|
+
export interface DeployOpsDeployResult {
|
|
67
|
+
platform: string;
|
|
68
|
+
target: string;
|
|
69
|
+
/** False is a safe refusal: no deployment was dispatched. */
|
|
70
|
+
started: boolean;
|
|
71
|
+
summary: string;
|
|
72
|
+
runId?: string;
|
|
73
|
+
sha?: string;
|
|
74
|
+
machineIds?: string[];
|
|
75
|
+
image?: string;
|
|
76
|
+
url?: string;
|
|
77
|
+
}
|
|
78
|
+
/** A host secret as listed: never its value. `digest` is the vendor's own, not comparable across vendors. */
|
|
79
|
+
export interface DeployOpsSecretInfo {
|
|
80
|
+
name: string;
|
|
81
|
+
digest?: string;
|
|
82
|
+
updatedAt?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface DeployOpsSecretList {
|
|
85
|
+
secrets: DeployOpsSecretInfo[];
|
|
86
|
+
truncated?: boolean;
|
|
87
|
+
}
|
|
88
|
+
/** When a written secret reaches the running app: on the next deploy (staged), after a restart the vendor starts, or at once. */
|
|
89
|
+
export type DeployOpsSecretAppliesOn = "next-deploy" | "vendor-restart" | "immediately";
|
|
90
|
+
export interface DeployOpsSecretCapabilities {
|
|
91
|
+
appliesOn: DeployOpsSecretAppliesOn;
|
|
92
|
+
supportsStaging: boolean;
|
|
93
|
+
}
|
|
94
|
+
/** `readSecret` is host-only: its value is compared or copied server side and never returned to the model. */
|
|
95
|
+
export type DeployOpsSecretRead = {
|
|
96
|
+
value: string;
|
|
97
|
+
} | {
|
|
98
|
+
absent: true;
|
|
99
|
+
};
|
|
100
|
+
export interface DeployOpsSecretWrite {
|
|
101
|
+
version?: string | number;
|
|
102
|
+
}
|
|
103
|
+
export interface DeployOpsContext {
|
|
104
|
+
/** Bound to one saved credential and this platform's allowed hosts. Never follows redirects. */
|
|
105
|
+
get(url: string): Promise<DeployOpsResponse>;
|
|
106
|
+
/** Same binding as `get`: one credential, the platform's hosts, HTTPS only, no redirects, capped and redacted. */
|
|
107
|
+
send(request: DeployOpsSendRequest): Promise<DeployOpsResponse>;
|
|
108
|
+
nowIso(): string;
|
|
109
|
+
/** Abortable pause between follow-up reads (e.g. waiting for a dispatched run to appear); capped by the host. */
|
|
110
|
+
sleep(ms: number): Promise<void>;
|
|
111
|
+
/** A model-visible refusal, without importing host code into a plugin module. */
|
|
112
|
+
fail(message: string): never;
|
|
113
|
+
}
|
|
114
|
+
export interface DeployOpsModule {
|
|
115
|
+
status(ctx: DeployOpsContext, input: Pick<DeployOpsInput, "target" | "runId" | "branch">): Promise<DeployOpsStatus>;
|
|
116
|
+
logs(ctx: DeployOpsContext, input: Pick<DeployOpsInput, "target" | "runId" | "branch"> & {
|
|
117
|
+
limit: number;
|
|
118
|
+
}): Promise<DeployOpsLogs>;
|
|
119
|
+
listTargets?(ctx: DeployOpsContext, input: {
|
|
120
|
+
org?: string | undefined;
|
|
121
|
+
}): Promise<DeployOpsTargets>;
|
|
122
|
+
/** Optional: a platform without it is observe-only and `runDeploy` refuses it. */
|
|
123
|
+
deploy?(ctx: DeployOpsContext, input: DeployOpsDeployInput): Promise<DeployOpsDeployResult>;
|
|
124
|
+
/** Optional secrets adapter; `listSecrets`, `setSecret` and `unsetSecret` come together with `secretCapabilities`. */
|
|
125
|
+
secretCapabilities?: DeployOpsSecretCapabilities;
|
|
126
|
+
listSecrets?(ctx: DeployOpsContext, input: {
|
|
127
|
+
target: string;
|
|
128
|
+
}): Promise<DeployOpsSecretList>;
|
|
129
|
+
setSecret?(ctx: DeployOpsContext, input: {
|
|
130
|
+
target: string;
|
|
131
|
+
name: string;
|
|
132
|
+
value: string;
|
|
133
|
+
}): Promise<DeployOpsSecretWrite>;
|
|
134
|
+
unsetSecret?(ctx: DeployOpsContext, input: {
|
|
135
|
+
target: string;
|
|
136
|
+
name: string;
|
|
137
|
+
}): Promise<DeployOpsSecretWrite>;
|
|
138
|
+
/** Optional: enables skip-if-identical and copying one secret to another name on the same target. */
|
|
139
|
+
readSecret?(ctx: DeployOpsContext, input: {
|
|
140
|
+
target: string;
|
|
141
|
+
name: string;
|
|
142
|
+
}): Promise<DeployOpsSecretRead>;
|
|
143
|
+
}
|
|
144
|
+
export interface DeployOpsDescriptor {
|
|
145
|
+
id: string;
|
|
146
|
+
label: string;
|
|
147
|
+
module: string;
|
|
148
|
+
hosts: readonly string[];
|
|
149
|
+
}
|
|
150
|
+
export interface LoadedDeployOps {
|
|
151
|
+
descriptor: DeployOpsDescriptor;
|
|
152
|
+
pluginId: string;
|
|
153
|
+
module: DeployOpsModule;
|
|
154
|
+
}
|
|
155
|
+
export interface DeployOpsRegistry {
|
|
156
|
+
get(id: string): LoadedDeployOps | undefined;
|
|
157
|
+
list(): readonly LoadedDeployOps[];
|
|
158
|
+
readonly refusals: readonly string[];
|
|
159
|
+
/** Platform id -> id of the installed plugin that provides it but is switched off. */
|
|
160
|
+
readonly switchedOff?: ReadonlyMap<string, string>;
|
|
161
|
+
}
|
|
162
|
+
export interface DeployOpsWaitResult {
|
|
163
|
+
reached: boolean;
|
|
164
|
+
waitedSeconds: number;
|
|
165
|
+
polls: number;
|
|
166
|
+
last: DeployOpsStatus;
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=ops-contracts.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { DeployOpsDescriptor, DeployOpsModule } from './ops-contracts.js';
|
|
2
|
+
/**
|
|
3
|
+
* @file The pure parser for a plugin's `deploy-ops` contribution file, and the module contract each
|
|
4
|
+
* declared platform's default export must meet. The host reads the file and imports the module
|
|
5
|
+
* through its own activation, digest and containment gates.
|
|
6
|
+
*/
|
|
7
|
+
type ParseResult = {
|
|
8
|
+
ok: true;
|
|
9
|
+
descriptors: DeployOpsDescriptor[];
|
|
10
|
+
} | {
|
|
11
|
+
ok: false;
|
|
12
|
+
reason: string;
|
|
13
|
+
};
|
|
14
|
+
/** Parse data only. Duplicate ids, URL hosts and escaping paths refuse the entire manifest. O(platforms). */
|
|
15
|
+
export declare function parseDeployOpsFile({ raw }: {
|
|
16
|
+
readonly raw: string;
|
|
17
|
+
}, _optional?: Record<string, never>): ParseResult;
|
|
18
|
+
/** Export shape and secrets capabilities remain this domain's contract. @complexity O(1). */
|
|
19
|
+
export declare function asDeployOpsModule({ exported: candidate }: {
|
|
20
|
+
readonly exported: unknown;
|
|
21
|
+
}, _optional?: Record<string, never>): DeployOpsModule | string;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=ops-descriptors.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const object = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2
|
+
/** Parse data only. Duplicate ids, URL hosts and escaping paths refuse the entire manifest. O(platforms). */
|
|
3
|
+
export function parseDeployOpsFile({ raw }, _optional = {}) {
|
|
4
|
+
let value;
|
|
5
|
+
try {
|
|
6
|
+
value = JSON.parse(raw);
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return { ok: false, reason: "not valid JSON" };
|
|
10
|
+
}
|
|
11
|
+
if (!object(value) || value.schemaVersion !== 1)
|
|
12
|
+
return { ok: false, reason: "schemaVersion must be 1" };
|
|
13
|
+
if (!Array.isArray(value.platforms) || value.platforms.length > 32)
|
|
14
|
+
return { ok: false, reason: "platforms must be an array of at most 32 entries" };
|
|
15
|
+
const descriptors = [];
|
|
16
|
+
const seen = new Set();
|
|
17
|
+
for (const [i, entry] of value.platforms.entries()) {
|
|
18
|
+
const at = `platforms[${i}]`;
|
|
19
|
+
if (!object(entry))
|
|
20
|
+
return { ok: false, reason: `${at} must be an object` };
|
|
21
|
+
const reason = descriptorError({ entry, at, seen }, {});
|
|
22
|
+
if (reason)
|
|
23
|
+
return { ok: false, reason };
|
|
24
|
+
const { id, label, module, hosts } = entry;
|
|
25
|
+
seen.add(id);
|
|
26
|
+
descriptors.push({ id, label, module, hosts });
|
|
27
|
+
}
|
|
28
|
+
return { ok: true, descriptors };
|
|
29
|
+
}
|
|
30
|
+
/** Lexical containment is checked before the lifecycle loader checks disk containment. */
|
|
31
|
+
function containedModule({ module }, _optional = {}) {
|
|
32
|
+
if (typeof module !== "string" || !module.endsWith(".mjs"))
|
|
33
|
+
return false;
|
|
34
|
+
return !module.startsWith("/") && !module.includes("\\") && !module.split("/").some(s => s === ".." || s === "." || !s);
|
|
35
|
+
}
|
|
36
|
+
function validHosts({ hosts }, _optional = {}) {
|
|
37
|
+
return Array.isArray(hosts) && hosts.length > 0 && hosts.length <= 8 && hosts.every(host => typeof host === "string" && host.length <= 253 && /^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$/.test(host));
|
|
38
|
+
}
|
|
39
|
+
function descriptorError({ entry, at, seen }, _optional = {}) {
|
|
40
|
+
const { id, label, module, hosts } = entry;
|
|
41
|
+
if (typeof id !== "string" || id.length > 64 || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(id))
|
|
42
|
+
return `${at}.id must be a lowercase hyphenated id`;
|
|
43
|
+
if (seen.has(id))
|
|
44
|
+
return `${at}.id '${id}' is declared twice`;
|
|
45
|
+
return descriptorFieldsError({ label, module, hosts, at }, {});
|
|
46
|
+
}
|
|
47
|
+
function descriptorFieldsError({ label, module, hosts, at }, _optional = {}) {
|
|
48
|
+
if (typeof label !== "string" || !label.trim() || label.length > 100)
|
|
49
|
+
return `${at}.label must be a non-empty string`;
|
|
50
|
+
if (!containedModule({ module }, {}))
|
|
51
|
+
return `${at}.module must be a contained relative .mjs path`;
|
|
52
|
+
if (!validHosts({ hosts }, {}))
|
|
53
|
+
return `${at}.hosts must be a non-empty array of HTTPS hostnames`;
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
const OPTIONAL_VERBS = ["listTargets", "deploy", "listSecrets", "setSecret", "unsetSecret", "readSecret"];
|
|
57
|
+
const SECRET_VERBS = ["listSecrets", "setSecret", "unsetSecret"];
|
|
58
|
+
/** A half secrets adapter would list what it cannot remove (or the reverse), so the verbs and capabilities come as one set. O(1). */
|
|
59
|
+
function secretsShapeError(candidate) {
|
|
60
|
+
const present = SECRET_VERBS.filter(verb => candidate[verb] !== undefined);
|
|
61
|
+
if (present.length === 0)
|
|
62
|
+
return candidate.secretCapabilities !== undefined || candidate.readSecret !== undefined ? "secretCapabilities and readSecret need listSecrets(), setSecret() and unsetSecret()" : undefined;
|
|
63
|
+
if (present.length !== SECRET_VERBS.length)
|
|
64
|
+
return "a secrets adapter must export listSecrets(), setSecret() and unsetSecret() together";
|
|
65
|
+
const caps = candidate.secretCapabilities;
|
|
66
|
+
if (!object(caps) || !["next-deploy", "vendor-restart", "immediately"].includes(caps.appliesOn) || typeof caps.supportsStaging !== "boolean")
|
|
67
|
+
return "secretCapabilities must declare appliesOn and supportsStaging";
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
/** Export shape and secrets capabilities remain this domain's contract. @complexity O(1). */
|
|
71
|
+
export function asDeployOpsModule({ exported: candidate }, _optional = {}) {
|
|
72
|
+
if (!object(candidate) || typeof candidate.status !== "function" || typeof candidate.logs !== "function" || OPTIONAL_VERBS.some(verb => candidate[verb] !== undefined && typeof candidate[verb] !== "function"))
|
|
73
|
+
return "module must export status() and logs()";
|
|
74
|
+
const reason = secretsShapeError(candidate);
|
|
75
|
+
return reason ?? candidate;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=ops-descriptors.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DeployOpsRegistry, LoadedDeployOps } from './ops-contracts.js';
|
|
2
|
+
/** Refuse an absent id with the switched-off plugin that provides it, else the available ids and loader refusals, rather than guessing a platform. */
|
|
3
|
+
export declare function requireDeployPlatform({ registry, id }: {
|
|
4
|
+
registry: DeployOpsRegistry;
|
|
5
|
+
id: string;
|
|
6
|
+
}, _optional?: {}): LoadedDeployOps;
|
|
7
|
+
//# sourceMappingURL=ops-registry.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Mechanical extraction provenance is recorded in this package's source-map.md.
|
|
2
|
+
import { ToolInputError } from '@jini-ai/core';
|
|
3
|
+
/** Refuse an absent id with the switched-off plugin that provides it, else the available ids and loader refusals, rather than guessing a platform. */
|
|
4
|
+
export function requireDeployPlatform({ registry, id }, _optional = {}) {
|
|
5
|
+
const platform = registry.get(id);
|
|
6
|
+
if (!platform) {
|
|
7
|
+
const pluginId = registry.switchedOff?.get(id);
|
|
8
|
+
if (pluginId !== undefined)
|
|
9
|
+
throw new ToolInputError({ message: `Deployment ops platform '${id}' is provided by plugin '${pluginId}', which is off; turn it on first.` });
|
|
10
|
+
const refusals = registry.refusals.length ? ` ${registry.refusals.join(" ")}` : "";
|
|
11
|
+
throw new ToolInputError({ message: `Unknown deployment ops platform '${id}'. Choose: ${registry.list().map(p => p.descriptor.id).join(", ") || "(none)"}.${refusals}` });
|
|
12
|
+
}
|
|
13
|
+
return platform;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ops-registry.js.map
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { ToolInputError } from '@jini-ai/core';
|
|
2
|
+
import type { DeployOpsRuntime, WaitClock, DeployCredentialDiagnostic } from './ops-tool-contracts.js';
|
|
3
|
+
import type { DeployOpsContext, DeployOpsDeployResult, DeployOpsInput, DeployOpsLogs, DeployOpsStatus, DeployOpsTargets, DeployOpsWaitResult, LoadedDeployOps } from './ops-contracts.js';
|
|
4
|
+
/** Response text is capped before parsing; the credential layer has already redacted secrets. */
|
|
5
|
+
export declare const MAX_RESPONSE_CHARS = 256000;
|
|
6
|
+
/** The daemon applies no default tool timeout; this tool owns its 300s deadline and cancellation. */
|
|
7
|
+
export declare const MAX_WAIT_SECONDS = 300;
|
|
8
|
+
/** One module pause is short; a module that needs longer must poll, so cancellation stays prompt. */
|
|
9
|
+
export declare const MAX_MODULE_SLEEP_MS = 5000;
|
|
10
|
+
export declare const aborted: () => ToolInputError;
|
|
11
|
+
/** Internal control signal caught at the registration boundary; tools return the diagnostic. */
|
|
12
|
+
export declare class DeployCredentialSetupRequired extends ToolInputError {
|
|
13
|
+
readonly credentialSetup: DeployCredentialDiagnostic;
|
|
14
|
+
constructor({ message, credentialSetup }: {
|
|
15
|
+
message: string;
|
|
16
|
+
credentialSetup: DeployCredentialDiagnostic;
|
|
17
|
+
}, _optional?: {});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Bound GET/write facade. Both the platform and saved credential must allow the exact HTTPS origin.
|
|
21
|
+
* `allowDelete` is set only by the secret-removal verb, so no other verb's module can send a DELETE.
|
|
22
|
+
*/
|
|
23
|
+
/** @agent-note The request port must recheck abort at actual I/O after asynchronous auth-scheme loading. */
|
|
24
|
+
export declare function boundContext({ deps, platform, explicit }: {
|
|
25
|
+
deps: DeployOpsRuntime;
|
|
26
|
+
platform: LoadedDeployOps;
|
|
27
|
+
explicit?: string | undefined;
|
|
28
|
+
}, { signal, allowDelete }?: {
|
|
29
|
+
signal?: AbortSignal | undefined;
|
|
30
|
+
allowDelete?: boolean;
|
|
31
|
+
}): Promise<DeployOpsContext>;
|
|
32
|
+
type Operation = "status" | "logs" | "listTargets";
|
|
33
|
+
/** @agent-note loadDeployOps must enforce current admission on each invocation rather than reuse an earlier registry. */
|
|
34
|
+
export declare function runDeployOps(required: {
|
|
35
|
+
deps: DeployOpsRuntime;
|
|
36
|
+
input: DeployOpsInput;
|
|
37
|
+
operation: "status";
|
|
38
|
+
}, optional: {
|
|
39
|
+
signal?: AbortSignal | undefined;
|
|
40
|
+
}): Promise<DeployOpsStatus>;
|
|
41
|
+
export declare function runDeployOps(required: {
|
|
42
|
+
deps: DeployOpsRuntime;
|
|
43
|
+
input: DeployOpsInput;
|
|
44
|
+
operation: "logs";
|
|
45
|
+
}, optional: {
|
|
46
|
+
signal?: AbortSignal | undefined;
|
|
47
|
+
}): Promise<DeployOpsLogs>;
|
|
48
|
+
export declare function runDeployOps(required: {
|
|
49
|
+
deps: DeployOpsRuntime;
|
|
50
|
+
input: DeployOpsInput;
|
|
51
|
+
operation: "listTargets";
|
|
52
|
+
}, optional: {
|
|
53
|
+
signal?: AbortSignal | undefined;
|
|
54
|
+
}): Promise<DeployOpsTargets>;
|
|
55
|
+
export declare function runDeployOps(required: {
|
|
56
|
+
deps: DeployOpsRuntime;
|
|
57
|
+
input: DeployOpsInput;
|
|
58
|
+
operation: Operation;
|
|
59
|
+
}, optional: {
|
|
60
|
+
signal?: AbortSignal | undefined;
|
|
61
|
+
}): Promise<DeployOpsStatus | DeployOpsLogs | DeployOpsTargets>;
|
|
62
|
+
export interface DeployRequest {
|
|
63
|
+
platform: string;
|
|
64
|
+
target: string;
|
|
65
|
+
ref?: string | undefined;
|
|
66
|
+
credentialLabel?: string | undefined;
|
|
67
|
+
workflowFile?: string | undefined;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Start a deploy through a freshly gated installed adapter. The chat tool and the admin route both call this.
|
|
71
|
+
* @param required - `deps`: saved-credential ports and the no-redirect HTTP client; `input`: platform, target, optional ref and credential label.
|
|
72
|
+
* @param optional - `signal` cancels before further requests and propagates to the transport.
|
|
73
|
+
* @returns The normalized accepted-deploy result; landing is observed afterwards with status/wait.
|
|
74
|
+
* @throws {ToolInputError} Unknown or observe-only platforms, credential/host/auth failures, invalid module results, or cancellation.
|
|
75
|
+
* @complexity Time: O(credentials + response size) plus bounded adapter requests. Space: O(response size).
|
|
76
|
+
* @example await runDeploy({ deps, input: { platform: "my-host", target: "owner/repo", ref: "main" } }, { signal });
|
|
77
|
+
*/
|
|
78
|
+
export declare function runDeploy(required: {
|
|
79
|
+
deps: DeployOpsRuntime;
|
|
80
|
+
input: DeployRequest;
|
|
81
|
+
}, optional?: {
|
|
82
|
+
signal?: AbortSignal | undefined;
|
|
83
|
+
}): Promise<DeployOpsDeployResult>;
|
|
84
|
+
/**
|
|
85
|
+
* Poll immediately and every 10s, bounding sleeps and in-flight polls by the remaining deadline.
|
|
86
|
+
* @param deps - Status reader, optional monotonic clock/sleep seam, and initial unknown observation.
|
|
87
|
+
* @param input - Desired condition, timeout (default 180s; validated by the tool handler), and abort signal.
|
|
88
|
+
* @returns Reached flag, elapsed seconds, attempted poll count and last observation; timeout is a result.
|
|
89
|
+
* @throws {ToolInputError} Cancellation or a refusal from the status reader.
|
|
90
|
+
* @complexity Time: O(timeout / 10s) polls. Space: O(one status response).
|
|
91
|
+
* @example await waitForDeployOps({ status }, { until: "healthy", timeoutSeconds: 180, signal });
|
|
92
|
+
*/
|
|
93
|
+
export declare function waitForDeployOps(deps: {
|
|
94
|
+
status(signal: AbortSignal): Promise<DeployOpsStatus>;
|
|
95
|
+
clock?: WaitClock | undefined;
|
|
96
|
+
initial?: DeployOpsStatus;
|
|
97
|
+
}, input: {
|
|
98
|
+
until: "healthy" | "finished";
|
|
99
|
+
timeoutSeconds?: number;
|
|
100
|
+
signal?: AbortSignal | undefined;
|
|
101
|
+
}): Promise<DeployOpsWaitResult>;
|
|
102
|
+
export {};
|
|
103
|
+
//# sourceMappingURL=ops-runner.d.ts.map
|