@mastra/client-js 1.60.0-alpha.0 → 1.60.0-alpha.2
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/client.d.ts +5 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/docs/SKILL.md +5 -5
- package/dist/docs/assets/SOURCE_MAP.json +6 -6
- package/dist/docs/references/docs-harness-schedules.md +2 -0
- package/dist/docs/references/docs-signals-sending-signals.md +3 -1
- package/dist/docs/references/integrations-auth-clerk.md +46 -7
- package/dist/docs/references/integrations-auth-neon.md +217 -0
- package/dist/docs/references/integrations-auth-supabase.md +46 -7
- package/dist/docs/references/integrations-auth-workos.md +54 -15
- package/dist/docs/references/reference-client-js-agents.md +4 -4
- package/dist/docs/references/reference-client-js-observability.md +23 -1
- package/dist/docs/references/reference-observability-tracing-advanced-queries.md +47 -58
- package/dist/index.cjs +32 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -9
- package/dist/index.js.map +1 -1
- package/dist/resources/agent.d.ts +16 -9
- package/dist/resources/agent.d.ts.map +1 -1
- package/dist/resources/observability.d.ts +5 -1
- package/dist/resources/observability.d.ts.map +1 -1
- package/dist/route-types.generated.d.ts +235 -211
- package/dist/route-types.generated.d.ts.map +1 -1
- package/dist/types.d.ts +3 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/docs/references/reference-migrations-upgrade-to-v1-client.md +0 -341
package/dist/index.js
CHANGED
|
@@ -3224,20 +3224,27 @@ var Agent = class extends BaseResource {
|
|
|
3224
3224
|
* Use this to resume receiving events after a disconnection.
|
|
3225
3225
|
*
|
|
3226
3226
|
* @param params.runId - The run ID to observe
|
|
3227
|
-
* @param params.offset -
|
|
3227
|
+
* @param params.offset - Run-log position to resume from. Chunks from `observe()`, and from `stream()` on
|
|
3228
|
+
* durable and evented agents, carry an `index`; pass the `index + 1` of the last chunk that has one. Chunks without an `index`
|
|
3229
|
+
* (`abort` and structured-output `object` chunks) are skipped when choosing the offset. If omitted,
|
|
3230
|
+
* replays the chunks still cached for the run, or only live chunks if the server's transport can't replay.
|
|
3228
3231
|
* @returns Promise containing a streaming Response
|
|
3229
3232
|
*
|
|
3230
3233
|
* @example
|
|
3231
3234
|
* ```typescript
|
|
3232
|
-
*
|
|
3233
|
-
*
|
|
3234
|
-
*
|
|
3235
|
-
*
|
|
3236
|
-
*
|
|
3235
|
+
* const agent = client.getAgent('my-agent');
|
|
3236
|
+
* let offset = 0;
|
|
3237
|
+
* const trackOffset = async (chunk: { index?: number }) => {
|
|
3238
|
+
* if (chunk.index === undefined) return;
|
|
3239
|
+
* offset = chunk.index + 1;
|
|
3240
|
+
* };
|
|
3237
3241
|
*
|
|
3238
|
-
* await
|
|
3239
|
-
*
|
|
3240
|
-
*
|
|
3242
|
+
* const stream = await agent.stream(messages, { runId: 'run-123' });
|
|
3243
|
+
* await stream.processDataStream({ onChunk: trackOffset });
|
|
3244
|
+
*
|
|
3245
|
+
* // After a dropped connection, resume where the last indexed chunk left off
|
|
3246
|
+
* const response = await agent.observe({ runId: 'run-123', offset });
|
|
3247
|
+
* await response.processDataStream({ onChunk: trackOffset });
|
|
3241
3248
|
* ```
|
|
3242
3249
|
*/
|
|
3243
3250
|
async observe(params) {
|
|
@@ -5641,6 +5648,10 @@ var Observability = class extends BaseResource {
|
|
|
5641
5648
|
]);
|
|
5642
5649
|
return this.request(`/observability/logs${queryString ? `?${queryString}` : ""}`);
|
|
5643
5650
|
}
|
|
5651
|
+
/** Retrieves one score by ID; the response contains null when it is missing. */
|
|
5652
|
+
getScore(id) {
|
|
5653
|
+
return this.request(`/observability/scores/${encodeURIComponent(id)}`);
|
|
5654
|
+
}
|
|
5644
5655
|
/**
|
|
5645
5656
|
* Retrieves a paginated list of scores with optional filtering and sorting.
|
|
5646
5657
|
*/
|
|
@@ -5714,6 +5725,10 @@ var Observability = class extends BaseResource {
|
|
|
5714
5725
|
body: params
|
|
5715
5726
|
});
|
|
5716
5727
|
}
|
|
5728
|
+
/** Retrieves one feedback by ID; the response contains null when it is missing. */
|
|
5729
|
+
getFeedback(id) {
|
|
5730
|
+
return this.request(`/observability/feedback/${encodeURIComponent(id)}`);
|
|
5731
|
+
}
|
|
5717
5732
|
/**
|
|
5718
5733
|
* Retrieves a paginated list of feedback with optional filtering and sorting.
|
|
5719
5734
|
*/
|
|
@@ -8501,6 +8516,10 @@ var MastraClient = class extends BaseResource {
|
|
|
8501
8516
|
listLogsVNext(params = {}) {
|
|
8502
8517
|
return this.observability.listLogs(params);
|
|
8503
8518
|
}
|
|
8519
|
+
/** Retrieves one score by ID; the response contains null when it is missing. */
|
|
8520
|
+
getScore(id) {
|
|
8521
|
+
return this.observability.getScore(id);
|
|
8522
|
+
}
|
|
8504
8523
|
/** Retrieves a paginated list of observability scores. */
|
|
8505
8524
|
listScores(params = {}) {
|
|
8506
8525
|
return this.observability.listScores(params);
|
|
@@ -8529,6 +8548,10 @@ var MastraClient = class extends BaseResource {
|
|
|
8529
8548
|
getScorePercentiles(params) {
|
|
8530
8549
|
return this.observability.getScorePercentiles(params);
|
|
8531
8550
|
}
|
|
8551
|
+
/** Retrieves one feedback by ID; the response contains null when it is missing. */
|
|
8552
|
+
getFeedback(id) {
|
|
8553
|
+
return this.observability.getFeedback(id);
|
|
8554
|
+
}
|
|
8532
8555
|
/** Retrieves a paginated list of feedback records. */
|
|
8533
8556
|
listFeedback(params = {}) {
|
|
8534
8557
|
return this.observability.listFeedback(params);
|