agent-neckbeard 1.1.5 → 1.1.6
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 +28 -0
- package/dist/index.d.cts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +28 -0
- package/package.json +1 -1
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
|
@@ -320,9 +320,23 @@ declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
|
|
|
320
320
|
* await agent.kill(id);
|
|
321
321
|
* ```
|
|
322
322
|
*/
|
|
323
|
+
/**
|
|
324
|
+
* Deploy a one-shot agent. Throws if called on a server-mode agent; use
|
|
325
|
+
* `deployServer()` for those. Returns the sandbox id so callers can pass it
|
|
326
|
+
* to `run(input, { sandboxId })`.
|
|
327
|
+
*/
|
|
323
328
|
deploy(options?: {
|
|
324
329
|
fresh?: boolean;
|
|
325
|
-
}): Promise<string
|
|
330
|
+
}): Promise<string>;
|
|
331
|
+
/**
|
|
332
|
+
* Deploy a server-mode agent. Throws if called on a one-shot agent; use
|
|
333
|
+
* `deploy()` for those. Returns the sandbox id, public server URL, bearer
|
|
334
|
+
* token, and Daytona preview token that `invoke()` needs to stream.
|
|
335
|
+
*/
|
|
336
|
+
deployServer(options?: {
|
|
337
|
+
fresh?: boolean;
|
|
338
|
+
}): Promise<ServerDeployResult>;
|
|
339
|
+
private _deploy;
|
|
326
340
|
/**
|
|
327
341
|
* Executes the agent with the given input.
|
|
328
342
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -320,9 +320,23 @@ declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
|
|
|
320
320
|
* await agent.kill(id);
|
|
321
321
|
* ```
|
|
322
322
|
*/
|
|
323
|
+
/**
|
|
324
|
+
* Deploy a one-shot agent. Throws if called on a server-mode agent; use
|
|
325
|
+
* `deployServer()` for those. Returns the sandbox id so callers can pass it
|
|
326
|
+
* to `run(input, { sandboxId })`.
|
|
327
|
+
*/
|
|
323
328
|
deploy(options?: {
|
|
324
329
|
fresh?: boolean;
|
|
325
|
-
}): Promise<string
|
|
330
|
+
}): Promise<string>;
|
|
331
|
+
/**
|
|
332
|
+
* Deploy a server-mode agent. Throws if called on a one-shot agent; use
|
|
333
|
+
* `deploy()` for those. Returns the sandbox id, public server URL, bearer
|
|
334
|
+
* token, and Daytona preview token that `invoke()` needs to stream.
|
|
335
|
+
*/
|
|
336
|
+
deployServer(options?: {
|
|
337
|
+
fresh?: boolean;
|
|
338
|
+
}): Promise<ServerDeployResult>;
|
|
339
|
+
private _deploy;
|
|
326
340
|
/**
|
|
327
341
|
* Executes the agent with the given input.
|
|
328
342
|
*
|
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 {
|