agentful 0.2.3 → 0.2.5
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/index.cjs +25 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3044,7 +3044,7 @@ var VERSION, brand, useColor, wrap, paint, sym, ui;
|
|
|
3044
3044
|
var init_branding = __esm({
|
|
3045
3045
|
"src/branding.ts"() {
|
|
3046
3046
|
"use strict";
|
|
3047
|
-
VERSION = "0.2.
|
|
3047
|
+
VERSION = "0.2.5" ? "0.2.5" : null.version;
|
|
3048
3048
|
brand = {
|
|
3049
3049
|
name: "agentful",
|
|
3050
3050
|
// the command users type
|
|
@@ -5946,6 +5946,9 @@ function compareVersions(a, b) {
|
|
|
5946
5946
|
}
|
|
5947
5947
|
function noticeIfOutdated(manifest) {
|
|
5948
5948
|
if (!manifest) return;
|
|
5949
|
+
if (manifest.notice) {
|
|
5950
|
+
ui.info(paint.dim(manifest.notice));
|
|
5951
|
+
}
|
|
5949
5952
|
const min = manifest.min_cli_version;
|
|
5950
5953
|
const latest = manifest.latest_cli_version;
|
|
5951
5954
|
if (min && compareVersions(VERSION, min) < 0) {
|
|
@@ -6336,6 +6339,25 @@ var CLOUD_AGENT = "agentful-build";
|
|
|
6336
6339
|
var LOCAL_AGENT = "local-only";
|
|
6337
6340
|
var CLOUD_AGENT_PROMPT = `You are the Agentful Cloud build agent: everything you build in this directory targets deployment on Agentful Cloud via \`agentful push\`. Follow the platform contract in AGENTFUL_CLOUD.md strictly \u2014 static files only, no server process, no build-time env vars or secrets. When a push or cloud build fails, diagnose ONLY from the \`agentful push\` output and \`agentful build-status\`; quote the record and never invent causes or settings it does not show. If the user wants development that is not meant for the platform, suggest the ${LOCAL_AGENT} agent (Tab).`;
|
|
6338
6341
|
var LOCAL_AGENT_PROMPT = "You are in local-only mode: free local development with no cloud deployment target \u2014 any stack is fine. Be clear that this directory will NOT be deployable with `agentful push` unless it satisfies the platform contract in AGENTFUL_CLOUD.md (static files only). If the user asks to deploy or push, check the contract first and say honestly whether the project can ship on the platform; never claim cloud deployability without evidence.";
|
|
6342
|
+
function readAuthFile(path) {
|
|
6343
|
+
try {
|
|
6344
|
+
return (0, import_node_fs11.readFileSync)(path, "utf8");
|
|
6345
|
+
} catch {
|
|
6346
|
+
return null;
|
|
6347
|
+
}
|
|
6348
|
+
}
|
|
6349
|
+
function mergedAuthJson(existingRaw, sessionToken) {
|
|
6350
|
+
let auth = {};
|
|
6351
|
+
if (existingRaw) {
|
|
6352
|
+
try {
|
|
6353
|
+
const parsed = JSON.parse(existingRaw);
|
|
6354
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) auth = parsed;
|
|
6355
|
+
} catch {
|
|
6356
|
+
}
|
|
6357
|
+
}
|
|
6358
|
+
auth[PROVIDER_ID] = { apiKey: sessionToken };
|
|
6359
|
+
return JSON.stringify(auth, null, 2);
|
|
6360
|
+
}
|
|
6339
6361
|
function buildEngineConfig(opts) {
|
|
6340
6362
|
const models = {};
|
|
6341
6363
|
for (const entry of opts.catalog.models) models[entry.id] = { name: entry.name };
|
|
@@ -6434,9 +6456,8 @@ async function writeEngineSession(session, catalog, localProviders = {}, framewo
|
|
|
6434
6456
|
instructionPaths
|
|
6435
6457
|
});
|
|
6436
6458
|
(0, import_node_fs11.writeFileSync)((0, import_node_path13.join)(configDir2, "config.json"), JSON.stringify(config, null, 2));
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
}, null, 2));
|
|
6459
|
+
const authPath2 = (0, import_node_path13.join)(dataDir, "auth.json");
|
|
6460
|
+
(0, import_node_fs11.writeFileSync)(authPath2, mergedAuthJson(readAuthFile(authPath2), session.token));
|
|
6440
6461
|
const { brandingPluginSource: brandingPluginSource2 } = await Promise.resolve().then(() => (init_plugin(), plugin_exports));
|
|
6441
6462
|
const pluginPath = (0, import_node_path13.join)(pluginsDir, "agentful-branding.tsx");
|
|
6442
6463
|
(0, import_node_fs11.writeFileSync)(pluginPath, brandingPluginSource2());
|