@blogic-cz/agent-tools 1.14.5 → 1.14.6
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 +2 -10
- package/dist/api-tool/main.d.ts +6 -1
- package/dist/api-tool/main.d.ts.map +1 -1
- package/dist/audit-tool/main.d.ts +6 -1
- package/dist/audit-tool/main.d.ts.map +1 -1
- package/dist/az-tool/main.d.ts +6 -1
- package/dist/az-tool/main.d.ts.map +1 -1
- package/dist/azdo-tool/main.d.ts +6 -1
- package/dist/azdo-tool/main.d.ts.map +1 -1
- package/dist/credential-guard/registry.d.ts.map +1 -1
- package/dist/db-tool/main.d.ts +8 -1
- package/dist/db-tool/main.d.ts.map +1 -1
- package/dist/db-tool/service.d.ts +1 -0
- package/dist/db-tool/service.d.ts.map +1 -1
- package/dist/gh-tool/main.d.ts +4 -1
- package/dist/gh-tool/main.d.ts.map +1 -1
- package/dist/gh-tool/read/store.d.ts +4 -1
- package/dist/gh-tool/read/store.d.ts.map +1 -1
- package/dist/k8s-tool/main.d.ts +8 -1
- package/dist/k8s-tool/main.d.ts.map +1 -1
- package/dist/logs-tool/main.d.ts +4 -0
- package/dist/logs-tool/main.d.ts.map +1 -1
- package/dist/observability-tool/main.d.ts +6 -1
- package/dist/observability-tool/main.d.ts.map +1 -1
- package/dist/session-tool/main.d.ts +4 -0
- package/dist/session-tool/main.d.ts.map +1 -1
- package/dist/shared/secret-env.d.ts +9 -0
- package/dist/shared/secret-env.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/api-tool/index.ts +1 -1
- package/src/api-tool/main.ts +19 -6
- package/src/audit-tool/index.ts +1 -1
- package/src/audit-tool/main.ts +13 -4
- package/src/az-tool/index.ts +1 -1
- package/src/az-tool/main.ts +10 -4
- package/src/azdo-tool/index.ts +1 -1
- package/src/azdo-tool/main.ts +13 -4
- package/src/credential-guard/registry.ts +93 -3
- package/src/db-tool/index.ts +1 -1
- package/src/db-tool/main.ts +10 -4
- package/src/db-tool/service.ts +6 -1
- package/src/gh-tool/index.ts +1 -1
- package/src/gh-tool/main.ts +5 -4
- package/src/gh-tool/read/store.ts +8 -2
- package/src/k8s-tool/index.ts +1 -1
- package/src/k8s-tool/main.ts +10 -4
- package/src/logs-tool/index.ts +1 -1
- package/src/logs-tool/main.ts +13 -4
- package/src/observability-tool/index.ts +1 -1
- package/src/observability-tool/main.ts +10 -2
- package/src/session-tool/index.ts +1 -1
- package/src/session-tool/main.ts +10 -13
- package/src/shared/secret-env.ts +108 -88
package/README.md
CHANGED
|
@@ -361,16 +361,8 @@ Membership comes from GitHub's stacks API, never from chaining `baseRefName` to
|
|
|
361
361
|
That chain both over-reports (a promotion PR whose head is `main` adopts every ordinary PR as a
|
|
362
362
|
child) and under-reports (a PR based on a stack member's branch need not be in the stack).
|
|
363
363
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
```bash
|
|
368
|
-
AGENT_TOOLS_E2E=1 bun tests/e2e/stack-merge.e2e.ts
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
It builds a real three-deep stack and asserts the thing no mock can prove — that each
|
|
372
|
-
squash commit on the trunk adds only its own PR's changes, so a squashed parent is not
|
|
373
|
-
replayed inside its child.
|
|
364
|
+
Stack-merge tests run in-process with synthetic GitHub responses. They do not prove
|
|
365
|
+
that GitHub squash commits exclude changes from an already squashed parent.
|
|
374
366
|
|
|
375
367
|
### gh-tool machine contracts
|
|
376
368
|
|
package/dist/api-tool/main.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { Command } from "effect/cli";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { ApiError } from "./errors";
|
|
4
|
+
export declare const mainCommand: Command.Command<"api-tool", {} | {}, {}, ApiError, never>;
|
|
5
|
+
export declare const runMain: () => void;
|
|
6
|
+
export declare const runProgram: (args: readonly string[]) => Effect.Effect<void, ApiError | import("effect/cli/CliError").CliError, never>;
|
|
2
7
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/api-tool/main.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/api-tool/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGzC,OAAO,EAAE,QAAQ,EAAuB,MAAM,UAAU,CAAC;AAyCzD,eAAO,MAAM,WAAW,2DAEvB,CAAC;AACF,eAAO,MAAM,OAAO,YAWjB,CAAC;AAEJ,eAAO,MAAM,UAAU,SAAU,SAAS,MAAM,EAAE,kFAQ/C,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
|
|
2
|
+
import { Command } from "effect/cli";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
import { AuditService } from "#shared/audit";
|
|
5
|
+
export declare const mainCommand: Command.Command<"audit-tool", {} | {}, {}, never, AuditService>;
|
|
6
|
+
export declare const runMain: () => void;
|
|
7
|
+
export declare const runProgram: (args: readonly string[]) => Effect.Effect<void, import("effect/cli/CliError").CliError, never>;
|
|
3
8
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/audit-tool/main.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/audit-tool/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAQ,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAiB,MAAM,QAAQ,CAAC;AAU/C,OAAO,EAAE,YAAY,EAAgC,MAAM,eAAe,CAAC;AAgF3E,eAAO,MAAM,WAAW,iEAGvB,CAAC;AAcF,eAAO,MAAM,OAAO,YAGhB,CAAC;AAEL,eAAO,MAAM,UAAU,SAAU,SAAS,MAAM,EAAE,uEAMuB,CAAC"}
|
package/dist/az-tool/main.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
|
|
2
|
+
import { Command } from "effect/cli";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
import { AzService } from "./service";
|
|
5
|
+
export declare const mainCommand: Command.Command<"az-tool", {} | {}, {}, import("./errors").AzCommandError | import("./errors").AzParseError | import("./errors").AzProfileError | import("./errors").AzSecurityError | import("./errors").AzTimeoutError, AzService>;
|
|
6
|
+
export declare const runMain: () => void;
|
|
7
|
+
export declare const runProgram: (args: readonly string[]) => Effect.Effect<void, import("./errors").AzCommandError | import("./errors").AzParseError | import("./errors").AzProfileError | import("./errors").AzSecurityError | import("./errors").AzTimeoutError | import("../config/loader").ConfigLoadError | import("effect/cli/CliError").CliError, never>;
|
|
3
8
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/az-tool/main.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/az-tool/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAQ,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAiB,MAAM,QAAQ,CAAC;AAY/C,OAAO,EAAE,SAAS,EAAkB,MAAM,WAAW,CAAC;AAiGtD,eAAO,MAAM,WAAW,sOAsBvB,CAAC;AAkBF,eAAO,MAAM,OAAO,YAGhB,CAAC;AAEL,eAAO,MAAM,UAAU,SAAU,SAAS,MAAM,EAAE,uSAGuB,CAAC"}
|
package/dist/azdo-tool/main.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
|
|
2
|
+
import { Command } from "effect/cli";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
import { AzdoService } from "./service";
|
|
5
|
+
export declare const mainCommand: Command.Command<"azdo-tool", {} | {}, {}, import("./errors").AzdoCommandError | import("./errors").AzdoParseError | import("./errors").AzdoSecurityError | import("./errors").AzdoTimeoutError, AzdoService>;
|
|
6
|
+
export declare const runMain: () => void;
|
|
7
|
+
export declare const runProgram: (args: readonly string[]) => Effect.Effect<void, import("./errors").AzdoCommandError | import("./errors").AzdoParseError | import("./errors").AzdoSecurityError | import("./errors").AzdoTimeoutError | import("../config/loader").ConfigLoadError | import("effect/cli/CliError").CliError, never>;
|
|
3
8
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/azdo-tool/main.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/azdo-tool/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAQ,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAiB,MAAM,QAAQ,CAAC;AAoB/C,OAAO,EAAE,WAAW,EAAoB,MAAM,WAAW,CAAC;AAmK1D,eAAO,MAAM,WAAW,8MAiBvB,CAAC;AAkBF,eAAO,MAAM,OAAO,YAGhB,CAAC;AAEL,eAAO,MAAM,UAAU,SAAU,SAAS,MAAM,EAAE,2QAMuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/credential-guard/registry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAK1C,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,YAAY,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,SAAS,CAAC;AAChF,MAAM,MAAM,WAAW,GACnB,M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
|
4
|
+
import { ConfigService } from "#config";
|
|
5
|
+
import { DbConfigService } from "./config-service";
|
|
6
|
+
import { DbService } from "./service";
|
|
7
|
+
export declare const mainCommand: Command.Command<"db-tool", {} | {}, {}, import("./errors").DbError, ConfigService | DbConfigService | DbService>;
|
|
8
|
+
export declare const runMain: () => void;
|
|
9
|
+
export declare const runProgram: (args: readonly string[]) => Effect.Effect<void, import("../config/loader").ConfigLoadError | import("effect/cli/CliError").CliError | import("./errors").DbError, never>;
|
|
3
10
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/db-tool/main.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/db-tool/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAQ,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAiB,MAAM,QAAQ,CAAC;AAe/C,OAAO,EAAE,aAAa,EAA6C,MAAM,SAAS,CAAC;AACnF,OAAO,EAAE,eAAe,EAAqB,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AA8MtC,eAAO,MAAM,WAAW,kHAWvB,CAAC;AAyBF,eAAO,MAAM,OAAO,YAGhB,CAAC;AAEL,eAAO,MAAM,UAAU,SAAU,SAAS,MAAM,EAAE,iJAGuB,CAAC"}
|
|
@@ -32,6 +32,7 @@ export declare function resolveHostOverride(literalHost: string, hostEnvVar: str
|
|
|
32
32
|
export declare function resolveDbAccessMode(env: string, host: string, hasKubectlConfig: boolean, allowedMutations?: readonly DbMutationOperation[]): Pick<DbConfig, "allowMutations" | "allowedMutations" | "host" | "needsTunnel">;
|
|
33
33
|
export declare function isFullyReadOnly(config: Pick<DbConfig, "allowMutations" | "allowedMutations" | "allowedMutationTargets">): boolean;
|
|
34
34
|
export { buildApiProbeArgs } from "#shared/k8s-probe";
|
|
35
|
+
export declare const DbGuardianInProcess: Context.Reference<boolean>;
|
|
35
36
|
declare const DbService_base: Context.ServiceClass<DbService, "@agent-tools/DbService", {
|
|
36
37
|
readonly executeQuery: (env: string, sql: string, limit?: number) => Effect.Effect<QueryResult, DbError>;
|
|
37
38
|
readonly executeSchemaQuery: (env: string, mode: SchemaMode, table?: string) => Effect.Effect<QueryResult, DbError>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/db-tool/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAS,OAAO,EAAY,MAAM,EAAE,KAAK,EAAkB,MAAM,QAAQ,CAAC;AAEjF,OAAO,KAAK,EAAE,QAAQ,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEtF,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAKvD,OAAO,EAAE,eAAe,EAA4B,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAqB,MAAM,cAAc,CAAC;AAC9D,OAAO,EAKL,KAAK,OAAO,EACb,MAAM,UAAU,CAAC;AAwBlB,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,KAAK,EAAE,MAAM,GAAG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,SAAU,SAAQ,cAcF;IAC3B,MAAM,CAAC,QAAQ,CAAC,KAAK,6IAovBnB;CACH"}
|
package/dist/gh-tool/main.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
|
|
2
|
+
import { Command } from "effect/cli";
|
|
3
|
+
import { GitHubService } from "./read/transport";
|
|
4
|
+
export declare const mainCommand: Command.Command<"gh-tool", {} | {}, {}, any, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | GitHubService>;
|
|
5
|
+
export declare const runMain: () => void;
|
|
3
6
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/gh-tool/main.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/gh-tool/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAkFrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AA6IjD,eAAO,MAAM,WAAW,gIAiDvB,CAAC;AAoCF,eAAO,MAAM,OAAO,YAGhB,CAAC"}
|
|
@@ -40,11 +40,14 @@ export declare const defaultCacheDirectory: () => string;
|
|
|
40
40
|
export declare class FileStore {
|
|
41
41
|
readonly directory: string;
|
|
42
42
|
readonly identity: string;
|
|
43
|
+
private readonly contentionTimeoutMs;
|
|
43
44
|
private readonly counters;
|
|
44
45
|
private readonly statsId;
|
|
45
46
|
private statsWrite;
|
|
46
47
|
private constructor();
|
|
47
|
-
static open(identity: string, directory?: string
|
|
48
|
+
static open(identity: string, directory?: string, options?: {
|
|
49
|
+
contentionTimeoutMs?: number;
|
|
50
|
+
}): Promise<FileStore>;
|
|
48
51
|
readClock(): Promise<ReadFence>;
|
|
49
52
|
private clockUnderLock;
|
|
50
53
|
get ghCacheDirectory(): string;
|
|
@@ -1 +1 @@
|
|
|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C,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,EACjD,KAAK,EAAE,CAAC,EACR,SAAS,EAAE,OAAO,EAClB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,OAAO,CAAC,CAmClB;IAED,aAAa,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAcpF;IAEK,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYvD;IAEK,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAc/C;CACF"}
|
package/dist/k8s-tool/main.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
|
|
2
|
+
import { Command } from "effect/cli";
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
import { K8sService } from "./service";
|
|
5
|
+
import { ConfigService } from "#config";
|
|
6
|
+
import { K8sContextError } from "./errors";
|
|
7
|
+
export declare const mainCommand: Command.Command<"k8s-tool", {} | {}, {}, K8sContextError, ConfigService | K8sService>;
|
|
8
|
+
export declare const runMain: () => void;
|
|
9
|
+
export declare const runProgram: (args: readonly string[]) => Effect.Effect<void, import("../config/loader").ConfigLoadError | K8sContextError | import("effect/cli/CliError").CliError, never>;
|
|
3
10
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/k8s-tool/main.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/k8s-tool/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAQ,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAiB,MAAM,QAAQ,CAAC;AAc/C,OAAO,EAAE,UAAU,EAAmB,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,aAAa,EAA4D,MAAM,SAAS,CAAC;AAElG,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAub3C,eAAO,MAAM,WAAW,uFAWvB,CAAC;AAkBF,eAAO,MAAM,OAAO,YAGhB,CAAC;AAEL,eAAO,MAAM,UAAU,SAAU,SAAS,MAAM,EAAE,sIAGuB,CAAC"}
|
package/dist/logs-tool/main.d.ts
CHANGED
|
@@ -12,9 +12,13 @@
|
|
|
12
12
|
* Always start with --list to see available log files.
|
|
13
13
|
* Use --format toon for LLM-optimized output (fewer tokens).
|
|
14
14
|
*/
|
|
15
|
+
import { Command } from "effect/cli";
|
|
15
16
|
import { Effect } from "effect";
|
|
16
17
|
import { ConfigService } from "#config";
|
|
17
18
|
import { LogsConfigError } from "./errors";
|
|
18
19
|
import { LogsService } from "./service";
|
|
20
|
+
export declare const mainCommand: Command.Command<"logs-tool", {} | {}, {}, LogsConfigError, ConfigService | LogsService>;
|
|
19
21
|
export declare const run: (args: ReadonlyArray<string>) => Effect.Effect<void, LogsConfigError | import("effect/cli/CliError").CliError, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | ConfigService | import("effect/FileSystem").FileSystem | LogsService | import("effect/Path").Path | import("effect/Stdio").Stdio | import("effect/Terminal").Terminal>;
|
|
22
|
+
export declare const runMain: () => void;
|
|
23
|
+
export declare const runProgram: (args: readonly string[]) => Effect.Effect<void, import("../config/loader").ConfigLoadError | LogsConfigError | import("effect/cli/CliError").CliError, never>;
|
|
20
24
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/logs-tool/main.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/logs-tool/main.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,OAAO,EAAQ,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAyB,MAAM,QAAQ,CAAC;AAcvD,OAAO,EAAE,aAAa,EAA6C,MAAM,SAAS,CAAC;AACnF,OAAO,EAAE,eAAe,EAAsD,MAAM,UAAU,CAAC;AAC/F,OAAO,EAAE,WAAW,EAAoB,MAAM,WAAW,CAAC;AA6L1D,eAAO,MAAM,WAAW,yFAGvB,CAAC;AAWF,eAAO,MAAM,GAAG,SAAU,aAAa,CAAC,MAAM,CAAC,4TAC6C,CAAC;AAa7F,eAAO,MAAM,OAAO,YAGhB,CAAC;AAEL,eAAO,MAAM,UAAU,SAAU,SAAS,MAAM,EAAE,sIAMuB,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { Command } from "effect/cli";
|
|
4
|
+
import { SecretEnvResolver } from "#shared/secret-env";
|
|
5
|
+
export declare const mainCommand: Command.Command<"observability-tool", {} | {}, {}, never, import("#config").ConfigService | SecretEnvResolver>;
|
|
6
|
+
export declare const runMain: () => void;
|
|
7
|
+
export declare const runProgram: (args: readonly string[]) => Effect.Effect<void, import("../config/loader").ConfigLoadError | import("effect/cli/CliError").CliError, never>;
|
|
3
8
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/observability-tool/main.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/observability-tool/main.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,MAAM,EAAS,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAKrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AASvD,eAAO,MAAM,WAAW,gHAKvB,CAAC;AAgBF,eAAO,MAAM,OAAO,YAAqE,CAAC;AAE1F,eAAO,MAAM,UAAU,SAAU,SAAS,MAAM,EAAE,oHAMuB,CAAC"}
|
|
@@ -5,8 +5,12 @@
|
|
|
5
5
|
* Lists, searches, and reads OpenCode session history.
|
|
6
6
|
* Uses current project scope by default, or all projects with --all.
|
|
7
7
|
*/
|
|
8
|
+
import { Command } from "effect/cli";
|
|
8
9
|
import { Effect } from "effect";
|
|
9
10
|
import { ResolvedPaths } from "./config";
|
|
10
11
|
import { SessionService } from "./service";
|
|
12
|
+
export declare const mainCommand: Command.Command<"session-tool", {} | {}, {}, never, ResolvedPaths | SessionService>;
|
|
11
13
|
export declare const run: (args: ReadonlyArray<string>) => Effect.Effect<void, import("effect/cli/CliError").CliError, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | import("effect/FileSystem").FileSystem | import("effect/Path").Path | ResolvedPaths | SessionService | import("effect/Stdio").Stdio | import("effect/Terminal").Terminal>;
|
|
14
|
+
export declare const runProgram: (args: readonly string[]) => Effect.Effect<void, import("effect/cli/CliError").CliError | undefined, never>;
|
|
15
|
+
export declare const runMain: () => void;
|
|
12
16
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/session-tool/main.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/session-tool/main.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAY,OAAO,EAAQ,MAAM,YAAY,CAAC;AAErD,OAAO,EAAE,MAAM,EAAiB,MAAM,QAAQ,CAAC;AAgB/C,OAAO,EAAE,aAAa,EAAsB,MAAM,UAAU,CAAC;AAE7D,OAAO,EAAc,cAAc,EAAuB,MAAM,WAAW,CAAC;AAuS5E,eAAO,MAAM,WAAW,qFAGvB,CAAC;AAMF,eAAO,MAAM,GAAG,SAAU,aAAa,CAAC,MAAM,CAAC,6SAC6C,CAAC;AAO7F,eAAO,MAAM,UAAU,SAAU,SAAS,MAAM,EAAE,mFAI/C,CAAC;AAEJ,eAAO,MAAM,OAAO,YAGhB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spawn, type SpawnOptions } from "node:child_process";
|
|
1
2
|
import { Context, Layer } from "effect";
|
|
2
3
|
export type LookupResult = {
|
|
3
4
|
readonly _tag: "found";
|
|
@@ -9,6 +10,14 @@ export type LookupResult = {
|
|
|
9
10
|
readonly reason: string;
|
|
10
11
|
};
|
|
11
12
|
export type ZshRunner = (name: string, timeoutMs: number) => Promise<LookupResult>;
|
|
13
|
+
type ZshProcess = Pick<ReturnType<typeof spawn>, "pid" | "stdio" | "kill"> & {
|
|
14
|
+
on: {
|
|
15
|
+
(event: "error", listener: () => void): unknown;
|
|
16
|
+
(event: "exit", listener: (code: number | null) => void): unknown;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export type ZshLauncher = (command: string, args: readonly string[], options: SpawnOptions) => ZshProcess;
|
|
20
|
+
export declare const makeZshRunner: (launch?: ZshLauncher, terminate?: (pid: number) => void) => ZshRunner;
|
|
12
21
|
declare const SecretEnvResolver_base: Context.ServiceClass<SecretEnvResolver, "@agent-tools/SecretEnvResolver", {
|
|
13
22
|
readonly resolveSecretEnv: (name: string) => Promise<string>;
|
|
14
23
|
readonly lookupConfigEnv: (name: string) => Promise<LookupResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secret-env.d.ts","sourceRoot":"","sources":["../../src/shared/secret-env.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"secret-env.d.ts","sourceRoot":"","sources":["../../src/shared/secret-env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,YAAY,EAAE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IACnC,MAAM,KAAK,SAAS,iDAEnB;IACD,MAAM,CAAC,QAAQ,CAAC,SAAS,YAAY,SAAS,kDACT;CACtC;AAED,wBAAgB,0BAA0B,CACxC,MAAM,GAAE,SAA6B,EACrC,SAAS,SAAqB,gDAwC/B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blogic-cz/agent-tools",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.6",
|
|
4
4
|
"description": "CLI tools for AI coding agent workflows — GitHub, database, Kubernetes, Azure platform, Azure DevOps, logs, sessions, and audit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"session-tool": "bun src/session-tool/index.ts",
|
|
159
159
|
"update:packages": "bun update -i -r",
|
|
160
160
|
"update:skills": "bun run .agents/skills/update-packages/references/skills-update-local.ts",
|
|
161
|
-
"test": "vitest run",
|
|
161
|
+
"test": "bun --bun node_modules/vitest/vitest.mjs run",
|
|
162
162
|
"api-tool": "bun src/api-tool/index.ts",
|
|
163
163
|
"api-proxy": "bun src/api-tool/proxy-entry.ts"
|
|
164
164
|
},
|
package/src/api-tool/index.ts
CHANGED
package/src/api-tool/main.ts
CHANGED
|
@@ -44,15 +44,28 @@ const requestCommand = Command.make(
|
|
|
44
44
|
).pipe(
|
|
45
45
|
Command.withDescription("Send a JSON REST request through an operator-owned credential proxy"),
|
|
46
46
|
);
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
export const mainCommand = Command.make("api-tool", {}).pipe(
|
|
48
|
+
Command.withSubcommands([requestCommand]),
|
|
49
|
+
);
|
|
50
|
+
export const runMain = () =>
|
|
51
|
+
BunRuntime.runMain(
|
|
52
|
+
Command.run(mainCommand, { version: VERSION, renderErrors: false }).pipe(
|
|
53
|
+
Effect.provide(BunServices.layer),
|
|
54
|
+
Effect.tapError((error) =>
|
|
55
|
+
Console.error(
|
|
56
|
+
JSON.stringify(error instanceof ApiError ? safeError(error) : apiError("CONFIG_INVALID")),
|
|
57
|
+
),
|
|
58
|
+
),
|
|
59
|
+
),
|
|
60
|
+
{ disableErrorReporting: true },
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export const runProgram = (args: readonly string[]) =>
|
|
64
|
+
Command.runWith(mainCommand, { version: VERSION, renderErrors: false })(args).pipe(
|
|
50
65
|
Effect.provide(BunServices.layer),
|
|
51
66
|
Effect.tapError((error) =>
|
|
52
67
|
Console.error(
|
|
53
68
|
JSON.stringify(error instanceof ApiError ? safeError(error) : apiError("CONFIG_INVALID")),
|
|
54
69
|
),
|
|
55
70
|
),
|
|
56
|
-
)
|
|
57
|
-
{ disableErrorReporting: true },
|
|
58
|
-
);
|
|
71
|
+
);
|
package/src/audit-tool/index.ts
CHANGED
package/src/audit-tool/main.ts
CHANGED
|
@@ -91,7 +91,7 @@ const purgeCommand = Command.make(
|
|
|
91
91
|
|
|
92
92
|
const commandsCommand = makeSchemaCommand(() => mainCommand);
|
|
93
93
|
|
|
94
|
-
const mainCommand = Command.make("audit-tool", {}).pipe(
|
|
94
|
+
export const mainCommand = Command.make("audit-tool", {}).pipe(
|
|
95
95
|
Command.withDescription("Audit log inspection and maintenance for agent-tools"),
|
|
96
96
|
Command.withSubcommands([listCommand, purgeCommand, commandsCommand]),
|
|
97
97
|
);
|
|
@@ -108,6 +108,15 @@ const program = withRedactedOutput(withAudit("audit", cli)).pipe(
|
|
|
108
108
|
Effect.tapCause(renderCauseToStderr),
|
|
109
109
|
);
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
export const runMain = () =>
|
|
112
|
+
BunRuntime.runMain(program, {
|
|
113
|
+
disableErrorReporting: true,
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
export const runProgram = (args: readonly string[]) =>
|
|
117
|
+
withRedactedOutput(
|
|
118
|
+
withAudit(
|
|
119
|
+
"audit",
|
|
120
|
+
Command.runWith(mainCommand, { version: VERSION, renderErrors: false })(args),
|
|
121
|
+
),
|
|
122
|
+
).pipe(Effect.provide(MainLayer), Effect.tapCause(renderCauseToStderr));
|
package/src/az-tool/index.ts
CHANGED
package/src/az-tool/main.ts
CHANGED
|
@@ -110,7 +110,7 @@ EXAMPLES:
|
|
|
110
110
|
|
|
111
111
|
const commandsCommand = makeSchemaCommand(() => mainCommand);
|
|
112
112
|
|
|
113
|
-
const mainCommand = Command.make("az-tool", {}).pipe(
|
|
113
|
+
export const mainCommand = Command.make("az-tool", {}).pipe(
|
|
114
114
|
Command.withDescription(
|
|
115
115
|
`Azure Platform Tool for Coding Agents (READ-ONLY)
|
|
116
116
|
|
|
@@ -150,6 +150,12 @@ const program = withRedactedOutput(withAudit("az", cli)).pipe(
|
|
|
150
150
|
Effect.tapCause(renderCauseToStderr),
|
|
151
151
|
);
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
export const runMain = () =>
|
|
154
|
+
BunRuntime.runMain(program, {
|
|
155
|
+
disableErrorReporting: true,
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
export const runProgram = (args: readonly string[]) =>
|
|
159
|
+
withRedactedOutput(
|
|
160
|
+
withAudit("az", Command.runWith(mainCommand, { version: VERSION, renderErrors: false })(args)),
|
|
161
|
+
).pipe(Effect.provide(MainLayer), Effect.tapCause(renderCauseToStderr));
|
package/src/azdo-tool/index.ts
CHANGED
package/src/azdo-tool/main.ts
CHANGED
|
@@ -184,7 +184,7 @@ EXAMPLES:
|
|
|
184
184
|
|
|
185
185
|
const commandsCommand = makeSchemaCommand(() => mainCommand);
|
|
186
186
|
|
|
187
|
-
const mainCommand = Command.make("azdo-tool", {}).pipe(
|
|
187
|
+
export const mainCommand = Command.make("azdo-tool", {}).pipe(
|
|
188
188
|
Command.withDescription(
|
|
189
189
|
`Azure DevOps Tool for Coding Agents (READ-ONLY)
|
|
190
190
|
|
|
@@ -219,6 +219,15 @@ const program = withRedactedOutput(withAudit("azdo", cli)).pipe(
|
|
|
219
219
|
Effect.tapCause(renderCauseToStderr),
|
|
220
220
|
);
|
|
221
221
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
export const runMain = () =>
|
|
223
|
+
BunRuntime.runMain(program, {
|
|
224
|
+
disableErrorReporting: true,
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
export const runProgram = (args: readonly string[]) =>
|
|
228
|
+
withRedactedOutput(
|
|
229
|
+
withAudit(
|
|
230
|
+
"azdo",
|
|
231
|
+
Command.runWith(mainCommand, { version: VERSION, renderErrors: false })(args),
|
|
232
|
+
),
|
|
233
|
+
).pipe(Effect.provide(MainLayer), Effect.tapCause(renderCauseToStderr));
|
|
@@ -1164,6 +1164,78 @@ export const EXECUTABLES: readonly ExecutableEntry[] = [
|
|
|
1164
1164
|
operands: [path],
|
|
1165
1165
|
startup: ["JAVA_TOOL_OPTIONS", "JDK_JAVA_OPTIONS", "CLASSPATH", "_JAVA_OPTIONS", "JAVA_HOME"],
|
|
1166
1166
|
},
|
|
1167
|
+
{
|
|
1168
|
+
name: "hc",
|
|
1169
|
+
rejectsAbbreviations: true,
|
|
1170
|
+
options: {
|
|
1171
|
+
...flags("--json", "--help", "-h", "--version", "-V", "--skill", "--licenses"),
|
|
1172
|
+
},
|
|
1173
|
+
operands: [data],
|
|
1174
|
+
subcommands: {
|
|
1175
|
+
...Object.fromEntries(
|
|
1176
|
+
[
|
|
1177
|
+
"get",
|
|
1178
|
+
"keys",
|
|
1179
|
+
"interrupt",
|
|
1180
|
+
"attach",
|
|
1181
|
+
"kill",
|
|
1182
|
+
"rm",
|
|
1183
|
+
"label",
|
|
1184
|
+
"keep",
|
|
1185
|
+
"ls",
|
|
1186
|
+
"read",
|
|
1187
|
+
"wait",
|
|
1188
|
+
"templates",
|
|
1189
|
+
"events",
|
|
1190
|
+
"schema",
|
|
1191
|
+
"connect",
|
|
1192
|
+
"server",
|
|
1193
|
+
].map((name) => [
|
|
1194
|
+
name,
|
|
1195
|
+
{
|
|
1196
|
+
operands: [data],
|
|
1197
|
+
options: {
|
|
1198
|
+
...flags("--all", "--off", "--wait", "--force"),
|
|
1199
|
+
"--lines": arg(data),
|
|
1200
|
+
"--output": arg(data),
|
|
1201
|
+
"--children": arg(data),
|
|
1202
|
+
"--timeout": arg(data),
|
|
1203
|
+
},
|
|
1204
|
+
},
|
|
1205
|
+
]),
|
|
1206
|
+
),
|
|
1207
|
+
send: {
|
|
1208
|
+
operands: [data, path],
|
|
1209
|
+
options: {
|
|
1210
|
+
...flags("--force", "--json", "--wait"),
|
|
1211
|
+
"--if": arg(data),
|
|
1212
|
+
"--timeout": arg(data),
|
|
1213
|
+
},
|
|
1214
|
+
},
|
|
1215
|
+
run: {
|
|
1216
|
+
operands: [data],
|
|
1217
|
+
options: {
|
|
1218
|
+
...flags("--bg", "--outlive-parent", "--no-parent", "--no-notify", "--rm", "--keep"),
|
|
1219
|
+
"--name": arg(data),
|
|
1220
|
+
"--cwd": arg(path),
|
|
1221
|
+
"--on": arg(data),
|
|
1222
|
+
"--label": arg(data),
|
|
1223
|
+
"--parent": arg(data),
|
|
1224
|
+
"--timeout": arg(data),
|
|
1225
|
+
},
|
|
1226
|
+
},
|
|
1227
|
+
exec: {
|
|
1228
|
+
operands: [data],
|
|
1229
|
+
options: {
|
|
1230
|
+
...flags("-i", "--stdin"),
|
|
1231
|
+
"--cwd": arg(path),
|
|
1232
|
+
"--on": arg(data),
|
|
1233
|
+
"--env": { roles: [data], issue: unknown("hc environment override") },
|
|
1234
|
+
"--timeout": arg(data),
|
|
1235
|
+
},
|
|
1236
|
+
},
|
|
1237
|
+
},
|
|
1238
|
+
},
|
|
1167
1239
|
{
|
|
1168
1240
|
name: "herdr",
|
|
1169
1241
|
options: {
|
|
@@ -4231,7 +4303,11 @@ function classifyInvocation(
|
|
|
4231
4303
|
}
|
|
4232
4304
|
const a = argv[position];
|
|
4233
4305
|
if (a === undefined) {
|
|
4234
|
-
if (
|
|
4306
|
+
if (
|
|
4307
|
+
["env", "forward", "timeout", "xargs"].includes(entry.semantics ?? "") ||
|
|
4308
|
+
(entry.name === "hc" &&
|
|
4309
|
+
(mode === entry.subcommands?.run || mode === entry.subcommands?.exec))
|
|
4310
|
+
)
|
|
4235
4311
|
issues.push({
|
|
4236
4312
|
kind: "missing-knowledge",
|
|
4237
4313
|
rule: "opaque-executable",
|
|
@@ -4457,8 +4533,8 @@ function classifyInvocation(
|
|
|
4457
4533
|
(attached ?? argv[position + 1]) === undefined
|
|
4458
4534
|
)
|
|
4459
4535
|
issues.push(unknown("Bun option operand is not literal"));
|
|
4460
|
-
if (entry.name
|
|
4461
|
-
if (cwdOperands.length) issues.push(unknown(
|
|
4536
|
+
if (["bun", "hc"].includes(entry.name) && optionName === "--cwd") {
|
|
4537
|
+
if (cwdOperands.length) issues.push(unknown(`repeated ${entry.name} working directory`));
|
|
4462
4538
|
cwdOperands.push({
|
|
4463
4539
|
index: attached === undefined ? position + 1 : position,
|
|
4464
4540
|
...(attached !== undefined ? { literal: attached } : {}),
|
|
@@ -4581,6 +4657,18 @@ function classifyInvocation(
|
|
|
4581
4657
|
position++;
|
|
4582
4658
|
continue;
|
|
4583
4659
|
}
|
|
4660
|
+
if (
|
|
4661
|
+
entry.name === "hc" &&
|
|
4662
|
+
(mode === entry.subcommands?.run || mode === entry.subcommands?.exec)
|
|
4663
|
+
) {
|
|
4664
|
+
if (mode === entry.subcommands?.run && position === argv.length - 1) {
|
|
4665
|
+
roles.push({ index: position, role: code("bash") });
|
|
4666
|
+
roles.push({ index: position, role: path });
|
|
4667
|
+
issues.push(...unknownOperandIssues([a]));
|
|
4668
|
+
codeSeen = true;
|
|
4669
|
+
} else child(position);
|
|
4670
|
+
break;
|
|
4671
|
+
}
|
|
4584
4672
|
if (entry.name === "git" && mode === entry.subcommands?.bisect?.subcommands?.run) {
|
|
4585
4673
|
child(position);
|
|
4586
4674
|
break;
|
|
@@ -4669,6 +4757,8 @@ function classifyInvocation(
|
|
|
4669
4757
|
if (effect && effect !== "none") issues.push(effect);
|
|
4670
4758
|
if (!positional.length && !children.length && !codeSeen && entry.bare) issues.push(entry.bare);
|
|
4671
4759
|
roles.push(...optionRoles);
|
|
4760
|
+
if (entry.name === "hc" && mode === entry.subcommands?.send)
|
|
4761
|
+
issues.push(...unknownOperandIssues(positional.slice(1).map((index) => argv[index])));
|
|
4672
4762
|
const operands =
|
|
4673
4763
|
(filterOption && ["sed", "awk"].includes(entry.semantics ?? "")) ||
|
|
4674
4764
|
(filterOption &&
|
package/src/db-tool/index.ts
CHANGED
package/src/db-tool/main.ts
CHANGED
|
@@ -225,7 +225,7 @@ const grantsCommand = makeDiagnosticCommand(
|
|
|
225
225
|
|
|
226
226
|
const commandsCommand = makeSchemaCommand(() => mainCommand);
|
|
227
227
|
|
|
228
|
-
const mainCommand = Command.make("db-tool", {}).pipe(
|
|
228
|
+
export const mainCommand = Command.make("db-tool", {}).pipe(
|
|
229
229
|
Command.withDescription("Database Query Tool for Coding Agents"),
|
|
230
230
|
Command.withSubcommands([
|
|
231
231
|
sqlCommand,
|
|
@@ -261,6 +261,12 @@ const program = withRedactedOutput(withAudit("db", cli)).pipe(
|
|
|
261
261
|
Effect.tapCause(renderCauseToStderr),
|
|
262
262
|
);
|
|
263
263
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
264
|
+
export const runMain = () =>
|
|
265
|
+
BunRuntime.runMain(program, {
|
|
266
|
+
disableErrorReporting: true,
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
export const runProgram = (args: readonly string[]) =>
|
|
270
|
+
withRedactedOutput(
|
|
271
|
+
withAudit("db", Command.runWith(mainCommand, { version: VERSION, renderErrors: false })(args)),
|
|
272
|
+
).pipe(Effect.provide(MainLayer), Effect.tapCause(renderCauseToStderr));
|
package/src/db-tool/service.ts
CHANGED
|
@@ -133,6 +133,10 @@ export function isFullyReadOnly(
|
|
|
133
133
|
// Re-exported from the shared probe so existing `#db/service` consumers keep working.
|
|
134
134
|
export { buildApiProbeArgs } from "#shared/k8s-probe";
|
|
135
135
|
|
|
136
|
+
export const DbGuardianInProcess = Context.Reference<boolean>("@agent-tools/DbGuardianInProcess", {
|
|
137
|
+
defaultValue: () => false,
|
|
138
|
+
});
|
|
139
|
+
|
|
136
140
|
export class DbService extends Context.Service<
|
|
137
141
|
DbService,
|
|
138
142
|
{
|
|
@@ -156,6 +160,7 @@ export class DbService extends Context.Service<
|
|
|
156
160
|
const sqlClient = yield* DbSqlClient;
|
|
157
161
|
const secretEnvResolver = yield* SecretEnvResolver;
|
|
158
162
|
const agentToolsConfig = yield* ConfigService;
|
|
163
|
+
const runGuardianInProcess = yield* DbGuardianInProcess;
|
|
159
164
|
const dbConfig = yield* DbConfigService;
|
|
160
165
|
|
|
161
166
|
if (!dbConfig) {
|
|
@@ -364,7 +369,7 @@ export class DbService extends Context.Service<
|
|
|
364
369
|
prerequisiteConfig,
|
|
365
370
|
(command, _label) => executeShellCommand(command),
|
|
366
371
|
effect,
|
|
367
|
-
{ tryWithoutPrerequisites: true },
|
|
372
|
+
{ tryWithoutPrerequisites: true, runGuardianInProcess },
|
|
368
373
|
).pipe(
|
|
369
374
|
Effect.mapError((error) =>
|
|
370
375
|
isPrerequisiteRunError(error)
|
package/src/gh-tool/index.ts
CHANGED
package/src/gh-tool/main.ts
CHANGED
|
@@ -222,7 +222,7 @@ const gistCommand = Command.make("gist", {}).pipe(
|
|
|
222
222
|
|
|
223
223
|
const commandsCommand = makeSchemaCommand(() => mainCommand);
|
|
224
224
|
|
|
225
|
-
const mainCommand = Command.make("gh-tool", {}).pipe(
|
|
225
|
+
export const mainCommand = Command.make("gh-tool", {}).pipe(
|
|
226
226
|
Command.withDescription(
|
|
227
227
|
`GitHub CLI Tool for Coding Agents
|
|
228
228
|
|
|
@@ -307,6 +307,7 @@ const observed = Effect.gen(function* () {
|
|
|
307
307
|
});
|
|
308
308
|
const program = observed.pipe(Effect.provide(MainLayer), Effect.tapCause(renderCauseToStderr));
|
|
309
309
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
310
|
+
export const runMain = () =>
|
|
311
|
+
BunRuntime.runMain(program, {
|
|
312
|
+
disableErrorReporting: true,
|
|
313
|
+
});
|
|
@@ -87,11 +87,13 @@ export class FileStore {
|
|
|
87
87
|
private constructor(
|
|
88
88
|
readonly directory: string,
|
|
89
89
|
readonly identity: string,
|
|
90
|
+
private readonly contentionTimeoutMs: number,
|
|
90
91
|
) {}
|
|
91
92
|
|
|
92
93
|
static async open(
|
|
93
94
|
identity: string,
|
|
94
95
|
directory = process.env["GH_TOOL_CACHE_DIR"] ?? defaultCacheDirectory(),
|
|
96
|
+
options: { contentionTimeoutMs?: number } = {},
|
|
95
97
|
): Promise<FileStore> {
|
|
96
98
|
const uid = process.getuid?.();
|
|
97
99
|
if (uid === undefined) throw new Error("Cache ownership cannot be verified");
|
|
@@ -116,7 +118,11 @@ export class FileStore {
|
|
|
116
118
|
await checkDirectory(path);
|
|
117
119
|
}),
|
|
118
120
|
);
|
|
119
|
-
const store = new FileStore(
|
|
121
|
+
const store = new FileStore(
|
|
122
|
+
join(directory, "gh-read-v1"),
|
|
123
|
+
identity,
|
|
124
|
+
options.contentionTimeoutMs ?? 2000,
|
|
125
|
+
);
|
|
120
126
|
await mkdir(store.ghCacheDirectory, { recursive: true, mode: 0o700 });
|
|
121
127
|
await checkDirectory(store.ghCacheDirectory);
|
|
122
128
|
await store.readClock();
|
|
@@ -226,7 +232,7 @@ export class FileStore {
|
|
|
226
232
|
}
|
|
227
233
|
},
|
|
228
234
|
25,
|
|
229
|
-
|
|
235
|
+
this.contentionTimeoutMs,
|
|
230
236
|
);
|
|
231
237
|
try {
|
|
232
238
|
return await body();
|
package/src/k8s-tool/index.ts
CHANGED
package/src/k8s-tool/main.ts
CHANGED
|
@@ -457,7 +457,7 @@ const topCommand = Command.make(
|
|
|
457
457
|
|
|
458
458
|
const commandsCommand = makeSchemaCommand(() => mainCommand);
|
|
459
459
|
|
|
460
|
-
const mainCommand = Command.make("k8s-tool", {}).pipe(
|
|
460
|
+
export const mainCommand = Command.make("k8s-tool", {}).pipe(
|
|
461
461
|
Command.withDescription("Kubernetes CLI Tool for Coding Agents"),
|
|
462
462
|
Command.withSubcommands([
|
|
463
463
|
kubectlCommand,
|
|
@@ -486,6 +486,12 @@ const program = withRedactedOutput(withAudit("k8s", cli)).pipe(
|
|
|
486
486
|
Effect.tapCause(renderCauseToStderr),
|
|
487
487
|
);
|
|
488
488
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
489
|
+
export const runMain = () =>
|
|
490
|
+
BunRuntime.runMain(program, {
|
|
491
|
+
disableErrorReporting: true,
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
export const runProgram = (args: readonly string[]) =>
|
|
495
|
+
withRedactedOutput(
|
|
496
|
+
withAudit("k8s", Command.runWith(mainCommand, { version: VERSION, renderErrors: false })(args)),
|
|
497
|
+
).pipe(Effect.provide(MainLayer), Effect.tapCause(renderCauseToStderr));
|
package/src/logs-tool/index.ts
CHANGED
package/src/logs-tool/main.ts
CHANGED
|
@@ -221,7 +221,7 @@ const readCommand = Command.make(
|
|
|
221
221
|
|
|
222
222
|
const commandsCommand = makeSchemaCommand(() => mainCommand);
|
|
223
223
|
|
|
224
|
-
const mainCommand = Command.make("logs-tool", {}).pipe(
|
|
224
|
+
export const mainCommand = Command.make("logs-tool", {}).pipe(
|
|
225
225
|
Command.withDescription("Application Logs Tool for Coding Agents"),
|
|
226
226
|
Command.withSubcommands([listCommand, readCommand, commandsCommand]),
|
|
227
227
|
);
|
|
@@ -249,6 +249,15 @@ const program = withRedactedOutput(withAudit("logs", cli)).pipe(
|
|
|
249
249
|
Effect.tapCause(renderCauseToStderr),
|
|
250
250
|
);
|
|
251
251
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
252
|
+
export const runMain = () =>
|
|
253
|
+
BunRuntime.runMain(program, {
|
|
254
|
+
disableErrorReporting: true,
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
export const runProgram = (args: readonly string[]) =>
|
|
258
|
+
withRedactedOutput(
|
|
259
|
+
withAudit(
|
|
260
|
+
"logs",
|
|
261
|
+
Command.runWith(mainCommand, { version: VERSION, renderErrors: false })(args),
|
|
262
|
+
),
|
|
263
|
+
).pipe(Effect.provide(MainLayer), Effect.tapCause(renderCauseToStderr));
|
|
@@ -16,7 +16,7 @@ import { traceCommand } from "./trace";
|
|
|
16
16
|
|
|
17
17
|
const commandsCommand = makeSchemaCommand(() => mainCommand);
|
|
18
18
|
|
|
19
|
-
const mainCommand = Command.make("observability-tool", {}).pipe(
|
|
19
|
+
export const mainCommand = Command.make("observability-tool", {}).pipe(
|
|
20
20
|
Command.withDescription(
|
|
21
21
|
"LGTM observability queries — Tempo traces, Loki logs, Prometheus metrics",
|
|
22
22
|
),
|
|
@@ -37,4 +37,12 @@ const program = withRedactedOutput(withAudit("observability", cli)).pipe(
|
|
|
37
37
|
Effect.tapCause(renderCauseToStderr),
|
|
38
38
|
);
|
|
39
39
|
|
|
40
|
-
BunRuntime.runMain(program, { disableErrorReporting: true });
|
|
40
|
+
export const runMain = () => BunRuntime.runMain(program, { disableErrorReporting: true });
|
|
41
|
+
|
|
42
|
+
export const runProgram = (args: readonly string[]) =>
|
|
43
|
+
withRedactedOutput(
|
|
44
|
+
withAudit(
|
|
45
|
+
"observability",
|
|
46
|
+
Command.runWith(mainCommand, { version: VERSION, renderErrors: false })(args),
|
|
47
|
+
),
|
|
48
|
+
).pipe(Effect.provide(MainLayer), Effect.tapCause(renderCauseToStderr));
|
package/src/session-tool/main.ts
CHANGED
|
@@ -322,16 +322,11 @@ const readCommand = Command.make(
|
|
|
322
322
|
|
|
323
323
|
const commandsCommand = makeSchemaCommand(() => mainCommand);
|
|
324
324
|
|
|
325
|
-
const mainCommand = Command.make("session-tool", {}).pipe(
|
|
325
|
+
export const mainCommand = Command.make("session-tool", {}).pipe(
|
|
326
326
|
Command.withDescription("OpenCode session history tool"),
|
|
327
327
|
Command.withSubcommands([listCommand, readCommand, searchCommand, commandsCommand]),
|
|
328
328
|
);
|
|
329
329
|
|
|
330
|
-
const cli = Command.run(mainCommand, {
|
|
331
|
-
version: VERSION,
|
|
332
|
-
renderErrors: false,
|
|
333
|
-
});
|
|
334
|
-
|
|
335
330
|
const runWithErrorsDisabled = Command.runWith(mainCommand, {
|
|
336
331
|
version: VERSION,
|
|
337
332
|
renderErrors: false,
|
|
@@ -344,11 +339,13 @@ const MainLayer = AppLayer.pipe(
|
|
|
344
339
|
Layer.provideMerge(AuditServiceLayer),
|
|
345
340
|
);
|
|
346
341
|
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
)
|
|
342
|
+
export const runProgram = (args: readonly string[]) =>
|
|
343
|
+
withRedactedOutput(withAudit("session", runWithErrorsDisabled(args))).pipe(
|
|
344
|
+
Effect.provide(MainLayer),
|
|
345
|
+
Effect.tapCause(renderCauseToStderr),
|
|
346
|
+
);
|
|
351
347
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
348
|
+
export const runMain = () =>
|
|
349
|
+
BunRuntime.runMain(runProgram(process.argv.slice(2)), {
|
|
350
|
+
disableErrorReporting: true,
|
|
351
|
+
});
|
package/src/shared/secret-env.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
1
|
+
import { spawn, type SpawnOptions } from "node:child_process";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { relative, resolve as resolvePath } from "node:path";
|
|
4
4
|
import { Context, Layer } from "effect";
|
|
@@ -75,101 +75,121 @@ const inspectFrame = (frame: Buffer): FrameInspection => {
|
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
78
|
+
type ZshProcess = Pick<ReturnType<typeof spawn>, "pid" | "stdio" | "kill"> & {
|
|
79
|
+
on: {
|
|
80
|
+
(event: "error", listener: () => void): unknown;
|
|
81
|
+
(event: "exit", listener: (code: number | null) => void): unknown;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
export type ZshLauncher = (
|
|
85
|
+
command: string,
|
|
86
|
+
args: readonly string[],
|
|
87
|
+
options: SpawnOptions,
|
|
88
|
+
) => ZshProcess;
|
|
89
|
+
export const makeZshRunner =
|
|
90
|
+
(
|
|
91
|
+
launch: ZshLauncher = spawn,
|
|
92
|
+
terminate: (pid: number) => void = (pid) => {
|
|
93
|
+
process.kill(pid, "SIGKILL");
|
|
94
|
+
},
|
|
95
|
+
): ZshRunner =>
|
|
96
|
+
(name, timeoutMs) =>
|
|
97
|
+
new Promise((resolve) => {
|
|
98
|
+
if (process.env.VITEST !== undefined) {
|
|
99
|
+
const home = process.env.HOME;
|
|
100
|
+
const zdotdir = process.env.ZDOTDIR;
|
|
101
|
+
const relativeZdotdir = zdotdir ? relative(tmpdir(), resolvePath(zdotdir)) : "..";
|
|
102
|
+
if (
|
|
103
|
+
!home ||
|
|
104
|
+
!zdotdir ||
|
|
105
|
+
resolvePath(home) !== resolvePath(zdotdir) ||
|
|
106
|
+
relativeZdotdir === ".." ||
|
|
107
|
+
relativeZdotdir.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)
|
|
108
|
+
) {
|
|
109
|
+
resolve(failed(name));
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
93
112
|
}
|
|
94
|
-
}
|
|
95
113
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
let child: ReturnType<typeof spawn>;
|
|
105
|
-
try {
|
|
106
|
-
child = spawn("zsh", ["-i", "-c", script, "agent-tools-secret-env", name], {
|
|
107
|
-
detached: true,
|
|
108
|
-
env: childEnv,
|
|
109
|
-
stdio: ["ignore", "ignore", "ignore", "pipe"],
|
|
110
|
-
});
|
|
111
|
-
} catch {
|
|
112
|
-
resolve(failed(name));
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
114
|
+
const childEnv = Object.fromEntries(
|
|
115
|
+
STARTUP_ENV_NAMES.flatMap((key) => {
|
|
116
|
+
const value = process.env[key];
|
|
117
|
+
return value === undefined ? [] : [[key, value]];
|
|
118
|
+
}),
|
|
119
|
+
);
|
|
120
|
+
const script = `export LC_ALL=C; if (( \${+parameters[$1]} )); then value=\${(P)1}; print -ru3 -- "set"; print -ru3 -- "\${#value}"; print -rn -- "$value" >&3; else print -ru3 -- "unset"; fi`;
|
|
115
121
|
|
|
116
|
-
|
|
117
|
-
if (!stream || typeof stream === "number") {
|
|
118
|
-
child.kill("SIGKILL");
|
|
119
|
-
resolve(failed(name));
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
const chunks: Buffer[] = [];
|
|
124
|
-
let exited = false;
|
|
125
|
-
let ended = false;
|
|
126
|
-
let exitCode: number | null = null;
|
|
127
|
-
let settled = false;
|
|
128
|
-
const killProcessGroup = () => {
|
|
129
|
-
if (child.pid === undefined) return;
|
|
122
|
+
let child: ZshProcess;
|
|
130
123
|
try {
|
|
131
|
-
|
|
124
|
+
child = launch("zsh", ["-i", "-c", script, "agent-tools-secret-env", name], {
|
|
125
|
+
detached: true,
|
|
126
|
+
env: childEnv,
|
|
127
|
+
stdio: ["ignore", "ignore", "ignore", "pipe"],
|
|
128
|
+
});
|
|
132
129
|
} catch {
|
|
133
|
-
|
|
130
|
+
resolve(failed(name));
|
|
131
|
+
return;
|
|
134
132
|
}
|
|
135
|
-
};
|
|
136
|
-
const finish = (result: LookupResult) => {
|
|
137
|
-
if (settled) return;
|
|
138
|
-
settled = true;
|
|
139
|
-
clearTimeout(timer);
|
|
140
|
-
stream.destroy();
|
|
141
|
-
killProcessGroup();
|
|
142
|
-
resolve(result);
|
|
143
|
-
};
|
|
144
|
-
const checkFrame = () => {
|
|
145
|
-
if (settled) return;
|
|
146
|
-
const inspection = inspectFrame(Buffer.concat(chunks));
|
|
147
|
-
if (inspection._tag === "malformed") return finish(failed(name));
|
|
148
|
-
if (!exited) return;
|
|
149
|
-
if (exitCode !== 0) return finish(failed(name));
|
|
150
|
-
if (inspection._tag === "complete") finish(inspection.result);
|
|
151
|
-
else if (ended) finish(failed(name));
|
|
152
|
-
};
|
|
153
|
-
const timer = setTimeout(() => {
|
|
154
|
-
finish(failed(name));
|
|
155
|
-
}, timeoutMs);
|
|
156
133
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
134
|
+
const stream = child.stdio[3];
|
|
135
|
+
if (!stream || typeof stream === "number") {
|
|
136
|
+
child.kill("SIGKILL");
|
|
137
|
+
resolve(failed(name));
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const chunks: Buffer[] = [];
|
|
142
|
+
let exited = false;
|
|
143
|
+
let ended = false;
|
|
144
|
+
let exitCode: number | null = null;
|
|
145
|
+
let settled = false;
|
|
146
|
+
const killProcessGroup = () => {
|
|
147
|
+
if (child.pid === undefined) return;
|
|
148
|
+
try {
|
|
149
|
+
terminate(-child.pid);
|
|
150
|
+
} catch {
|
|
151
|
+
// The process group may already have exited.
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
const finish = (result: LookupResult) => {
|
|
155
|
+
if (settled) return;
|
|
156
|
+
settled = true;
|
|
157
|
+
clearTimeout(timer);
|
|
158
|
+
stream.destroy();
|
|
159
|
+
killProcessGroup();
|
|
160
|
+
resolve(result);
|
|
161
|
+
};
|
|
162
|
+
const checkFrame = () => {
|
|
163
|
+
if (settled) return;
|
|
164
|
+
const inspection = inspectFrame(Buffer.concat(chunks));
|
|
165
|
+
if (inspection._tag === "malformed") return finish(failed(name));
|
|
166
|
+
if (!exited) return;
|
|
167
|
+
if (exitCode !== 0) return finish(failed(name));
|
|
168
|
+
if (inspection._tag === "complete") finish(inspection.result);
|
|
169
|
+
else if (ended) finish(failed(name));
|
|
170
|
+
};
|
|
171
|
+
const timer = setTimeout(() => {
|
|
172
|
+
finish(failed(name));
|
|
173
|
+
}, timeoutMs);
|
|
174
|
+
|
|
175
|
+
stream.on("data", (chunk: Buffer | string) => {
|
|
176
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
177
|
+
checkFrame();
|
|
178
|
+
});
|
|
179
|
+
stream.on("end", () => {
|
|
180
|
+
ended = true;
|
|
181
|
+
checkFrame();
|
|
182
|
+
});
|
|
183
|
+
stream.on("error", () => finish(failed(name)));
|
|
184
|
+
child.on("error", () => finish(failed(name)));
|
|
185
|
+
child.on("exit", (code) => {
|
|
186
|
+
exited = true;
|
|
187
|
+
exitCode = code;
|
|
188
|
+
checkFrame();
|
|
189
|
+
});
|
|
171
190
|
});
|
|
172
|
-
|
|
191
|
+
|
|
192
|
+
const runInteractiveZsh = makeZshRunner();
|
|
173
193
|
|
|
174
194
|
export class SecretEnvResolver extends Context.Service<
|
|
175
195
|
SecretEnvResolver,
|