@blogic-cz/agent-tools 0.14.0 → 0.14.2
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 +3 -3
- package/package.json +4 -4
- package/schemas/agent-tools.schema.json +18 -3
- package/src/config/loader.ts +3 -0
- package/src/config/types.ts +2 -1
- package/src/db-tool/service.ts +2 -1
package/README.md
CHANGED
|
@@ -174,17 +174,17 @@ bun run agent-tools/example-tool/index.ts ping
|
|
|
174
174
|
dbPath: "~/.agent-tools/audit.sqlite",
|
|
175
175
|
},
|
|
176
176
|
vpns: {
|
|
177
|
-
|
|
177
|
+
exampleVpn: {
|
|
178
178
|
// auto defaults to true:
|
|
179
179
|
// darwin -> macos-scutil, linux -> linux-nmcli, win32 -> windows-rasdial
|
|
180
|
-
name: "
|
|
180
|
+
name: "ExampleVPN",
|
|
181
181
|
},
|
|
182
182
|
},
|
|
183
183
|
kubernetes: {
|
|
184
184
|
default: {
|
|
185
185
|
clusterId: "your-cluster-id",
|
|
186
186
|
namespaces: { test: "your-ns-test", prod: "your-ns-prod" },
|
|
187
|
-
prerequisites: [{ type: "vpn", key: "
|
|
187
|
+
prerequisites: [{ type: "vpn", key: "exampleVpn" }],
|
|
188
188
|
// Prerequisites are currently decoded and validated as config metadata;
|
|
189
189
|
// automatic VPN connect/disconnect execution is planned for a follow-up release.
|
|
190
190
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blogic-cz/agent-tools",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
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",
|
|
@@ -133,13 +133,13 @@
|
|
|
133
133
|
"test": "vitest run"
|
|
134
134
|
},
|
|
135
135
|
"dependencies": {
|
|
136
|
-
"@effect/platform-bun": "4.0.0-beta.
|
|
136
|
+
"@effect/platform-bun": "4.0.0-beta.65",
|
|
137
137
|
"@toon-format/toon": "2.1.0",
|
|
138
|
-
"effect": "4.0.0-beta.
|
|
138
|
+
"effect": "4.0.0-beta.65"
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|
|
141
141
|
"@effect/language-service": "0.85.1",
|
|
142
|
-
"@effect/vitest": "4.0.0-beta.
|
|
142
|
+
"@effect/vitest": "4.0.0-beta.65",
|
|
143
143
|
"@types/bun": "1.3.12",
|
|
144
144
|
"oxfmt": "0.44.0",
|
|
145
145
|
"oxlint": "1.59.0",
|
|
@@ -209,6 +209,10 @@
|
|
|
209
209
|
"namespace": {
|
|
210
210
|
"description": "Kubectl namespace for tunnel commands.",
|
|
211
211
|
"type": "string"
|
|
212
|
+
},
|
|
213
|
+
"service": {
|
|
214
|
+
"description": "Kubernetes service name used as the port-forward target. Defaults to postgresql.",
|
|
215
|
+
"type": "string"
|
|
212
216
|
}
|
|
213
217
|
},
|
|
214
218
|
"required": ["context", "namespace"]
|
|
@@ -220,6 +224,17 @@
|
|
|
220
224
|
"remotePort": {
|
|
221
225
|
"description": "Optional remote database port used by the tunnel.",
|
|
222
226
|
"type": "number"
|
|
227
|
+
},
|
|
228
|
+
"prerequisites": {
|
|
229
|
+
"description": "Ordered prerequisite references required before remote database access.",
|
|
230
|
+
"type": "array",
|
|
231
|
+
"items": {
|
|
232
|
+
"$ref": "#/definitions/Prerequisite"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"vpn": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"description": "Convenience sugar for a VPN prerequisite key. Runtime normalizes this to prerequisites."
|
|
223
238
|
}
|
|
224
239
|
},
|
|
225
240
|
"required": ["environments"]
|
|
@@ -525,7 +540,7 @@
|
|
|
525
540
|
"namespaces": {
|
|
526
541
|
"test": "my-app-test",
|
|
527
542
|
"prod": "my-app-prod",
|
|
528
|
-
"system": "
|
|
543
|
+
"system": "system"
|
|
529
544
|
},
|
|
530
545
|
"timeoutMs": 60000
|
|
531
546
|
}
|
|
@@ -549,8 +564,8 @@
|
|
|
549
564
|
}
|
|
550
565
|
},
|
|
551
566
|
"kubectl": {
|
|
552
|
-
"context": "
|
|
553
|
-
"namespace": "
|
|
567
|
+
"context": "example-cluster",
|
|
568
|
+
"namespace": "system"
|
|
554
569
|
},
|
|
555
570
|
"tunnelTimeoutMs": 5000,
|
|
556
571
|
"remotePort": 5432
|
package/src/config/loader.ts
CHANGED
|
@@ -95,10 +95,13 @@ const DatabaseConfigSchema = Schema.Struct({
|
|
|
95
95
|
Schema.Struct({
|
|
96
96
|
context: Schema.String,
|
|
97
97
|
namespace: Schema.String,
|
|
98
|
+
service: Schema.optionalKey(Schema.String),
|
|
98
99
|
}),
|
|
99
100
|
),
|
|
100
101
|
tunnelTimeoutMs: Schema.optionalKey(Schema.Number),
|
|
101
102
|
remotePort: Schema.optionalKey(Schema.Number),
|
|
103
|
+
prerequisites: Schema.optionalKey(PrerequisitesSchema),
|
|
104
|
+
vpn: Schema.optionalKey(Schema.String),
|
|
102
105
|
});
|
|
103
106
|
|
|
104
107
|
const LogsConfigSchema = Schema.Struct({
|
package/src/config/types.ts
CHANGED
|
@@ -78,12 +78,13 @@ export type DbEnvConfig = {
|
|
|
78
78
|
};
|
|
79
79
|
|
|
80
80
|
/** Database profile configuration */
|
|
81
|
-
export type DatabaseConfig = {
|
|
81
|
+
export type DatabaseConfig = ProfilePrerequisites & {
|
|
82
82
|
/** Named database environments, e.g. { local: {...}, test: {...}, prod: {...} } */
|
|
83
83
|
environments: Record<string, DbEnvConfig>;
|
|
84
84
|
kubectl?: {
|
|
85
85
|
context: string;
|
|
86
86
|
namespace: string;
|
|
87
|
+
service?: string;
|
|
87
88
|
};
|
|
88
89
|
tunnelTimeoutMs?: number;
|
|
89
90
|
remotePort?: number;
|
package/src/db-tool/service.ts
CHANGED
|
@@ -67,6 +67,7 @@ export class DbService extends Context.Service<
|
|
|
67
67
|
|
|
68
68
|
const kubectlContext = dbConfig.kubectl?.context;
|
|
69
69
|
const kubectlNamespace = dbConfig.kubectl?.namespace;
|
|
70
|
+
const kubectlService = dbConfig.kubectl?.service ?? "postgresql";
|
|
70
71
|
const tunnelTimeoutMs = dbConfig.tunnelTimeoutMs ?? 5000;
|
|
71
72
|
const remotePort = dbConfig.remotePort ?? 5432;
|
|
72
73
|
|
|
@@ -213,7 +214,7 @@ export class DbService extends Context.Service<
|
|
|
213
214
|
kubectlContext,
|
|
214
215
|
"--namespace",
|
|
215
216
|
kubectlNamespace,
|
|
216
|
-
|
|
217
|
+
`svc/${kubectlService}`,
|
|
217
218
|
`${config.port}:${remotePort}`,
|
|
218
219
|
],
|
|
219
220
|
{ stdout: "pipe", stderr: "pipe" },
|