@reminix/sdk 0.8.2 → 0.8.4
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/CHANGELOG.md +37 -0
- package/README.md +10 -43
- package/client.d.mts +12 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +12 -6
- package/client.d.ts.map +1 -1
- package/client.js +9 -3
- package/client.js.map +1 -1
- package/client.mjs +9 -3
- package/client.mjs.map +1 -1
- package/core/streaming.d.mts +33 -0
- package/core/streaming.d.mts.map +1 -0
- package/core/streaming.d.ts +33 -0
- package/core/streaming.d.ts.map +1 -0
- package/core/streaming.js +263 -0
- package/core/streaming.js.map +1 -0
- package/core/streaming.mjs +258 -0
- package/core/streaming.mjs.map +1 -0
- package/index.d.mts +0 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts +0 -1
- package/index.d.ts.map +1 -1
- package/index.js +1 -5
- package/index.js.map +1 -1
- package/index.mjs +0 -2
- package/index.mjs.map +1 -1
- package/internal/decoders/line.d.mts +17 -0
- package/internal/decoders/line.d.mts.map +1 -0
- package/internal/decoders/line.d.ts +17 -0
- package/internal/decoders/line.d.ts.map +1 -0
- package/internal/decoders/line.js +113 -0
- package/internal/decoders/line.js.map +1 -0
- package/internal/decoders/line.mjs +108 -0
- package/internal/decoders/line.mjs.map +1 -0
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +10 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +10 -0
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts +2 -0
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +2 -0
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents.d.mts +49 -40
- package/resources/agents.d.mts.map +1 -1
- package/resources/agents.d.ts +49 -40
- package/resources/agents.d.ts.map +1 -1
- package/resources/agents.js +7 -127
- package/resources/agents.js.map +1 -1
- package/resources/agents.mjs +7 -126
- package/resources/agents.mjs.map +1 -1
- package/resources/deployments.d.mts +4 -0
- package/resources/deployments.d.mts.map +1 -0
- package/resources/deployments.d.ts +4 -0
- package/resources/deployments.d.ts.map +1 -0
- package/resources/deployments.js +9 -0
- package/resources/deployments.js.map +1 -0
- package/resources/deployments.mjs +5 -0
- package/resources/deployments.mjs.map +1 -0
- package/resources/index.d.mts +4 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +4 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -1
- package/resources/index.mjs.map +1 -1
- package/resources/{project.d.mts → projects.d.mts} +31 -7
- package/resources/projects.d.mts.map +1 -0
- package/resources/{project.d.ts → projects.d.ts} +31 -7
- package/resources/projects.d.ts.map +1 -0
- package/resources/{project.js → projects.js} +8 -7
- package/resources/projects.js.map +1 -0
- package/resources/{project.mjs → projects.mjs} +6 -5
- package/resources/projects.mjs.map +1 -0
- package/resources/secrets.d.mts +4 -0
- package/resources/secrets.d.mts.map +1 -0
- package/resources/secrets.d.ts +4 -0
- package/resources/secrets.d.ts.map +1 -0
- package/resources/secrets.js +9 -0
- package/resources/secrets.js.map +1 -0
- package/resources/secrets.mjs +5 -0
- package/resources/secrets.mjs.map +1 -0
- package/src/client.ts +25 -5
- package/src/core/streaming.ts +315 -0
- package/src/index.ts +0 -4
- package/src/internal/decoders/line.ts +135 -0
- package/src/internal/parse.ts +14 -0
- package/src/internal/request-options.ts +2 -0
- package/src/resources/agents.ts +101 -67
- package/src/resources/deployments.ts +5 -0
- package/src/resources/index.ts +8 -1
- package/src/resources/{project.ts → projects.ts} +35 -7
- package/src/resources/secrets.ts +5 -0
- package/src/streaming.ts +2 -87
- package/src/version.ts +1 -1
- package/streaming.d.mts +1 -30
- package/streaming.d.mts.map +1 -1
- package/streaming.d.ts +1 -30
- package/streaming.d.ts.map +1 -1
- package/streaming.js +3 -80
- package/streaming.js.map +1 -1
- package/streaming.mjs +1 -78
- package/streaming.mjs.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/project.d.mts.map +0 -1
- package/resources/project.d.ts.map +0 -1
- package/resources/project.js.map +0 -1
- package/resources/project.mjs.map +0 -1
package/streaming.js
CHANGED
|
@@ -1,83 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// stainless-custom-start
|
|
3
|
-
/**
|
|
4
|
-
* Streaming utilities for SSE (Server-Sent Events) responses.
|
|
5
|
-
*
|
|
6
|
-
* This module provides streaming support for the Reminix API.
|
|
7
|
-
* When you upgrade to Stainless Pro, you can remove this file
|
|
8
|
-
* and use the built-in streaming support.
|
|
9
|
-
*/
|
|
10
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```ts
|
|
17
|
-
* const stream = await client.agents.chatStream('agent', { messages: [...] });
|
|
18
|
-
* for await (const chunk of stream) {
|
|
19
|
-
* process.stdout.write(chunk.chunk);
|
|
20
|
-
* }
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
class Stream {
|
|
24
|
-
constructor(response) {
|
|
25
|
-
this.response = response;
|
|
26
|
-
}
|
|
27
|
-
async *[Symbol.asyncIterator]() {
|
|
28
|
-
const reader = this.response.body?.getReader();
|
|
29
|
-
if (!reader) {
|
|
30
|
-
throw new Error('Response body is not readable');
|
|
31
|
-
}
|
|
32
|
-
const decoder = new TextDecoder();
|
|
33
|
-
let buffer = '';
|
|
34
|
-
try {
|
|
35
|
-
while (true) {
|
|
36
|
-
const { done, value } = await reader.read();
|
|
37
|
-
if (done)
|
|
38
|
-
break;
|
|
39
|
-
buffer += decoder.decode(value, { stream: true });
|
|
40
|
-
const lines = buffer.split('\n');
|
|
41
|
-
buffer = lines.pop() || '';
|
|
42
|
-
for (const line of lines) {
|
|
43
|
-
const trimmed = line.trim();
|
|
44
|
-
if (trimmed.startsWith('data: ')) {
|
|
45
|
-
const data = trimmed.slice(6);
|
|
46
|
-
if (data === '[DONE]') {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (data) {
|
|
50
|
-
try {
|
|
51
|
-
yield JSON.parse(data);
|
|
52
|
-
}
|
|
53
|
-
catch {
|
|
54
|
-
// Skip malformed JSON
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
// Process any remaining data in buffer
|
|
61
|
-
if (buffer.trim()) {
|
|
62
|
-
const trimmed = buffer.trim();
|
|
63
|
-
if (trimmed.startsWith('data: ')) {
|
|
64
|
-
const data = trimmed.slice(6);
|
|
65
|
-
if (data && data !== '[DONE]') {
|
|
66
|
-
try {
|
|
67
|
-
yield JSON.parse(data);
|
|
68
|
-
}
|
|
69
|
-
catch {
|
|
70
|
-
// Skip malformed JSON
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
finally {
|
|
77
|
-
reader.releaseLock();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
exports.Stream = Stream;
|
|
82
|
-
// stainless-custom-end
|
|
3
|
+
const tslib_1 = require("./internal/tslib.js");
|
|
4
|
+
/** @deprecated Import from ./core/streaming instead */
|
|
5
|
+
tslib_1.__exportStar(require("./core/streaming.js"), exports);
|
|
83
6
|
//# sourceMappingURL=streaming.js.map
|
package/streaming.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.js","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"streaming.js","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,8DAAiC"}
|
package/streaming.mjs
CHANGED
|
@@ -1,79 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* Streaming utilities for SSE (Server-Sent Events) responses.
|
|
4
|
-
*
|
|
5
|
-
* This module provides streaming support for the Reminix API.
|
|
6
|
-
* When you upgrade to Stainless Pro, you can remove this file
|
|
7
|
-
* and use the built-in streaming support.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* An async iterable stream that parses SSE (Server-Sent Events) responses.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```ts
|
|
14
|
-
* const stream = await client.agents.chatStream('agent', { messages: [...] });
|
|
15
|
-
* for await (const chunk of stream) {
|
|
16
|
-
* process.stdout.write(chunk.chunk);
|
|
17
|
-
* }
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export class Stream {
|
|
21
|
-
constructor(response) {
|
|
22
|
-
this.response = response;
|
|
23
|
-
}
|
|
24
|
-
async *[Symbol.asyncIterator]() {
|
|
25
|
-
const reader = this.response.body?.getReader();
|
|
26
|
-
if (!reader) {
|
|
27
|
-
throw new Error('Response body is not readable');
|
|
28
|
-
}
|
|
29
|
-
const decoder = new TextDecoder();
|
|
30
|
-
let buffer = '';
|
|
31
|
-
try {
|
|
32
|
-
while (true) {
|
|
33
|
-
const { done, value } = await reader.read();
|
|
34
|
-
if (done)
|
|
35
|
-
break;
|
|
36
|
-
buffer += decoder.decode(value, { stream: true });
|
|
37
|
-
const lines = buffer.split('\n');
|
|
38
|
-
buffer = lines.pop() || '';
|
|
39
|
-
for (const line of lines) {
|
|
40
|
-
const trimmed = line.trim();
|
|
41
|
-
if (trimmed.startsWith('data: ')) {
|
|
42
|
-
const data = trimmed.slice(6);
|
|
43
|
-
if (data === '[DONE]') {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (data) {
|
|
47
|
-
try {
|
|
48
|
-
yield JSON.parse(data);
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
// Skip malformed JSON
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
// Process any remaining data in buffer
|
|
58
|
-
if (buffer.trim()) {
|
|
59
|
-
const trimmed = buffer.trim();
|
|
60
|
-
if (trimmed.startsWith('data: ')) {
|
|
61
|
-
const data = trimmed.slice(6);
|
|
62
|
-
if (data && data !== '[DONE]') {
|
|
63
|
-
try {
|
|
64
|
-
yield JSON.parse(data);
|
|
65
|
-
}
|
|
66
|
-
catch {
|
|
67
|
-
// Skip malformed JSON
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
finally {
|
|
74
|
-
reader.releaseLock();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
// stainless-custom-end
|
|
1
|
+
export * from "./core/streaming.mjs";
|
|
79
2
|
//# sourceMappingURL=streaming.mjs.map
|
package/streaming.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streaming.mjs","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"streaming.mjs","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":""}
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.8.
|
|
1
|
+
export declare const VERSION = "0.8.4";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.8.
|
|
1
|
+
export declare const VERSION = "0.8.4";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.8.
|
|
1
|
+
export const VERSION = '0.8.4'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.mts","sourceRoot":"","sources":["../src/resources/project.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGxE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CACpE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/resources/project.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGxE;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EAAE,KAAK,uBAAuB,IAAI,uBAAuB,EAAE,CAAC;CACpE"}
|
package/resources/project.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../src/resources/project.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAI/C,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,OAAwB;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;CACF;AAjBD,0BAiBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project.mjs","sourceRoot":"","sources":["../src/resources/project.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,OAAwB;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;CACF"}
|