@blogic-cz/agent-tools 0.15.14 → 0.16.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/README.md +5 -0
- package/package.json +9 -6
- package/src/az-tool/errors.ts +4 -4
- package/src/db-tool/errors.ts +4 -4
- package/src/gh-tool/errors.ts +11 -14
- package/src/k8s-tool/errors.ts +4 -4
- package/src/logs-tool/errors.ts +11 -14
- package/src/observability-tool/errors.ts +1 -1
- package/src/session-tool/errors.ts +7 -10
- package/src/shared/env-template.ts +1 -1
- package/src/shared/exec.ts +1 -1
- package/src/shared/prerequisites/errors.ts +1 -1
- package/src/shared/throttle.ts +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,11 @@ These tools wrap each CLI with:
|
|
|
27
27
|
bun add -d @blogic-cz/agent-tools
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
`effect` is a peer dependency pinned to an exact version, and package managers install
|
|
31
|
+
it for you. If your project depends on `effect` too, pin it to the same exact version.
|
|
32
|
+
Two copies of `effect` are structurally incompatible types, so the values this package
|
|
33
|
+
exports stop typechecking in your project when the versions drift.
|
|
34
|
+
|
|
30
35
|
### Skill installation
|
|
31
36
|
|
|
32
37
|
Install per-tool skills for only the tools your project uses:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blogic-cz/agent-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "CLI tools for AI coding agent workflows — GitHub, database, Kubernetes, Azure DevOps, logs, sessions, and audit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -85,21 +85,24 @@
|
|
|
85
85
|
"test": "vitest run"
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@effect/platform-bun": "4.0.0-beta.
|
|
89
|
-
"@toon-format/toon": "2.1.0"
|
|
90
|
-
"effect": "4.0.0-beta.98"
|
|
88
|
+
"@effect/platform-bun": "4.0.0-beta.105",
|
|
89
|
+
"@toon-format/toon": "2.1.0"
|
|
91
90
|
},
|
|
92
91
|
"devDependencies": {
|
|
93
92
|
"@effect/language-service": "0.86.2",
|
|
94
|
-
"@effect/vitest": "4.0.0-beta.
|
|
93
|
+
"@effect/vitest": "4.0.0-beta.105",
|
|
95
94
|
"@types/bun": "1.3.12",
|
|
95
|
+
"effect": "4.0.0-beta.105",
|
|
96
96
|
"oxfmt": "0.44.0",
|
|
97
97
|
"oxlint": "1.59.0",
|
|
98
98
|
"typescript": "6.0.2",
|
|
99
99
|
"vitest": "^4.1.4"
|
|
100
100
|
},
|
|
101
|
+
"peerDependencies": {
|
|
102
|
+
"effect": "4.0.0-beta.105"
|
|
103
|
+
},
|
|
101
104
|
"overrides": {
|
|
102
|
-
"@effect/platform-node-shared": "4.0.0-beta.
|
|
105
|
+
"@effect/platform-node-shared": "4.0.0-beta.105"
|
|
103
106
|
},
|
|
104
107
|
"engines": {
|
|
105
108
|
"bun": ">=1.3.0"
|
package/src/az-tool/errors.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
|
-
export class AzSecurityError extends Schema.
|
|
3
|
+
export class AzSecurityError extends Schema.TaggedError<AzSecurityError>()("AzSecurityError", {
|
|
4
4
|
message: Schema.String,
|
|
5
5
|
command: Schema.String,
|
|
6
6
|
hint: Schema.optionalKey(Schema.String),
|
|
@@ -8,7 +8,7 @@ export class AzSecurityError extends Schema.TaggedErrorClass<AzSecurityError>()(
|
|
|
8
8
|
retryable: Schema.optionalKey(Schema.Boolean),
|
|
9
9
|
}) {}
|
|
10
10
|
|
|
11
|
-
export class AzCommandError extends Schema.
|
|
11
|
+
export class AzCommandError extends Schema.TaggedError<AzCommandError>()("AzCommandError", {
|
|
12
12
|
message: Schema.String,
|
|
13
13
|
command: Schema.String,
|
|
14
14
|
exitCode: Schema.optionalKey(Schema.Number),
|
|
@@ -18,7 +18,7 @@ export class AzCommandError extends Schema.TaggedErrorClass<AzCommandError>()("A
|
|
|
18
18
|
retryable: Schema.optionalKey(Schema.Boolean),
|
|
19
19
|
}) {}
|
|
20
20
|
|
|
21
|
-
export class AzTimeoutError extends Schema.
|
|
21
|
+
export class AzTimeoutError extends Schema.TaggedError<AzTimeoutError>()("AzTimeoutError", {
|
|
22
22
|
message: Schema.String,
|
|
23
23
|
command: Schema.String,
|
|
24
24
|
timeoutMs: Schema.Number,
|
|
@@ -27,7 +27,7 @@ export class AzTimeoutError extends Schema.TaggedErrorClass<AzTimeoutError>()("A
|
|
|
27
27
|
retryable: Schema.optionalKey(Schema.Boolean),
|
|
28
28
|
}) {}
|
|
29
29
|
|
|
30
|
-
export class AzParseError extends Schema.
|
|
30
|
+
export class AzParseError extends Schema.TaggedError<AzParseError>()("AzParseError", {
|
|
31
31
|
message: Schema.String,
|
|
32
32
|
rawOutput: Schema.String,
|
|
33
33
|
hint: Schema.optionalKey(Schema.String),
|
package/src/db-tool/errors.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
|
-
export class DbConnectionError extends Schema.
|
|
3
|
+
export class DbConnectionError extends Schema.TaggedError<DbConnectionError>()(
|
|
4
4
|
"DbConnectionError",
|
|
5
5
|
{
|
|
6
6
|
message: Schema.String,
|
|
@@ -11,7 +11,7 @@ export class DbConnectionError extends Schema.TaggedErrorClass<DbConnectionError
|
|
|
11
11
|
},
|
|
12
12
|
) {}
|
|
13
13
|
|
|
14
|
-
export class DbQueryError extends Schema.
|
|
14
|
+
export class DbQueryError extends Schema.TaggedError<DbQueryError>()("DbQueryError", {
|
|
15
15
|
message: Schema.String,
|
|
16
16
|
sql: Schema.String,
|
|
17
17
|
stderr: Schema.optionalKey(Schema.String),
|
|
@@ -20,7 +20,7 @@ export class DbQueryError extends Schema.TaggedErrorClass<DbQueryError>()("DbQue
|
|
|
20
20
|
retryable: Schema.optionalKey(Schema.Boolean),
|
|
21
21
|
}) {}
|
|
22
22
|
|
|
23
|
-
export class DbTunnelError extends Schema.
|
|
23
|
+
export class DbTunnelError extends Schema.TaggedError<DbTunnelError>()("DbTunnelError", {
|
|
24
24
|
message: Schema.String,
|
|
25
25
|
port: Schema.Number,
|
|
26
26
|
hint: Schema.optionalKey(Schema.String),
|
|
@@ -28,7 +28,7 @@ export class DbTunnelError extends Schema.TaggedErrorClass<DbTunnelError>()("DbT
|
|
|
28
28
|
retryable: Schema.optionalKey(Schema.Boolean),
|
|
29
29
|
}) {}
|
|
30
30
|
|
|
31
|
-
export class DbMutationBlockedError extends Schema.
|
|
31
|
+
export class DbMutationBlockedError extends Schema.TaggedError<DbMutationBlockedError>()(
|
|
32
32
|
"DbMutationBlockedError",
|
|
33
33
|
{
|
|
34
34
|
message: Schema.String,
|
package/src/gh-tool/errors.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
|
-
export class GitHubCommandError extends Schema.
|
|
3
|
+
export class GitHubCommandError extends Schema.TaggedError<GitHubCommandError>()(
|
|
4
4
|
"GitHubCommandError",
|
|
5
5
|
{
|
|
6
6
|
message: Schema.String,
|
|
@@ -13,7 +13,7 @@ export class GitHubCommandError extends Schema.TaggedErrorClass<GitHubCommandErr
|
|
|
13
13
|
},
|
|
14
14
|
) {}
|
|
15
15
|
|
|
16
|
-
export class GitHubNotFoundError extends Schema.
|
|
16
|
+
export class GitHubNotFoundError extends Schema.TaggedError<GitHubNotFoundError>()(
|
|
17
17
|
"GitHubNotFoundError",
|
|
18
18
|
{
|
|
19
19
|
message: Schema.String,
|
|
@@ -25,25 +25,22 @@ export class GitHubNotFoundError extends Schema.TaggedErrorClass<GitHubNotFoundE
|
|
|
25
25
|
},
|
|
26
26
|
) {}
|
|
27
27
|
|
|
28
|
-
export class GitHubAuthError extends Schema.
|
|
28
|
+
export class GitHubAuthError extends Schema.TaggedError<GitHubAuthError>()("GitHubAuthError", {
|
|
29
29
|
message: Schema.String,
|
|
30
30
|
hint: Schema.optionalKey(Schema.String),
|
|
31
31
|
nextCommand: Schema.optionalKey(Schema.String),
|
|
32
32
|
retryable: Schema.optionalKey(Schema.Boolean),
|
|
33
33
|
}) {}
|
|
34
34
|
|
|
35
|
-
export class GitHubMergeError extends Schema.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
retryable: Schema.optionalKey(Schema.Boolean),
|
|
43
|
-
},
|
|
44
|
-
) {}
|
|
35
|
+
export class GitHubMergeError extends Schema.TaggedError<GitHubMergeError>()("GitHubMergeError", {
|
|
36
|
+
message: Schema.String,
|
|
37
|
+
reason: Schema.Literals(["conflicts", "checks_failing", "branch_protected", "unknown"]),
|
|
38
|
+
hint: Schema.optionalKey(Schema.String),
|
|
39
|
+
nextCommand: Schema.optionalKey(Schema.String),
|
|
40
|
+
retryable: Schema.optionalKey(Schema.Boolean),
|
|
41
|
+
}) {}
|
|
45
42
|
|
|
46
|
-
export class GitHubTimeoutError extends Schema.
|
|
43
|
+
export class GitHubTimeoutError extends Schema.TaggedError<GitHubTimeoutError>()(
|
|
47
44
|
"GitHubTimeoutError",
|
|
48
45
|
{
|
|
49
46
|
message: Schema.String,
|
package/src/k8s-tool/errors.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
|
-
export class K8sContextError extends Schema.
|
|
3
|
+
export class K8sContextError extends Schema.TaggedError<K8sContextError>()("K8sContextError", {
|
|
4
4
|
message: Schema.String,
|
|
5
5
|
clusterId: Schema.String,
|
|
6
6
|
hint: Schema.optionalKey(Schema.String),
|
|
@@ -8,7 +8,7 @@ export class K8sContextError extends Schema.TaggedErrorClass<K8sContextError>()(
|
|
|
8
8
|
retryable: Schema.optionalKey(Schema.Boolean),
|
|
9
9
|
}) {}
|
|
10
10
|
|
|
11
|
-
export class K8sCommandError extends Schema.
|
|
11
|
+
export class K8sCommandError extends Schema.TaggedError<K8sCommandError>()("K8sCommandError", {
|
|
12
12
|
message: Schema.String,
|
|
13
13
|
command: Schema.String,
|
|
14
14
|
exitCode: Schema.optionalKey(Schema.Number),
|
|
@@ -18,7 +18,7 @@ export class K8sCommandError extends Schema.TaggedErrorClass<K8sCommandError>()(
|
|
|
18
18
|
retryable: Schema.optionalKey(Schema.Boolean),
|
|
19
19
|
}) {}
|
|
20
20
|
|
|
21
|
-
export class K8sTimeoutError extends Schema.
|
|
21
|
+
export class K8sTimeoutError extends Schema.TaggedError<K8sTimeoutError>()("K8sTimeoutError", {
|
|
22
22
|
message: Schema.String,
|
|
23
23
|
command: Schema.String,
|
|
24
24
|
timeoutMs: Schema.Number,
|
|
@@ -27,7 +27,7 @@ export class K8sTimeoutError extends Schema.TaggedErrorClass<K8sTimeoutError>()(
|
|
|
27
27
|
retryable: Schema.optionalKey(Schema.Boolean),
|
|
28
28
|
}) {}
|
|
29
29
|
|
|
30
|
-
export class K8sDangerousCommandError extends Schema.
|
|
30
|
+
export class K8sDangerousCommandError extends Schema.TaggedError<K8sDangerousCommandError>()(
|
|
31
31
|
"K8sDangerousCommandError",
|
|
32
32
|
{
|
|
33
33
|
message: Schema.String,
|
package/src/logs-tool/errors.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
|
-
export class LogsNotFoundError extends Schema.
|
|
3
|
+
export class LogsNotFoundError extends Schema.TaggedError<LogsNotFoundError>()(
|
|
4
4
|
"LogsNotFoundError",
|
|
5
5
|
{
|
|
6
6
|
message: Schema.String,
|
|
@@ -11,7 +11,7 @@ export class LogsNotFoundError extends Schema.TaggedErrorClass<LogsNotFoundError
|
|
|
11
11
|
},
|
|
12
12
|
) {}
|
|
13
13
|
|
|
14
|
-
export class LogsReadError extends Schema.
|
|
14
|
+
export class LogsReadError extends Schema.TaggedError<LogsReadError>()("LogsReadError", {
|
|
15
15
|
message: Schema.String,
|
|
16
16
|
source: Schema.String,
|
|
17
17
|
hint: Schema.optionalKey(Schema.String),
|
|
@@ -19,23 +19,20 @@ export class LogsReadError extends Schema.TaggedErrorClass<LogsReadError>()("Log
|
|
|
19
19
|
retryable: Schema.optionalKey(Schema.Boolean),
|
|
20
20
|
}) {}
|
|
21
21
|
|
|
22
|
-
export class LogsConfigError extends Schema.
|
|
22
|
+
export class LogsConfigError extends Schema.TaggedError<LogsConfigError>()("LogsConfigError", {
|
|
23
23
|
message: Schema.String,
|
|
24
24
|
hint: Schema.optionalKey(Schema.String),
|
|
25
25
|
nextCommand: Schema.optionalKey(Schema.String),
|
|
26
26
|
retryable: Schema.optionalKey(Schema.Boolean),
|
|
27
27
|
}) {}
|
|
28
28
|
|
|
29
|
-
export class LogsTimeoutError extends Schema.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
retryable: Schema.optionalKey(Schema.Boolean),
|
|
38
|
-
},
|
|
39
|
-
) {}
|
|
29
|
+
export class LogsTimeoutError extends Schema.TaggedError<LogsTimeoutError>()("LogsTimeoutError", {
|
|
30
|
+
message: Schema.String,
|
|
31
|
+
source: Schema.String,
|
|
32
|
+
timeoutMs: Schema.Number,
|
|
33
|
+
hint: Schema.optionalKey(Schema.String),
|
|
34
|
+
nextCommand: Schema.optionalKey(Schema.String),
|
|
35
|
+
retryable: Schema.optionalKey(Schema.Boolean),
|
|
36
|
+
}) {}
|
|
40
37
|
|
|
41
38
|
export type LogsError = LogsNotFoundError | LogsReadError | LogsConfigError | LogsTimeoutError;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
|
-
export class ObservabilityToolError extends Schema.
|
|
3
|
+
export class ObservabilityToolError extends Schema.TaggedError<ObservabilityToolError>()(
|
|
4
4
|
"ObservabilityToolError",
|
|
5
5
|
{
|
|
6
6
|
cause: Schema.Unknown,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
|
-
export class SessionStorageNotFoundError extends Schema.
|
|
3
|
+
export class SessionStorageNotFoundError extends Schema.TaggedError<SessionStorageNotFoundError>()(
|
|
4
4
|
"SessionStorageNotFoundError",
|
|
5
5
|
{
|
|
6
6
|
message: Schema.String,
|
|
@@ -8,22 +8,19 @@ export class SessionStorageNotFoundError extends Schema.TaggedErrorClass<Session
|
|
|
8
8
|
},
|
|
9
9
|
) {}
|
|
10
10
|
|
|
11
|
-
export class SessionReadError extends Schema.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
source: Schema.String,
|
|
16
|
-
},
|
|
17
|
-
) {}
|
|
11
|
+
export class SessionReadError extends Schema.TaggedError<SessionReadError>()("SessionReadError", {
|
|
12
|
+
message: Schema.String,
|
|
13
|
+
source: Schema.String,
|
|
14
|
+
}) {}
|
|
18
15
|
|
|
19
|
-
export class SessionConfigError extends Schema.
|
|
16
|
+
export class SessionConfigError extends Schema.TaggedError<SessionConfigError>()(
|
|
20
17
|
"SessionConfigError",
|
|
21
18
|
{
|
|
22
19
|
message: Schema.String,
|
|
23
20
|
},
|
|
24
21
|
) {}
|
|
25
22
|
|
|
26
|
-
export class SessionParseError extends Schema.
|
|
23
|
+
export class SessionParseError extends Schema.TaggedError<SessionParseError>()(
|
|
27
24
|
"SessionParseError",
|
|
28
25
|
{
|
|
29
26
|
message: Schema.String,
|
|
@@ -2,7 +2,7 @@ import { Effect, Schema } from "effect";
|
|
|
2
2
|
|
|
3
3
|
const envTemplateRegex = /\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g;
|
|
4
4
|
|
|
5
|
-
export class EnvTemplateError extends Schema.
|
|
5
|
+
export class EnvTemplateError extends Schema.TaggedError<EnvTemplateError>()(
|
|
6
6
|
"@agent-tools/EnvTemplateError",
|
|
7
7
|
{ envVar: Schema.String },
|
|
8
8
|
) {}
|
package/src/shared/exec.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Effect, Schema, Stream } from "effect";
|
|
|
3
3
|
|
|
4
4
|
const DEFAULT_TIMEOUT_MS = 30000;
|
|
5
5
|
|
|
6
|
-
export class ExecError extends Schema.
|
|
6
|
+
export class ExecError extends Schema.TaggedError<ExecError>()("ExecError", {
|
|
7
7
|
message: Schema.String,
|
|
8
8
|
command: Schema.String,
|
|
9
9
|
exitCode: Schema.Number,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
|
-
export class PrerequisiteRunError extends Schema.
|
|
3
|
+
export class PrerequisiteRunError extends Schema.TaggedError<PrerequisiteRunError>()(
|
|
4
4
|
"PrerequisiteRunError",
|
|
5
5
|
{
|
|
6
6
|
message: Schema.String,
|
package/src/shared/throttle.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Effect, Ref, Schema } from "effect";
|
|
|
2
2
|
|
|
3
3
|
const WINDOW_MS = 60000;
|
|
4
4
|
|
|
5
|
-
export class ThrottleError extends Schema.
|
|
5
|
+
export class ThrottleError extends Schema.TaggedError<ThrottleError>()("ThrottleError", {
|
|
6
6
|
message: Schema.String,
|
|
7
7
|
label: Schema.String,
|
|
8
8
|
limit: Schema.Number,
|