chore: generate
This commit is contained in:
@@ -283,9 +283,7 @@ export function createPromptState(input: PromptInput): PromptState {
|
||||
const [shell, setShell] = createSignal(false)
|
||||
const placeholder = createMemo(() => {
|
||||
if (shell()) {
|
||||
return new StyledText([
|
||||
bg(input.theme().surface)(fg(input.theme().muted)('Run a command... "git status"')),
|
||||
])
|
||||
return new StyledText([bg(input.theme().surface)(fg(input.theme().muted)('Run a command... "git status"'))])
|
||||
}
|
||||
|
||||
if (!input.state().first) {
|
||||
@@ -1087,7 +1085,8 @@ export function createPromptState(input: PromptInput): PromptState {
|
||||
return
|
||||
}
|
||||
|
||||
const parsed = next.mode === "shell" || isNewCommand(next.text) ? undefined : parseSlashCommand(next.text, input.commands())
|
||||
const parsed =
|
||||
next.mode === "shell" || isNewCommand(next.text) ? undefined : parseSlashCommand(next.text, input.commands())
|
||||
if (parsed?.type === "pending") {
|
||||
input.onStatus("loading commands")
|
||||
return
|
||||
|
||||
@@ -515,14 +515,19 @@ function createLayer(input: StreamInput) {
|
||||
state.footerView = current
|
||||
}
|
||||
|
||||
const resolveShellAgent = Effect.fn("RunStreamTransport.resolveShellAgent")(function* (agent: string | undefined) {
|
||||
const resolveShellAgent = Effect.fn("RunStreamTransport.resolveShellAgent")(function* (
|
||||
agent: string | undefined,
|
||||
) {
|
||||
if (agent) {
|
||||
return agent
|
||||
}
|
||||
|
||||
const list = yield* Effect.promise(() =>
|
||||
input.sdk.app.agents(input.directory ? { directory: input.directory } : undefined, { throwOnError: true }),
|
||||
).pipe(Effect.map((item) => item.data ?? []), Effect.orElseSucceed(() => []))
|
||||
).pipe(
|
||||
Effect.map((item) => item.data ?? []),
|
||||
Effect.orElseSucceed(() => []),
|
||||
)
|
||||
const next = list.find((item) => item.mode !== "subagent" && item.hidden !== true)?.name
|
||||
if (next) {
|
||||
return next
|
||||
@@ -1023,7 +1028,8 @@ function createLayer(input: StreamInput) {
|
||||
],
|
||||
}
|
||||
const command = next.prompt.command
|
||||
const send = next.prompt.mode === "shell"
|
||||
const send =
|
||||
next.prompt.mode === "shell"
|
||||
? Effect.sync(() => {
|
||||
input.trace?.write("send.shell", {
|
||||
sessionID: input.sessionID,
|
||||
@@ -1031,7 +1037,8 @@ function createLayer(input: StreamInput) {
|
||||
})
|
||||
}).pipe(
|
||||
Effect.andThen(
|
||||
resolveShellAgent(next.agent).pipe(
|
||||
resolveShellAgent(next.agent)
|
||||
.pipe(
|
||||
Effect.flatMap((agent) =>
|
||||
Effect.promise(() =>
|
||||
input.sdk.session.shell(
|
||||
@@ -1045,7 +1052,8 @@ function createLayer(input: StreamInput) {
|
||||
),
|
||||
),
|
||||
),
|
||||
).pipe(
|
||||
)
|
||||
.pipe(
|
||||
Effect.tap(() =>
|
||||
Effect.sync(() => {
|
||||
input.trace?.write("send.shell.ok", {
|
||||
|
||||
Reference in New Issue
Block a user