@lotics/cli 0.133.0 → 0.134.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/dist/src/cli.js +26 -12
- package/package.json +1 -1
package/dist/src/cli.js
CHANGED
|
@@ -45622,8 +45622,6 @@ import { randomUUID } from "node:crypto";
|
|
|
45622
45622
|
import { tmpdir } from "node:os";
|
|
45623
45623
|
|
|
45624
45624
|
// src/starter_template.ts
|
|
45625
|
-
var STARTER_FALLBACK_UI_VERSION = "31.0.0";
|
|
45626
|
-
var STARTER_FALLBACK_SDK_VERSION = "0.75.1";
|
|
45627
45625
|
var STARTER_REACT_NATIVE_VERSION = "0.85.3";
|
|
45628
45626
|
var VITEST_SETUP_FILENAME = "vitest.setup.ts";
|
|
45629
45627
|
var VITEST_SETUP_CONTENT = `import { vi } from "vitest";
|
|
@@ -45658,8 +45656,8 @@ vi.mock("@lotics/app-sdk", async (importOriginal) => {
|
|
|
45658
45656
|
});
|
|
45659
45657
|
`;
|
|
45660
45658
|
function buildStarterTemplate(args) {
|
|
45661
|
-
const uiVersion = args.ui_version
|
|
45662
|
-
const sdkVersion = args.sdk_version
|
|
45659
|
+
const uiVersion = args.ui_version;
|
|
45660
|
+
const sdkVersion = args.sdk_version;
|
|
45663
45661
|
const sanitizedPkgName = args.app_name.toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "").slice(0, 64) || "lotics-app";
|
|
45664
45662
|
return [
|
|
45665
45663
|
{
|
|
@@ -65482,6 +65480,11 @@ var cForStepSchema = zod_default.lazy(
|
|
|
65482
65480
|
);
|
|
65483
65481
|
var workflowStepsSchema = zod_default.array(workflowStepSchema).min(1);
|
|
65484
65482
|
|
|
65483
|
+
// ../shared/src/zod_issues.ts
|
|
65484
|
+
function formatZodIssues(issues) {
|
|
65485
|
+
return issues.map((i2) => `${i2.path.join(".") || "<root>"}: ${i2.message}`).join("; ");
|
|
65486
|
+
}
|
|
65487
|
+
|
|
65485
65488
|
// ../shared/src/expression_array.ts
|
|
65486
65489
|
var expression_array_exports = {};
|
|
65487
65490
|
__export(expression_array_exports, {
|
|
@@ -70007,8 +70010,10 @@ function walkAgentInvocation(call, scope, stepId, description) {
|
|
|
70007
70010
|
if (!outputNode) fail(arg, "agent requires `output`.");
|
|
70008
70011
|
const outputResult = agentOutputSpecSchema.safeParse(walkStaticJsonLiteral(outputNode));
|
|
70009
70012
|
if (!outputResult.success) {
|
|
70010
|
-
|
|
70011
|
-
|
|
70013
|
+
fail(
|
|
70014
|
+
outputNode,
|
|
70015
|
+
`Invalid agent \`output\`: ${formatZodIssues(outputResult.error.issues)}`
|
|
70016
|
+
);
|
|
70012
70017
|
}
|
|
70013
70018
|
const modelNode = kw.get("model");
|
|
70014
70019
|
let model_tier;
|
|
@@ -70438,6 +70443,15 @@ async function fetchLatestNpmVersion(packageName, { timeoutMs = 1500 } = {}) {
|
|
|
70438
70443
|
return null;
|
|
70439
70444
|
}
|
|
70440
70445
|
}
|
|
70446
|
+
async function requireLatestNpmVersion(packageName, { timeoutMs = 1e4 } = {}) {
|
|
70447
|
+
const version2 = await fetchLatestNpmVersion(packageName, { timeoutMs });
|
|
70448
|
+
if (version2 === null) {
|
|
70449
|
+
throw new Error(
|
|
70450
|
+
`Could not resolve the latest published ${packageName} from registry.npmjs.org. Refusing to fall back to the static starter pin, which may name a version this repo has not published yet.`
|
|
70451
|
+
);
|
|
70452
|
+
}
|
|
70453
|
+
return version2;
|
|
70454
|
+
}
|
|
70441
70455
|
|
|
70442
70456
|
// src/app_commands.ts
|
|
70443
70457
|
function orderedLike(value2, template) {
|
|
@@ -71174,18 +71188,18 @@ async function appCreate(client, args) {
|
|
|
71174
71188
|
}
|
|
71175
71189
|
}
|
|
71176
71190
|
fs6.mkdirSync(targetPath, { recursive: true });
|
|
71177
|
-
const app = await client.createApp({ name: args.name });
|
|
71178
|
-
console.error(`Created app: ${app.name} (${app.id})`);
|
|
71179
71191
|
const [uiLatest, sdkLatest] = await Promise.all([
|
|
71180
|
-
|
|
71181
|
-
|
|
71192
|
+
requireLatestNpmVersion("@lotics/ui"),
|
|
71193
|
+
requireLatestNpmVersion("@lotics/app-sdk")
|
|
71182
71194
|
]);
|
|
71195
|
+
const app = await client.createApp({ name: args.name });
|
|
71196
|
+
console.error(`Created app: ${app.name} (${app.id})`);
|
|
71183
71197
|
const files = buildStarterTemplate({
|
|
71184
71198
|
app_name: args.name,
|
|
71185
71199
|
app_id: app.id,
|
|
71186
71200
|
workspace_id: app.workspace_id,
|
|
71187
|
-
ui_version:
|
|
71188
|
-
sdk_version:
|
|
71201
|
+
ui_version: `^${uiLatest}`,
|
|
71202
|
+
sdk_version: `^${sdkLatest}`
|
|
71189
71203
|
});
|
|
71190
71204
|
for (const file2 of files) {
|
|
71191
71205
|
const fullPath = path7.join(targetPath, file2.path);
|