create-expert 0.0.44 → 0.0.45
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/bin/cli.js +3 -3
- package/package.json +14 -17
- package/bin/cli.ts +0 -99
package/dist/bin/cli.js
CHANGED
|
@@ -16306,7 +16306,7 @@ const EMPTY_COMPLETION_RESULT = { completion: {
|
|
|
16306
16306
|
//#endregion
|
|
16307
16307
|
//#region ../base/package.json
|
|
16308
16308
|
var name$5 = "@perstack/base";
|
|
16309
|
-
var version$2 = "0.0.
|
|
16309
|
+
var version$2 = "0.0.68";
|
|
16310
16310
|
|
|
16311
16311
|
//#endregion
|
|
16312
16312
|
//#region ../base/src/tools/todo.ts
|
|
@@ -19985,7 +19985,7 @@ var SkillManager = class SkillManager {
|
|
|
19985
19985
|
|
|
19986
19986
|
//#endregion
|
|
19987
19987
|
//#region ../../packages/runtime/package.json
|
|
19988
|
-
var version$1 = "0.0.
|
|
19988
|
+
var version$1 = "0.0.117";
|
|
19989
19989
|
|
|
19990
19990
|
//#endregion
|
|
19991
19991
|
//#region ../../packages/runtime/src/helpers/usage.ts
|
|
@@ -118779,7 +118779,7 @@ async function startHandler(expertKey, query, options, handlerOptions) {
|
|
|
118779
118779
|
//#endregion
|
|
118780
118780
|
//#region package.json
|
|
118781
118781
|
var name = "create-expert";
|
|
118782
|
-
var version = "0.0.
|
|
118782
|
+
var version = "0.0.45";
|
|
118783
118783
|
var description = "Create and modify Perstack expert definitions";
|
|
118784
118784
|
|
|
118785
118785
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,40 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-expert",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.45",
|
|
4
4
|
"description": "Create and modify Perstack expert definitions",
|
|
5
5
|
"author": "Wintermute Technologies, Inc.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"bin": {
|
|
9
|
-
"create-expert": "bin/cli.
|
|
9
|
+
"create-expert": "dist/bin/cli.js"
|
|
10
10
|
},
|
|
11
11
|
"publishConfig": {
|
|
12
|
-
"access": "public"
|
|
13
|
-
"bin": {
|
|
14
|
-
"create-expert": "dist/bin/cli.js"
|
|
15
|
-
}
|
|
12
|
+
"access": "public"
|
|
16
13
|
},
|
|
17
14
|
"files": [
|
|
18
15
|
"dist"
|
|
19
16
|
],
|
|
20
|
-
"scripts": {
|
|
21
|
-
"clean": "rm -rf dist",
|
|
22
|
-
"build": "bun run clean && tsdown --config ./tsdown.config.ts && cp perstack.toml dist/",
|
|
23
|
-
"typecheck": "tsc --noEmit"
|
|
24
|
-
},
|
|
25
17
|
"dependencies": {
|
|
26
18
|
"commander": "^14.0.3"
|
|
27
19
|
},
|
|
28
20
|
"devDependencies": {
|
|
29
|
-
"@perstack/core": "workspace:*",
|
|
30
|
-
"@perstack/perstack-toml": "workspace:*",
|
|
31
|
-
"@perstack/runtime": "workspace:*",
|
|
32
|
-
"@perstack/tui": "workspace:*",
|
|
33
21
|
"@tsconfig/node22": "^22.0.5",
|
|
34
22
|
"@types/node": "^25.3.0",
|
|
35
|
-
"typescript": "^5.9.3"
|
|
23
|
+
"typescript": "^5.9.3",
|
|
24
|
+
"@perstack/core": "0.0.56",
|
|
25
|
+
"@perstack/perstack-toml": "0.0.12",
|
|
26
|
+
"@perstack/runtime": "0.0.117",
|
|
27
|
+
"@perstack/tui": "0.0.18"
|
|
36
28
|
},
|
|
37
29
|
"engines": {
|
|
38
30
|
"bun": ">=1.2.0"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"clean": "rm -rf dist",
|
|
34
|
+
"build": "bun run clean && tsdown --config ./tsdown.config.ts && cp perstack.toml dist/",
|
|
35
|
+
"typecheck": "tsc --noEmit"
|
|
39
36
|
}
|
|
40
|
-
}
|
|
37
|
+
}
|
package/bin/cli.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
|
-
import { readFileSync } from "node:fs"
|
|
4
|
-
import { fileURLToPath } from "node:url"
|
|
5
|
-
import { PerstackError } from "@perstack/core"
|
|
6
|
-
import { findLockfile, loadLockfile, parsePerstackConfig } from "@perstack/perstack-toml"
|
|
7
|
-
import { runHandler, startHandler } from "@perstack/tui"
|
|
8
|
-
import { PROVIDER_ENV_MAP } from "@perstack/tui/provider-config"
|
|
9
|
-
import { Command } from "commander"
|
|
10
|
-
import packageJson from "../package.json" with { type: "json" }
|
|
11
|
-
|
|
12
|
-
const tomlPath = new URL("../perstack.toml", import.meta.url)
|
|
13
|
-
|
|
14
|
-
new Command()
|
|
15
|
-
.name(packageJson.name)
|
|
16
|
-
.description(packageJson.description)
|
|
17
|
-
.version(packageJson.version)
|
|
18
|
-
.argument("[query]", "Description of the expert to create or modify")
|
|
19
|
-
.option("--headless", "Run in headless mode with JSON output (no TUI)")
|
|
20
|
-
.option(
|
|
21
|
-
"--filter <types>",
|
|
22
|
-
"Filter events by type (comma-separated, e.g., completeRun,stopRunByError)",
|
|
23
|
-
)
|
|
24
|
-
.option("--provider <provider>", "Provider to use")
|
|
25
|
-
.option("--model <model>", "Model to use")
|
|
26
|
-
.option(
|
|
27
|
-
"--reasoning-budget <budget>",
|
|
28
|
-
"Reasoning budget for native LLM reasoning (minimal, low, medium, high, or token count)",
|
|
29
|
-
)
|
|
30
|
-
.option("--max-retries <maxRetries>", "Maximum number of generation retries, default is 5")
|
|
31
|
-
.option(
|
|
32
|
-
"--timeout <timeout>",
|
|
33
|
-
"Timeout for each generation in milliseconds, default is 300000 (5 minutes)",
|
|
34
|
-
)
|
|
35
|
-
.option("--job-id <jobId>", "Job ID for identifying the job")
|
|
36
|
-
.option(
|
|
37
|
-
"--env-path <path>",
|
|
38
|
-
"Path to the environment file (can be specified multiple times), default is .env and .env.local",
|
|
39
|
-
(value: string, previous: string[]) => previous.concat(value),
|
|
40
|
-
[] as string[],
|
|
41
|
-
)
|
|
42
|
-
.option("--verbose", "Enable verbose logging")
|
|
43
|
-
.option("--continue", "Continue the most recent job with new query")
|
|
44
|
-
.option("--continue-job <jobId>", "Continue the specified job with new query")
|
|
45
|
-
.option(
|
|
46
|
-
"--resume-from <checkpointId>",
|
|
47
|
-
"Resume from a specific checkpoint (requires --continue or --continue-job)",
|
|
48
|
-
)
|
|
49
|
-
.option("-i, --interactive-tool-call-result", "Query is interactive tool call result")
|
|
50
|
-
.action(async (query: string | undefined, options: Record<string, unknown>) => {
|
|
51
|
-
const config = parsePerstackConfig(readFileSync(tomlPath, "utf-8"))
|
|
52
|
-
|
|
53
|
-
// Resolve create-expert-skill server path to absolute so it works regardless of CWD.
|
|
54
|
-
// tomlPath resolves to dist/perstack.toml from compiled CLI (dist/bin/cli.js).
|
|
55
|
-
// ../../ goes: dist/ → create-expert/ → apps/, then into create-expert-skill/.
|
|
56
|
-
const skillServerPath = fileURLToPath(
|
|
57
|
-
new URL("../../create-expert-skill/dist/bin/server.js", tomlPath),
|
|
58
|
-
)
|
|
59
|
-
const skillFinderSkill =
|
|
60
|
-
config.experts?.["@create-expert/skill-finder"]?.skills?.["@perstack/create-expert-skill"]
|
|
61
|
-
if (skillFinderSkill && skillFinderSkill.type === "mcpStdioSkill") {
|
|
62
|
-
skillFinderSkill.args = [skillServerPath]
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const lockfilePath = findLockfile()
|
|
66
|
-
const lockfile = lockfilePath ? (loadLockfile(lockfilePath) ?? undefined) : undefined
|
|
67
|
-
const additionalEnv = (env: Record<string, string>) => {
|
|
68
|
-
const provider = config.provider?.providerName ?? "anthropic"
|
|
69
|
-
const envKey = PROVIDER_ENV_MAP[provider]
|
|
70
|
-
const value = envKey ? env[envKey] : undefined
|
|
71
|
-
return value ? { PROVIDER_API_KEY: value } : ({} as Record<string, string>)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (options.headless) {
|
|
75
|
-
if (!query) {
|
|
76
|
-
console.error("Error: query argument is required in headless mode")
|
|
77
|
-
process.exit(1)
|
|
78
|
-
}
|
|
79
|
-
await runHandler("create-expert", query, options, {
|
|
80
|
-
perstackConfig: config,
|
|
81
|
-
lockfile,
|
|
82
|
-
additionalEnv,
|
|
83
|
-
})
|
|
84
|
-
} else {
|
|
85
|
-
await startHandler("create-expert", query, options, {
|
|
86
|
-
perstackConfig: config,
|
|
87
|
-
lockfile,
|
|
88
|
-
additionalEnv,
|
|
89
|
-
})
|
|
90
|
-
}
|
|
91
|
-
})
|
|
92
|
-
.parseAsync()
|
|
93
|
-
.catch((error) => {
|
|
94
|
-
if (error instanceof PerstackError) {
|
|
95
|
-
console.error(error.message)
|
|
96
|
-
process.exit(1)
|
|
97
|
-
}
|
|
98
|
-
throw error
|
|
99
|
-
})
|