agent-neckbeard 1.1.5 → 1.1.7

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 CHANGED
@@ -904,7 +904,35 @@ try {
904
904
  * await agent.kill(id);
905
905
  * ```
906
906
  */
907
+ /**
908
+ * Deploy a one-shot agent. Throws if called on a server-mode agent; use
909
+ * `deployServer()` for those. Returns the sandbox id so callers can pass it
910
+ * to `run(input, { sandboxId })`.
911
+ */
907
912
  async deploy(options) {
913
+ if (this.mode !== "one-shot") {
914
+ throw new ConfigurationError(
915
+ "deploy() is only available on one-shot agents. Use agent.deployServer() for server-mode agents."
916
+ );
917
+ }
918
+ const result = await this._deploy(options);
919
+ return result;
920
+ }
921
+ /**
922
+ * Deploy a server-mode agent. Throws if called on a one-shot agent; use
923
+ * `deploy()` for those. Returns the sandbox id, public server URL, bearer
924
+ * token, and Daytona preview token that `invoke()` needs to stream.
925
+ */
926
+ async deployServer(options) {
927
+ if (this.mode !== "server") {
928
+ throw new ConfigurationError(
929
+ "deployServer() is only available on server-mode agents. Use agent.deploy() for one-shot agents."
930
+ );
931
+ }
932
+ const result = await this._deploy(options);
933
+ return result;
934
+ }
935
+ async _deploy(options) {
908
936
  if (!options?.fresh && this._sandboxId && this.mode === "one-shot") return this._sandboxId;
909
937
  if (!options?.fresh && this._sandboxId && this._serverRuntime) {
910
938
  return {
package/dist/index.d.cts CHANGED
@@ -272,6 +272,8 @@ declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
272
272
  };
273
273
  private _sourceFile;
274
274
  private _sandboxId?;
275
+ constructor(config: OneShotAgentConfig<TInput, TOutput>);
276
+ constructor(config: ServerAgentConfig<TInput, TFrame>);
275
277
  constructor(config: AgentConfig<TInput, TOutput, TFrame>);
276
278
  get sandboxId(): string | undefined;
277
279
  private get sandboxEnv();
@@ -320,9 +322,23 @@ declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
320
322
  * await agent.kill(id);
321
323
  * ```
322
324
  */
325
+ /**
326
+ * Deploy a one-shot agent. Throws if called on a server-mode agent; use
327
+ * `deployServer()` for those. Returns the sandbox id so callers can pass it
328
+ * to `run(input, { sandboxId })`.
329
+ */
323
330
  deploy(options?: {
324
331
  fresh?: boolean;
325
- }): Promise<string | ServerDeployResult>;
332
+ }): Promise<string>;
333
+ /**
334
+ * Deploy a server-mode agent. Throws if called on a one-shot agent; use
335
+ * `deploy()` for those. Returns the sandbox id, public server URL, bearer
336
+ * token, and Daytona preview token that `invoke()` needs to stream.
337
+ */
338
+ deployServer(options?: {
339
+ fresh?: boolean;
340
+ }): Promise<ServerDeployResult>;
341
+ private _deploy;
326
342
  /**
327
343
  * Executes the agent with the given input.
328
344
  *
package/dist/index.d.ts CHANGED
@@ -272,6 +272,8 @@ declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
272
272
  };
273
273
  private _sourceFile;
274
274
  private _sandboxId?;
275
+ constructor(config: OneShotAgentConfig<TInput, TOutput>);
276
+ constructor(config: ServerAgentConfig<TInput, TFrame>);
275
277
  constructor(config: AgentConfig<TInput, TOutput, TFrame>);
276
278
  get sandboxId(): string | undefined;
277
279
  private get sandboxEnv();
@@ -320,9 +322,23 @@ declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
320
322
  * await agent.kill(id);
321
323
  * ```
322
324
  */
325
+ /**
326
+ * Deploy a one-shot agent. Throws if called on a server-mode agent; use
327
+ * `deployServer()` for those. Returns the sandbox id so callers can pass it
328
+ * to `run(input, { sandboxId })`.
329
+ */
323
330
  deploy(options?: {
324
331
  fresh?: boolean;
325
- }): Promise<string | ServerDeployResult>;
332
+ }): Promise<string>;
333
+ /**
334
+ * Deploy a server-mode agent. Throws if called on a one-shot agent; use
335
+ * `deploy()` for those. Returns the sandbox id, public server URL, bearer
336
+ * token, and Daytona preview token that `invoke()` needs to stream.
337
+ */
338
+ deployServer(options?: {
339
+ fresh?: boolean;
340
+ }): Promise<ServerDeployResult>;
341
+ private _deploy;
326
342
  /**
327
343
  * Executes the agent with the given input.
328
344
  *
package/dist/index.js CHANGED
@@ -759,7 +759,35 @@ try {
759
759
  * await agent.kill(id);
760
760
  * ```
761
761
  */
762
+ /**
763
+ * Deploy a one-shot agent. Throws if called on a server-mode agent; use
764
+ * `deployServer()` for those. Returns the sandbox id so callers can pass it
765
+ * to `run(input, { sandboxId })`.
766
+ */
762
767
  async deploy(options) {
768
+ if (this.mode !== "one-shot") {
769
+ throw new ConfigurationError(
770
+ "deploy() is only available on one-shot agents. Use agent.deployServer() for server-mode agents."
771
+ );
772
+ }
773
+ const result = await this._deploy(options);
774
+ return result;
775
+ }
776
+ /**
777
+ * Deploy a server-mode agent. Throws if called on a one-shot agent; use
778
+ * `deploy()` for those. Returns the sandbox id, public server URL, bearer
779
+ * token, and Daytona preview token that `invoke()` needs to stream.
780
+ */
781
+ async deployServer(options) {
782
+ if (this.mode !== "server") {
783
+ throw new ConfigurationError(
784
+ "deployServer() is only available on server-mode agents. Use agent.deploy() for one-shot agents."
785
+ );
786
+ }
787
+ const result = await this._deploy(options);
788
+ return result;
789
+ }
790
+ async _deploy(options) {
763
791
  if (!options?.fresh && this._sandboxId && this.mode === "one-shot") return this._sandboxId;
764
792
  if (!options?.fresh && this._sandboxId && this._serverRuntime) {
765
793
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-neckbeard",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "Deploy AI agents to E2B and Daytona sandboxes",
5
5
  "type": "module",
6
6
  "exports": {