agentful 0.1.1 → 0.1.3
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 +39 -17
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -3432,7 +3432,7 @@ var {
|
|
|
3432
3432
|
} = import_index.default;
|
|
3433
3433
|
|
|
3434
3434
|
// src/branding.ts
|
|
3435
|
-
var VERSION = "0.1.
|
|
3435
|
+
var VERSION = "0.1.3" ? "0.1.3" : null.version;
|
|
3436
3436
|
var brand = {
|
|
3437
3437
|
name: "agentful",
|
|
3438
3438
|
// the command users type
|
|
@@ -5096,7 +5096,7 @@ var IF_NOT_LINKED = 'If the command reports "No Agentful project here", this dir
|
|
|
5096
5096
|
var SLASH_COMMANDS = {
|
|
5097
5097
|
setup: {
|
|
5098
5098
|
description: `${brand.displayName}: create or link the cloud project for this directory`,
|
|
5099
|
-
template: 'Check whether .agentful/project.json exists. If it does, report the linked project title and id and stop. Otherwise
|
|
5099
|
+
template: 'Check whether .agentful/project.json exists. If it does, report the linked project title and id and stop. Otherwise run `agentful init --title "<name>"` using the bash tool, where <name> is $ARGUMENTS if I gave one, otherwise the current directory name. Report what it created and mention the title I can change it to. Do not modify any other project files.'
|
|
5100
5100
|
},
|
|
5101
5101
|
push: {
|
|
5102
5102
|
description: `${brand.displayName}: deploy this project and get a preview URL`,
|
|
@@ -5235,6 +5235,8 @@ async function writeEngineSession(session, catalog, localProviders = {}) {
|
|
|
5235
5235
|
|
|
5236
5236
|
// src/lib/models.ts
|
|
5237
5237
|
async function fetchModelCatalog(auth, fallback) {
|
|
5238
|
+
const regionDefaultsToBedrock = fallback.ai_region === "eu" || fallback.ai_region === "de";
|
|
5239
|
+
const isAgenticCapable = (id) => id !== "auto" && !id.includes("bedrock");
|
|
5238
5240
|
let catalog = null;
|
|
5239
5241
|
try {
|
|
5240
5242
|
catalog = await request(`${PB_URL}/api/llm/available-models`, {
|
|
@@ -5292,7 +5294,11 @@ async function fetchModelCatalog(auth, fallback) {
|
|
|
5292
5294
|
}
|
|
5293
5295
|
}
|
|
5294
5296
|
const ids = new Set(entries.map((e) => e.id));
|
|
5295
|
-
|
|
5297
|
+
let defaultModel = catalog.default_model && ids.has(catalog.default_model) ? catalog.default_model : ids.has("auto") ? "auto" : entries[0]?.id || fallback.default_model;
|
|
5298
|
+
if (regionDefaultsToBedrock && !isAgenticCapable(defaultModel)) {
|
|
5299
|
+
const working = entries.find((e) => isAgenticCapable(e.id));
|
|
5300
|
+
if (working) defaultModel = working.id;
|
|
5301
|
+
}
|
|
5296
5302
|
return {
|
|
5297
5303
|
models: entries,
|
|
5298
5304
|
defaultModel,
|
|
@@ -5404,25 +5410,31 @@ function writeLocalProvidersExample() {
|
|
|
5404
5410
|
var import_node_fs10 = require("fs");
|
|
5405
5411
|
var import_node_path11 = require("path");
|
|
5406
5412
|
var import_node_child_process4 = require("child_process");
|
|
5407
|
-
var SEP = "";
|
|
5408
|
-
function sqlite(dbPath, sql) {
|
|
5409
|
-
const res = (0, import_node_child_process4.spawnSync)("sqlite3", ["-readonly", dbPath, sql], { encoding: "utf8" });
|
|
5410
|
-
if (res.status !== 0 || !res.stdout) return null;
|
|
5411
|
-
return res.stdout.trim().split("\n").filter(Boolean);
|
|
5412
|
-
}
|
|
5413
5413
|
function lastSessionForDirectory(cwd = process.cwd()) {
|
|
5414
5414
|
const dbPath = (0, import_node_path11.join)(engineXdg().dataHome, "opencode", "opencode.db");
|
|
5415
5415
|
if (!(0, import_node_fs10.existsSync)(dbPath)) return null;
|
|
5416
5416
|
const escaped = cwd.replace(/'/g, "''");
|
|
5417
|
-
const
|
|
5418
|
-
|
|
5419
|
-
|
|
5417
|
+
const res = (0, import_node_child_process4.spawnSync)(
|
|
5418
|
+
"sqlite3",
|
|
5419
|
+
[
|
|
5420
|
+
"-readonly",
|
|
5421
|
+
"-json",
|
|
5422
|
+
dbPath,
|
|
5423
|
+
`SELECT id, COALESCE(title, slug, '') AS title FROM session
|
|
5420
5424
|
WHERE directory = '${escaped}' AND time_archived IS NULL
|
|
5421
5425
|
ORDER BY COALESCE(time_updated, time_created) DESC LIMIT 1;`
|
|
5426
|
+
],
|
|
5427
|
+
{ encoding: "utf8" }
|
|
5422
5428
|
);
|
|
5423
|
-
if (!
|
|
5424
|
-
|
|
5425
|
-
|
|
5429
|
+
if (res.status !== 0 || !res.stdout.trim()) return null;
|
|
5430
|
+
try {
|
|
5431
|
+
const rows = JSON.parse(res.stdout);
|
|
5432
|
+
const row = rows[0];
|
|
5433
|
+
if (!row?.id) return null;
|
|
5434
|
+
return { id: row.id, title: row.title || "" };
|
|
5435
|
+
} catch {
|
|
5436
|
+
return null;
|
|
5437
|
+
}
|
|
5426
5438
|
}
|
|
5427
5439
|
|
|
5428
5440
|
// src/commands/tui.ts
|
|
@@ -5751,14 +5763,24 @@ var run = (fn) => async (...args) => {
|
|
|
5751
5763
|
process.exitCode = 1;
|
|
5752
5764
|
}
|
|
5753
5765
|
};
|
|
5754
|
-
program2.name("agentful").description("Agentful in your terminal \u2014 local development with push-to-cloud previews").version(VERSION)
|
|
5766
|
+
program2.name("agentful").description("Agentful in your terminal \u2014 local development with push-to-cloud previews").version(VERSION).option("-s, --session <id>", "resume a previous session (same as `tui -s`)").action(run((opts, cmd) => {
|
|
5767
|
+
const [unknown] = cmd.args;
|
|
5768
|
+
if (unknown) {
|
|
5769
|
+
throw new ApiError(
|
|
5770
|
+
0,
|
|
5771
|
+
"unknown_command",
|
|
5772
|
+
`Unknown command '${unknown}'. Run \`agentful --help\` to see what is available.`
|
|
5773
|
+
);
|
|
5774
|
+
}
|
|
5775
|
+
return tuiCommand(opts);
|
|
5776
|
+
})).showSuggestionAfterError();
|
|
5755
5777
|
program2.command("login").description("Sign in to your Agentful account (device flow)").option("--no-browser", "do not open the browser automatically").action(run((opts) => loginCommand({ browser: opts.browser !== false })));
|
|
5756
5778
|
program2.command("logout").description("Remove the stored credentials").action(run(logoutCommand));
|
|
5757
5779
|
program2.command("whoami").description("Show the signed-in account").action(run(whoamiCommand));
|
|
5758
5780
|
program2.command("init").description("Create (or link) the Agentful cloud project for this directory").option("--link <projectId>", "link an existing project instead of creating one").option("--title <title>", "project title (skips the prompt)").action(run((opts) => initCommand(opts)));
|
|
5759
5781
|
program2.command("push").description("Upload this project and get a live preview URL").option("--prebuilt", "upload a locally built output instead of building in the cloud").option("--dir <path>", "built-output directory for --prebuilt (default: auto-detect)").action(run((opts) => pushCommand(opts)));
|
|
5760
5782
|
program2.command("open").description("Open the live preview in the browser").action(run(openCommand));
|
|
5761
|
-
program2.command("tui"
|
|
5783
|
+
program2.command("tui").description("Start the Agentful coding TUI with your Agentful account").option("-s, --session <id>", "resume a previous session").action(run((opts) => tuiCommand(opts)));
|
|
5762
5784
|
program2.command("publish <subdomain>").description("Publish the built project at https://<subdomain>.agentful.dev").action(run(publishCommand));
|
|
5763
5785
|
program2.command("share").description("Make the live preview public (anyone with the link)").option("--private", "make the preview owner-only again").action(run((opts) => shareCommand(opts)));
|
|
5764
5786
|
program2.command("pull").description("Download the cloud workspace into this directory").option("--force", "overwrite files in a non-empty directory").action(run((opts) => pullCommand(opts)));
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentful",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Agentful in your terminal
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Agentful in your terminal — local development with push-to-cloud previews",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://agentful.dev",
|
|
7
7
|
"bin": {
|
|
8
|
-
"agentful": "
|
|
8
|
+
"agentful": "dist/index.cjs"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|
|
39
|
-
"url": "https://github.com/limoncello/mainmvp.git",
|
|
39
|
+
"url": "git+https://github.com/limoncello/mainmvp.git",
|
|
40
40
|
"directory": "cli"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|