Normalize instance lifecycle wiring (#25501)

This commit is contained in:
Kit Langton
2026-05-02 20:39:20 -04:00
committed by GitHub
parent a6464062b7
commit 7d91d3b1ed
71 changed files with 852 additions and 936 deletions

View File

@@ -10,6 +10,7 @@ import fs from "fs/promises"
import { Filesystem } from "@/util/filesystem"
import matter from "gray-matter"
import { Instance } from "../../project/instance"
import { WithInstance } from "../../project/with-instance"
import { EOL } from "os"
import type { Argv } from "yargs"
@@ -61,7 +62,7 @@ const AgentCreateCommand = cmd({
describe: "model to use in the format of provider/model",
}),
async handler(args) {
await Instance.provide({
await WithInstance.provide({
directory: process.cwd(),
async fn() {
const cliPath = args.path
@@ -236,7 +237,7 @@ const AgentListCommand = cmd({
command: "list",
describe: "list all available agents",
async handler() {
await Instance.provide({
await WithInstance.provide({
directory: process.cwd(),
async fn() {
const agents = await AppRuntime.runPromise(Agent.Service.use((svc) => svc.list()))