@r_masseater/msch 0.123.1 → 0.124.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/cli.mjs CHANGED
@@ -37,6 +37,7 @@ import { findPackageJson } from "@r_masseater/masseater-utils/kestrion/node";
37
37
  import { findSkillFiles } from "@tanstack/intent";
38
38
  import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http";
39
39
  import { runMainWith } from "@r_masseater/masseater-utils/node-main";
40
+ import { sdkAgentQuery } from "@r_masseater/masseater-utils/agent-query";
40
41
  import { dual } from "effect/Function";
41
42
  import { judgeText } from "@r_masseater/oxlint-plugin-decision";
42
43
  import { finished, mustSucceed, outputOf, succeeds, writeOutputs } from "@r_masseater/masseater-utils/github-workflow";
@@ -47,7 +48,7 @@ import { Buffer } from "node:buffer";
47
48
  import { createZstdDecompress } from "node:zlib";
48
49
  // package.json
49
50
  var name = "@r_masseater/msch";
50
- var version = "0.123.1";
51
+ var version = "0.124.0";
51
52
  var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
52
53
  var repository = {
53
54
  "type": "git",
@@ -20499,54 +20500,6 @@ const checkWithAgents = Effect.fn("checkWithAgents")(function* checkWithAgents(r
20499
20500
  const found = yield* Effect.forEach(checks, runAgentCheck(setup), { concurrency: SEQUENTIAL$1 });
20500
20501
  return pipe(found, Array$1.flatten);
20501
20502
  });
20502
- // src/shared/lib/agent-query.ts
20503
- const SDK = "@anthropic-ai/claude-agent-sdk";
20504
- const ResultMessage = Schema.Struct({
20505
- type: Schema.Literal("result"),
20506
- subtype: Schema.String,
20507
- is_error: Schema.Boolean,
20508
- structured_output: Schema.optional(Schema.Unknown)
20509
- });
20510
- const isResult = Schema.is(ResultMessage);
20511
- const reasonOf$2 = (failure) => {
20512
- if (failure instanceof Error) return failure.message;
20513
- return String(failure);
20514
- };
20515
- const loadSdk = Effect.tryPromise({
20516
- try: () => import("@anthropic-ai/claude-agent-sdk"),
20517
- catch: () => `${SDK} is not installed. Add it to the devDependencies of the repository root to run agents.`
20518
- });
20519
- const answerOf = (message) => {
20520
- if (message.is_error || message.subtype !== "success") return Effect.fail(`the agent ended with ${message.subtype}`);
20521
- return Effect.fromOption(Option.fromUndefinedOr(message.structured_output)).pipe(Effect.mapError(() => "the agent returned no structured output"));
20522
- };
20523
- const lastResult = (messages) => pipe(Stream.fromAsyncIterable(messages, reasonOf$2), Stream.filter(isResult), Stream.runLast);
20524
- /** @internal */
20525
- const sdkAgentQuery = Effect.fn("sdkAgentQuery")(function* querying(request) {
20526
- const messages = (yield* loadSdk).query({
20527
- prompt: request.prompt,
20528
- options: {
20529
- cwd: request.directory,
20530
- model: request.model,
20531
- effort: request.effort,
20532
- tools: [...request.tools],
20533
- allowedTools: [...request.allowed],
20534
- permissionMode: "dontAsk",
20535
- settingSources: [],
20536
- mcpServers: {},
20537
- strictMcpConfig: true,
20538
- persistSession: false,
20539
- maxTurns: request.maxTurns,
20540
- outputFormat: {
20541
- type: "json_schema",
20542
- schema: { ...request.schema }
20543
- }
20544
- }
20545
- });
20546
- const result = yield* lastResult(messages);
20547
- const message = yield* Effect.fromOption(result).pipe(Effect.mapError(() => "the agent ended without a result"));
20548
- return yield* answerOf(message);
20549
- });
20550
20503
  // src/app/agents-command.ts
20551
20504
  const agents = Effect.fn("agents")(function* investigating(input) {
20552
20505
  const root = (yield* RepositoryFiles).resolve(".");