@m6d/cortex-cli 0.22.0 → 0.23.0
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/package.json +1 -1
- package/src/commands/management.ts +8 -5
- package/src/commands/setup.ts +15 -8
- package/src/contracts/management/procedures.generated.ts +238 -168
- package/src/contracts/manifest/index.ts +125 -47
- package/src/contracts/runs/index.ts +187 -0
- package/src/contracts/schedule/index.ts +62 -0
- package/src/contracts/server/index.ts +99 -28
- package/src/contracts/triggers/index.ts +36 -93
- package/src/contracts/wire/index.ts +119 -55
- package/src/management/flags.ts +14 -4
- package/src/scaffold/files.ts +8 -3
- package/src/ui/prompts.ts +18 -24
package/package.json
CHANGED
|
@@ -98,7 +98,7 @@ async function login(given: string | undefined, name: string) {
|
|
|
98
98
|
const typed =
|
|
99
99
|
given ??
|
|
100
100
|
(prompts.canAsk()
|
|
101
|
-
? await prompts.askValue("Cortex URL", "https://cortex.example.com")
|
|
101
|
+
? await prompts.askValue("Cortex URL", { hint: "https://cortex.example.com" })
|
|
102
102
|
: report.fail({
|
|
103
103
|
what: "No terminal to ask for the Cortex URL",
|
|
104
104
|
blocks: ["Pass it with --url."],
|
|
@@ -544,13 +544,16 @@ async function collectInput(
|
|
|
544
544
|
return Object.fromEntries(body);
|
|
545
545
|
}
|
|
546
546
|
|
|
547
|
-
/** Asks for one field until the answer parses the way the flag would. */
|
|
547
|
+
/** Asks for one field until the answer parses the way the flag would; blank is `null` where allowed. */
|
|
548
548
|
async function askUntilValid(flag: Flag) {
|
|
549
|
-
const hint = flag.choices?.join(" | ") ?? flag.description
|
|
549
|
+
const hint = flag.choices?.join(" | ") ?? (flag.description || flag.kind);
|
|
550
550
|
for (;;) {
|
|
551
551
|
const answer = flag.sensitive
|
|
552
|
-
? await prompts.askSecret(flag.name)
|
|
553
|
-
: await prompts.askValue(flag.name,
|
|
552
|
+
? await prompts.askSecret(flag.name, { blank: flag.nullable })
|
|
553
|
+
: await prompts.askValue(flag.name, {
|
|
554
|
+
hint: flag.nullable ? `${hint} (blank for none)` : hint,
|
|
555
|
+
blank: flag.nullable,
|
|
556
|
+
});
|
|
554
557
|
const value = parseAnswer(flag, answer);
|
|
555
558
|
if (value !== undefined) return value;
|
|
556
559
|
report.note(`${flag.name} must be ${flag.choices ? `one of ${hint}` : `a ${flag.kind}`}.`);
|
package/src/commands/setup.ts
CHANGED
|
@@ -499,20 +499,27 @@ async function askAndSave() {
|
|
|
499
499
|
export async function askProvider() {
|
|
500
500
|
for (;;) {
|
|
501
501
|
const name = (
|
|
502
|
-
await prompts.askValue("Model provider name",
|
|
502
|
+
await prompts.askValue("Model provider name", {
|
|
503
|
+
hint: "openai",
|
|
504
|
+
check: issue("MODEL_PROVIDER_NAME"),
|
|
505
|
+
})
|
|
503
506
|
).trim();
|
|
504
507
|
const baseUrl = (
|
|
505
|
-
await prompts.askValue(
|
|
506
|
-
"
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
)
|
|
508
|
+
await prompts.askValue("Base URL", {
|
|
509
|
+
hint: "Any OpenAI-compatible URL, e.g. https://api.openai.com/v1",
|
|
510
|
+
check: issue("MODEL_PROVIDER_URL"),
|
|
511
|
+
})
|
|
510
512
|
)
|
|
511
513
|
.trim()
|
|
512
514
|
.replace(/\/+$/, "");
|
|
513
|
-
const apiKey = await prompts.askSecret("API key",
|
|
515
|
+
const apiKey = await prompts.askSecret("API key", {
|
|
516
|
+
check: issue("MODEL_PROVIDER_API_KEY"),
|
|
517
|
+
});
|
|
514
518
|
const model = (
|
|
515
|
-
await prompts.askValue("Model",
|
|
519
|
+
await prompts.askValue("Model", {
|
|
520
|
+
hint: "gpt-5-mini",
|
|
521
|
+
check: issue("MODEL_PROVIDER_MODEL"),
|
|
522
|
+
})
|
|
516
523
|
).trim();
|
|
517
524
|
const provider = { name, baseUrl, apiKey, model };
|
|
518
525
|
|