@leviyuan/lodestar 0.19.9 → 0.19.11
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/lodestar-agent.js +1 -1
- package/dist/lodestar.js +219 -218
- package/docs/usage.md +2 -2
- package/package.json +1 -1
package/dist/lodestar-agent.js
CHANGED
|
@@ -124,6 +124,6 @@ try {
|
|
|
124
124
|
`}function r1(A,Q){process.stdout.write(Q?`${JSON.stringify(A,null,2)}
|
|
125
125
|
`:Yf(A))}function Yf(A){let Q=`lodestar-agent${A.binding==="project"?` --project ${kE(String(A.project))}`:""}`,B=[`# Lodestar agent ${A.run_id??"MISS"}`,"",`- Status: ${A.status??"MISS"}`,...A.binding==="project"?[`- Project: ${A.project}`]:[],`- Description: ${A.description??"MISS"}`,`- Work directory: ${A.work_dir??"MISS"}`,...A.parent_run_id?[`- Parent: ${A.parent_run_id} (${A.parent_kind??"delegate"})`]:[]];if(A.error)B.push(`- Error: ${A.error}`);for(let I of A.workers??[]){if(B.push("",`## ${I.identity_name??I.identity_id}`,"",`Status: ${I.status}`),I.session_id)B.push(`Session: ${I.session_id}`);if(I.error)B.push("",`Error: ${I.error}`);if(I.pending_input){B.push("",`Input request: ${I.pending_input.request_id}`);for(let C of I.pending_input.questions??[])if(B.push(`- [${C.id}] ${C.question}`),C.options?.length)B.push(` Options: ${C.options.map((g)=>g.label).join(" / ")}`);B.push("","Answer with:",`${Q} answer ${kE(A.run_id)} --identity ${kE(I.identity_id)} --request ${kE(I.pending_input.request_id)} --stdin`)}if(I.output)B.push("",I.output);if(I.session_id&&I.identity_id&&["completed","failed","cancelled"].includes(A.status))B.push("","Continue with:",`${Q} run --session ${kE(I.session_id)} --identity ${kE(I.identity_id)} --description '<brief next step>' --stdin`)}if(A.presentation_errors?.length)B.push("","Presentation errors:",...A.presentation_errors.map((I)=>`- ${I}`));return`${B.join(`
|
|
126
126
|
`)}
|
|
127
|
-
`}function kE(A){return`'${A.replace(/'/g,"'\\''")}'`}async function t1(){if(process.stdin.isTTY)return"";let A=[];for await(let Q of process.stdin)A.push(Buffer.isBuffer(Q)?Q:Buffer.from(Q));return Buffer.concat(A).toString("utf8")}function NC(A,Q){if(!A?.trim())throw Error(Q);return A.trim()}function i1(){return["Usage:"," lodestar-agent --project <project-or-worktree> <command> [options]"," lodestar-agent identities [--json]"," lodestar-agent run --identity <id> [--identity <id>...] --description <summary> [--workdir <path>] [--effort <level>] [--json] --stdin"," lodestar-agent run --session <session_id> [--identity <id>] --description <summary> [--workdir <path>] [--effort <level>] [--json] --stdin"," lodestar-agent follow-up <run_id> [--identity <id>] --description <summary> [--workdir <path>] [--effort <level>] [--json] --stdin"," lodestar-agent answer <run_id> [--identity <id>] --request <id> (--answer key=value | --stdin)"," lodestar-agent status <run_id> [--json]"," lodestar-agent cancel <run_id>","","Use --prompt <text> instead of --stdin for inline input. --no-wait returns the started run as JSON.","Agent task calls must use the managed-session context. --project is only for independent services and applications.","Without --project, the existing managed-session context is required; invalid contexts never switch modes.","Project run/follow-up: --request-id <unique-key> deduplicates retries; --requester <open_id>
|
|
127
|
+
`}function kE(A){return`'${A.replace(/'/g,"'\\''")}'`}async function t1(){if(process.stdin.isTTY)return"";let A=[];for await(let Q of process.stdin)A.push(Buffer.isBuffer(Q)?Q:Buffer.from(Q));return Buffer.concat(A).toString("utf8")}function NC(A,Q){if(!A?.trim())throw Error(Q);return A.trim()}function i1(){return["Usage:"," lodestar-agent --project <project-or-worktree> <command> [options]"," lodestar-agent identities [--json]"," lodestar-agent run --identity <id> [--identity <id>...] --description <summary> [--workdir <path>] [--effort <level>] [--json] --stdin"," lodestar-agent run --session <session_id> [--identity <id>] --description <summary> [--workdir <path>] [--effort <level>] [--json] --stdin"," lodestar-agent follow-up <run_id> [--identity <id>] --description <summary> [--workdir <path>] [--effort <level>] [--json] --stdin"," lodestar-agent answer <run_id> [--identity <id>] --request <id> (--answer key=value | --stdin)"," lodestar-agent status <run_id> [--json]"," lodestar-agent cancel <run_id>","","Use --prompt <text> instead of --stdin for inline input. --no-wait returns the started run as JSON.","Agent task calls must use the managed-session context. --project is only for independent services and applications.","Without --project, the existing managed-session context is required; invalid contexts never switch modes.","Project run/follow-up: --request-id <unique-key> deduplicates retries; --requester <open_id> records the requester only.","Agent results and local artifact paths return to the caller. File-delivery markers are not executed.","--session resumes the unique native conversation id only within its registered project and group.","Unknown ownership and cross-project/group resumes are rejected, even with an explicit identity.","--identity may change the model/source within the original backend; effort and project-local workdir may be overridden.","The new run belongs to the current caller; the previous run keeps its original owner and cancellation scope.","--workdir defaults to the managed-session or explicit-project directory; relative paths are resolved from it.","New conversations and resumes stay within that project root. Resumes otherwise reuse the recorded directory.","session_id is the stable conversation identity; run_id identifies only one invocation, not a second session.","--description is required for every run/follow-up: one short line, at most 60 characters, shown on the collapsed card.","Each turn has a new run_id; workers[].session_id identifies the native conversation."].join(`
|
|
128
128
|
`)}function e1(A){return A instanceof Error?A.message:String(A)}if(process.argv[1]&&d1(process.argv[1])===d1(Qf(import.meta.url)))Bf().catch((A)=>{process.stderr.write(`lodestar-agent: ${e1(A)}
|
|
129
129
|
`),process.exitCode=1});export{n1 as parsePromptArgs,Bf as main,gf as extractProjectOption};
|