Skip to content

Commit e9fca22

Browse files
Sync packages from monorepo (f6122a1)
1 parent e112d13 commit e9fca22

33 files changed

Lines changed: 285 additions & 225 deletions

File tree

packages/agent-cli-detect/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export type AgentCLIDefinition = {
88
displayName: string
99
/** CLI binary name(s) to search for */
1010
binaries: string[]
11-
/** npm package name, if installed via npm */
11+
/** Npm package name, if installed via npm */
1212
npmPackage?: string
1313
/** Additional well-known install paths to check beyond PATH */
1414
knownPaths?: string[]

packages/belay/src/graphql.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
* This allows using the Relay compiler for type generation without bundling relay-runtime.
44
*
55
* @example
6-
* ```ts
7-
* import { graphql } from '@puzzmo-com/belay'
6+
* ```ts
7+
* import { graphql } from "@puzzmo-com/belay"
88
*
9-
* const MyQuery = graphql`
9+
* const MyQuery = graphql`
1010
* query MyQuery {
11-
* viewer { id }
11+
* viewer { id }
1212
* }
13-
* `
14-
* ```
13+
* `
14+
* ```
1515
*/
1616
export const graphql = (strings: TemplateStringsArray): string => {
1717
return strings[0]!

packages/belay/src/mutate.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ import type { GraphQLResponse, OperationType, RequestOptions } from "./types"
44
* Execute a GraphQL mutation using fetch with Relay-generated types.
55
*
66
* @example
7-
* ```ts
8-
* import { graphql, mutate } from '@puzzmo-com/belay'
9-
* import type { UpdateUserMutation } from '@relay/UpdateUserMutation.graphql'
7+
* ```ts
8+
* import { graphql, mutate } from "@puzzmo-com/belay"
9+
* import type { UpdateUserMutation } from "@relay/UpdateUserMutation.graphql"
1010
*
11-
* const updateUserMutation = graphql`
11+
* const updateUserMutation = graphql`
1212
* mutation UpdateUserMutation($id: ID!, $input: UpdateUserInput!) {
13-
* updateUser(id: $id, input: $input) { id name }
13+
* updateUser(id: $id, input: $input) { id name }
1414
* }
15-
* `
15+
* `
1616
*
17-
* const { data, errors } = await mutate<UpdateUserMutation>(updateUserMutation, {
18-
* variables: { id: '123', input: { name: 'New Name' } },
19-
* url: 'https://api.puzzmo.com/graphql'
20-
* })
21-
* ```
17+
* const { data, errors } = await mutate<UpdateUserMutation>(updateUserMutation, {
18+
* variables: { id: "123", input: { name: "New Name" } },
19+
* url: "https://api.puzzmo.com/graphql",
20+
* })
21+
* ```
2222
*/
2323
export const mutate = async <T extends OperationType>(
2424
mutationString: string,

packages/belay/src/query.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ import type { GraphQLResponse, OperationType, RequestOptions } from "./types"
44
* Execute a GraphQL query using fetch with Relay-generated types.
55
*
66
* @example
7-
* ```ts
8-
* import { graphql, query } from '@puzzmo-com/belay'
9-
* import type { LoginFormQuery } from '@relay/LoginFormQuery.graphql'
7+
* ```ts
8+
* import { graphql, query } from "@puzzmo-com/belay"
9+
* import type { LoginFormQuery } from "@relay/LoginFormQuery.graphql"
1010
*
11-
* const loginQuery = graphql`
11+
* const loginQuery = graphql`
1212
* query LoginFormQuery($jwt: String!) {
13-
* login(jwt: $jwt) { id }
13+
* login(jwt: $jwt) { id }
1414
* }
15-
* `
15+
* `
1616
*
17-
* const { data, errors } = await query<LoginFormQuery>(loginQuery, {
18-
* variables: { jwt: 'xxx' },
19-
* url: 'https://api.puzzmo.com/graphql'
20-
* })
21-
* ```
17+
* const { data, errors } = await query<LoginFormQuery>(loginQuery, {
18+
* variables: { jwt: "xxx" },
19+
* url: "https://api.puzzmo.com/graphql",
20+
* })
21+
* ```
2222
*/
2323
export const query = async <T extends OperationType>(
2424
queryString: string,

packages/cli/src/agents/claude.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { runStreamJsonCli } from "./stream-json-cli.js"
22
import type { Agent, AgentEvent } from "./types.js"
33

4-
/** Claude adapter — wraps the local `claude` CLI in subprocess + stream-json mode
5-
* so the user's existing subscription auth keeps working. The Claude Agent SDK
6-
* requires an API key, which we explicitly want to avoid here. */
4+
/**
5+
* Claude adapter — wraps the local `claude` CLI in subprocess + stream-json mode
6+
* so the user's existing subscription auth keeps working. The Claude Agent SDK
7+
* requires an API key, which we explicitly want to avoid here.
8+
*/
79
export const claudeAgent: Agent = {
810
name: "claude",
911
run: (input) =>

packages/cli/src/agents/codex.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import { Codex } from "@openai/codex-sdk"
22

33
import type { Agent, AgentEvent, RunInput } from "./types.js"
44

5-
/** Codex adapter — wraps `@openai/codex-sdk`, which itself shells out to the
6-
* user's installed `codex` CLI and reuses its ChatGPT subscription auth. */
5+
/**
6+
* Codex adapter — wraps `@openai/codex-sdk`, which itself shells out to the
7+
* user's installed `codex` CLI and reuses its ChatGPT subscription auth.
8+
*/
79
export const codexAgent: Agent = {
810
name: "codex",
911
run(input) {

packages/cli/src/agents/copilot.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import { CopilotClient, approveAll } from "@github/copilot-sdk"
22

33
import type { Agent, AgentEvent, RunInput } from "./types.js"
44

5-
/** Copilot adapter — wraps `@github/copilot-sdk`, which spawns the bundled
6-
* `@github/copilot` CLI and reuses its OAuth/Copilot Pro subscription auth. */
5+
/**
6+
* Copilot adapter — wraps `@github/copilot-sdk`, which spawns the bundled
7+
* `@github/copilot` CLI and reuses its OAuth/Copilot Pro subscription auth.
8+
*/
79
export const copilotAgent: Agent = {
810
name: "copilot",
911
run(input) {

packages/cli/src/agents/gemini.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { runStreamJsonCli } from "./stream-json-cli.js"
22
import type { Agent, AgentEvent } from "./types.js"
33

4-
/** Gemini adapter — wraps the local `gemini` CLI in subprocess + stream-json
5-
* mode. Auth delegates to the user's `gemini` CLI login (Google account /
6-
* Code Assist) or falls back to GEMINI_API_KEY. */
4+
/**
5+
* Gemini adapter — wraps the local `gemini` CLI in subprocess + stream-json
6+
* mode. Auth delegates to the user's `gemini` CLI login (Google account /
7+
* Code Assist) or falls back to GEMINI_API_KEY.
8+
*/
79
export const geminiAgent: Agent = {
810
name: "gemini",
911
run: (input) =>
@@ -17,9 +19,11 @@ export const geminiAgent: Agent = {
1719
),
1820
}
1921

20-
/** Map one stream-json line from gemini to an AgentEvent (or null to skip).
21-
* Event union per `@google/gemini-cli-core`'s `JsonStreamEvent`:
22-
* init / message / tool_use / tool_result / error / result. */
22+
/**
23+
* Map one stream-json line from gemini to an AgentEvent (or null to skip).
24+
* Event union per `@google/gemini-cli-core`'s `JsonStreamEvent`:
25+
* init / message / tool_use / tool_result / error / result.
26+
*/
2327
const parseGeminiLine = (line: string): AgentEvent | null => {
2428
let obj: any
2529
try {

packages/cli/src/agents/opencode.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import { createOpencodeClient, createOpencodeServer } from "@opencode-ai/sdk"
22

33
import type { Agent, AgentEvent, RunInput } from "./types.js"
44

5-
/** OpenCode adapter — spawns a local opencode server, opens an SSE stream
6-
* against it, creates a session, and sends a prompt. Auth lives in the
7-
* user's `opencode` CLI config / `client.auth.set()`. */
5+
/**
6+
* OpenCode adapter — spawns a local opencode server, opens an SSE stream
7+
* against it, creates a session, and sends a prompt. Auth lives in the
8+
* user's `opencode` CLI config / `client.auth.set()`.
9+
*/
810
export const opencodeAgent: Agent = {
911
name: "opencode",
1012
run(input) {

packages/cli/src/agents/stream-json-cli.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import { spawn, type ChildProcess } from "node:child_process"
22

33
import type { AgentEvent, RunInput } from "./types.js"
44

5-
/** Shared driver for any CLI that emits NDJSON over stdout when given a prompt
6-
* in print/headless mode. Used by both the claude and gemini adapters. */
5+
/**
6+
* Shared driver for any CLI that emits NDJSON over stdout when given a prompt
7+
* in print/headless mode. Used by both the claude and gemini adapters.
8+
*/
79
export type StreamJsonCliConfig = {
810
cmd: string
911
buildArgs: (prompt: string) => string[]

0 commit comments

Comments
 (0)