@blogic-cz/agent-tools 0.16.0 → 0.17.0
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/dist/audit-tool/index.d.ts +3 -0
- package/dist/audit-tool/index.d.ts.map +1 -0
- package/dist/az-tool/build.d.ts +47 -0
- package/dist/az-tool/build.d.ts.map +1 -0
- package/dist/az-tool/config.d.ts +13 -0
- package/dist/az-tool/config.d.ts.map +1 -0
- package/dist/az-tool/errors.d.ts +43 -0
- package/dist/az-tool/errors.d.ts.map +1 -0
- package/dist/az-tool/extract-option-value.d.ts +2 -0
- package/dist/az-tool/extract-option-value.d.ts.map +1 -0
- package/dist/az-tool/index.d.ts +3 -0
- package/dist/az-tool/index.d.ts.map +1 -0
- package/dist/az-tool/security.d.ts +4 -0
- package/dist/az-tool/security.d.ts.map +1 -0
- package/dist/az-tool/service.d.ts +15 -0
- package/dist/az-tool/service.d.ts.map +1 -0
- package/dist/az-tool/transformers.d.ts +10 -0
- package/dist/az-tool/transformers.d.ts.map +1 -0
- package/dist/az-tool/types.d.ts +64 -0
- package/dist/az-tool/types.d.ts.map +1 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/loader.d.ts +22 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/types.d.ts +189 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/credential-guard/claude-hook.d.ts +13 -0
- package/dist/credential-guard/claude-hook.d.ts.map +1 -0
- package/dist/credential-guard/index.d.ts +77 -0
- package/dist/credential-guard/index.d.ts.map +1 -0
- package/dist/db-tool/config-service.d.ts +25 -0
- package/dist/db-tool/config-service.d.ts.map +1 -0
- package/dist/db-tool/errors.d.ts +41 -0
- package/dist/db-tool/errors.d.ts.map +1 -0
- package/dist/db-tool/index.d.ts +3 -0
- package/dist/db-tool/index.d.ts.map +1 -0
- package/dist/db-tool/schema.d.ts +21 -0
- package/dist/db-tool/schema.d.ts.map +1 -0
- package/dist/db-tool/security.d.ts +23 -0
- package/dist/db-tool/security.d.ts.map +1 -0
- package/dist/db-tool/service.d.ts +18 -0
- package/dist/db-tool/service.d.ts.map +1 -0
- package/dist/db-tool/sql-client.d.ts +24 -0
- package/dist/db-tool/sql-client.d.ts.map +1 -0
- package/dist/db-tool/transformers.d.ts +10 -0
- package/dist/db-tool/transformers.d.ts.map +1 -0
- package/dist/db-tool/types.d.ts +37 -0
- package/dist/db-tool/types.d.ts.map +1 -0
- package/dist/gh-tool/branch.d.ts +18 -0
- package/dist/gh-tool/branch.d.ts.map +1 -0
- package/dist/gh-tool/config.d.ts +7 -0
- package/dist/gh-tool/config.d.ts.map +1 -0
- package/dist/gh-tool/errors.d.ts +51 -0
- package/dist/gh-tool/errors.d.ts.map +1 -0
- package/dist/gh-tool/index.d.ts +3 -0
- package/dist/gh-tool/index.d.ts.map +1 -0
- package/dist/gh-tool/issue/commands.d.ts +68 -0
- package/dist/gh-tool/issue/commands.d.ts.map +1 -0
- package/dist/gh-tool/issue/core.d.ts +82 -0
- package/dist/gh-tool/issue/core.d.ts.map +1 -0
- package/dist/gh-tool/issue/index.d.ts +3 -0
- package/dist/gh-tool/issue/index.d.ts.map +1 -0
- package/dist/gh-tool/issue/triage.d.ts +89 -0
- package/dist/gh-tool/issue/triage.d.ts.map +1 -0
- package/dist/gh-tool/pr/commands.d.ts +384 -0
- package/dist/gh-tool/pr/commands.d.ts.map +1 -0
- package/dist/gh-tool/pr/core.d.ts +236 -0
- package/dist/gh-tool/pr/core.d.ts.map +1 -0
- package/dist/gh-tool/pr/helpers.d.ts +27 -0
- package/dist/gh-tool/pr/helpers.d.ts.map +1 -0
- package/dist/gh-tool/pr/index.d.ts +2 -0
- package/dist/gh-tool/pr/index.d.ts.map +1 -0
- package/dist/gh-tool/pr/review.d.ts +90 -0
- package/dist/gh-tool/pr/review.d.ts.map +1 -0
- package/dist/gh-tool/release.d.ts +52 -0
- package/dist/gh-tool/release.d.ts.map +1 -0
- package/dist/gh-tool/repo.d.ts +21 -0
- package/dist/gh-tool/repo.d.ts.map +1 -0
- package/dist/gh-tool/service.d.ts +25 -0
- package/dist/gh-tool/service.d.ts.map +1 -0
- package/dist/gh-tool/text-input.d.ts +22 -0
- package/dist/gh-tool/text-input.d.ts.map +1 -0
- package/dist/gh-tool/types.d.ts +271 -0
- package/dist/gh-tool/types.d.ts.map +1 -0
- package/dist/gh-tool/workflow.d.ts +157 -0
- package/dist/gh-tool/workflow.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/k8s-tool/errors.d.ts +43 -0
- package/dist/k8s-tool/errors.d.ts.map +1 -0
- package/dist/k8s-tool/index.d.ts +3 -0
- package/dist/k8s-tool/index.d.ts.map +1 -0
- package/dist/k8s-tool/profile.d.ts +3 -0
- package/dist/k8s-tool/profile.d.ts.map +1 -0
- package/dist/k8s-tool/security.d.ts +14 -0
- package/dist/k8s-tool/security.d.ts.map +1 -0
- package/dist/k8s-tool/service.d.ts +16 -0
- package/dist/k8s-tool/service.d.ts.map +1 -0
- package/dist/k8s-tool/transformers.d.ts +23 -0
- package/dist/k8s-tool/transformers.d.ts.map +1 -0
- package/dist/k8s-tool/types.d.ts +13 -0
- package/dist/k8s-tool/types.d.ts.map +1 -0
- package/dist/logs-tool/errors.d.ts +40 -0
- package/dist/logs-tool/errors.d.ts.map +1 -0
- package/dist/logs-tool/index.d.ts +21 -0
- package/dist/logs-tool/index.d.ts.map +1 -0
- package/dist/logs-tool/service.d.ts +23 -0
- package/dist/logs-tool/service.d.ts.map +1 -0
- package/dist/logs-tool/transformers.d.ts +2 -0
- package/dist/logs-tool/transformers.d.ts.map +1 -0
- package/dist/logs-tool/types.d.ts +39 -0
- package/dist/logs-tool/types.d.ts.map +1 -0
- package/dist/observability-tool/errors.d.ts +8 -0
- package/dist/observability-tool/errors.d.ts.map +1 -0
- package/dist/observability-tool/index.d.ts +3 -0
- package/dist/observability-tool/index.d.ts.map +1 -0
- package/dist/observability-tool/logs.d.ts +22 -0
- package/dist/observability-tool/logs.d.ts.map +1 -0
- package/dist/observability-tool/metrics.d.ts +3 -0
- package/dist/observability-tool/metrics.d.ts.map +1 -0
- package/dist/observability-tool/shared.d.ts +18 -0
- package/dist/observability-tool/shared.d.ts.map +1 -0
- package/dist/observability-tool/trace.d.ts +3 -0
- package/dist/observability-tool/trace.d.ts.map +1 -0
- package/dist/observability-tool/types.d.ts +171 -0
- package/dist/observability-tool/types.d.ts.map +1 -0
- package/dist/session-tool/claude-code.d.ts +46 -0
- package/dist/session-tool/claude-code.d.ts.map +1 -0
- package/dist/session-tool/codex.d.ts +44 -0
- package/dist/session-tool/codex.d.ts.map +1 -0
- package/dist/session-tool/config.d.ts +29 -0
- package/dist/session-tool/config.d.ts.map +1 -0
- package/dist/session-tool/errors.d.ts +27 -0
- package/dist/session-tool/errors.d.ts.map +1 -0
- package/dist/session-tool/index.d.ts +13 -0
- package/dist/session-tool/index.d.ts.map +1 -0
- package/dist/session-tool/pi.d.ts +40 -0
- package/dist/session-tool/pi.d.ts.map +1 -0
- package/dist/session-tool/service.d.ts +18 -0
- package/dist/session-tool/service.d.ts.map +1 -0
- package/dist/session-tool/summaries.d.ts +5 -0
- package/dist/session-tool/summaries.d.ts.map +1 -0
- package/dist/session-tool/types.d.ts +38 -0
- package/dist/session-tool/types.d.ts.map +1 -0
- package/dist/shared/audit.d.ts +40 -0
- package/dist/shared/audit.d.ts.map +1 -0
- package/dist/shared/binary-preflight.d.ts +27 -0
- package/dist/shared/binary-preflight.d.ts.map +1 -0
- package/dist/shared/bun.d.ts +5 -0
- package/dist/shared/bun.d.ts.map +1 -0
- package/dist/shared/cli.d.ts +18 -0
- package/dist/shared/cli.d.ts.map +1 -0
- package/dist/shared/env-template.d.ts +9 -0
- package/dist/shared/env-template.d.ts.map +1 -0
- package/dist/shared/error-renderer.d.ts +4 -0
- package/dist/shared/error-renderer.d.ts.map +1 -0
- package/dist/shared/exec.d.ts +23 -0
- package/dist/shared/exec.d.ts.map +1 -0
- package/dist/shared/format.d.ts +7 -0
- package/dist/shared/format.d.ts.map +1 -0
- package/dist/shared/index.d.ts +12 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/k8s-probe.d.ts +11 -0
- package/dist/shared/k8s-probe.d.ts.map +1 -0
- package/dist/shared/log-transform.d.ts +2 -0
- package/dist/shared/log-transform.d.ts.map +1 -0
- package/dist/shared/path.d.ts +2 -0
- package/dist/shared/path.d.ts.map +1 -0
- package/dist/shared/prerequisites/config.d.ts +6 -0
- package/dist/shared/prerequisites/config.d.ts.map +1 -0
- package/dist/shared/prerequisites/driver-commands.d.ts +19 -0
- package/dist/shared/prerequisites/driver-commands.d.ts.map +1 -0
- package/dist/shared/prerequisites/errors.d.ts +10 -0
- package/dist/shared/prerequisites/errors.d.ts.map +1 -0
- package/dist/shared/prerequisites/guardian-entry.d.ts +2 -0
- package/dist/shared/prerequisites/guardian-entry.d.ts.map +1 -0
- package/dist/shared/prerequisites/guardian.d.ts +41 -0
- package/dist/shared/prerequisites/guardian.d.ts.map +1 -0
- package/dist/shared/prerequisites/index.d.ts +6 -0
- package/dist/shared/prerequisites/index.d.ts.map +1 -0
- package/dist/shared/prerequisites/runtime.d.ts +26 -0
- package/dist/shared/prerequisites/runtime.d.ts.map +1 -0
- package/dist/shared/prerequisites/store.d.ts +99 -0
- package/dist/shared/prerequisites/store.d.ts.map +1 -0
- package/dist/shared/prerequisites/types.d.ts +39 -0
- package/dist/shared/prerequisites/types.d.ts.map +1 -0
- package/dist/shared/prerequisites/vpn.d.ts +5 -0
- package/dist/shared/prerequisites/vpn.d.ts.map +1 -0
- package/dist/shared/schema-dump.d.ts +27 -0
- package/dist/shared/schema-dump.d.ts.map +1 -0
- package/dist/shared/throttle.d.ts +17 -0
- package/dist/shared/throttle.d.ts.map +1 -0
- package/dist/shared/transform.d.ts +49 -0
- package/dist/shared/transform.d.ts.map +1 -0
- package/dist/shared/types.d.ts +30 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/package.json +77 -20
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChildProcessSpawner } from "effect/unstable/process";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
|
+
declare const ExecError_base: Schema.Class<ExecError, Schema.TaggedStruct<"ExecError", {
|
|
4
|
+
readonly message: Schema.String;
|
|
5
|
+
readonly command: Schema.String;
|
|
6
|
+
readonly exitCode: Schema.Number;
|
|
7
|
+
readonly stderr: Schema.String;
|
|
8
|
+
}>, import("effect/Cause").YieldableError>;
|
|
9
|
+
export declare class ExecError extends ExecError_base {
|
|
10
|
+
}
|
|
11
|
+
export declare const collectProcessOutput: (process: ChildProcessSpawner.ChildProcessHandle) => Effect.Effect<{
|
|
12
|
+
stdout: string;
|
|
13
|
+
stderr: string;
|
|
14
|
+
exitCode: ChildProcessSpawner.ExitCode;
|
|
15
|
+
}, import("effect/PlatformError").PlatformError, never>;
|
|
16
|
+
export declare const execEffect: (commandStr: string, timeoutMs?: number) => Effect.Effect<{
|
|
17
|
+
stdout: string;
|
|
18
|
+
stderr: string;
|
|
19
|
+
exitCode: number;
|
|
20
|
+
}, ExecError, ChildProcessSpawner.ChildProcessSpawner>;
|
|
21
|
+
export declare const quoteShellArg: (value: string) => string;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=exec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/shared/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;;;;;;;AAIhD,qBAAa,SAAU,SAAQ,cAK7B;CAAG;AAEL,eAAO,MAAM,oBAAoB,GAAI,SAAS,mBAAmB,CAAC,kBAAkB;;;;uDAUhF,CAAC;AAEL,eAAO,MAAM,UAAU,GACrB,YAAY,MAAM,EAClB,YAAW,MAA2B,KACrC,MAAM,CAAC,MAAM,CACd;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,EACpD,SAAS,EACT,mBAAmB,CAAC,mBAAmB,CAsCtC,CAAC;AAEJ,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,WAA0C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Flag } from "effect/unstable/cli";
|
|
2
|
+
import type { BaseResult, OutputFormat } from "./types";
|
|
3
|
+
export declare const formatOption: Flag.Flag<"json" | "toon">;
|
|
4
|
+
export declare function formatOutput<T extends BaseResult>(result: T, format: OutputFormat): string;
|
|
5
|
+
export declare function formatAny<T>(data: T, format: OutputFormat): string;
|
|
6
|
+
export declare const logFormatted: <T>(data: T, format: OutputFormat) => import("effect/Effect").Effect<void, never, never>;
|
|
7
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/shared/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAI3C,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAExD,eAAO,MAAM,YAAY,4BAGxB,CAAC;AAEF,wBAAgB,YAAY,CAAC,CAAC,SAAS,UAAU,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAK1F;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,YAAY,GAAG,MAAM,CAKlE;AAED,eAAO,MAAM,YAAY,GAAI,CAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,YAAY,uDACvB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { BaseResult, CommandOptions, CommandResult, Environment, OutputFormat, ToolResult, } from "./types";
|
|
2
|
+
export { formatAny, formatOption, formatOutput, logFormatted } from "./format";
|
|
3
|
+
export { expandPath, runCommand, runShellCommand } from "./bun";
|
|
4
|
+
export { commonArgOptions, parseCommonArgs } from "./cli";
|
|
5
|
+
export { renderCauseToStderr } from "./error-renderer";
|
|
6
|
+
export { dumpCommandSchema, makeSchemaCommand, type CommandSchema } from "./schema-dump";
|
|
7
|
+
export declare const VERSION: string;
|
|
8
|
+
export { execEffect, type ExecError } from "./exec";
|
|
9
|
+
export { createThrottle, type ThrottleError } from "./throttle";
|
|
10
|
+
export { aggregateByField, deduplicateLines, formatCountSummary, parseTextTable, stripEmptyColumns, truncateRows, } from "./transform";
|
|
11
|
+
export { transformLogOutput } from "./log-transform";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shared/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,aAAa,EACb,WAAW,EACX,YAAY,EACZ,UAAU,GACX,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAIzF,eAAO,MAAM,OAAO,QAAc,CAAC;AAEnC,OAAO,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhE,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,YAAY,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared kubectl API-server reachability probe, used by every VPN-gated tool
|
|
3
|
+
* (db-tool, k8s-tool) to fail fast instead of hanging on a silently unreachable cluster.
|
|
4
|
+
*
|
|
5
|
+
* Hitting `/version` via `--raw` is the cheapest authenticated round-trip; `--request-timeout`
|
|
6
|
+
* bounds it so an unreachable server (VPN down / off the office network, or the cluster API
|
|
7
|
+
* degraded) fails in ~`timeoutMs` with a clear message instead of waiting out the tool's full
|
|
8
|
+
* command/tunnel timeout.
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildApiProbeArgs(kubeconfig: string | undefined, context: string, timeoutMs: number): string[];
|
|
11
|
+
//# sourceMappingURL=k8s-probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"k8s-probe.d.ts","sourceRoot":"","sources":["../../src/shared/k8s-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,MAAM,EAAE,CASV"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-transform.d.ts","sourceRoot":"","sources":["../../src/shared/log-transform.ts"],"names":[],"mappings":"AAgOA,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAe5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/shared/path.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,GAAI,OAAO,MAAM,EAAE,GAAG,MAAM,SAAS,MAAM,EAAE,WAYjE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AgentToolsConfig, VpnPrerequisite, ProfilePrerequisites } from "#config/types";
|
|
2
|
+
import type { PrerequisiteResolution } from "#shared/prerequisites/types";
|
|
3
|
+
export declare function normalizeProfilePrerequisites(profile: ProfilePrerequisites): readonly VpnPrerequisite[];
|
|
4
|
+
export declare function resolveProfilePrerequisites(config: AgentToolsConfig, profile: ProfilePrerequisites): PrerequisiteResolution;
|
|
5
|
+
export declare function resolveEnvironmentScopedPrerequisites(profile: ProfilePrerequisites, environment: ProfilePrerequisites): ProfilePrerequisites;
|
|
6
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/shared/prerequisites/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC7F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE1E,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,oBAAoB,GAC5B,SAAS,eAAe,EAAE,CAa5B;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,oBAAoB,GAC5B,sBAAsB,CAcxB;AAKD,wBAAgB,qCAAqC,CACnD,OAAO,EAAE,oBAAoB,EAC7B,WAAW,EAAE,oBAAoB,GAChC,oBAAoB,CAWtB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ChildProcess } from "effect/unstable/process";
|
|
2
|
+
import type { ResolvedVpnDriver } from "#shared/prerequisites/types";
|
|
3
|
+
import type { SanitizedVpnDriver } from "#shared/prerequisites/store";
|
|
4
|
+
export type VpnDriverAction = "status" | "start" | "stop";
|
|
5
|
+
export type VpnCommandSpec = {
|
|
6
|
+
readonly executable: string;
|
|
7
|
+
readonly args: readonly string[];
|
|
8
|
+
};
|
|
9
|
+
export declare const sanitizeVpnDriver: (driver: ResolvedVpnDriver) => SanitizedVpnDriver;
|
|
10
|
+
export declare const vpnCommandSpec: (driver: SanitizedVpnDriver, action: VpnDriverAction) => VpnCommandSpec;
|
|
11
|
+
export declare const makeParentVpnCommand: (driver: ResolvedVpnDriver, action: VpnDriverAction, secret?: string) => {
|
|
12
|
+
command: ChildProcess.StandardCommand;
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const parseVpnStatus: (driver: SanitizedVpnDriver, result: {
|
|
16
|
+
readonly stdout: string;
|
|
17
|
+
readonly exitCode: number;
|
|
18
|
+
}) => boolean | undefined;
|
|
19
|
+
//# sourceMappingURL=driver-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"driver-commands.d.ts","sourceRoot":"","sources":["../../../src/shared/prerequisites/driver-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAE/F,eAAO,MAAM,iBAAiB,GAAI,QAAQ,iBAAiB,KAAG,kBAQ7D,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,QAAQ,kBAAkB,EAC1B,QAAQ,eAAe,KACtB,cA4BF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,iBAAiB,EACzB,QAAQ,eAAe,EACvB,SAAS,MAAM;;;CAUhB,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,QAAQ,kBAAkB,EAC1B,QAAQ;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,KAC7D,OAAO,GAAG,SAkBZ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const PrerequisiteRunError_base: Schema.Class<PrerequisiteRunError, Schema.TaggedStruct<"PrerequisiteRunError", {
|
|
3
|
+
readonly message: Schema.String;
|
|
4
|
+
readonly hint: Schema.optionalKey<Schema.String>;
|
|
5
|
+
}>, import("effect/Cause").YieldableError>;
|
|
6
|
+
export declare class PrerequisiteRunError extends PrerequisiteRunError_base {
|
|
7
|
+
}
|
|
8
|
+
export declare const isPrerequisiteRunError: (error: unknown) => error is PrerequisiteRunError;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/shared/prerequisites/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;AAEhC,qBAAa,oBAAqB,SAAQ,yBAMzC;CAAG;AAEJ,eAAO,MAAM,sBAAsB,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,oBAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guardian-entry.d.ts","sourceRoot":"","sources":["../../../src/shared/prerequisites/guardian-entry.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { SanitizedVpnDriver } from "#shared/prerequisites/store";
|
|
2
|
+
import { VpnStore } from "#shared/prerequisites/store";
|
|
3
|
+
import type { VpnCleanupPolicy } from "#shared/prerequisites/types";
|
|
4
|
+
export type GuardianInitMessage = {
|
|
5
|
+
readonly type: "INIT";
|
|
6
|
+
readonly driver: SanitizedVpnDriver;
|
|
7
|
+
readonly runtimeRoot: string;
|
|
8
|
+
readonly leaseId: string;
|
|
9
|
+
readonly guardianId: string;
|
|
10
|
+
readonly ownerPid: number;
|
|
11
|
+
readonly cleanup: VpnCleanupPolicy;
|
|
12
|
+
readonly idleDisconnectMs: number;
|
|
13
|
+
readonly disconnectTimeoutMs: number;
|
|
14
|
+
};
|
|
15
|
+
export type GuardianReleaseMessage = {
|
|
16
|
+
readonly type: "RELEASE";
|
|
17
|
+
readonly leaseId: string;
|
|
18
|
+
};
|
|
19
|
+
export type GuardianInboundMessage = GuardianInitMessage | GuardianReleaseMessage;
|
|
20
|
+
export type GuardianOutboundMessage = {
|
|
21
|
+
readonly type: "READY";
|
|
22
|
+
readonly leaseId: string;
|
|
23
|
+
readonly guardianId: string;
|
|
24
|
+
} | {
|
|
25
|
+
readonly type: "RELEASED";
|
|
26
|
+
readonly leaseId: string;
|
|
27
|
+
} | {
|
|
28
|
+
readonly type: "ERROR";
|
|
29
|
+
readonly message: string;
|
|
30
|
+
};
|
|
31
|
+
export type GuardianCommandRunner = (action: "status" | "stop", timeoutMs: number) => Promise<{
|
|
32
|
+
readonly stdout: string;
|
|
33
|
+
readonly stderr: string;
|
|
34
|
+
readonly exitCode: number;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const makeGuardianCommandRunner: (driver: SanitizedVpnDriver) => GuardianCommandRunner;
|
|
37
|
+
export declare function stopWhenIdle(store: VpnStore, init: GuardianInitMessage, runCommand: GuardianCommandRunner, now?: () => number): Promise<void>;
|
|
38
|
+
export declare function runGuardian(init: GuardianInitMessage, send: (message: GuardianOutboundMessage) => void, runCommand?: GuardianCommandRunner): Promise<{
|
|
39
|
+
release: () => Promise<void>;
|
|
40
|
+
}>;
|
|
41
|
+
//# sourceMappingURL=guardian.d.ts.map
|
|
@@ -0,0 +1 @@
|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Q,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzD,MAAM,MAAM,qBAAqB,GAAG,CAClC,MAAM,EAAE,QAAQ,GAAG,MAAM,EACzB,SAAS,EAAE,MAAM,KACd,OAAO,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAU9F,eAAO,MAAM,yBAAyB,GACnC,QAAQ,kBAAkB,KAAG,qBAiB7B,CAAC;AAOJ,wBAAsB,YAAY,CAChC,KAAK,EAAE,QAAQ,EACf,IAAI,EAAE,mBAAmB,EACzB,UAAU,EAAE,qBAAqB,EACjC,GAAG,GAAE,MAAM,MAAiB,GAC3B,OAAO,CAAC,IAAI,CAAC,CAsDf;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAE,mBAAmB,EACzB,IAAI,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,EAChD,UAAU,GAAE,qBAA8D,GACzE,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAoC3C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { runWithProfilePrerequisites } from "#shared/prerequisites/runtime";
|
|
2
|
+
export { resolveEnvironmentScopedPrerequisites } from "#shared/prerequisites/config";
|
|
3
|
+
export { isPrerequisiteRunError, PrerequisiteRunError } from "#shared/prerequisites/errors";
|
|
4
|
+
export type { PrerequisiteCommandResult, PrerequisiteCommandRunner, } from "#shared/prerequisites/types";
|
|
5
|
+
export type { ProfilePrerequisites, VpnPrerequisite } from "#config/types";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/prerequisites/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,qCAAqC,EAAE,MAAM,8BAA8B,CAAC;AAErF,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAE5F,YAAY,EACV,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import type { AgentToolsConfig, ProfilePrerequisites } from "#config/types";
|
|
3
|
+
import type { PrerequisiteCommandRunner } from "#shared/prerequisites/types";
|
|
4
|
+
import { PrerequisiteRunError } from "#shared/prerequisites/errors";
|
|
5
|
+
export declare const DEFAULT_VPN_IDLE_DISCONNECT_MS = 30000;
|
|
6
|
+
type TimeoutScheduler = (callback: () => void, delayMs: number) => () => void;
|
|
7
|
+
export declare const scheduleLongTimeout: (callback: () => void, timeoutMs: number, now?: () => number, schedule?: TimeoutScheduler) => () => void;
|
|
8
|
+
export declare const vpnStartFailureMessage: (key: string, stderr: string, redactStderr: boolean) => string;
|
|
9
|
+
export declare const missingVpnSecretError: (key: string) => PrerequisiteRunError;
|
|
10
|
+
type GuardianSpawner = typeof Bun.spawn;
|
|
11
|
+
type ReleasableGuardian = {
|
|
12
|
+
readonly release: () => Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
export declare const releaseHeldLeases: (leases: readonly {
|
|
15
|
+
readonly guardian: ReleasableGuardian;
|
|
16
|
+
}[]) => Effect.Effect<void, never, never>;
|
|
17
|
+
export declare const closeVpnStoreAfter: <A, E>(key: string, guardian: ReleasableGuardian, close: () => void, body: Effect.Effect<A, E, never>) => Effect.Effect<A, E | PrerequisiteRunError, never>;
|
|
18
|
+
export declare const runWithProfilePrerequisites: <A, E, CommandError>(config: AgentToolsConfig, profile: ProfilePrerequisites, runCommand: PrerequisiteCommandRunner<CommandError>, effect: Effect.Effect<A, E, never>, options?: {
|
|
19
|
+
/** Caller proved the target is already reachable: skip the VPN entirely (no status, no lease). */
|
|
20
|
+
alreadySatisfied?: boolean;
|
|
21
|
+
tryWithoutPrerequisites?: boolean;
|
|
22
|
+
runGuardianInProcess?: boolean;
|
|
23
|
+
guardianSpawn?: GuardianSpawner;
|
|
24
|
+
}) => Effect.Effect<A, E | PrerequisiteRunError, never>;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/shared/prerequisites/runtime.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,MAAM,EAAkB,MAAM,QAAQ,CAAC;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAa,MAAM,eAAe,CAAC;AACvF,OAAO,KAAK,EACV,yBAAyB,EAG1B,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAIpE,eAAO,MAAM,8BAA8B,QAAS,CAAC;AAOrD,KAAK,gBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,IAAI,CAAC;AAE9E,eAAO,MAAM,mBAAmB,GAC9B,UAAU,MAAM,IAAI,EACpB,WAAW,MAAM,EACjB,MAAK,MAAM,MAAiB,EAC5B,WAAU,gBAGT,eAoBF,CAAC;AAMF,eAAO,MAAM,sBAAsB,GAAI,KAAK,MAAM,EAAE,QAAQ,MAAM,EAAE,cAAc,OAAO,WAGxF,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,KAAK,MAAM,yBAI7C,CAAC;AAqEL,KAAK,eAAe,GAAG,OAAO,GAAG,CAAC,KAAK,CAAC;AA+UxC,KAAK,kBAAkB,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC;AAUpE,eAAO,MAAM,iBAAiB,GAAI,QAAQ,SAAS;IAAE,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAA;CAAE,EAAE,sCAMzF,CAAC;AAEN,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAE,CAAC,EACrC,KAAK,MAAM,EACX,UAAU,kBAAkB,EAC5B,OAAO,MAAM,IAAI,EACjB,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,KAC/B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,oBAAoB,EAAE,KAAK,CAc/C,CAAC;AA6OL,eAAO,MAAM,2BAA2B,GAAI,CAAC,EAAE,CAAC,EAAE,YAAY,EAC5D,QAAQ,gBAAgB,EACxB,SAAS,oBAAoB,EAC7B,YAAY,yBAAyB,CAAC,YAAY,CAAC,EACnD,QAAQ,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAClC,UAAU;IACR,kGAAkG;IAClG,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,aAAa,CAAC,EAAE,eAAe,CAAC;CACjC,KACA,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,oBAAoB,EAAE,KAAK,CAgElD,CAAC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { ResolvedVpnDriver, VpnCleanupPolicy } from "#shared/prerequisites/types";
|
|
2
|
+
export type VpnLifecycle = "DOWN" | "EXTERNAL" | "CHECKING" | "STARTING" | "ACTIVE" | "IDLE" | "STOPPING" | "UNKNOWN";
|
|
3
|
+
export type VpnLeaseStatus = "PENDING" | "ACTIVE";
|
|
4
|
+
export type VpnOperationKind = "CHECK" | "START" | "STOP";
|
|
5
|
+
export type SanitizedVpnDriver = {
|
|
6
|
+
readonly type: "macos-scutil";
|
|
7
|
+
readonly platform: "darwin";
|
|
8
|
+
readonly serviceName: string;
|
|
9
|
+
} | {
|
|
10
|
+
readonly type: "linux-nmcli";
|
|
11
|
+
readonly platform: "linux";
|
|
12
|
+
readonly connectionName: string;
|
|
13
|
+
} | {
|
|
14
|
+
readonly type: "windows-rasdial";
|
|
15
|
+
readonly platform: "win32";
|
|
16
|
+
readonly entryName: string;
|
|
17
|
+
};
|
|
18
|
+
export type VpnStateSnapshot = {
|
|
19
|
+
readonly lifecycle: VpnLifecycle;
|
|
20
|
+
readonly managedEpochId: string | null;
|
|
21
|
+
readonly operationId: string | null;
|
|
22
|
+
readonly operationKind: VpnOperationKind | null;
|
|
23
|
+
readonly operationToken: string | null;
|
|
24
|
+
readonly operationPid: number | null;
|
|
25
|
+
readonly revision: number;
|
|
26
|
+
readonly idleDeadline: number | null;
|
|
27
|
+
readonly evidence: string | null;
|
|
28
|
+
readonly adoptExternalAfterStart: boolean;
|
|
29
|
+
readonly updatedAt: number;
|
|
30
|
+
readonly pendingLeases: number;
|
|
31
|
+
readonly activeLeases: number;
|
|
32
|
+
};
|
|
33
|
+
export type OperationGuard = {
|
|
34
|
+
readonly operationId: string;
|
|
35
|
+
readonly token: string;
|
|
36
|
+
readonly revision: number;
|
|
37
|
+
};
|
|
38
|
+
export declare class VpnStoreError extends Error {
|
|
39
|
+
readonly hint = "Stop all agent-tools processes, then remove this VPN state directory before retrying.";
|
|
40
|
+
constructor(message: string, options?: ErrorOptions);
|
|
41
|
+
}
|
|
42
|
+
export declare const sanitizeVpnDriver: (driver: ResolvedVpnDriver) => SanitizedVpnDriver;
|
|
43
|
+
export declare const canonicalDriverIdentity: (driver: SanitizedVpnDriver) => string;
|
|
44
|
+
export declare const getVpnStoreLocation: (driver: SanitizedVpnDriver, root?: string) => {
|
|
45
|
+
identity: string;
|
|
46
|
+
root: string;
|
|
47
|
+
directory: string;
|
|
48
|
+
databasePath: string;
|
|
49
|
+
};
|
|
50
|
+
export declare class VpnStore {
|
|
51
|
+
private readonly db;
|
|
52
|
+
readonly directory: string;
|
|
53
|
+
readonly databasePath: string;
|
|
54
|
+
private constructor();
|
|
55
|
+
static open(driver: SanitizedVpnDriver, options?: {
|
|
56
|
+
root?: string;
|
|
57
|
+
now?: number;
|
|
58
|
+
}): VpnStore;
|
|
59
|
+
close(): void;
|
|
60
|
+
settings(): {
|
|
61
|
+
journalMode: string | undefined;
|
|
62
|
+
synchronous: number | undefined;
|
|
63
|
+
userVersion: number | undefined;
|
|
64
|
+
};
|
|
65
|
+
private immediate;
|
|
66
|
+
snapshot(): VpnStateSnapshot;
|
|
67
|
+
reserveLease(input: {
|
|
68
|
+
leaseId: string;
|
|
69
|
+
guardianId: string;
|
|
70
|
+
ownerPid: number;
|
|
71
|
+
cleanup: VpnCleanupPolicy;
|
|
72
|
+
now: number;
|
|
73
|
+
}): VpnStateSnapshot;
|
|
74
|
+
activateLease(leaseId: string, guardianId: string, now: number): boolean;
|
|
75
|
+
claimCheck(operationId: string, token: string, ownerPid: number, now: number): OperationGuard | undefined;
|
|
76
|
+
claimExternalCheck(operationId: string, token: string, ownerPid: number, now: number): OperationGuard | undefined;
|
|
77
|
+
claimStart(operationId: string, token: string, ownerPid: number, now: number): OperationGuard | undefined;
|
|
78
|
+
private claimOperation;
|
|
79
|
+
claimStop(operationId: string, token: string, ownerPid: number, now: number): OperationGuard | undefined;
|
|
80
|
+
commitCheck(guard: OperationGuard, connected: boolean, now: number): boolean;
|
|
81
|
+
commitStart(guard: OperationGuard, result: "managed" | "external" | "down" | "unknown", managedEpochId: string, evidence: string, now: number): boolean;
|
|
82
|
+
commitStop(guard: OperationGuard, disconnected: boolean, evidence: string, now: number): boolean;
|
|
83
|
+
reconcileOperation(snapshot: VpnStateSnapshot, connected: boolean | undefined, now: number): boolean;
|
|
84
|
+
/** Recovers terminal UNKNOWN from an observed status; fenced so it can never take ownership from a holder. */
|
|
85
|
+
reconcileUnknown(snapshot: VpnStateSnapshot, connected: boolean, now: number): boolean;
|
|
86
|
+
private commitOperation;
|
|
87
|
+
releaseLease(input: {
|
|
88
|
+
leaseId: string;
|
|
89
|
+
guardianId: string;
|
|
90
|
+
idleDisconnectMs: number;
|
|
91
|
+
now: number;
|
|
92
|
+
}): {
|
|
93
|
+
released: boolean;
|
|
94
|
+
deadline: number | null;
|
|
95
|
+
};
|
|
96
|
+
abandonLease(leaseId: string, now: number): boolean;
|
|
97
|
+
deleteDeadLeases(isPidLive: (pid: number) => boolean, idleDisconnectMs: number, now: number): number;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/shared/prerequisites/store.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAQvF,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,UAAU,GACV,UAAU,GACV,UAAU,GACV,QAAQ,GACR,MAAM,GACN,UAAU,GACV,SAAS,CAAC;AACd,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,CAAC;AAClD,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC5F;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GAC7F;IAAE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IAAC,QAAQ,CAA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CA+CV"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Schema, type Effect } from "effect";
|
|
2
|
+
import type { ChildProcess } from "effect/unstable/process";
|
|
3
|
+
import type { LinuxNmcliVpnDriverConfig, MacosScutilVpnDriverConfig, VpnPrerequisite, WindowsRasdialVpnDriverConfig } from "#config/types";
|
|
4
|
+
export type PrerequisiteResolution = {
|
|
5
|
+
success: true;
|
|
6
|
+
prerequisites: readonly VpnPrerequisite[];
|
|
7
|
+
} | {
|
|
8
|
+
success: false;
|
|
9
|
+
error: string;
|
|
10
|
+
hint: string;
|
|
11
|
+
};
|
|
12
|
+
export type SupportedPlatform = "darwin" | "linux" | "win32";
|
|
13
|
+
export type ResolvedVpnDriver = (MacosScutilVpnDriverConfig & {
|
|
14
|
+
platform: "darwin";
|
|
15
|
+
serviceName: string;
|
|
16
|
+
}) | (LinuxNmcliVpnDriverConfig & {
|
|
17
|
+
platform: "linux";
|
|
18
|
+
connectionName: string;
|
|
19
|
+
}) | (WindowsRasdialVpnDriverConfig & {
|
|
20
|
+
platform: "win32";
|
|
21
|
+
entryName: string;
|
|
22
|
+
});
|
|
23
|
+
export type VpnDriverResolution = {
|
|
24
|
+
success: true;
|
|
25
|
+
driver: ResolvedVpnDriver;
|
|
26
|
+
} | {
|
|
27
|
+
success: false;
|
|
28
|
+
error: string;
|
|
29
|
+
hint: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const VpnCleanupPolicy: Schema.Literals<readonly ["leave-running", "stop-if-started"]>;
|
|
32
|
+
export type VpnCleanupPolicy = Schema.Schema.Type<typeof VpnCleanupPolicy>;
|
|
33
|
+
export type PrerequisiteCommandResult = {
|
|
34
|
+
readonly stdout: string;
|
|
35
|
+
readonly stderr: string;
|
|
36
|
+
readonly exitCode: number;
|
|
37
|
+
};
|
|
38
|
+
export type PrerequisiteCommandRunner<E> = (command: ChildProcess.Command, label: string) => Effect.Effect<PrerequisiteCommandResult, E, never>;
|
|
39
|
+
//# sourceMappingURL=types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F,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI,CACzC,OAAO,EAAE,YAAY,CAAC,OAAO,EAC7B,KAAK,EAAE,MAAM,KACV,MAAM,CAAC,MAAM,CAAC,yBAAyB,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VpnConfig } from "#config/types";
|
|
2
|
+
import type { ResolvedVpnDriver, VpnDriverResolution } from "#shared/prerequisites/types";
|
|
3
|
+
export declare function resolveVpnDriverConfig(config: VpnConfig, platform?: typeof process.platform): VpnDriverResolution;
|
|
4
|
+
export declare function missingVpnToolHint(driver: ResolvedVpnDriver): string;
|
|
5
|
+
//# sourceMappingURL=vpn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vpn.d.ts","sourceRoot":"","sources":["../../../src/shared/prerequisites/vpn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAmB,MAAM,eAAe,CAAC;AAChE,OAAO,KAAK,EACV,iBAAiB,EAEjB,mBAAmB,EACpB,MAAM,6BAA6B,CAAC;AAgErC,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,EACjB,QAAQ,GAAE,OAAO,OAAO,CAAC,QAA2B,GACnD,mBAAmB,CA+CrB;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAUpE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Command } from "effect/unstable/cli";
|
|
2
|
+
/**
|
|
3
|
+
* Machine-readable command-tree dump so an agent can discover the whole CLI surface in ONE call
|
|
4
|
+
* instead of repeated `--help` round-trips (the top remaining discovery friction in the usage audit).
|
|
5
|
+
*/
|
|
6
|
+
export type FlagSchema = {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly type?: string;
|
|
9
|
+
readonly choices?: readonly string[];
|
|
10
|
+
readonly description?: string;
|
|
11
|
+
readonly aliases?: readonly string[];
|
|
12
|
+
};
|
|
13
|
+
export type CommandSchema = {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly description?: string;
|
|
16
|
+
readonly flags: readonly FlagSchema[];
|
|
17
|
+
readonly subcommands: readonly CommandSchema[];
|
|
18
|
+
};
|
|
19
|
+
export declare const dumpCommandSchema: (command: unknown) => CommandSchema;
|
|
20
|
+
/**
|
|
21
|
+
* Builds the `commands` subcommand for a tool. Pass a thunk returning the tool's root command so the
|
|
22
|
+
* dump reflects the fully-assembled tree (the root is defined after its subcommands, incl. this one).
|
|
23
|
+
*/
|
|
24
|
+
export declare const makeSchemaCommand: (getRoot: () => unknown) => Command.Command<"commands", {
|
|
25
|
+
readonly format: "json" | "toon";
|
|
26
|
+
}, {}, never, never>;
|
|
27
|
+
//# sourceMappingURL=schema-dump.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-dump.d.ts","sourceRoot":"","sources":["../../src/shared/schema-dump.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAK9C;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,SAAS,aAAa,EAAE,CAAC;CAChD,CAAC;AAiDF,eAAO,MAAM,iBAAiB,GAAI,SAAS,OAAO,KAAG,aASpD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,OAAO;;oBAOrD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
declare const ThrottleError_base: Schema.Class<ThrottleError, Schema.TaggedStruct<"ThrottleError", {
|
|
3
|
+
readonly message: Schema.String;
|
|
4
|
+
readonly label: Schema.String;
|
|
5
|
+
readonly limit: Schema.Number;
|
|
6
|
+
readonly windowMs: Schema.Number;
|
|
7
|
+
}>, import("effect/Cause").YieldableError>;
|
|
8
|
+
export declare class ThrottleError extends ThrottleError_base {
|
|
9
|
+
}
|
|
10
|
+
export declare const createThrottle: (opts: {
|
|
11
|
+
maxPerMinute: number;
|
|
12
|
+
label: string;
|
|
13
|
+
}) => {
|
|
14
|
+
check: () => Effect.Effect<void, ThrottleError>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=throttle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../src/shared/throttle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAO,MAAM,EAAE,MAAM,QAAQ,CAAC;;;;;;;AAI7C,qBAAa,aAAc,SAAQ,kBAKjC;CAAG;AAEL,eAAO,MAAM,cAAc,GAAI,MAAM;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;iBAGxD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC;CAoBrD,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
type DeduplicateOptions = {
|
|
2
|
+
normalizeTimestamps?: boolean;
|
|
3
|
+
normalizeUUIDs?: boolean;
|
|
4
|
+
normalizeHex?: boolean;
|
|
5
|
+
normalizeNumbers?: boolean;
|
|
6
|
+
normalizePaths?: boolean;
|
|
7
|
+
maxUniqueLines?: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Deduplicate consecutive identical lines after normalization.
|
|
11
|
+
* Normalizes timestamps, UUIDs, hex strings, large numbers before comparison.
|
|
12
|
+
* Returns lines with [×N] suffix for collapsed runs.
|
|
13
|
+
*/
|
|
14
|
+
export declare function deduplicateLines(text: string, options?: DeduplicateOptions): string;
|
|
15
|
+
/**
|
|
16
|
+
* Parse kubectl-style whitespace-aligned text tables.
|
|
17
|
+
* Handles multi-word headers (e.g., "NOMINATED NODE" → "NOMINATED_NODE").
|
|
18
|
+
* Returns structured array of row objects keyed by header name.
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseTextTable(text: string): {
|
|
21
|
+
headers: string[];
|
|
22
|
+
rows: Record<string, string>[];
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Count occurrences of values for a given field across items.
|
|
26
|
+
* Returns a map of value → count, sorted by count descending.
|
|
27
|
+
*/
|
|
28
|
+
export declare function aggregateByField<T extends Record<string, unknown>>(items: T[], field: keyof T & string): Record<string, number>;
|
|
29
|
+
/**
|
|
30
|
+
* Format aggregated counts into a human-readable summary string.
|
|
31
|
+
* Example: formatCountSummary({Running: 30, Error: 3}, 33, "pods") → "33 pods: 30 Running, 3 Error"
|
|
32
|
+
*/
|
|
33
|
+
export declare function formatCountSummary(counts: Record<string, number>, total: number, label: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Truncate an array of rows to a maximum length, returning metadata about truncation.
|
|
36
|
+
*/
|
|
37
|
+
export declare function truncateRows<T>(data: T[], limit: number): {
|
|
38
|
+
rows: T[];
|
|
39
|
+
truncated: boolean;
|
|
40
|
+
total: number;
|
|
41
|
+
showing: number;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Remove columns/keys from records where ALL values are empty/null/undefined.
|
|
45
|
+
* Optionally remove columns where >threshold% of values are empty.
|
|
46
|
+
*/
|
|
47
|
+
export declare function stripEmptyColumns<T extends Record<string, unknown>>(records: T[], threshold?: number): T[];
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/shared/transform.ts"],"names":[],"mappings":"AAAA,KAAK,kBAAkB,GAAG;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAyCF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,MAAM,CAsDvF;AA8CD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG;IAC5C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CAChC,CA0BA;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChE,KAAK,EAAE,CAAC,EAAE,EACV,KAAK,EAAE,MAAM,CAAC,GAAG,MAAM,GACtB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA+BxB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,MAAM,CAQR;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,IAAI,EAAE,CAAC,EAAE,EACT,KAAK,EAAE,MAAM,GACZ;IAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAUnE;AAcD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjE,OAAO,EAAE,CAAC,EAAE,EACZ,SAAS,SAAM,GACd,CAAC,EAAE,CAmCL"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type OutputFormat = "json" | "toon";
|
|
2
|
+
export type Environment = "local" | "test" | "prod";
|
|
3
|
+
export type BaseResult = {
|
|
4
|
+
success: boolean;
|
|
5
|
+
error?: string;
|
|
6
|
+
executionTimeMs: number;
|
|
7
|
+
nextCommand?: string;
|
|
8
|
+
retryable?: boolean;
|
|
9
|
+
hint?: string;
|
|
10
|
+
};
|
|
11
|
+
export type ToolResult = BaseResult & {
|
|
12
|
+
message: string;
|
|
13
|
+
data?: unknown;
|
|
14
|
+
};
|
|
15
|
+
export type CommandOptions = {
|
|
16
|
+
cwd?: string;
|
|
17
|
+
env?: Record<string, string>;
|
|
18
|
+
timeout?: number;
|
|
19
|
+
killSignal?: NodeJS.Signals;
|
|
20
|
+
};
|
|
21
|
+
export type CommandResult = {
|
|
22
|
+
success: boolean;
|
|
23
|
+
stdout: string;
|
|
24
|
+
stderr: string;
|
|
25
|
+
exitCode: number;
|
|
26
|
+
signalCode: NodeJS.Signals | null;
|
|
27
|
+
timedOut: boolean;
|
|
28
|
+
executionTimeMs: number;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shared/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAC3C,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpD,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAGF,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC"}
|