@blogic-cz/agent-tools 0.8.16 → 0.8.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blogic-cz/agent-tools",
3
- "version": "0.8.16",
3
+ "version": "0.8.17",
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",
@@ -116,22 +116,26 @@
116
116
  "lint": "oxlint -c ./.oxlintrc.json --deny-warnings",
117
117
  "lint:fix": "oxlint -c ./.oxlintrc.json --fix",
118
118
  "session-tool": "bun src/session-tool/index.ts",
119
+ "update:packages": "bun update -i -r",
119
120
  "update:skills": "bun run .agents/skills/update-packages/references/skills-update-local.ts",
120
121
  "test": "vitest run"
121
122
  },
122
123
  "dependencies": {
123
- "@effect/platform-bun": "4.0.0-beta.25",
124
+ "@effect/platform-bun": "4.0.0-beta.48",
124
125
  "@toon-format/toon": "2.1.0",
125
- "effect": "4.0.0-beta.25"
126
+ "effect": "4.0.0-beta.48"
126
127
  },
127
128
  "devDependencies": {
128
- "@effect/language-service": "0.77.0",
129
- "@effect/vitest": "4.0.0-beta.25",
130
- "@types/bun": "1.3.9",
131
- "oxfmt": "0.35.0",
132
- "oxlint": "1.50.0",
133
- "typescript": "5.9.3",
134
- "vitest": "^4.0.18"
129
+ "@effect/language-service": "0.85.1",
130
+ "@effect/vitest": "4.0.0-beta.48",
131
+ "@types/bun": "1.3.12",
132
+ "oxfmt": "0.44.0",
133
+ "oxlint": "1.59.0",
134
+ "typescript": "6.0.2",
135
+ "vitest": "^4.1.4"
136
+ },
137
+ "overrides": {
138
+ "@effect/platform-node-shared": "4.0.0-beta.48"
135
139
  },
136
140
  "engines": {
137
141
  "bun": ">=1.0.0"
@@ -1,5 +1,5 @@
1
1
  import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
2
- import { Effect, Layer, ServiceMap, Stream, Option } from "effect";
2
+ import { Context, Effect, Layer, Option, Stream } from "effect";
3
3
 
4
4
  import type { InvokeParams } from "./types";
5
5
  import type { AzureConfig } from "#config/types";
@@ -10,7 +10,7 @@ import { isCommandAllowed, isInvokeAllowed } from "./security";
10
10
  import { transformCmdOutput } from "./transformers";
11
11
  import { ConfigService, getToolConfig } from "#config";
12
12
 
13
- export class AzService extends ServiceMap.Service<
13
+ export class AzService extends Context.Service<
14
14
  AzService,
15
15
  {
16
16
  readonly runCommand: (
@@ -1,6 +1,6 @@
1
1
  import { dirname } from "node:path";
2
2
 
3
- import { Data, Effect, Layer, Schema, ServiceMap } from "effect";
3
+ import { Context, Data, Effect, Layer, Schema } from "effect";
4
4
 
5
5
  import type { AgentToolsConfig, GitHubRepoConfig } from "./types";
6
6
 
@@ -159,10 +159,9 @@ export async function loadConfig(): Promise<AgentToolsConfig | undefined> {
159
159
  return decodeConfig(parsed, configPath);
160
160
  }
161
161
 
162
- export class ConfigService extends ServiceMap.Service<
163
- ConfigService,
164
- AgentToolsConfig | undefined
165
- >()("@agent-tools/ConfigService") {}
162
+ export class ConfigService extends Context.Service<ConfigService, AgentToolsConfig | undefined>()(
163
+ "@agent-tools/ConfigService",
164
+ ) {}
166
165
 
167
166
  export class ConfigLoadError extends Data.TaggedError("ConfigLoadError")<{
168
167
  readonly cause: unknown;
@@ -1,4 +1,4 @@
1
- import { Effect, Layer, ServiceMap } from "effect";
1
+ import { Context, Effect, Layer } from "effect";
2
2
 
3
3
  import { ConfigService, getToolConfig } from "#config";
4
4
  import type { DatabaseConfig } from "#config";
@@ -12,10 +12,9 @@ import type { DatabaseConfig } from "#config";
12
12
  * const dbConfig = yield* DbConfigService;
13
13
  * if (!dbConfig) { // no config }
14
14
  */
15
- export class DbConfigService extends ServiceMap.Service<
16
- DbConfigService,
17
- DatabaseConfig | undefined
18
- >()("@agent-tools/DbConfigService") {}
15
+ export class DbConfigService extends Context.Service<DbConfigService, DatabaseConfig | undefined>()(
16
+ "@agent-tools/DbConfigService",
17
+ ) {}
19
18
 
20
19
  /**
21
20
  * Creates a DbConfigService layer that resolves the database config
@@ -1,5 +1,5 @@
1
1
  import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
2
- import { Clock, Duration, Effect, Layer, Ref, ServiceMap, Stream } from "effect";
2
+ import { Clock, Context, Duration, Effect, Layer, Ref, Stream } from "effect";
3
3
 
4
4
  import type { DbConfig, QueryResult, SchemaMode } from "./types";
5
5
 
@@ -33,7 +33,7 @@ export function resolveDbAccessMode(
33
33
  };
34
34
  }
35
35
 
36
- export class DbService extends ServiceMap.Service<
36
+ export class DbService extends Context.Service<
37
37
  DbService,
38
38
  {
39
39
  readonly executeQuery: (env: string, sql: string) => Effect.Effect<QueryResult, DbError>;
@@ -1,4 +1,4 @@
1
- import { Console, Effect, Option } from "effect";
1
+ import { Console, Effect, Option, Result } from "effect";
2
2
 
3
3
  import type {
4
4
  BranchPRDetail,
@@ -610,7 +610,7 @@ export const fetchChecks = Effect.fn("pr.fetchChecks")(function* (
610
610
  yield* gh.runGh(watchArgs).pipe(
611
611
  Effect.timeoutOrElse({
612
612
  duration: timeoutMs,
613
- onTimeout: () =>
613
+ orElse: () =>
614
614
  Effect.fail(
615
615
  new GitHubTimeoutError({
616
616
  message: `CI check monitoring timed out after ${timeoutSeconds}s`,
@@ -652,13 +652,18 @@ export const fetchChecksForCommand = Effect.fn("pr.fetchChecksForCommand")(funct
652
652
  }
653
653
 
654
654
  const watchedChecks = yield* fetchChecks(pr, true, failFast, timeoutSeconds).pipe(
655
- Effect.catchTag("GitHubCommandError", (error) =>
656
- Effect.succeed({ _tag: "command_error" as const, error }),
657
- ),
655
+ Effect.result,
656
+ Effect.flatMap((result) => {
657
+ if (Result.isFailure(result) && result.failure._tag !== "GitHubCommandError") {
658
+ return Effect.fail(result.failure);
659
+ }
660
+
661
+ return Effect.succeed(result);
662
+ }),
658
663
  );
659
664
 
660
- if (Array.isArray(watchedChecks)) {
661
- return watchedChecks;
665
+ if (Result.isSuccess(watchedChecks)) {
666
+ return watchedChecks.success;
662
667
  }
663
668
 
664
669
  const finalChecks = yield* fetchCheckResults(pr);
@@ -666,7 +671,7 @@ export const fetchChecksForCommand = Effect.fn("pr.fetchChecksForCommand")(funct
666
671
  return yield* buildFailedChecksReport(pr, finalChecks);
667
672
  }
668
673
 
669
- return yield* Effect.fail(watchedChecks.error);
674
+ return yield* Effect.fail(watchedChecks.failure);
670
675
  });
671
676
 
672
677
  export const rerunChecks = Effect.fn("pr.rerunChecks")(function* (
@@ -1,5 +1,5 @@
1
1
  import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
2
- import { Effect, Layer, ServiceMap, Stream } from "effect";
2
+ import { Context, Effect, Layer, Stream } from "effect";
3
3
 
4
4
  import type { RepoInfo } from "./types";
5
5
 
@@ -15,7 +15,7 @@ type GhResult = {
15
15
 
16
16
  type GhError = GitHubCommandError | GitHubAuthError | GitHubNotFoundError;
17
17
 
18
- export class GitHubService extends ServiceMap.Service<
18
+ export class GitHubService extends Context.Service<
19
19
  GitHubService,
20
20
  {
21
21
  readonly runGh: (args: string[]) => Effect.Effect<GhResult, GhError>;
@@ -1,5 +1,5 @@
1
1
  import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
2
- import { Effect, Layer, Option, Ref, ServiceMap, Stream } from "effect";
2
+ import { Context, Effect, Layer, Option, Ref, Stream } from "effect";
3
3
 
4
4
  import type { CommandResult, Environment } from "./types";
5
5
 
@@ -13,7 +13,7 @@ import { ConfigService, getToolConfig } from "#config";
13
13
  import type { K8sConfig } from "#config";
14
14
  import { isKubectlCommandAllowed } from "./security";
15
15
 
16
- export class K8sService extends ServiceMap.Service<
16
+ export class K8sService extends Context.Service<
17
17
  K8sService,
18
18
  {
19
19
  readonly runCommand: (
@@ -1,5 +1,5 @@
1
1
  import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
2
- import { Effect, Layer, Result, ServiceMap, Stream } from "effect";
2
+ import { Context, Effect, Layer, Result, Stream } from "effect";
3
3
 
4
4
  import type { Environment, LogFile, ReadOptions } from "./types";
5
5
 
@@ -47,7 +47,7 @@ export const sanitizeShellArg = (input: string): string => `'${input.replace(/'/
47
47
 
48
48
  const readCommandOutput = (output: unknown): string => (typeof output === "string" ? output : "");
49
49
 
50
- export class LogsService extends ServiceMap.Service<
50
+ export class LogsService extends Context.Service<
51
51
  LogsService,
52
52
  {
53
53
  readonly listLogs: (env: Environment, profile?: string) => Effect.Effect<LogFile[], LogsError>;
@@ -1,4 +1,4 @@
1
- import { Effect, Layer, ServiceMap } from "effect";
1
+ import { Context, Effect, Layer } from "effect";
2
2
  import { existsSync } from "node:fs";
3
3
  import { homedir } from "node:os";
4
4
  import { join } from "node:path";
@@ -38,7 +38,7 @@ export const resolveSessionsPath = Effect.gen(function* () {
38
38
  /**
39
39
  * Context tag for resolved paths (cached during effect execution).
40
40
  */
41
- export class ResolvedPaths extends ServiceMap.Service<
41
+ export class ResolvedPaths extends Context.Service<
42
42
  ResolvedPaths,
43
43
  {
44
44
  readonly messagesPath: string;
@@ -1,4 +1,4 @@
1
- import { Effect, Layer, ServiceMap } from "effect";
1
+ import { Context, Effect, Layer } from "effect";
2
2
  import { readdir } from "node:fs/promises";
3
3
 
4
4
  import type { MessageSummary, SessionInfo } from "./types";
@@ -142,7 +142,7 @@ const readJsonFilesFlat = (dir: string): Effect.Effect<FileEntry[], SessionError
142
142
  }),
143
143
  });
144
144
 
145
- export class SessionService extends ServiceMap.Service<
145
+ export class SessionService extends Context.Service<
146
146
  SessionService,
147
147
  {
148
148
  readonly getSessionsForProject: (
@@ -3,7 +3,7 @@ import { mkdirSync } from "node:fs";
3
3
  import { homedir } from "node:os";
4
4
  import { basename, dirname, join } from "node:path";
5
5
 
6
- import { Cause, Effect, Layer, ServiceMap } from "effect";
6
+ import { Cause, Context, Effect, Layer } from "effect";
7
7
 
8
8
  import { loadConfig } from "#config";
9
9
 
@@ -65,7 +65,7 @@ type TableInfoRow = {
65
65
  name: string;
66
66
  };
67
67
 
68
- export class AuditService extends ServiceMap.Service<AuditService, AuditServiceShape>()(
68
+ export class AuditService extends Context.Service<AuditService, AuditServiceShape>()(
69
69
  "@agent-tools/AuditService",
70
70
  ) {}
71
71