agentful 0.4.8 → 0.4.9

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.
Files changed (2) hide show
  1. package/dist/index.cjs +40 -23
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -33,9 +33,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  mod
34
34
  ));
35
35
 
36
- // ../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/lib/error.js
36
+ // node_modules/commander/lib/error.js
37
37
  var require_error = __commonJS({
38
- "../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/lib/error.js"(exports2) {
38
+ "node_modules/commander/lib/error.js"(exports2) {
39
39
  "use strict";
40
40
  var CommanderError2 = class extends Error {
41
41
  /**
@@ -69,9 +69,9 @@ var require_error = __commonJS({
69
69
  }
70
70
  });
71
71
 
72
- // ../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/lib/argument.js
72
+ // node_modules/commander/lib/argument.js
73
73
  var require_argument = __commonJS({
74
- "../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/lib/argument.js"(exports2) {
74
+ "node_modules/commander/lib/argument.js"(exports2) {
75
75
  "use strict";
76
76
  var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
77
77
  var Argument2 = class {
@@ -197,9 +197,9 @@ var require_argument = __commonJS({
197
197
  }
198
198
  });
199
199
 
200
- // ../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/lib/help.js
200
+ // node_modules/commander/lib/help.js
201
201
  var require_help = __commonJS({
202
- "../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/lib/help.js"(exports2) {
202
+ "node_modules/commander/lib/help.js"(exports2) {
203
203
  "use strict";
204
204
  var { humanReadableArgName } = require_argument();
205
205
  var Help2 = class {
@@ -612,9 +612,9 @@ var require_help = __commonJS({
612
612
  }
613
613
  });
614
614
 
615
- // ../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/lib/option.js
615
+ // node_modules/commander/lib/option.js
616
616
  var require_option = __commonJS({
617
- "../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/lib/option.js"(exports2) {
617
+ "node_modules/commander/lib/option.js"(exports2) {
618
618
  "use strict";
619
619
  var { InvalidArgumentError: InvalidArgumentError2 } = require_error();
620
620
  var Option2 = class {
@@ -885,9 +885,9 @@ var require_option = __commonJS({
885
885
  }
886
886
  });
887
887
 
888
- // ../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/lib/suggestSimilar.js
888
+ // node_modules/commander/lib/suggestSimilar.js
889
889
  var require_suggestSimilar = __commonJS({
890
- "../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/lib/suggestSimilar.js"(exports2) {
890
+ "node_modules/commander/lib/suggestSimilar.js"(exports2) {
891
891
  "use strict";
892
892
  var maxDistance = 3;
893
893
  function editDistance(a, b) {
@@ -966,9 +966,9 @@ var require_suggestSimilar = __commonJS({
966
966
  }
967
967
  });
968
968
 
969
- // ../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/lib/command.js
969
+ // node_modules/commander/lib/command.js
970
970
  var require_command = __commonJS({
971
- "../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/lib/command.js"(exports2) {
971
+ "node_modules/commander/lib/command.js"(exports2) {
972
972
  "use strict";
973
973
  var EventEmitter = require("events").EventEmitter;
974
974
  var childProcess = require("child_process");
@@ -3010,9 +3010,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
3010
3010
  }
3011
3011
  });
3012
3012
 
3013
- // ../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/index.js
3013
+ // node_modules/commander/index.js
3014
3014
  var require_commander = __commonJS({
3015
- "../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/index.js"(exports2) {
3015
+ "node_modules/commander/index.js"(exports2) {
3016
3016
  "use strict";
3017
3017
  var { Argument: Argument2 } = require_argument();
3018
3018
  var { Command: Command2 } = require_command();
@@ -3044,7 +3044,7 @@ var VERSION, brand, useColor, wrap, paint, tuiDesign, sym, ui;
3044
3044
  var init_branding = __esm({
3045
3045
  "src/branding.ts"() {
3046
3046
  "use strict";
3047
- VERSION = "0.4.8" ? "0.4.8" : null.version;
3047
+ VERSION = "0.4.9" ? "0.4.9" : null.version;
3048
3048
  brand = {
3049
3049
  name: "agentful",
3050
3050
  // the command users type
@@ -3103,9 +3103,9 @@ var init_branding = __esm({
3103
3103
  }
3104
3104
  });
3105
3105
 
3106
- // ../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/ignore/index.js
3106
+ // node_modules/ignore/index.js
3107
3107
  var require_ignore = __commonJS({
3108
- "../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/ignore/index.js"(exports2, module2) {
3108
+ "node_modules/ignore/index.js"(exports2, module2) {
3109
3109
  "use strict";
3110
3110
  function makeArray(subject) {
3111
3111
  return Array.isArray(subject) ? subject : [subject];
@@ -3824,7 +3824,7 @@ var init_plugin = __esm({
3824
3824
  }
3825
3825
  });
3826
3826
 
3827
- // ../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/commander/esm.mjs
3827
+ // node_modules/commander/esm.mjs
3828
3828
  var import_index = __toESM(require_commander(), 1);
3829
3829
  var {
3830
3830
  program,
@@ -4785,7 +4785,7 @@ init_branding();
4785
4785
  var import_node_fs4 = require("fs");
4786
4786
  var import_node_path6 = require("path");
4787
4787
 
4788
- // ../../../../../../../../Users/gn/Labor/mainmvp/cli/node_modules/fflate/esm/index.mjs
4788
+ // node_modules/fflate/esm/index.mjs
4789
4789
  var import_module = require("module");
4790
4790
  var require2 = (0, import_module.createRequire)("/");
4791
4791
  var _a;
@@ -6932,7 +6932,7 @@ var import_node_stream = require("stream");
6932
6932
  var import_promises3 = require("stream/promises");
6933
6933
  init_branding();
6934
6934
  var ENGINE_BINARY = "agentful-engine";
6935
- var FALLBACK_ENGINE_VERSION = "v1.18.18";
6935
+ var FALLBACK_ENGINE_VERSION = "v1.18.32";
6936
6936
  function compareVersions(a, b) {
6937
6937
  const pa = a.replace(/^v/, "").split(".").map((n) => parseInt(n, 10) || 0);
6938
6938
  const pb = b.replace(/^v/, "").split(".").map((n) => parseInt(n, 10) || 0);
@@ -7524,6 +7524,7 @@ var DISABLED_ENGINE_PLUGINS = {
7524
7524
  "internal:sidebar-todo": false,
7525
7525
  "internal:sidebar-files": false
7526
7526
  };
7527
+ var GATEWAY_STREAM_TIMEOUT_MS = 6e5;
7527
7528
  var CLOUD_AGENT = "agentful-build";
7528
7529
  var LOCAL_AGENT = "local-only";
7529
7530
  var SERVER_SIDE_IN_ONE_SENTENCE = `static files only; no server process in the app \u2014 server-side logic = Managed Server Actions (\`.server/actions/*.js\`, request/response, ${contract_default.server_side.managed_actions.limits.action_timeout_budget_s} s budget) or an API of your own; no cron, no sockets, no npm inside actions; no build-time secrets`;
@@ -7589,7 +7590,12 @@ function buildEngineConfig(opts) {
7589
7590
  [PROVIDER_ID]: {
7590
7591
  npm: "@ai-sdk/openai-compatible",
7591
7592
  name: "Agentful",
7592
- options: { baseURL: opts.session.gateway_url, apiKey: opts.session.token },
7593
+ options: {
7594
+ baseURL: opts.session.gateway_url,
7595
+ apiKey: opts.session.token,
7596
+ headerTimeout: GATEWAY_STREAM_TIMEOUT_MS,
7597
+ chunkTimeout: GATEWAY_STREAM_TIMEOUT_MS
7598
+ },
7593
7599
  models
7594
7600
  }
7595
7601
  }
@@ -8262,6 +8268,7 @@ function describeModelRoute(model, catalog, localProviders, connectedProviders)
8262
8268
  }
8263
8269
 
8264
8270
  // src/lib/engineEvents.ts
8271
+ var import_node_crypto2 = require("crypto");
8265
8272
  var import_node_net = require("net");
8266
8273
  function payloadOf(event) {
8267
8274
  return event.payload && typeof event.payload === "object" ? event.payload : event;
@@ -8384,6 +8391,12 @@ var EngineLivenessPolicy = class {
8384
8391
  this.activityRevision += 1;
8385
8392
  }
8386
8393
  };
8394
+ function engineServerCredentials(env = process.env) {
8395
+ return {
8396
+ username: env.OPENCODE_SERVER_USERNAME || void 0,
8397
+ password: env.OPENCODE_SERVER_PASSWORD || (0, import_node_crypto2.randomUUID)()
8398
+ };
8399
+ }
8387
8400
  async function reserveLoopbackPort() {
8388
8401
  return new Promise((resolve2, reject) => {
8389
8402
  const server = (0, import_node_net.createServer)();
@@ -8635,13 +8648,14 @@ async function tuiCommand(opts = {}) {
8635
8648
  let code = 0;
8636
8649
  let sessionID = opts.session;
8637
8650
  let selectedPin = initialPin;
8651
+ const serverAuth = engineServerCredentials();
8638
8652
  for (; ; ) {
8639
8653
  const port = await reserveLoopbackPort();
8640
8654
  const monitor = startEngineEventMonitor({
8641
8655
  port,
8642
8656
  directory: process.cwd(),
8643
- username: process.env.OPENCODE_SERVER_USERNAME,
8644
- password: process.env.OPENCODE_SERVER_PASSWORD
8657
+ username: serverAuth.username,
8658
+ password: serverAuth.password
8645
8659
  });
8646
8660
  code = await new Promise((resolve2) => {
8647
8661
  const engineArgs = [
@@ -8663,6 +8677,9 @@ async function tuiCommand(opts = {}) {
8663
8677
  XDG_CONFIG_HOME: xdg.configHome,
8664
8678
  XDG_DATA_HOME: xdg.dataHome,
8665
8679
  XDG_STATE_HOME: xdg.stateHome,
8680
+ // The loopback server is reachable from any browser tab; a random
8681
+ // password keeps web pages out (engineServerCredentials).
8682
+ OPENCODE_SERVER_PASSWORD: serverAuth.password,
8666
8683
  // Belt and braces with `autoupdate: false` in the config: engine
8667
8684
  // versions are rolled out through our manifest, never self-updated.
8668
8685
  OPENCODE_DISABLE_AUTOUPDATE: "true",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentful",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
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",