casedev 0.31.3 → 0.32.0

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 (111) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/resources/agent/agent.d.mts +4 -0
  4. package/resources/agent/agent.d.mts.map +1 -1
  5. package/resources/agent/agent.d.ts +4 -0
  6. package/resources/agent/agent.d.ts.map +1 -1
  7. package/resources/agent/agent.js +4 -0
  8. package/resources/agent/agent.js.map +1 -1
  9. package/resources/agent/agent.mjs +4 -0
  10. package/resources/agent/agent.mjs.map +1 -1
  11. package/resources/agent/index.d.mts +1 -0
  12. package/resources/agent/index.d.mts.map +1 -1
  13. package/resources/agent/index.d.ts +1 -0
  14. package/resources/agent/index.d.ts.map +1 -1
  15. package/resources/agent/index.js +3 -1
  16. package/resources/agent/index.js.map +1 -1
  17. package/resources/agent/index.mjs +1 -0
  18. package/resources/agent/index.mjs.map +1 -1
  19. package/resources/agent/v2/chat/chat.d.mts +165 -0
  20. package/resources/agent/v2/chat/chat.d.mts.map +1 -0
  21. package/resources/agent/v2/chat/chat.d.ts +165 -0
  22. package/resources/agent/v2/chat/chat.d.ts.map +1 -0
  23. package/resources/agent/v2/chat/chat.js +109 -0
  24. package/resources/agent/v2/chat/chat.js.map +1 -0
  25. package/resources/agent/v2/chat/chat.mjs +104 -0
  26. package/resources/agent/v2/chat/chat.mjs.map +1 -0
  27. package/resources/agent/v2/chat/files.d.mts +42 -0
  28. package/resources/agent/v2/chat/files.d.mts.map +1 -0
  29. package/resources/agent/v2/chat/files.d.ts +42 -0
  30. package/resources/agent/v2/chat/files.d.ts.map +1 -0
  31. package/resources/agent/v2/chat/files.js +33 -0
  32. package/resources/agent/v2/chat/files.js.map +1 -0
  33. package/resources/agent/v2/chat/files.mjs +29 -0
  34. package/resources/agent/v2/chat/files.mjs.map +1 -0
  35. package/resources/agent/v2/chat/index.d.mts +3 -0
  36. package/resources/agent/v2/chat/index.d.mts.map +1 -0
  37. package/resources/agent/v2/chat/index.d.ts +3 -0
  38. package/resources/agent/v2/chat/index.d.ts.map +1 -0
  39. package/resources/agent/v2/chat/index.js +9 -0
  40. package/resources/agent/v2/chat/index.js.map +1 -0
  41. package/resources/agent/v2/chat/index.mjs +4 -0
  42. package/resources/agent/v2/chat/index.mjs.map +1 -0
  43. package/resources/agent/v2/chat.d.mts +2 -0
  44. package/resources/agent/v2/chat.d.mts.map +1 -0
  45. package/resources/agent/v2/chat.d.ts +2 -0
  46. package/resources/agent/v2/chat.d.ts.map +1 -0
  47. package/resources/agent/v2/chat.js +6 -0
  48. package/resources/agent/v2/chat.js.map +1 -0
  49. package/resources/agent/v2/chat.mjs +3 -0
  50. package/resources/agent/v2/chat.mjs.map +1 -0
  51. package/resources/agent/v2/execute.d.mts +42 -0
  52. package/resources/agent/v2/execute.d.mts.map +1 -0
  53. package/resources/agent/v2/execute.d.ts +42 -0
  54. package/resources/agent/v2/execute.d.ts.map +1 -0
  55. package/resources/agent/v2/execute.js +19 -0
  56. package/resources/agent/v2/execute.js.map +1 -0
  57. package/resources/agent/v2/execute.mjs +15 -0
  58. package/resources/agent/v2/execute.mjs.map +1 -0
  59. package/resources/agent/v2/index.d.mts +5 -0
  60. package/resources/agent/v2/index.d.mts.map +1 -0
  61. package/resources/agent/v2/index.d.ts +5 -0
  62. package/resources/agent/v2/index.d.ts.map +1 -0
  63. package/resources/agent/v2/index.js +13 -0
  64. package/resources/agent/v2/index.js.map +1 -0
  65. package/resources/agent/v2/index.mjs +6 -0
  66. package/resources/agent/v2/index.mjs.map +1 -0
  67. package/resources/agent/v2/run.d.mts +73 -0
  68. package/resources/agent/v2/run.d.mts.map +1 -0
  69. package/resources/agent/v2/run.d.ts +73 -0
  70. package/resources/agent/v2/run.d.ts.map +1 -0
  71. package/resources/agent/v2/run.js +51 -0
  72. package/resources/agent/v2/run.js.map +1 -0
  73. package/resources/agent/v2/run.mjs +47 -0
  74. package/resources/agent/v2/run.mjs.map +1 -0
  75. package/resources/agent/v2/v2.d.mts +18 -0
  76. package/resources/agent/v2/v2.d.mts.map +1 -0
  77. package/resources/agent/v2/v2.d.ts +18 -0
  78. package/resources/agent/v2/v2.d.ts.map +1 -0
  79. package/resources/agent/v2/v2.js +25 -0
  80. package/resources/agent/v2/v2.js.map +1 -0
  81. package/resources/agent/v2/v2.mjs +20 -0
  82. package/resources/agent/v2/v2.mjs.map +1 -0
  83. package/resources/agent/v2.d.mts +2 -0
  84. package/resources/agent/v2.d.mts.map +1 -0
  85. package/resources/agent/v2.d.ts +2 -0
  86. package/resources/agent/v2.d.ts.map +1 -0
  87. package/resources/agent/v2.js +6 -0
  88. package/resources/agent/v2.js.map +1 -0
  89. package/resources/agent/v2.mjs +3 -0
  90. package/resources/agent/v2.mjs.map +1 -0
  91. package/resources/vault/objects.d.mts +4 -0
  92. package/resources/vault/objects.d.mts.map +1 -1
  93. package/resources/vault/objects.d.ts +4 -0
  94. package/resources/vault/objects.d.ts.map +1 -1
  95. package/src/resources/agent/agent.ts +6 -0
  96. package/src/resources/agent/index.ts +1 -0
  97. package/src/resources/agent/v2/chat/chat.ts +272 -0
  98. package/src/resources/agent/v2/chat/files.ts +63 -0
  99. package/src/resources/agent/v2/chat/index.ts +16 -0
  100. package/src/resources/agent/v2/chat.ts +3 -0
  101. package/src/resources/agent/v2/execute.ts +67 -0
  102. package/src/resources/agent/v2/index.ts +27 -0
  103. package/src/resources/agent/v2/run.ts +137 -0
  104. package/src/resources/agent/v2/v2.ts +73 -0
  105. package/src/resources/agent/v2.ts +3 -0
  106. package/src/resources/vault/objects.ts +5 -0
  107. package/src/version.ts +1 -1
  108. package/version.d.mts +1 -1
  109. package/version.d.ts +1 -1
  110. package/version.js +1 -1
  111. package/version.mjs +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.32.0 (2026-03-27)
4
+
5
+ Full Changelog: [v0.31.4...v0.32.0](https://github.com/CaseMark/casedev-typescript/compare/v0.31.4...v0.32.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** api update ([85f1de7](https://github.com/CaseMark/casedev-typescript/commit/85f1de7230a429db0fa31f73ddf1a300ad5957ab))
10
+
11
+ ## 0.31.4 (2026-03-27)
12
+
13
+ Full Changelog: [v0.31.3...v0.31.4](https://github.com/CaseMark/casedev-typescript/compare/v0.31.3...v0.31.4)
14
+
15
+ ### Chores
16
+
17
+ * **internal:** update multipart form array serialization ([ff0880a](https://github.com/CaseMark/casedev-typescript/commit/ff0880ac9d48dafdf0fce3fdfb8945eee5ddc3b8))
18
+
3
19
  ## 0.31.3 (2026-03-25)
4
20
 
5
21
  Full Changelog: [v0.31.2...v0.31.3](https://github.com/CaseMark/casedev-typescript/compare/v0.31.2...v0.31.3)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "casedev",
3
- "version": "0.31.3",
3
+ "version": "0.32.0",
4
4
  "description": "The official TypeScript library for the Casedev API",
5
5
  "author": "Casedev <support@casemark.com>",
6
6
  "types": "./index.d.ts",
@@ -1,10 +1,14 @@
1
1
  import { APIResource } from "../../core/resource.mjs";
2
2
  import * as V1API from "./v1/v1.mjs";
3
3
  import { V1 } from "./v1/v1.mjs";
4
+ import * as V2API from "./v2/v2.mjs";
5
+ import { V2 } from "./v2/v2.mjs";
4
6
  export declare class Agent extends APIResource {
5
7
  v1: V1API.V1;
8
+ v2: V2API.V2;
6
9
  }
7
10
  export declare namespace Agent {
8
11
  export { V1 as V1 };
12
+ export { V2 as V2 };
9
13
  }
10
14
  //# sourceMappingURL=agent.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.mts","sourceRoot":"","sources":["../../src/resources/agent/agent.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,KAAK;OACV,EAAE,EAAE,EAAE;AAEb,qBAAa,KAAM,SAAQ,WAAW;IACpC,EAAE,EAAE,KAAK,CAAC,EAAE,CAA8B;CAC3C;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC;CACrB"}
1
+ {"version":3,"file":"agent.d.mts","sourceRoot":"","sources":["../../src/resources/agent/agent.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,KAAK;OACV,EAAE,EAAE,EAAE;OACN,KAAK,KAAK;OACV,EAAE,EAAE,EAAE;AAEb,qBAAa,KAAM,SAAQ,WAAW;IACpC,EAAE,EAAE,KAAK,CAAC,EAAE,CAA8B;IAC1C,EAAE,EAAE,KAAK,CAAC,EAAE,CAA8B;CAC3C;AAKD,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC;IAEpB,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC;CACrB"}
@@ -1,10 +1,14 @@
1
1
  import { APIResource } from "../../core/resource.js";
2
2
  import * as V1API from "./v1/v1.js";
3
3
  import { V1 } from "./v1/v1.js";
4
+ import * as V2API from "./v2/v2.js";
5
+ import { V2 } from "./v2/v2.js";
4
6
  export declare class Agent extends APIResource {
5
7
  v1: V1API.V1;
8
+ v2: V2API.V2;
6
9
  }
7
10
  export declare namespace Agent {
8
11
  export { V1 as V1 };
12
+ export { V2 as V2 };
9
13
  }
10
14
  //# sourceMappingURL=agent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/resources/agent/agent.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,KAAK;OACV,EAAE,EAAE,EAAE;AAEb,qBAAa,KAAM,SAAQ,WAAW;IACpC,EAAE,EAAE,KAAK,CAAC,EAAE,CAA8B;CAC3C;AAID,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC;CACrB"}
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/resources/agent/agent.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,KAAK;OACV,EAAE,EAAE,EAAE;OACN,KAAK,KAAK;OACV,EAAE,EAAE,EAAE;AAEb,qBAAa,KAAM,SAAQ,WAAW;IACpC,EAAE,EAAE,KAAK,CAAC,EAAE,CAA8B;IAC1C,EAAE,EAAE,KAAK,CAAC,EAAE,CAA8B;CAC3C;AAKD,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC;IAEpB,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC;CACrB"}
@@ -6,12 +6,16 @@ const tslib_1 = require("../../internal/tslib.js");
6
6
  const resource_1 = require("../../core/resource.js");
7
7
  const V1API = tslib_1.__importStar(require("./v1/v1.js"));
8
8
  const v1_1 = require("./v1/v1.js");
9
+ const V2API = tslib_1.__importStar(require("./v2/v2.js"));
10
+ const v2_1 = require("./v2/v2.js");
9
11
  class Agent extends resource_1.APIResource {
10
12
  constructor() {
11
13
  super(...arguments);
12
14
  this.v1 = new V1API.V1(this._client);
15
+ this.v2 = new V2API.V2(this._client);
13
16
  }
14
17
  }
15
18
  exports.Agent = Agent;
16
19
  Agent.V1 = v1_1.V1;
20
+ Agent.V2 = v2_1.V2;
17
21
  //# sourceMappingURL=agent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/resources/agent/agent.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,0DAAiC;AACjC,mCAA6B;AAE7B,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,OAAE,GAAa,IAAI,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;CAAA;AAFD,sBAEC;AAED,KAAK,CAAC,EAAE,GAAG,OAAE,CAAC"}
1
+ {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/resources/agent/agent.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,0DAAiC;AACjC,mCAA6B;AAC7B,0DAAiC;AACjC,mCAA6B;AAE7B,MAAa,KAAM,SAAQ,sBAAW;IAAtC;;QACE,OAAE,GAAa,IAAI,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,OAAE,GAAa,IAAI,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;CAAA;AAHD,sBAGC;AAED,KAAK,CAAC,EAAE,GAAG,OAAE,CAAC;AACd,KAAK,CAAC,EAAE,GAAG,OAAE,CAAC"}
@@ -2,11 +2,15 @@
2
2
  import { APIResource } from "../../core/resource.mjs";
3
3
  import * as V1API from "./v1/v1.mjs";
4
4
  import { V1 } from "./v1/v1.mjs";
5
+ import * as V2API from "./v2/v2.mjs";
6
+ import { V2 } from "./v2/v2.mjs";
5
7
  export class Agent extends APIResource {
6
8
  constructor() {
7
9
  super(...arguments);
8
10
  this.v1 = new V1API.V1(this._client);
11
+ this.v2 = new V2API.V2(this._client);
9
12
  }
10
13
  }
11
14
  Agent.V1 = V1;
15
+ Agent.V2 = V2;
12
16
  //# sourceMappingURL=agent.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.mjs","sourceRoot":"","sources":["../../src/resources/agent/agent.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,KAAK;OACV,EAAE,EAAE,EAAE;AAEb,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,OAAE,GAAa,IAAI,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;CAAA;AAED,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"agent.mjs","sourceRoot":"","sources":["../../src/resources/agent/agent.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,KAAK;OACV,EAAE,EAAE,EAAE;OACN,KAAK,KAAK;OACV,EAAE,EAAE,EAAE;AAEb,MAAM,OAAO,KAAM,SAAQ,WAAW;IAAtC;;QACE,OAAE,GAAa,IAAI,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,OAAE,GAAa,IAAI,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;CAAA;AAED,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC;AACd,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export { Agent } from "./agent.mjs";
2
2
  export { V1 } from "./v1/index.mjs";
3
+ export { V2 } from "./v2/index.mjs";
3
4
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/agent/index.ts"],"names":[],"mappings":"OAEO,EAAE,KAAK,EAAE;OACT,EAAE,EAAE,EAAE"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/agent/index.ts"],"names":[],"mappings":"OAEO,EAAE,KAAK,EAAE;OACT,EAAE,EAAE,EAAE;OACN,EAAE,EAAE,EAAE"}
@@ -1,3 +1,4 @@
1
1
  export { Agent } from "./agent.js";
2
2
  export { V1 } from "./v1/index.js";
3
+ export { V2 } from "./v2/index.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/agent/index.ts"],"names":[],"mappings":"OAEO,EAAE,KAAK,EAAE;OACT,EAAE,EAAE,EAAE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/agent/index.ts"],"names":[],"mappings":"OAEO,EAAE,KAAK,EAAE;OACT,EAAE,EAAE,EAAE;OACN,EAAE,EAAE,EAAE"}
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.V1 = exports.Agent = void 0;
4
+ exports.V2 = exports.V1 = exports.Agent = void 0;
5
5
  var agent_1 = require("./agent.js");
6
6
  Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return agent_1.Agent; } });
7
7
  var index_1 = require("./v1/index.js");
8
8
  Object.defineProperty(exports, "V1", { enumerable: true, get: function () { return index_1.V1; } });
9
+ var index_2 = require("./v2/index.js");
10
+ Object.defineProperty(exports, "V2", { enumerable: true, get: function () { return index_2.V2; } });
9
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/agent/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,uCAAgC;AAAvB,2FAAA,EAAE,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/agent/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,uCAAgC;AAAvB,2FAAA,EAAE,OAAA;AACX,uCAAgC;AAAvB,2FAAA,EAAE,OAAA"}
@@ -1,4 +1,5 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  export { Agent } from "./agent.mjs";
3
3
  export { V1 } from "./v1/index.mjs";
4
+ export { V2 } from "./v2/index.mjs";
4
5
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/agent/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,KAAK,EAAE;OACT,EAAE,EAAE,EAAE"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/agent/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,KAAK,EAAE;OACT,EAAE,EAAE,EAAE;OACN,EAAE,EAAE,EAAE"}
@@ -0,0 +1,165 @@
1
+ import { APIResource } from "../../../../core/resource.mjs";
2
+ import * as FilesAPI from "./files.mjs";
3
+ import { FileDownloadParams, FileListResponse, Files } from "./files.mjs";
4
+ import { APIPromise } from "../../../../core/api-promise.mjs";
5
+ import { Stream } from "../../../../core/streaming.mjs";
6
+ import { RequestOptions } from "../../../../internal/request-options.mjs";
7
+ /**
8
+ * Create, manage, and execute AI agents with tool access, sandbox environments, and async run workflows
9
+ */
10
+ export declare class Chat extends APIResource {
11
+ files: FilesAPI.Files;
12
+ /**
13
+ * Creates a persistent OpenCode chat session backed by a Daytona runtime. Session
14
+ * state is retained and can be resumed or recovered across requests.
15
+ */
16
+ create(body?: ChatCreateParams | null | undefined, options?: RequestOptions): APIPromise<ChatCreateResponse>;
17
+ /**
18
+ * Terminates the active Daytona runtime (if any), then marks the chat as ended.
19
+ */
20
+ delete(id: string, options?: RequestOptions): APIPromise<ChatDeleteResponse>;
21
+ /**
22
+ * Aborts the active OpenCode generation for this Daytona-backed chat session.
23
+ */
24
+ cancel(id: string, options?: RequestOptions): APIPromise<ChatCancelResponse>;
25
+ /**
26
+ * Answers a pending OpenCode question for the Daytona-backed chat session and
27
+ * resumes or recovers the runtime if needed.
28
+ */
29
+ replyToQuestion(requestID: string, params: ChatReplyToQuestionParams, options?: RequestOptions): APIPromise<void>;
30
+ /**
31
+ * Streams a single assistant turn from a Daytona-backed chat runtime as normalized
32
+ * SSE events with stable turn, message, and part IDs. Emits events:
33
+ * `turn.started`, `turn.status`, `message.created`, `message.part.updated`,
34
+ * `message.completed`, `session.usage`, `turn.completed`.
35
+ *
36
+ * **When to use this endpoint:** Recommended for building custom chat UIs that
37
+ * need real-time streaming progress. This is the primary streaming endpoint for
38
+ * new integrations.
39
+ *
40
+ * **Alternatives:**
41
+ *
42
+ * - `POST /chat/:id/message` — synchronous, returns complete response as JSON
43
+ * (best for server-to-server)
44
+ */
45
+ respond(id: string, body: ChatRespondParams, options?: RequestOptions): APIPromise<Stream<ChatRespondResponse>>;
46
+ /**
47
+ * Sends a message to a Daytona-backed chat runtime and returns the complete
48
+ * response as a single JSON body. Blocks until the assistant turn completes.
49
+ *
50
+ * **When to use this endpoint:** Best for server-to-server integrations,
51
+ * background processing, or any context where you want the full response in one
52
+ * call without managing an SSE stream.
53
+ *
54
+ * **Alternatives:**
55
+ *
56
+ * - `POST /chat/:id/respond` — streaming SSE with normalized events (recommended
57
+ * for custom chat UIs)
58
+ */
59
+ sendMessage(id: string, body: ChatSendMessageParams, options?: RequestOptions): APIPromise<void>;
60
+ /**
61
+ * Relays OpenCode SSE events for this Daytona-backed chat runtime. Supports replay
62
+ * from buffered events using Last-Event-ID and transparently reconnects stopped or
63
+ * archived runtimes.
64
+ */
65
+ stream(id: string, query?: ChatStreamParams | undefined, options?: RequestOptions): APIPromise<Stream<ChatStreamResponse>>;
66
+ }
67
+ export interface ChatCreateResponse {
68
+ id?: string;
69
+ createdAt?: string;
70
+ idleTimeoutMs?: number;
71
+ provider?: 'daytona';
72
+ runtimeState?: string;
73
+ status?: string;
74
+ }
75
+ export interface ChatDeleteResponse {
76
+ id?: string;
77
+ cost?: number;
78
+ provider?: string | null;
79
+ runtimeId?: string | null;
80
+ runtimeMs?: number;
81
+ status?: string;
82
+ }
83
+ export interface ChatCancelResponse {
84
+ id?: string;
85
+ ok?: boolean;
86
+ }
87
+ export type ChatRespondResponse = string;
88
+ export type ChatStreamResponse = string;
89
+ export interface ChatCreateParams {
90
+ /**
91
+ * Idle timeout before the runtime is eligible to stop. Defaults to 15 minutes.
92
+ */
93
+ idleTimeoutMs?: number | null;
94
+ /**
95
+ * Optional model override for the OpenCode session
96
+ */
97
+ model?: string | null;
98
+ /**
99
+ * Optional human-readable session title
100
+ */
101
+ title?: string;
102
+ /**
103
+ * Restrict the chat session to specific vault IDs
104
+ */
105
+ vaultIds?: Array<string> | null;
106
+ }
107
+ export interface ChatReplyToQuestionParams {
108
+ /**
109
+ * Path param: Chat session ID
110
+ */
111
+ id: string;
112
+ /**
113
+ * Body param: Answer selections for each prompt element in the pending question
114
+ */
115
+ answers: Array<Array<string>>;
116
+ }
117
+ export interface ChatRespondParams {
118
+ /**
119
+ * Message content parts. Currently only "text" type is supported. Additional types
120
+ * (e.g. file, image) may be added in future versions.
121
+ */
122
+ parts?: Array<ChatRespondParams.Part>;
123
+ }
124
+ export declare namespace ChatRespondParams {
125
+ interface Part {
126
+ /**
127
+ * The message text content
128
+ */
129
+ text: string;
130
+ /**
131
+ * Part type. Currently only "text" is supported.
132
+ */
133
+ type: 'text';
134
+ }
135
+ }
136
+ export interface ChatSendMessageParams {
137
+ /**
138
+ * Message content parts. Currently only "text" type is supported. Additional types
139
+ * (e.g. file, image) may be added in future versions.
140
+ */
141
+ parts?: Array<ChatSendMessageParams.Part>;
142
+ }
143
+ export declare namespace ChatSendMessageParams {
144
+ interface Part {
145
+ /**
146
+ * The message text content
147
+ */
148
+ text: string;
149
+ /**
150
+ * Part type. Currently only "text" is supported.
151
+ */
152
+ type: 'text';
153
+ }
154
+ }
155
+ export interface ChatStreamParams {
156
+ /**
157
+ * Replay events after this sequence number
158
+ */
159
+ lastEventId?: number;
160
+ }
161
+ export declare namespace Chat {
162
+ export { type ChatCreateResponse as ChatCreateResponse, type ChatDeleteResponse as ChatDeleteResponse, type ChatCancelResponse as ChatCancelResponse, type ChatRespondResponse as ChatRespondResponse, type ChatStreamResponse as ChatStreamResponse, type ChatCreateParams as ChatCreateParams, type ChatReplyToQuestionParams as ChatReplyToQuestionParams, type ChatRespondParams as ChatRespondParams, type ChatSendMessageParams as ChatSendMessageParams, type ChatStreamParams as ChatStreamParams, };
163
+ export { Files as Files, type FileListResponse as FileListResponse, type FileDownloadParams as FileDownloadParams, };
164
+ }
165
+ //# sourceMapp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Resource } from "../../../../core/resource.js";
2
+ import * as FilesAPI from "./files.js";
3
+ import { FileDownloadParams, FileListResponse, Files } from "./files.js";
4
+ import { APIPromise } from "../../../../core/api-promise.js";
5
+ import { Stream } from "../../../../core/streaming.js";
6
+ import { RequestOptions } from "../../../../internal/request-options.js";
7
+ /**
8
+ * Create, manage, and execute AI agents with tool access, sandbox environments, and async run workflows
9
+ */
10
+ export declare class Chat extends APIResource {
11
+ files: FilesAPI.Files;
12
+ /**
13
+ * Creates a persistent OpenCode chat session backed by a Daytona runtime. Session
14
+ * state is retained and can be resumed or recovered across requests.
15
+ */
16
+ create(body?: ChatCreateParams | null | undefined, options?: RequestOptions): APIPromise<ChatCreateResponse>;
17
+ /**
18
+ * Terminates the active Daytona runtime (if any), then marks the chat as ended.
19
+ */
20
+ delete(id: string, options?: RequestOptions): APIPromise<ChatDeleteResponse>;
21
+ /**
22
+ * Aborts the active OpenCode generation for this Daytona-backed chat session.
23
+ */
24
+ cancel(id: string, options?: RequestOptions): APIPromise<ChatCancelResponse>;
25
+ /**
26
+ * Answers a pending OpenCode question for the Daytona-backed chat session and
27
+ * resumes or recovers the runtime if needed.
28
+ */
29
+ replyToQuestion(requestID: string, params: ChatReplyToQuestionParams, options?: RequestOptions): APIPromise<void>;
30
+ /**
31
+ * Streams a single assistant turn from a Daytona-backed chat runtime as normalized
32
+ * SSE events with stable turn, message, and part IDs. Emits events:
33
+ * `turn.started`, `turn.status`, `message.created`, `message.part.updated`,
34
+ * `message.completed`, `session.usage`, `turn.completed`.
35
+ *
36
+ * **When to use this endpoint:** Recommended for building custom chat UIs that
37
+ * need real-time streaming progress. This is the primary streaming endpoint for
38
+ * new integrations.
39
+ *
40
+ * **Alternatives:**
41
+ *
42
+ * - `POST /chat/:id/message` — synchronous, returns complete response as JSON
43
+ * (best for server-to-server)
44
+ */
45
+ respond(id: string, body: ChatRespondParams, options?: RequestOptions): APIPromise<Stream<ChatRespondResponse>>;
46
+ /**
47
+ * Sends a message to a Daytona-backed chat runtime and returns the complete
48
+ * response as a single JSON body. Blocks until the assistant turn completes.
49
+ *
50
+ * **When to use this endpoint:** Best for server-to-server integrations,
51
+ * background processing, or any context where you want the full response in one
52
+ * call without managing an SSE stream.
53
+ *
54
+ * **Alternatives:**
55
+ *
56
+ * - `POST /chat/:id/respond` — streaming SSE with normalized events (recommended
57
+ * for custom chat UIs)
58
+ */
59
+ sendMessage(id: string, body: ChatSendMessageParams, options?: RequestOptions): APIPromise<void>;
60
+ /**
61
+ * Relays OpenCode SSE events for this Daytona-backed chat runtime. Supports replay
62
+ * from buffered events using Last-Event-ID and transparently reconnects stopped or
63
+ * archived runtimes.
64
+ */
65
+ stream(id: string, query?: ChatStreamParams | undefined, options?: RequestOptions): APIPromise<Stream<ChatStreamResponse>>;
66
+ }
67
+ export interface ChatCreateResponse {
68
+ id?: string;
69
+ createdAt?: string;
70
+ idleTimeoutMs?: number;
71
+ provider?: 'daytona';
72
+ runtimeState?: string;
73
+ status?: string;
74
+ }
75
+ export interface ChatDeleteResponse {
76
+ id?: string;
77
+ cost?: number;
78
+ provider?: string | null;
79
+ runtimeId?: string | null;
80
+ runtimeMs?: number;
81
+ status?: string;
82
+ }
83
+ export interface ChatCancelResponse {
84
+ id?: string;
85
+ ok?: boolean;
86
+ }
87
+ export type ChatRespondResponse = string;
88
+ export type ChatStreamResponse = string;
89
+ export interface ChatCreateParams {
90
+ /**
91
+ * Idle timeout before the runtime is eligible to stop. Defaults to 15 minutes.
92
+ */
93
+ idleTimeoutMs?: number | null;
94
+ /**
95
+ * Optional model override for the OpenCode session
96
+ */
97
+ model?: string | null;
98
+ /**
99
+ * Optional human-readable session title
100
+ */
101
+ title?: string;
102
+ /**
103
+ * Restrict the chat session to specific vault IDs
104
+ */
105
+ vaultIds?: Array<string> | null;
106
+ }
107
+ export interface ChatReplyToQuestionParams {
108
+ /**
109
+ * Path param: Chat session ID
110
+ */
111
+ id: string;
112
+ /**
113
+ * Body param: Answer selections for each prompt element in the pending question
114
+ */
115
+ answers: Array<Array<string>>;
116
+ }
117
+ export interface ChatRespondParams {
118
+ /**
119
+ * Message content parts. Currently only "text" type is supported. Additional types
120
+ * (e.g. file, image) may be added in future versions.
121
+ */
122
+ parts?: Array<ChatRespondParams.Part>;
123
+ }
124
+ export declare namespace ChatRespondParams {
125
+ interface Part {
126
+ /**
127
+ * The message text content
128
+ */
129
+ text: string;
130
+ /**
131
+ * Part type. Currently only "text" is supported.
132
+ */
133
+ type: 'text';
134
+ }
135
+ }
136
+ export interface ChatSendMessageParams {
137
+ /**
138
+ * Message content parts. Currently only "text" type is supported. Additional types
139
+ * (e.g. file, image) may be added in future versions.
140
+ */
141
+ parts?: Array<ChatSendMessageParams.Part>;
142
+ }
143
+ export declare namespace ChatSendMessageParams {
144
+ interface Part {
145
+ /**
146
+ * The message text content
147
+ */
148
+ text: string;
149
+ /**
150
+ * Part type. Currently only "text" is supported.
151
+ */
152
+ type: 'text';
153
+ }
154
+ }
155
+ export interface ChatStreamParams {
156
+ /**
157
+ * Replay events after this sequence number
158
+ */
159
+ lastEventId?: number;
160
+ }
161
+ export declare namespace Chat {
162
+ export { type ChatCreateResponse as ChatCreateResponse, type ChatDeleteResponse as ChatDeleteResponse, type ChatCancelResponse as ChatCancelResponse, type ChatRespondResponse as ChatRespondResponse, type ChatStreamResponse as ChatStreamResponse, type ChatCreateParams as ChatCreateParams, type ChatReplyToQuestionParams as ChatReplyToQuestionParams, type ChatRespondParams as ChatRespondParams, type ChatSendMessageParams as ChatSendMessageParams, type ChatStreamParams as ChatStreamParams, };
163
+ export { Files as Files, type FileListResponse as FileListResponse, type FileDownloadParams as FileDownloadParams, };
164
+ }
165
+ //# sourceMappingURL=chat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../src/resources/agent/v2/chat/chat.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,QAAQ;OACb,EAAE,kBAAkB,EAAE,gBAAgB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BAAiB,CAAC;IACjC,UAAiB,IAAI;QACnB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;CAC3C;AAED,yBAAiB,qBAAqB,CAAC;IACrC,UAAiB,IAAI;QACnB;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;KACd;CACF;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;IAEF,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Chat = void 0;
5
+ const tslib_1 = require("../../../../internal/tslib.js");
6
+ const resource_1 = require("../../../../core/resource.js");
7
+ const FilesAPI = tslib_1.__importStar(require("./files.js"));
8
+ const files_1 = require("./files.js");
9
+ const headers_1 = require("../../../../internal/headers.js");
10
+ const path_1 = require("../../../../internal/utils/path.js");
11
+ /**
12
+ * Create, manage, and execute AI agents with tool access, sandbox environments, and async run workflows
13
+ */
14
+ class Chat extends resource_1.APIResource {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.files = new FilesAPI.Files(this._client);
18
+ }
19
+ /**
20
+ * Creates a persistent OpenCode chat session backed by a Daytona runtime. Session
21
+ * state is retained and can be resumed or recovered across requests.
22
+ */
23
+ create(body = {}, options) {
24
+ return this._client.post('/agent/v2/chat', { body, ...options });
25
+ }
26
+ /**
27
+ * Terminates the active Daytona runtime (if any), then marks the chat as ended.
28
+ */
29
+ delete(id, options) {
30
+ return this._client.delete((0, path_1.path) `/agent/v2/chat/${id}`, options);
31
+ }
32
+ /**
33
+ * Aborts the active OpenCode generation for this Daytona-backed chat session.
34
+ */
35
+ cancel(id, options) {
36
+ return this._client.post((0, path_1.path) `/agent/v2/chat/${id}/cancel`, options);
37
+ }
38
+ /**
39
+ * Answers a pending OpenCode question for the Daytona-backed chat session and
40
+ * resumes or recovers the runtime if needed.
41
+ */
42
+ replyToQuestion(requestID, params, options) {
43
+ const { id, ...body } = params;
44
+ return this._client.post((0, path_1.path) `/agent/v2/chat/${id}/question/${requestID}/reply`, {
45
+ body,
46
+ ...options,
47
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
48
+ });
49
+ }
50
+ /**
51
+ * Streams a single assistant turn from a Daytona-backed chat runtime as normalized
52
+ * SSE events with stable turn, message, and part IDs. Emits events:
53
+ * `turn.started`, `turn.status`, `message.created`, `message.part.updated`,
54
+ * `message.completed`, `session.usage`, `turn.completed`.
55
+ *
56
+ * **When to use this endpoint:** Recommended for building custom chat UIs that
57
+ * need real-time streaming progress. This is the primary streaming endpoint for
58
+ * new integrations.
59
+ *
60
+ * **Alternatives:**
61
+ *
62
+ * - `POST /chat/:id/message` — synchronous, returns complete response as JSON
63
+ * (best for server-to-server)
64
+ */
65
+ respond(id, body, options) {
66
+ return this._client.post((0, path_1.path) `/agent/v2/chat/${id}/respond`, {
67
+ body,
68
+ ...options,
69
+ headers: (0, headers_1.buildHeaders)([{ Accept: 'text/event-stream' }, options?.headers]),
70
+ stream: true,
71
+ });
72
+ }
73
+ /**
74
+ * Sends a message to a Daytona-backed chat runtime and returns the complete
75
+ * response as a single JSON body. Blocks until the assistant turn completes.
76
+ *
77
+ * **When to use this endpoint:** Best for server-to-server integrations,
78
+ * background processing, or any context where you want the full response in one
79
+ * call without managing an SSE stream.
80
+ *
81
+ * **Alternatives:**
82
+ *
83
+ * - `POST /chat/:id/respond` — streaming SSE with normalized events (recommended
84
+ * for custom chat UIs)
85
+ */
86
+ sendMessage(id, body, options) {
87
+ return this._client.post((0, path_1.path) `/agent/v2/chat/${id}/message`, {
88
+ body,
89
+ ...options,
90
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
91
+ });
92
+ }
93
+ /**
94
+ * Relays OpenCode SSE events for this Daytona-backed chat runtime. Supports replay
95
+ * from buffered events using Last-Event-ID and transparently reconnects stopped or
96
+ * archived runtimes.
97
+ */
98
+ stream(id, query = {}, options) {
99
+ return this._client.get((0, path_1.path) `/agent/v2/chat/${id}/stream`, {
100
+ query,
101
+ ...options,
102
+ headers: (0, headers_1.buildHeaders)([{ Accept: 'text/event-stream' }, options?.headers]),
103
+ stream: true,
104
+ });
105
+ }
106
+ }
107
+ exports.Chat = Chat;
108
+ Chat.Files = files_1.Files;
109
+ //# sourceMappingURL=chat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.js","sourceRoot":"","sources":["../../../../src/resources/agent/v2/chat/chat.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,2DAAwD;AACxD,6DAAoC;AACpC,sCAAsE;AAGtE,6DAA4D;AAE5D,6DAAuD;AAEvD;;GAEG;AACH,MAAa,IAAK,SAAQ,sBAAW;IAAr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